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
Initialise the color editor used to change the main color
function initColorEditor() { const keyword = "coloroverride" const keyhistory = [] document.addEventListener("keyup", evt => { keyhistory.push(evt.key.toLowerCase()) // See if the user entered the secret keyword let valid = true for(let i = keyword.length; i > 0; i--) { if(keyhistory[keyhistory.length - i] !== keyword[keyword.length - i]) { valid = false } } if(valid) { alert("Color override editor is now shown in the top right") document.querySelector(".color-editor").classList.remove("hidden") } }); // Get the color picker const wrapper = document.querySelector(".color-editor") // Method to convert hex string (from input's value) to rgb array function hexToRgb(hex) { const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? [ parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16) ] : null; } wrapper.querySelector("input").addEventListener("input", evt => { const rgb = hexToRgb(evt.currentTarget.value) wrapper.querySelector("p").innerText = rgb.join(', ') if(rgb) setBackgroundColor(rgb) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initialize () {\n // Dynamically set default color value and preview.\n var palette = Array.prototype.slice.apply(document.querySelectorAll('.custom-color'));\n\n palette.forEach(function(customOption) {\n var color = colors[$(customOption).data('target')],\n defaultColor = $(customOption).data('value'),\n appliedColor = defaultColor ? '#' + defaultColor : color;\n\n // Reset default color to already saved color\n colors[$(customOption).data('target')] = appliedColor;\n\n $(customOption).val(defaultColor || color.substr(1));\n $(customOption).siblings('.color-preview').css('background-color', appliedColor);\n });\n\n clonedColors = colors;\n }", "function initColorWindow() {\n $(\"colorArea\").hide();\n $(\"colorArea\").hidden = false;\n $(\"colorBtn\").observe(\"click\", function (event) {\n if (isColorBarOpened == false) {\n // set the location of the emotion window\n var total = $(\"colorBtn\").offsetTop - parseInt($(\"colorArea\").getStyle(\"height\"));\n $(\"colorArea\").style.top = total + \"px\";\n $(\"colorArea\").style.left = $(\"colorBtn\").offsetLeft + \"px\";\n // show the emotion window\n $(\"colorArea\").slideDown({\n duration: 0.4\n });\n isColorBarOpened = true;\n } else {\n // press again to close the emotion window\n // and set the color of the text\n $(\"colorArea\").slideUp({\n duration: 0.4\n });\n isColorBarOpened = false;\n $(\"editwindow\").contentDocument.execCommand(\n \"ForeColor\", false, $$(\"#colorArea .color\")[0].value);\n $(\"editwindow\").focus();\n }\n });\n}", "function editor_tools_handle_color()\n{\n editor_tools_store_range();\n\n // Display the color picker.\n var img_obj = document.getElementById('editor-tools-img-color');\n showColorPicker(img_obj);\n return;\n}", "_initTheme() {\n if (\n GLOBAL_LOCALIZED?.editor?.backgroundColor &&\n GLOBAL_LOCALIZED.editor.backgroundColor != null\n ) {\n document.documentElement.style.setProperty(\n '--abt-background-editor',\n GLOBAL_LOCALIZED.editor.backgroundColor,\n );\n }\n }", "function init()\n{\n\tdebug('init');\n\t//make_color_coll();\n\tmake_color_defs_for_Littlefoot();\n}", "function initEditor() {\n renderWorkingLine();\n renderTextInput();\n renderFontColorPicker();\n renderFontSize();\n toggleStrokeBtn();\n renderStrokeColorPicker();\n renderStrokeSize();\n renderStickers();\n}", "function initializeColorPicker() {\n if (global.params.selectedColor === undefined) {\n global.params.selectedColor = DefaultColor;\n }\n const colorPicker = new ColorPicker(new Color(global.params.selectedColor));\n main.append(colorPicker);\n const width = colorPicker.offsetWidth;\n const height = colorPicker.offsetHeight;\n resizeWindow(width, height);\n}", "function init() {\n self.messageText = \"\";\n self.currentColor = self.colors[randomNumber(0, self.colors.length - 1)];\n self.colorPrompt = 'Can you find the ' + self.currentColor.name + ' block?'\n}", "function palette_init() {\n /* ini colorpicker */\n \n var _head = $('head');\n var _body= $('body');\n var _colorPrimary = $('#color-primary');\n var _colorSecondary = $('#color-secondary');\n var _colorBackground = $('#color-background');\n var _colorBackground = $('#color-background');\n var _colorTitles = $('#color-titles');\n var _colorSubTitles = $('#color-subtitles');\n var _colorTitlesPrimary = $('#color-titles-primary');\n var _colorTitlesSecondary = $('#color-titles-secondary');\n var _colorContent = $('#color-content');\n var _colorPrimary_class = $('.color-primary');\n var _bColorPrimary_class = $('.border-color-primary');\n var _ColorTopBarBg = $('#color-top-bar-bg');\n var _colorPrimaryBtn = $('#color-primary-btn');\n var _colorPrimaryBtnhover= $('#color-primary-btnhover');\n var _ColorTopBarBg = $('#color-top-bar-bg');\n \n _colorPrimary.colorpicker();\n if (_colorPrimary_class.css('background-color')) {\n _colorPrimary.colorpicker('setValue', _colorPrimary_class.css('background-color'));\n } else {\n _colorPrimary.colorpicker('setValue', '#da3743');\n }\n\n _colorSecondary.colorpicker();\n if ($('.color-secondary').css('background-color')) {\n _colorSecondary.colorpicker('setValue', $('.color-secondary').css('background-color'));\n } else {\n _colorSecondary.colorpicker('setValue', 'rgb(0,137,195)');\n }\n\n _colorBackground.colorpicker();\n _colorBackground.colorpicker('setValue', '#F8F8F8');\n \n _colorTitles.colorpicker();\n _colorTitles.colorpicker('setValue', '#252525');\n _colorSubTitles.colorpicker();\n _colorSubTitles.colorpicker('setValue', '#7b7b7b');\n _colorTitlesPrimary.colorpicker();\n _colorTitlesPrimary.colorpicker('setValue', '#4285f4');\n _colorTitlesSecondary.colorpicker();\n _colorTitlesSecondary.colorpicker('setValue', '#252525');\n _colorContent.colorpicker();\n _colorContent.colorpicker('setValue', '#353535');\n _ColorTopBarBg.colorpicker();\n _ColorTopBarBg.colorpicker('setValue', '#DA3743');\n \n _colorPrimaryBtn.colorpicker();\n _colorPrimaryBtn.colorpicker('setValue', '#DA3743');\n _colorPrimaryBtnhover.colorpicker();\n _colorPrimaryBtnhover.colorpicker('setValue', '#C5434D');\n \n /* end ini colorpicker */\n\n // close and open palette panel\n $('.custom-palette-btn').on('click', function () {\n $('.custom-palette').toggleClass('palette-closed');\n })\n\n // change primary color\n _colorPrimary.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n\n _colorPrimary_class.css('cssText', 'background-color: ' + color + ' !important');\n _bColorPrimary_class.css('cssText', 'border-color: ' + color + ' !important');\n $('.text-color-primary').css('cssText', 'color: ' + color + ' !important');\n\n var style = '';\n style += ' .btn-custom-secondary, .owl-dots-local .owl-theme .owl-dots .owl-dot:hover span,\\n\\\n .affix-menu.affix.top-bar .default-menu .dropdown-menu>li.dropdown-submenu:hover > a, .affix-menu.affix.top-bar .default-menu .dropdown-menu>li>a:hover,\\n\\\n .c_purpose-tablet li.active, .c_purpose-tablet li:hover,.infobox-big .title,\\n\\\n .cluster div:after,\\n\\\n .google_marker:before,\\n\\\n .owl-carousel-items.owl-theme .owl-dots .owl-dot.active span,\\n\\\n .owl-carousel-items.owl-theme .owl-dots .owl-dot:hover span,\\n\\\n .hidden-subtitle,\\n\\\n .btn-marker:hover .box,\\n\\\n .affix-menu.affix.top-bar .default-menu .dropdown-menu>li>a:hover, .affix-menu.affix.top-bar .default-menu .dropdown-menu>li.active>a, .affix-menu.affix.top-bar .default-menu .dropdown-menu>li.dropdown.dropdown-submenu:hover > a,\\n\\\n .owl-nav-local .owl-theme .owl-nav [class*=\"owl-\"]:hover,\\n\\\n .color-mask:after,\\n\\\n .owl-dots-local .owl-theme .owl-dots .owl-dot.active span{\\n\\\n background-color: ' + color + ';\\n\\\n }';\n \n style += ' @media (min-width: 768px){.top-bar.t-overflow:not(.affix) .default-menu .dropdown-menu>li>a:hover{\\n\\\n color: ' + color + ' !important;\\n\\\n }}';\n\n style += '.caption .date i,\\n\\\n .invoice-intro.invoice-logo a,\\n\\\n .commten-box .title a:hover,\\n\\\n .commten-box .action a:hover,\\n\\\n .author-card .name_surname a:hover,\\n\\\n p.note:before,\\n\\\n .location-box .location-box-content .title a:hover,\\n\\\n .list-navigation li.return a,\\n\\\n .filters .picker .pc-select .pc-list li:hover,\\n\\\n .mark-c,\\n\\\n .pagination>li a:hover, .pagination>.active>a, .pagination>.active>a:focus, .pagination>.active>a:hover, .pagination>.active>span, .pagination>.active>span:focus, .pagination>.active>span:hover,\\n\\\n .infobox .content .title a:hover,\\n\\\n .thumbnail.thumbnail-type .caption .title a:hover,\\n\\\n .thumbnail.thumbnail-video .thumbnail-title a:hover,\\n\\\n .card.card-category:hover .badget.b-icon i,\\n\\\n .btn-marker:hover .title,\\n\\\n .btn-marker .box,\\n\\\n .thumbnail.thumbnail-property .thumbnail-title a:hover,\\n\\\n .rating-action,\\n\\\n .bootstrap-select .dropdown-menu > li > a:hover .glyphicon,\\n\\\n .grid-tile a:hover .title,\\n\\\n .grid-tile .preview i,\\n\\\n .lang-manu:hover .caret, \\n\\\n .lang-manu .dropdown-menu > li > a:hover, \\n\\\n .lang-manu.open .caret, \\n\\\n .top-bar .nav-items li.open>a >span, .top-bar .nav-items li> a:hover >span,\\n\\\n .top-bar.t-overflow:not(.affix) .default-menu .dropdown-menu > li.active > a, .top-bar.t-overflow:not(.affix) .default-menu .dropdown-menu > li.active > a,\\n\\\n .top-bar.t-overflow:not(.affix) .default-menu .dropdown-menu>li.active>a:hover,\\n\\\n .top-bar.t-overflow:not(.affix) .default-menu .dropdown-menu>li>a:hover,\\n\\\n body:not(.navigation-open) .top-bar.t-overflow:not(.affix) .default-menu .dropdown-menu > li.dropdown.dropdown-submenu.open > a, body:not(.navigation-open) .top-bar.t-overflow:not(.affix) .default-menu .dropdown-menu > li.dropdown.dropdown-submenu:hover > a,\\n\\\n .scale-range .nonlinear-val,.top-bar .logo a, \\n\\\n .default-menu .dropdown-menu>li.active>a, .default-menu .dropdown-menu>li>a:hover \\n\\\n {\\n\\\n color: ' + color + ';\\n\\\n }';\n\n style += ' .custom_infowindow .gm-style-iw + div,.pagination>li a:hover, .pagination>.active>a, .pagination>.active>a:focus, .pagination>.active>a:hover, .pagination>.active>span, .pagination>.active>span:focus, .pagination>.active>span:hover,\\n\\\n .infoBox > img, \\n\\\n .infobox-big, \\n\\\n .infobox:before,\\n\\\n .infobox-big:before,\\n\\\n .infobox{\\n\\\n border-color: ' + color + ';\\n\\\n }';\n \n style += '.top-bar.t-overflow:not(.affix) .default-menu .dropdown-menu > li.active > a, .top-bar.t-overflow:not(.affix) .default-menu .dropdown-menu > li.active > a, \\n\\\n [class*=\"icon-star-ratings\"]:after{\\n\\\n color: ' + color + ' !important;\\n\\\n }';\n \n \n style += '.primary-color{\\n\\\n background-color: ' + color + ';\\n\\\n }';\n \n style += '.primary-text-color, .primary-link:hover {\\n\\\n color: ' + color + ';\\n\\\n }';\n \n /*\n var geomap = $('#geo-map');\n if (geomap && geomap.length) {\n geomap.geo_map('set_config',{\n 'color_hover': color,\n 'color_active': color\n })\n }\n */\n if ($('#palette-styles-pr').length) {\n _head.find('#palette-styles-pr').html(style);\n } else {\n _head.append('<style id=\"palette-styles-pr\">' + style + '</style>');\n }\n });\n\n // change secondary color\n _colorSecondary.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n var style = '';\n style += ' \\n\\\n .btn-custom-primary {\\n\\\n background: ' + color + ';\\n\\\n }';\n style += ' .top-bar .nav-items > li> a.btn.btn-custom-primary, \\n\\\n .btn-custom-primary \\n\\\n {\\n\\\n border-color: ' + color + ';\\n\\\n }';\n style += ' /*.top-bar .nav-items > li> a.btn.btn-custom-primary:hover\\n\\\n {\\n\\\n color: ' + color + ';\\n\\\n }*/';\n \n if ($('#palette-styles-colorSecondary').length) {\n _head.find('#palette-styles-colorSecondary').html(style);\n } else {\n _head.append('<style id=\"palette-styles-colorSecondary\">' + style + '</style>');\n }\n \n \n $('.color-secondary').css('cssText', 'background-color: ' + color + ' !important');\n $('.border-color-secondary').css('cssText', 'border-color: ' + color + ' !important');\n $('.text-color-secondary').css('cssText', 'color: ' + color + ' !important');\n });\n\n // change _colorTitles color\n _colorPrimaryBtnhover.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n var style = '';\n style += ' \\n\\\n .search-tabs li.active .btn-special-primary:hover,\\n\\\n .btn-special-primary.fill:hover,\\n\\\n .btn-custom-secondary:hover {\\n\\\n background: ' + color + ';\\n\\\n }';\n style += ' .search-tabs li.active .btn-special-primary:hove, .btn-special-primary.fill:hover \\n\\\n {\\n\\\n border-color: ' + color + ';\\n\\\n }';\n \n if ($('#palette-styles-colorPrBtnhover').length) {\n _head.find('#palette-styles-colorPrBtnhover').html(style);\n } else {\n _head.append('<style id=\"palette-styles-colorPrBtnhover\">' + style + '</style>');\n }\n });\n \n // change _colorTitles color\n _colorPrimaryBtn.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n var style = '';\n style += ' .btn-special-primary:hover,.search-tabs li.active .btn-special-primary, .search-tabs li.active .btn-special-primary:hover, .btn-special-primary.fill {\\n\\\n background: ' + color + ';\\n\\\n }';\n \n style += ' .btn-special-primary \\n\\\n {\\n\\\n color: ' + color + ';\\n\\\n }';\n \n style += ' .btn-special-primary:hover,.search-tabs li.active .btn-special-primary,.search-tabs li.active .btn-special-primary:hover, .btn-special-primary.fill, .btn-special-primary \\n\\\n {\\n\\\n border-color: ' + color + ';\\n\\\n }';\n \n if ($('#palette-styles-colorPrBtn').length) {\n _head.find('#palette-styles-colorPrBtn').html(style);\n } else {\n _head.append('<style id=\"palette-styles-colorPrBtn\">' + style + '</style>');\n }\n });\n \n // change _colorTitles color\n _colorTitles.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n var style = '';\n style += ' .post-comments .post-comments-title,.reply-box .reply-title,.post-header .post-title .title,.widget-listing-title .options .options-body .title,\\n\\\n .widget-styles .caption-title h2, .widget-styles .caption-title, .widget .widget-title, .widget-styles .header h2, .widget-styles .header,\\n\\\n .header .title-location .location,.user-card .body .name,.section-title .title {\\n\\\n color: ' + color + ';\\n\\\n }';\n if ($('#palette-styles-colorTitles').length) {\n _head.find('#palette-styles-colorTitles').html(style);\n } else {\n _head.append('<style id=\"palette-styles-colorTitles\">' + style + '</style>');\n }\n });\n \n // change _colorTitles color\n _ColorTopBarBg.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n var style = '';\n style += ' .top-bar.top-bar-color {\\n\\\n background: ' + color + ';\\n\\\n }';\n \n if ($('#palette-styles-colortopBar').length) {\n _head.find('#palette-styles-colortopBar').html(style);\n } else {\n _head.append('<style id=\"palette-styles-colortopBar\">' + style + '</style>');\n }\n });\n\n // change _colorSubTitles color\n _colorSubTitles.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n var style = '';\n style += ' .thumbnail.thumbnail-video .type,.caption .date,.thumbnail.thumbnail-property-list .header .right .address,.thumbnail.thumbnail-property .type,\\n\\\n .post-header .post-title .subtitle,.header .title-location .count,.section-title .subtitle {\\n\\\n color: ' + color + ';\\n\\\n }';\n if ($('#palette-styles-colorSubTitles').length) {\n _head.find('#palette-styles-colorSubTitles').html(style);\n } else {\n _head.append('<style id=\"palette-styles-colorSubTitles\">' + style + '</style>');\n }\n });\n\n // change colorTitlesPrimary color\n _colorTitlesPrimary.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n var style = '';\n style += ' .post-social .hash-tags a,.user-card .body .contact .link,.thumbnail.thumbnail-property .thumbnail-title a {\\n\\\n color: ' + color + ';\\n\\\n }';\n if ($('#palette-styles-colorTitlesPrimary').length) {\n _head.find('#palette-styles-colorTitlesPrimary').html(style);\n } else {\n _head.append('<style id=\"palette-styles-colorTitlesPrimary\">' + style + '</style>');\n }\n });\n\n // change _colorTitlesSecondary color\n _colorTitlesSecondary.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n var style = '';\n style += ' .caption.caption-blog .thumbnail-title a,.list-category-item .title, .list-category-item .title a,.grid-tile .title,.btn-marker .title,.commten-box .title a,\\n\\\n .thumbnail.thumbnail-type .caption .title, .thumbnail.thumbnail-type .caption .title a, .author-card .name_surname a {\\n\\\n color: ' + color + ';\\n\\\n }';\n if ($('#palette-styles-colorTitlesSecondary').length) {\n _head.find('#palette-styles-colorTitlesSecondary').html(style);\n } else {\n _head.append('<style id=\"palette-styles-colorTitlesSecondary\">' + style + '</style>');\n }\n });\n\n // change _colorContent color\n _colorContent.colorpicker().on('changeColor.colorpicker', function (event) {\n var color = event.color.toString();\n var style = '';\n style += ' .thumbnail .caption,.thumbnail.thumbnail-type .caption .description,.author-card .author-body, \\n\\\n body,.author-card .author-body,.post-body,.thumbnail.thumbnail-type .caption .description {\\n\\\n color: ' + color + ';\\n\\\n }';\n if ($('#palette-styles-colorContent').length) {\n _head.find('#palette-styles-colorContent').html(style);\n } else {\n _head.append('<style id=\"palette-styles-colorContent\">' + style + '</style>');\n }\n });\n \n // change font-family color\n $('#font-family select').on('change', function (e) {\n var style = '';\n style += ' body {\\n\\\n font-family: \"' + $(this).val() + '\";\\n\\\n }';\n if ($('#palette-styles-font-family').length) {\n _head.find('#palette-styles-font-family').html(style);\n } else {\n _head.append('<style id=\"palette-styles-font-family\">' + style + '</style>');\n }\n });\n \n //font-size\n $('#font-size select').on('change', function (e) {\n var c = 0;\n switch ($(this).val()) {\n case '+1': c = 2;\n break;\n case '+2': c = 4;\n break;\n case '+3': c = 5;\n break;\n case '-1': c = -2;\n break;\n case '-2': c = -2;\n break;\n case '-3': c = -3;\n break;\n\n default:\n break;\n }\n var style = '';\n \n style += ' .owl-slider-content .item .title {\\n\\\n font-size: ' + (40+c) + 'px;\\n\\\n }';\n \n style += ' .widget-geomap .geomap-title,.h-area .title {\\n\\\n font-size: ' + (36+c) + 'px;\\n\\\n }';\n \n style += ' .widget-listing-title .options .options-body .title,.section-title .title {\\n\\\n font-size: ' + (32+c) + 'px;\\n\\\n }';\n \n style += ' .footer .logo a,.top-bar .logo a {\\n\\\n font-size: ' + (30+c) + 'px;\\n\\\n }';\n \n style += ' .h3, h3 {\\n\\\n font-size: ' + (24+c) + 'px;\\n\\\n }';\n \n style += ' .section-profile-box .content .title,.section.widget-recentproperties .header .title-location .location,.section-title.slim .title,.caption.caption-blog .thumbnail-title a {\\n\\\n font-size: ' + (20+c) + 'px;\\n\\\n }';\n \n style += ' .agent-box .title a, .thumbnail.thumbnail-offers .thumbnail-title a, .card.card-pricing .title, .list-category-item .title, .list-category-item .title a, .thumbnail.thumbnail-type .caption .title, .thumbnail.thumbnail-type .caption .title a, .owl-slider-content .item .subtitle, .thumbnail.thumbnail-property .thumbnail-title a, .thumbnail.thumbnail-type .caption .title, .thumbnail.thumbnail-type .caption .title a, .owl-slider-content .item .subtitle, .thumbnail.thumbnail-property .thumbnail-title a,\\n\\\n .thumbnail.thumbnail-offers .thumbnail-title a, .card.card-pricing .title, .list-category-item .title, .list-category-item .title a,\\n\\\n .thumbnail.thumbnail-type .caption .title, .thumbnail.thumbnail-type .caption .title a, .owl-slider-content .item .subtitle, .thumbnail.thumbnail-property .thumbnail-title a,\\n\\\n .thumbnail.thumbnail-type .caption .title, .thumbnail.thumbnail-type .caption .title a, .owl-slider-content .item .subtitle, .thumbnail.thumbnail-property .thumbnail-title a {\\n\\\n font-size: ' + (18+c) + 'px;\\n\\\n }';\n \n style += ' .section-profile-box .content .options,.grid-tile .title,.h-area .subtitle,.f-box .title,.user-card .body .name,.section-title .subtitle {\\n\\\n font-size: ' + (16+c) + 'px;\\n\\\n }';\n \n style += ' .btn-custom,.header .title-location .location,.thumbnail.thumbnail-property-list .header .right .address {\\n\\\n font-size: ' + (15+c) + 'px;\\n\\\n }';\n \n style += ' .list-navigation li,.btn,body,.top-bar .nav-items li {\\n\\\n font-size: ' + (14+c) + 'px;\\n\\\n }';\n \n style += ' .card.card-pricing .price-box .notice,.list-suggestions li,.thumbnail.thumbnail-property-list .list-comment p,.thumbnail.thumbnail-type .caption .description,.thumbnail.thumbnail-video .type,\\n\\\n .section-search-area .tags ul li,.f-box .list-f a,.caption .date,.btn-marker .title,.thumbnail.thumbnail-property .typ {\\n\\\n font-size: ' + (13+c) + 'px;\\n\\\n }';\n \n if ($('#palette-styles-font-size').length) {\n _head.find('#palette-styles-font-size').html(style);\n } else {\n _head.append('<style id=\"palette-styles-font-size\">' + style + '</style>');\n }\n });\n\n // chose prepared color\n $('#palette-colors-prepared a').on('click', function (e) {\n e.preventDefault();\n var backgroundtopbar = '';\n backgroundtopbar = $(this).closest('li').attr('data-backgroundtopbar');\n if (backgroundtopbar)\n _ColorTopBarBg.colorpicker('setValue', backgroundtopbar);\n \n var primary = '';\n primary = $(this).closest('li').attr('data-primary-color');\n if (primary)\n _colorPrimary.colorpicker('setValue', primary);\n\n var secondary = '';\n secondary = $(this).closest('li').attr('data-secondary-color');\n if (secondary)\n _colorSecondary.colorpicker('setValue', secondary);\n \n var btnprimary = '';\n btnprimary = $(this).closest('li').attr('data-btnprimary');\n if (btnprimary)\n _colorPrimaryBtn.colorpicker('setValue', btnprimary);\n\n var btnprimaryhover = '';\n btnprimaryhover = $(this).closest('li').attr('data-btnprimaryhover');\n if (btnprimaryhover)\n _colorPrimaryBtnhover.colorpicker('setValue', btnprimaryhover);\n\n var titlescolor = '';\n titlescolor = $(this).closest('li').attr('data-titlescolor');\n if (titlescolor)\n _colorTitles.colorpicker('setValue', titlescolor);\n\n var subtitlescolor = '';\n subtitlescolor = $(this).closest('li').attr('data-subtitlescolor');\n if (subtitlescolor)\n _colorSubTitles.colorpicker('setValue', subtitlescolor);\n\n var titlesprimary = '';\n titlesprimary = $(this).closest('li').attr('data-titlesprimary');\n if (titlesprimary)\n _colorTitlesPrimary.colorpicker('setValue', titlesprimary);\n\n var titlesecondary = '';\n titlesecondary = $(this).closest('li').attr('data-titlesecondary');\n if (titlesecondary)\n _colorTitlesSecondary.colorpicker('setValue', titlesecondary);\n\n var contentcolor = '';\n contentcolor = $(this).closest('li').attr('data-contentcolor');\n if (contentcolor)\n _colorContent.colorpicker('setValue', contentcolor);\n })\n\n // change background color\n _colorBackground.colorpicker().on('changeColor.colorpicker', function (event) {\n _body.removeClass('bg-image');\n var color = event.color.toString();\n _body.css('background', color);\n });\n\n // choose preperad bg-color boxed\n $('#palette-backgroundimage-prepared a').on('click', function (e) {\n e.preventDefault();\n var bg;\n var style;\n bg = $(this).closest('li').attr('data-backgroundimage') || '';\n style = $(this).closest('li').attr('data-backgroundimage-style') || '';\n\n $('#palette-backgroundimage-prepared a').removeClass('active');\n $(this).addClass('active');\n _body.addClass('bg-image');\n\n if (bg && style) {\n if (style == 'fixed') {\n _body.css('background', 'url(' + bg + ') no-repeat fixed');\n _body.css('background-size', 'cover');\n } else if (style == 'repeat') {\n _body.css('background', 'url(' + bg + ') repeat');\n _body.css('background-size', 'inherit');\n } else {\n _body.css('background', 'url(' + bg + ') no-repeat fixed');\n }\n } else if (bg) {\n _body.css('background', 'url(' + bg + ') no-repeat fixed');\n }\n })\n\n //type-site (full-width, wide)\n $('.custom-palette-box input[name=\"type-site\"]').on('change',function (e) {\n e.preventDefault();\n _body.removeClass('full-width')\n .removeClass('boxed');\n _body.addClass($('.custom-palette-box input[name=\"type-site\"]:checked').val());\n\n var _m = $('.widget-topmap');\n if ($(window).width() > 768 ){\n var _w;\n if($('body').hasClass('boxed')){\n _w = $('main.container .row-fluid .right-b.box').outerWidth();\n } else {\n _w = $('main.container .row-fluid .right-b.box').outerWidth()+(($(window).width() - $('main.container').outerWidth())/2)+15;\n }\n\n if(_w)\n _m.find('.flex .flex-right').attr('style','width: '+_w+'px;min-width:'+_w+'px');\n } else {\n _m.find('.flex .flex-right').attr('style','');\n }\n \n $(window).trigger('resize')\n })\n \n // top-bar type\n if($('.top-bar.top-bar-color').length) {\n $('.custom-palette-box #topbar-version select').val('color');\n $('.custom-palette-box #topbar-version select').selectpicker('refresh');\n $('#color-top-bar-bg').closest('.custom-palette-color').removeClass('hidden')\n }\n var defaultTopbarBg_classes ='';\n if($('.top-bar').length) {\n var defaultTopbarBg_classes = $('.top-bar').attr('class');\n }\n \n $('.custom-palette-box #topbar-version select').on('change', function (e) {\n $(this).val();\n \n switch ($(this).val()) {\n case 'white': $('.top-bar').removeClass('t-overflow')\n .removeClass('overflow')\n .removeClass('top-bar-white')\n .removeClass('top-bar-white')\n .removeClass('top-bar-color');\n $('#color-top-bar-bg').closest('.custom-palette-color').addClass('hidden')\n \n break;\n case 'color': $('.top-bar').removeClass('t-overflow')\n .removeClass('overflow')\n .addClass('top-bar-white')\n .addClass('top-bar-color');\n $('#color-top-bar-bg').closest('.custom-palette-color').removeClass('hidden')\n break;\n default:\n $('.top-bar').attr('class', defaultTopbarBg_classes);\n $('#color-top-bar-bg').closest('.custom-palette-color').addClass('hidden')\n break;\n }\n \n $(window).trigger('resize');\n })\n\n //reset \n $('#pallete-reset').on('click', function (e) {\n e.preventDefault();\n \n _body.attr('class', '');\n var type = $('input[name=\"type-site\"]').last().val();\n _body.attr('class', type);\n\n _body.attr('style', '');\n $('#custom_scheme').remove();\n _colorPrimary.colorpicker('setValue', '#da3743');\n _colorSecondary.colorpicker('setValue', 'rgb(0,137,195)');\n _colorBackground.colorpicker('setValue', '#F8F8F8');\n _colorTitles.colorpicker('setValue', '#252525');\n _colorSubTitles.colorpicker('setValue', '#7b7b7b');\n _colorTitlesPrimary.colorpicker('setValue', '#4285f4');\n _colorTitlesSecondary.colorpicker('setValue', '#252525');\n _colorContent.colorpicker('setValue', '#353535');\n _colorPrimaryBtn.colorpicker('setValue', '#DA3743');\n _colorPrimaryBtnhover.colorpicker('setValue', '#C5434D');\n \n $('#palette-backgroundimage-prepared a').removeClass('active');\n\n $('.custom-palette-box input[name=\"type-site\"]').removeAttr('checked')\n $('.custom-palette-box input[name=\"type-site\"][value=\"\"]').attr('checked', 'checked');\n\n _body.css('background', 'white')\n .css('background-size', 'cover');\n \n $('#palette-styles-font-size,#palette-styles-font-size, #palette-styles-font-family,#palette-styles-colorContent,#palette-styles-colorTitlesSecondary,palette-styles-colorTitlesPrimary, #palette-styles-colorSubTitles, #palette-styles-colorTitles').remove()\n \n $('.top-bar').attr('class', defaultTopbarBg_classes);\n\n })\n \n \n if($('#palette-colors-prepared a.active').length) {\n $('#palette-colors-prepared a.active').trigger('click');\n }\n\n /* End Palette */\n\n \n}", "init() {\n // Get saved editor settings if any or default values from SettingsHandler\n const initialLanguage = settingsHandler.getEditorLanguageMode();\n const initialContent = settingsHandler.getEditorContent();\n\n this.engine.setTheme('ace/theme/monokai');\n this.engine.$blockScrolling = Infinity;\n this.engine.setShowPrintMargin(false);\n // Define the language mode for syntax highlighting and editor content\n this.engine.getSession().setMode({path:'ace/mode/' + initialLanguage, inline:true});\n this.engine.setValue(initialContent);\n\n this.initEventListners();\n }", "constructor (...args) {\n super(...args);\n\n // Set the color property from editor value\n this.color = toCSS(this.node.value);\n }", "function initColorPicker() {\n\n\t\t\tif ($.fn.mColorPicker.init.replace == '[type=color]') {\n\n\t\t\t\t$('input').filter(function(index) {\n\t\t\t\t\treturn this.getAttribute(\"type\") == 'color';\n\t\t\t\t\t}).mColorPicker();\n\n\t\t\t\t\t$(document).bind('ajaxSuccess', function () {\n\n\t\t\t\t\t\t$('input').filter(function(index) {\n\n\t\t\t\t\t\t\treturn this.getAttribute(\"type\") == 'color';\n\t\t\t\t\t\t\t}).mColorPicker();\n\t\t\t\t\t\t});\n\n\t\t\t\t\t} else if ($.fn.mColorPicker.init.replace) {\n\n\t\t\t\t\t\t$('input' + $.fn.mColorPicker.init.replace).mColorPicker();\n\n\t\t\t\t\t\t$(document).bind('ajaxSuccess', function () {\n\n\t\t\t\t\t\t\t$('input' + $.fn.mColorPicker.init.replace).mColorPicker();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\t// init the listener on color change...\n\t\t\t\t\t$('#color1').bind(\"colorpicked\",function(){\n\n\t\t\t\t\t\tstats.color = $(this)[0].value\n\n\t\t\t\t\t\tvar children = d3.select(\".stats.filters\").node().childNodes;\n\n\t\t\t\t\t\tfor (var i=0; i < children.length; i++) {\n\t\t\t\t\t\t\tvar f = $(children[i]).data().filter;\n\n\t\t\t\t\t\t\tf.color = stats.color;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t})\n\n\t\t\t\t}", "function init() {\n rootEditorElement = document.createElement('div');\n rootEditorElement.innerHTML = `\n <div class=\"slds-color-picker\">\n <div class=\"slds-form-element slds-color-picker__summary\">\n <div class=\"slds-form-element__control\">\n <button class=\"slds-button slds-color-picker__summary-button slds-button_icon slds-button_icon-more\" title=\"Choose Color\">\n <span class=\"slds-swatch\" style=\"background:hsl(0, 0%, 0%)\">\n <span class=\"slds-assistive-text\">hsl(0, 0%, 0%)</span>\n </span>\n <svg class=\"slds-button__icon slds-button__icon_small slds-m-left_xx-small\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" >\n <path d=\"M3.8 6.5h16.4c.4 0 .8.6.4 1l-8 9.8c-.3.3-.9.3-1.2 0l-8-9.8c-.4-.4-.1-1 .4-1z\"></path>\n </svg>\n <span class=\"slds-assistive-text\">Choose a color. Current color: #000000</span>\n</button>\n <div class=\"slds-color-picker__summary-input\">\n <input type=\"text\" id=\"color-picker-summary-input\" class=\"slds-input\" value=\"#000000\" />\n </div>\n </div>\n</div>\n <section aria-describedby=\"dialog-body-id-9\" aria-label=\"Choose a color\" class=\"slds-popover slds-color-picker__selector slds-hide\" role=\"dialog\">\n <div class=\"slds-popover__body\" id=\"dialog-body-id-9\">\n <div class=\"slds-tabs_default\">\n <ul class=\"slds-tabs_default__nav\" role=\"tablist\">\n <li class=\"slds-tabs_default__item colorpicker-default-tab slds-is-active\" title=\"Default\" role=\"presentation\">\n <a class=\"slds-tabs_default__link\" href=\"javascript:void(0);\" role=\"tab\" tabindex=\"0\" aria-selected=\"true\" aria-controls=\"color-picker-default\" id=\"color-picker-default__item\">Default</a>\n </li>\n <li class=\"slds-tabs_default__item colorpicker-custom-tab\" title=\"Custom\" role=\"presentation\">\n <a class=\"slds-tabs_default__link\" href=\"javascript:void(0);\" role=\"tab\" tabindex=\"-1\" aria-selected=\"false\" aria-controls=\"color-picker-custom\" id=\"color-picker-custom__item\">Custom</a>\n </li>\n </ul>\n <div id=\"color-picker-default\" class=\"slds-tabs_default__content slds-show\" role=\"tabpanel\" aria-labelledby=\"color-picker-default__item\">\n <ul class=\"slds-color-picker__swatches\" role=\"listbox\">\n ${generateColorsHTML(variables.brandColors)}\n </ul>\n </div>\n <div id=\"color-picker-custom\" class=\"slds-tabs_default__content slds-hide\" role=\"tabpanel\" aria-labelledby=\"color-picker-custom__item\">\n <div class=\"slds-color-picker__custom\">\n <p id=\"color-picker-instructions\" class=\"slds-assistive-text\">Use arrow keys to select a saturation and brightness, on an x and y axis.</p>\n <div class=\"slds-color-picker__custom-range\" style=\"background:hsl(220, 100%, 50%)\">\n <a class=\"slds-color-picker__range-indicator\" style=\"bottom:45%;left:46%\" href=\"#\" aria-live=\"assertive\" aria-atomic=\"true\" aria-describedby=\"color-picker-instructions\" draggable=\"true\">\n <span class=\"slds-assistive-text\">Saturation: 46%. Brightness: 45%.</span>\n </a>\n </div>\n <div class=\"slds-color-picker__hue-and-preview\">\n <label class=\"slds-assistive-text\" for=\"color-picker-input-range-9\">Select Hue</label>\n <input type=\"range\" class=\"slds-color-picker__hue-slider\" min=\"0\" max=\"360\" id=\"color-picker-input-range-9\" value=\"208\" />\n <span class=\"slds-swatch\" style=\"background:#000000\">\n <span class=\"slds-assistive-text\" aria-hidden=\"true\">#000000</span>\n </span>\n </div>\n <div class=\"slds-color-picker__custom-inputs\">\n <div class=\"slds-form-element slds-color-picker__input-custom-hex\">\n <label class=\"slds-form-element__label\" for=\"color-picker-input-hex-9\">Hex</label>\n <div class=\"slds-form-element__control\">\n <input type=\"text\" id=\"color-picker-input-hex-9\" disabled=\"true\" class=\"slds-input\" value=\"#000000\" />\n </div>\n </div>\n <div class=\"slds-form-element\">\n <label class=\"slds-form-element__label\" for=\"color-picker-input-r-9\">\n <abbr title=\"Red\">R</abbr>\n </label>\n <div class=\"slds-form-element__control\">\n <input type=\"text\" id=\"color-picker-input-r-9\" disabled=\"true\" class=\"slds-input\" value=\"86\" />\n </div>\n </div>\n <div class=\"slds-form-element\">\n <label class=\"slds-form-element__label\" for=\"color-picker-input-g-9\">\n <abbr title=\"Green\">G</abbr>\n </label>\n <div class=\"slds-form-element__control\">\n <input type=\"text\" id=\"color-picker-input-g-9\" disabled=\"true\" class=\"slds-input\" value=\"121\" />\n </div>\n </div>\n <div class=\"slds-form-element\">\n <label class=\"slds-form-element__label\" disabled=\"true\" for=\"color-picker-input-b-9\">\n <abbr title=\"blue\">B</abbr>\n </label>\n <div class=\"slds-form-element__control\">\n <input type=\"text\" id=\"color-picker-input-b-9\" disabled=\"true\" class=\"slds-input\" value=\"192\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <footer class=\"slds-popover__footer\">\n <div class=\"slds-color-picker__selector-footer\">\n <button class=\"slds-button slds-button_neutral\" id=\"cancel-button\">Cancel</button>\n <button class=\"slds-button slds-button_brand\" id=\"confirm-button\">Done</button>\n </div>\n </footer>\n </section>\n</div >`;\n\n document.body.appendChild(rootEditorElement);\n\n var r = rootEditorElement.querySelector('#color-picker-input-r-9').value;\n var g = rootEditorElement.querySelector('#color-picker-input-g-9').value;\n var b = rootEditorElement.querySelector('#color-picker-input-b-9').value;\n currentHSV = ColorUtils.rgbToHsv({ r, g, b });\n }", "function initJSColor(){\n\tjscolor.installByClassName('jscolor');\n}", "function init_ColorPicker() {\n\n\t\t\tif( typeof ($.fn.colorpicker) === 'undefined'){ return; }\n\t\t\tconsole.log('init_ColorPicker');\n\n\t\t\t\t$('.demo1').colorpicker();\n\t\t\t\t$('.demo2').colorpicker();\n\n\t\t\t\t$('#demo_forceformat').colorpicker({\n\t\t\t\t\tformat: 'rgba',\n\t\t\t\t\thorizontal: true\n\t\t\t\t});\n\n\t\t\t\t$('#demo_forceformat3').colorpicker({\n\t\t\t\t\tformat: 'rgba',\n\t\t\t\t});\n\n\t\t\t\t$('.demo-auto').colorpicker();\n\n\t\t}", "_setupColorPicker() {\n\t\tlet options = _.defaults( this.options.colorPicker || {}, {\n\t\t\tdefaultColor: this.shadowColor,\n\t\t\thide: false,\n\t\t\tchange: () => {}\n\t\t} );\n\n\t\tthis.colorPicker.init( false, options );\n\n\t\t// Add change event after initialize to prevent, programtic change events frm changing colors.\n\t\tthis.colorPicker.$input.iris( 'option', 'change', ( e, ui ) => {\n\t\t\tthis.shadowColor = ui.color.toString();\n\t\t\tthis._updateCss();\n\t\t\tthis._triggerChangeEvent();\n\t\t} );\n\t}", "function FillColorEditor(container, data, name, resources, colorChangedCallback) {\n this.colorChanged = colorChangedCallback;\n var self = this;\n this.colorEditor = new ColorEditor(container, data.backColor, data.transparency || 0, name, {\n noColorText: resources.noColorText,\n solidColorText: resources.solidColorText,\n automaticColorText: resources.automaticColorText\n }, function (color) {\n return self.colorChanged('backColor', color);\n }, function (transparency) {\n return self.colorChanged('backColorTransparency', transparency);\n });\n }", "function changeColorScheme() {\n\n}", "function setColor(){\n\tconsole.log(\"Using color-theme: \" + col);\n\t$(\".color-theme\").html(\n\t\t\"body, .scroll-btn {\" +\n\t\t\t\"color: \" + col + \";\" +\n\t\t\"}\" +\n\t\t\".swipe-down-menu-blur, .circle-fromMiddle, .scroll-btn i, .input-range::-webkit-slider-thumb {\" +\n\t\t\t\"border: 2px solid \" + col + \";\" +\n\t\t\"}\" +\n\t\t\".swipe-down-menu-blur {\" +\n\t\t\t\"border-top: none;\" +\n\t\t\"}\" +\n\t\t\".pace .pace-progress, .input-range::-webkit-slider-thumb, .input-range::-webkit-slider-runnable-track, .settings>li:after, .circle-fromMiddle span, .circle-fromMiddle:before, .circle-fromMiddle:after, .scroll-btn i:before, .swipe-down-menu:hover>.scroll-btn i, .swipe-down-menu:hover>.swipe-down-menu-blur, .swipe-down-menu:active>.swipe-down-menu-blur {\" +\n\t\t\t\"background-color: \" + col + \";\" +\n\t\t\"}\" +\n\t\t\".settings>li:after, .pace .pace-progress {\" +\n\t\t\t\"box-shadow: 0px 2px 2px \" + col + \";\" +\n\t\t\"}\" +\n\t\t\"@-webkit-keyframes textColour {0% {color: #fff;}100% {color: \" + col + \";}}@-moz-keyframes textColour {0% {color: #fff;}100% {color: \" + col + \";}}@-o-keyframes textColour {0% {color: #fff;}100% {color: \" + col + \";}}@keyframes textColour {0% {color: #fff;}100% {color: \" + col + \";}}\" +\n\t\t\".swipe-down-menu:hover>.swipe-down-menu-blur, .swipe-down-menu:active>.swipe-down-menu-blur {\" +\n\t\t\t\"box-shadow: 0px 0px 5px \" + col + \";\" +\n\t\t\t\"background-color: rgba(\" + rgbCol.r + \", \" + rgbCol.g + \", \" + rgbCol.b + \", 0.1);\" +\n\t\t\"}\" +\n\t\t\".e-loadholder .m-loader .e-text {border: 5px solid \" + col + \";}.e-loadholder .m-loader {border: 5px solid hsl(\" + curColorTheme[0] + \", \" + curColorTheme[1] + \"%, \" + (curColorTheme[2] + 10) + \"%);}.e-loadholder {border: 5px solid hsl(\" + curColorTheme[0] + \", \" + curColorTheme[1] + \"%, \" + (curColorTheme[2] + 20) + \"%);}\" +\n\t\t\".switch {\" +\n\t\t\t\"--uiSwitchButtonBgColor: \" + col + \";\" +\n\t\t\t\"--uiSwitchBgColorActive: \" + col + \";\" +\n\t\t\"}\"\n\t);\n}", "function newColor() {\n this.style.background = colorPicker.value;\n }", "init() {\n this.editor.style.width = this.width;\n this.editor.style.height = this.height;\n this.bar.setupToolbar();\n\n this.createTag(\"\", this.getActiveTags(), this.getActiveStyle());\n\n let tools = document.querySelectorAll(\".editor-button\");\n tools.forEach(t => {\n t.addEventListener('click', (e) => {\n this.updateStyle(e);\n });\n });\n }", "function init() {\n readColorsFromLocalStorage();\n initGenerateBtnListener();\n initSaveColorBtnListener();\n}", "function initEditor() {\n checkSetup();\n initFirebase();\n initConstants();\n initCanvas();\n initButton();\n initEditorData();\n initEventHandlers();\n resetEditor();\n initGrid();\n initSelectorContent();\n}", "function changeOne() {\n colors = ['#B29190', '#FFFFD3', '#FF8E8B', '#77A8CC', '#5E8EB2', '#FFD792'];\n init();\n}", "function startup() {\n let colorPicker = document.getElementById(\"color-picker\");\n colorPicker.addEventListener(\"input\", update, false);\n colorPicker.select();\n }", "function initialize_editor() {\n\t// remove the existing report styles\n\t$('body style').empty();\n\t// add the styles for the editor\n\t$('body').prepend('<style id=\"interface-styles\" type=\"text/css\">#editor {position: absolute;top: 10px;left: 10px;display: none;border: 1px solid;border-radius: 10px;width: 290px;height: 270px;padding: 5px;background-color: white;-webkit-touch-callout: none;-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;font-size: 11pt;font-family: Arial, Verdana, san-serif;}#editor h1 {font-size: 18pt; margin-top: 0px;}#editor-instruction {display: none;font-size: 30pt;text-align: center;}#font-selector {margin: 10px 10px 0px 10px;}.size-button {cursor: pointer;border: 1px solid;border-radius: 5px;width: 50px;height: 50px;vertical-align: middle;font-size: 28pt;}.size-button:hover {background-color: aquamarine;}.size-button:active {background-color: mediumaquamarine;}.font-resizer {float: left;margin: 10px;text-align: center;}.font-currentsize {margin: 5px;}</style>');\n\t// add the editor interface\n\t$('#interface-styles').after('<div id=\"editor-instruction\">press \"esc\" to change font or font size</div><div id=\"editor\"><h1>Report display options</h1><div id=\"font-selector\">Font:<select><option value=\"Verdana, Arial, Helvetica, Tahoma, sans-serif\">Verdana</option><option value=\"Arial, Helvetica, Tahoma, sans-serif\">Arial</option><option value=\"Tahoma, Geneva, sans-serif;\">Tahoma</option><option value=\"Trebuchet ms, Helvetica, sans-serif;\">Trebuchet</option><option value=\"Comic sans ms, cursive;\">Comic Sans :P</option></select></div><div id=\"H3b-size\" class=\"font-resizer\">1st<br/>Header<div id=\"H3b-plus\" class=\"size-button\">+</div><div id=\"H3b-field\" class=\"font-currentsize\">9pt</div><div id=\"H3b-minus\" class=\"size-button\">-</div></div><div id=\"H4b-size\" class=\"font-resizer\">2nd<br/>Header<div id=\"H4b-plus\" class=\"size-button\">+</div><div id=\"H4b-field\" class=\"font-currentsize\">8pt</div><div id=\"H4b-minus\" class=\"size-button\">-</div></div><div id=\"H5b-size\" class=\"font-resizer\">Name<br/>&amp; Sum<div id=\"H5b-plus\" class=\"size-button\">+</div><div id=\"H5b-field\" class=\"font-currentsize\">7pt</div><div id=\"H5b-minus\" class=\"size-button\">-</div></div><div id=\"small-size\" class=\"font-resizer\">Column<br/>&amp; Data<div id=\"small-plus\" class=\"size-button\">+</div><div id=\"small-field\" class=\"font-currentsize\">7pt</div><div id=\"small-minus\" class=\"size-button\">-</div></div></div>');\n\t// add hidden fields for storing the setting values with defaults\n\t$('#editor').after('<input type=\"hidden\" value=\"Verdana, Arial, Helvetica, Tahoma, sans-serif\" name=\"Font\"><input type=\"hidden\" value=\"9\" name=\"H3bsize\"><input type=\"hidden\" value=\"8\" name=\"H4bsize\"><input type=\"hidden\" value=\"7\" name=\"H5bsize\"><input type=\"hidden\" value=\"7\" name=\"smallsize\">');\n\tupdate_formatting('init');\n\t// set the key trigger to toggle the interface\n\t$(\"body\").keyup(function(event) {\n\t\tif (event.which == 27) {\n\t\t\t$(\"#editor\").slideToggle();\n\t\t}\n\t});\n\t// set the triggers on the buttons and drop-down menu\n\t$(\".size-button\").click(function() {\n\t\tupdate_formatting($(this).attr('id'));\n\t});\n\t$(\"#font-selector\").change(function() {\n\t\tupdate_formatting($(this).attr('id'));\n\t});\n\t// display message\n\t$(\"#editor-instruction\").slideToggle();\n\tsetTimeout(function(){$(\"#editor-instruction\").slideToggle()}, 3000);\n}", "function init(){\n var el = document.getElementById('palette');\n buildLine(col1, el);\n buildLine(col3, el);\n buildLine(col4, el);\n\n }", "function initEditor() {\n\t\t//first thing to do is set up loading page until we can establish a connection\n\t\tdrawLoadScreen();\n\t\tgetToken();\n\t}", "onMainChange() {\n this.themeBuilderService.MaterialPaletteColors = this.themeBuilderService.GetPalette(this.Form.value.main);\n // set lightest and darkest hue colors in color picker\n if (!this.Unlocked.value) {\n this.Form.patchValue({ lighter: this.themeBuilderService.MaterialPaletteColors['50'] });\n this.Form.patchValue({ darker: this.themeBuilderService.MaterialPaletteColors['900'] });\n }\n }", "function ColorEditor(container, color, transparency, name, resources, changedValueCallback, changeOpacityCallBack) {\n var self = this;\n var numTransparency = transparency || 0;\n self.changedValue = changedValueCallback;\n self.changedOpacity = changeOpacityCallBack;\n self.noColorText = resources.noColorText;\n self.solidColorText = resources.solidColorText;\n self.automaticColorText = resources.automaticColorText;\n self.radiogroup = new RadioGroup(container, [this.noColorText, this.solidColorText, this.automaticColorText], name, function (element) {\n return self.radioGroupSelectionChanged(element);\n });\n self.colorpicker = new ColorPicker(container, function (value) {\n self.colorPicked(value);\n });\n self.opacityEditor = new InputNumberEditor(container, designer.res.chartSliderPanel.transparency, function (transparent) {\n self.changedOpacity(transparent / 100);\n }, { min: 0, max: 100, descString: '%' });//TODO\n self.updateUI(color, numTransparency * 100);\n }", "function formalizeColorPicker() {\n \t$('.formalize-color').wpColorPicker();\n\t}", "function ColorPicker() {\n this._colorPos = {};\n this.el = o(require('./template'));\n this.main = this.el.find('.main').get(0);\n this.spectrum = this.el.find('.spectrum').get(0);\n this.hue(rgb(255, 0, 0));\n this.spectrumEvents();\n this.mainEvents();\n this.w = 180;\n this.h = 180;\n this.render();\n}", "function initSpectrum(){\n $(\".cm-colorPicker\").spectrum({\n clickoutFiresChange: true,\n hide: function(color){\n $(\".cm-dialog\").addClass(\"cm-inactive\")\n },\n change: function(color){\n colorScheme[currentClass] = createColorCSS(\n [$(\"#cm-bgColorPicker\").spectrum(\"get\").toHexString(),\n $(\"#cm-fontColorPicker\").spectrum(\"get\").toHexString()]\n )\n\n if(currentClass < borderScheme.length )\n if(borderScheme[currentClass]) {\n borderScheme[currentClass]['border-color'] = $(\"#cm-borderColorPicker\").spectrum(\"get\").toHexString()\n }\n\n updateColorScheme()\n updateBorderScheme()\n }\n })\n\n $(\".sp-replacer.sp-light\").addClass(\"cm-colorPicker\")\n }", "createColorPicker(title, colorCode, initialValue) {\n const container = document.createElement(\"div\");\n container.style.display = \"flex\";\n container.style.alignItems = \"center\";\n container.style.justifyContent = \"flex-end\";\n container.style.marginBottom = \"10px\";\n\n const colorName = document.createElement(\"p\");\n colorName.textContent = title;\n colorName.style.margin = \"0px 10px 0px 0px\";\n\n const colorPicker = document.createElement(\"input\");\n colorPicker.style.width = \"32px\";\n colorPicker.style.height = \"32px\";\n colorPicker.style.padding = \"2px\";\n colorPicker.setAttribute(\"type\", \"color\");\n colorPicker.setAttribute(\"value\", initialValue);\n\n colorPicker.onchange = () => {\n const newConfig = {\n ...this._config,\n customColors: { ...this._config.customColors },\n };\n newConfig.customColors[colorCode] = colorPicker.value;\n this.setConfiguration(newConfig);\n };\n\n // clear the config setting for this color code if we should use the event theme.\n const button = document.createElement(\"button\");\n button.textContent = \"Use Event Theme\";\n button.onclick = () => {\n const newConfig = {\n ...this._config,\n customColors: { ...this._config.customColors },\n };\n newConfig.customColors[colorCode] = undefined;\n this.setConfiguration(newConfig);\n };\n\n if (\n !this._config.customColors ||\n this._config.customColors[colorCode] === undefined\n ) {\n //style as selected\n button.style.border = \"2px solid #016AE1\";\n button.style.borderRadius = \"8px\";\n }\n\n button.style.margin = \"0px 0px 0px 10px\";\n\n container.append(colorName, colorPicker, button);\n return container;\n }", "initializer() {\n this.level = 1;\n this.changeTagLevel(`Da click en el botón empezar juego`);\n this.chooseColor = this.chooseColor.bind(this);\n this.nextLevel = this.nextLevel.bind(this);\n this.removeButtonListener = this.removeButtonListener.bind(this);\n this.toggleBtnStart();\n this.colors = {\n celeste,\n violeta,\n naranja,\n verde\n };\n }", "function setColors () {\n // SET ALL COLOR VARIABLES\n setColorValues();\n\n // UPDATE CSS COLOR STYLES\n setColorStyles();\n\n // SET CONTRAST COLOR STYLES\n setContrastStyles();\n}", "_menuEventColor() {\n\n this.colorData[\"type\"] = \"set-color\";\n this._menuEventHandler(this.colorData);\n this.colorData[\"type\"] = \"select-color\";\n }", "init() {\n for(let codeElement of doc.getElementsByTagName('code') ) {\n this.colorNode(codeElement);\n }\n }", "function colorPreview() {\r\n\t\t\t//récupération de la case \"aperçu\" à colorier et remplissage avec la couleur en cours\r\n\t \t$preview = $('#preview');\t\r\n\t\t\tvar previewCtx = $preview[0].getContext(\"2d\");\r\n\t\t previewCtx.fillStyle = color;\r\n\t\t previewCtx.fillRect(0, 0, 30.000, 30.000);\r\n\t\t}", "function init() {\n textAreaColor();\n newDay();\n}", "function colorChanged() {\r\n // STEP 2 PART 1\r\n // In index.html, the color picker's value ranges from #000000 to #ffffff\r\n // Let's store the color picker's value in a variable, perhaps named \"color\"\r\n\r\n /* SOLUTION HERE */\r\n color = colorPicker.value;\r\n\r\n // STEP 2 PART 2\r\n // Set the color value to both context.fillStyle and context.strokeStyle\r\n\r\n /* SOLUTION HERE */\r\n context.fillStyle = color;\r\n context.strokeStyle = color;\r\n\r\n }", "function inicializa() {\n var ArrayColors = Ti.App.Properties.getList(\"ArrayColors\");\n for (chave in ArrayColors) {\n var view = Ti.UI.createView({\n colorID: chave,\n backgroundColor: ArrayColors[chave],\n height: \"20%\",\n width: \"20%\",\n left: \"10%\",\n top: \"10%\",\n borderColor: \"black\",\n borderRadius: 10,\n elevation: 8,\n borderStyle: Ti.UI.INPUT_BORDERSTYLE_BEZEL,\n backgroundSelectedColor: \"#000000\",\n });\n $.viewColors.add(view);\n }\n\n $.viewColors.addEventListener(\"click\", function (e) {\n if ((e.source.apiName = \"Ti.UI.View\" && e.source.colorID != undefined)) {\n $.viewcat.backgroundColor = e.source.backgroundColor;\n }\n });\n}", "function initializePage() {\r\n colorList();\r\n }", "function fnInitialiseEditor()\n {\n elRoot.parentNode.classList.add('-active');\n\n // if it’s already there…\n if (oEditor !== null)\n {\n oEditor.setup();\n return;\n }\n\n // load raw markup from the server, then use it to init the editor\n ajaxRequest( `${options.uri}.json?field=${options.property}` ).then( oJson =>\n {\n // a. swap things out\n sOldMarkup = elRoot.innerHTML;\n elRoot.innerHTML = oJson.content;\n\n // b initiate the editor\n oEditor = new Editor( elRoot, { toolbar: { buttons: EDITOR_BUTTONS }});\n });\n }", "function init() {\n\n\t\t// Bind the editor elements to variables\n\t\tbindElements();\n\n\t\t// Create event listeners for keyup, mouseup, etc.\n\t\tcreateEventBindings();\n\t}", "function setColor() {\n \t\t\t$(this).setPixels({\n\t \t\tx: 260, y: 30,\n\t \t\twidth: 60, height: 40,\n\t \t\t// loop through each pixel\n\t \t\teach: function(px) {\n\t \t\t\tpx.r = rgb_r;\n\t \t\t\tpx.g = rgb_g;\n\t \t\t\tpx.b = rgb_b;\n\t \t\t}\n \t\t\t});\n\t\t}", "function setUp(){\n // control blockly look and feel\n Blockly.HSV_SATURATION = 0.7;\n Blockly.HSV_VALUE = 0.97;\n }", "onColorClick (event) {\n let pos = getDOMOffset(this.colorPicker);\n pos.x += 30;\n pos.y = editor.heightAtLine(this.line) - 15;\n\n this.picker = new ColorPicker(this.colorPicker.style.backgroundColor);\n\n this.picker.presentModal(pos.x, pos.y);\n this.picker.on('changed', this.onColorChange.bind(this));\n }", "function CodeMirrorInit() {\n var textAreaHeight = getDocHeight() - 125;\n\n cssTemplateCfg = LoadCodeMirror('csscfg', 'text/x-scss', 'vibrant-ink', false);\n cssTemplateCfg.setSize(\"100%\", textAreaHeight + \"px\");\n}", "function onColorChange() {\n color = colorpicker.value;\n}", "function initialize(firstColor, secondColor) {\n\n\tcolor1.value = firstColor;\n\t\n\tcolor2.value = secondColor; \n\t\n\tsetBackground();\n}", "function newColor1()\n{\n\tIN.doFocus();\n\tIN.clr=\"#109FA6\";\n\trcCookie.set(\"c\",IN.clr,365);\n\tIN.ec(\"ForeColor\",false,IN.clr);\n\tIN.tBC();\n}", "function initInteractiveEditor() {\n /* If the `data-height` attribute is defined on the `codeBlock`, set\n the value of this attribute as a class on the editor element. */\n if (watCodeBlock.dataset[\"height\"]) {\n const watEditor = document.getElementById(\"wat-panel\");\n watEditor.classList.add(watCodeBlock.dataset[\"height\"]);\n const jsEditor = document.getElementById(\"js-panel\");\n jsEditor.classList.add(watCodeBlock.dataset[\"height\"]);\n }\n\n staticContainer = document.getElementById(\"static\");\n staticContainer.classList.add(\"hidden\");\n\n liveContainer = document.getElementById(\"live\");\n liveContainer.classList.remove(\"hidden\");\n\n mceConsole();\n mceEvents.register();\n\n initCodeMirror();\n\n registerEventListeners();\n }", "function init(e) {\r\n\r\n\tbackgroundPane = dojo.widget.byId(\"backgroundPane\");\r\n\tfontPane = dojo.widget.byId(\"fontPane\");\r\n\tcolorPane = dojo.widget.byId(\"colorPane\");\r\n\timagePane = dojo.widget.byId(\"imagePane\");\r\n\tuploadPane = dojo.widget.byId(\"uploadPane\");\r\n\tdeletePane = dojo.widget.byId(\"deletePane\");\r\n\tyahooLinksPane = dojo.widget.byId(\"yahooLinksPane\");\r\n\ttabContainerSearchUi = dojo.widget.byId(\"tabContainerSearchUi\");\r\n\tssbcpPane = dojo.widget.byId(\"ssbcpPane\");\r\n\t\r\n\tdojo.event.kwConnect({srcObj:colorPicker, srcFunc:\"onColorSelect\", targetObj:this, \r\n\t\t\ttargetFunc:\"updateColorAndClose\", once:true});\r\n\t\r\n\t// Sidebar needs to be drawn after the rest of the Graphics are initiated to\r\n\t// prevent Firefox from drawing it incorrectly...\r\n\tdocument.getElementById(\"side-bar\").style.display = \"block\";\r\n\t\r\n\tverifyCheckboxes();\r\n}", "function TextFillEditor(container, data, name, resources, textColorChangedCallback) {\n this.colorChanged = textColorChangedCallback;\n var self = this;\n this.colorEditor = new ColorEditor(container, data.color !== keyword_undefined ? data.color : data.colorTitle, data.transparency, name, {\n noColorText: resources.noColorText,\n solidColorText: resources.solidColorText\n }, function (color) {\n return self.colorChanged(data.color !== keyword_undefined ? 'color' : 'colorTitle', color);\n }, function (transparency) {\n return self.colorChanged(data.color !== keyword_undefined ? 'transparency' : 'titleTransparency', transparency);\n });\n }", "function init() {\n\tinitalizeGrid();\n\tupdateCanvasGrid();\n\tdrawPalette();\n\tdrawCurrentColor();\n\tdecodeOnFirstLoad();\n}", "function initEditorCanvas() {\n let canvas = document.getElementById('editorCanvas');\n // Resize the canvas.\n canvas.width = EDITOR_SCALE * CHR_WIDTH;\n canvas.height = EDITOR_SCALE * CHR_HEIGHT;\n\n let ctx = cmn.getContext2DNA(canvas);\n ctx.imageSmoothingEnabled = false;\n ctx.scale(EDITOR_SCALE, EDITOR_SCALE);\n\n // Canvas is white by default.\n ctx.fillStyle = 'black';\n ctx.fillRect(0, 0, CHR_WIDTH, CHR_HEIGHT);\n\n canvas.addEventListener('mousedown', function (me) { _mouseDown = true; onMouseMove(me); });\n canvas.addEventListener('mousemove', onMouseMove);\n canvas.addEventListener('mouseup', function (me) { _mouseDown = false; });\n canvas.addEventListener('mouseleave', function (me) { _mouseDown = false; });\n}", "function main()\n{\n initCommand();\n clearSelection();\n global.mode = global.mode_BACKGROUND;\n setPromptPrefix(qsTr(\"Enter RED,GREEN,BLUE values for background or [Crosshair/Grid]: \"));\n}", "function UpdateColors(aColorWellID, aPreviewID, aColor)\n{\n // Only show editor colors from prefs if we're in custom mode\n if (!document.getElementById(\"editor.use_custom_colors\").value)\n return;\n\n SetColors(aColorWellID, aPreviewID, aColor)\n}", "function set_colors_dialog(){\r\n box = document.getElementById('TL_MENU');\r\n base = box.innerHTML;\r\n clr = '<i>Customize your event colours...</i>\\n';\r\n\r\n function add_color(display, event_name){\r\n clr += display.pad(9)+'= <input id=\"TL_EVENT_'+event_name+'\" value=\"'+eval(event_name)+'\"/>\\n';\r\n }\r\n add_color('BUILDING', 'BUILDING_COLOR');\r\n add_color('ATTACK', 'ATTACK_COLOR');\r\n add_color('REPORT', 'REPORT_COLOR');\r\n add_color('MARKET', 'MARKET_COLOR');\r\n add_color('RESEARCH', 'RESEARCH_COLOR');\r\n add_color('PARTY', 'PARTY_COLOR');\r\n\r\n clr += '\\n<a href=\"#\" style=\"color: blue\" id=\"TL_MENU_BACK\">BACK</a>\\n';\r\n\r\n box.innerHTML = clr;\r\n\r\n document.getElementById('TL_MENU_BACK').addEventListener('click', function(e){\r\n box.innerHTML = base;\r\n set_add_listeners(box);\r\n }, false);\r\n colors = box.childNodes;\r\n for (i in colors){\r\n if (colors[i] == undefined) continue;\r\n colors[i].addEventListener('change', function(e){\r\n id = e.target.id.substr(9);\r\n GM_setValue(prefix(id), eval(id+'=\"'+e.target.value+'\"'));\r\n }, false);\r\n }\r\n }", "function CReplaceColor() {\n this.mode = 0;\n this.app = null;\n this.pImages = null;\n}", "function colorPick(colorCode) {\n currentColor = colorCode;\n}", "function init() {\n var cm = new CodeMirror(document.getElementById('editor-container'), {\n mode: 'erv',\n tabSize: 4,\n indentWithTabs: false,\n indentUnit: 4,\n lineNumbers: true,\n gutters: ['error-markers'],\n hintOptions: {\n hint: getAutoCompletionHints\n }\n });\n cm.on('change', onEditorContentChange);\n return cm;\n}", "initEditor() {\n let savedCode = this.service.getCode(this.currentExo.method);\n if (savedCode)\n this.editor.setValue(savedCode);\n\n byId('editor').style.height = this.editorHeight + 'px';\n this.editor.resize();\n }", "setColours() {\n this.colourNeutral = 'colourInputNeutral';\n this.colourGo = 'colourInputGo';\n this.colourNoGo = 'colourNoGo';\n this.setStartColour();\n }", "function initColorPicker() {\n // Local variable containing the id of the color box\n let element = document.getElementById(\"color-box\");\n // Object with keys containing the ids of the inputs\n let colors = {\n red: document.getElementById(\"red\"),\n green: document.getElementById(\"green\"),\n blue: document.getElementById(\"blue\")\n };\n // Local variable containing the class name of the inputs\n let colorPickers = document.getElementsByClassName(\"picker\");\n // Call eventListeners function\n setColorPickerEventListeners(element, colors, colorPickers);\n}", "color() {\r\n if (!this.state.editMode) {\r\n return '#E07A0C';\r\n } else {\r\n return '#B33529';\r\n }\r\n }", "function Start() {\n\t\toriginalColor = GetComponent.<Renderer>().material.color;\t\n}", "function setGUIColors(){\n\tdpost(\"setGUIColors()\\n\");\n\tif(myNodeInit){\n\t\tvar workingcolor = myNodeColorOn;\n\t\tif(myNodeEnable == 0)\n\t\t\tworkingcolor = myNodeColorOff;\n \n \tif(vpl_nodeCanvas.understands(\"bgfillcolor\")){\n \t//post(\"bgfillcolor\\n\");\n \tvpl_nodeCanvas.message(\"bgfillcolor\", workingcolor[0], workingcolor[1], workingcolor[2], workingcolor[3]);\n \t}\n \tif(vpl_nodeCanvas.understands(\"bgcolor\")){\n \t//post(\"bgcolor\\n\");\n \tvpl_nodeCanvas.message(\"bgcolor\", workingcolor[0], workingcolor[1], workingcolor[2], workingcolor[3]);\n \t}\n\n\t\tif(vpl_nodeEnable != null){\n\t\t//\tvpl_nodeEnable.message(\"bordercolor\", workingcolor[0], workingcolor[1], workingcolor[2], workingcolor[3]- 0.05 );\n\t\t}\n\n\t\t// setting the title bar\n\t\tworkingcolor = (myNodeSelected == 1)? myNodeColorSelected:myNodeColorUnSelected;\n\t\tif(vpl_titleBar != null){\n\t\t\tvpl_titleBar.message(\"bgcolor\", workingcolor);\n\t\t}\n\t}\n}", "function setColors() {\n var idName = '#math_' + oper;\n var className = oper + 'Color';\n \n // Remove any of the color classes before resetting\n $('[id^=\"answer\"]').removeClass('error');\n $('.page').removeClassRegex(/Color$/);\n $('.subLevels').removeClass(/Color$/);\n\n // Set different colors for each operation\n $('.page').addClass(oper + 'Color');\n\n // Adjust colors in main menu if needed\n if (!($(idName).hasClass(className))) {\n\n $('[id^=\"math_\"]').removeClassRegex(/Color$/);\n $(idName).addClass(className);\n }\n }", "function initColor() {\n let paletteArr = document.getElementById(\"palette\").children;\n\n //array for each for the colours\n let colorPalette = [\n 'rgb(210, 57, 57)',\n 'rgb(251, 107, 134)',\n 'rgb(255, 61, 114)',\n 'rgb(205, 34, 145)',\n 'rgb(189, 0, 255)',\n 'rgb(125, 46, 238)',\n 'rgb(0, 71, 255)',\n 'rgb(0, 67, 196)',\n 'rgb(36, 117, 224)',\n 'rgb(60, 215, 255)',\n 'rgb(0, 255, 201)',\n 'rgb(44, 238, 167)',\n 'rgb(176, 254, 76)',\n 'rgb(255, 252, 0)',\n 'rgb(255, 253, 101)',\n 'rgb(255, 203, 18)',\n 'rgb(255, 171, 60)',\n 'rgb(255, 122, 0)',\n 'rgb(255, 255, 255)',\n 'rgb(38, 38, 38)'\n ];\n\n for (let j = 0; j < paletteArr.length; j++) {\n Object.assign(paletteArr[j].style, {\n backgroundColor: colorPalette[j]\n });\n paletteArr[j].addEventListener('click', function() {\n //This is variable holding the rgb value\n currentColor = colorPalette[j];\n\n //this sets the brush to the current color\n let brushie = document.getElementById('brushie');\n brushie.style.fill = currentColor;\n });\n }\n\n return palette;\n}", "function ChangeColor(){\n selected_object.material.color.setHex(shape_params.color);\n }", "function onIsStateInitializedChanged(e) {\n var framework = pureweb.getFramework();\n if (framework.isStateInitialized()) {\n selectColor(framework.getState().getValue('ScribbleColor'));\n }\n}", "function init()\r\n{\r\n\t//Initialize globals\r\n\tstyleExplorer = new StyleExplorerApplication();\r\n\tstyleExplorer.setCanvas(document.getElementById(\"canvasStyleExplorer\"));\r\n}", "function EditorConstructor() { }", "function EditorConstructor() { }", "function __INITIALIZE(self){\n self._view.css({\n backgroundColor: '#EEE'\n });\n }", "function showColorPicker(){\n var self = $(this);\n cw.input(this);\n cw.onchange(function(){\n var color = self.val();\n self.css({color: color, 'background-color': color});\n });\n $('#color_popup').bPopup({modalColor: 'transparent'});\n}", "function ColorPicker() {\n this.selector = '.t3js-color-picker';\n }", "constructor() {\n super('color', []);\n this.setDescription('!color <Twitch color> changes the color of the bot to the selected color.');\n }", "function startUp() {\n\tvar bgColor = document.getElementById(\"outlineBg\");\n\tbgColor.value = \"#69d499\";\n\tbgColor.addEventListener(\"input\", updateFirst, false);\n}", "constructor() {\n\t\tthis.colors = ['red', 'pink', 'green', 'blue', 'yellow', 'purple', 'grey'];\n\t}", "setTheme(theme = {}) {\n this.colors.foreground = this._parseColor(theme.foreground, DEFAULT_FOREGROUND);\n this.colors.background = this._parseColor(theme.background, DEFAULT_BACKGROUND);\n this.colors.cursor = this._parseColor(theme.cursor, DEFAULT_CURSOR, true);\n this.colors.cursorAccent = this._parseColor(theme.cursorAccent, DEFAULT_CURSOR_ACCENT, true);\n this.colors.selectionTransparent = this._parseColor(theme.selection, DEFAULT_SELECTION, true);\n this.colors.selectionOpaque = color.blend(this.colors.background, this.colors.selectionTransparent);\n /**\n * If selection color is opaque, blend it with background with 0.3 opacity\n * Issue #2737\n */\n if (color.isOpaque(this.colors.selectionTransparent)) {\n const opacity = 0.3;\n this.colors.selectionTransparent = color.opacity(this.colors.selectionTransparent, opacity);\n }\n this.colors.ansi[0] = this._parseColor(theme.black, DEFAULT_ANSI_COLORS[0]);\n this.colors.ansi[1] = this._parseColor(theme.red, DEFAULT_ANSI_COLORS[1]);\n this.colors.ansi[2] = this._parseColor(theme.green, DEFAULT_ANSI_COLORS[2]);\n this.colors.ansi[3] = this._parseColor(theme.yellow, DEFAULT_ANSI_COLORS[3]);\n this.colors.ansi[4] = this._parseColor(theme.blue, DEFAULT_ANSI_COLORS[4]);\n this.colors.ansi[5] = this._parseColor(theme.magenta, DEFAULT_ANSI_COLORS[5]);\n this.colors.ansi[6] = this._parseColor(theme.cyan, DEFAULT_ANSI_COLORS[6]);\n this.colors.ansi[7] = this._parseColor(theme.white, DEFAULT_ANSI_COLORS[7]);\n this.colors.ansi[8] = this._parseColor(theme.brightBlack, DEFAULT_ANSI_COLORS[8]);\n this.colors.ansi[9] = this._parseColor(theme.brightRed, DEFAULT_ANSI_COLORS[9]);\n this.colors.ansi[10] = this._parseColor(theme.brightGreen, DEFAULT_ANSI_COLORS[10]);\n this.colors.ansi[11] = this._parseColor(theme.brightYellow, DEFAULT_ANSI_COLORS[11]);\n this.colors.ansi[12] = this._parseColor(theme.brightBlue, DEFAULT_ANSI_COLORS[12]);\n this.colors.ansi[13] = this._parseColor(theme.brightMagenta, DEFAULT_ANSI_COLORS[13]);\n this.colors.ansi[14] = this._parseColor(theme.brightCyan, DEFAULT_ANSI_COLORS[14]);\n this.colors.ansi[15] = this._parseColor(theme.brightWhite, DEFAULT_ANSI_COLORS[15]);\n // Clear our the cache\n this._contrastCache.clear();\n }", "function init (){\n themeToggle.value = \"1\"\n theme.href = \"theme\" + themeToggle.value + \".css\"\n display.innerHTML = calcDisplay;\n prepareThemeToggle()\n prepareStaButtons()\n prepareDelButton()\n prepareOperations()\n prepareEqualButton()\n prepareResetButtons()\n \n\n}", "function updateColor(){\r\n color = colorSelector.value;\r\n}", "function set_color() {\n var color = localStorage.getItem('mimity-color');\n var style = localStorage.getItem('mimity-style');\n $('#color-chooser').val(color);\n $('#style-chooser').val(style);\n $('#theme').attr('href','css/style.'+color+'.'+style+'.css');\n $('.logo img').attr('src','images/logo-'+color+'.png');\n}", "function Colorer (cursor, base) {\n this.current = null\n this.cursor = cursor\n this.base = base\n}", "function Colorer (cursor, base) {\n this.current = null\n this.cursor = cursor\n this.base = base\n}", "function Colorer (cursor, base) {\n this.current = null\n this.cursor = cursor\n this.base = base\n}", "setColours() {\n this.colourNeutral = 'colourMenuNeutral';\n this.colourGo = 'colourMenuGo';\n this.colourNoGo = '';\n this.setStartColour();\n }", "function init() {\n\t\t\tif (productData.products.length > 1) {\n\t\t\t\tcolorPickerPopover = new ss.Popover('.gallery-module .controls .color-picker', {placement: 'top',content: $('.color-picker-popover-content').html(),html: true,container: '.gallery-module',animation: false});\n\t\t\t}\n\n\t\t\tvar modelCode = $('#modelCode').val();\n\n\t\t\t// Category에서 색상 값이 넘어올 경우\n\t\t\t/*if (prdColor != null && bindColorNames.length > 1) {\n\t\t\t\tfor (var index = 0; index < bindColorNames.length; index++) {\n\t\t\t\t\tif (bindColorNames[index] == prdColor) {\n\t\t\t\t\t\tselectColor = bindColors[index];\n\t\t\t\t\t\tselectIndex = index;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (selectColor != null) {\n\n\t\t\t\t\tvar url = $('#selectColor').find('[data-color=\"' + bindColors[selectIndex] + '\"]').attr('data-url');\n\t\t\t\t\tvar group = $('#selectColor').find('[data-color=\"' + bindColors[selectIndex] + '\"]').attr('data-groupcode');\n\t\t\t\t\tvar model = $('#selectColor').find('[data-color=\"' + bindColors[selectIndex] + '\"]').attr('data-modelcode');\n\n\t\t\t\t\tif (selectIndex == defaultColorIndex) {\n\t\t\t\t\t\t$('#currentColor').val(selectColor);\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// 그룹으로 묶이지 않은 색상일경우\n\t\t\t\t\t\tif (group == \"\" || group == null) {\n\t\t\t\t\t\t\t$('#currentColor').val(selectColor);\n\n\t\t\t\t\t\t// 그룹으로 묶인 색상일 경우\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// 모델이 동일하지 않을경우\n\t\t\t\t\t\t\tif (model != modelCode) {\n\t\t\t\t\t\t\t\tlocation.href = url;\n\t\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// 모델이 동일한 경우\n\t\t\t\t\t\t\t\t$('#currentColor').val(selectColor);\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\t\t\t\t} else {\n\t\t\t\t\t//new ss.PDPStandard.PDPeCommerce();\n\t\t\t\t\t$('#currentColor').val(defaultColorIndex);\n\t\t\t\t//setupThumbnailGallery(defaultColorIndex);\n\n\t\t\t\t}\n\n\t\t\t// Category에서 색상 값을 받지 못한 경우 또는 색상이 하나밖에 없을때\n\t\t\t} else {\n\t\t\t\t//new ss.PDPStandard.PDPeCommerce();\n\t\t\t\t$('#currentColor').val(defaultColorIndex);\n\t\t\t//setupThumbnailGallery(defaultColorIndex);\n\t\t\t}*/\n\n\t\t\t//$('#currentColor').val(selectColor);\n\n\t\t\t// 첫 로딩 시 옵션 컬러값이 있을 경우\n\t\t\tvar paramModelColor = $('#ParamModelColor').val();\n\t\t\tif ((paramModelColor != \"\") && (paramModelColor != undefined) && (paramModelColor != null)) {\n\t\t\t\tvar siteCode = $('#siteCode').val();\n\t\t\t\tvar colorCode = $('#currentColor').val();\n\t\t\t\tvar url = '/' + siteCode + '/api/product/gallery/' + $('#ParamModelCode').val() + '?mType=json';\n\t\t\t\t$.ajax({\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\turl: url,\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tsuccess: function(data) {\n\t\t\t\t\t\tvar htmlStr = \"\";\n\t\t\t\t\t\tvar prdImg = data.xmlData.productImage.productImage;\n\t\t\t\t\t\t// displayname 변경.\n\t\t\t\t\t\t$(\".product-title\").text(prdImg[0].dispNm);\n\t\t\t\t\t\t$.each(prdImg, function(i) {\n\t\t\t\t\t\t\tif (this.type == 'R' || this.type == 'G') {\n\t\t\t\t\t\t\t\thtmlStr += '<li data-heroImageType=\"G\" image-color-type=\"' + this.color + '\">';\n\t\t\t\t\t\t\t\thtmlStr += '<div class=\"hero responsive-image\"';\n\t\t\t\t\t\t\t\thtmlStr += 'data-media-tablet-portrait=\"' + this.url + '?$DT-Gallery$\"';\n\t\t\t\t\t\t\t\thtmlStr += 'data-media-desktop=\"' + this.url + '?$DT-Gallery$\"';\n\t\t\t\t\t\t\t\thtmlStr += 'gallery-image-url=\"' + this.url + '\"';\n\t\t\t\t\t\t\t\thtmlStr += 'gallery-thumb-url=\"' + this.url + '?$XS-Thumbnail$\"';\n\t\t\t\t\t\t\t\thtmlStr += 'gallery-color-type=\"' + this.color + '\"';\n\t\t\t\t\t\t\t\thtmlStr += 'gallery-size-width=\"' + this.width + '\"';\n\t\t\t\t\t\t\t\thtmlStr += 'gallery-size-height=\"' + this.height + '\"';\n\t\t\t\t\t\t\t\thtmlStr += 'role=\"img\" aria-label=\"${escSpecialTextdispNm }\">';\n\t\t\t\t\t\t\t\thtmlStr += '</div>';\n\t\t\t\t\t\t\t\thtmlStr += '</li>';\n\t\t\t\t\t\t\t} else if ((this.type == 'B' || this.type == 'Y') && this.useTIYN == 'Y') {\n\t\t\t\t\t\t\t\thtmlStr += '<li data-heroImageType=\"V\">';\n\t\t\t\t\t\t\t\thtmlStr += '<div';\n\t\t\t\t\t\t\t\thtmlStr += 'gallery-videoType=\"' + this.type + '\"';\n\t\t\t\t\t\t\t\thtmlStr += 'gallery-code=\"' + this.src + '\"';\n\t\t\t\t\t\t\t\thtmlStr += 'gallery-image-url=\"' + this.desktopTI + '\"';\n\t\t\t\t\t\t\t\thtmlStr += 'gallery-thumb-url=\"' + this.desktopTI + '\"';\n\t\t\t\t\t\t\t\thtmlStr += 'gallery-size-width=\"' + this.width + '\"';\n\t\t\t\t\t\t\t\thtmlStr += 'gallery-size-height=\"' + this.height + '\">';\n\t\t\t\t\t\t\t\thtmlStr += '</div>';\n\t\t\t\t\t\t\t\thtmlStr += '</li>';\n\t\t\t\t\t\t\t} else if (this.type == 'B' || this.type == 'Y') {\n\t\t\t\t\t\t\t\thtmlStr += '<li data-heroImageType=\"V\">';\n\t\t\t\t\t\t\t\thtmlStr += '<div';\n\t\t\t\t\t\t\t\thtmlStr += 'gallery-videoType=\"' + this.type + '\"';\n\t\t\t\t\t\t\t\thtmlStr += 'gallery-code=\"' + this.src + '\"';\n\t\t\t\t\t\t\t\thtmlStr += 'gallery-image-url=\"\"';\n\t\t\t\t\t\t\t\thtmlStr += 'gallery-thumb-url=\"\"';\n\t\t\t\t\t\t\t\thtmlStr += 'gallery-size-width=\"\"';\n\t\t\t\t\t\t\t\thtmlStr += 'gallery-size-height=\"\">';\n\t\t\t\t\t\t\t\thtmlStr += '</div>';\n\t\t\t\t\t\t\t\thtmlStr += '</li>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif((colorCode == \"\") || (colorCode == \"undefined\") || (colorCode == null)) {\n\t\t\t\t\t\t\tcolorCode = prdImg[0].color;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$('#prdImgData').html(htmlStr);\n\t\t\t\t\t\t$('#currentColor').val(colorCode);\n\n\t\t\t\t\t\tproductData.products[defaultColorIndex] = {'swatchColor': bindColorNames[defaultColorIndex],'swatchColorCode': bindColors[defaultColorIndex],'images': []};\n\t\t\t\t\t\tvar image_url = $('#prdImgData').find(\"[gallery-color-type='\" + $('#currentColor').val() + \"']\");\n\t\t\t\t\t\tfor (var j = 0; j < image_url.length; j++) {\n\t\t\t\t\t\t\tvar assetUrl = '';\n\t\t\t\t\t\t\tif ($(image_url[j]).attr('gallery-image-url').indexOf('samsung/') != -1) {\n\t\t\t\t\t\t\t\tassetUrl = $(image_url[j]).attr('gallery-image-url').substr($(image_url[j]).attr('gallery-image-url').indexOf('samsung/'));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tassetUrl = $(image_url[j]).attr('gallery-image-url');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tproductData.products[defaultColorIndex].images[j] = {\n\t\t\t\t\t\t\t\t'type': 's7',\n\t\t\t\t\t\t\t\t'thumbnail': $(image_url[j]).attr('gallery-thumb-url')\n\t\t\t\t\t\t\t\t,'url': imgServerUrlChk\n\t\t\t\t\t\t\t\t,'asset': assetUrl + \"?i=\" + j\n\t\t\t\t\t\t\t\t,'width': $(image_url[j]).attr('gallery-size-width')\n\t\t\t\t\t\t\t\t,'height': $(image_url[j]).attr('gallery-size-height')\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar video_url = $('#prdImgData').find(\"[data-heroimagetype='V']\");\n\t\t\t\t\t\tfor (var k = 0; k < video_url.length; k++) {\n\t\t\t\t\t\t\tvar assetUrl = '';\n\t\t\t\t\t\t\tvar assetWidth = '';\n\t\t\t\t\t\t\tvar assetHeight = '';\n\t\t\t\t\t\t\tif ($(video_url[k]).find('div').attr('gallery-image-url').indexOf('samsung/') != -1) {\n\t\t\t\t\t\t\t\tassetUrl = $(video_url[k]).find('div').attr('gallery-image-url').substr($(video_url[k]).find('div').attr('gallery-image-url').indexOf('samsung/'));\n\t\t\t\t\t\t\t\tassetWidth = ($(video_url[k]).find('div').attr('gallery-size-width') == undefined || $(video_url[k]).find('div').attr('gallery-size-width') == \"\") ? \"3000\" : $(video_url[k]).find('div').attr('gallery-size-width');\n\t\t\t\t\t\t\t\tassetHeight = ($(video_url[k]).find('div').attr('gallery-size-height') == undefined || $(video_url[k]).find('div').attr('gallery-size-height') == \"\") ? \"2000\" : $(video_url[k]).find('div').attr('gallery-size-height')\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tassetUrl = \"samsung/gallery_thumbnail\";\n\t\t\t\t\t\t\t\tassetWidth = \"700\";\n\t\t\t\t\t\t\t\tassetHeight = \"467\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ($(video_url[k]).find('div').attr('gallery-image-url') == \"\") {\n\t\t\t\t\t\t\t\tproductData.products[defaultColorIndex].images[j] = {'thumbnail': \"http://images.samsung.com/is/image/samsung/gallery_thumbnail\"\n\t\t\t\t\t\t\t\t\t,'asset': assetUrl + \"?i=\" + j\n\t\t\t\t\t\t\t\t\t,'code': $(video_url[k]).find('div').attr('gallery-code')\n\t\t\t\t\t\t\t\t\t,'type': $(video_url[k]).find('div').attr('gallery-videoType') == \"B\" ? \"be\" : \"yt\"\n\t\t\t\t\t\t\t\t\t,'width': assetWidth\n\t\t\t\t\t\t\t\t\t,'height': assetHeight\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tproductData.products[defaultColorIndex].images[j] = {'thumbnail': $(video_url[k]).find('div').attr('gallery-thumb-url')\n\t\t\t\t\t\t\t\t\t,'asset': assetUrl + '?i=' + j\n\t\t\t\t\t\t\t\t\t,'code': $(video_url[k]).find('div').attr('gallery-code')\n\t\t\t\t\t\t\t\t\t,'type': $(video_url[k]).find('div').attr('gallery-videoType') == \"B\" ? \"be\" : \"yt\"\n\t\t\t\t\t\t\t\t\t,'width': assetWidth\n\t\t\t\t\t\t\t\t\t,'height': assetHeight\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$('#ParamModelColor').val(\"\");\n\t\t\t\t\t\tsetupThumbnailGallery(defaultColorIndex);\n\t\t\t\t\t\tbindEvents();\n\t\t\t\t\t\tchangeSpec();\n\t\t\t\t\t},\n\t\t\t\t\terror: function(data) {\n\t\t\t\t\t\tconsole.log(\"API error\");\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tsetupThumbnailGallery(defaultColorIndex);\n\t\t\t\tbindEvents();\n\t\t\t}\n\t\t}", "inicializar() {\n this.elegirColor = this.elegirColor.bind(this);\n this.siguienteNivel = this.siguienteNivel.bind(this);\n this.toggleBtnEmpezar();\n this.nivel = 1;\n this.Ultimo_nivel = 10;\n this.colores = {\n celeste,\n violeta,\n naranja,\n verde,\n };\n }", "function init() {\n setUpModeButtons();\n setUpSquares();\n reset();\n}", "function setINITIALcolour() {\n neonlightcolor = \"#222222\";\n root.style.setProperty(\"--neonlightcolor\", neonlightcolor);\n}", "function Editor() { }", "function Editor() { }", "_initializeEditor(editor) {\n const that = this;\n\n if (that.$[editor + 'Editor']) {\n that._editor = that.$[editor + 'Editor'];\n return;\n }\n\n const editorElement = document.createElement('jqx-' + JQX.Utilities.Core.toDash(editor));\n\n if (editor === 'numericTextBox') {\n editorElement.spinButtons = true;\n editorElement.inputFormat = 'floatingPoint';\n }\n else if (editor === 'dateTimePicker') {\n editorElement.dropDownAppendTo = that.$.container;\n editorElement.calendarButton = true;\n editorElement.dropDownDisplayMode = 'auto';\n editorElement.enableMouseWheelAction = true;\n editorElement.locale = that.locale;\n\n if (!editorElement.messages[that.locale]) {\n editorElement.messages[that.locale] = {};\n }\n\n editorElement.messages[that.locale].dateTabLabel = that.localize('dateTabLabel');\n editorElement.messages[that.locale].timeTabLabel = that.localize('timeTabLabel');\n }\n\n editorElement.theme = that.theme;\n editorElement.animation = that.animation;\n editorElement.$.addClass('jqx-hidden underlined');\n that.$.editorsContainer.appendChild(editorElement);\n that._editor = that.$[editor + 'Editor'] = editorElement;\n }", "@action\n setCustomColor() {\n // Set selected color if valid.\n let color = this.get('_customColor');\n if (this._validateColor(color)) {\n this.selectColor(color);\n }\n }", "cleanColor() {\n this.urlInput.color = \"#0A0A0F\"\n }", "constructor(color){\n this.color = color\n }" ]
[ "0.7226462", "0.6910648", "0.6772753", "0.6743187", "0.6701363", "0.66706365", "0.6508841", "0.6464322", "0.6459971", "0.6444418", "0.64343137", "0.63924754", "0.6390817", "0.638868", "0.6370697", "0.6367619", "0.6322547", "0.62874156", "0.6269315", "0.6259995", "0.6228138", "0.62201244", "0.62188876", "0.62187076", "0.61952484", "0.615026", "0.6140595", "0.6126531", "0.6118597", "0.61154264", "0.61080915", "0.61002594", "0.6064042", "0.6042283", "0.6040551", "0.6035497", "0.6032858", "0.6018701", "0.5962444", "0.5952798", "0.5949427", "0.5941516", "0.59246695", "0.59198505", "0.58991027", "0.58897567", "0.58775693", "0.58672404", "0.5862498", "0.5861565", "0.58583087", "0.5855413", "0.58506006", "0.58502", "0.5847493", "0.5840988", "0.58272696", "0.582041", "0.5816003", "0.5815099", "0.5807693", "0.58050853", "0.5803084", "0.5802829", "0.5802805", "0.579886", "0.579671", "0.5796378", "0.5790512", "0.57713985", "0.5765906", "0.57555693", "0.57541543", "0.5751163", "0.5746763", "0.5746763", "0.5742494", "0.5733177", "0.57169604", "0.57128626", "0.571284", "0.57072186", "0.5703502", "0.57029206", "0.56984395", "0.56959486", "0.56924266", "0.56924266", "0.56924266", "0.5692208", "0.56856495", "0.5682663", "0.5681589", "0.56806403", "0.5680312", "0.5680312", "0.5670022", "0.56679267", "0.5661212", "0.5659028" ]
0.7463424
0
Method to convert hex string (from input's value) to rgb array
function hexToRgb(hex) { const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? [ parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16) ] : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@autobind\n hexToRgb(hex) {\n console.log(\"hexToRgb\");\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, function(m, r, g, b) {\n return r + r + g + g + b + b;\n });\n\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? [\n parseInt(result[1], 16)/255,\n parseInt(result[2], 16)/255,\n parseInt(result[3], 16)/255\n ] : null;\n }", "function convertHexaToRgb() {\n let output = [];\n let arglength = arguments.length;\n if (arglength > 0) {\n let input = arguments;\n for (let i = 0; i < arglength; i++) {\n output.push(parseInt(arguments[i], 16));\n }\n }\n return output;\n}", "function hexToRgb(hex) {\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, function(m, r, g, b) {\n return r + r + g + g + b + b;\n });\n\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n if (!result) {\n console.log('Could not parse color', hex);\n return [0, 0, 0];\n }\n return [\n parseInt(result[1], 16),\n parseInt(result[2], 16),\n parseInt(result[3], 16)\n ];\n }", "function convertToRGB(hex) {\n var color = [];\n color[0] = parseInt((trim(hex)).substring(0, 2), 16);\n color[1] = parseInt((trim(hex)).substring(2, 4), 16);\n color[2] = parseInt((trim(hex)).substring(4, 6), 16);\n return color;\n }", "function hexToRgb(hex) {\n while (hex.charAt(0)=='#') {\n hex = hex.substr(1);\n }\n\n // parses string, returns integer in base 16\n var bigint = parseInt(hex, 16);\n\n var r = (bigint >> 16) & 255;\n var g = (bigint >> 8) & 255;\n var b = bigint & 255;\n\n return [r,g,b];\n}", "function convertToRGB(hex) {\n var color = [];\n\n color[0] = parseInt((trim(hex)).substring (0, 2), 16);\n color[1] = parseInt((trim(hex)).substring (2, 4), 16);\n color[2] = parseInt((trim(hex)).substring (4, 6), 16);\n\n return color;\n}", "function hexToRGB(hex) {\n var rStr = hex.substr(0, 2).toLowerCase(),\n\t\tgStr = hex.substr(2, 2).toLowerCase(),\n\t\tbStr = hex.substr(4, 2).toLowerCase();\n\t\tvar val = [parseInt(rStr, 16), parseInt(gStr, 16), parseInt(bStr, 16)];\n\t\treturn val;\n}", "_convertToRGB(hex) {\n var color = [];\n color[0] = parseInt((this._trim(hex)).substring(0, 2), 16);\n color[1] = parseInt((this._trim(hex)).substring(2, 4), 16);\n color[2] = parseInt((this._trim(hex)).substring(4, 6), 16);\n return color;\n }", "hexToRgb (hex) {\n var hexChars = {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, 'A': 10, 'B': 11, 'C': 12, 'D': 13, 'E': 14, 'F': 15};\n var result = [];\n // Remove \"#\"\n hex = hex.toUpperCase().match(/.{1,2}/g);\n // Split the red, green, and blue\n var r = hex[0].split(''), g = hex[1].split(''), b = hex[2].split('');\n \n result[0] = Math.round(hexChars[r[0]] * 16 + hexChars[r[1]]);\n result[1] = Math.round(hexChars[g[0]] * 16 + hexChars[g[1]]);\n result[2] = Math.round(hexChars[b[0]] * 16 + hexChars[b[1]]);\n return result;\n }", "function hexToRGB(hex) {\n\tlet val1, val2, val3;\n\t[val1, val2, val3 ] = hex.match(/.{1,2}/g)\n\trgb = [parseInt(val1, 16).toString(10), parseInt(val2, 16).toString(10), parseInt(val3, 16).toString(10)];\n\treturn rgb;\n}", "function hex2rgb(hexString) {\n if (hexString.lastIndexOf('#') > -1) {\n hexString = hexString.replace(/#/, '0x');\n } else {\n hexString = '0x' + hexString;\n }\n var r = hexString >> 16;\n var g = (hexString & 0x00FF00) >> 8;\n var b = hexString & 0x0000FF;\n return [r, g, b];\n}", "function hexToRGB(hex) {\n\tif(hex.charAt(0) == \"#\") hex = hex.slice(1); //Remove the '#' char - if there is one.\n\thex = hex.toUpperCase();\n\tvar hex_alphabets = \"0123456789ABCDEF\";\n\tvar value = new Array(3);\n\tvar k = 0;\n\tvar int1,int2;\n\tfor(var i=0;i<6;i+=2) {\n\t\tint1 = hex_alphabets.indexOf(hex.charAt(i));\n\t\tint2 = hex_alphabets.indexOf(hex.charAt(i+1));\n\t\tvalue[k] = (int1 * 16) + int2;\n\t\tk++;\n\t}\n\treturn(value);\n}", "function HEXtoRGB(hex) {\n r = hex.substr(0, 2);\n r = (hexChars.indexOf(r[0]) * 16 + hexChars.indexOf(r[1])) / 255;\n\n g = hex.substr(2, 2);\n g = (hexChars.indexOf(g[0]) * 16 + hexChars.indexOf(g[1])) / 255;\n\n b = hex.substr(4, 2);\n b = (hexChars.indexOf(b[0]) * 16 + hexChars.indexOf(b[1])) / 255;\n\n return [r, g, b];\n}", "function hex2rgb(hex) {\n\n var bigint = parseInt(hex, 16);\n var r = (bigint >> 16) & 255;\n var g = (bigint >> 8) & 255;\n var b = bigint & 255;\n\n return [r, g, b];\n }", "function convertToRGB (hex) {\n var color = [];\n color[0] = parseInt ((trim(hex)).substring (0, 2), 16);\n color[1] = parseInt ((trim(hex)).substring (2, 4), 16);\n color[2] = parseInt ((trim(hex)).substring (4, 6), 16);\n return color;\n}", "function _convertToRGB(hex) {\n if (_.isString(hex) == false || hex.charAt(0) !== '#') {\n console.error('hex should be a string start with \\'#\\'.');\n throw new Error('Invalid parameter');\n }\n\n var colors = null;\n if (hex.length === 4) {\n //abc => ['a','b','c'] => ['aa', 'bb', 'cc']\n colors = hex.slice(1).match(/.{1,1}/g).map(colors, function(val) {\n return val + val;\n });\n } else if (hex.length === 7) {\n colors = hex.slice(1).match(/.{1,2}/g);\n } else {\n console.error('hex should be a string with length equals to 4 or 7');\n throw new Error('Invalid parameter');\n }\n return colors.map(function(val) {\n return parseInt(val, 16);\n });\n}", "function convertToRGB (hex) {\n var color = [];\n color[0] = parseInt ((trim(hex)).substring (0, 2), 16);\n color[1] = parseInt ((trim(hex)).substring (2, 4), 16);\n color[2] = parseInt ((trim(hex)).substring (4, 6), 16);\n return color;\n}", "function hexToRgb(e){var a=/^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;e=e.replace(a,function(e,a,t,i){return a+a+t+t+i+i});var t=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}", "function hexToRgb(e){var a=/^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;e=e.replace(a,function(e,a,t,i){return a+a+t+t+i+i});var t=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}", "function hexToRgb(e){var a=/^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;e=e.replace(a,function(e,a,t,i){return a+a+t+t+i+i});var t=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}", "function hexToRgb(e){var a=/^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;e=e.replace(a,function(e,a,t,i){return a+a+t+t+i+i});var t=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}", "function hexToRgb(e){var a=/^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;e=e.replace(a,function(e,a,t,i){return a+a+t+t+i+i});var t=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}", "function hexToRgb(e){var a=/^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;e=e.replace(a,function(e,a,t,i){return a+a+t+t+i+i});var t=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}", "function rgbValues(hexColor) {\r\n var color = hexColor.substr(1);\r\n color = color.toLowerCase();\r\n\r\n if(color.length == 3) {\r\n var temp = '';\r\n for(var i=0; i<3; i++) {\r\n temp += color.substr(i, 1);\r\n temp += color.substr(i, 1);\r\n }\r\n color = temp;\r\n }\r\n var redValue = parseInt('0x' + color.substr(0,2));\r\n var greenValue = parseInt('0x' + color.substr(2,2));\r\n var blueValue = parseInt('0x' + color.substr(4,2));\r\n var result = [redValue, greenValue, blueValue];\r\n return result;\r\n}", "function convertToRGB (hex) {\n let color = [];\n color[0] = parseInt ((trim(hex)).substring (0, 2), 16);\n color[1] = parseInt ((trim(hex)).substring (2, 4), 16);\n color[2] = parseInt ((trim(hex)).substring (4, 6), 16);\n return color;\n}", "function hexToRGB(hex) {\n let red = parseInt(hex.substring(1, 3), 16);\n let green = parseInt(hex.substring(3, 5), 16);\n let blue = parseInt(hex.substring(5, 7), 16);\n console.log(173, \"RGB colors:\", red, green, blue);\n return [red, green, blue];\n}", "function hexToColor(hex) {\n\thex = hex.replace(\"#\", \"\");\n\t//console.log(hex + \" : \" + hex.length);\n\tvar vals = [];\n\tif (hex.length == 3) {\n\t\tvals.push( parseInt(\"0x\"+hex.substring(0,1)) / 15 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(1,2)) / 15 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(2,3)) / 15 );\n\t\tvals.push(1);\n\t}\n\tif (hex.length == 4) {\n\t\tvals.push( parseInt(\"0x\"+hex.substring(0,1)) / 15 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(1,2)) / 15 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(2,3)) / 15 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(3,4)) / 15 );\n\t}\n\tif (hex.length == 6) {\n\t\tvals.push( parseInt(\"0x\"+hex.substring(0,2)) / 255 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(2,4)) / 255 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(4,6)) / 255 );\n\t\tvals.push(1);\n\t}\n\tif (hex.length == 8) {\n\t\tvals.push( parseInt(\"0x\"+hex.substring(0,2)) / 255 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(2,4)) / 255 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(4,6)) / 255 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(6,8)) / 255 );\n\t}\n\treturn vals;\n}", "function hexToColor(hex) {\n\thex = hex.replace(\"#\", \"\");\n\t//console.log(hex + \" : \" + hex.length);\n\tvar vals = [];\n\tif (hex.length == 3) {\n\t\tvals.push( parseInt(\"0x\"+hex.substring(0,1)) / 15 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(1,2)) / 15 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(2,3)) / 15 );\n\t\tvals.push(1);\n\t}\n\tif (hex.length == 4) {\n\t\tvals.push( parseInt(\"0x\"+hex.substring(0,1)) / 15 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(1,2)) / 15 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(2,3)) / 15 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(3,4)) / 15 );\n\t}\n\tif (hex.length == 6) {\n\t\tvals.push( parseInt(\"0x\"+hex.substring(0,2)) / 255 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(2,4)) / 255 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(4,6)) / 255 );\n\t\tvals.push(1);\n\t}\n\tif (hex.length == 8) {\n\t\tvals.push( parseInt(\"0x\"+hex.substring(0,2)) / 255 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(2,4)) / 255 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(4,6)) / 255 );\n\t\tvals.push( parseInt(\"0x\"+hex.substring(6,8)) / 255 );\n\t}\n\treturn vals;\n}", "function hexToRgb(e) { var a = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n e = e.replace(a, function(e, a, t, i) { return a + a + t + t + i + i }); var t = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(e); return t ? { r: parseInt(t[1], 16), g: parseInt(t[2], 16), b: parseInt(t[3], 16) } : null }", "function hexToRgb(hex) {\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i\n hex = hex.replace(shorthandRegex, function(m, r, g, b) {\n return r + r + g + g + b + b\n })\n\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex)\n return result ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)] : null\n}", "function hexToRgb(hex) {\n // regex to convert the hex value\n /*\n ^# - starts with a hash symbol and matches the hash character\n ? - quantifier - match between 0 and 1 of the preceding token - can only have one hash token\n () - starts a capture group; hex values use six hexadecimal digits, the first two digits represent the red color, the second two the green color and the last two are the blue color. We simplifiy this by grouping 2 tokens three times.\n [] - a character set - matches any token with the set of defined characters - hexadecimal values range from 0-9 and then a-f, the charcter set defined matches on any numeric digit `\\d = 0-9` and the alpha characters a-f\n {} - quantifier - matches x number of the preceding tokens - we need two 0-9a-f tokens inside the capture group to make one color, so we define the quantifier with a value of 2 \n i - case insensitive matching - we don't care if the letter values are upper or lower case, it makes no difference.\n */\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n // console.log(result);\n /* \n result is an array of the hex values\n index[0] is the original value\n index[1] is the red color value\n index[2] is the green color value\n index[3] is the blue color value\n */\n // use a ternary operation to build out the rgb value of the hex color.\n /* parseInt() takes two parameters\n 1. the number to parse \n 2. the radix to return the parse value as. \n */\n // In our case we want hexadecimal which is base 16 (hexa = 6 = a - f, decimal = 10 = 0 - 9; 6 + 10 = 16).\n return result ? 'rgb(' + parseInt(result[1], 16) + ', ' + parseInt(result[2], 16) + ', ' + parseInt(result[3], 16) + ')' : null;\n }", "function hexToRgb(hex) {\n\t\t// regex to convert the hex value\n /*\n ^# - starts with a hash symbol and matches the hash character\n ? - quantifier - match between 0 and 1 of the preceding token - can only have one hash token\n () - starts a capture group; hex values use six hexadecimal digits, the first two digits represent the red color, the second two the green color and the last two are the blue color. We simplifiy this by grouping 2 tokens three times.\n [] - a character set - matches any token with the set of defined characters - hexadecimal values range from 0-9 and then a-f, the charcter set defined matches on any numeric digit `\\d = 0-9` and the alpha characters a-f\n {} - quantifier - matches x number of the preceding tokens - we need two 0-9a-f tokens inside the capture group to make one color, so we define the quantifier with a value of 2 \n i - case insensitive matching - we don't care if the letter values are upper or lower case, it makes no difference.\n */\n\t\tvar result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n\t\t// console.log(result);\n /* \n result is an array of the hex values\n index[0] is the original value\n index[1] is the red color value\n index[2] is the green color value\n index[3] is the blue color value\n */\n\t\t// use a ternary operation to build out the rgb value of the hex color.\n /* parseInt() takes two parameters\n 1. the number to parse \n 2. the radix to return the parse value as. \n */\n\t\t// In our case we want hexadecimal which is base 16 (hexa = 6 = a - f, decimal = 10 = 0 - 9; 6 + 10 = 16).\n\t\treturn result ? 'rgb(' + parseInt(result[1], 16) + ', ' + parseInt(result[2], 16) + ', ' + parseInt(result[3], 16) + ')' : null;\n\t}", "function HEXtoRGB(hex) {\n\t\tif(hex.length == 4) {\n\t\t\thex = [hex.slice(1,2),hex.slice(2,3),hex.slice(3,4)];\n\t\t}\n\t\t//#0F0F0F\n\t\telse if(hex.length == 7) {\n\t\t\thex = [hex.slice(1,3),hex.slice(3,5),hex.slice(5,7)];\n\t\t}\n var rgb = [parseInt(hex[0], 16), parseInt(hex[1], 16), parseInt(hex[2], 16)];\n\treturn rgb;\n}", "hexToRgb(hex) {\n if (typeof hex == \"string\" && /^([0-9A-F]{3}){1,2}$/i.test(hex))\n throw new Errors_1.UtilityError(\"Invalid hex code provided!\");\n hex = hex.replace(/^#/, \"\");\n let alpha = 1;\n if (hex.length === 8) {\n alpha = parseInt(hex.slice(6, 8), 16) / 255;\n hex = hex.slice(0, 6);\n }\n ;\n if (hex.length === 4) {\n alpha = parseInt(hex.slice(3, 4).repeat(2), 16) / 255;\n hex = hex.slice(0, 3);\n }\n ;\n if (hex.length === 3)\n hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];\n const num = parseInt(hex, 16);\n const red = num >> 16;\n const green = (num >> 8) & 255;\n const blue = num & 255;\n return [red, green, blue, alpha];\n }", "function convertHexToArrayColor(hexColor){\n if (hexColor) {\n // hex -> rgb -> array\n var rgb = hexToRgb(hexColor);\n return [ \n rgb.r / RGB_255,\n rgb.g / RGB_255, \n rgb.b / RGB_255 \n ];\n }\n }", "function hexToRGB(h) {\n\t\tif ( typeof h !== 'string' || !h.match(/^#([0-9A-F]{3}$)|([0-9A-F]{6}$)/i) ) return [0, 0, 0];\n\t\telse if ( h.match(/^(#[0-9a-f]{3})$/i) ) h = '#' + h[1] + h[1] + h[2] + h[2] + h[3] + h[3];\n\t\tvar rgb = [],\n\t\t\ti = 1;\n\n\t\tfor(; i < 6; i+=2) {\n\t\t\trgb.push(parseInt(h.substring(i, i + 2), 16));\n\t\t}\n\t\treturn rgb;\n\t}", "function hexToRgb(hex) {\n\tvar result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n\treturn result\n\t? [\n\t\tparseInt(result[1], 16),\n\t\tparseInt(result[2], 16),\n\t\tparseInt(result[3], 16)\n\t]\n\t: [0, 0, 0];\n}", "function processHEX(val) {\n //does the hex contain extra char?\n var hex = (val.length >6)?val.substr(1, val.length - 1):val;\n // is it a six character hex?\n if (hex.length > 3) {\n\n //scrape out the numerics\n var r = hex.substr(0, 2);\n var g = hex.substr(2, 2);\n var b = hex.substr(4, 2);\n\n // if not six character hex,\n // then work as if its a three character hex\n } else {\n\n // just concat the pieces with themselves\n var r = hex.substr(0, 1) + hex.substr(0, 1);\n var g = hex.substr(1, 1) + hex.substr(1, 1);\n var b = hex.substr(2, 1) + hex.substr(2, 1);\n\n }\n // return our clean values\n return [\n parseInt(r, 16),\n parseInt(g, 16),\n parseInt(b, 16)\n ]\n}", "function processHEX(val) {\n //does the hex contain extra char?\n var hex = (val.length >6)?val.substr(1, val.length - 1):val;\n // is it a six character hex?\n if (hex.length > 3) {\n\n //scrape out the numerics\n var r = hex.substr(0, 2);\n var g = hex.substr(2, 2);\n var b = hex.substr(4, 2);\n\n // if not six character hex,\n // then work as if its a three character hex\n } else {\n\n // just concat the pieces with themselves\n var r = hex.substr(0, 1) + hex.substr(0, 1);\n var g = hex.substr(1, 1) + hex.substr(1, 1);\n var b = hex.substr(2, 1) + hex.substr(2, 1);\n\n }\n // return our clean values\n return [\n parseInt(r, 16),\n parseInt(g, 16),\n parseInt(b, 16)\n ]\n}", "function hexToRGB(hex) {\n hex = hex.replace(\"#\", \"\");\n let r = parseInt(hex.substring(0, 2), 16);\n let g = parseInt(hex.substring(2, 4), 16);\n let b = parseInt(hex.substring(4, 6), 16);\n return [r / 255.0, g / 255.0, b / 255.0];\n}", "function hexToRgb(hexValue) {\n return [\n parseInt(hexValue.substr(1, 2), 16) / 255, // compute \"R\" value\n parseInt(hexValue.substr(3, 2), 16) / 255, // compute \"G\" value\n parseInt(hexValue.substr(5, 2), 16) / 255, // compute \"B\" value\n ];\n}", "function hex2Rgb(hex) {\n var color = [];\n color[0] = parseInt((trim(hex)).substring(0, 2), 16);\n color[1] = parseInt((trim(hex)).substring(2, 4), 16);\n color[2] = parseInt((trim(hex)).substring(4, 6), 16);\n return color;\n}", "function parseHexColor(color) {\n var array = new Uint8ClampedArray(4);\n if (color.length === 7) {\n var value = parseInt(color.substring(1), 16);\n array[0] = value / 65536;\n array[1] = value / 256 % 256;\n array[2] = value % 256;\n array[3] = 255;\n } else if (color.length === 9) {\n var _value = parseInt(color.substring(1), 16);\n array[0] = _value / 16777216;\n array[1] = _value / 65536 % 256;\n array[2] = _value / 256 % 256;\n array[3] = _value % 256;\n }\n return array;\n}", "function hex2rgb(hex) {\n var r = parseInt(hex.slice(0, 2), 16)\n var g = parseInt(hex.slice(2, 4), 16)\n var b = parseInt(hex.slice(4, 6), 16)\n\n return [r, g, b]\n}", "function hexToRgb(e) {\n var a = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n e = e.replace(a, function (e, a, t, i) {\n return a + a + t + t + i + i\n });\n var t = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(e);\n return t ? {r: parseInt(t[1], 16), g: parseInt(t[2], 16), b: parseInt(t[3], 16)} : null\n}", "function hexToRgb(hex) {\n if (hex[0]=='#') hex=hex.substr(1);\n var c = parseInt(hex, 16);\n var r = (c >> 16) & 255;\n var g = (c >> 8) & 255;\n var b = c & 255;\n return r + \",\" + g + \",\" + b;\n}", "function hexToRgb(hex) {\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)] : null;\n}", "function HexToRgb(hex) {\n const red = parseInt(hex[0] + hex[1], 16);\n const green = parseInt(hex[2] + hex[3], 16);\n const blue = parseInt(hex[4] + hex[5], 16);\n return [red, green, blue];\n}", "hexToRGB(hex) {\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? {\n red: parseInt(result[1], 16),\n green: parseInt(result[2], 16),\n blue: parseInt(result[3], 16)\n } : null;\n }", "function hexToRgb(hex){\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? parseInt(result[1], 16) +','+ parseInt(result[2], 16) +',' + parseInt(result[3], 16) : null;\n}", "static hexToRGB(hex) {\n if (hex.charAt(0) === \"#\") { hex = hex.substr(1); }\n const r = parseInt(hex.substr(0, 2), 16);\n const g = parseInt(hex.substr(2, 2), 16);\n const b = parseInt(hex.substr(4, 2), 16);\n\n return {r, g, b};\n }", "function rgb2Hex(s) {\n //@ts-ignore\n return s.match(/[0-9]+/g).reduce(function (a, b) { return a + (b | 256).toString(16).slice(1); }, '#').toString(16);\n}", "function hexToRGB(hex) {\r\n var hashed = hex.charAt(0) == \"#\" ? hex.substring(1, 7) : hex;\r\n var R = parseInt(hashed.substring(0, 2), 16);\r\n var G = parseInt(hashed.substring(2, 4), 16);\r\n var B = parseInt(hashed.substring(4, 6), 16);\r\n var RGB = `rgb(${R}, ${G}, ${B})`;\r\n // I used a array here to return the Color Values separated.\r\n // Original Function: https://codepen.io/Tibixx/pen/RJbjBE\r\n return [R, G, B]; //RGB;\r\n}", "function hexToRgb(e) {\n var a = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n e = e.replace(a, function (e, a, t, i) {\n return a + a + t + t + i + i\n });\n var t = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(e);\n return t ? {\n r: parseInt(t[1], 16),\n g: parseInt(t[2], 16),\n b: parseInt(t[3], 16)\n } : null\n}", "function hexToRgb(hex) {\n var c;\n if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)) {\n c = hex.substring(1).split(\"\");\n if (c.length == 3) {\n c = [c[0], c[0], c[1], c[1], c[2], c[2]];\n }\n c = \"0x\" + c.join(\"\");\n return [(c >> 16) & 255, (c >> 8) & 255, c & 255].join(\",\");\n }\n return `${hex} is not a valid Hex code.`;\n }", "function rgbToHex(str) {\n\tcolour = [];\n\tstr.replace(/[a-z())]+/g, '')\n\t\t.split(',')\n\t\t.map(val => {\n\t\t\tlet value = Number(val).toString(16);\n\t\t\tvalue = value < 2 ? `0${value}` : value;\n\t\t\tcolour.push(value);\n\t\t});\n\treturn '#' + colour.join('');\n}", "function hexToRgbA(hex) {\n\tvar c;\n\tif (/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)) {\n\t\tc = hex.substring(1).split('');\n\t\tif (c.length == 3) {\n\t\t\tc = [c[0], c[0], c[1], c[1], c[2], c[2]];\n\t\t}\n\t\tc = '0x' + c.join('');\n\t\treturn [(c >> 16) & 255, (c >> 8) & 255, c & 255, 255];\n\t}\n\tthrow new Error('Bad Hex');\n}", "function convertHexaToRgb(color) {\n /* var r = parseInt(hex.substring(1, 3), 16); */\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n\n console.log(`rgb (${r},${g},${b})`);\n}", "function hexToRgb(hex) {\n var c;\n if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)) {\n\t\t// console.log(\"we reached tihis\");\n c = hex.substring(1).split('');\n if (c.length == 3) {\n c = [c[0], c[0], c[1], c[1], c[2], c[2]];\n }\n c = '0x' + c.join('');\n return new Color(((c >> 16) & 255) / 255.0, ((c >> 8) & 255) / 255.0, (c & 255) / 255.0)\n }\n throw new Error('Bad Hex');\n}", "function hexToRgb(hex) {\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, function(m, r, g, b) {\n return r + r + g + g + b + b;\n });\n\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16)\n } : null;\n\t\n}", "function hexToRGB(hexValue) {\n const rString = hexValue.substring(1, 3);\n const gString = hexValue.substring(3, 5);\n const bString = hexValue.substring(5, 7);\n \n const r = parseInt(rString, 16);\n const g = parseInt(gString, 16);\n const b = parseInt(bString, 16);\n\n let rgb = {\n r,\n g,\n b,\n }\n return rgb;\n}", "function rgbStr2digitsArray( rgbStr, normalize )\n {\n rgbStr = rgbStr.replace('#','');\n var r = parseInt( rgbStr.substring(0,2), 16 );\n var g = parseInt( rgbStr.substring(2,4), 16 );\n var b = parseInt( rgbStr.substring(4,6), 16 );\n if( normalize ) {\n r = Math.min( r/255, 1 );\n g = Math.min( g/255, 1 );\n b = Math.min( b/255, 1 );\n }\n return [ r, g, b ];\n }", "function html2rgb(s) {\n var r = 0;\n var g = 0;\n var b = 0;\n if(s.length == 7) {\n r = parseInt('0x'+s.slice(1,3))/255;\n g = parseInt('0x'+s.slice(3,5))/255;\n b = parseInt('0x'+s.slice(5,7))/255;\n }\n return [r,g,b];\n}", "function hexToRgb(hex) {\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, function (m, r, g, b) {\n return r + r + g + g + b + b;\n });\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16)\n } : undefined;\n}", "function hexToDec(hex) {\n // Remove hash\n if(hex.charAt(0) == '#') {\n hex = hex.substr(1, 7);\n }\n \n // Return an array with rgb values\n return Array(parseInt(hex.substr(0, 2), 16), parseInt(hex.substr(2, 2), 16), parseInt(hex.substr(4, 2), 16));\n }", "function hexToRgb(hex) {\n\n// nothing to do\r\nif (hex.length < 3) return null;\r\n \r\n var temp,hxv;\r\n hxv = temp = hex;\r\n \r\n if (hxv.length == 3) {\r\n\r\n hxv = \"\";\r\n temp = /^([a-f0-9])([a-f0-9])([a-f0-9])$/i .exec(temp).slice(1);\r\n\r\n for (var i = 0; i < 3; i++) {\r\n var col = temp[i];\r\n // mak a 2-tuple out of it\r\n hxv += col + col;\r\n }\r\n }\r\n\r\n if (hxv.length == 6) {\r\n var triplets = /^([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i .exec(hxv).slice(1);\r\n\r\n // prepare for calculation\r\n hxv = \"0x\" + triplets.join(\"\");\r\n return {\r\n R: (hxv & 0xff0000) >> 16,\r\n G: (hxv & 0x00ff00) >> 8,\r\n B: (hxv & 0x0000ff)\r\n };\r\n }\r\n \r\n return null;\r\n}", "function hexToRgb(hex) {\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, function(m, r, g, b) {\n return r + r + g + g + b + b;\n });\n\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result\n ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16)\n }\n : null;\n}", "function hexToRGB(hex) {\n // hex = checkChosenColor();\n let r = parseInt(hex.substring(1, 3), 16);\n let g = parseInt(hex.substring(3, 5), 16);\n let b = parseInt(hex.substring(5, 7), 16);\n return { r, g, b };\n}", "function hexToRgb(hex) {\n\t\t// Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n\t\tvar shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n\t\thex = hex.replace(shorthandRegex, function(m, r, g, b) {\n\t\t\treturn r + r + g + g + b + b;\n\t\t});\n\n\t\tvar result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n\t\treturn result ? {\n\t\t\tr: parseInt(result[1], 16),\n\t\t\tg: parseInt(result[2], 16),\n\t\t\tb: parseInt(result[3], 16)\n\t\t} : null;\n\t}", "function hexToRgb(hex) {\n \tvar result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n \treturn result ? {\n \t\tred: parseInt(result[1], 16),\n \t\tgreen: parseInt(result[2], 16),\n \t\tblue: parseInt(result[3], 16)\n \t} : null;\n\t}", "function HexToRGB(hex) {\r\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\r\n hex = hex.replace(shorthandRegex, function (m, r, g, b) {\r\n return r + r + g + g + b + b;\r\n });\r\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\r\n return result ? {\r\n r: parseInt(result[1], 16),\r\n g: parseInt(result[2], 16),\r\n b: parseInt(result[3], 16)\r\n } : null;\r\n }", "function HexToArray(color: string): Array<number> {\n let colHex: string = color.slice(1);\n if (colHex.length < 6) {\n colHex =\n `${colHex[0]}${colHex[0]}${colHex[1]}${colHex[1]}${colHex[2]}${colHex[2]}`;\n }\n const col: Array<number> = [\n parseInt(colHex.slice(0, 2), 16) / 255.0,\n parseInt(colHex.slice(2, 4), 16) / 255.0,\n parseInt(colHex.slice(4, 6), 16) / 255.0,\n 1,\n ];\n return col;\n}", "function hex (color) {\n var c = color[0] === '#' ? color.substring(1) : color\n , r = c.substring(0, 2)\n , g = c.substring(2, 4)\n , b = c.substring(4, 6)\n return [parseInt(r, 16), parseInt(g, 16), parseInt(b, 16)]\n}", "function hex (color) {\n var c = color[0] === '#' ? color.substring(1) : color\n , r = c.substring(0, 2)\n , g = c.substring(2, 4)\n , b = c.substring(4, 6)\n return [parseInt(r, 16), parseInt(g, 16), parseInt(b, 16)]\n}", "function hex (color) {\n var c = color[0] === '#' ? color.substring(1) : color\n , r = c.substring(0, 2)\n , g = c.substring(2, 4)\n , b = c.substring(4, 6)\n return [parseInt(r, 16), parseInt(g, 16), parseInt(b, 16)]\n}", "function html2rgb (s) {\n let r = 0\n let g = 0\n let b = 0\n if (s.length === 7) {\n r = parseInt('0x' + s.slice(1, 3)) / 255\n g = parseInt('0x' + s.slice(3, 5)) / 255\n b = parseInt('0x' + s.slice(5, 7)) / 255\n }\n return [r, g, b]\n}", "function convertRgbToHexa() {\n let output = [];\n let arglength = arguments.length;\n if (arglength > 0) {\n let input = arguments;\n for (let i = 0; i < arglength; i++) {\n output.push(arguments[i].toString(16));\n }\n }\n return output;\n}", "function hexToRgb(hex) {\r\n\t\tvar result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\r\n\t\treturn result ? {\r\n\t\t\tr: parseInt(result[1], 16),\r\n\t\t\tg: parseInt(result[2], 16),\r\n\t\t\tb: parseInt(result[3], 16)\r\n\t\t} : null;\r\n\t}", "function hexToRgb( hex ) {\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace( shorthandRegex, function( m, r, g, b ) {\n return r + r + g + g + b + b;\n } );\n\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec( hex );\n return result ? {\n r: parseInt( result[1], 16 ),\n g: parseInt( result[2], 16 ),\n b: parseInt( result[3], 16 )\n } : null;\n}", "function hexToRgb(hex){\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16)\n }: null;\n}", "hexToRgb(hex) {\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n\n return \"rgb(\" + parseInt(result[1], 16) + \",\" + parseInt(result[2], 16) + \",\" + parseInt(result[3], 16) + \")\";\n }", "function hexToRgb(hex) {\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16)\n } : null;\n }", "function hexToRgb(hex) {\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16)\n } : null;\n }", "function hexToRgb(hex) {\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16)\n } : null;\n }", "function hexToRgb(hex) {\n\t var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n\t hex = hex.replace(shorthandRegex, function(m, r, g, b) {\n\t return r + r + g + g + b + b;\n\t });\n\n\t var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n\t \n\t return result ? {\n\t r: parseInt(result[1], 16),\n\t g: parseInt(result[2], 16),\n\t b: parseInt(result[3], 16),\n\t a: 255\n\t } : null;\n\t}", "function hexToRgb(hex) {\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result && result.length === 4 ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16),\n a: 1,\n } : null;\n }", "function hex2rgb(hex) {\n hex = (hex.substr(0,1)==\"#\") ? hex.substr(1) : hex;\n return 'rgb('+parseInt(hex.substr(0,2), 16) + ','+ parseInt(hex.substr(2,2), 16)+ ',' + parseInt(hex.substr(4,2), 16) + ')';\n }", "function unpack(color) {\n var re = /^rgb\\((.*?),(.*?),(.*?)\\)/;\n if (color.length == 7) {\n return [parseInt('0x' + color.substring(1, 3)) / 255,\n parseInt('0x' + color.substring(3, 5)) / 255,\n parseInt('0x' + color.substring(5, 7)) / 255];\n }\n else if (color.length == 4) {\n return [parseInt('0x' + color.substring(1, 2)) / 15,\n parseInt('0x' + color.substring(2, 3)) / 15,\n parseInt('0x' + color.substring(3, 4)) / 15];\n }\n else if (re.test(color)) {\n return [parseFloat(color.replace(re, \"$1\") / 255),\n parseFloat(color.replace(re, \"$2\") / 255),\n parseFloat(color.replace(re, \"$3\") / 255)];\n }\n else return color;\n }", "function hexToRgb(hex: Color) {\n const r = parseInt(hex.substring(0, 2), 16);\n const g = parseInt(hex.substring(2, 4), 16);\n const b = parseInt(hex.substring(4, 6), 16);\n\n return { r, g, b };\n}", "function hexToRgb(hex) {\n\t\t var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n\t\t return result ? {\n\t\t r: parseInt(result[1], 16),\n\t\t g: parseInt(result[2], 16),\n\t\t b: parseInt(result[3], 16)\n\t\t } : null;\n\t\t}", "function hexToRgb(hex) {\n let r = parseInt(hex.substring(1, 3), 16);\n let g = parseInt(hex.substring(3, 5), 16);\n let b = parseInt(hex.substring(5, 7), 16);\n return { r: r, g: g, b: b };\n}", "function HexToRgb(hex) {\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16)\n };\n}", "function hexToRgb(hex) {\r\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\r\n return result ? {\r\n r: parseInt(result[1], 16),\r\n g: parseInt(result[2], 16),\r\n b: parseInt(result[3], 16)\r\n } : null;\r\n}", "function hexToRgb(hex) {\n\t\tvar result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n\t\treturn result ? {\n\t\t\tr: parseInt(result[1], 16),\n\t\t\tg: parseInt(result[2], 16),\n\t\t\tb: parseInt(result[3], 16)\n\t\t} : null;\n\t}", "function hexToRgb(hex){\n var c;\n if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)){\n c= hex.substring(1).split('');\n if(c.length== 3){\n c= [c[0], c[0], c[1], c[1], c[2], c[2]];\n }\n c= '0x'+c.join('');\n return 'rgb('+[(c>>16)&255, (c>>8)&255, c&255].join(',') + ')';\n }\n throw new Error('Bad Hex');\n}", "static hexToRgb(hex) {\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})?$/i.exec(hex);\n return result ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16),\n w: (result[4] != null) ? parseInt(result[4], 16) : 0\n } : null;\n }", "function hexToRgbA(hex){\n let c;\n if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)){\n c= hex.substring(1).split('');\n if(c.length== 3){\n c= [c[0], c[0], c[1], c[1], c[2], c[2]];\n }\n c= '0x'+c.join('');\n return 'rgba('+[(c>>16)&255, (c>>8)&255, c&255].join(',')+',0.5)';\n }\n throw new Error('Bad Hex');\n}", "function hex2Rgb(hex){\r\n var rgbColor = new RGBColor();\r\n if(hex.charAt(0) == \"#\") {\r\n hex = hex.substring(1,7);\r\n }\r\n rgbColor.red = parseInt(hex.substring(0,2),16);\r\n rgbColor.green = parseInt(hex.substring(2,4),16);\r\n rgbColor.blue = parseInt(hex.substring(4,6),16);\r\n return rgbColor;\r\n}", "function hexToRgb(hex) {\n\t var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n\t return result ? {\n\t r: parseInt(result[1], 16),\n\t g: parseInt(result[2], 16),\n\t b: parseInt(result[3], 16)\n\t } : null;\n\t}", "function hexToRgb(hex) {\n\t var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n\t return result ? {\n\t r: parseInt(result[1], 16),\n\t g: parseInt(result[2], 16),\n\t b: parseInt(result[3], 16)\n\t } : null;\n\t}" ]
[ "0.7845003", "0.77312917", "0.77218074", "0.76931614", "0.7691661", "0.76538444", "0.7651057", "0.7648551", "0.7617549", "0.76046914", "0.75895077", "0.75861865", "0.75617576", "0.7559461", "0.75558597", "0.7543058", "0.75375456", "0.7536097", "0.7536097", "0.7536097", "0.7536097", "0.7536097", "0.7536097", "0.7522104", "0.7501458", "0.7498318", "0.7483714", "0.7483714", "0.74553746", "0.74540734", "0.74330014", "0.74286956", "0.7386965", "0.7381689", "0.7378237", "0.73637974", "0.73607963", "0.7356078", "0.7356078", "0.7344354", "0.73319423", "0.73267764", "0.7318776", "0.7300762", "0.72474945", "0.7244861", "0.72371995", "0.72314626", "0.72290003", "0.7226853", "0.7223201", "0.72220904", "0.72185725", "0.72137856", "0.71998155", "0.7195472", "0.7183247", "0.71808845", "0.7162027", "0.71209913", "0.7119145", "0.71171576", "0.7091372", "0.70879716", "0.7066155", "0.70587385", "0.70548284", "0.7049414", "0.7042915", "0.7027823", "0.70206237", "0.701648", "0.701421", "0.701421", "0.701421", "0.7004637", "0.69798356", "0.6965146", "0.6957386", "0.6954327", "0.69433403", "0.69425315", "0.69425315", "0.69405025", "0.6925579", "0.69248277", "0.6923614", "0.6919172", "0.6915789", "0.6913532", "0.6913186", "0.68976355", "0.6893467", "0.689323", "0.68897355", "0.6884605", "0.6884104", "0.6883059", "0.6882941", "0.6882941" ]
0.72718436
44
Compile Sass to CSS, Embed Source Map in Development
async compile(config) { return new Promise((resolve, reject) => { if (!isProd) { config.sourceMap = true config.sourceMapEmbed = true config.outputStyle = 'expanded' } return sass.render(config, (err, result) => { if (err) { return reject(err) } resolve(result.css.toString()) }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cssDev(){\n\treturn src('./src/sass/main.sass')\n\t\t.pipe(sourcemaps.init({largeFile: true}))\n\t\t.pipe(sass().on('error', sass.logError))\n\t\t.pipe(autoprefixer({\n\t\t\tbrowsers: [\n\t\t\t\t'Android 2.3',\n\t\t\t\t'Android >= 4',\n\t\t\t\t'Chrome >= 20',\n\t\t\t\t'Firefox >= 24', // Firefox 24 is the latest ESR\n\t\t\t\t'Explorer >= 8',\n\t\t\t\t'iOS >= 6',\n\t\t\t\t'Opera >= 12',\n\t\t\t\t'Safari >= 6'\n\t\t\t],\n\t\t\tcascade: false\n\t\t}))\n\t\t//.pipe(hash({\n\t\t//\t\"format\": \"{name}.{hash}{ext}\"\n\t\t//}))\n\t\t.pipe(sourcemaps.write('./map'))\n\t\t.pipe(dest(paths.devDir + paths.staticDir + '/css'));\n}", "function compilarSass(){\n return src(paths.url_scss)\n .pipe( sourcemaps.init())\n .pipe( sass())\n .pipe( postcss( [autoprefixer(), cssnano()] ))\n .pipe( sourcemaps.write('.'))\n .pipe( dest(\"./build/css\"))\n}", "function sassToCss() {\n return gulp.src('src/assets/scss/builders/main.scss')\n .pipe($.sourcemaps.init())\n .pipe($.sass({\n includePaths: PATHS.sass\n })\n .on('error', $.sass.logError))\n .pipe($.autoprefixer({\n browsers: COMPATIBILITY\n }))\n\n // Comment in the pipe below to run UnCSS in production\n //.pipe($.if(PRODUCTION, $.uncss(UNCSS_OPTIONS)))\n .pipe($.if(PRODUCTION, $.cleanCss({compatibility: 'ie9'})))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/assets/css'))\n .pipe(pixrem({rootValue: '16px', replace: true}))\n .pipe(browser.reload({stream: true}));\n}", "function scssDev() {\n return src('scss/styles.scss')\n .pipe(sourcemaps.init())\n .pipe(\n sass({ outputStyle: 'expanded' }).on('error', function (err) {\n console.log(err.message);\n this.emit('end');\n })\n )\n .pipe(autoprefixer({ cascade: false, grid: true }))\n .pipe(sourcemaps.write('.'))\n .pipe(dest('dist'));\n}", "function sass() {\n return gulp.src('src/assets/scss/app.scss')\n .pipe($.sourcemaps.init())\n .pipe($.sass({\n includePaths: PATHS.sass\n })\n .on('error', $.sass.logError))\n .pipe($.autoprefixer({\n browsers: COMPATIBILITY\n }))\n // Comment in the pipe below to run UnCSS in production\n //.pipe($.if(PRODUCTION, $.uncss(UNCSS_OPTIONS)))\n .pipe($.if(PRODUCTION, $.cssnano()))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/assets/css'))\n .pipe(browser.reload({ stream: true }));\n }", "function sass() {\n return gulp.src('.' + PATHS.sass + '**/*.scss')\n .pipe($.sourcemaps.init())\n .pipe($.sass({\n includePaths: PATHS.sass,\n noCache: true\n })\n .on('error', $.sass.logError))\n .pipe($.autoprefixer({\n browsers: COMPATIBILITY\n }))\n // Comment in the pipe below to run UnCSS in production\n //.pipe($.if(PRODUCTION, $.uncss(UNCSS_OPTIONS)))\n .pipe($.sourcemaps.write())\n .pipe(gulp.dest('./dist/css'))\n .pipe(browser.reload({ stream: true }));\n}", "function compileSass() {\r\n\treturn gulp\r\n\t\t.src( paths.scss.src )\r\n\t\t.pipe(\r\n\t\t\tsass( {\r\n\t\t\t\tindentType: 'tab',\r\n\t\t\t\tindentWidth: 1,\r\n\t\t\t\toutputStyle: 'expanded'\r\n\t\t\t} )\r\n\t\t)\r\n\t\t.pipe( gulp.dest( paths.scss.dest ) )\r\n\t\t.on( 'error', notify.onError() );\r\n}", "function scssTask() {\n return src(files.scssPath)\n .pipe(sourcemaps.init())\n .pipe(sass({outputStyle: \"compressed\"}).on(\"error\", sass.logError))\n .pipe(sourcemaps.write(\"./\"))\n .pipe(dest(\"public/css\"))\n}", "function compileCSS() {\r\n var paths = [source.sass.path].concat(sassLibs);\r\n\r\n return src(source.sass.main)\r\n .pipe(sourcemaps.init())\r\n .pipe(sass({includePaths: paths}))\r\n .pipe(rename(cssMain))\r\n .pipe(sourcemaps.write())\r\n .pipe(dest(getCSSPath()));\r\n\r\n}", "function sassTask() {\nreturn src(files.sassPath)\n.pipe(browserSync.stream())\n.pipe(sourcemaps.init())\n.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))\n.pipe(sourcemaps.write('.maps'))\n.pipe(dest('pub')\n);\n}", "function sass() {\n return gulp.src('scss/app.scss')\n .pipe($.sourcemaps.init())\n .pipe($.sass({\n includePaths: PATHS.sass\n })\n .on('error', $.sass.logError))\n .pipe($.autoprefixer({\n browsers: COMPATIBILITY\n }))\n .pipe($.if(PRODUCTION, $.cssnano()))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/public/css'));\n}", "function build(){\n return gulp.src( config.assetPath + \"/styles/**/*.sass\")\n .pipe(sourcemaps.init())\n .pipe(sass({\"style\": \"expanded\"}))\n .on(\"error\", handleErrors)\n .pipe(autoprefixer({\n \"browsers\": config.build.browserlist,\n \"cascade\": false\n }))\n .pipe(sourcemaps.write())\n .pipe(gulp.dest( config.dev + \"/css\" ))\n}", "function scssTask(){ \r\n return src(files.scssPath)\r\n .pipe(sourcemaps.init()) // initialize sourcemaps first\r\n .pipe(sass()) // compile SCSS to CSS\r\n .pipe(postcss([ autoprefixer(), cssnano() ])) // PostCSS plugins\r\n .pipe(sourcemaps.write('.')) // write sourcemaps file in current directory\r\n .pipe(dest('dist/css')\r\n );\r\n}", "function css(){\n return src(paths.scss)\n .pipe(sourcemaps.init())\n .pipe(sass())\n .pipe(postcss([autoprefixer(), cssnano()]))\n .pipe(sourcemaps.write('.'))\n .pipe(dest('./build/css'));\n }", "function sass() {\n return gulp.src(PATHS.srcScssApp)\n .pipe($.sourcemaps.init())\n .pipe($.sass({\n includePaths: PATHS.sassLibraries\n })\n .on('error', $.sass.logError))\n .pipe($.autoprefixer({\n browsers: COMPATIBILITY\n }))\n // Comment in the pipe below to run UnCSS in production\n //.pipe($.if(PRODUCTION, $.uncss(UNCSS_OPTIONS)))\n .pipe($.if(PRODUCTION, $.cleanCss({\n compatibility: 'ie9'\n })))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.distCSS))\n .pipe(browser.reload({\n stream: true\n }));\n}", "function scssTask() {\n\n return src(files.scssPath)\n\n .pipe(sourcemaps.init()) // initialize sourcemaps first\n\n .pipe(sass()) // compile SCSS to CSS\n\n .pipe(postcss([autoprefixer(), cssnano()])) // PostCSS plugins \n\n .pipe(sourcemaps.write('.')) // write sourcemaps file in current directory\n\n .pipe(dest('src/css')\n\n ); // put final CSS in src folder\n\n}", "function sassy() {\r\n\treturn gulp\r\n\t\t.src(sassFiles)\r\n\t\t.pipe(sourcemaps.init())\r\n\t\t.pipe(sass().on('error', sass.logError)) //Using gulp-sass\r\n\t\t.pipe(sourcemaps.write(sourceMaps))\r\n\t\t// .pipe(rename(path => {\r\n\t\t// \tlet name = path.dirname.replace('../maps/', '')\r\n\r\n\t\t// \t\tpath.dirname = ''\r\n\t\t// \t\tpath.basename = name\r\n\t\t// \t\tpath.extname = path.extname\r\n\t\t// }))\r\n\t\t.pipe(gulp.dest('src/blocks'))\r\n}", "function scssTask() {\n return src(paths.sass.src)\n .pipe(sourcemaps.init()) // initialize sourcemaps first\n .pipe(sass()) // compile SCSS to CSS\n .pipe(postcss([autoprefixer(), cssnano()])) // PostCSS plugins\n .pipe(sourcemaps.write(\".\")) // write sourcemaps file in current directory\n .pipe(dest(paths.sass.dest)); // put final CSS in dist folder\n}", "function sass() {\r\n\tconst postCssPlugins = [ \t\t// Autoprefixer siehe https://www.npmjs.com/package/autoprefixer\r\n\t\tautoprefixer({ browsers: CONF.COMPATIBILITY }),\r\n\t].filter(Boolean);\r\n\tconst sourcefiles = [SRC + '/assets/scss/app.scss', SRC + '/assets/scss/editor.scss'];\r\n\r\n\treturn gulp.src(sourcefiles)\r\n\t\t.pipe($.sourcemaps.init())\r\n\t\t.pipe($.sass({\r\n\t\t\tincludePaths: CONF.PATHS.sass\r\n\t\t})\r\n\t\t\t.on('error', $.sass.logError))\r\n\t\t.pipe($.postcss(postCssPlugins))\r\n\t\t.pipe(rename({ suffix: \"-roh\", }))\r\n\t\t.pipe(gulp.dest(CONF.PATHS.dist + '/assets/css'))\t//****************** DEST roh ******************************\r\n\t\t// .pipe(rename({ suffix: \"-uncss\", }))\r\n\t\t// .pipe(uncss(CONF.PATHS.uncss_options))\r\n\t\t// .pipe(gulp.dest(CONF.PATHS.dist + '/assets/css'))\t//****************** DEST uncss ******************************\r\n\t\t.pipe(rename({ suffix: \"-cleancss\", }))\r\n\t\t.pipe($.cleanCss({ compatibility: 'ie9' }))\r\n\t\t.pipe(gulp.dest(CONF.PATHS.dist + '/assets/css'))\t//****************** DEST cleanCss ******************************\r\n\t\t.pipe(rename({ suffix: \"-sourcemap\", }))\r\n\t\t.pipe($.sourcemaps.write())\r\n\t\t.pipe(gulp.dest(CONF.PATHS.dist + '/assets/css'));\t//****************** DEST sourcemap ******************************\r\n\t\t// .pipe(rename({\tsuffix: \"-rev\", }))\r\n\t\t// .pipe($.rev())\r\n\t\t// .pipe(gulp.dest(CONF.PATHS.dist + '/assets/css'))\t//****************** DEST rev ******************************\r\n\t\t// .pipe(rename({\tsuffix: \"-manifest\", }))\r\n\t\t// .pipe($.rev.manifest())\r\n\t\t// .pipe(gulp.dest(CONF.PATHS.dist + '/assets/css'))\t//****************** DEST manifest ******************************\r\n}", "function compileScss() {\n return gulp.src(['./assets/scss/**/*.scss'])\n .pipe($.sass())\n .pipe(gulp.dest('./assets/css'));\n}", "function compileSCSS() {\n\n const sass = require('sass');\n const postcss = require('postcss');\n const postcssPresetEnv = require('postcss-preset-env');\n\n console.info('\\x1b[36m','😻 Rendering sass...');\n\n sass.render({\n file: './src/scss/app.scss',\n outputStyle: envType !== 'production' ? \"expanded\" : 'compressed',\n sourceMap: false,\n outFile: './dist/css/app.css',\n },\n function(error, result) {\n if (!error) {\n\n postcss([ postcssPresetEnv ])\n .process(result.css, { from: undefined, to: 'dist/css/app.css' })\n .then(result => {\n\n fs.writeFile('./dist/css/app.css', result.css, err => {\n !err ? console.info('\\x1b[32m',`🍕 CSS written to file!`) : null;\n });\n\n });\n\n } else {\n\n console.error(error);\n\n }\n });\n\n}", "function sass() {\n return gulp.src('src/styles/main.scss')\n .pipe($.sourcemaps.init())\n .pipe($.sass({\n includePaths: PATHS.sass\n })\n .on('error', $.sass.logError))\n .pipe($.autoprefixer({\n browsers: COMPATIBILITY\n }))\n .pipe($.if(PRODUCTION, $.cleanCss({ compatibility: 'ie9' })))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/styles'));\n}", "function sass() {\n return gulp\n .src(config.src + 'styles/main.scss')\n .pipe(\n gulp_plumber({\n errorHandler: gulp_notify.onError('SASS Error: <%= error.message %>')\n })\n )\n .pipe(gulp_sourcemaps.init())\n .pipe(gulp_sass().on('error', gulp_sass.logError))\n .pipe(\n gulp_autoprefixer({\n browsers: ['last 2 versions']\n })\n )\n .pipe(gulp_cssnano())\n .pipe(gulp_sourcemaps.write())\n .pipe(gulp_rename('main.min.css'))\n .pipe(gulp.dest(config.assets + 'css'))\n .pipe(gulp_notify('SASS compiled: <%= file.relative %>'));\n}", "function compileToReadableCSS() {\n return src(srcFiles.pathSCSS)\n .pipe(sourcemaps.init())\n .pipe(sass({ outputStyle: \"expanded\" }))\n .pipe(sourcemaps.write(\".\"))\n .pipe(dest(destFolders.readable));\n}", "function scssTask() {\n return src(files.scssPath)\n .pipe(sourcemaps.init())\n .pipe(sass({outputStyle: \"compressed\"}).on(\"error\", sass.logError))\n .pipe(sourcemaps.write(\"./\"))\n .pipe(dest(\"pub/css\"))\n .pipe(browserSync.stream())\n}", "function sass() {\n return gulp.src('src/assets/scss/mail.scss')\n .pipe($.if(!PRODUCTION, $.sourcemaps.init()))\n .pipe($.sass({\n includePaths: ['node_modules/foundation-emails/scss']\n }).on('error', $.sass.logError))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest('./'));\n}", "function buildSass() {\n return gulp\n .src('scss/*.scss')\n .pipe(sass())\n .pipe(gulp.dest('css'))\n .pipe(browserSync.stream());\n}", "function scssTask() {\r\n return src(files.scssPath)\r\n .pipe(sourcemaps.init())\r\n .pipe(sass())\r\n .pipe(postcss( [autoprefixer()] ))\r\n .pipe(sourcemaps.write('.'))\r\n .pipe(dest('dist'))\r\n}", "function compileSass() {\r\n return gulp\r\n .src(['Stylesheets/**/*.scss'])\r\n .pipe(gulpSass({ outputStyle: \"expanded\" }))\r\n .pipe(autoPrefixer({\r\n overrideBrowserslist: ['last 2 versions'],\r\n cascade: false\r\n }))\r\n .pipe(concat('site.css'))\r\n .pipe(header(banner))\r\n .pipe(gulp.dest('./wwwroot/css/'));\r\n}", "function scssTask() {\n return src(files.scssPath)\n .pipe(sourcemaps.init())\n .pipe(sass().on('error', sass.logError))\n .pipe(cleanCSS())\n .pipe(sourcemaps.write('./maps'))\n .pipe(dest('pub/css'))\n .pipe(browserSync.stream()) // Make sure changes shows in browsers\n}", "function sassFormat() {\n\treturn gulp.src(config.sass)\n\t\t.pipe(gulpif(config.settings.createSourcemaps, sourcemaps.init()))\n\t\t.pipe(sass().on('error', sass.logError))\n\t\t.pipe(autoprefixer())\n\t\t.pipe(gulpif(config.settings.isBuild, cleanCSS({compatibility: 'ie8'})))\n\t\t.pipe(gulpif(config.settings.createSourcemaps, sourcemaps.write('./maps')))\n\t\t.pipe(gulp.dest(config.distCSS))\n}", "function compileSass() {\n return gulp.src('./src/scss/*.scss')\n .pipe(sass())\n /*.pipe(purgecss({\n content: ['./dist/!*.html']\n }))*/\n .pipe(gulp.dest(\"./src/css\"))\n .pipe(cleanCSS())\n .pipe(rename({suffix: '.min'}))\n .pipe(gulp.dest(\"./dist/css\"))\n .pipe(browserSync.stream());\n}", "function renderScss() {\n // Start rendering\n sass.render(scssConfig, function (err, result) {\n if ( err ) {\n return handleError(err);\n }\n\n // Write CSS\n fs.writeFile(csspath + 'styles.css', result.css, 'utf8', function () {\n handleWrite(err, result);\n });\n\n // Write sourcemap\n fs.writeFile(csspath + 'styles.css.map', result.map, 'utf8');\n });\n}", "function css(){\n return src(\"src/scss/styles.scss\")//returna la ubicacion del archivo de sass\n .pipe(sourcemaps.init())//inicia el mapa primero\n .pipe( sass())//compila el css\n .pipe(postcss(dos))//minifica el css y agregar prefijos\n .pipe(sourcemaps.write(\".\"))//escribe nuestro propio \"mapa\"\n .pipe(dest(\"./build/css\"))//ubicacion donde se \"compile\" sass\n //pipe recibe como argumento una funcion o un paquete importado, nosotros le pasamos sass\n }", "function sass() {\n gutil.log('updating scss');\n return gulp.src('src/scss/app.scss')\n .pipe($.sourcemaps.init())\n .pipe($.sass({\n includePaths: PATHS.sass\n })\n .on('error', $.sass.logError))\n .pipe($.autoprefixer())\n // Comment in the pipe below to run UnCSS in production\n //.pipe($.if(PRODUCTION, $.uncss(UNCSS_OPTIONS)))\n .pipe($.if(PRODUCTION, $.cssnano()))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + PATHS.distAssets + '/css'))\n}", "function scssTransform() {\n return gulp.src(paths.styles.src)\n .pipe(sourcemaps.init({ loadMaps: true }))\n .pipe(sass({ outputStyle: 'compressed' })\n .on('error', sass.logError))\n .pipe(autoprefixer({\n overrideBrowserslist: \"last 3 version\"\n }))\n .pipe(sourcemaps.write('./'))\n .pipe(gulp.dest(paths.styles.dest));\n}", "function style()\n{\n // STEPS\n // 1. Where is my SASS?\n // 2. Pass that file through SASS compiler\n // 3. Where do i save the compiled SASS\n // 4. stream changes to all browser\n\n // 1.\n return gulp.src('./src/scss/*.scss')\n // 2.\n .pipe(sass({\n outputStyle: 'compressed'\n }).on('error', sass.logError))\n // 3.\n .pipe(gulp.dest('./dist/css'))\n // 4.\n .pipe(browserSync.stream());\n}", "function compileScss() {\n return gulp.src('src/scss/*.scss')\n .pipe(sass())\n .pipe(gulp.dest('dist/css'))\n}", "function css() {\n var plugins = [autoprefixer()];\n return gulp\n .src([\"./webpage/src/scss/main.scss\"])\n .pipe(sourcemaps.init())\n .pipe(sass())\n .pipe(postcss(plugins))\n .pipe(minifyCSS())\n .pipe(sourcemaps.write(\"../maps\"))\n .pipe(gulp.dest(\"./webpage/dist/css\"));\n}", "function scss() {\n return src('./src/sass/main.scss')\n .pipe(changed('./src/css'))\n .pipe(sass({\n outputStyle: 'nested',\n precision: 10,\n includePaths: ['.'],\n onError: console.error.bind(console, 'Sass error:')\n }))\n .pipe(dest('src/css'))\n}", "function sassTask() {\n return src('app/sass/**/*.scss')\n .pipe(plumber())\n .pipe(sourcemaps.init()) // initialize sourcemaps first\n .pipe(\n sass.sync({\n outputStyle: 'expanded',\n })\n ) // compile SCSS to CSS\n .pipe(postcss([autoprefixer(), cssnano()])) // PostCSS runs plugins\n .pipe(sourcemaps.write('.')) // write sourcemaps file in current directory\n .pipe(dest('app/css')) // put final CSS in app folder\n .pipe(browserSync.stream());\n}", "function scssTask() {\n\treturn src('./sass/styles.scss')\n\t\t.pipe(sourcemaps.init()) // initialize sourcemaps first\n\t\t.pipe(sass({includePaths: sassPaths }).on('error', sass.logError))\n\t\t.pipe(postcss([autoprefixer(), cssnano()])) // PostCSS plugins\n\t\t.pipe(sourcemaps.write('.')) // write sourcemaps file in current directory\n\t\t.pipe(rename('theme.css'))\n\t\t.pipe(replace('\"{{', '{{')) // remove the extra set of quotations used for escaping the liquid string\n\t\t.pipe(replace('}}\"', '}}'))\n\t\t.pipe(\n\t\t\tdest('./assets/') // put final CSS in assets folder\n\t\t);\n}", "function css() {\n return gulp\n .src(sass_sources)\n .pipe(sourcemaps.init())\n .pipe(plumber())\n .pipe(sass({ outputStyle: \"expanded\" }))\n .pipe(gulp.dest(css_dest))\n .pipe(rename({ suffix: \".min\" }))\n .pipe(postcss([autoprefixer(), cssnano()]))\n .pipe(sourcemaps.write('.'))\n .pipe(gulp.dest(css_dest))\n .pipe(browsersync.stream());\n}", "function css() {\n return gulp.src('./public/assets/scss/*.scss')\n // compile to css\n .pipe(sass())\n // take compiled css and place into folder\n .pipe(gulp.dest('./public/bin/css/'))\n //browser realod\n .pipe(browserSync.stream());\n}", "function css(){\n\n //retornamos la hoja de sass\n return src(paths.scss) //identifica la hoja de estilos\n .pipe(sass({\n outputStyle:'expanded'\n })) //aplica esta funcion primero (compilamos el sass a css)\n .pipe(dest('./build/css')) //despues lo guardamos, mandamos a llamar la funcion para que se cree la carpeta build\n}", "function sass(path) {\n return gulp.src(path)\n .pipe($.sourcemaps.init())\n .pipe($.sass({\n includePaths: PATHS.sass.vendor\n })\n .on('error', $.sass.logError))\n\n .pipe($.concat('app.css'))\n .pipe($.autoprefixer({\n browsers: COMPATIBILITY\n }))\n .pipe($.if(PRODUCTION, $.cssnano()))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/css'))\n}", "function compileCSS() {\n return gulp\n .src(['packages/nhsuk.scss'])\n .pipe(sass())\n .pipe(gulp.dest('dist/'))\n .on('error', (err) => {\n console.log(err)\n process.exit(1)\n })\n}", "function scssTask(){\n return src(files.scssPath)\n \n .pipe(sass().on('error', sass.logError))\n\t\t.pipe(postcss([ autoprefixer() ]))\n .pipe(dest(\"./docs/css/\")) // put final CSS in dist folder\n .pipe(browserSync.reload({stream:true}));\n}", "function SASS(){\n return parent.gulp.src(parent.CONFIG.sass)\n .pipe(parent.sass())\n .pipe(parent.gulp.dest((parent.dist ? parent.CONFIG.distRoot : parent.CONFIG.tmpRoot) + '/assets'));\n\n}", "function css() {\r\n return gulp\r\n .src('src/scss/**/*.scss')\r\n .pipe(plumber())\r\n .pipe(sass())\r\n .pipe(csso())\r\n .pipe(gulp.dest('assets/css/'))\r\n .pipe(gulp.dest('_site/assets/css/'))\r\n .pipe(bsync.stream());\r\n}", "function compileToMinifiedCSS() {\n return src(srcFiles.pathSCSS)\n .pipe(sourcemaps.init())\n .pipe(sass())\n .pipe(postcss([autoprefixer(), cssnano()]))\n .pipe(sourcemaps.write(\".\"))\n .pipe(dest(destFolders.minified));\n}", "function css(done) {\n src('source/sass/**/*.sass')\n .pipe(plumber())\n .pipe(sass({\n style: 'compressed'\n }))\n .pipe(rename({\n basename: 'main',\n suffix: '.min'\n }))\n\n .pipe(dest('build/assets/css'));\n done();\n}", "function scssTask(){\n return src('src/*.scss')\n // .pipe(sass({ }))\n .pipe(postcss([\n require('postcss-bem')({\n style: 'bem',\n // separators: { descendent: '__' }\n }),\n // require('postcss-bem-linter')({\n \n // }),\n // require('postcss-nesting')(),\n // require('postcss-mixins'),\n // require('postcss-each'),\n // require('postcss-for'),\n // require('postcss-css-variables')({\n // variables:{\n // '--other-var': { value: '#00CC00' },\n // '--important-var': { value: '#ffCC00' }\n // }\n // }),\n // require('postcss-calc')(),\n ]))\n .pipe(dest('dist/'))\n}", "function css() {\n return src('./src/sass/main.scss')\n .pipe(changed('./build/css'))\n // Compile SASS files\n .pipe(sass({\n outputStyle: 'nested',\n precision: 10,\n includePaths: ['.'],\n onError: console.error.bind(console, 'Sass error:')\n }))\n // Minify the file\n .pipe(cssClean())\n // Output\n .pipe(dest('./build/css'))\n}", "function convertToCSS(){\n return src('src/scss/*.scss')\n .pipe(sass())\n .pipe(dest('src/css'));\n}", "function css() {\n return gulp\n .src(\"./src/scss/styles.scss\")\n .pipe(plumber())\n .pipe(sass({ outputStyle: \"expanded\" }))\n .pipe(gulp.dest(\"./docs/css/\"))\n .pipe(browsersync.stream());\n}", "function sassComp() {\n return src('dev/*.scss')\n .pipe($.plumber({ errorHandler }))\n .pipe($.debug())\n .pipe($.sass({ outputStyle: conf.sassOutputStyle }).on('error', $.sass.logError))\n .pipe($.autoprefixer({ cascade: false }))\n .pipe(dest('dev'))\n .pipe($.browserSync.stream())\n .pipe($.notify({ title: 'Sass', message: '✅ Task Completed!', icon: icons.success, onLast: true }));\n}", "function sassy() {\r\n\treturn gulp\r\n\t\t.src(mainSassFile)\r\n\t\t.pipe(sass().on('error', sass.logError)) //Using gulp-sass\r\n\t\t.pipe(gulp.dest(cssFiles))\r\n}", "function style() {\n return gulp.src('./styles/scss/main.scss')\n .pipe(sourcemaps.init())\n .pipe(sass().on('error', sass.logError))\n .pipe(sourcemaps.write())\n .pipe(gulp.dest('./styles/css'))\n .pipe(browserSync.stream());\n}", "function scss() {\n return gulp.src('src/assets/scss/app.scss')\n .pipe(sass().on('error', sass.logError))\n .pipe(sourcemaps.init())\n .pipe(autoprefixer({\n browsers: ['last 2 versions'],\n cascade: false\n }))\n .pipe(sourcemaps.write('./'))\n .pipe(gulp.dest(styleDest))\n .pipe(browserSync.stream());\n}", "function css() {\n return gulp\n .src('app/sass/*.scss') \n .pipe(sass().on('error', sass.logError))\n .pipe(gulp.dest('dist/css'))\n}", "function scssTask(){ \n return src(files.scssPath)\n .pipe(sass({\n outputStyle: 'expanded'\n })) //compile to css\n .pipe(postcss([autoprefixer()])) // PostCSS plugins\n .pipe(cssSvg())\n .pipe(dest('dist')\n ); \n}", "function sass(cb) {\n return gulp.src('app/scss/*.scss')\n //.pipe(sass())\n .pipe(gulp.dest('dist/css/'))\n}", "function css() {\n return src(url_src + 'scss/style.scss')\n .pipe(sassGlob())\n .pipe(\n sass({\n outputStyle: 'expand' //expand or compact or compressed\n })\n .on('error', sass.logError)\n ).pipe(\n browserSync.reload({\n stream: true\n })\n ).pipe(\n autoprefixer({\n cascade: true\n })\n ).pipe(dest(url_dest + 'css/'));\n}", "function style () {\r\n //path to scss file\r\n return gulp\r\n .src('app/scss/**/*.scss')\r\n //init sourcemaps\r\n .pipe(sourcemaps.init())\r\n //give it to sass compiler\r\n .pipe(sass())\r\n //give it to postcss, autoprefixer and cssnano\r\n .pipe(postcss([ autoprefixer(), cssnano() ]))\r\n //write sourcemaps in current directory\r\n .pipe(sourcemaps.write('.'))\r\n //destination path for css file\r\n .pipe(gulp.dest('dist/css'))\r\n //stream changes to all browser\r\n .pipe(browserSync.stream());\r\n}", "function scssTask () {\n return src('src/assets/sass/application.scss')\n .pipe(sass())\n .pipe(postcss([cssnano()]))\n .pipe(rename('style.css'))\n .pipe(dest('output/css'))\n}", "function buildSass(done) {\n gulp.src('_sass/main.scss')\n .pipe(sass({\n includePaths: ['node_modules'],\n onError: browser.notify\n }))\n .pipe(gulp.dest('_site/css'))\n .pipe(gulpIf(prod, prefix(browsers, { cascade: true })))\n .pipe(gulpIf(prod, cleanCSS()))\n .pipe(gulpIf(prod, uncss({\n html: ['_site/**/*.html']\n })))\n .pipe(browser.reload({ stream: true }))\n .pipe(gulp.dest('_site/css'));\n done();\n}", "function sass() {\n\n return gulp.src(`${PATHS.src}/**/*.scss`)\n .pipe($.sass().on('error', $.sass.logError))\n .pipe(mergeCSS({ name: 'app.css' }))\n .pipe(gulp.dest(`${PATHS.dist}/assets/css`));\n}", "function css(cb){\n\n return src('src/scss/*')\n .pipe(sass())\n .pipe(dest('dist/css/'))\n \n cb();\n}", "function processStyles() {\n return gulp.src(\n [\n srcRoot + \"**/*.scss\"\n ]\n ).pipe(\n sourcemaps.init()\n ).pipe(\n sass().on(\n \"error\",\n sass.logError\n )\n ).pipe(\n cssNano(config.cssNano)\n ).pipe(\n concat(\"health-bam.all.min.css\")\n ).pipe(\n sourcemaps.write(\"./\")\n ).pipe(\n gulp.dest(destination)\n );\n }", "function compile(glob) {\n return function() {\n return gulp.src(glob)\n .pipe(sass({\n includePaths: INCLUDE_PATHS\n }))\n .on('error', function(err) {\n gutil.beep();\n if (consts.PRODUCTION) {\n throw err;\n } else {\n gutil.log(err);\n }\n })\n .pipe(prefix({\n browsers: [\n 'last 2 version',\n 'firefox esr',\n 'opera 12.1',\n 'android 4',\n 'explorer 9'\n ],\n cascade: false\n }))\n .pipe(consts.PRODUCTION ? cssmin({\n processImport: false,\n rebase: false,\n restructuring: false\n }) : gutil.noop())\n .pipe(gulp.dest(CSS_OUTPUT_DIR))\n .pipe(livereload())\n .pipe(print(function(filepath) {\n return 'built: ' + filepath;\n }));\n };\n}", "function compileSass(cb){\n\tgulp.src(sassSrc)\n\t.pipe(sass())\n\t.pipe(gulp.dest(sassDest));\n\tcb();\n}", "function scssTask() {\r\n return src(files.scssPath)\r\n .pipe(sass())\r\n .pipe(dest('dist/css'));\r\n}", "function watchSass() {\n watch(files.scss.src, compileSCSS);\n}", "function styles () {\n return src('src/scss/**/*.scss')\n .pipe(sass().on('error', sass.logError))\n .pipe(dest('build/css'))\n}", "function copySass() {\n let tasks = [];\n Object.keys(config).forEach((key) => {\n let val = config[key];\n tasks.push(gulp.src(val.src)\n .pipe(replace('./node_modules/@mozilla-protocol/', ''))\n .pipe(gulp.dest(val.dest))\n );\n });\n\n return merge(tasks);\n}", "function sassify(){\n return gulp.src('./scss/tesla.scss')\n .pipe(sass().on('error',sass.logError))\n .pipe(mmq({\n log:true\n }))\n .pipe(gulp.dest('./dist/css'));\n}", "function css(cb) {\n return gulp.src(['src/scss/main.scss'])\n .pipe(sass())\n .pipe(gulp.dest(\"src/css\"));\n cb();\n}", "function cssBundle() {\n let postcssPlugins = [\n autoprefixer()\n ];\n\n return gulp.src([\"scss/facade.scss\"])\n .pipe(sass().on(\"error\", sass.logError))\n .pipe(postcss(postcssPlugins))\n .pipe(gulp.dest(\"public/css\"))\n .pipe(touch())\n .pipe(browserSync.stream());\n}", "function style(){\n // 1. Where is scss file?\n return gulp.src('app/scss/**/*.scss')\n .pipe(sourcemaps.init())\n // 2. Compile sass file\n .pipe(sass()).on('error', sass.logError)\n // 3. Add prefixes to code\n .pipe(postcss([autoprefixer]))\n // Minify the CSS\n .pipe(cleanCSS())\n .pipe(sourcemaps.write())\n // 4. Where do I save the complied CSS?\n .pipe(gulp.dest('app/css'))\n // 5. Stream changes to all browsers\n .pipe(browserSync.stream())\n}", "function css() {\n return gulp\n .src('./assets/scss/**/*.scss')\n .pipe(plumber())\n .pipe(sourcemaps.init())\n .pipe(sass().on('error', sass.logError))\n .pipe(autoprefixer())\n .pipe(minifyCss())\n .pipe(rename('style.min.css'))\n .pipe(sourcemaps.write('.'))\n .pipe(gulp.dest('./assets/css/'));\n}", "function style() {\r\n // 1. where is my scss file\r\n return gulp.src('./scss/**/*.scss')\r\n // 2. pass that fiel through sass compiler\r\n .pipe(sass().on('error', sass.logError))\r\n // 3. where do I save the compiled CSS\r\n .pipe(gulp.dest('./css'))\r\n\r\n // is actually: return gulp.src('./scss/**/*.scss').pipe(sass()).pipe(gulp.dest('./css'))\r\n\r\n // 4. stream changes to all browser\r\n // .pipe(browserSync.stream())\r\n}", "function sassInk() {\n return gulp.src('email/src/assets/scss/app.scss')\n .pipe($.if(!PRODUCTION, $.sourcemaps.init()))\n .pipe($.sass({\n includePaths: ['node_modules/foundation-emails/scss']\n }).on('error', $.sass.logError))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest('email/dist/css'));\n}", "function css() {\n return src(source + 'scss/*.scss')\n .pipe(concat('main.css'))\n .pipe(sass())\n .pipe(cleanCSS())\n .pipe(rename({ suffix: '.min' }))\n .pipe(dest(destination + 'css'));\n}", "function style(){\n //1. where is my scss file\n return gulp.src('./scss/**/*.scss')\n //2. pass that file through sass compiler\n .pipe(sass().on('error', sass.logError))\n //3. where do i save the compiled CSS?\n .pipe(gulp.dest('./css'))\n //4.stream change to all browser\n .pipe(browserSync.stream());\n}", "function style() {\n\t// sources\n\treturn gulp.src('./assets/sass/**/*.scss')\n\t// compile\n\t.pipe(sass())\n\t// path\n\t.pipe(gulp.dest('./public/css'))\n}", "function scss() {\n return gulp.src( 'src/assets/scss/all.scss' )\n .pipe( concat( 'style.scss/' ) )\n .pipe( sass().on( 'error', sass.logError ) )\n .pipe( gulp.dest( './build/assets/css/' ) );\n}", "function scss_renderer(cb) {\n src(\"src/renderer/app.scss\").pipe(sass()).pipe(dest(\"build/renderer\")).on('end', cb);\n}", "function watchSass() {\n watch('assets/sass/*.sass', compileSass);\n}", "function style() {\n\n //1. Where is my scss\n return gulp.src(sassFiles)\n\n //2.pass through compiler\n .pipe(sass().on('error', sass.logError))\n\n //3.wher to save css\n .pipe(gulp.dest(cssDest))\n\n .pipe(browserSync.stream());\n\n}", "function compileSass(done) {\n return gulp\n .src(\"sass/**/*.scss\") // get every scss file in the sass directory\n .pipe(sassify({ outputStyle: \"compressed\" }).on(\"error\", sassify.logError)) // run it thru the compiler, and also compress it\n .pipe(gulp.dest(\"css\")); // save the compiled file to the CSS directory\n}", "function buildStyles() {\n return src('index.scss')\n .pipe(sass())\n .pipe(dest('css'))\n}", "function css() {\n\tlet time =\n\t\t\"<span \" +\n\t\ttimeStyle +\n\t\t\">\" +\n\t\tformat.asString(new Date(), \"[HH:MM:ss]\") +\n\t\t\"</span>\";\n\treturn gulp\n\t\t.src(\"src/scss/style.scss\")\n\t\t.pipe(sass({ sourcemaps: true }))\n\t\t.on(\"error\", function(err) {\n\t\t\tlog(\n\t\t\t\tcolour.red(\"⚠️ SCSS error\"),\n\t\t\t\tbrowserSync.notify(\n\t\t\t\t\t\"⚠️ <strong>SCSS error</strong> \" +\n\t\t\t\t\t\ttime +\n\t\t\t\t\t\t\"<pre \" +\n\t\t\t\t\t\tcodeStyle +\n\t\t\t\t\t\t\">\" +\n\t\t\t\t\t\terr.messageOriginal +\n\t\t\t\t\t\t\"</pre>File: \" +\n\t\t\t\t\t\terr.relativePath +\n\t\t\t\t\t\t\"<br>Line: \" +\n\t\t\t\t\t\terr.line,\n\t\t\t\t\t5000\n\t\t\t\t),\n\t\t\t\terr.messageFormatted.toString()\n\t\t\t);\n\t\t})\n\t\t.pipe(autoprefix())\n\t\t.pipe(rename({ suffix: \".min\" }))\n\t\t.pipe(cleanCSS({ rebase: false }))\n\t\t.pipe(gulp.dest(\"dist/css\"))\n\t\t.pipe(\n\t\t\tbrowserSync.stream(),\n\t\t\tlog(browserSync.notify(\"✅ SASS built \" + time))\n\t\t);\n}", "function compileStyles() {\n return gulp.src(files.mainScss)\n .pipe(plugins.inject(\n gulp.src([files.styles, `!${files.mainScss}`, `!${files.bowerComponents}`]),\n {\n relative: true,\n starttag: '/*** scss-inject ***/',\n endtag: '/*** end scss-inject ***/',\n transform(filepath) {\n return `@import \"${filepath}\";`;\n },\n },\n ))\n .pipe(plugins.sourcemaps.init())\n .pipe(plugins.sass({\n includePaths: [paths.bowerComponents],\n outputStyle: 'compressed',\n }))\n .pipe(plugins.autoprefixer())\n .pipe(plugins.sourcemaps.write())\n .pipe(gulp.dest(paths.tmp));\n}", "function style() {\n //1. Where is my scss file\n return (\n gulp\n .src(\"./scss/**/*.scss\")\n\n //2. Pass that file through sass compiler\n .pipe(sass())\n //3.Where do I save my compiled css?\n .pipe(gulp.dest(\"./css\"))\n //4. Stream changes to all browsers\n .pipe(browserSync.stream())\n );\n}", "function style() {\n return gulp\n .src(paths.input.scss)\n .pipe(sass().on('error', sass.logError))\n .pipe(gulp.dest(paths.output.scss))\n .pipe(browserSync.stream());\n}", "function buildStyles() {\n const plugins = [\n autoprefixer(),\n ];\n\n return gulp.src('./src/stylesheets/**/*.scss')\n .pipe($.sourcemaps.init())\n .pipe(sass({\n outputStyle: 'nested',\n includePaths: ['./node_modules/bootstrap/scss']\n }).on('error', sass.logError))\n .pipe($.postcss(plugins))\n .pipe($.if(opts.env === 'production', $.cleanCss())) // 在production環境下壓縮css\n .pipe($.sourcemaps.write('.'))\n .pipe(gulp.dest('./public/stylesheets'))\n .pipe(browserSync.stream());\n}", "function scssBuild() {\n return gulp\n .src(paths.src.scss + \"index.scss\")\n .pipe(\n plumber({ errorHandler: notify.onError(\"Error: <%= error.message %>\") })\n )\n .pipe(sass(sassOptions))\n .pipe(postcss(postcssOptions))\n .pipe(gcmq())\n .pipe(gulpif(banner.visible, header(banner.basic, { pkg, pjt })))\n .pipe(rename(pkg.name + \".css\"))\n .pipe(gulp.dest(paths.dist.css))\n .pipe(cleanCSS())\n .pipe(rename({ suffix: \".min\" }))\n .pipe(gulp.dest(paths.dist.css))\n}", "function style() {\n // 1. where is my scss file\n return gulp.src('./src/Assets/scss/**/*.scss')\n // 2. pass that file through sass compiler\n .pipe(sass())\n .pipe(cleanCSS())\n .pipe(rename({ suffix: '.min'}))\n .pipe(changed('./src/Assets/css'))\n //3 . where do I save the compiled CSS?\n .pipe(gulp.dest('./src/Assets/css'))\n //4. stream changes to all brouser\n}", "function buildAppScss() {\n\n //Create stream\n var stream = gulp.src(config.assets.client.scss.main)\n .pipe(sass().on('error', sass.logError));\n\n //Minifying?\n if (isDeploying || config.build.app.css.minify) {\n stream = stream\n .pipe(sourcemaps.init())\n .pipe(autoprefixer({\n browsers: ['last 2 versions']\n }))\n .pipe(csso())\n .pipe(rename(packageFileName('.min.css')))\n .pipe(sourcemaps.write('./'));\n }\n\n //Write to public folder and return\n return stream\n .pipe(gulp.dest(destination + '/css'))\n .pipe(livereload());\n}" ]
[ "0.77264106", "0.7585183", "0.75212884", "0.7462039", "0.7377429", "0.7357436", "0.733218", "0.7308293", "0.7302244", "0.7297472", "0.72970974", "0.72890645", "0.7282065", "0.72634524", "0.7263284", "0.72411805", "0.72392064", "0.7228728", "0.7218675", "0.72063565", "0.72015053", "0.7180181", "0.71757585", "0.7170234", "0.7150388", "0.71469414", "0.7143141", "0.7132272", "0.71117556", "0.71109205", "0.71100706", "0.70917535", "0.7076672", "0.7067399", "0.7059959", "0.703578", "0.7026652", "0.70170903", "0.7010495", "0.6995311", "0.6977927", "0.6977843", "0.6974143", "0.6954554", "0.6945853", "0.6944266", "0.69363976", "0.69269955", "0.6924042", "0.69223607", "0.6917796", "0.6900681", "0.68963516", "0.68922937", "0.6891985", "0.6889484", "0.6887464", "0.6879399", "0.6879258", "0.68658787", "0.6864158", "0.68587196", "0.685544", "0.68548083", "0.68545717", "0.6852743", "0.68417233", "0.6831922", "0.6823267", "0.6821477", "0.68082374", "0.67952114", "0.67941946", "0.6788591", "0.6768389", "0.67669606", "0.676209", "0.6760574", "0.67438775", "0.67418975", "0.6729035", "0.67257017", "0.67182344", "0.670464", "0.67016745", "0.6676922", "0.6675888", "0.66701466", "0.66635764", "0.66606385", "0.6651285", "0.6650115", "0.66303194", "0.6620452", "0.66201997", "0.66199756", "0.661272", "0.66094524", "0.65976906", "0.65916204" ]
0.71601975
24
Minify & Optimize with CleanCSS in Production
async minify(css) { return new Promise((resolve, reject) => { if (!isProd) { resolve(css) } const minified = new CleanCSS().minify(css) if (!minified.styles) { return reject(minified.error) } resolve(minified.styles) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function minify(){\n let minify = gulp.src(config.dev + \"/css/*.css\");\n if( process.env.NODE_ENV == \"production\" ){\n minify = gulp.src(config.dev + \"/css/*.css\")\n .pipe(cleanCSS())\n .pipe(gulp.dest(config.dev + \"/css\"))\n }\n\n return minify;\n}", "function prodcss() {\n return src('./src/styles.styl')\n .pipe(stylus({\n 'include css': true\n }))\n .pipe(cleanCSS({debug: true}, (details) => {\n console.log(`${details.name}: ${details.stats.originalSize}`);\n console.log(`${details.name}: ${details.stats.minifiedSize}`);\n }))\n .pipe(dest('dist/'))\n}", "function cssMinify() {\n return gulp.src([\"public/css/facade.css\"])\n .pipe(postcss([\n cssnano()\n ]))\n .pipe(gulp.dest(\"public/css\"))\n .pipe(touch());\n}", "function minifyCss() {\n \n return gulp.src('./src/assets/sass/*.css', { matchBase: './src/assets/css/' })\n .pipe(cssnano())\n .pipe(gulp.dest('./src/assets/css/'))\n .pipe(browserSynnc.stream());\n}", "function minify_css() {\r\n\treturn gulp.src(paths.dist + 'bundles/app.css')\r\n\t.pipe(minifyCSS({\r\n\t\tkeepSpecialComments: 0\r\n\t}))\r\n\t.pipe(gulp.dest(paths.dist + 'bundles/'));\r\n}", "function minify(css) {\n return YAHOO.compressor.cssmin(css);\n }", "function buildCSS() {\r\n return src(paths.devCSS)\r\n .pipe(purifyCSS([paths.devHTML, paths.devJS]))\r\n .pipe(cleanCSS())\r\n .pipe(postCSS([autoprefixer]))\r\n .pipe(size({ showFiles: true }))\r\n .pipe(dest(paths.prodCSS));\r\n}", "function minсss() {\n // Folder with files to minify\n return src(['./css/*.css', '!./css/*.min.css'])\n //The method pipe() allow you to chain multiple tasks together \n //I execute the task to minify the files\n .pipe(rename({\n suffix: '.min'\n }))\n\n .pipe(cleanCSS())\n //I define the destination of the minified files with the method dest\n .pipe(dest('./dist/css'));\n}", "function minifyCss() {\n return map(function (buff, filename) {\n return new CleanCSS(\n Elixir.config.css.minifier.pluginOptions\n )\n .minify(buff.toString())\n .styles;\n });\n}", "function minify() {\n return src(DIR.SASS)\n .pipe(sass({\n errorLogToConsole: true\n }))\n .on('error', console.error.bind(console))\n .pipe(rename({\n suffix: '.min'\n }))\n .pipe(postcss([tailwindcss(),autoprefixer(), cssnano(),]))\n .pipe(dest(DIR.CSS))\n .pipe(notify({\n message: 'Minify'\n }));\n}", "function minifyStyles() {\n const minifySource = [\n conf.dist.styles + '/**/*.css',\n ];\n\n return src(minifySource, {sourcemaps: conf.sourcemaps.enable})\n .pipe(minify())\n .pipe(rename({suffix: '.min'}))\n .pipe(dest(conf.dist.styles, {sourcemaps: conf.sourcemaps.path}))\n ;\n}", "function minifyCSS() {\n return gulp\n .src([\n 'dist/*.css',\n '!dist/*.min.css' // don't re-minify minified css\n ])\n .pipe(cleanCSS())\n .pipe(\n rename({\n suffix: `-${version}.min`\n })\n )\n .pipe(gulp.dest('dist/'))\n}", "function cssClean() {\n return gulp\n .src([\"./src/css/*.less\", \"./src/css/*.css\"])\n .pipe(less())\n .pipe(csso())\n .pipe(gulp.dest(\"dist/css\"));\n}", "async function optimizeStyles() {\n await gulp\n .src(configProd.optimize.styles.src)\n .pipe(plumber())\n .pipe(cssnano(configProd.optimize.styles.options))\n .pipe(gulp.dest(configProd.optimize.styles.dest))\n .pipe(size(configProd.size));\n}", "function minifycss() {\n return gulp.src(['dist/css/*.css', '!dist/css/**/*.min.css'])\n .pipe(rename({\n suffix: '.min'\n }))\n .pipe(minifyCSS())\n .pipe(gulp.dest(cssDest))\n}", "function minifyCSS(cb) {\n gulp\n .src(\"./src/temp/css/*.css\")\n .pipe(cleanCSS({ compatibility: \"ie8\" }))\n .pipe(gulp.dest(`./${path}/assets/css`));\n\n cb();\n}", "function compileToMinifiedCSS() {\n return src(srcFiles.pathSCSS)\n .pipe(sourcemaps.init())\n .pipe(sass())\n .pipe(postcss([autoprefixer(), cssnano()]))\n .pipe(sourcemaps.write(\".\"))\n .pipe(dest(destFolders.minified));\n}", "function minstyles() {\n // Source\n return gulp.src('./src/Styles/dist/main.css')\n .pipe(sourcemaps.init())\n .pipe(cleanCSS({compatibility: 'ie10'}))\n .pipe(sourcemaps.write()) // *Optional\n // Save\n .pipe(rename({\n suffix: '.min'\n }))\n .pipe(gulp.dest('./src/Styles/dist'))\n .pipe(browserSync.stream());\n}", "function compress() {\n return through.obj(function (file, enc, cb) {\n new CleanCSS().minify(file.contents, function (err, minified) {\n file.contents = Buffer.from(minified.styles);\n cb(err, file);\n });\n });\n}", "function stylesheets_minify() {\n\tlet stream = gulp.src([config.client.css.srcDir + '/**/*.css']);\n\t\n\t// let minifyDurationStream = $.duration('minifying stylesheets');\n \t// let autoprefixerDurationStream = $.duration('autoprefixing stylesheets');\n\t\n\treturn stream.pipe($.plumber({errorHandler: mapError}))\n\t.pipe($.duration('minifying stylesheets'))\n\t// .pipe($.changed(config.client.css.outputDir, {extension: '.css', hasChanged: $.changed.compareSha1Digest}))\n\t.pipe($.cache('css-minify'))\n\t// .pipe($.gulpif(isProduction, $.sourcemaps.init({\t\t\t\t\t\t\t\t\t// loads map from browserify file\n\t// \tloadMaps: true\n\t// }), $.gutil.noop())) \n\t.pipe($.duration('autoprefixing stylesheets'))\t\n\t.pipe($.autoprefixer({\n browsers: ['> 5%'],\t\t\t\t\t\t\t\t\t\t// also 'last 2 versions' -> taken from browserlist github.com/ai/browserlist\n cascade: false\n }))\n .pipe(gulp.dest(config.client.css.srcDir))\t\t\t\t\t// save the prefixed added files in src itself before minifying\n\t.pipe($.minify({compatibility: 'ie8', debug: true}))\n\t.pipe($.rename({\t\t\t\t\t\t\t\t\t\t\t\t\t// Rename output from to '.min.js'\n\t\textname: config.client.css.outputFileMinExt\n\t})) \t\n\t// .pipe($.gulpif(isProduction, $.sourcemaps.write({destPath: config.client.js.mapDir}), $.gutil.noop())) \t\t// writes .map file\t\n\t.pipe(gulp.dest(config.client.css.outputDir));\n\n}", "function minifyJs() {\n\n return gulp.src('./src/assets/js/**/*.js', { matchBase: './src/assets/js/' })\n .pipe(ugly({compress: true}))\n .pipe(gulp.dest('./src/assets/css/'))\n .pipe(browserSynnc.stream());\n}", "function buildNormalize() {\r\n return src(paths.normalize)\r\n .pipe(cleanCSS())\r\n .pipe(size({ showFiles: true }))\r\n .pipe(dest(paths.prodCSS));\r\n}", "function combineCss() {\r\n return gulp\r\n .src(configCss.src)\r\n .pipe(concat('site.min.css'))\r\n .pipe(cleanCss({\r\n debug: true\r\n }, (details) => {\r\n console.log(`${details.name}: ${details.stats.originalSize}`);\r\n console.log(`${details.name}: ${details.stats.minifiedSize}`);\r\n }))\r\n .pipe(header(banner))\r\n .pipe(gulp.dest('./wwwroot/css/'));\r\n}", "function compileCSS() {\n return gulp.src(\"app/css/**/*.css\")\n .pipe(concat(\"bundled.css\"))\n .pipe(gulpif(argv.production, streamify(minifyCSS())))\n .pipe(gulp.dest(\"build/css/\"))\n .pipe(gulpif(argv.livereload, livereload()));\n}", "function minCss(callback) {\r\n return gulp.src('../public/css/*.css')\r\n .pipe(minifycss())\r\n .pipe(gulp.dest('../public/css'))\r\n .on('finish', callback);\r\n}", "function css() {\n return gulp.src(paths.less)\n .pipe(plugins.plumber())\n .pipe(plugins.rename('main.min.css'))\n .pipe(plugins.sourcemaps.init())\n .pipe(plugins.less({\n compress: false\n }))\n .pipe(plugins.sourcemaps.write(''))\n .pipe(gulp.dest(paths.dev));\n}", "minify() {\n\n }", "function distCssJs() {\n return gulp.src('app/*.html')\n .pipe(useref())\n .pipe(gulpIf('*.js', uglify()))\n .pipe(gulpIf('*.css', cssnano()))\n .pipe(gulp.dest('dist'));\n}", "function uglify() {\n\t\t\tvar settings = config.styles.uglify;\n\n\t\t\treturn gulp.src( settings.src )\n\t\t\t // Deal with errors.\n\t\t\t .pipe( plugins.plumber( {errorHandler: handleErrors} ) )\n\n\t\t\t .pipe( plugins.rename( {suffix: '.min'} ) )\n\t\t\t .pipe( plugins.uglify( {\n\t\t\t\t mangle: false\n\t\t\t } ) )\n\t\t\t .pipe( gulp.dest( settings.dest ) ).on( 'end', function () {\n\t\t\t\t\t\t\tplugins.util.log( plugins.util.colors.bgGreen( 'Scripts are now minified....[uglify()]' ) );\n\t\t\t\t\t\t} )\n\t\t\t .pipe( plugins.notify( {message: 'Scripts are built.'} ) );\n\t\t}", "function css() {\n\treturn src( folder.src + 'css/*.css' )\n\t\t.pipe( minifyCSS() )\n\t\t.pipe( dest( folder.build + 'css' ) )\n}", "function cleaner(){\n\n if(app.locals.env === 'predeploy'){\n walkAndUnlink( path.join(__dirname, 'public', 'css'), new RegExp(/style-/) )\n walkAndUnlink( path.join(__dirname, 'public', 'js'), new RegExp(/dependencies-/) )\n walkAndUnlink( path.join(__dirname, 'public', 'js'), new RegExp(/dillinger-/) )\n }\n}", "function pluginsCss() {\n return src(paths.pluginsCss)\n .pipe(concat(paths.concatPluginsCss))\n .pipe(gulpif(production, cleanCSS()))\n .pipe(dest(paths.destPluginsCss))\n\n}", "function cleanCss(cb) {\n del(['css/*.css', 'css/*.min.css']);\n\n cb();\n}", "function css() {\n return gulp\n .src(sass_sources)\n .pipe(sourcemaps.init())\n .pipe(plumber())\n .pipe(sass({ outputStyle: \"expanded\" }))\n .pipe(gulp.dest(css_dest))\n .pipe(rename({ suffix: \".min\" }))\n .pipe(postcss([autoprefixer(), cssnano()]))\n .pipe(sourcemaps.write('.'))\n .pipe(gulp.dest(css_dest))\n .pipe(browsersync.stream());\n}", "function css() {\n return src(source + 'scss/*.scss')\n .pipe(concat('main.css'))\n .pipe(sass())\n .pipe(cleanCSS())\n .pipe(rename({ suffix: '.min' }))\n .pipe(dest(destination + 'css'));\n}", "function css() {\n return src(paths.css.src)\n .pipe(sass()\n .on('error', sass.logError))\n .pipe(purify([paths.js.dist, paths.html.src]))\n .pipe(minifyCSS({\n keepSpecialComments: 0\n }))\n .pipe(rename({ extname: '.min.css' }))\n .pipe(dest(paths.css.dist))\n .pipe(browserSync.stream())\n}", "function vendorCssTask(){\n\treturn src(files.vendorCssPath)\n\t\t.pipe(sourcemaps.init()) // initialize sourcemaps first\n\t\t.pipe(sass()) // compile SCSS to CSS\n\t\t.pipe(rename({\n\t\t\tsuffix: '.min'\n\t\t}))\n\t\t.pipe(postcss([ autoprefixer(), cssnano() ])) // PostCSS plugins\n\t\t.pipe(sourcemaps.write('.')) // write sourcemaps file in current directory\n\t\t.pipe(dest(themeRoot + '/dist')\n\t\t); // put final CSS in dist folder\n}", "function css() {\n return gulp\n // minify and prefix the reset and any css files in this project.\n .src(['node_modules/reset-css/reset.css', './*.css']) // the file(s) you want the task performed on\n .pipe(autoprefixer({ // the plugin to use\n browsers: ['last 2 versions'],\n cascade: false\n }))\n .pipe(csso()) // minify css\n .pipe(concat('style.min.css')) // concat all css files into one file\n .pipe(gulp.dest('build')); // the destination for the finished file\n}", "function scssProd() {\n return src('scss/styles.scss')\n .pipe(\n sass({ outputStyle: 'compressed' }).on('error', function (err) {\n console.log(err.message);\n this.emit('end');\n })\n )\n .pipe(autoprefixer({ cascade: false, grid: true }))\n .pipe(rename({ suffix: '.min' }))\n .pipe(dest('dist'));\n}", "function css() {\n\n // 1 - pegue o arquivo sass/scss referente ao app\n // 2 - compile o arquivo para css\n // 3 - aplique atributos compatíveis com a versão de browser especificada na propriedade \"browserslist\" do arquivo package.json\n // 4 - crie os arquivos e coloque o compilado css na pasta de destino\n // 5 - minifique o arquivo css\n // 6 - renomeie o arquivo minificado\n // 7 - coloque minificado css na pasta de destino\n let css = gulp.src(`${src.sass}/${appName}.{scss,sass}`)\n .pipe(sassCompiler().on('error', sassCompiler.logError))\n .pipe(autoprefixer())\n .pipe(csso())\n .pipe(rename({ extname: '.min.css' }))\n .pipe(gulp.dest(dest.css));\n\n if (uploadFiles) {\n\n // aplique a stream de upload de arquivos\n css = upload(css, dest.css);\n }\n\n return css;\n }", "function cssans() {\n return gulp\n .src('./_src/cssans/sass/**/*.scss')\n .pipe(plumber())\n .pipe(sass({ outputStyle: 'expanded' }))\n\n // Prod version\n .pipe(rename({ suffix: '.min' }))\n .pipe(postcss([autoprefixer(), cssnano()]))\n .pipe(gulp.dest(\"./dist/\"))\n\n // IE version (doesn't support CSS vars)\n .pipe(rename({ suffix: \".ie\" }))\n .pipe(postcss([cssvariables]))\n .pipe(gulp.dest('./dist/'));\n}", "function buildCss() {\n return gulp.src('./src/styles/main.css')\n .pipe(postcss())\n .pipe(gulp.dest('./dist/static'));\n}", "function sassMinTask() {\n return src(['src/**/*.scss', 'src/**/*.css', '!src/**/_*.scss', '!src/var.scss'])\n .pipe(sass({ outputStyle: 'compressed' }).on('error', sass.logError))\n .pipe(autoprefixer())\n .pipe(rename(function (path) {\n path.basename += \".min\";\n return path;\n }))\n .pipe(dest('dist/'))\n}", "function cssComp(cb) {\n return src(\"./src/css/*.css\") // read .css files from ./src/ folder\n .pipe(postCss()) // compile using postcss\n .pipe(gulpIf(buildEnv === 'prod', cleanCss()))\n .pipe(conCat('main.min.css'))\n .pipe(dest(buildDir+\"css/\")) // paste them in ./assets/css folder\n .pipe(browserSync.stream());\n cb();\n}", "function jsClean() {\n return gulp\n .src(\"./src/js/*.js\")\n .pipe(\n babel({\n presets: [\"@babel/env\"],\n })\n )\n .pipe(uglify())\n .pipe(gulp.dest(\"dist/js\"));\n}", "function buildAppScss() {\n\n //Create stream\n var stream = gulp.src(config.assets.client.scss.main)\n .pipe(sass().on('error', sass.logError));\n\n //Minifying?\n if (isDeploying || config.build.app.css.minify) {\n stream = stream\n .pipe(sourcemaps.init())\n .pipe(autoprefixer({\n browsers: ['last 2 versions']\n }))\n .pipe(csso())\n .pipe(rename(packageFileName('.min.css')))\n .pipe(sourcemaps.write('./'));\n }\n\n //Write to public folder and return\n return stream\n .pipe(gulp.dest(destination + '/css'))\n .pipe(livereload());\n}", "function bundleCss() {\n return src('./lib/**/*.css')\n .pipe(concat(TIMELINE_CSS))\n .pipe(dest(DIST))\n // TODO: nicer to put minifying css in a separate task?\n .pipe(cleanCSS())\n .pipe(rename(TIMELINE_MIN_CSS))\n .pipe(dest(DIST));\n}", "function styles() {\n return gulp.src(paths.styles.src)\n .pipe(cleanCSS({compatibility: 'ie8'}))\n // pass in options to the stream\n // .pipe(rename({\n // basename: 'main',\n // suffix: '.min'\n // }))\n .pipe(gulp.dest(paths.styles.dest));\n}", "function gulpStyle(done){\n return src(paths.css.src)\n .pipe(plumber())\n .pipe(sourcemap.init({loadMaps: true}))\n .pipe(sass().on('error', sass.logError))\n .pipe(postcss([ autoprefixer() ]))\n .pipe(cleancss())\n .pipe(rename({ suffix: \".min\" }))\n .pipe(sourcemap.write('./'))\n .pipe(dest(paths.css.dest))\n .pipe(browserSync.stream())\n done();\n}", "function cssFolder() {\n return gulp.src('dist/*.min.css').pipe(clean()).pipe(gulp.dest('dist/css/'))\n}", "function compress() {\n return src(['dist/math.js'])\n .pipe(minify({\n ext:{\n min:'.min.js'\n }\n }))\n .pipe(dest('./dist'));\n}", "function runCleanCss(cb) {\n del(global.getDest('scss'), cb);\n}", "function styles() {\n return gulp.src(paths.styles.src)\n .pipe(sass({\n outputStyle: 'expanded'\n }))\n .pipe(autoprefixer('last 6 version'))\n .pipe(gulp.dest('assets/sass'))\n .pipe(cleanCSS())\n // pass in options to the stream\n .pipe(rename({\n suffix: '.min'\n }))\n .pipe(gulp.dest(paths.styles.dest))\n .pipe(concat('main.min.css'))\n .pipe(gulp.dest(paths.styles.dest))\n}", "function css() {\n return gulp.src(path.src.styles.css)\n .pipe(cleanCSS())\n .pipe(concat('main.css'))\n .pipe(gulp.dest(path.build.styles))\n .pipe(reload({stream: true}))\n}", "async function minifyCssFiles(filenames) {\n const preset = litePreset({});\n console.log(`//-- ${chalk.cyan('CSS Minify')} --//`);\n console.log('--------------------');\n\n for (const filename of filenames) {\n console.log(filename);\n const inputFile = fs.readFileSync(filename, 'utf8');\n const writeFilePath = './dist/' + filename.replace('./', '')\n .replace('.css', '.min.css');\n\n const result = await postcss([cssnano({ preset, plugins: [autoprefixer] })])\n .process(inputFile, { from: undefined });\n\n const minifiedCss = result.css.replace(/(url\\(.*)(\\.css)([\\W]\\))/gi, '$1.min.css$3');\n\n ensureDirectoryExistence(writeFilePath);\n fs.writeFileSync(writeFilePath, minifiedCss, 'utf8');\n changedFiles.add(path.resolve(writeFilePath));\n }\n}", "function cssTask(){\n return src(files.cssPath)\n .pipe(browserSync.stream())\n .pipe(concatCss(\"css/main.css\"))\n .pipe(cleanCSS({compatibility: 'ie8'}))\n .pipe(dest('pub')\n );\n }", "async function optimizeScripts() {\n await gulp\n .src(configProd.optimize.scripts.src)\n .pipe(plumber())\n .pipe(uglify(configProd.optimize.scripts.options))\n .pipe(gulp.dest(configProd.optimize.scripts.dest))\n .pipe(size(configProd.size));\n}", "function postCss() {\n var options = [\n $.autoprefixer({browsers: ['last 3 version']}),\n $.cssnano({\n discardUnused: {\n keyframes: false\n },\n discardComments: {\n removeAll: true\n },\n reduceIdents: {\n keyframes: false\n },\n convertValues: true,\n zindex: false\n })\n ];\n return gulp.src(['./assets/css/**/*.css'])\n .pipe($.postcss(options))\n .pipe(gulp.dest('./public/css'));\n}", "function BuildCleanerWebpackPlugin() {}", "async function stylesDev() {\n let processors = [\n atImport(atImportConfig),\n autoprefixer(configDev.styles.autoprefixer)\n ];\n\n await gulp\n .src(configDev.styles.src)\n .pipe(plumber())\n .pipe(sourcemaps.init())\n .pipe(postcss(processors))\n .pipe(sourcemaps.write())\n .pipe(extReplace('.css'))\n .pipe(gulp.dest(configDev.styles.dest));\n}", "function cssDev(){\n\treturn src('./src/sass/main.sass')\n\t\t.pipe(sourcemaps.init({largeFile: true}))\n\t\t.pipe(sass().on('error', sass.logError))\n\t\t.pipe(autoprefixer({\n\t\t\tbrowsers: [\n\t\t\t\t'Android 2.3',\n\t\t\t\t'Android >= 4',\n\t\t\t\t'Chrome >= 20',\n\t\t\t\t'Firefox >= 24', // Firefox 24 is the latest ESR\n\t\t\t\t'Explorer >= 8',\n\t\t\t\t'iOS >= 6',\n\t\t\t\t'Opera >= 12',\n\t\t\t\t'Safari >= 6'\n\t\t\t],\n\t\t\tcascade: false\n\t\t}))\n\t\t//.pipe(hash({\n\t\t//\t\"format\": \"{name}.{hash}{ext}\"\n\t\t//}))\n\t\t.pipe(sourcemaps.write('./map'))\n\t\t.pipe(dest(paths.devDir + paths.staticDir + '/css'));\n}", "function cleaner(){\n walkAndUnlink( path.join(__dirname, 'public', 'css'), new RegExp(/style-/) )\n walkAndUnlink( path.join(__dirname, 'public', 'js'), new RegExp(/kloutskout-/) )\n}", "function compileToMinifiedJS() {\n return src([srcFiles.pathJS])\n .pipe(concat(\"all.js\"))\n .pipe(uglify())\n .pipe(dest(destFolders.minified));\n}", "function cssBundle() {\n let postcssPlugins = [\n autoprefixer()\n ];\n\n return gulp.src([\"scss/facade.scss\"])\n .pipe(sass().on(\"error\", sass.logError))\n .pipe(postcss(postcssPlugins))\n .pipe(gulp.dest(\"public/css\"))\n .pipe(touch())\n .pipe(browserSync.stream());\n}", "function clean() {\n return del(['./static/css/dist/']);\n}", "function compileAppCSS() {\n return processCSS(CFG.SRC.APP_CSS, CFG.OUT.APP_MIN_CSS);\n}", "function cssminifier(css = \"\"){\n\t// Checking for the right type of argument.\n\n\tif (typeof css !== \"string\"){\n\t\tthrow new Error(\"Invalid Type Passed.\");\n\t}\n\n\t// Required Variables\n\n\tlet minifiedcss = ``,\t\t\t// The string that will later be the minified css.\n\t\tinComment = false,\t\t\t// Variable to keep track whether the iterator is part of a comment.\n\t\tspaceregex = /^[\\s{}:;]$/;\t// Regex to check whether the character next to the current character is a punctuation mark and hence, doesn't need to be added.\n\n\tfor(let char = 0; char < css.length; char++){\n\t\t// Iterating over the css char by char.\n\n\t\tif(inComment === false){\n\t\t\tif(css[char] === '/' && css[char + 1] === '*'){\n\t\t\t\t// Checking for the start of a comment.\n\t\t\t\tinComment = true;\t// We are inside a comment. Don't add anything unless it gets over.\n\t\t\t\tchar++;\t\t\t\t// No need to evaluate next character.\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if(css[char] === '\\n'){\n\t\t\t\t// Removing line breaks.\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if(/\\s/.test(css[char]) && (spaceregex.test(css[char + 1]) || spaceregex.test(css[char - 1]))){\n\t\t\t\t// Remove all the extra whitespaces.\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tminifiedcss += css[char];\n\t\t}\n\t\telse{\n\t\t\t// If we are inside a comment. We don't need to add anything.\n\t\t\t// We just need to check if the comment has ended or not.\n\n\t\t\tif(css[char] === '*' && css[char + 1] === '/'){\n\t\t\t\tinComment = false;\t// No longer inside a comment.\n\t\t\t\tchar++;\t\t// No need to evaluate next character.\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcontinue;\t// Don't add the character as its inside a comment.\n\t\t\t}\n\t\t}\n\t}\n\n\t// Now removing all the instances where a closing bracket (}) comes after a semicolon as that isn't needed.\n\n\tminifiedcss = [...minifiedcss];\t // Turning the string into an array of characters.\n\n\tfor(let char = 0; char < minifiedcss.length; char++){\n\t\tif(minifiedcss[char] === ';' && minifiedcss[char + 1] === '}'){\n\t\t\tminifiedcss[char] = '';\t// No data in the character now.\n\t\t}\n\t}\n\n\tminifiedcss = minifiedcss.join('');\t// Joining the array back to a string.\n\n\treturn minifiedcss;\n}", "function clean() {\n return del([ 'website/frontend/static/css' ]);\n}", "function compileJs() {\n return merge(\n // config-theme.js\n src(['src/assets/js/*.js', '!src/assets/js/indonez/*.js'])\n .pipe(beautify({js: {file_types: ['.js']} })) \n .pipe(dest('dist/js')),\n\n // indonez.min.js\n src('src/assets/js/indonez/*.js')\n .pipe(concat('indonez.min.js', {newLine: '\\r\\n\\r\\n'}))\n //.pipe(babel({presets: ['babel-preset-env']}))\n .pipe(minify({minify: true, minifyJS: {sourceMap: false}}))\n .pipe(dest('dist/js/vendors')),\n\n // uikit.min.js\n src('node_modules/uikit/dist/js/uikit.min.js')\n .pipe(newer('dist/js/vendors'))\n .pipe(dest('dist/js/vendors')),\n\n // js vendors\n src('src/assets/js/vendors/*.js')\n .pipe(newer('dist/js/vendors'))\n .pipe(dest('dist/js/vendors'))\n )\n}", "function build(){\n return gulp.src( config.assetPath + \"/styles/**/*.sass\")\n .pipe(sourcemaps.init())\n .pipe(sass({\"style\": \"expanded\"}))\n .on(\"error\", handleErrors)\n .pipe(autoprefixer({\n \"browsers\": config.build.browserlist,\n \"cascade\": false\n }))\n .pipe(sourcemaps.write())\n .pipe(gulp.dest( config.dev + \"/css\" ))\n}", "function scriptsCSSans() {\n return (\n gulp\n .src(['./_src/cssans/js/**/*.js'])\n .pipe(concat('cssans.min.js'))\n .pipe(uglify())\n .pipe(gulp.dest('./dist/'))\n );\n}", "async function distStyle() {\n return (\n gulp\n .src('src/scss/**/*.scss')\n .pipe(sass().on('error', sass.logError))\n .pipe(autoprefixer())\n .pipe(\n uglifycss({\n uglyComments: true,\n })\n )\n .pipe(gulp.dest('./dist/css'))\n // Stream css changes to all browsers\n .pipe(browserSync.stream())\n );\n}", "function compileVendorCSS() {\n return processCSS(CFG.SRC.VENDOR_CSS, CFG.OUT.VENDOR_MIN_CSS);\n}", "function cleanCssOut() {\n\treturn del([cssDest + cssOut]);\n}", "function style() {\n // 1. where is my scss file\n return gulp.src('./src/Assets/scss/**/*.scss')\n // 2. pass that file through sass compiler\n .pipe(sass())\n .pipe(cleanCSS())\n .pipe(rename({ suffix: '.min'}))\n .pipe(changed('./src/Assets/css'))\n //3 . where do I save the compiled CSS?\n .pipe(gulp.dest('./src/Assets/css'))\n //4. stream changes to all brouser\n}", "function cssTask() {\n return src(files.cssPath)\n .pipe(postcss([autoprefixer(), cssnano()])) // PostCSS plugins\n .pipe(sourcemaps.write(\".\")) // write sourcemaps file in current directory\n .pipe(dest(\"dist/css\")) // put final CSS in dist folder\n .pipe(browserSync.stream()); //让css文件在不刷新的情况下依旧能够被注入更改;\n}", "function minJs() {\n return gulp\n .src(paths.dev.js)\n .pipe(babel({\n presets: ['@babel/env']\n }))\n .pipe(concat('main.js'))\n .pipe(minify({\n ext: {\n min: '.min.js'\n },\n }))\n .pipe(gulp.dest(paths.dist.js))\n}", "function clean() {\r\n return del(['./wwwroot/css/site.min.css', './wwwroot/js/site.min.js']);\r\n}", "function cleanCss(cb) {\n\treturn del(paths.devDir + paths.staticDir + '/css').then(() => {\n\t\tcb();\n\t});\n}", "function cssSite() {\n return gulp\n\n // Dev version\n .src('./_src/site/sass/**/*.scss')\n .pipe(sourcemaps.init())\n .pipe(plumber())\n .pipe(sass({ outputStyle: 'expanded' }))\n .pipe(sourcemaps.write())\n .pipe(gulp.dest('./_min/'))\n .pipe(gulp.dest('./_site/_min/')) /* Update _site for live reloading */\n\n // Prod version\n .pipe(rename({ suffix: '.min' }))\n .pipe(postcss([autoprefixer(), cssnano()]))\n .pipe(gulp.dest('./_includes/assets/'));\n}", "function minJs() {\n return gulp\n .src(paths.dev.js)\n .pipe(concat('main.js'))\n .pipe(minify({\n ext: {\n min: '.min.js'\n },\n }))\n .pipe(gulp.dest(paths.dist.js));\n}", "function css()\n{\n var streams = pathConfig.css.map( function( folder )\n {\n return gulp.src( getGlob( folder ) )\n .pipe( $.clipEmptyFiles() )\n .pipe( !$.util.env.production && !folder.thirdParty ? $.sass.sync().on( 'error', $.sass.logError ) : $.util.noop() )\n .pipe( $.util.env.production && !folder.thirdParty ? $.sass.sync() : $.util.noop() )\n .pipe( !folder.thirdParty ? $.autoPrefixer( taskConfig.css.autoPrefixer ) : $.util.noop() )\n .pipe( !folder.thirdParty ? $.combineMq() : $.util.noop() )\n .pipe( $.util.env.production ? $.cssNano( taskConfig.css.cssNano ) : $.util.noop() )\n .pipe( gulp.dest( folder.dist ) );\n } );\n\n return $.mergeStream( streams );\n}", "function processStyles(input, output, onComplete) {\n concat(input, output, function() {\n if (_options.pack.css.minify) {\n fs.readFile(output, 'utf8', function(){\n minifyStyles(output, output, onComplete);\n });\n }\n else {\n onComplete && onComplete();\n }\n });\n}", "function minifyJs() {\r\n\treturn gulp\r\n\t\t.src( paths.js.src )\r\n\t\t.pipe( uglify() )\r\n\t\t.pipe( rename( { suffix: '.min' } ) )\r\n\t\t.pipe( gulp.dest( paths.js.dest ) )\r\n\t\t.on( 'error', notify.onError() );\r\n}", "async function minify(){\n const { terser } = await import('rollup-plugin-terser');\n return terser({\n output: {\n //comments: \"all\",\n comments: function(node, comment) {\n var text = comment.value;\n var type = comment.type;\n if (type == 'comment2') {\n // multiline comment\n return /@preserve|@license|@cc_on/i.test(text);\n }\n },\n }\n });\n}", "function buildCSS(done) {\n const scssFiles = [\n 'src/scss/style.scss'\n ];\n gulp.src(scssFiles)\n .pipe(errorNotify('Error on Compile CSS'))\n .pipe(scss())\n .pipe(autoprefixer(autoprefixerBrowsers))\n .pipe(beautify.css({\n indent_size: 4\n }))\n .pipe(gulp.dest('app/assets/css/'));\n done();\n}", "function consolidateStreamedStyles() {\n if (\"production\" !== 'production') {\n // eslint-disable-next-line no-console\n console.warn('styled-components automatically does streaming SSR rehydration now.\\n' + 'Calling consolidateStreamedStyles manually is no longer necessary and a noop now.\\n' + '- Please remove the consolidateStreamedStyles call from your client.');\n }\n}", "function concat_css(){\r\n\treturn gulp.src(source.css)\r\n\t.pipe(concatCSS('app.css'))\r\n\t.pipe(gulp.dest(paths.dist + 'bundles/'));\r\n}", "function cssTask() {\n return src(files.cssPath)\n //conCat put the files togheter into a file with the name main.css\n .pipe(conCat('main.css'))\n .pipe(cssnano())\n .pipe(dest('pub/css'));\n}", "function css() {\n var plugins = [autoprefixer()];\n return gulp\n .src([\"./webpage/src/scss/main.scss\"])\n .pipe(sourcemaps.init())\n .pipe(sass())\n .pipe(postcss(plugins))\n .pipe(minifyCSS())\n .pipe(sourcemaps.write(\"../maps\"))\n .pipe(gulp.dest(\"./webpage/dist/css\"));\n}", "function compileSass() {\n return gulp.src('./src/scss/*.scss')\n .pipe(sass())\n /*.pipe(purgecss({\n content: ['./dist/!*.html']\n }))*/\n .pipe(gulp.dest(\"./src/css\"))\n .pipe(cleanCSS())\n .pipe(rename({suffix: '.min'}))\n .pipe(gulp.dest(\"./dist/css\"))\n .pipe(browserSync.stream());\n}", "function styles() {\n return gulp.src(paths.styles.src)\n .pipe(less()\n .on('error', function (e) {\n console.error(e.message);\n this.emit('end');\n }))\n .pipe(autoprefixer())\n .pipe(minify({\n compatibility: 'ie7'\n }))\n .pipe(rename({ suffix: '.min' }))\n .pipe(gulp.dest(paths.styles.dest));\n}", "function processStyles() {\n return gulp.src(\n [\n srcRoot + \"**/*.scss\"\n ]\n ).pipe(\n sourcemaps.init()\n ).pipe(\n sass().on(\n \"error\",\n sass.logError\n )\n ).pipe(\n cssNano(config.cssNano)\n ).pipe(\n concat(\"health-bam.all.min.css\")\n ).pipe(\n sourcemaps.write(\"./\")\n ).pipe(\n gulp.dest(destination)\n );\n }", "function getMinimizerConfig() {\n return global.FOO_PROD\n ? [\n new UglifyJsPlugin({\n uglifyOptions: {\n parse: {\n html5_comments: false\n },\n comments: false,\n compress: {\n warnings: false,\n drop_console: true,\n drop_debugger: true\n }\n },\n extractComments: true\n })\n ]\n : [];\n}", "function minifyEs () {\n return src('src/js/**/*.js')\n .pipe(uglify())\n .pipe(dest('build/js'))\n}", "function scssBuild() {\n return gulp\n .src(paths.src.scss + \"index.scss\")\n .pipe(\n plumber({ errorHandler: notify.onError(\"Error: <%= error.message %>\") })\n )\n .pipe(sass(sassOptions))\n .pipe(postcss(postcssOptions))\n .pipe(gcmq())\n .pipe(gulpif(banner.visible, header(banner.basic, { pkg, pjt })))\n .pipe(rename(pkg.name + \".css\"))\n .pipe(gulp.dest(paths.dist.css))\n .pipe(cleanCSS())\n .pipe(rename({ suffix: \".min\" }))\n .pipe(gulp.dest(paths.dist.css))\n}", "function buildStyles() {\n\tconst plugins = [\n\t\tpostcssImport(),\n\t\tcombineMQ(),\n\t\tsortMQ({ sort: 'desktop-first' }),\n\t\tpxtorem({\n\t\t\treplace: false,\n\t\t\trootValue: 16,\n\t\t\tpropList: ['*'],\n\t\t}),\n\t];\n\n\treturn src('./src/styles/main.scss')\n\t\t.pipe(sass({ outputStyle: 'compressed' }).on('error', sass.logError))\n\t\t.pipe(postcss(plugins))\n\t\t.pipe(dest('build/css/'))\n\t\t.pipe(browserSync.stream());\n}", "function sass() {\r\n\tconst postCssPlugins = [ \t\t// Autoprefixer siehe https://www.npmjs.com/package/autoprefixer\r\n\t\tautoprefixer({ browsers: CONF.COMPATIBILITY }),\r\n\t].filter(Boolean);\r\n\tconst sourcefiles = [SRC + '/assets/scss/app.scss', SRC + '/assets/scss/editor.scss'];\r\n\r\n\treturn gulp.src(sourcefiles)\r\n\t\t.pipe($.sourcemaps.init())\r\n\t\t.pipe($.sass({\r\n\t\t\tincludePaths: CONF.PATHS.sass\r\n\t\t})\r\n\t\t\t.on('error', $.sass.logError))\r\n\t\t.pipe($.postcss(postCssPlugins))\r\n\t\t.pipe(rename({ suffix: \"-roh\", }))\r\n\t\t.pipe(gulp.dest(CONF.PATHS.dist + '/assets/css'))\t//****************** DEST roh ******************************\r\n\t\t// .pipe(rename({ suffix: \"-uncss\", }))\r\n\t\t// .pipe(uncss(CONF.PATHS.uncss_options))\r\n\t\t// .pipe(gulp.dest(CONF.PATHS.dist + '/assets/css'))\t//****************** DEST uncss ******************************\r\n\t\t.pipe(rename({ suffix: \"-cleancss\", }))\r\n\t\t.pipe($.cleanCss({ compatibility: 'ie9' }))\r\n\t\t.pipe(gulp.dest(CONF.PATHS.dist + '/assets/css'))\t//****************** DEST cleanCss ******************************\r\n\t\t.pipe(rename({ suffix: \"-sourcemap\", }))\r\n\t\t.pipe($.sourcemaps.write())\r\n\t\t.pipe(gulp.dest(CONF.PATHS.dist + '/assets/css'));\t//****************** DEST sourcemap ******************************\r\n\t\t// .pipe(rename({\tsuffix: \"-rev\", }))\r\n\t\t// .pipe($.rev())\r\n\t\t// .pipe(gulp.dest(CONF.PATHS.dist + '/assets/css'))\t//****************** DEST rev ******************************\r\n\t\t// .pipe(rename({\tsuffix: \"-manifest\", }))\r\n\t\t// .pipe($.rev.manifest())\r\n\t\t// .pipe(gulp.dest(CONF.PATHS.dist + '/assets/css'))\t//****************** DEST manifest ******************************\r\n}", "function prodScripts(){\n return gulp\n .src(config.scripts.src)\n .pipe($.babel())\n .pipe($.concat(config.scripts.bundle))//after babel transpiling\n .pipe($.uglify())//now minify app.js\n .pipe(gulp.dest(config.scripts.dest)); \n}", "function build() {\r\n\t\tgulp.src(path.src)\r\n\t\t\t// Initialize source maps\r\n\t\t\t.pipe(plugins.sourcemaps.init())\r\n\t\t\t// Build the sass\r\n\t\t\t.pipe(plugins.sass().on('error', plugins.sass.logError))\r\n\t\t\t// Run any PostCSS actions\r\n\t\t\t// autoprefixer in our case\r\n\t\t\t.pipe(plugins.postcss(postCssOptions))\r\n\t\t\t// Write source maps\r\n\t\t\t.pipe(plugins.sourcemaps.write('.'))\r\n\t\t\t// Write CSS files and source map files\r\n\t\t\t.pipe(gulp.dest(path.dest))\r\n\t\t\t\t// Filter CSS files from the stream\r\n\t\t\t\t.pipe(plugins.filter(glob))\r\n\t\t\t\t// Minify these CSS files\r\n\t\t\t\t// creating a second,\r\n\t\t\t\t// minified variant of our compiled file\r\n\t\t\t\t.pipe(plugins.minifyCss())\r\n\t\t\t\t// Rename these CSS files to .min.css\r\n\t\t\t\t.pipe(plugins.rename(config.params.rename))\r\n\t\t\t\t// Write minified files\r\n\t\t\t\t.pipe(gulp.dest(path.dest));\r\n\t}" ]
[ "0.7908697", "0.74718785", "0.74689233", "0.7414659", "0.74015915", "0.7376908", "0.73444664", "0.723997", "0.7231879", "0.7213696", "0.7136727", "0.7123864", "0.7103397", "0.7025357", "0.70233846", "0.7003923", "0.69819486", "0.6957991", "0.6934078", "0.691753", "0.6905753", "0.68530405", "0.6678683", "0.6669415", "0.65855545", "0.65101814", "0.64547014", "0.6412527", "0.6391566", "0.6363489", "0.6359669", "0.6345691", "0.6332954", "0.6294758", "0.6266969", "0.6265308", "0.62457734", "0.62348914", "0.6225083", "0.6206225", "0.6203098", "0.6170715", "0.6163547", "0.61574143", "0.6157015", "0.61375993", "0.6134541", "0.6130252", "0.6125319", "0.60997105", "0.60983336", "0.6096164", "0.60831016", "0.6048647", "0.6043204", "0.60401666", "0.6039412", "0.603291", "0.60308546", "0.60277086", "0.60183996", "0.60182405", "0.60043204", "0.59907186", "0.59898436", "0.5988347", "0.59851843", "0.5981797", "0.5979223", "0.59414375", "0.59320503", "0.59267753", "0.5918221", "0.591713", "0.590662", "0.5898991", "0.5886757", "0.58849555", "0.58844614", "0.5877725", "0.58681524", "0.5858326", "0.5851532", "0.5844251", "0.58306843", "0.58267105", "0.57954514", "0.5789721", "0.5784982", "0.5779438", "0.57787454", "0.5777075", "0.57733107", "0.5773053", "0.5762471", "0.5756104", "0.5754877", "0.57498777", "0.57468885", "0.5739391" ]
0.7469411
2
render the CSS file
async render({ entryPath }) { try { const css = await this.compile({ file: entryPath }) const result = await this.minify(css) return result; } catch (err) { // if things go wrong if (isProd) { // throw and abort in production throw new Error(err) } else { console.error(err) } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function styles(request, response) {\n var rootFolder = path.dirname(require.main.filename);\n var fileName = path.join(rootFolder, \"www/styles/styles.css\");\n fs.readFile(fileName, function (err, data) {\n if (err) {\n response.writeHead(404, {\n \"Content-Type\": \"text/plain; charset=utf-8\"\n });\n response.end(\"HTTP Status: 404 : NOT FOUND\");\n } else {\n response.writeHead(200, {\n \"Content-Type\": \"text/css; charset=utf-8\"\n });\n response.end(data);\n }\n });\n}", "function renderCss(sheet) {\n var styleCode = fs.readFileSync(sheet, 'utf8')\n var outputName = path.basename(sheet, '.styl')\n\n stylus(styleCode)\n .include(path.dirname(stylePaths))\n .render(function(err, css) {\n var outputFile = path.resolve(outputDir, outputName + '.css')\n\n mkdirp.sync(path.dirname(outputFile))\n\n fs.writeFileSync(outputFile, css)\n })\n }", "render () {\n let stylesheet = document.createElement('style')\n stylesheet.innerHTML = this.styles || ''\n this.stylesheet = stylesheet\n document.body.appendChild(stylesheet)\n\n document.body.appendChild(this.node)\n }", "function user_style() {\r\n\tres.contentType = 'text/css';\r\n\tres.write(this.custom_style);\r\n}", "function readCss(request, response, suffix) {\r\n\tvar data = fs.readFileSync(\"..\" + request.url, \"utf-8\");\r\n\tresponse.writeHead(200, {\"Content-Type\": {\r\n\t\t\".css\":\"text/css\",\r\n\t\t\".js\":\"application/javascript\",\r\n\t}[suffix]\r\n });\r\n\tresponse.write(data);\r\n\tresponse.end();\r\n}", "function renderScss() {\n // Start rendering\n sass.render(scssConfig, function (err, result) {\n if ( err ) {\n return handleError(err);\n }\n\n // Write CSS\n fs.writeFile(csspath + 'styles.css', result.css, 'utf8', function () {\n handleWrite(err, result);\n });\n\n // Write sourcemap\n fs.writeFile(csspath + 'styles.css.map', result.map, 'utf8');\n });\n}", "function loadCSS (filename) {\n var fileobj = document.createElement('link');\n fileobj.setAttribute('rel','stylesheet');\n fileobj.setAttribute('type','text/css');\n fileobj.setAttribute('href',filename);\n document.getElementsByTagName('head')[0].appendChild(fileobj);\n}", "function cssTask() {\n return src(files.cssPath)\n //conCat put the files togheter into a file with the name main.css\n .pipe(conCat('main.css'))\n .pipe(cssnano())\n .pipe(dest('pub/css'));\n}", "function css() {\n\n // 1 - pegue o arquivo sass/scss referente ao app\n // 2 - compile o arquivo para css\n // 3 - aplique atributos compatíveis com a versão de browser especificada na propriedade \"browserslist\" do arquivo package.json\n // 4 - crie os arquivos e coloque o compilado css na pasta de destino\n // 5 - minifique o arquivo css\n // 6 - renomeie o arquivo minificado\n // 7 - coloque minificado css na pasta de destino\n let css = gulp.src(`${src.sass}/${appName}.{scss,sass}`)\n .pipe(sassCompiler().on('error', sassCompiler.logError))\n .pipe(autoprefixer())\n .pipe(csso())\n .pipe(rename({ extname: '.min.css' }))\n .pipe(gulp.dest(dest.css));\n\n if (uploadFiles) {\n\n // aplique a stream de upload de arquivos\n css = upload(css, dest.css);\n }\n\n return css;\n }", "function css() {\n return (\n src([`${srcDir}/**/*.css`, `!${srcDir}/**/_*.css`])\n .pipe(\n postcss().on('error', function(err) {\n console.error(err);\n this.emit('end'); // 防止中断\n })\n )\n // 去掉编译出来的 :root{}\n .pipe(replace(/:root\\s\\{[^}]*\\}?\\s*/, ''))\n .pipe(\n rename(path => {\n path.extname = '.wxss';\n })\n )\n .pipe(\n dest(file => {\n return file.base; // 原目录\n })\n )\n );\n}", "function addCSS(filename) {\n var head = document.getElementsByTagName('head')[0]\n\n var style = document.createElement('link')\n style.href = filename\n style.type = 'text/css'\n style.rel = 'stylesheet'\n head.append(style)\n }", "function DOM_add_css (file) {\r\n jQuery('head').append(`<link rel=\"stylesheet\" href=${file} type=\"text/css\" />`);\r\n}", "function SetCSS()\r\n {\r\n var cssfile = _settings.csssettings.file,\r\n cssafter = _data.cssafter,\r\n cache = _settings.cache;\r\n\r\n if($.inArray(cssfile, _globalself.csscache) < 0)\r\n {\r\n _globalself.csscache.push(cssfile);\r\n cssafter.after($(StringFormat('<link rel=\"styleSheet\" type=\"text/css\" href=\"{0}\" />', cssfile)));\r\n }\r\n \r\n GetContent();\r\n }", "function loadcssfile(filename){\n\tvar fileref=document.createElement(\"link\");\n\tfileref.setAttribute(\"rel\", \"stylesheet\");\n\tfileref.setAttribute(\"type\", \"text/css\");\n\tfileref.setAttribute(\"href\", filename);\n\tdocument.getElementsByTagName(\"head\")[0].appendChild(fileref);\n}", "function loadCSS() {\n\n // CSS file not loaded yet? => load CSS file\n if ( !resource ) jQuery( 'head' ).append( '<link rel=\"stylesheet\" type=\"text/css\" href=\"' + url + '\">' );\n\n // immediate perform success callback\n success();\n\n }", "function css() {\n return src('./src/styles.styl')\n .pipe(stylus({\n 'include css': true\n }))\n .pipe(dest('dist/'))\n //.pipe(livereload());\n}", "function add_css$c() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-19yho4w-style\";\n\tstyle.textContent = \".wrapper.svelte-19yho4w{width:var(--size);height:calc(var(--size) / 2);overflow:hidden}.rainbow.svelte-19yho4w{width:var(--size);height:var(--size);border-left-color:transparent;border-bottom-color:transparent;border-top-color:var(--color);border-right-color:var(--color);box-sizing:border-box;transform:rotate(-200deg);border-radius:50%;border-style:solid;animation:var(--duration) ease-in-out 0s infinite normal none running svelte-19yho4w-rotate}@keyframes svelte-19yho4w-rotate{0%{border-width:10px}25%{border-width:3px}50%{transform:rotate(115deg);border-width:10px}75%{border-width:3px}100%{border-width:10px}}\";\n\tappend(document.head, style);\n}", "function css() {\n\treturn src( folder.src + 'css/*.css' )\n\t\t.pipe( minifyCSS() )\n\t\t.pipe( dest( folder.build + 'css' ) )\n}", "function loadCSS(path,name) {\n stylus(fs.readFileSync(__dirname+path,'utf8'))\n .use(nib())\n .render(function(err,out) {\n if (err) { throw err; }\n css[name] = pd.cssmin(out)\n })\n}", "function includeCSS(filename)\r\n{\r\n link = document.createElement('link');\r\n link.rel = 'stylesheet';\r\n link.href = filename;\r\n link.type = 'text/css';\r\n link.media = 'screen, print';\r\n document.getElementsByTagName('head').item(0).appendChild(link);\r\n}", "function css(){\n return gulp.src(paths.styles.src)\n .pipe(gulp.dest(paths.styles.dest));\n\n}", "function tmpServer() {\n\tdocument.getElementsByTagName(\"body\")[0].classList.add(\"container\");\n\tvar str = \"../siteassets/style.min.css\";\n\tdocument.getElementById(\"css\").innerHTML = res;\n\tvar theme = document.getElementById(\"theme\");\n\n\ttheme.href=\"../siteassets/service.min.css\";\n\t\n\t\n}", "function css(){\n\n //retornamos la hoja de sass\n return src(paths.scss) //identifica la hoja de estilos\n .pipe(sass({\n outputStyle:'expanded'\n })) //aplica esta funcion primero (compilamos el sass a css)\n .pipe(dest('./build/css')) //despues lo guardamos, mandamos a llamar la funcion para que se cree la carpeta build\n}", "function loadCSS () {\n const script = [\n require('raw!uglify!fg-loadcss/src/loadCSS'),\n require('raw!uglify!fg-loadcss/src/cssrelpreload.js')\n ].join(';')\n return '<SCRIPT>' + script + '</SCRIPT>'\n}", "function loadCSS()\n {\n var head = document.getElementsByTagName('head')[0];\n var link = document.createElement('link');\n link.rel = 'stylesheet';\n link.type = 'text/css';\n link.href = path + \"/whiteboard.css\";\n link.media = 'all';\n head.appendChild(link);\n }", "async function buildCss() {\n fs.rmdirSync(path.resolve(\"css\"), { recursive: true });\n fs.mkdirSync(path.resolve(\"css\"));\n\n Object.keys(themes).forEach(async (theme) => {\n try {\n const outFile = path.resolve(\"css\", theme + \".css\");\n const { css } = await sassRender({\n data: `\n $feature-flags: (\n enable-css-custom-properties: ${theme === \"all\"},\n grid-columns-16: true,\n );\n @import \"node_modules/@carbon/themes/scss/themes\";\n ${themes[theme]}\n ${shared.globals}\n ${shared.components}\n `,\n outFile,\n outputStyle: \"compact\",\n omitSourceMapUrl: true,\n });\n\n const prefixed = await postcss([\n autoprefixer({\n overrideBrowserslist: [\"last 1 version\", \"ie >= 11\", \"Firefox ESR\"],\n }),\n ]).process(css, { from: undefined });\n\n await writeFile(outFile, prefixed.css);\n } catch (e) {\n console.log(e);\n }\n });\n}", "createCSS() {\n return \"\";\n }", "function getCSS(file) {\n\n var rawFile = new XMLHttpRequest();\n var allText = '';\n rawFile.open(\"GET\", file, false);\n rawFile.onreadystatechange = function () {\n if(rawFile.readyState === 4) {\n if(rawFile.status === 200 || rawFile.status == 0) {\n allText = rawFile.responseText;\n }\n }\n };\n rawFile.send(null);\n return allText;\n\n }", "function getCSS(file) {\n\n var rawFile = new XMLHttpRequest();\n var allText = '';\n rawFile.open(\"GET\", file, false);\n rawFile.onreadystatechange = function () {\n if(rawFile.readyState === 4) {\n if(rawFile.status === 200 || rawFile.status == 0) {\n allText = rawFile.responseText;\n }\n }\n };\n rawFile.send(null);\n return allText;\n\n }", "function getCSS(file) {\n\n var rawFile = new XMLHttpRequest();\n var allText = '';\n rawFile.open(\"GET\", file, false);\n rawFile.onreadystatechange = function () {\n if(rawFile.readyState === 4) {\n if(rawFile.status === 200 || rawFile.status == 0) {\n allText = rawFile.responseText;\n }\n }\n };\n rawFile.send(null);\n return allText;\n\n }", "function getCSS(file) {\n\n var rawFile = new XMLHttpRequest();\n var allText = '';\n rawFile.open(\"GET\", file, false);\n rawFile.onreadystatechange = function () {\n if(rawFile.readyState === 4) {\n if(rawFile.status === 200 || rawFile.status == 0) {\n allText = rawFile.responseText;\n }\n }\n };\n rawFile.send(null);\n return allText;\n\n }", "function css() {\n return src(url_src + 'scss/style.scss')\n .pipe(sassGlob())\n .pipe(\n sass({\n outputStyle: 'expand' //expand or compact or compressed\n })\n .on('error', sass.logError)\n ).pipe(\n browserSync.reload({\n stream: true\n })\n ).pipe(\n autoprefixer({\n cascade: true\n })\n ).pipe(dest(url_dest + 'css/'));\n}", "function css() {\n if (fs.existsSync(PATHS.less.index)) {\n return less(PATHS.less.index);\n }\n if (fs.existsSync(PATHS.sass.index)) {\n return sass(PATHS.sass.index);\n }\n console.log(\"No scss/less index found\");\n return false;\n}", "function writeCss() { //写css\n\n\tvar cssOut,\n\t\timages = exportImageData,\n\t\tidx = images.length - 1,\n\t\thdr = exportHeader;\n\n\tcssOut = new File(hdr.outDir + '/' + hdr.cssDir + '/' + hdr.prefix + '.css');\n\tcssOut.open('w');\n\tcssOut.writeln('/* exported css for ' + hdr.psdName + ' */');\n\tcssOut.writeln('\\n');\n\tcssOut.writeln('body,html { width:100%;height:100%; }');\n\tcssOut.writeln('div>img { width:100%;height:100%; }');\n\tcssOut.writeln('\\n');\n\tcssOut.writeln('body { margin: 0px; padding:0px; background: hsl(229, 47%, 9%); }');\n\tcssOut.writeln('\\n');\n\tcssOut.writeln('.wrap {');\n\tcssOut.writeln(' position: relative;');\n\tcssOut.writeln(' width: 100%;');\n\tcssOut.writeln(' height: 100%;');\n\tcssOut.writeln(' overflow: hidden;');\n\tcssOut.writeln('}');\n\n\t// Photoshop extracts top first; put em in the css bottom first\n\n\tif (_DATA.cssUnit == '%') {\n\t\tfor (idx; idx >= 0; idx -= 1) {\n\n\t\t\tcssOut.writeln('\\n');\n\t\t\tcssOut.writeln('.' + removeHyphen(images[idx].name) + ' {');\n\t\t\tcssOut.writeln(' position: absolute;');\n\t\t\tcssOut.writeln(' top: ' + parseFloat(parseInt((images[idx].top * 100 / hdr.psdHeight)*100)/100) + '%;');\n\t\t\tcssOut.writeln(' left: ' + parseFloat(parseInt((images[idx].left * 100 / hdr.psdWidth)*100)/100) + '%;');\n\t\t\tcssOut.writeln(' height: ' + parseFloat(parseInt((images[idx].height * 100 / hdr.psdHeight)*100)/100) + '%;');\n\t\t\tcssOut.writeln(' width: ' + parseFloat(parseInt((images[idx].width * 100 / hdr.psdWidth)*100)/100) + '%;');\n\t\t\tcssOut.writeln(' background: url(../' + hdr.imgDir + '/' + images[idx].name + hdr.extension + ') no-repeat;');\n\t\t\tcssOut.writeln(' background-size: 100% 100%;');\n\t\t\tcssOut.writeln('}');\n\t\t}\n\t}\n\telse if (_DATA.cssUnit == 'rem') {\n\t\tfor (idx; idx >= 0; idx -= 1) {\n\n\t\t\tcssOut.writeln('\\n');\n\t\t\tcssOut.writeln('.' + removeHyphen(images[idx].name) + ' {');\n\t\t\tcssOut.writeln(' position: absolute;');\n\n\t\t\t// 增加适配单位\n\t\t\tcssOut.writeln(' top: ' + parseFloat(images[idx].top) / 100 + 'rem;');\n\t\t\tcssOut.writeln(' left: ' + parseFloat(images[idx].left) / 100 + 'rem;');\n\t\t\tcssOut.writeln(' height: ' + parseFloat(images[idx].height) / 100 + 'rem;');\n\t\t\tcssOut.writeln(' width: ' + parseFloat(images[idx].width) / 100 + 'rem;');\n\n\t\t\tcssOut.writeln(' background: url(../' + hdr.imgDir + '/' + images[idx].name + hdr.extension + ') no-repeat;');\n\t\t\tcssOut.writeln(' background-size: 100% 100%;');\n\t\t\tcssOut.writeln('}');\n\t\t}\n\t} else {\n\t\tfor (idx; idx >= 0; idx -= 1) {\n\n\t\t\tcssOut.writeln('\\n');\n\t\t\tcssOut.writeln('.' + removeHyphen(images[idx].name) + ' {');\n\t\t\tcssOut.writeln(' position: absolute;');\n\n\t\t\tcssOut.writeln(' top: ' + parseInt(images[idx].top) + 'px;');\n\t\t\tcssOut.writeln(' left: ' + parseInt(images[idx].left) + 'px;');\n\t\t\tcssOut.writeln(' height: ' + parseInt(images[idx].height) + 'px;');\n\t\t\tcssOut.writeln(' width: ' + parseInt(images[idx].width) + 'px;');\n\n\t\t\tcssOut.writeln(' background: url(../' + hdr.imgDir + '/' + images[idx].name + hdr.extension + ') no-repeat;');\n\t\t\tcssOut.writeln(' background-size: 100% 100%;');\n\t\t\tcssOut.writeln('}');\n\t\t}\n\t}\n\n\tcssOut.close();\n}", "function style() {\n\t// Where is My Scss file\n\treturn (\n\t\tgulp\n\t\t\t.src(\"app/assets/scss/**/*.scss\")\n\t\t\t//Pass the file through Sass Compiler\n\t\t\t.pipe(sass())\n\t\t\t//Where i Do Save the Compiled CSS ?\n\t\t\t.pipe(gulp.dest(\"app/assets/css\"))\n\t\t\t//Settle Down thing Automatically\n\t\t\t.pipe(browserSync.stream())\n\t);\n}", "function style() {\n // 1.find scss file\n return gulp.src(cssPath)\n // 2. pass that file through sass compiles\n .pipe(sass())\n //3. save the compiled css\n .pipe(gulp.dest(toFolder))\n //4. stream changes to all browser\n .pipe(browserSync.stream())\n}", "render() {\n this.getColorsFromCSS();\n this.drawLines();\n }", "function saveStylesheet() {\n console.info( 'Creating stylesheet...' );\n var stylePath = rootPath + styleDirectory + '/style.css';\n fs.unlink( stylePath, function() {} );\n loadUrlSync( webUrl, function( html ) {\n\tvar doc = domino.createDocument( html );\n\tvar links = doc.getElementsByTagName( 'link' );\n\tvar cssUrlRegexp = new RegExp( 'url\\\\([\\'\"]{0,1}(.+?)[\\'\"]{0,1}\\\\)', 'gi' );\n\tvar cssDataUrlRegex = new RegExp( '^data' );\n\t\n\tfor ( var i = 0; i < links.length ; i++ ) {\n\t var link = links[i];\n\t if (link.getAttribute('rel') === 'stylesheet') {\n\t\tvar url = link.getAttribute('href');\n\n\t\t/* Need a rewrite if url doesn't include protocol */\n\t\turl = getFullUrl( url );\n\t\t\n\t\tconsole.info( 'Downloading CSS from ' + decodeURI( url ) );\n\t\tloadUrlSync( url, function( body ) {\n\n\t\t /* Downloading CSS dependencies */\n\t\t var match;\n\t\t var rewrittenCss = body;\n\t\t \n\t\t while (match = cssUrlRegexp.exec( body ) ) {\n\t\t\tvar url = match[1];\n\t\t\t\n\t\t\t/* Avoid 'data', so no url dependency */\n\t\t\tif ( ! url.match( '^data' ) ) {\n\t\t\t var filename = pathParser.basename( urlParser.parse( url, false, true ).pathname );\n\t\t\t \n\t\t\t /* Rewrite the CSS */\n\t\t\t rewrittenCss = rewrittenCss.replace( url, filename );\n\t\t\t \n\t\t\t /* Need a rewrite if url doesn't include protocol */\n\t\t\t url = getFullUrl( url );\n\t\t\t \n\t\t\t /* Download CSS dependency */\n\t\t\t downloadFile(url, rootPath + styleDirectory + '/' +filename );\n\t\t\t}\n\t\t }\n\t\t fs.appendFileSync( stylePath, rewrittenCss );\n\t\t});\n\t }\n\t}\n });\n}", "function css() {\n return gulp.src(path.src.styles.css)\n .pipe(cleanCSS())\n .pipe(concat('main.css'))\n .pipe(gulp.dest(path.build.styles))\n .pipe(reload({stream: true}))\n}", "function cssTask() {\n return src(files.cssPath)\n .pipe(postcss([autoprefixer(), cssnano()])) // PostCSS plugins\n .pipe(sourcemaps.write(\".\")) // write sourcemaps file in current directory\n .pipe(dest(\"dist/css\")) // put final CSS in dist folder\n .pipe(browserSync.stream()); //让css文件在不刷新的情况下依旧能够被注入更改;\n}", "function loadCss(url) {\n var head = document.getElementsByTagName(\"head\")[0];\n var link = document.createElement(\"link\");\n link.href = url + \"?rand=\" + Math.random();\n link.rel = \"stylesheet\";\n link.type = \"text/css\";\n head.appendChild(link);\n }", "function cssTask(){\n return src(files.cssPath)\n .pipe(browserSync.stream())\n .pipe(concatCss(\"css/main.css\"))\n .pipe(cleanCSS({compatibility: 'ie8'}))\n .pipe(dest('pub')\n );\n }", "function setCss(banDoc, repStyleObj) {\r\n let textCSS = \"\";\r\n let file = Banana.IO.getLocalFile(\"file:script/rendiconto5xMille.css\");\r\n let fileContent = file.read();\r\n if (!file.errorString) {\r\n Banana.IO.openPath(fileContent);\r\n //Banana.console.log(fileContent);\r\n textCSS = fileContent;\r\n } else {\r\n Banana.console.log(file.errorString);\r\n }\r\n // Parse the CSS text\r\n repStyleObj.parse(textCSS);\r\n}", "function rewriteTagColorCSS()\n {\n var cssFile;\n var colorHash;\n\n cssFile= getCSSFile();\n if (cssFile.exists())\n {\n colorHash= getColorHash(cssFile);\n writeCSS(cssFile, colorHash);\n loadStyle(cssFile);\n }\n }", "function get_css_result(res) {\r\n\tvar css = res.responseText;\r\n\tvar status = res.status;\r\nLOG.output(\"HTTP status:\"+status);\r\n\tif ( status != 200 ) {\t// failed\r\n\t\tGM_log(\"Can't get CSS file (HTTP status=\"+status+\")\");\r\n\t\treturn;\r\n }\r\n Add_CSS(css);\r\n}", "function css() {\n return gulp.src('./public/assets/scss/*.scss')\n // compile to css\n .pipe(sass())\n // take compiled css and place into folder\n .pipe(gulp.dest('./public/bin/css/'))\n //browser realod\n .pipe(browserSync.stream());\n}", "function cssLoad(){\r\n\tvar cssId = 'style';\r\n\tvar head = document.getElementsByTagName('head')[0];\r\n\tvar link = document.createElement('link');\r\n\tlink.id = cssId;\r\n\tlink.rel = 'stylesheet';\r\n\tlink.type = 'text/css';\r\n\tlink.href = 'options.css'; //name of css file (from server?)\r\n\tlink.media = 'all';\r\n\thead.appendChild(link);\r\n}", "function ac_createStyles() {\n\t$(\"body\").append('<style type=\"text/css\">' + AC_CSS + '</style>');\n}", "insertCss() { }", "function css(){\n return src(paths.scss)\n .pipe(sourcemaps.init())\n .pipe(sass())\n .pipe(postcss([autoprefixer(), cssnano()]))\n .pipe(sourcemaps.write('.'))\n .pipe(dest('./build/css'));\n }", "function addCSS()\n{\n let style = document.createElement('link');\n style.type = 'text/css';\n style.rel = 'stylesheet';\n style.href = \"css/inspektor.css\";\n \n document.getElementsByTagName('head')[0].appendChild(style);\n \n}", "function cssToPublic() {\n return src('src/style.css')\n .pipe(dest('./public/'));\n}", "renderCssStyle() {\n this.cssStyle = [\n // `width: ${parseFloat(this.width) != this.width ? this.width : this.width + 'px'};`\n ].join(' ');\n }", "loadStyle(val) {\n $('<link/>', { rel: 'stylesheet', type: 'text/css', href: val }).appendTo('head')\n }", "function style(cb) {\n src(css.in)\n .pipe(sourcemaps.init())\n .pipe(sass(css.sassOpts))\n .pipe(autoprefixer(css.autoprefixerOpts))\n .pipe(sourcemaps.write('.'))\n .pipe(dest(css.out))\n watch(css.watch, series(style, browsersync.reload))\n cb()\n}", "function loadCss() {\n var cssFileName = fs.path.join(fs.knownFolders.currentApp().path, application.cssFile);\n\n var applicationCss;\n if (FSA.fileExists(cssFileName)) {\n FSA.readText(cssFileName, function (r) { applicationCss = r; });\n //noinspection JSUnusedAssignment\n application.cssSelectorsCache = styleScope.StyleScope.createSelectorsFromCss(applicationCss, cssFileName);\n\n // Add New CSS to Current Page\n var f = frameCommon.topmost();\n if (f && f.currentPage) {\n f.currentPage._resetCssValues();\n f.currentPage._styleScope = new styleScope.StyleScope();\n //noinspection JSUnusedAssignment\n f.currentPage._addCssInternal(applicationCss, cssFileName);\n f.currentPage._refreshCss();\n }\n }\n}", "function compile(str, path) {\n return stylus(str)\n .set('filename', path)\n // Comment the processed CSS when not on production\n .set('linenos', process.env.NODE_ENV !== 'production')\n // Compress the processed CSS\n .set('compress', true);\n}", "function loadCss(href) {\n var link_tag = document.createElement('link');\n link_tag.setAttribute(\"type\", \"text/css\");\n link_tag.setAttribute(\"rel\", \"stylesheet\");\n link_tag.setAttribute(\"href\", href);\n (document.getElementsByTagName(\"head\")[0] || document.documentElement).appendChild(link_tag);\n }", "function style() {\n // 1. where is my scss file\n return gulp.src('./src/Assets/scss/**/*.scss')\n // 2. pass that file through sass compiler\n .pipe(sass())\n .pipe(cleanCSS())\n .pipe(rename({ suffix: '.min'}))\n .pipe(changed('./src/Assets/css'))\n //3 . where do I save the compiled CSS?\n .pipe(gulp.dest('./src/Assets/css'))\n //4. stream changes to all brouser\n}", "function compile(str, path) {\n return stylus(str)\n .set('filename', path)\n .use(nib());\n }", "function compile(str, path) {\r\n return stylus(str)\r\n .set('filename', path)\r\n .use(nib())\r\n}", "function css() {\n return gulp\n .src(\"./src/scss/styles.scss\")\n .pipe(plumber())\n .pipe(sass({ outputStyle: \"expanded\" }))\n .pipe(gulp.dest(\"./docs/css/\"))\n .pipe(browsersync.stream());\n}", "function createIndex(err) {\n if (err) throw err\n fs.readFile(template, 'utf8', function(err, template) {\n if (err) throw err\n fn = jade.compile(template, { pretty: true })\n results.title = (program.title) ? program.title : 'Readme Docs'\n results.github = (program.github) ? program.github : false\n // css addition\n results.css = false\n if (program.css) {\n // copy the file to the build/css folder\n var cssName = path.basename(program.css)\n fs.copy(program.css, path.join(build, 'css', cssName), function(err) {\n if (err) throw err\n // add the css file\n results.css = cssName\n finishFile()\n })\n } else {\n finishFile()\n }\n })\n }", "function get_preview_css_result(res) {\r\n\tvar css = res.responseText;\r\n\tvar status = res.status;\r\nLOG.output(\"HTTP status:\"+status);\r\n\tif ( status != 200 ) {\t// failed\r\n\t\twindow.alert(\"Can't get CSS file (HTTP status=\"+status+\")\");\r\n\t\treturn;\r\n }\r\n Add_Preview_CSS(css);\r\n}", "function add_css() {\n\tvar style = Object(svelte_shared_js__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"style\");\n\tstyle.id = 'svelte-1tosv1m-style';\n\tstyle.textContent = \"li.svelte-1tosv1m{clear:both;margin-bottom:30px}ul.svelte-1tosv1m{margin:0;padding:0;list-style-type:none}h3.svelte-1tosv1m{font-weight:normal;font-size:12px;text-transform:uppercase;letter-spacing:1px;text-align:center;position:relative;margin-top:10px;margin-bottom:20px;margin:10px 0 20px;padding:0 30px}h3.svelte-1tosv1m:before{content:'';position:absolute;border-bottom:1px solid #888;top:-8px;left:40%;right:40%}\";\n\tObject(svelte_shared_js__WEBPACK_IMPORTED_MODULE_0__[\"appendNode\"])(style, document.head);\n}", "function __loadCss($css) {\r\n var node = document.createElement(\"LINK\");\r\n node.rel = \"Stylesheet\";\r\n node.type = \"text/css\";\r\n node.href = _c + \"/css/\" + $css;\r\n document.all.tags(\"HEAD\")[0].appendChild(node);\r\n}", "function loadcss(url) {\r\n if(!$(\"link[href='\"+ url +\"']\").length) {\r\n var link = document.createElement(\"link\");\r\n link.type = \"text/css\";\r\n link.rel = \"stylesheet\";\r\n link.href = url;\r\n $(\"head\")[0].appendChild(link);\r\n }\r\n }", "function compile(str, path) {\n return stylus(str)\n .set('filename', path)\n .use(nib())\n .use(bootstrap())\n }", "function forceAddCss(text) {\n var linkElement = document.createElement('link');\n linkElement.setAttribute('rel', 'stylesheet');\n linkElement.setAttribute('href',\n URL.createObjectURL(new Blob([text], {'type': 'text/css'}))\n );\n document.head.appendChild(linkElement);\n }", "function load_css(document) {\n // taken from https://stackoverflow.com/questions/574944/how-to-load-up-css-files-using-javascript\n var cssId = \"psono-css\"; // you could encode the css path itself to generate id..\n if (!document.getElementById(cssId)) {\n var head = document.getElementsByTagName(\"head\")[0];\n var link = document.createElement(\"link\");\n link.id = cssId;\n link.rel = \"stylesheet\";\n link.type = \"text/css\";\n link.href = browser.runtime.getURL(\"data/css/contentscript.css\");\n link.media = \"all\";\n head.appendChild(link);\n }\n }", "function compile(str, path) {\n return stylus(str)\n .set('filename', path)\n .use(nib())\n}", "function compile(str, path) {\n return stylus(str)\n .set('filename', path)\n .use(nib())\n}", "function css() {\n return src(paths.css.src)\n .pipe(sass()\n .on('error', sass.logError))\n .pipe(purify([paths.js.dist, paths.html.src]))\n .pipe(minifyCSS({\n keepSpecialComments: 0\n }))\n .pipe(rename({ extname: '.min.css' }))\n .pipe(dest(paths.css.dist))\n .pipe(browserSync.stream())\n}", "function compile(str, path) {\n return stylus(str)\n .set('filename', path)\n .set('compress', true)\n .use(nib())\n .import('nib');\n }", "function compileAppCSS() {\n return processCSS(CFG.SRC.APP_CSS, CFG.OUT.APP_MIN_CSS);\n}", "function loadCss(url) {\n var cssId = 'code-mirror-css';\n\n if (!document.getElementById(cssId)){\n var link = document.createElement(\"link\");\n link.type = \"text/css\";\n link.rel = \"stylesheet\";\n link.href = url;\n link.id = cssId;\n document.getElementsByTagName(\"head\")[0].appendChild(link);\n }\n }", "function addCSSFile(name, path) {\n\tif(cssLists[name] == null || cssLists[name] == undefined) {\n\t\tcssLists[name] = path + \"?rnd=\" + Math.random();\n\t\t\n\t\tif($.browser.msie && jQuery.browser.version <= 8){\n\t\t\tdocument.createStyleSheet(cssLists[name]);\n\t\t} else {\n\t\t\tvar css = '<link rel=\"stylesheet\" href=\"' + cssLists[name] + '\" />';\n\t\t\t$(\"head\").append(css);\n\t\t}\n\t}\n}", "function cssComp(cb) {\n return src(\"./src/css/*.css\") // read .css files from ./src/ folder\n .pipe(postCss()) // compile using postcss\n .pipe(gulpIf(buildEnv === 'prod', cleanCss()))\n .pipe(conCat('main.min.css'))\n .pipe(dest(buildDir+\"css/\")) // paste them in ./assets/css folder\n .pipe(browserSync.stream());\n cb();\n}", "function css(cb){\n\n return src('src/scss/*')\n .pipe(sass())\n .pipe(dest('dist/css/'))\n \n cb();\n}", "function cssInject() {\n return src('app/temp/styles/styles.css')\n .pipe(browserSync.stream());\n}", "function add_css() {\n\tvar style = (0, _shared.createElement)(\"style\");\n\tstyle.id = 'svelte-12mbumt-style';\n\tstyle.textContent = \".colab-root.svelte-12mbumt{display:inline-block;background:rgba(255, 255, 255, 0.75);padding:4px 8px;border-radius:4px;font-size:11px!important;text-decoration:none;color:#aaa;border:none;font-weight:300;border:solid 1px rgba(0, 0, 0, 0.08);border-bottom-color:rgba(0, 0, 0, 0.15);text-transform:uppercase;line-height:16px}span.svelte-12mbumt{background-image:url(images/colab.svg);background-repeat:no-repeat;background-size:20px;background-position-y:2px;display:inline-block;padding-left:24px;border-radius:4px;text-decoration:none}a.svelte-12mbumt:hover{color:#666;background:white;border-color:rgba(0, 0, 0, 0.2)}\";\n\t(0, _shared.append)(document.head, style);\n}", "function add_css() {\n\tvar style = Object(__WEBPACK_IMPORTED_MODULE_0_svelte_internal__[\"g\" /* element */])(\"style\");\n\tstyle.id = 'svelte-yx5wa5-style';\n\tstyle.textContent = \".small.svelte-yx5wa5{font:normal 12px sans-serif;background:white;text-align:left\\n }\";\n\tObject(__WEBPACK_IMPORTED_MODULE_0_svelte_internal__[\"b\" /* append */])(document.head, style);\n}", "function loadCss(href) {\n var link_tag = document.createElement('link');\n link_tag.setAttribute(\"type\", \"text/css\");\n link_tag.setAttribute(\"rel\", \"stylesheet\");\n link_tag.setAttribute(\"href\", href);\n (document.getElementsByTagName(\"head\")[0] || document.documentElement).appendChild(link_tag);\n }", "function loadCss(href) {\n var link_tag = document.createElement('link');\n link_tag.setAttribute(\"type\", \"text/css\");\n link_tag.setAttribute(\"rel\", \"stylesheet\");\n link_tag.setAttribute(\"href\", href);\n (document.getElementsByTagName(\"head\")[0] || document.documentElement).appendChild(link_tag);\n }", "function CSSStyleSheetInit() {}", "processStylesheet(response) {\n const stylesheetHref = getWithDefault(response || {}, 'stylesheet', false);\n\n if (stylesheetHref) {\n const linkTag = document.createElement('link');\n const head = document.getElementsByTagName('head')[0];\n\n linkTag.type = 'text/css';\n linkTag.rel = 'stylesheet';\n linkTag.href = response.stylesheet;\n head.appendChild(linkTag);\n }\n }", "function load_css(url, use_cache) {\n\t\treturn load_and_append(url, 'style', 'head', use_cache);\n\t}", "_load(css){\n\t\tif(typeof css === \"undefined\" || (typeof css === \"string\" && css.length === 0)) return;\n\n\t\tif(typeof window._glasscord_customCss === \"undefined\"){\n\t\t\twindow._glasscord_customCss = document.createElement(\"style\");\n\t\t\twindow._glasscord_customCss.id = \"glasscord-custom-css\";\n\t\t\tdocument.head.appendChild(window._glasscord_customCss);\n\t\t}\n\n\t\twindow._glasscord_customCss.innerHTML = css;\n\t\tconsole.log(\"%c[Glasscord] %cCustom stylesheet loaded!\", \"color:#ff00ff;font-weight:bold\", \"color:inherit;font-weight:normal;\");\n\t}", "function style() {\n //1. Where is my scss file\n return (\n gulp\n .src(\"./scss/**/*.scss\")\n\n //2. Pass that file through sass compiler\n .pipe(sass())\n //3.Where do I save my compiled css?\n .pipe(gulp.dest(\"./css\"))\n //4. Stream changes to all browsers\n .pipe(browserSync.stream())\n );\n}", "function compile(str, path) {\n return stylus(str)\n .set('filename', path)\n .set('compress', !options.debug)\n .use(nib())\n .import('nib');\n}", "function css(){\n return src(\"src/scss/styles.scss\")//returna la ubicacion del archivo de sass\n .pipe(sourcemaps.init())//inicia el mapa primero\n .pipe( sass())//compila el css\n .pipe(postcss(dos))//minifica el css y agregar prefijos\n .pipe(sourcemaps.write(\".\"))//escribe nuestro propio \"mapa\"\n .pipe(dest(\"./build/css\"))//ubicacion donde se \"compile\" sass\n //pipe recibe como argumento una funcion o un paquete importado, nosotros le pasamos sass\n }", "function add_css() {\n \tvar style = element(\"style\");\n \tstyle.id = 'svelte-5qo5ik-style';\n \tstyle.textContent = \".codemirror-container.svelte-5qo5ik{position:relative;width:100%;height:100%;border:none;line-height:1.5;overflow:hidden}.codemirror-container.svelte-5qo5ik .CodeMirror{height:100%;background:transparent;font:400 14px/1.7 var(--font-mono);color:var(--base)}.codemirror-container.flex.svelte-5qo5ik .CodeMirror{height:auto}.codemirror-container.flex.svelte-5qo5ik .CodeMirror-lines{padding:0}.codemirror-container.svelte-5qo5ik .CodeMirror-gutters{padding:0 16px 0 8px;border:none}.codemirror-container.svelte-5qo5ik .error-loc{position:relative;border-bottom:2px solid #da106e}.codemirror-container.svelte-5qo5ik .error-line{background-color:rgba(200, 0, 0, .05)}textarea.svelte-5qo5ik{visibility:hidden}pre.svelte-5qo5ik{position:absolute;width:100%;height:100%;top:0;left:0;border:none;padding:4px 4px 4px 60px;resize:none;font-family:var(--font-mono);font-size:13px;line-height:1.7;user-select:none;pointer-events:none;color:#ccc;tab-size:2;-moz-tab-size:2}.flex.svelte-5qo5ik pre.svelte-5qo5ik{padding:0 0 0 4px;height:auto}\";\n \tappend(document.head, style);\n }", "function add_css() {\n\tvar style = Object(__WEBPACK_IMPORTED_MODULE_0_svelte_internal__[\"g\" /* element */])(\"style\");\n\tstyle.id = 'svelte-1elzdbg-style';\n\tstyle.textContent = \".small.svelte-1elzdbg{font:normal 13px sans-serif;background:white;text-align:left;line-height:18px}.grid-container.svelte-1elzdbg{position:absolute;top:65px;display:grid;grid-template-columns:auto auto;padding:10px;width:200px}.grid.svelte-1elzdbg{margin:100px}\";\n\tObject(__WEBPACK_IMPORTED_MODULE_0_svelte_internal__[\"b\" /* append */])(document.head, style);\n}", "function css() {\n return gulp\n .src(path.resolve(base, 'src', 'css', 'index.css'))\n .pipe(cssimport())\n .pipe(gulp.dest(path.resolve(base, 'temp', 'css')));\n}", "function loadCSS(url){\n\t \tvar link = document.createElement(\"link\");\n\t\tlink.setAttribute(\"rel\",\"stylesheet\");\n\t\tlink.setAttribute(\"type\",\"text/css\");\n\t\tlink.setAttribute(\"href\",url);\n if (\"item\" in head) {\n // reassign from live node list ref to pure node ref -- \n // avoids nasty IE bug where changes to DOM invalidate live \n // node lists\n head = head[0]; \n }\n\t\thead.appendChild(link);\n }", "function css() {\n return src(PATHS.src.css.main, {\n sourcemaps: true\n })\n .pipe(postcss([\n postcss_import(),\n postcss_preset_env(),\n postcss_autoprefixer(),\n postcss_cssnano(),\n ]))\n .pipe(dest(PATHS.public.css.folder))\n .pipe(browserSync.stream());\n}", "visitStylesheet(stylesheet) { }", "loadStylesAndResources() {\n if (stylesLoaded) return;\n stylesLoaded = true;\n \n let style = document.createElement('style');\n style.type = 'text/css';\n style.innerHTML = styles;\n document.body.appendChild(style);\n\n for (let url of [fontAwesome + '/css/all.css', heebo + '/css.css']) {\n let link = document.createElement('link');\n link.rel = 'stylesheet';\n link.type = 'text/css';\n link.href = url;\n document.head.appendChild(link);\n }\n }", "function css() {\n return src('./src/sass/main.scss')\n .pipe(changed('./build/css'))\n // Compile SASS files\n .pipe(sass({\n outputStyle: 'nested',\n precision: 10,\n includePaths: ['.'],\n onError: console.error.bind(console, 'Sass error:')\n }))\n // Minify the file\n .pipe(cssClean())\n // Output\n .pipe(dest('./build/css'))\n}", "function add_css$1() {\n \tvar style = element(\"style\");\n \tstyle.id = 'svelte-7fiviz-style';\n \tstyle.textContent = \"\";\n \tappend(document.head, style);\n }" ]
[ "0.71482533", "0.70699674", "0.70213526", "0.7010176", "0.6785818", "0.66566014", "0.6359353", "0.62424195", "0.6239406", "0.6219371", "0.62172544", "0.6203648", "0.6195959", "0.61401886", "0.61144817", "0.6096984", "0.6062708", "0.60361624", "0.6034927", "0.6033276", "0.6029682", "0.60242665", "0.60119176", "0.5967305", "0.595987", "0.5956515", "0.59553325", "0.59525895", "0.59525895", "0.59525895", "0.59525895", "0.5952522", "0.59150875", "0.5911757", "0.59007525", "0.58978236", "0.5892882", "0.5889805", "0.5871216", "0.58667445", "0.58654004", "0.58486724", "0.5842166", "0.58345765", "0.5817951", "0.58153677", "0.57957834", "0.5795178", "0.57783604", "0.5770256", "0.57432413", "0.5742149", "0.57308924", "0.5729035", "0.5725359", "0.5720801", "0.5713973", "0.57136196", "0.571264", "0.57036984", "0.5702617", "0.56858337", "0.5684747", "0.5681028", "0.5680065", "0.56688166", "0.5662856", "0.5661692", "0.5656678", "0.56561446", "0.5651558", "0.5651558", "0.56454265", "0.5642045", "0.5634591", "0.56283283", "0.56198627", "0.5619164", "0.5608629", "0.5608108", "0.56071544", "0.5606768", "0.56060404", "0.56060404", "0.5606015", "0.55949", "0.55827326", "0.55716836", "0.55670303", "0.5562471", "0.5556353", "0.5544381", "0.5543277", "0.55405235", "0.5538548", "0.5537684", "0.5533673", "0.5531309", "0.5530724", "0.5526288" ]
0.617109
13
Snap Elements: this._rect, this._nrTxt, this._btns.topright, this._btns.top, this._btns.bottomright, this._btns.bottom Foreign Elements: this._txt, this._check, (only as blocktype.definition: this._name, this._alt )
draw(editable, group){ this._editable = editable; this._g = group; this._height = 0; let cornerRadius = this._roundedCornerRadius; // draw rect this._rect = this._s.rect( 0, 0, this._width, this._height, cornerRadius ); group.add(this._rect); // draw nr if(editable) { this._nrTxt = this._s.text(20, 20, this._nr); group.add(this._nrTxt); } if(this._type == blocktype.definition) this._height = this.drawDefElements(group, editable); // draw text let cleantext = (!editable) ? this.textWithoutBrInMath() : this._text; this._txt = this.createForeignText(cleantext, editable); this._height += parseInt(this._txt.getAttribute("height"))+45; group.node.appendChild(this._txt); // foreignObject // draw checkbox for conclusion if(editable && this._type != blocktype.premise && this._type != blocktype.definition) { this._check = this.createConclCheckbox(); group.node.appendChild(this._check); // foreignObject } // adjust rect height this._rect.attr({ fill: "#4e5d6c", stroke: "#000", height : this._height, }); if(this._type == blocktype.proof) this._rect.addClass("rect-proof"); // manage style e.g. stroke-width, hover // draw buttons if(editable && this._type != blocktype.definition) { if(this._type != blocktype.premise) { // premise has no top or topright button this._btns.topright = this.createAddButton(buttonpos.topright); this._btns.top = this.createAddButton(buttonpos.top); group.add(this._btns.topright, this._btns.top); } this._btns.bottomright = this.createAddButton(buttonpos.bottomright); this._btns.bottom = this.createAddButton(buttonpos.bottom); group.add(this._btns.bottomright, this._btns.bottom); } // trigger positioning of blocks objects this.x = 0; this.y = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateBlocks() {\n \n //Hide all \"ofBookmark\" blocks first\n let shapesInCanvas = canvas.getObjects();\n for (let i = 0; i < shapesInCanvas.length; i++) {\n if (shapesInCanvas[i].type == \"ofBookmark\") {\n shapesInCanvas[i].visible = false;\n }\n }\n \n //Show the only one of \"ofBookmark\" if the selected block is bookmark\n if (currentBlock.type == \"bookmark\") {\n if (currentBlock.bookmark !== undefined) {\n currentBlock.bookmark.visible = true;\n }\n }\n}", "mouseClick(button) {\r\n //check if mouse pointer is locked\r\n if (BOX.Engine.noa.container.hasPointerLock) {\r\n if (this.parent && this.parent.isDeveloper) {\r\n let devComponent = this.parent.components['DeveloperMode']; //need to fix this !!!\r\n if (devComponent && devComponent.status) {\r\n switch (button) {\r\n case 0:\r\n // add block\r\n if (BOX.Engine.noa.targetedBlock) {\r\n devComponent.addBlock();\r\n }\r\n break;\r\n case 2:\r\n // remove block\r\n if (BOX.Engine.noa.targetedBlock) {\r\n devComponent.removeBlock();\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }", "function Interface(width, height, blockSize, addSelection, drawEditor,\n viewOnly) {\n let self = this;\n this.handleMousemove = function(e) {\n self.mouse.updatePos(e);\n self.selection.y = self.yToMin(self.mouse.y);\n self.update();\n }\n this.handleMousedown = function(e) {\n self.mouse.updatePos(e);\n self.selection.y = self.yToMin(self.mouse.y);\n self.selection.selectiondown();\n self.update();\n }\n this.handleMouseup = function(e) {\n self.mouse.updatePos(e);\n self.selection.y = self.yToMin(self.mouse.y);\n self.selection.selectionup();\n self.update();\n }\n this.handleMouseout = function(e) {\n self.mouse.mouseout();\n self.selection.selectionout();\n self.update();\n }\n //draws and also updates the childs if the state of interface changes\n //(i.e. width, height, blockSize)\n this.update = function() {\n if(self.selection.isDone) {\n //callback\n addSelection(self.selection.minY(), self.selection.maxY());\n self.selection.isDone = false;\n }\n drawEditor();\n }\n this.hourToY = function(h) {\n return Math.floor(h/24*self.canvas.height);\n }\n this.minToY = function(m) {\n return Math.floor(m/60/24*self.canvas.height);\n }\n //rounds everything to closest block\n this.yToMin = function(y) {\n let mins = y*24*60/this.canvas.height;\n return Math.round(mins/self.blockSize)*self.blockSize\n }\n //rounds everything to closest block\n this.yToTime = function(y) {\n let roundMins = self.yToMin(y);\n let hours = Math.floor(roundMins/60)\n let result = new Time24(hours, roundMins%60);\n return result;\n }\n this.snapToBlocks = function(y) {\n let time = self.yToTime(y);\n return self.hourToY(time.hour) + self.minToY(time.min);\n }\n this.drawIntervals = function(intervals, colors) {\n for(let i = 0; i < intervals.length; i++) {\n let grade = parseInt(intervals[i][2]);\n self.ctx.fillStyle = colors.get(grade);\n let yBegin = self.minToY(intervals[i][0]);\n let yEnd = self.minToY(intervals[i][1]);\n self.ctx.fillRect(0, yBegin, self.canvas.width, yEnd-yBegin);\n }\n }\n //start and end are minutes!\n this.drawActiveSelection = function(start, end, grade, colors) {\n startY = self.minToY(start);\n endY = self.minToY(end);\n\n startY = self.snapToBlocks(startY);\n endY = self.snapToBlocks(endY);\n color = colors.get(grade);\n self.ctx.save();\n self.ctx.fillStyle = color;\n self.ctx.globalAlpha = 0.9;\n self.ctx.fillRect(0, startY, this.canvas.width, endY-startY);\n self.ctx.restore();\n self.drawDotRect(30, startY, this.canvas.width-30, endY-startY, 4, 8);\n self.drawBoldLine(startY);\n self.drawBoldLine(endY);\n }\n this.drawDotRect = function(x, y, width, height, dotSize, dotNumber) {\n for(let i = 0; i <= dotNumber; i += 1) {\n for(let j = 1; j < dotNumber; j += 1) {\n if((i+j)%2 == 0) {\n self.ctx.fillStyle = 'black';\n }\n else {\n self.ctx.fillStyle = 'whitesmoke';\n }\n let currX = parseInt(x+(j/dotNumber)*width-dotSize/2)\n let currY = parseInt(y+(i/dotNumber)*height-dotSize/2)\n self.ctx.fillRect(currX, currY, dotSize, dotSize);\n }\n }\n }\n this.drawMouse = function() {\n if(!self.mouse.isActive) {\n return;\n }\n let x = self.mouse.x;\n let y = self.mouse.y;\n //draw snap time line as bold\n self.drawBoldLine(y);\n //draw background box for the time\n self.ctx.fillStyle = 'rgb(245, 245, 245, 0.8)';\n self.ctx.fillRect(x, y-30, 90, 35)\n //draw current time\n let time = self.yToTime(y);\n let hourStr = ('0' + time.hour).slice(-2);\n let minStr = ('0' + time.min).slice(-2);\n let timeStr = hourStr + ':' + minStr;\n self.ctx.textBaseline = 'alphabetic';\n self.ctx.font = '30px Courier New';\n self.ctx.fillStyle = 'rgb(0, 0, 0)';\n self.ctx.fillText(timeStr, x, y);\n }\n this.drawBoldLine = function(y) {\n self.ctx.beginPath();\n self.ctx.strokeStyle = 'black';\n self.ctx.lineWidth=4;\n self.ctx.moveTo(0, self.snapToBlocks(y));\n self.ctx.lineTo(self.canvas.width, self.snapToBlocks(y));\n self.ctx.stroke();\n }\n this.drawTimeGrid = function() {\n //minor grid\n for(let i = 0; i < 24; i++) {\n self.ctx.beginPath();\n self.ctx.strokeStyle = 'rgb(0, 0, 0, 0.5)';\n self.ctx.lineWidth = 1;\n for(let j = 1; j < 4; j++) {\n //+0.5 is to make the anti-aliasing look better\n let y = self.hourToY(i) + self.minToY(j*15)+0.5\n self.ctx.moveTo(0, y);\n self.ctx.lineTo(self.canvas.width, y)\n }\n self.ctx.stroke()\n }\n //clear left side of the canvas for the labels\n self.ctx.fillStyle = 'whitesmoke';\n self.ctx.fillRect(0, 0, 40, self.canvas.height);\n //major grid\n for(let i = 0; i < 24; i++) {\n self.ctx.beginPath();\n self.ctx.strokeStyle = 'black';\n self.ctx.lineWidth = 2;\n self.ctx.moveTo(0, self.hourToY(i));\n self.ctx.lineTo(self.canvas.width, self.hourToY(i));\n self.ctx.stroke()\n }\n //major grid labels\n for(let i = 0; i < 24; i++) {\n self.ctx.fillStyle = 'black';\n self.ctx.textBaseline = 'top';\n self.ctx.font = '30px Courier New';\n hourStr = ('0' + i.toString()).slice(-2);\n self.ctx.fillText(hourStr, 0, self.hourToY(i))\n }\n }\n this.draw = function(oldGrades, newGrades, selectedGrade) {\n self.drawIntervals(oldGrades, self.gradeColors);\n if(viewOnly == 0) {\n self.drawIntervals(newGrades, self.gradeColors);\n\n if(self.selection.isActive) {\n self.drawActiveSelection(self.selection.minY(),\n self.selection.maxY(),\n selectedGrade,\n self.activeColors);\n }\n }\n self.drawTimeGrid();\n self.drawMouse();\n }\n this.reset = function() {\n self.mouse.reset();\n self.selection.reset();\n }\n\n //TODO just arrays\n self.gradeColors = new Map();\n self.gradeColors.set(2, 'rgb(60, 60, 60');\n self.gradeColors.set(1, 'silver');\n self.gradeColors.set(0, 'whitesmoke');\n self.activeColors = new Map();\n self.activeColors.set(2, 'rgb(60, 60, 60)');\n self.activeColors.set(1, 'silver');\n self.activeColors.set(0, 'whitesmoke');\n\n self.canvas = document.createElement('canvas');\n self.ctx = self.canvas.getContext('2d');\n self.canvas.width = width;\n self.canvas.height = height;\n\n self.selection = new Selection();\n self.mouse = new Mouse();\n\n self.canvas.addEventListener('mousemove', self.handleMousemove);\n self.canvas.addEventListener('mousedown', self.handleMousedown);\n self.canvas.addEventListener('mouseup', self.handleMouseup);\n self.canvas.addEventListener('mouseout', self.handleMouseout);\n\n self.blockSize = blockSize;\n}", "hort(x, y) {\n //visual blocks\n this.blck = this.add.sprite(x - 65,y - 32,'blck');\n this.blck = this.add.sprite(x - 32,y - 32,'blck');\n this.blck2 = this.add.sprite(x,y - 32,'blck');\n }", "enableBlocks() {\n\t\t// Get a reference to this fretboard's pattern area\n\t\tvar patterns = document.querySelector(this.bodyID + ' .patterns');\n\t\t/**\n\t\t * Loop through all of the block buttons associated with this board.\n\t\t * Add each block's image to this freboards' patterns area and add a \n\t\t * click listener that allows each block button to active its' \n\t\t * associated image.\n\t\t */\n\t\tfor(var i = 0; i < this.blocks.length; i++) {\n\t\t\t// Add each image to the fretboard patterns\n\t\t\tvar scalePattern = document.createElement('img');\n\t\t\tscalePattern.src = this.blocks[i];\n\t\t\tpatterns.appendChild(scalePattern);\n\t\t\tscalePattern.style.display = 'none';\n\n\t\t\t// Create a button and add to the controls area\n\t\t\tvar btn = document.createElement('button');\n\t\t\tbtn.id = 'block' + (i + 1);\n\t\t\tbtn.setAttribute('class', 'btn block');\n\t\t\tbtn.innerHTML = 'block ' + (i + 1);\n\t\t\tvar controls = document.querySelector(this.bodyID + ' .controls');\n\t\t\tcontrols.appendChild(btn);\n\n\t\t\t// Add click listener to set image per block clicked\n\t\t\tvar blockBtn = document.querySelector(this.blocks[i].bodyID);\n\t\t\tvar _this = this;\n\t\t\tbtn.addEventListener('click', function(e) {\n\t\t\t\t_this.activateBlock(_this, e);\n\t\t\t}, false);\n\t\t}\n\t}", "function overridenBlockTemplates(category) {\n var myself = this,\n blocks = [],\n varNames,\n button;\n\n var myself = this;\n\n if (!this.arduino) {\n this.arduino = {\n board : undefined, // Reference to arduino board - to be created by new firmata.Board()\n connecting : false, // Mark to avoid multiple attempts to connect\n justconnected: false, // Mark to avoid double attempts\n };\n }\n\n //var variableWatcherToggle = SpriteMorph.prototype.originalBlockTemplates_Makers.variableWatcherToggle;\n\n function variableBlock(varName) {\n var newBlock = SpriteMorph.prototype.variableBlock(varName);\n newBlock.isDraggable = false;\n newBlock.isTemplate = true;\n return newBlock;\n }\n \n function watcherToggle(selector) {\n if (StageMorph.prototype.hiddenPrimitives[selector]) {\n return null;\n }\n var info = SpriteMorph.prototype.blocks[selector];\n return new ToggleMorph(\n 'checkbox',\n this,\n function () {\n myself.toggleWatcher(\n selector,\n localize(info.spec),\n myself.blockColor[info.category]\n );\n },\n null,\n function () {\n return myself.showingWatcher(selector);\n },\n null\n );\n }\n\n function variableWatcherToggle(varName) {\n return new ToggleMorph(\n 'checkbox',\n this,\n function () {\n myself.toggleVariableWatcher(varName);\n },\n null,\n function () {\n return myself.showingVariableWatcher(varName);\n },\n null\n );\n }\n\n function helpMenu() {\n var menu = new MenuMorph(this);\n menu.addItem('help...', 'showHelp');\n return menu;\n }\n\n // Button definitions\n // Buttons are push buttons displayed in the block group area\n // which can trigger actions but are not used as programming blocks\n \n\n /**\n * Button that triggers a connection attempt \n */\n var arduinoConnectButton = new PushButtonMorph(\n null,\n function () {\n myself.arduino.attemptConnection();\n },\n 'Connect Arduino'\n );\n\n /**\n * Button that triggers a disconnection from board\n */\n var arduinoDisconnectButton = new PushButtonMorph(\n null,\n function () {\n myself.arduino.disconnect();;\n },\n 'Disconnect Arduino'\n );\n\n\n\n /**\n * Authorize twitter account (requests a PIN through a browser window)\n */\n var tweetButton = new PushButtonMorph(\n null,\n function () {\n world.makers.twitter.requestPin(function(err, results) {\n if (!err) {\n new world.makers.twitter.TwitterDialogMorph(\n null,\n // Function executed after pin is given by the user\n function(pin) {\n world.makers.twitter.processPin(pin, function(err, res) {\n if (!err) {\n var msg = localize('Successful authorization for Twitter account')+' \"'+res.screen_name+'\".\\n\\n';\n msg += localize('You may now send tweets (on behalf of')+' \"'+res.screen_name+'\").'\n inform('Twitter', msg);\n } else {\n inform('Twitter',\"Authorization failed\");\n }\n })\n }\n ).prompt(\n \"Twitter PIN\",\n localize('PIN number you get from browser page') ,\n myself.world()\n ); \n } else {\n inform('Twitter', \"Could not connect to Twitter API, check Internet connectivity\");\n }\n })\n\n },\n \"Authorize Twitter Account\"\n );\n\n\n // *this* will either be StageMorph or SpriteMorph\n //var blocks = this.originalBlockTemplates_Makers(category); \n\n function blockBySelector(selector) {\n var newBlock = SpriteMorph.prototype.blockForSelector(selector, true);\n newBlock.isTemplate = true;\n return newBlock;\n }\n\n function block(selector) {\n if (StageMorph.prototype.hiddenPrimitives[selector]) {\n return null;\n }\n var newBlock = SpriteMorph.prototype.blockForSelector(selector, true);\n newBlock.isTemplate = true;\n return newBlock;\n }\n\n\n SpriteMorph.prototype.makersTemperature = function () {\n var sprite = this;\n\n var board = sprite.arduino.board;\n if (sprite.makersIsBoardConnected()) {\n var val;\n var pin = 0;\n\n if (board.pins[board.analogPins[pin]].mode != board.MODES.ANALOG) {\n board.pinMode(board.analogPins[pin],board.MODES.ANALOG);\n }\n val = board.pins[board.analogPins[pin]].value;\n return world.makers.convertAnalogMeasure.temperatureLW35(val);\n } else {\n return null;\n }\n };\n\n SpriteMorph.prototype.makersLight = function () {\n var sprite = this;\n\n var board = sprite.arduino.board;\n if (sprite.makersIsBoardConnected()) {\n\n var val;\n var pin = 1;\n\n if (board.pins[board.analogPins[pin]].mode != board.MODES.ANALOG) {\n board.pinMode(board.analogPins[pin],board.MODES.ANALOG);\n }\n val = board.pins[board.analogPins[pin]].value;\n return world.makers.convertAnalogMeasure.light(val);\n } else {\n return null;\n }\n\n };\n\n SpriteMorph.prototype.makersAudio = function () {\n var sprite = this;\n\n var board = sprite.arduino.board;\n if (sprite.makersIsBoardConnected()) {\n\n var val;\n var pin = 2;\n\n if (board.pins[board.analogPins[pin]].mode != board.MODES.ANALOG) {\n board.pinMode(board.analogPins[pin],board.MODES.ANALOG);\n }\n val = board.pins[board.analogPins[pin]].value;\n return world.makers.convertAnalogMeasure.audio(val);\n } else {\n return null;\n }\n\n };\n\n SpriteMorph.prototype.makersHumidity = function () {\n var sprite = this;\n\n var board = sprite.arduino.board;\n if (sprite.makersIsBoardConnected()) {\n\n var val;\n var pin = 3;\n\n if (board.pins[board.analogPins[pin]].mode != board.MODES.ANALOG) {\n board.pinMode(board.analogPins[pin],board.MODES.ANALOG);\n }\n val = board.pins[board.analogPins[pin]].value;\n return world.makers.convertAnalogMeasure.humidity(val);\n } else {\n return null;\n }\n\n };\n\n SpriteMorph.prototype.makersInfrared = function () {\n var sprite = this;\n\n var board = sprite.arduino.board;\n if (sprite.makersIsBoardConnected()) {\n\n var val;\n var pin = 4;\n\n if (board.pins[board.analogPins[pin]].mode != board.MODES.ANALOG) {\n board.pinMode(board.analogPins[pin],board.MODES.ANALOG);\n }\n val = board.pins[board.analogPins[pin]].value;\n return world.makers.convertAnalogMeasure.infrared(val);\n } else {\n return null;\n }\n\n };\n\n SpriteMorph.prototype.makersPotentiometer = function () {\n var sprite = this;\n\n var board = sprite.arduino.board;\n if (sprite.makersIsBoardConnected()) {\n\n var val;\n var pin = 5;\n\n if (board.pins[board.analogPins[pin]].mode != board.MODES.ANALOG) {\n board.pinMode(board.analogPins[pin],board.MODES.ANALOG);\n }\n val = board.pins[board.analogPins[pin]].value;\n return world.makers.convertAnalogMeasure.potentiometer(val);\n } else {\n return null;\n }\n\n };\n\n SpriteMorph.prototype.makersSwitch = function () {\n var sprite = this;\n\n var board = sprite.arduino.board;\n if (sprite.makersIsBoardConnected()) {\n\n var val;\n var digitalPin = 2;\n\n val = board.pins[digitalPin].value;\n return val === 1;\n } else {\n return null;\n }\n\n };\n\n\n if (category === 'motion') {\n if (world.isMakersBasicMode) {\n blocks.push(block('forward'));\n blocks.push(block('turn'));\n blocks.push(block('turnLeft'));\n blocks.push('-');\n blocks.push(block('setHeading'));\n blocks.push('-');\n blocks.push(block('changeXPosition'));\n blocks.push(block('setXPosition'));\n blocks.push(block('changeYPosition'));\n blocks.push(block('setYPosition'));\n } else {\n blocks.push(block('forward'));\n blocks.push(block('turn'));\n blocks.push(block('turnLeft'));\n blocks.push('-');\n blocks.push(block('setHeading'));\n blocks.push(block('doFaceTowards'));\n blocks.push('-');\n blocks.push(block('gotoXY'));\n blocks.push(block('doGotoObject'));\n blocks.push(block('doGlide'));\n blocks.push('-');\n blocks.push(block('changeXPosition'));\n blocks.push(block('setXPosition'));\n blocks.push(block('changeYPosition'));\n blocks.push(block('setYPosition'));\n blocks.push('-');\n blocks.push(block('bounceOffEdge'));\n blocks.push('-');\n blocks.push(watcherToggle('xPosition'));\n blocks.push(block('xPosition'));\n blocks.push(watcherToggle('yPosition'));\n blocks.push(block('yPosition'));\n blocks.push(watcherToggle('direction'));\n blocks.push(block('direction'));\n }\n\n } else if (category === 'looks') {\n if (world.isMakersBasicMode) {\n blocks.push(block('doSwitchToCostume'));\n blocks.push('-');\n blocks.push(block('setScale')); \n blocks.push(watcherToggle('getScale'));\n blocks.push(block('getScale'));\n blocks.push('-');\n blocks.push(block('bubble'));\n blocks.push('-');\n blocks.push(block('show'));\n blocks.push(block('hide'));\n\n } else {\n blocks.push(block('doSwitchToCostume'));\n blocks.push(block('doWearNextCostume'));\n blocks.push(watcherToggle('getCostumeIdx'));\n blocks.push(block('getCostumeIdx'));\n blocks.push('-');\n blocks.push(block('doSayFor'));\n blocks.push(block('bubble'));\n blocks.push(block('doThinkFor'));\n blocks.push(block('doThink'));\n blocks.push('-');\n blocks.push(block('changeEffect'));\n blocks.push(block('setEffect'));\n blocks.push(block('clearEffects'));\n blocks.push(block('changeScale'));\n blocks.push(block('setScale')); \n blocks.push(watcherToggle('getScale'));\n blocks.push(block('getScale'));\n blocks.push('-');\n blocks.push(block('show'));\n blocks.push(block('hide'));\n blocks.push('-');\n blocks.push(block('comeToFront'));\n blocks.push(block('goBack'));\n }\n\n // for debugging: ///////////////\n\n if (this.world().isDevMode) {\n blocks.push('-');\n txt = new TextMorph(localize(\n 'development mode \\ndebugging primitives:'\n ));\n txt.fontSize = 9;\n txt.setColor(this.paletteTextColor);\n blocks.push(txt);\n blocks.push('-');\n blocks.push(block('reportCostumes'));\n blocks.push('-');\n blocks.push(block('log'));\n blocks.push(block('alert'));\n blocks.push('-');\n blocks.push(block('doScreenshot'));\n }\n\n /////////////////////////////////\n\n } else if (category === 'sound') {\n if (world.isMakersBasicMode) {\n blocks.push(block('playSound'));\n blocks.push(block('doStopAllSounds'));\n blocks.push('-');\n blocks.push(block('doPlayNote'));\n } else {\n blocks.push(block('playSound'));\n blocks.push(block('doPlaySoundUntilDone'));\n blocks.push(block('doStopAllSounds'));\n blocks.push('-');\n blocks.push(block('doRest'));\n blocks.push('-');\n blocks.push(block('doPlayNote'));\n blocks.push('-');\n blocks.push(block('doChangeTempo'));\n blocks.push(block('doSetTempo'));\n blocks.push(watcherToggle('getTempo'));\n blocks.push(block('getTempo'));\n }\n \n\n\n // for debugging: ///////////////\n\n if (this.world().isDevMode) {\n blocks.push('-');\n txt = new TextMorph(localize(\n 'development mode \\ndebugging primitives:'\n ));\n txt.fontSize = 9;\n txt.setColor(this.paletteTextColor);\n blocks.push(txt);\n blocks.push('-');\n blocks.push(block('reportSounds'));\n }\n\n } else if (category === 'pen') {\n if (world.isMakersBasicMode) {\n blocks.push(block('clear'));\n blocks.push('-');\n blocks.push(block('down'));\n blocks.push(block('up'));\n blocks.push('-');\n blocks.push(block('setColor'));\n blocks.push('-');\n blocks.push(block('setSize'));\n } else {\n blocks.push(block('clear'));\n blocks.push('-');\n blocks.push(block('down'));\n blocks.push(block('up'));\n blocks.push('-');\n blocks.push(block('setColor'));\n blocks.push(block('changeHue'));\n blocks.push(block('setHue'));\n blocks.push('-');\n blocks.push(block('changeBrightness'));\n blocks.push(block('setBrightness'));\n blocks.push('-');\n blocks.push(block('changeSize'));\n blocks.push(block('setSize'));\n blocks.push('-');\n blocks.push(block('doStamp'));\n }\n\n\n\n } else if (category === 'control') {\n if (world.isMakersBasicMode) {\n blocks.push(block('receiveGo'));\n blocks.push(block('receiveKey'));\n blocks.push(block('receiveClick'));\n blocks.push(block('receiveMessage'));\n blocks.push('-');\n blocks.push(block('doBroadcast')); \n blocks.push(block('doWait'));\n blocks.push('-'); \n blocks.push(block('doForever'));\n blocks.push(block('doUntil'));\n blocks.push('-');\n blocks.push(block('doIf'));\n blocks.push(block('doIfElse'));\n } else {\n blocks.push(block('receiveGo'));\n blocks.push(block('receiveKey'));\n blocks.push(block('receiveClick'));\n blocks.push(block('receiveMessage'));\n blocks.push('-');\n blocks.push(block('doBroadcast'));\n blocks.push(block('doBroadcastAndWait'));\n blocks.push(watcherToggle('getLastMessage'));\n blocks.push(block('getLastMessage'));\n \n blocks.push('-');\n blocks.push(block('doWarp'));\n blocks.push('-');\n blocks.push(block('doWait'));\n blocks.push(block('doWaitUntil'));\n blocks.push('-');\n \n blocks.push(block('doForever'));\n blocks.push(block('doRepeat'));\n blocks.push(block('doUntil'));\n blocks.push('-');\n blocks.push(block('doIf'));\n blocks.push(block('doIfElse'));\n blocks.push('-');\n blocks.push(block('doReport'));\n blocks.push('-');\n blocks.push(block('doStopThis'));\n blocks.push(block('doStopOthers'));\n blocks.push('-');\n blocks.push(block('doRun'));\n blocks.push(block('fork'));\n blocks.push(block('evaluate'));\n blocks.push('-');\n blocks.push(block('doCallCC'));\n blocks.push(block('reportCallCC'));\n blocks.push('-');\n blocks.push(block('receiveOnClone'));\n blocks.push(block('createClone'));\n blocks.push(block('removeClone'));\n blocks.push('-');\n blocks.push(block('doPauseAll'));\n }\n\n } else if (category === 'utilities') {\n if (world.isMakersBasicMode) {\n blocks.push(watcherToggle('reportMouseX'));\n blocks.push(block('reportMouseX'));\n blocks.push(watcherToggle('reportMouseY'));\n blocks.push(block('reportMouseY'));\n blocks.push(block('reportMouseDown'));\n blocks.push('-');\n blocks.push(block('reportKeyPressed'));\n blocks.push('-');\n blocks.push(block('reportDate'));\n } else {\n blocks.push(block('reportTouchingObject'));\n blocks.push(block('reportTouchingColor'));\n blocks.push(block('reportColorIsTouchingColor'));\n blocks.push('-');\n blocks.push(block('doAsk'));\n blocks.push(watcherToggle('getLastAnswer'));\n blocks.push(block('getLastAnswer'));\n blocks.push('-');\n blocks.push(watcherToggle('reportMouseX'));\n blocks.push(block('reportMouseX'));\n blocks.push(watcherToggle('reportMouseY'));\n blocks.push(block('reportMouseY'));\n blocks.push(block('reportMouseDown'));\n blocks.push('-');\n blocks.push(block('reportKeyPressed'));\n blocks.push('-');\n blocks.push(block('reportDistanceTo'));\n blocks.push('-');\n blocks.push(block('doResetTimer'));\n blocks.push(watcherToggle('getTimer'));\n blocks.push(block('getTimer'));\n blocks.push('-');\n blocks.push(block('reportAttributeOf'));\n blocks.push('-');\n blocks.push(block('reportURL'));\n blocks.push('-');\n blocks.push(block('reportIsFastTracking'));\n blocks.push(block('doSetFastTracking'));\n blocks.push('-');\n blocks.push(block('reportDate'));\n }\n\n\n \n\n // for debugging: ///////////////\n\n if (this.world().isDevMode) {\n\n blocks.push('-');\n txt = new TextMorph(localize(\n 'development mode \\ndebugging primitives:'\n ));\n txt.fontSize = 9;\n txt.setColor(this.paletteTextColor);\n blocks.push(txt);\n blocks.push('-');\n blocks.push(block('colorFiltered'));\n blocks.push(block('reportStackSize'));\n blocks.push(block('reportFrameCount'));\n }\n\n } else if (category === 'operators') {\n if (world.isMakersBasicMode) {\n blocks.push(block('reportSum'));\n blocks.push(block('reportDifference'));\n blocks.push(block('reportProduct'));\n blocks.push(block('reportQuotient'));\n blocks.push('-');\n blocks.push(block('reportModulus'));\n blocks.push(block('reportRound'));\n blocks.push(block('reportMonadic'));\n blocks.push(block('reportRandom'));\n blocks.push('-');\n blocks.push(block('reportLessThan'));\n blocks.push(block('reportEquals'));\n blocks.push(block('reportGreaterThan'));\n blocks.push('-');\n blocks.push(block('reportAnd'));\n blocks.push(block('reportOr'));\n blocks.push(block('reportNot'));\n blocks.push('-');\n blocks.push(block('reportTrue'));\n blocks.push(block('reportFalse'));\n blocks.push('-');\n blocks.push(block('reportJoinWords'));\n } else {\n blocks.push(block('reifyScript'));\n blocks.push(block('reifyReporter'));\n blocks.push(block('reifyPredicate'));\n blocks.push('#');\n blocks.push('-');\n blocks.push(block('reportSum'));\n blocks.push(block('reportDifference'));\n blocks.push(block('reportProduct'));\n blocks.push(block('reportQuotient'));\n blocks.push('-');\n blocks.push(block('reportModulus'));\n blocks.push(block('reportRound'));\n blocks.push(block('reportMonadic'));\n blocks.push(block('reportRandom'));\n blocks.push('-');\n blocks.push(block('reportLessThan'));\n blocks.push(block('reportEquals'));\n blocks.push(block('reportGreaterThan'));\n blocks.push('-');\n blocks.push(block('reportAnd'));\n blocks.push(block('reportOr'));\n blocks.push(block('reportNot'));\n blocks.push('-');\n blocks.push(block('reportTrue'));\n blocks.push(block('reportFalse'));\n blocks.push('-');\n blocks.push(block('reportJoinWords'));\n blocks.push(block('reportTextSplit'));\n blocks.push(block('reportLetter'));\n blocks.push(block('reportStringSize'));\n blocks.push('-');\n blocks.push(block('reportUnicode'));\n blocks.push(block('reportUnicodeAsLetter'));\n blocks.push('-');\n blocks.push(block('reportIsA'));\n blocks.push(block('reportIsIdentical'));\n blocks.push('-');\n blocks.push(block('reportJSFunction'));\n }\n\n\n\n\n // for debugging: ///////////////\n\n if (this.world().isDevMode) {\n blocks.push('-');\n txt = new TextMorph(\n 'development mode \\ndebugging primitives:'\n );\n txt.fontSize = 9;\n txt.setColor(this.paletteTextColor);\n blocks.push(txt);\n blocks.push('-');\n blocks.push(block('reportTypeOf'));\n blocks.push(block('reportTextFunction'));\n }\n\n /////////////////////////////////\n\n } else if (category === 'variables') {\n\n if (world.isMakersBasicMode) {\n button = new PushButtonMorph(\n null,\n function () {\n new VariableDialogMorph(\n null,\n function (pair) {\n if (pair && !myself.variables.silentFind(pair[0])) {\n myself.addVariable(pair[0], pair[1]);\n myself.toggleVariableWatcher(pair[0], pair[1]);\n myself.blocksCache[category] = null;\n myself.paletteCache[category] = null;\n myself.parentThatIsA(IDE_Morph).refreshPalette();\n }\n },\n myself\n ).prompt(\n 'Variable name',\n null,\n myself.world()\n );\n },\n 'Make a variable'\n );\n button.userMenu = helpMenu;\n button.selector = 'addVariable';\n button.showHelp = BlockMorph.prototype.showHelp;\n blocks.push(button);\n\n if (this.variables.allNames().length > 0) {\n button = new PushButtonMorph(\n null,\n function () {\n var menu = new MenuMorph(\n myself.deleteVariable,\n null,\n myself\n );\n myself.variables.allNames().forEach(function (name) {\n menu.addItem(name, name);\n });\n menu.popUpAtHand(myself.world());\n },\n 'Delete a variable'\n );\n button.userMenu = helpMenu;\n button.selector = 'deleteVariable';\n button.showHelp = BlockMorph.prototype.showHelp;\n blocks.push(button);\n }\n\n blocks.push('-');\n\n varNames = this.variables.allNames();\n if (varNames.length > 0) {\n varNames.forEach(function (name) {\n blocks.push(variableWatcherToggle(name));\n blocks.push(variableBlock(name));\n });\n blocks.push('-');\n }\n\n blocks.push(block('doSetVar'));\n blocks.push(block('doChangeVar'));\n blocks.push(block('doShowVar'));\n blocks.push(block('doHideVar'));\n } else {\n button = new PushButtonMorph(\n null,\n function () {\n new VariableDialogMorph(\n null,\n function (pair) {\n if (pair && !myself.variables.silentFind(pair[0])) {\n myself.addVariable(pair[0], pair[1]);\n myself.toggleVariableWatcher(pair[0], pair[1]);\n myself.blocksCache[category] = null;\n myself.paletteCache[category] = null;\n myself.parentThatIsA(IDE_Morph).refreshPalette();\n }\n },\n myself\n ).prompt(\n 'Variable name',\n null,\n myself.world()\n );\n },\n 'Make a variable'\n );\n button.userMenu = helpMenu;\n button.selector = 'addVariable';\n button.showHelp = BlockMorph.prototype.showHelp;\n blocks.push(button);\n\n if (this.variables.allNames().length > 0) {\n button = new PushButtonMorph(\n null,\n function () {\n var menu = new MenuMorph(\n myself.deleteVariable,\n null,\n myself\n );\n myself.variables.allNames().forEach(function (name) {\n menu.addItem(name, name);\n });\n menu.popUpAtHand(myself.world());\n },\n 'Delete a variable'\n );\n button.userMenu = helpMenu;\n button.selector = 'deleteVariable';\n button.showHelp = BlockMorph.prototype.showHelp;\n blocks.push(button);\n }\n\n blocks.push('-');\n\n varNames = this.variables.allNames();\n if (varNames.length > 0) {\n varNames.forEach(function (name) {\n blocks.push(variableWatcherToggle(name));\n blocks.push(variableBlock(name));\n });\n blocks.push('-');\n }\n\n blocks.push(block('doSetVar'));\n blocks.push(block('doChangeVar'));\n blocks.push(block('doShowVar'));\n blocks.push(block('doHideVar'));\n blocks.push(block('doDeclareVariables'));\n\n blocks.push('=');\n\n blocks.push(block('reportNewList'));\n blocks.push('-');\n blocks.push(block('reportCONS'));\n blocks.push(block('reportListItem'));\n blocks.push(block('reportCDR'));\n blocks.push('-');\n blocks.push(block('reportListLength'));\n blocks.push(block('reportListContainsItem'));\n blocks.push('-');\n blocks.push(block('doAddToList'));\n blocks.push(block('doDeleteFromList'));\n blocks.push(block('doInsertInList'));\n blocks.push(block('doReplaceInList'));\n }\n\n\n\n\n // for debugging: ///////////////\n\n if (this.world().isDevMode) {\n blocks.push('-');\n txt = new TextMorph(localize(\n 'development mode \\ndebugging primitives:'\n ));\n txt.fontSize = 9;\n txt.setColor(this.paletteTextColor);\n blocks.push(txt);\n blocks.push('-');\n blocks.push(block('reportMap'));\n }\n\n /////////////////////////////////\n\n if (world.isMakersBasicMode) {\n\n } else {\n blocks.push('=');\n\n if (StageMorph.prototype.enableCodeMapping) {\n blocks.push(block('doMapCodeOrHeader'));\n blocks.push(block('doMapStringCode'));\n blocks.push(block('doMapListCode'));\n blocks.push('-');\n blocks.push(block('reportMappedCode'));\n blocks.push('=');\n }\n\n button = new PushButtonMorph(\n null,\n function () {\n var ide = myself.parentThatIsA(IDE_Morph),\n stage = myself.parentThatIsA(StageMorph);\n new BlockDialogMorph(\n null,\n function (definition) {\n if (definition.spec !== '') {\n if (definition.isGlobal) {\n stage.globalBlocks.push(definition);\n } else {\n myself.customBlocks.push(definition);\n }\n ide.flushPaletteCache();\n ide.refreshPalette();\n new BlockEditorMorph(definition, myself).popUp();\n }\n },\n myself\n ).prompt(\n 'Make a block',\n null,\n myself.world()\n );\n },\n 'Make a block'\n );\n button.userMenu = helpMenu;\n button.selector = 'addCustomBlock';\n button.showHelp = BlockMorph.prototype.showHelp;\n blocks.push(button);\n }\n\n } else if (category === 'makers') {\n blocks.push(arduinoConnectButton);\n blocks.push(arduinoDisconnectButton);\n blocks.push('-');\n blocks.push(blockBySelector('makersLedOn'));\n blocks.push(blockBySelector('makersLedOff'));\n blocks.push('-');\n blocks.push(blockBySelector('makersBuzzerOn'));\n blocks.push(blockBySelector('makersBuzzerOff'));\n blocks.push(blockBySelector('makersBuzzer'));\n blocks.push('-');\n blocks.push(watcherToggle('makersTemperature'));\n blocks.push(blockBySelector('makersTemperature'));\n blocks.push(watcherToggle('makersLight'));\n blocks.push(blockBySelector('makersLight'));\n blocks.push(watcherToggle('makersAudio'));\n blocks.push(blockBySelector('makersAudio'));\n blocks.push(watcherToggle('makersHumidity'));\n blocks.push(blockBySelector('makersHumidity'));\n blocks.push(watcherToggle('makersInfrared'));\n blocks.push(blockBySelector('makersInfrared'));\n blocks.push(watcherToggle('makersPotentiometer'));\n blocks.push(blockBySelector('makersPotentiometer'));\n blocks.push('-');\n blocks.push(watcherToggle('makersSwitch'));\n blocks.push(blockBySelector('makersSwitch'));\n blocks.push('-');\n blocks.push(blockBySelector('makersTurnOnActuator'));\n blocks.push(blockBySelector('makersTurnOffActuator'));\n blocks.push(blockBySelector('makersSetPWM'));\n blocks.push('-');\n blocks.push(blockBySelector('makersReadSensor'));\n blocks.push(blockBySelector('makersReportDigitalPin'));\n blocks.push('-');\n blocks.push(blockBySelector('makersServoWrite'));\n\n } else if (category === 'internet') {\n blocks.push('-');\n blocks.push(tweetButton);\n blocks.push(blockBySelector('makersSendTweet'));\n blocks.push('-');\n blocks.push(block('reportURL'));\n blocks.push('-');\n blocks.push(block('reportWeather'));\n blocks.push('-');\n\n if (!world.isMakersBasicMode) {\n blocks.push(block('reportXively'));\n blocks.push('-');\n blocks.push(block('reportThingSpeak'));\n blocks.push(block('updateThingSpeak'));\n } \n }\n\n return blocks;\n}", "function PaintSequence() {\n if (idCurrentBloc != undefined) {\n var nom, item, topMargin;\n topMargin = 60; //initial value of topMargin for the first box. This value will increment +50px for each box of the jsplumb.\n idsInside = [];\n if (o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].BlocsReferences) {\n for (var i = 0; i < o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].BlocsReferences.int.length; i++) {\n idsInside.push(o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].BlocsReferences.int[i] + \"-B\");\n }\n }\n if (o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].PointsReferences) {\n for (var i = 0; i < o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].PointsReferences.int.length; i++) {\n idsInside.push(o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].PointsReferences.int[i] + \"-P\");\n }\n }\n\n document.getElementById(\"diagramcontainer\").innerHTML = \"\";\n document.getElementById(\"diagramcontainer\").innerHTML += \"<div id='item9998' class='item' onclick='GetItemGUIPositionMouseUp(this.id)' style='top:10px; background: #ffffff; color: #242629; width: 80px;margin-left:auto;margin-right:auto;'><strong><p id='initcontent'></p></strong></div>\";\n document.getElementById('initcontent').innerHTML = \"Init\";\n var middleX;\n middleX = (document.getElementById(\"diagramcontainer\").offsetWidth / 2) - 100;\n for (var i = 0; i < idsInside.length; i++) {\n arrayidsInside = idsInside[i].split(\"-\");\n id = idsInside[i].split(\"-\", 1);\n item = \"item\" + id;\n nom = \"nom\" + id;\n\n //first compares the idgiven with the ItemGUI id's\n if (o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].SequenceDescriptions.AllItems.ItemGUI) {\n for (var u = 0; u < o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].SequenceDescriptions.AllItems.ItemGUI.length; u++) {\n if (o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].SequenceDescriptions.AllItems.ItemGUI[u].itemId == id) {\n xS = (+o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].SequenceDescriptions.AllItems.ItemGUI[u].x_location) + (+middleX);\n yS = o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].SequenceDescriptions.AllItems.ItemGUI[u].y_location;\n document.getElementById(\"diagramcontainer\").innerHTML += \"<div id='\" + item + \"' class='item' style='top:\" + yS + \"px; left:\" + xS + \"px;' oncontextmenu='RightClickItem(this.id)' onmouseover='MouseOverItem(this.id, event)' onmouseout='HideDialogBox()' onclick='GetItemGUIPositionMouseUp(this.id)' ondblclick='DblClickElemSequence(this.id)'><strong><p id='\" + nom + \"'></p></strong></div>\";\n\n }\n }\n if (arrayidsInside[1] == \"B\") {\n for (var q = 0; q < o.BlocAssembly.AllBlocs.Bloc.length; q++) {\n if (o.BlocAssembly.AllBlocs.Bloc[q][\"@Id\"] == id) {\n document.getElementById(nom).innerHTML = o.BlocAssembly.AllBlocs.Bloc[q].BlocName;\n document.getElementById(item).style.background = \"#54595f\"; //color bloc in secuence\n document.getElementById(item).style.color = \"#ffffff\";\n\n }\n }\n } else if (arrayidsInside[1] == \"P\") {\n for (var q = 0; q < o.BlocAssembly.AllPoints.ProcessPoint.length; q++) {\n if (o.BlocAssembly.AllPoints.ProcessPoint[q][\"@Id\"] == id) {\n document.getElementById(nom).innerHTML = o.BlocAssembly.AllPoints.ProcessPoint[q].Alias;\n }\n }\n }\n }\n }\n document.getElementById(\"diagramcontainer\").innerHTML += \"<div id='item9999' class='item' onclick='GetItemGUIPositionMouseUp(this.id)' style='top:\" + 500 + \"px; background: #ffffff; color: #242629; width: 80px; margin-left:auto;margin-right:auto;'><strong><p id='fincontent'></p></strong></div>\";\n document.getElementById('fincontent').innerHTML = \"End\";\n PlumbGrafic();\n }\n}", "_handleAdvancedSnapping() {\n const that = this;\n\n if (!that._dragDetails) {\n return;\n }\n\n if (that._snapFeedback && !that._dragDetails.hoveredTabsWindow) {\n that._snapFeedback._position = undefined;\n\n if (that._snapFeedback.areaHighlighter && that._snapFeedback.areaHighlighter.parentElement) {\n that._snapFeedback.areaHighlighter.parentElement.removeChild(that._snapFeedback.areaHighlighter);\n }\n\n if (that._snapFeedback.headerHighlighter && that._snapFeedback.headerHighlighter.parentElement) {\n that._snapFeedback.headerHighlighter.parentElement.removeChild(that._snapFeedback.headerHighlighter);\n }\n\n if (!that._dragDetails.hoveredItem) {\n if (that._snapFeedback.innerSnapElement && that._snapFeedback.innerSnapElement.parentElement) {\n that._snapFeedback.innerSnapElement.parentElement.removeChild(that._snapFeedback.innerSnapElement);\n }\n\n if (that._snapFeedback.outherSnapElement && !that._dragDetails.isInsideTheLayout) {\n const outherElements = [].slice.call(that.$.container.children);\n\n for (let i = 0; i < outherElements.length; i++) {\n if (outherElements[i].className.indexOf('jqx-docking-layout-snap') > -1) {\n that._snapFeedback.outherSnapElement.appendChild(outherElements[i]);\n }\n }\n }\n\n return;\n }\n }\n\n if (!that._snapFeedback) {\n that._snapFeedback = {\n innerSnapElement: document.createElement('div'),\n outherSnapElement: document.createElement('div'),\n areaHighlighter: document.createElement('div'),\n headerHighlighter: document.createElement('div')\n };\n\n that._snapFeedback.innerSnapElement.classList.add('jqx-docking-layout-snap');\n that._snapFeedback.areaHighlighter.classList.add('jqx-docking-layout-snap-highlighter');\n that._snapFeedback.headerHighlighter.classList.add('jqx-docking-layout-snap-highlighter-header');\n\n that._snapFeedback.innerSnapElement.innerHTML = `\n <div>\n <div class=\"top\">\n <div><div></div></div>\n </div>\n </div>\n <div>\n <div class=\"left\">\n <div><div></div></div>\n </div>\n <div class=\"center\">\n <div><div></div></div>\n </div>\n <div class=\"right\">\n <div><div></div></div>\n </div>\n </div>\n <div>\n <div class=\"bottom\">\n <div><div></div></div>\n </div>\n </div>`;\n\n that._snapFeedback.outherSnapElement.innerHTML = `\n <div class=\"jqx-docking-layout-snap layout-top\">\n <div><div></div></div>\n </div>\n <div class=\"jqx-docking-layout-snap layout-left\">\n <div><div></div></div>\n </div>\n <div class=\"jqx-docking-layout-snap layout-right\">\n <div><div></div></div>\n </div>\n <div class=\"jqx-docking-layout-snap layout-bottom\">\n <div><div></div></div>\n </div>`;\n }\n\n if (that._snapFeedback.areaHighlighter.parentElement) {\n that._snapFeedback.areaHighlighter.removeAttribute('position');\n that._snapFeedback.areaHighlighter.classList.remove('jqx-hidden');\n }\n\n that._snapFeedback.areaHighlighter.style.width = '';\n that._snapFeedback.areaHighlighter.style.height = '';\n\n that._snapFeedback._position = that._dragDetails.hoveredItem && !(that._dragDetails.hoveredItem instanceof JQX.SplitterItem) ? that._dragDetails.hoveredItem.className : '';\n\n if (that._dragDetails.hoveredItem && that._dragDetails.hoveredItem.className.indexOf('layout-') > -1) {\n that._snapFeedback._position = that._snapFeedback._position.replace('jqx-docking-layout-snap ', '');\n that._snapFeedback.areaHighlighter.setAttribute('position', that._snapFeedback._position);\n\n const selectedTabsWindow = that._dragDetails.selectedTabsWindow;\n\n if (selectedTabsWindow.dropPosition.indexOf('all') > -1 || selectedTabsWindow.dropPosition.indexOf(that._snapFeedback._position) > -1) {\n that._dragDetails.hoveredItem.setAttribute('show', '');\n that.$.container.appendChild(that._snapFeedback.areaHighlighter);\n that._dragDetails.hoveredTabsWindow = true;\n\n //Sets the size of the outher(layout) highlighters\n if (['layout-left', 'layout-right'].indexOf(that._snapFeedback._position) > -1) {\n that._snapFeedback.areaHighlighter.style.width = that._dragDetails.windowFeedback.style.width || (that._dragDetails.windowFeedback.offsetWidth + 'px');\n }\n else if (['layout-top', 'layout-bottom'].indexOf(that._snapFeedback._position) > -1) {\n that._snapFeedback.areaHighlighter.style.height = that._dragDetails.windowFeedback.style.height || (that._dragDetails.windowFeedback.offsetHeight + 'px');\n }\n }\n else {\n that._dragDetails.hoveredItem.removeAttribute('show');\n that._snapFeedback._position = undefined;\n }\n\n return;\n }\n\n let dropPosition = that._dragDetails.hoveredTabsWindow ? that._dragDetails.hoveredTabsWindow.dropPosition : ['all'];\n\n if (dropPosition.length === 0) {\n dropPosition = ['all'];\n }\n\n if (that._dragDetails.hoveredTabsWindow instanceof JQX.TabsWindow && that._dragDetails.hoveredTabArea &&\n that._dragDetails.hoveredTabArea.closest('.jqx-tabs-header-section') && (dropPosition.indexOf('all') > -1 || dropPosition.indexOf('header') > -1)) {\n that._dragDetails.hoveredTabArea = that._dragDetails.hoveredTabArea.classList.contains('jqx-tab-label-container') ? that._dragDetails.hoveredTabArea : undefined;\n\n const dimensions = that._getHeaderLabelDimensions(),\n headerHighLighter = that._snapFeedback.headerHighlighter;\n\n headerHighLighter.style.width = dimensions.width + 'px';\n headerHighLighter.style.height = dimensions.height + 'px';\n headerHighLighter.style.top = dimensions.top + 'px';\n headerHighLighter.style.left = dimensions.left + 'px';\n headerHighLighter.classList.remove('jqx-hidden');\n\n if (headerHighLighter.parentElement !== document.body) {\n document.body.appendChild(headerHighLighter);\n }\n\n that._snapFeedback._position = 'header';\n }\n else {\n that._snapFeedback.headerHighlighter.style.width = that._snapFeedback.headerHighlighter.style.height = 0;\n }\n\n const innerSnapElementParent = that._snapFeedback.innerSnapElement.closest('jqx-splitter-item');\n\n if (that._dragDetails.hoveredItem instanceof JQX.SplitterItem) {\n if (innerSnapElementParent && that._dragDetails.hoveredItem !== innerSnapElementParent) {\n innerSnapElementParent.removeChild(that._snapFeedback.innerSnapElement);\n }\n\n if (that._dragDetails.hoveredItem.className.indexOf('auto-hide') < 0) {\n const highlighSections = that._snapFeedback.innerSnapElement.querySelectorAll('.top, .bottom, .left, .right, .center');\n\n for (let i = 0; i < highlighSections.length; i++) {\n\n if (dropPosition.indexOf(highlighSections[i].className) > -1 || dropPosition.indexOf('all') === 0) {\n highlighSections[i].setAttribute('show', '');\n }\n else {\n highlighSections[i].removeAttribute('show');\n }\n }\n\n that._snapFeedback.innerSnapElement.classList.remove('jqx-hidden');\n that._dragDetails.hoveredItem.appendChild(that._snapFeedback.innerSnapElement);\n }\n\n const outherElements = [].slice.call(that._snapFeedback.outherSnapElement.children),\n selectedTabsWindow = that._dragDetails.selectedTabsWindow;\n let position;\n\n for (let i = 0; i < outherElements.length; i++) {\n position = outherElements[i].className.replace('jqx-docking-layout-snap ', '');\n outherElements[i].classList.remove('jqx-hidden');\n\n if (selectedTabsWindow.dropPosition.indexOf('all') > -1 || selectedTabsWindow.dropPosition.indexOf(position) > -1) {\n outherElements[i].setAttribute('show', '');\n }\n else {\n outherElements[i].removeAttribute('show');\n }\n\n that.$.container.appendChild(outherElements[i]);\n }\n }\n\n if (!that._snapFeedback._position || dropPosition.indexOf('all') < 0 && dropPosition.indexOf(that._snapFeedback._position) < 0) {\n that._snapFeedback._position = that._dragDetails.hoveredTabArea = undefined;\n return;\n }\n\n if (that._snapFeedback._position === 'center' && that._items.filter(item => item.opened).length > 0) {\n that._dragDetails.hoveredTabArea = that._dragDetails.hoveredTabsWindow.$.tabsElement.$.tabsHeaderSection;\n }\n\n //Sets the size of the inner highlighters\n if (['left', 'right'].indexOf(that._snapFeedback._position) > -1) {\n that._snapFeedback.areaHighlighter.style.width = that._dragDetails.windowFeedback.style.width || (that._dragDetails.windowFeedback.offsetWidth + 'px');\n }\n else if (['top', 'bottom'].indexOf(that._snapFeedback._position) > -1) {\n that._snapFeedback.areaHighlighter.style.height = that._dragDetails.windowFeedback.style.height || (that._dragDetails.windowFeedback.offsetHeight + 'px');\n }\n\n that._snapFeedback.areaHighlighter.setAttribute('position', that._snapFeedback._position);\n\n if (that._snapFeedback._position === 'header') {\n that._dragDetails.hoveredTabsWindow.$.tabsElement.$.tabContentSection.appendChild(that._snapFeedback.areaHighlighter);\n }\n else {\n const orientation = that._dragDetails.hoveredTabsWindow.closest('jqx-splitter').orientation;\n\n if (((that._snapFeedback._position === 'left' || that._snapFeedback._position === 'right') && orientation === 'horizontal') ||\n ((that._snapFeedback._position === 'top' || that._snapFeedback._position === 'bottom') && orientation === 'vertical')) {\n that._snapFeedback._position = 'inside-' + that._snapFeedback._position;\n }\n\n that._dragDetails.hoveredItem.closest('jqx-splitter-item').appendChild(that._snapFeedback.areaHighlighter);\n }\n }", "function mj(a,b){this.Sc=ac(\"div\",\"blocklyToolboxDiv\");this.Sc.setAttribute(\"dir\",J?\"RTL\":\"LTR\");b.appendChild(this.Sc);this.Wa=new nj;a.appendChild(this.Wa.Ba());M(this.Sc,\"mousedown\",this,function(a){bd(a)||a.target==this.Sc?le(!1):le(!0)})}", "function focusSetup(side, pos, trigger) {\n const focusClass = \"slot \" + side + pos + \" \";\n\n const ghost = document.querySelector(\".ghost\");\n const defRing = document.querySelector(\".default_ring\");\n const statBar = document.querySelector(\".stat_bar\");\n const invBtns = document.querySelector(\".inventory_button_container\");\n const subclass = document.querySelector(\".subclass_border\");\n const allSlots = document.querySelectorAll(\".slot\");\n\n const beamSVG = document.querySelector(\"#beamSVG\");\n const focusBeam = document.querySelector(\"#beamTarget0\");\n const endEl = document.querySelector(\"#beamTarget4\");\n const ray0 = document.querySelector(\"#beamRay0\");\n const ray1 = document.querySelector(\"#beamRay1\");\n const ray2 = document.querySelector(\"#beamRay2\");\n const ray3 = document.querySelector(\"#beamRay3\");\n const ray4 = document.querySelector(\"#beamRay4\");\n const ray5 = document.querySelector(\"#beamRay5\");\n const ray6 = document.querySelector(\"#beamRay6\");\n const ray7 = document.querySelector(\"#beamRay7\");\n\n const svgData = beamSVG.getBoundingClientRect();\n\n let timeline = new TimelineMax();\n\n // Hide Stat Bar\n timeline.to(\n statBar,\n 0.25,\n { css: { scaleY: 0, transformOrigin: \"50% 0%\" }, ease: Power2.easeOut },\n 0\n );\n\n // Hide Inventory Button Container\n timeline.to(\n invBtns,\n 0.25,\n { css: { scaleY: 0, transformOrigin: \"50% 100%\" }, ease: Power2.easeOut },\n 0\n );\n\n // Hide Subclass\n timeline.to(subclass, 0.25, { css: { scale: 0 }, ease: Power2.easeOut }, 0);\n\n // Set Beam Ray Positions\n // timeline.to( ray0, 0, { attr: { x1: '50%', y1: '50%' } }, 0 );\n\n // Shift Ghost / Hide Ring\n timeline.to(defRing, 0.5, { autoAlpha: 0 }, 0);\n ghost.classList.remove(\"default\");\n ghost.classList.add(side);\n\n if (side === \"left\") {\n timeline.to(\n ghost,\n 0.5,\n { css: { scale: 2, x: -100, y: 15 }, ease: Power2.easeOut },\n 0\n );\n } else if (side === \"right\") {\n timeline.to(\n ghost,\n 0.5,\n { css: { scale: 2, x: 100, y: 15 }, ease: Power2.easeOut },\n 0\n );\n }\n\n // Hide Unfocused Slots\n for (let i = 0; i < allSlots.length; i++) {\n let thisSlot = allSlots[i];\n\n // If slot is the clicked slot\n if (thisSlot.className === focusClass) {\n\n // Position the return point for the beam\n if (side === \"left\") {\n timeline.to(endEl, 0, { css: { x: -100 + \"px\", y: 15 + \"px\" } }, 0);\n } else {\n timeline.to(endEl, 0, { css: { x: 100 + \"px\", y: 15 + \"px\" } }, 0);\n }\n\n // Decide which focus target for beam to move to\n const beamTargetSelector = side === \"left\" ? \"#scan_focus_target\" : \"#scan_focus_target_right\";\n const beamTargetSelector1 = side === \"left\" ? \".scan_beam_thin_target\" : \".scan_beam_thin_target_right\";\n const beamTargetSelector2 = side === \"left\" ? \".scanner_bucket\" : \".scanner_bucket_right\";\n\n const pathEl = document.querySelector(\"#beamPathEl\");\n const beamStart = buildBeam(focusBeam);\n const beamPath = buildBeam(thisSlot, side);\n const beamPath2 = buildBeam(document.querySelector(beamTargetSelector), side);\n const beamPath3 = buildBeam(document.querySelector(beamTargetSelector1), side);\n const beamPath4 = buildBeam(document.querySelector(beamTargetSelector2), side);\n const beamEnd = buildBeam(endEl, side);\n timeline.to(pathEl, 0, { attr: { d: beamStart }, css: { opacity: .8 }, }, 0);\n // Beam to Clicked Slot\n timeline.to(pathEl, .5, { attr: { d: beamPath }, ease: Power2.easeOut }, 0);\n // Beam to Focus\n timeline.to(pathEl, .5, { attr: { d: beamPath2 }, ease: Power2.easeInOut }, .5);\n // Beam to bucket start\n timeline.to(pathEl, 0.1, { attr: { d: beamPath3 }, ease: Power2.easeInOut }, 1);\n // Beam to bucket\n timeline.to(pathEl, 0.5, { attr: { d: beamPath4 }, ease: Power2.easeInOut }, 1.1);\n // Return Beam to Ghost\n timeline.to(pathEl, .5, { attr: { d: beamEnd }, ease: Power2.easeOut }, 1.6);\n timeline.to(pathEl, 0, { attr: { d: \"\" } }, 2.1);\n timeline.to(endEl, 0, { css: { opacity: 0 } }, 2.1);\n\n const moveInfo = getMoveInfo(thisSlot);\n const start = moveInfo.start;\n const end = moveInfo.end;\n let dX = end[0] - start[0];\n let dY = end[1] - start[1];\n\n const launchInfo = beamLaunchInfo(focusBeam, thisSlot);\n let launchX = launchInfo.end[0] - launchInfo.start[0];\n let launchY = launchInfo.end[1] - launchInfo.start[1];\n let rayLaunchX = launchInfo.end[0] - svgData.left;\n let rayLaunchY = launchInfo.end[1];\n\n const beamMoveInfo = getMoveInfo(focusBeam);\n let beamMoveX = beamMoveInfo.end[0] - beamMoveInfo.start[0];\n let beamMoveY = beamMoveInfo.end[1] - beamMoveInfo.start[1];\n let rayMoveX = beamMoveInfo.end[0] - svgData.left;\n let rayMoveY = beamMoveInfo.end[1];\n\n let svgCenterX = svgData.width * 0.5;\n let svgCenterY = svgData.height * 0.5;\n let rayOriginX = side === \"left\" ? svgCenterX - 100 : svgCenterX + 100;\n let rayOriginY = svgCenterY + 15;\n\n // Randomize Beam Attributes\n const beamAttrs = getRandomBeamAttributes(8);\n timeline.to(ray0, 0, { css: { stroke: beamAttrs.stroke[0], strokeWidth: beamAttrs.strokeWidth[0], strokeDasharray: beamAttrs.strokeDash[0], strokeDashoffset: beamAttrs.strokeDashOffset[0] } }, 0);\n timeline.to(ray1, 0, { css: { stroke: beamAttrs.stroke[1], strokeWidth: beamAttrs.strokeWidth[1], strokeDasharray: beamAttrs.strokeDash[1], strokeDashoffset: beamAttrs.strokeDashOffset[1] } }, 0);\n timeline.to(ray2, 0, { css: { stroke: beamAttrs.stroke[2], strokeWidth: beamAttrs.strokeWidth[2], strokeDasharray: beamAttrs.strokeDash[2], strokeDashoffset: beamAttrs.strokeDashOffset[2] } }, 0);\n timeline.to(ray3, 0, { css: { stroke: beamAttrs.stroke[3], strokeWidth: beamAttrs.strokeWidth[3], strokeDasharray: beamAttrs.strokeDash[3], strokeDashoffset: beamAttrs.strokeDashOffset[3] } }, 0);\n timeline.to(ray4, 0, { css: { stroke: beamAttrs.stroke[4], strokeWidth: beamAttrs.strokeWidth[4], strokeDasharray: beamAttrs.strokeDash[4], strokeDashoffset: beamAttrs.strokeDashOffset[4] } }, 0);\n timeline.to(ray5, 0, { css: { stroke: beamAttrs.stroke[5], strokeWidth: beamAttrs.strokeWidth[5], strokeDasharray: beamAttrs.strokeDash[5], strokeDashoffset: beamAttrs.strokeDashOffset[5] } }, 0);\n timeline.to(ray6, 0, { css: { stroke: beamAttrs.stroke[6], strokeWidth: beamAttrs.strokeWidth[6], strokeDasharray: beamAttrs.strokeDash[6], strokeDashoffset: beamAttrs.strokeDashOffset[6] } }, 0);\n timeline.to(ray7, 0, { css: { stroke: beamAttrs.stroke[7], strokeWidth: beamAttrs.strokeWidth[7], strokeDasharray: beamAttrs.strokeDash[7], strokeDashoffset: beamAttrs.strokeDashOffset[7] } }, 0);\n\n // Set Beam Ray Positions\n timeline.to(ray0, 0, { attr: { x1: svgCenterX, y1: svgCenterY, x2: launchInfo.data.x - svgData.left, y2: launchInfo.data.y } }, 0);\n timeline.to(ray1, 0, { attr: { x1: svgCenterX, y1: svgCenterY, x2: launchInfo.data.right - svgData.left, y2: launchInfo.data.y } }, 0);\n timeline.to(ray2, 0, { attr: { x1: svgCenterX, y1: svgCenterY, x2: launchInfo.data.x - svgData.left, y2: launchInfo.data.bottom } }, 0);\n timeline.to(ray3, 0, { attr: { x1: svgCenterX, y1: svgCenterY, x2: launchInfo.data.right - svgData.left, y2: launchInfo.data.bottom } }, 0);\n timeline.to(ray4, 0, { attr: { x1: svgCenterX, y1: svgCenterY, x2: launchInfo.data.x - svgData.left, y2: launchInfo.data.y } }, 0);\n timeline.to(ray5, 0, { attr: { x1: svgCenterX, y1: svgCenterY, x2: launchInfo.data.right - svgData.left, y2: launchInfo.data.y } }, 0);\n timeline.to(ray6, 0, { attr: { x1: svgCenterX, y1: svgCenterY, x2: launchInfo.data.x - svgData.left, y2: launchInfo.data.bottom } }, 0);\n timeline.to(ray7, 0, { attr: { x1: svgCenterX, y1: svgCenterY, x2: launchInfo.data.right - svgData.left, y2: launchInfo.data.bottom } }, 0);\n\n timeline.to(ray0, 0, { css: { opacity: 1 } }, 0);\n timeline.to(ray1, 0, { css: { opacity: 1 } }, 0);\n timeline.to(ray2, 0, { css: { opacity: 1 } }, 0);\n timeline.to(ray3, 0, { css: { opacity: 1 } }, 0);\n timeline.to(ray4, 0, { css: { opacity: 1 } }, 0);\n timeline.to(ray5, 0, { css: { opacity: 1 } }, 0);\n timeline.to(ray6, 0, { css: { opacity: 1 } }, 0);\n timeline.to(ray7, 0, { css: { opacity: 1 } }, 0);\n\n if (moveInfo.dims === 55) {\n dX = dX + 5;\n dY = dY + 5;\n }\n\n if (side === \"right\") {\n // let extra = window.innerHeight < 620 ? 184 : 204; // 167 : 197\n let extra = 245;\n\n dX = dX + extra;\n beamMoveX = beamMoveX + extra;\n rayMoveX = rayMoveX + extra;\n }\n\n // Shift Focus\n if (moveInfo.dims === 70) {\n dY = dY + 2;\n timeline.to(\n thisSlot,\n 0.5,\n { css: { width: 75, height: 75 }, ease: Power2.easeInOut },\n 0\n );\n }\n if (moveInfo.dims === 65) {\n if (side !== \"right\") {\n // dX = dX + 2.5;\n }\n dY = dY + 4;\n timeline.to(\n thisSlot,\n 0.5,\n { css: { width: 75, height: 75 }, ease: Power2.easeInOut },\n 0\n );\n }\n\n // Move Beam to Clicked Slot\n timeline.to(focusBeam, 0.5, { css: { x: launchX + \"px\", y: launchY + \"px\", width: launchInfo.dims, height: launchInfo.dims, border: \"2px solid rgba(0, 191, 255, .85)\", backgroundColor: \"rgba(0, 191, 255, .75)\" }, ease: Power2.easeOut }, 0);\n\n // Move Beam Ray Origins to Ghost\n timeline.to(ray0, 0.5, { attr: { x1: rayOriginX, y1: rayOriginY }, ease: Power2.easeOut }, 0);\n timeline.to(ray1, 0.5, { attr: { x1: rayOriginX, y1: rayOriginY }, ease: Power2.easeOut }, 0);\n timeline.to(ray2, 0.5, { attr: { x1: rayOriginX, y1: rayOriginY }, ease: Power2.easeOut }, 0);\n timeline.to(ray3, 0.5, { attr: { x1: rayOriginX, y1: rayOriginY }, ease: Power2.easeOut }, 0);\n timeline.to(ray4, 0.5, { attr: { x1: rayOriginX, y1: rayOriginY }, ease: Power2.easeOut }, 0);\n timeline.to(ray5, 0.5, { attr: { x1: rayOriginX, y1: rayOriginY }, ease: Power2.easeOut }, 0);\n timeline.to(ray6, 0.5, { attr: { x1: rayOriginX, y1: rayOriginY }, ease: Power2.easeOut }, 0);\n timeline.to(ray7, 0.5, { attr: { x1: rayOriginX, y1: rayOriginY }, ease: Power2.easeOut }, 0);\n\n // Move Beam Rays to Clicked Slot\n timeline.to(ray0, 0.5, { attr: { x2: rayLaunchX, y2: rayLaunchY }, ease: Power2.easeOut }, 0);\n timeline.to(ray1, 0.5, { attr: { x2: rayLaunchX + launchInfo.dims, y2: rayLaunchY }, ease: Power2.easeOut }, 0);\n timeline.to(ray2, 0.5, { attr: { x2: rayLaunchX, y2: rayLaunchY + launchInfo.dims }, ease: Power2.easeOut }, 0);\n timeline.to(ray3, 0.5, { attr: { x2: rayLaunchX + launchInfo.dims, y2: rayLaunchY + launchInfo.dims }, ease: Power2.easeOut }, 0);\n timeline.to(ray4, 0.5, { attr: { x2: rayLaunchX + launchInfo.dims * 0.5, y2: rayLaunchY }, ease: Power2.easeOut }, 0);\n timeline.to(ray5, 0.5, { attr: { x2: rayLaunchX + launchInfo.dims * 0.5, y2: rayLaunchY + launchInfo.dims }, ease: Power2.easeOut }, 0);\n timeline.to(ray6, 0.5, { attr: { x2: rayLaunchX, y2: rayLaunchY + launchInfo.dims * 0.5 }, ease: Power2.easeOut }, 0);\n timeline.to(ray7, 0.5, { attr: { x2: rayLaunchX + launchInfo.dims, y2: rayLaunchY + launchInfo.dims * 0.5 }, ease: Power2.easeOut }, 0);\n\n // Move Beam and Slot to Focus\n timeline.to(thisSlot, 0.5, { css: { x: dX + \"px\", y: dY + \"px\" }, ease: Power2.easeInOut }, 0.5);\n timeline.to(focusBeam, 0.5, { css: { x: beamMoveX + \"px\", y: beamMoveY + \"px\" }, ease: Power2.easeInOut }, 0.5);\n\n // Move Beam Rays to Focus\n timeline.to(ray0, 0.5, { attr: { x2: rayMoveX, y2: rayMoveY }, ease: Power2.easeInOut }, 0.5);\n timeline.to(ray1, 0.5, { attr: { x2: rayMoveX + launchInfo.dims, y2: rayMoveY }, ease: Power2.easeInOut }, 0.5);\n timeline.to(ray2, 0.5, { attr: { x2: rayMoveX, y2: rayMoveY + launchInfo.dims }, ease: Power2.easeInOut }, 0.5);\n timeline.to(ray3, 0.5, { attr: { x2: rayMoveX + launchInfo.dims, y2: rayMoveY + launchInfo.dims }, ease: Power2.easeInOut }, 0.5);\n timeline.to(ray4, 0.5, { attr: { x2: rayMoveX + launchInfo.dims * 0.5, y2: rayMoveY }, ease: Power2.easeInOut }, 0.5);\n timeline.to(ray5, 0.5, { attr: { x2: rayMoveX + launchInfo.dims * 0.5, y2: rayMoveY + launchInfo.dims }, ease: Power2.easeInOut }, 0.5);\n timeline.to(ray6, 0.5, { attr: { x2: rayMoveX, y2: rayMoveY + launchInfo.dims * 0.5 }, ease: Power2.easeInOut }, 0.5);\n timeline.to(ray7, 0.5, { attr: { x2: rayMoveX + launchInfo.dims, y2: rayMoveY + launchInfo.dims * 0.5 }, ease: Power2.easeInOut }, 0.5);\n\n // Move Beam to Bucket\n if (side === 'left') {\n timeline.to(focusBeam, 0.1, { css: { x: beamMoveX + 85 + \"px\", width: \".05em\" }, ease: Power2.easeInOut }, 1);\n } else if (side === 'right') {\n timeline.to(focusBeam, 0.1, { css: { x: beamMoveX - 10 + \"px\", width: \".05em\" }, ease: Power2.easeInOut }, 1);\n }\n\n // Move Beam Rays to Bucket\n if (side === 'left') {\n timeline.to(ray0, 0.1, { attr: { x2: rayMoveX + 85 }, ease: Power2.easeInOut }, 1);\n timeline.to(ray1, 0.1, { attr: { x2: rayMoveX + launchInfo.dims + 10 }, ease: Power2.easeInOut }, 1);\n timeline.to(ray2, 0.1, { attr: { x2: rayMoveX + 85 }, ease: Power2.easeInOut }, 1);\n timeline.to(ray3, 0.1, { attr: { x2: rayMoveX + launchInfo.dims + 10 }, ease: Power2.easeInOut }, 1);\n timeline.to(ray4, 0.1, { attr: { x2: rayMoveX + launchInfo.dims * 0.5 + 45 }, ease: Power2.easeInOut }, 1);\n timeline.to(ray5, 0.1, { attr: { x2: rayMoveX + launchInfo.dims * 0.5 + 45 }, ease: Power2.easeInOut }, 1);\n timeline.to(ray6, 0.1, { attr: { x2: rayMoveX + 85 }, ease: Power2.easeInOut }, 1);\n timeline.to(ray7, 0.1, { attr: { x2: rayMoveX + launchInfo.dims + 10 }, ease: Power2.easeInOut }, 1);\n } else if (side === 'right') {\n timeline.to(ray0, 0.1, { attr: { x2: rayMoveX - 10 }, ease: Power2.easeInOut }, 1);\n timeline.to(ray1, 0.1, { attr: { x2: rayMoveX - launchInfo.dims + 65 }, ease: Power2.easeInOut }, 1);\n timeline.to(ray2, 0.1, { attr: { x2: rayMoveX - 10 }, ease: Power2.easeInOut }, 1);\n timeline.to(ray3, 0.1, { attr: { x2: rayMoveX - launchInfo.dims + 65 }, ease: Power2.easeInOut }, 1);\n timeline.to(ray4, 0.1, { attr: { x2: rayMoveX - launchInfo.dims * 0.5 + 25 }, ease: Power2.easeInOut }, 1);\n timeline.to(ray5, 0.1, { attr: { x2: rayMoveX - launchInfo.dims * 0.5 + 25 }, ease: Power2.easeInOut }, 1);\n timeline.to(ray6, 0.1, { attr: { x2: rayMoveX - 10 }, ease: Power2.easeInOut }, 1);\n timeline.to(ray7, 0.1, { attr: { x2: rayMoveX - launchInfo.dims + 65 }, ease: Power2.easeInOut }, 1);\n }\n\n\n // Expand Beam to Bucket\n if (side === 'left') {\n timeline.to(focusBeam, 0.5, { css: { width: \"234px\", height: \"234px\" }, ease: Power2.easeInOut }, 1.1);\n } else if (side === 'right') {\n timeline.to(focusBeam, 0.5, { css: { x: beamMoveX - 242 + \"px\", width: \"234px\", height: \"234px\" }, ease: Power2.easeInOut }, 1.1);\n }\n\n\n // Expand Beam Rays to Bucket\n if (side === 'left') {\n // ray0 stays\n timeline.to(ray1, 0.5, { attr: { x2: rayMoveX + launchInfo.dims + 242 }, ease: Power2.easeInOut }, 1.1);\n timeline.to(ray2, 0.5, { attr: { y2: rayMoveY + launchInfo.dims + 159 }, ease: Power2.easeInOut }, 1.1);\n timeline.to(ray3, 0.5, { attr: { x2: rayMoveX + launchInfo.dims + 242, y2: rayMoveY + launchInfo.dims + 159 }, ease: Power2.easeInOut }, 1.1);\n timeline.to(ray4, 0.5, { attr: { x2: rayMoveX + launchInfo.dims * 0.5 + 167 }, ease: Power2.easeInOut }, 1.1);\n timeline.to(ray5, 0.5, { attr: { x2: rayMoveX + launchInfo.dims * 0.5 + 167, y2: rayMoveY + launchInfo.dims + 159 }, ease: Power2.easeInOut }, 1.1);\n timeline.to(ray6, 0.5, { attr: { y2: rayMoveY + launchInfo.dims * 0.5 + 80 }, ease: Power2.easeInOut }, 1.1);\n timeline.to(ray7, 0.5, { attr: { x2: rayMoveX + launchInfo.dims + 242, y2: rayMoveY + launchInfo.dims * 0.5 + 80 }, ease: Power2.easeInOut }, 1.1);\n } else if (side === 'right') {\n timeline.to(ray0, 0.5, { attr: { x2: rayMoveX + launchInfo.dims - 318 }, ease: Power2.easeInOut }, 1.1);\n // ray1 stays\n timeline.to(ray2, 0.5, { attr: { x2: rayMoveX + launchInfo.dims - 318, y2: rayMoveY + launchInfo.dims + 159 }, ease: Power2.easeInOut }, 1.1);\n timeline.to(ray3, 0.5, { attr: { y2: rayMoveY + launchInfo.dims + 159 }, ease: Power2.easeInOut }, 1.1);\n timeline.to(ray4, 0.5, { attr: { x2: rayMoveX + launchInfo.dims * 0.5 - 163 }, ease: Power2.easeInOut }, 1.1);\n timeline.to(ray5, 0.5, { attr: { x2: rayMoveX + launchInfo.dims * 0.5 - 163, y2: rayMoveY + launchInfo.dims + 159 }, ease: Power2.easeInOut }, 1.1);\n timeline.to(ray6, 0.5, { attr: { x2: rayMoveX + launchInfo.dims - 318, y2: rayMoveY + launchInfo.dims * 0.5 + 80 }, ease: Power2.easeInOut }, 1.1);\n timeline.to(ray7, 0.5, { attr: { y2: rayMoveY + launchInfo.dims * 0.5 + 80 }, ease: Power2.easeInOut }, 1.1);\n }\n\n // Return Beam to Ghost\n if (side === \"left\") {\n timeline.to(focusBeam, 0.5, { css: { x: \"-100\", y: \"15\", width: \".05em\", height: \".05em\", borderColor: \"none\", backgroundColor: \"none\" }, ease: Power2.easeOut }, 1.6);\n } else if (side === \"right\") {\n timeline.to(focusBeam, 0.5, { css: { x: \"100\", y: \"15\", width: \".05em\", height: \".05em\", borderColor: \"none\", backgroundColor: \"none\" }, ease: Power2.easeOut }, 1.6);\n }\n\n // Return Beam Rays to Ghost\n timeline.to(ray0, .5, { attr: { x2: rayOriginX, y2: rayOriginY }, ease: Power2.easeOut }, 1.6);\n timeline.to(ray1, .5, { attr: { x2: rayOriginX, y2: rayOriginY }, ease: Power2.easeOut }, 1.6);\n timeline.to(ray2, .5, { attr: { x2: rayOriginX, y2: rayOriginY }, ease: Power2.easeOut }, 1.6);\n timeline.to(ray3, .5, { attr: { x2: rayOriginX, y2: rayOriginY }, ease: Power2.easeOut }, 1.6);\n timeline.to(ray4, .5, { attr: { x2: rayOriginX, y2: rayOriginY }, ease: Power2.easeOut }, 1.6);\n timeline.to(ray5, .5, { attr: { x2: rayOriginX, y2: rayOriginY }, ease: Power2.easeOut }, 1.6);\n timeline.to(ray6, .5, { attr: { x2: rayOriginX, y2: rayOriginY }, ease: Power2.easeOut }, 1.6);\n timeline.to(ray7, .5, { attr: { x2: rayOriginX, y2: rayOriginY }, ease: Power2.easeOut }, 1.6);\n\n // timeline.to( ray0, 0, { css: { opacity: 0 } }, 2.1 );\n // timeline.to( ray1, 0, { css: { opacity: 0 } }, 2.1 );\n // timeline.to( ray2, 0, { css: { opacity: 0 } }, 2.1 );\n // timeline.to( ray3, 0, { css: { opacity: 0 } }, 2.1 );\n // timeline.to( ray4, 0, { css: { opacity: 0 } }, 2.1 );\n // timeline.to( ray5, 0, { css: { opacity: 0 } }, 2.1 );\n // timeline.to( ray6, 0, { css: { opacity: 0 } }, 2.1 );\n // timeline.to( ray7, 0, { css: { opacity: 0 } }, 2.1 );\n\n // Reset Beam Position\n timeline.to(focusBeam, 0, { css: { x: \"0\", y: \"0\" } }, 2.1);\n\n } else {\n // Left Slots\n if (i < 5) {\n timeline.to(\n thisSlot,\n 0.25,\n {\n css: { scaleX: 0, transformOrigin: \"0% 50%\" },\n ease: Power2.easeOut\n },\n 0\n );\n\n // Right Slots\n } else {\n timeline.to(\n thisSlot,\n 0.25,\n {\n css: { scaleX: 0, transformOrigin: \"100% 50%\" },\n ease: Power2.easeOut\n },\n 0\n );\n }\n }\n }\n\n // Trigger TypeFocus\n timeline.call(trigger, [side, pos], null, 1.1);\n}", "function Xj(a,b){this.Oc=D(\"div\",\"blocklyToolboxDiv\");this.Oc.setAttribute(\"dir\",q?\"RTL\":\"LTR\");b.appendChild(this.Oc);this.V=new Sh;a.appendChild(this.V.H());v(this.Oc,\"mousedown\",this,function(a){$b(a)||a.target==this.Oc?gg(!1):gg(!0)})}", "function makeEditBoxes(d){\r\n editingPic = d[5]\r\n editingPoly = -1;\r\n update();\r\n}", "function dbatt1(){\n\t\t\troot.batt_1.visible = false;\n\t\t\troot.line_cover_4.visible = true;\n\t\t\troot.line_cover_5.visible = true;\n\t\t\troot.dot_path4_rev.visible = true;\n\t\t\troot.dot_path5_rev.visible = true;\n\t\t}", "function touchdown(w) {\n // pick a random tetra\n var randomTetra = aux_1.Aux.listPickRandom(aux_1.Aux.tetraBlocks);\n w.tetra = randomTetra;\n var newBlocks = bset_1.BSet.blocksUnion(w.tetra.blocks, w.blocks);\n elim_1.Elim.eliminateFullRows(newBlocks);\n w.blocks = newBlocks;\n }", "_setModifierBoxes(measure) {\n measure.voices.forEach((voice) => {\n voice.notes.forEach((smoNote) => {\n const el = this.renderer.svg.getElementById(smoNote.renderId);\n if (el) {\n svgHelpers.updateArtifactBox(this.renderer.svg, el, smoNote, this.scroller);\n // TODO: fix this, only works on the first line.\n smoNote.getModifiers('SmoLyric').forEach((lyric) => {\n if (lyric.getText().length || lyric.isHyphenated()) {\n lyric.selector = '#' + smoNote.renderId + ' ' + lyric.getClassSelector();\n svgHelpers.updateArtifactBox(this.renderer.svg, $(lyric.selector)[0], lyric, this.scroller);\n }\n });\n smoNote.graceNotes.forEach((g) => {\n var gel = this.context.svg.getElementById('vf-' + g.renderedId);\n $(gel).addClass('grace-note');\n svgHelpers.updateArtifactBox(this.renderer.svg, gel, g, this.scroller);\n });\n smoNote.textModifiers.forEach((modifier) => {\n const modEl = $('.' + modifier.attrs.id);\n if (modifier.logicalBox && modEl.length) {\n svgHelpers.updateArtifactBox(this.renderer.svg, modEl[0], modifier, this.scroller);\n }\n });\n }\n });\n });\n }", "SetBoardClicked (nn) //TODO: redundant drag effects and calculations to be removed, make it HTML5 compatible\r\n {\r\n try\r\n {\r\n if (! this.xdocument.BoardForm) return;\r\n if (! this.xdocument.images[this.ImageOffset].style) { this.BoardClicked = nn; return; }\r\n if (this.CandidateStyle != \"\") this.HighlightCandidates(nn, this.CandidateStyle);\r\n if (this.isDragDrop) { this.BoardClicked = nn; return; }\r\n //if (this.BoardClicked >= 0) //really needed styles processing?\r\n //{\r\n // if (this.BoardClicked < 64)\r\n // {\r\n // if (isRotated)\r\n // this.xdocument.images[this.ImageOffset + 63 - this.BoardClicked].style.borderColor = this.BorderColor;\r\n // else\r\n // this.xdocument.images[this.ImageOffset + this.BoardClicked].style.borderColor = this.BorderColor;\r\n // }\r\n // else this.xdocument.images[this.ImageOffset + this.BoardClicked + 3].style.borderColor = this.BorderColor;\r\n //}\r\n this.BoardClicked = nn;\r\n //if (this.BoardClicked >= 0)\r\n //{\r\n // if (this.BoardClicked < 64)\r\n // {\r\n // if (isRotated)\r\n // this.xdocument.images[this.ImageOffset + 63 - this.BoardClicked].style.borderColor=\"#FF0000\";\r\n // else\r\n // this.xdocument.images[this.ImageOffset + this.BoardClicked].style.borderColor = \"#FF0000\";\r\n // }\r\n // else this.xdocument.images[this.ImageOffset + this.BoardClicked + 3].style.borderColor = \"#FF0000\";\r\n //}\r\n\r\n } catch (err)\r\n {\r\n throw \"SetBoardClicked (\" + nn + \")>>rethrow error: \" + err + \"\\n\";\r\n }\r\n }", "function Zi(a,b){this.Ub=M(\"div\",\"blocklyToolboxDiv\");this.Ub.setAttribute(\"dir\",x?\"RTL\":\"LTR\");b.appendChild(this.Ub);this.ja=new gi;a.appendChild(this.ja.H());F(this.Ub,\"mousedown\",this,function(a){Lb(a)||a.target==this.Ub?ug(!1):ug(!0)})}", "function setDragElements(obj) {\n\n var move = function (dx, dy) {\n\n var paperScaleX = this.paper.transform().localMatrix.a;\n var paperScaleY = this.paper.transform().localMatrix.d;\n\n this.attr({\n transform: this.data('origTransform') + (this.data('origTransform') ? \"T\" : \"t\") + [dx / paperScaleX, dy / paperScaleY]\n });\n\n //get current coordinates\n var x = this.transform().localMatrix.e;\n var y = this.transform().localMatrix.f;\n\n // check if new x or y is out of the box\n\n var o = this.select(\"#r\");\n //console.log(o);\n\n var width = o.attr(\"width\");\n var height = o.attr(\"height\");\n var maxX = this.paper.attr(\"width\");\n var maxY = this.paper.attr(\"height\");\n\n if (x < 0) x = 0;\n if (x >= (maxX - width)) x = (maxX - width);\n\n\n if (y < 0) y = 0;\n if (y >= (maxY - height)) y = (maxY - height);\n //console.log(\"x:\" + x + \" y:\" + y);\n //console.log(\"maxX:\" + maxX + \" maxY:\" + maxY);\n //console.log(\"height:\" + height + \" maxYwidth:\" + width);\n //console.log(\"SnapX:\"+xSnap+\" SnapY:\"+ ySnap);\n\n\n //console.log(\"x:\" + x + \" y:\" + y);\n this.transform(\"t\" + x + \",\" + y);\n\n // set dropzone\n var xSnap = Snap.snapTo(gridsize, x, 100000);\n var ySnap = Snap.snapTo(gridsize, y, 100000);\n //console.log(\"x:\" + x + \" y:\" + y);\n //console.log(\"dx:\" + dx + \" dy:\" + dy);\n //console.log(\"SnapX:\"+xSnap+\" SnapY:\"+ ySnap);\n\n var s = getSnap();\n var tmp = s.select(\".dropzone\");\n tmp.attr({\n stroke: \"#eee\",\n strokeWidth: 1,\n fill: \"#eee\",\n })\n $(tmp).show();\n tmp.transform(\"t\" + xSnap + \",\" + ySnap);\n\n //console.log(\"-----------------------------\");\n //console.log(this.transform().localMatrix);\n //console.log(tmp.transform().localMatrix);\n }\n\n var start = function () {\n console.log(\"start drag\");\n this.paper.undrag();\n this.data('origTransform', this.transform().local);\n\n getSnap().append(this);\n\n createTmpRec(this);\n\n }\n\n var stop = function (e) {\n\n var x = this.transform().localMatrix.e;\n var y = this.transform().localMatrix.f;\n\n\n var xSnap = Snap.snapTo(gridsize, x, 100000);\n var ySnap = Snap.snapTo(gridsize, y, 100000);\n\n this.attr({\n transform: \"martix(1,0,0,1,\" + xSnap + \",\" + ySnap + \")\"\n })\n\n //console.log(this.transform().localMatrix.e + 'x' + this.transform().localMatrix.f);\n //this.paper.drag();\n\n //remove tmp rectangle\n //var tmp = getSnap().select(\"#dropzone\");\n //tmp.remove();\n\n $(\".dropzone\").remove();\n\n detectNeighbors(this);\n }\n\n obj.drag(move, start, stop);\n\n}", "getLayout(viewId, elementId, elementType, widgetTime, stateTime, mode, attributes) {\n\n if ((viewId == \"Tutorial1\") || (viewId == \"Tutorial2\") || (viewId == \"Tutorial3\") ||\n (viewId == \"TutorialMove1\") || (viewId == \"TutorialMove2\") || (viewId==\"TutorialMove3\")) {\n\n if (elementId == \"background\") return { x: 0, y: 0, width: this.width, height: this.height };\n else if (elementType == \"video\") return { x: this.circleX - this.circleRadius, y: this.circleY - this.circleRadius, width: this.circleRadius * 2, height: this.circleRadius * 2 };\n else if (elementId == \"tip\") return { x: 0, y: this.height * 0.75, width: this.width, height: this.height * 0.10 };\n else if (elementId == \"tip_detail\") return { x: 0, y: this.height * 0.82, width: this.width, height: this.height * 0.10 };\n else if (elementId == \"button_skip\") return { x: 0, y: this.height - this.buttonHeight, width: this.width / 2, height: this.buttonHeight };\n else if (elementId == \"button_back\") return { x: 0, y: this.height - this.buttonHeight, width: this.width / 2, height: this.buttonHeight };\n else if (elementId == \"button_next\") return { x: this.width / 2, y: this.height - this.buttonHeight, width: this.width / 2, height: this.buttonHeight };\n else if (elementId == \"button_done\") return { x: this.width / 2, y: this.height - this.buttonHeight, width: this.width / 2, height: this.buttonHeight };\n else if (elementId == \"button_exit\") {\n var content = this.rm.getSetupResourceId(viewId, elementId, this.landscape, \"value\");\n var img = this.rm.getImage(content);\n var imgScaleFactor = (this.canvasSizeFactor) * this.rm.getImageScale();\n var imgWidth = img.width * imgScaleFactor;\n var imgHeight = img.height * imgScaleFactor;\n return { x: this.width - imgWidth - 30, y: 0, width: imgWidth + 30, height: imgHeight + 30 };\n }\n else if (elementId==\"liveness_move\") {\n return { x: this.circleX - this.circleRadius, y: this.circleY - this.circleRadius, width: this.circleRadius * 2, height: this.circleRadius * 2 };\n }\n\n } else {\n if (elementId == \"background\") return { x: 0, y: 0, width: this.width, height: this.height };\n else if (elementId == \"tip_video\") return { x: this.circleX - this.circleRadius, y: this.circleY - this.circleRadius, width: this.circleRadius * 2, height: this.circleRadius * 2 };\n else if (elementId == \"imageError\") return { x: this.circleX - this.circleRadius, y: this.circleY - this.circleRadius, width: this.circleRadius * 2, height: this.circleRadius * 2 };\n else if (elementId == \"video_success\") return { x: this.circleX - this.circleRadius, y: this.circleY - this.circleRadius, width: this.circleRadius * 2, height: this.circleRadius * 2 };\n else if (elementId == \"extraction_video\") return { x: this.width / 2 - this.width * 0.1, y: this.height * 0.73, width: this.width * 0.2, height: this.width * 0.2 };\n else if (elementId == \"tip\") return { x: 0, y: this.height * 0.75, width: this.width, height: this.height * 0.10 };\n else if (elementId == \"text_error\") return { x: 0, y: this.height * 0.75, width: this.width, height: this.height * 0.10 };\n else if (elementId == \"text\") {\n return { x: 0, y: this.circleY+this.circleRadius, width: this.width, height: (this.height-this.buttonHeight-10) - (this.circleY+this.circleRadius)};\n //return { x: 0, y: this.height * 0.80, width: this.width, height: this.height * 0.10 };\n }\n else if (elementId == \"tip_detail\") return { x: 0, y: this.height * 0.82, width: this.width, height: this.height * 0.10 };\n else if (elementId == \"button_skip\") return { x: 0, y: this.height - this.buttonHeight, width: this.width / 2, height: this.buttonHeight };\n else if (elementId == \"button_next\") return { x: this.width / 2, y: this.height - this.buttonHeight, width: this.width / 2, height: this.buttonHeight };\n else if (elementId == \"button_done\") return { x: this.width / 2, y: this.height - this.buttonHeight, width: this.width / 2, height: this.buttonHeight };\n else if (elementId == \"button_start\") {\n let w = 209.0*this.canvasSizeFactor;\n return { x: this.width/2 - w/2.0, y: this.height - this.buttonHeight+10, width: w, height: this.buttonHeight-10 };\n }\n else if (elementId == \"button_error\") return { x: this.width / 4, y: this.height - this.buttonHeight+10, width: this.width / 2, height: this.buttonHeight-10 };\n else if (elementId == \"button_back\") return { x: 0, y: this.height - this.buttonHeight, width: this.width / 2, height: this.buttonHeight };\n else if (elementId == \"button_repeat\") return { x: this.width * 0.05, y: this.height - this.buttonHeight, width: this.width * 0.4, height: this.buttonHeight };\n else if (elementId == \"button_finish\") return { x: this.width * 0.55, y: this.height - this.buttonHeight, width: this.width * 0.4, height: this.buttonHeight };\n else if (elementId == \"button_exit\") {\n\n var content = this.rm.getSetupResourceId(viewId, elementId, this.landscape, \"value\");\n var img = this.rm.getImage(content);\n var imgScaleFactor = (this.canvasSizeFactor) * this.rm.getImageScale();\n var imgWidth = img.width * imgScaleFactor;\n var imgHeight = img.height * imgScaleFactor;\n return { x: this.width - imgWidth - 30, y: 0, width: imgWidth + 30, height: imgHeight + 30 };\n }\n else if (elementId == \"button_info\") {\n\n if ((this.extractionMode == FPhi.Selphi.Mode.Register) ||\n (this.livenessMode != FPhi.Selphi.LivenessMode.None)) {\n var content = this.rm.getSetupResourceId(viewId, elementId, this.landscape, \"value\");\n var img = this.rm.getImage(content);\n var imgScaleFactor = (this.canvasSizeFactor) * this.rm.getImageScale();\n var imgWidth = img.width * imgScaleFactor;\n var imgHeight = img.height * imgScaleFactor;\n return { x: 0, y: 0, width: imgWidth + 30, height: imgHeight + 30 };\n }\n }\n else if (elementId == \"warning\") return { x: 0, y: this.height * 0.89, width: this.width, height: this.height * 0.10 };\n else if (elementId == \"warningTooFar\") return { x: 0, y: this.height * 0.89, width: this.width, height: this.height * 0.10 };\n else if (elementType == \"camera\") return { x: this.circleX - this.circleRadius, y: this.circleY - this.circleRadius, width: this.circleRadius * 2, height: this.circleRadius * 2 };\n else if (elementType == \"results\") return { x: this.circleX - this.circleRadius, y: this.circleY - this.circleRadius, width: this.circleRadius * 2, height: this.circleRadius * 2 };\n else if (elementId == \"liveness_move_text\") {\n //if ((attributes.state == \"UCLivenessMoveStabilizing\") || (attributes.state == \"UCLivenessMoveStabilized\") || (attributes.state == \"UCLivenessMoveDetecting\"))\n if (attributes.state==\"UCLivenessMoveProcessing\" && (stateTime<0.5)) return null;\n return { x: 0, y: this.height * 0.89, width: this.width, height: this.height * 0.10 };\n //else\n // return null;\n }\n else if (elementId == \"liveness_move_tip_text\") {\n return { x: this.circleX - this.circleRadius, y: this.circleY - this.circleRadius*0.39, width: this.circleRadius * 2, height: this.circleRadius * 2 };\n }\n else if (elementId == \"livenessInfo_text\") {\n return { x: 0, y: this.height * 0.89, width: this.width, height: this.height * 0.10 };\n }\n else if (elementId == \"liveness_move\") {\n if ((attributes.state == \"UCLivenessMoveDetecting\") && (stateTime >= 0.25) && (stateTime < 1.75)) {\n var fullscreen = false;\n if (this.rm.isAttributeAvailable(viewId,elementId,this.landscape,\"fullscreen\")) {\n if (this.rm.getSetupResourceId(viewId,elementId,this.landscape,\"fullscreen\") == \"true\")\n fullscreen=true;\n }\n if (fullscreen)\n return { x: 0, y: 0, width: this.width, height:this.height };\n else\n return { x: this.circleX - this.circleRadius, y: this.circleY - this.circleRadius, width: this.circleRadius * 2, height: this.circleRadius * 2 };\n }\n //console.log(viewId);\n return null;\n }\n else if ((elementId == \"liveness_move_left\") || (elementId==\"liveness_move_right\") ||\n (elementId == \"liveness_move_top\") || (elementId==\"liveness_move_bottom\")) {\n \n if ((attributes.state == \"UCLivenessMoveDetecting\") && (stateTime >= 0.25) && (stateTime < 1.75)) {\n if ((attributes.livenessMoveDirection==0) && (elementId!=\"liveness_move_top\"))\n return null;\n if ((attributes.livenessMoveDirection==2) && (elementId!=\"liveness_move_bottom\"))\n return null;\n if ((attributes.livenessMoveDirection==1) && (elementId!=\"liveness_move_right\"))\n return null;\n if ((attributes.livenessMoveDirection==3) && (elementId!=\"liveness_move_left\"))\n return null;\n\n var fullscreen = false;\n if (this.rm.isAttributeAvailable(viewId,elementId,this.landscape,\"fullscreen\")) {\n if (this.rm.getSetupResourceId(viewId,elementId,this.landscape,\"fullscreen\") == \"true\")\n fullscreen=true;\n }\n if (fullscreen)\n return { x: 0, y: 0, width: this.width, height:this.height };\n else\n return { x: this.circleX - this.circleRadius, y: this.circleY - this.circleRadius, width: this.circleRadius * 2, height: this.circleRadius * 2 };\n }\n else\n return null;\n }\n else if (elementId == \"face_searcher\") {\n return { x: 0, y: 0, width: this.width, height:this.height };\n }\n else if (elementId == \"livenessMoveGlasses\") {\n if (attributes.livenessMoveFailReason==0)\n return { x: this.circleX - this.circleRadius, y: this.circleY - this.circleRadius, width: this.circleRadius * 2, height: this.circleRadius * 2 };\n }\n else if (elementId == \"livenessMoveInfo\") {\n if (attributes.livenessMoveFailReason==1)\n return { x: this.circleX - this.circleRadius, y: this.circleY - this.circleRadius, width: this.circleRadius * 2, height: this.circleRadius * 2 };\n }\n else if (elementId==\"progress\") {\n if (attributes.state==\"UCLivenessMoveProcessing\" && (stateTime>this.processingMoveProgressStartTime))\n return {x:this.circleX-this.circleRadius,y:this.height * 0.80,width:this.circleRadius*2.0,height:19};\n }\n }\n //console.log(\"viewId: \"+viewId+\" elementId: \"+elementId);\n return null;\n }", "function customBlocks() {\n\t\t\t\tBlockly.Blocks.fw = {\n\t\t\t\t \tinit: function() {\n\t\t\t\t\t\tthis.appendDummyInput()\n\t\t\t\t\t\t\t.appendField(new Blockly.FieldImage(\n\t\t\t\t\t\t\t\t'../../img/blockly-forwards.png', common.imageSize, common.imageSize));\n\t\t\t\t\t\tthis.setPreviousStatement(true);\n\t \t\t\t\tthis.setNextStatement(true);\n\t\t\t\t\t this.setColour(common.blockColour);\n\t\t\t\t \t},\n\t\t\t\t\tonchange: function(ev) {\n\t\t\t\t\t\tvm.current = 'fw';\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tBlockly.Blocks.rr = {\n\t\t\t\t \tinit: function() {\n\t\t\t\t\t \tthis.appendDummyInput()\n\t\t\t\t\t\t\t.appendField(new Blockly.FieldImage(\n\t\t\t\t\t\t\t\t'../../img/blockly-rotateright.png', common.imageSize, common.imageSize));\n \t\t\t\t\t\tthis.setPreviousStatement(true);\n \t\t\t\t\t\tthis.setNextStatement(true);\n\t\t\t\t\t\tthis.setColour(common.blockColour);\n\t\t\t\t \t},\n\t\t\t\t\tonchange: function(ev) {\n\t\t\t\t\t\tvm.current = 'rr';\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tBlockly.Blocks.rl = {\n\t\t\t\t \tinit: function() {\n\t\t\t\t\t \tthis.appendDummyInput()\n\t\t\t\t\t\t\t.appendField(new Blockly.FieldImage(\n\t\t\t\t\t\t\t\t'../../img/blockly-rotateleft.png', common.imageSize, common.imageSize));\n \t\t\t\t\t\tthis.setPreviousStatement(true);\n \t\t\t\t\t\tthis.setNextStatement(true);\n\t\t\t\t\t\tthis.setColour(common.blockColour);\n\t\t\t\t \t},\n\t\t\t\t\tonchange: function(ev) {\n\t\t\t\t\t\tvm.current = 'rl';\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tBlockly.Blocks.lt = {\n\t\t\t\t \tinit: function() {\n\t\t\t\t\t \tthis.appendDummyInput()\n\t\t\t\t\t\t\t.appendField(new Blockly.FieldImage(\n\t\t\t\t\t\t\t\t'../../img/blockly-lightbulb.png', common.imageSize, common.imageSize));\n \t\t\t\t\t\tthis.setPreviousStatement(true);\n \t\t\t\t\t\tthis.setNextStatement(true);\n\t\t\t\t\t\tthis.setColour(common.blockColour);\n\t\t\t\t \t},\n\t\t\t\t\tonchange: function(ev) {\n\t\t\t\t\t\tvm.current = 'lt';\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tBlockly.Blocks.start = {\n\t\t\t\t\tinit: function() {\n\t\t\t\t\t\tthis.appendDummyInput()\n\t\t\t\t\t\t\t.appendField(new Blockly.FieldImage(\n\t\t\t\t\t\t\t\t'../../img/play-button.png', common.imageSize, common.imageSize));\n\t\t\t\t\t\tthis.setPreviousStatement(false);\n\t\t\t\t\t\tthis.setNextStatement(true);\n\t\t\t\t\t\tthis.setColour(65);\n\t\t\t\t\t\tthis.isTopLevel = true;\n\t\t\t\t\t\tthis.setDeletable(false);\n\t\t\t\t\t},\n\t\t\t\t\tonchange: function(ev) {\n\t\t\t\t\t\tvm.current = 'start';\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}", "setupEvents() {\n let $blocks = document.querySelectorAll(`.block`);\n //Yuk....Apolgies, I neevr usually do the whole var that = this thing, I dont like it, but for this purpose it works. \n let that = this;\n let listener = function (ev) {\n var blockObj = {\n x: this.getAttribute('xpos'),\n y: this.getAttribute('ypos'),\n colour: this.style.backgroundColor\n }\n that.blockClicked(ev, blockObj);\n };\n\n for (let i = $blocks.length - 1; i >= 0; i--) {\n $blocks[i].addEventListener('click', listener, false);\n };\n \n }", "function properties() {\n switch (selectedAnnos.length) {\n case 1:\n // disable\n if(selectedAnnos[0].startsWith('SvgjsLine')){\n $('#li2').parent().addClass('disabled');\n $('#li3').parent().addClass('disabled');\n $('#li1').parent().removeClass('disabled');\n $('#width').removeClass('disabled');\n $('#li1').trigger('click');\n }\n else if(selectedAnnos[0].startsWith('SvgjsRect')){\n if ($('#' + selectedAnnos).attr(\"fill-opacity\") == \"0.4\") {\n $('#li1').parent().addClass('disabled');\n $('#li2').parent().addClass('disabled');\n $('#li3').parent().removeClass('disabled');\n $('#width').addClass('disabled');\n $('#li3').trigger('click');\n }// properties of rect\n else{\n $('#li1').parent().removeClass('disabled');\n $('#li2').parent().removeClass('disabled');\n $('#li1').trigger('click');\n $('#li3').parent().addClass('disabled');\n $('#width').removeClass('disabled');\n }\n }\n $(\"#\" + $('#' + selectedAnnos).attr(\"stroke\")).prop(\"checked\", true);\n $(textExample.WIDTH).val($('#' + selectedAnnos).attr(\"stroke-width\"));\n $(\"#1\" + $('#' + selectedAnnos).attr(\"fill\")).prop(\"checked\", true);\n $(\"#2\" + $('#' + selectedAnnos).attr(\"fill\")).prop(\"checked\", true);\n\n $(\"#myModalLine\").modal();\n break;\n case 2:\n //cut xong paste thi rect lai trc text\n if ($('#' + selectedAnnos).attr('class')=='textDraw') {\n var textId = \"#\" + selectedAnnos[1];\n $(textExample.COMMENTTEXT).val($(textId).text());\n $(textExample.COMMENTTEXT).css(\"font-family\", $(textId).attr(\"font-family\"));\n $(\"#color\").val(selectOptionByText(\"#color\", $(textId).attr(\"fill\")));\n $(\"#fill\").val(selectOptionByText(\"#fill\", $(\"#\" + selectedAnnos).attr(\"fill\")));\n $(\"#border\").val(selectOptionByText(\"#border\", $(\"#\" + selectedAnnos).attr(\"stroke\")));\n $(\"#font\").val(selectOptionByText(\"#font\", $(textId).attr(\"font-family\")));\n $(\"#fontSize\").val(selectOptionByText(\"#fontSize\", $(textId).attr(\"font-size\")));\n if ($(textId).attr(\"font-style\") == \"italic\") {\n if ($(textId).attr(\"font-weight\") == \"bold\") {\n $(\"#fontStyle\").val(\"boldItalic\");\n $(textExample.COMMENTTEXT).css(\"font-style\", \"italic\");\n $(textExample.COMMENTTEXT).css(\"font-weight\", \"bold\");\n } else {\n $(\"#fontStyle\").val(\"italic\");\n $(textExample.COMMENTTEXT).css(\"font-style\", \"italic\");\n $(textExample.COMMENTTEXT).css(\"font-weight\", \"\");\n }\n } else {\n if ($(textId).attr(\"font-weight\") == \"bold\") {\n $(\"#fontStyle\").val(\"bold\");\n $(textExample.COMMENTTEXT).css(\"font-weight\", \"bold\");\n $(textExample.COMMENTTEXT).css(\"font-style\", \"\");\n } else {\n $(\"#fontStyle\").val(\"normal\");\n $(textExample.COMMENTTEXT).css(\"font-style\", \"\");\n $(textExample.COMMENTTEXT).css(\"font-weight\", \"\");\n }\n }\n $(\"#myModalText\").modal();\n break;\n }\n else if ($('#' + selectedAnnos).attr('id').startsWith('SvgjsImage')) {\n $(\"#commentTxtArea\").val($('#' + selectedAnnos[1]).attr('value'));\n $(\"#tbComment\").val($('#' + selectedAnnos[1])[0].textContent);\n $(\"#myModalComment\").modal();\n break;\n }\n modalLineProperties();\n break;\n default:\n $('#li1').parent().removeClass('disabled');\n $('#li2').parent().removeClass('disabled');\n $('#li3').parent().removeClass('disabled');\n $('#width').removeClass('disabled');\n $('#li1').trigger('click');\n modalLineProperties();\n break;\n }\n}", "function avdElmScrBlk()\n {\n this.ruleID = 'avdElmScrBlk';\n }", "function inputChecks(thisObj) {\n\n\t if ($('input[id=\"keyringBlock\"]').val() > 0) {\n thisObj.find(\".frame_upsell_wrapper\").append(keyringBlock);\n\t }\n\t if ($('input[id=\"photoBlock\"]').val() > 0) {\n\t thisObj.find(\".frame_upsell_wrapper\").append(photoblockBlock);\n\t }\n\t if ($('input[id=\"magnetBlock\"]').val() > 0) {\n\t thisObj.find(\".frame_upsell_wrapper\").append(magnetBlock);\n\t }\n\t if ($('input[id=\"cushionBlock\"]').val() > 0) {\n\t thisObj.find(\".frame_upsell_wrapper\").append(cushionBlock);\n\t }\n\t}", "function GtBlock()\r\n{\r\n this.objectName = \"Gt\";\r\n\tthis.text=\"GT\";\r\n}", "onLoad() {\n this.gui_builder = this.node.getChildByName(\"gui_builder\");\n\n this.mask = this.gui_builder.getChildByName(\"mask\");\n this.mask.on(cc.Node.EventType.TOUCH_START, this.hide_tower_builder, this);\n\n // 4个塔的按钮\n this.build_arrow_icon = this.gui_builder.getChildByName(\"build_arrow_icon\");\n this.build_arrow_icon.tower_type = Tower_Type.ARROW;\n this.build_arrow_icon.on(cc.Node.EventType.TOUCH_START, this.on_tower_build_click, this);\n\n this.build_bing_icon = this.gui_builder.getChildByName(\"build_bing_icon\");\n this.build_bing_icon.tower_type = Tower_Type.BING;\n this.build_bing_icon.on(cc.Node.EventType.TOUCH_START, this.on_tower_build_click, this);\n\n this.build_fasi_icon = this.gui_builder.getChildByName(\"build_fasi_icon\");\n this.build_fasi_icon.tower_type = Tower_Type.FASHI;\n this.build_fasi_icon.on(cc.Node.EventType.TOUCH_START, this.on_tower_build_click, this);\n\n this.build_zd_icon = this.gui_builder.getChildByName(\"build_zd_icon\");\n this.build_zd_icon.tower_type = Tower_Type.PAO;\n this.build_zd_icon.on(cc.Node.EventType.TOUCH_START, this.on_tower_build_click, this);\n\n this.gui_builder.active = false;\n\n // 升级和撤销塔\n this.gui_undo = this.node.getChildByName(\"gui_undo\");\n\n this.gui_undo_mask = this.gui_undo.getChildByName(\"mask\");\n this.gui_undo_mask.on(cc.Node.EventType.TOUCH_START, this.hide_tower_builder, this);\n\n this.btn_undo = this.gui_undo.getChildByName(\"undo\");\n this.btn_undo.on(cc.Node.EventType.TOUCH_START, this.on_tower_undo_click, this);\n\n this.btn_upgrade = this.gui_undo.getChildByName(\"upgrade\");\n this.btn_upgrade.on(cc.Node.EventType.TOUCH_START, this.on_tower_upgrade_click, this);\n this.btn_upgrade.getComponent(cc.Button).interactable = true;\n this.btn_upgrade.getComponent(cc.Button).enableAutoGrayEffect = true;\n\n this.gui_undo.active = false;\n }", "function build(e){var t=prepare(clicked.openWith),n=prepare(clicked.placeHolder),i=prepare(clicked.replaceWith),r=prepare(clicked.closeWith),o=prepare(clicked.openBlockWith),a=prepare(clicked.closeBlockWith),s=clicked.multiline;if(\"\"!==i)block=t+i+r;else if(\"\"===selection&&\"\"!==n)block=t+n+r;else{var l=[e=e||selection],c=[];!0===s&&(l=e.split(/\\r?\\n/));for(var p=0;p<l.length;p++){var u;line=l[p],(u=line.match(/ *$/))?c.push(t+line.replace(/ *$/g,\"\")+r+u):c.push(t+line+r)}block=c.join(\"\\n\")}return block=o+block+a,{block:block,openBlockWith:o,openWith:t,replaceWith:i,placeHolder:n,closeWith:r,closeBlockWith:a}}", "function PaintPointsActions() {\n var nom, item, topMargin;\n topMargin = 60; //initial value of topMargin for the first box. This value will increment +50px for each box of the jsplumb.\n var x = o.BlocAssembly.AllPoints.ProcessPoint;\n document.getElementById(\"diagramcontainer\").innerHTML = \"\";\n for (i = 0; i < x.length; i++) {\n esdelbloc = CompareProcessPointWithPointReferencesBloc(x[i][\"@Id\"]); //compara l'id del ProcessPoint que vaig a pintar, amb els ids del PointReferences del Bloc on estem. Si està, retorna true\n if (esdelbloc == true) {\n nom = \"nom\" + i;\n id = x[i][\"@Id\"];\n item = \"item\" + id;\n document.getElementById(\"diagramcontainer\").innerHTML += \"<div id='\" + item + \"' class='itemActions' style='top:\" + topMargin + \"px;' onclick='OnClickPoint_Actions(this.id)' ><strong><p id='\" + nom + \"'></p></strong></div>\";\n document.getElementById(nom).innerHTML = x[i].Alias;\n topMargin += 50;\n }\n }\n}", "function drawelements() {\n\t// show state\n\tif (showstate) {\n\t\t//eoutstateman.firstChild.nodeValue = \"State \" + state;\n\t\tprintareadraw(eoutstateman,\"State \" + statelist.indexOf(state));\n\t}\n\t\n\t// show scroll\n\tif (showscroll) {\n\t\t//escroll.firstChild.nodeValue = \n\t\t//\t\" sclvel = \" + scrollvelx + \",\" + scrollvely + \" scl = \" + scrollx + \",\" + scrolly;\n\t\tprintareadraw(escroll,\"sclvel = \" + scrollvelx + \",\" + scrollvely + \" scl = \" + scrollx + \",\" + scrolly);\n\t}\n\t\t\n\t// show much stuff\n\tif (showprint) {\n\t\tvar maxsize = 300;\n\t\t// show keystate\n\t\tvar ks = \"keystate = \";\n\t\tvar len = input.keystate.length;\n\t\tvar i;\n\t\tfor (i=0;i<len;++i) {\n\t\t\tif (input.keystate[i])\n\t\t\t\tks += i.toString(16) + \" \";\n\t\t}\n\t\t//eoutkeystate.firstChild.nodeValue = ks;\n\t\tprintareadraw(eoutkeystate,ks);\n\t\t\n\t\t// show input\n\t\t//eoutinputstate.firstChild.nodeValue = \"inputstate = mx \" + input.mx + \" my \" + input.my + \" mbut \" + input.mbut + \" mclick \" + input.mclick + \" key \" + input.key;\n\t\tprintareadraw(eoutinputstate,\"inputstate = mx \" + input.mx + \" my \" + input.my + \" mbut \" + input.mbut + \" mwheel \" + \n\t\tinput.wheelPos + \" mclick0 \" + input.mclick[0] + \" mclick1 \" + input.mclick[1] + \" mclick2 \" + \n\t\tinput.mclick[2] + \" key \" + input.key.toString(16) + \" keybufflen \" + input.keybuff.length);\n\t\t\n\t\t// show inputevents\n\t\tif (inputevents.length > maxsize) {\n\t\t\tinputevents = inputevents.substr(inputevents.length-maxsize,maxsize);\n\t\t}\n\t\t//eoutinputevents.firstChild.nodeValue = inputevents;\n\t\tprintareadraw(eoutinputevents,inputevents);\n\t\t\n\t\t// show logger\n/*\t\tif (logger_str.length > maxsize) {\n//\t\t\tlogger_str = logger_str.substr(logger_str.length-maxsize,maxsize);\n\t\t} */\n\t\t//eoutlogger.outerHTML = \"Howdy!\";\n\t\t//eoutlogger.firstChild.nodeValue = logger_str;\n\t\tif (logmode)\n\t\t\tprintareadraw(eoutlogger,logger_str);\n\t\telse {\n\t\t\tprintareadraw(eoutlogger,\"logger disabled\");\n\t\t\tlogger_str = \"\";\n\t\t}\n\t}\n\t\n\t// show image cache\n/*\tvar str = \"\";\n\tfor (var nam in imagecacher) {\n\t\tstr += \"C[\" + nam + \"] = \" + imagecacher[nam].size+ \",\";\t\n\t} */\n}", "function Pj(a,b){this.Wd=u(\"div\",\"blocklyToolboxDiv\");this.Wd.setAttribute(\"dir\",q?\"RTL\":\"LTR\");b.appendChild(this.Wd);this.Sa=new Te;a.appendChild(this.Sa.Aa());C(this.Wd,\"mousedown\",this,function(a){ae(a)||a.target==this.Wd?ee(!1):ee(!0)})}", "_initElements(respack) {\n let tempPart;\n\n for (let rowId = 0; rowId < this.blocksData.length; rowId++) {\n for (let colId = 0; colId < this.blocksData[rowId].length; colId++) {\n if (this.blocksData[rowId][colId] > 0) {\n tempPart = new PIXI.Sprite(respack[`block_${this.config.color}`]);\n tempPart.visible = false;\n this.blocks.push(this.container.addChild(tempPart));\n }\n }\n }\n }", "static partCreateUpdateFieldVisibility(context, controls) {\n\n let onlineSearch = libThis.isOnlineSearch(context);\n\n\n //Text item\n if (libThis.evalIsTextItem(context, controls) && onlineSearch === false) {\n if (controls.TextItemSim) controls.TextItemSim.setVisible(true);\n if (controls.MaterialLstPkr) controls.MaterialLstPkr.setVisible(false);\n if (controls.MaterialUOMLstPkr) controls.MaterialUOMLstPkr.setVisible(false);\n if (controls.UOMSim) controls.UOMSim.setVisible(false);\n //Material item\n } else {\n if (controls.TextItemSim) controls.TextItemSim.setVisible(false);\n if (controls.MaterialLstPkr) controls.MaterialLstPkr.setVisible(true);\n if (controls.MaterialUOMLstPkr) controls.MaterialUOMLstPkr.setVisible(true);\n if (controls.UOMSim) controls.UOMSim.setVisible(false);\n if (controls.StorageLocationLstPkr) {\n controls.StorageLocationLstPkr.setVisible(libThis.isOnlineSearch(context));\n controls.StorageLocationLstPkr.setValue('');\n }\n if (controls.material) {\n controls.material.setValue('');\n controls.material.setVisible(libThis.isOnlineSearch(context));\n }\n if (controls.materialDesc) {\n controls.materialDesc.setVisible(libThis.isOnlineSearch(context));\n controls.materialDesc.setValue('');\n\n }\n }\n ///Enable and disable controls for text or Stock items coming from Error archive\n if (libCom.isDefined(context.evaluateTargetPathForAPI('#Page:-Previous').getClientData().FromErrorArchive) || libCom.isDefined(context.evaluateTargetPathForAPI('#Page:-Previous').getClientData().ErrorObject)) {\n if (libCom.isDefined(context.binding)) {\n ////Check for TextItem\n if (context.binding.ItemCategory === libCom.getAppParam(context, 'PART', 'TextItemCategory')) {\n if (controls.TextItemSim) controls.TextItemSim.setVisible(true);\n if (controls.MaterialLstPkr) controls.MaterialLstPkr.setVisible(false);\n if (controls.MaterialUOMLstPkr) controls.MaterialUOMLstPkr.setVisible(false);\n if (controls.UOMSim) controls.UOMSim.setVisible(false);\n if (controls.StorageLocationLstPkr) controls.StorageLocationLstPkr.setVisible(libThis.isOnlineSearch(context));\n if (controls.material) controls.material.setVisible(libThis.isOnlineSearch(context));\n if (controls.materialDesc) controls.materialDesc.setVisible(libThis.isOnlineSearch(context)); \n } else {\n if (controls.TextItemSim) controls.TextItemSim.setVisible(false);\n if (controls.MaterialLstPkr) controls.MaterialLstPkr.setVisible(true);\n if (controls.MaterialUOMLstPkr) controls.MaterialUOMLstPkr.setVisible(true);\n if (controls.UOMSim) controls.UOMSim.setVisible(false);\n if (controls.StorageLocationLstPkr) controls.StorageLocationLstPkr.setVisible(libThis.isOnlineSearch(context));\n if (controls.material) controls.material.setVisible(libThis.isOnlineSearch(context));\n if (controls.materialDesc) controls.materialDesc.setVisible(libThis.isOnlineSearch(context));\n }\n }\n }\n }", "function LtBlock()\r\n{\r\n this.objectName = \"Lt\";\r\n\tthis.text=\"LT\";\r\n}", "function draw() {\n //check if mouse is on item\n if(currentState ===`inspection`){\n //calculates the distance between mouse and items\n let distRemote = dist(mouseX,mouseY,item_remote.x,item_remote.y);\n let distAc = dist(mouseX,mouseY,item_ac.x,item_ac.y);\n let distpenpen = dist(mouseX,mouseY,item_penpen.x,item_penpen.y);\n let distPictureBoard = dist(mouseX,mouseY,item_pictureBoard.x,item_pictureBoard.y);\n if (distRemote <=20\n && inItemDialogue === false\n && itemChecklist.acRemote_Checked ===false){\n cursor(CROSS);\n currentItem = `acRemote`;\n if (mouseIsPressed){\n inItemDialogue = true;\n }\n }else if(distAc <=40\n && inItemDialogue === false\n && itemChecklist.ac_Checked ===false) {\n cursor(CROSS);\n currentItem = `ac`;\n if (mouseIsPressed){\n inItemDialogue = true;\n }\n }else if(distpenpen <= 30\n && inItemDialogue === false\n && itemChecklist.penpen_Checked ===false){\n cursor(CROSS);\n currentItem = `penpen`;\n if (mouseIsPressed){\n inItemDialogue = true;\n }\n }else if(distPictureBoard <= 40\n && inItemDialogue === false\n && itemChecklist.pictureBoard_Checked ===false){\n cursor(CROSS);\n currentItem = `pictureBoard`;\n if (mouseIsPressed){\n inItemDialogue = true;\n }\n }else{\n cursor(ARROW);\n }\n }\n}", "function update() {\n //var snap = snap.prop(\"checked\"), liveSnap = $liveSnap.prop(\"checked\");\n Draggable.create('.box', {\n bounds: container,\n edgeResistance: 0.65,\n type: 'x,y',\n throwProps: true,\n liveSnap: liveSnap,\n snap: {\n x: function (endValue) {\n return snap || liveSnap ? Math.round(endValue / gridWidth) * gridWidth : endValue;\n },\n y: function (endValue) {\n return snap || liveSnap ? Math.round(endValue / gridHeight) * gridHeight : endValue;\n }\n }\n });\n }", "clickHandler (event) {\n const { target } = event\n if (target && target[BLOCK_DOM_PROPERTY] === this) {\n const lastChild = this.lastChild\n const lastContentBlock = lastChild.lastContentInDescendant()\n const { clientY } = event\n const lastChildDom = lastChild.domNode\n const { bottom } = lastChildDom.getBoundingClientRect()\n if (clientY > bottom) {\n if (lastChild.blockName === 'paragraph' && lastContentBlock.text === '') {\n lastContentBlock.setCursor(0, 0)\n } else {\n const state = {\n name: 'paragraph',\n text: ''\n }\n const newNode = ScrollPage.loadBlock(state.name).create(this.muya, state)\n this.append(newNode, 'user')\n const cursorBlock = newNode.lastContentInDescendant()\n cursorBlock.setCursor(0, 0, true)\n }\n }\n }\n }", "function load_scratchblockcode () {\n if (GM_getValue(\"blockCode\", true)) {\n if (document.querySelector(\".blocks\")) {\n let blocks = [], blocks1 = [], blocks2 = [], blocks3 = [];\n console.log(\"contains scratch blocks\");\n let xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = () => {\n if (xhttp.status == 200 && xhttp.readyState == 4) {\n let doc = xhttp.responseXML;\n //only do the elements in post body html\n let posts = document.getElementsByClassName(\"post_body_html\");\n let posts1 = doc.getElementsByClassName(\"post_body_html\");\n for (let a of posts) {\n if (a.querySelector(\".blocks\")) {\n for (let l = 0; l < a.getElementsByClassName(\"blocks\").length; l++) {\n blocks.push(a.querySelectorAll(\".blocks\")[l]);\n }\n }\n }\n for (let a of posts1) {\n if (a.querySelector(\".blocks\")) {\n for (let l = 0; l < a.getElementsByClassName(\"blocks\").length; l++) {\n blocks1.push(a.querySelectorAll(\".blocks\")[l]);\n }\n }\n }\n if (blocks.length > 0) {\n for (let i = 0; i < blocks1.length; i++) {\n blocks[i].setAttribute(\"id\", i);\n blocks[i].setAttribute(\"style\", \"cursor: pointer;\");\n blocks[i].addEventListener(\"click\", (event) => {\n let target = event.currentTarget;\n target.parentElement.replaceChild(blocks1[target.id], blocks[target.id]);\n }, false);\n }\n }\n //do elements for signatures\n posts = document.getElementsByClassName(\"postsignature\");\n posts1 = doc.getElementsByClassName(\"postsignature\");\n for (let a of posts) {\n if (a.querySelector(\".blocks\")) {\n for (let l = 0; l < a.getElementsByClassName(\"blocks\").length; l++) {\n blocks2.push(a.querySelectorAll(\".blocks\")[l]);\n }\n }\n }\n for (let a of posts1) {\n if (a.querySelector(\".blocks\")) {\n for (let l = 0; l < a.getElementsByClassName(\"blocks\").length; l++) {\n blocks3.push(a.querySelectorAll(\".blocks\")[l]);\n }\n }\n }\n if (blocks2.length > 0) {\n for (let i = 0; i < blocks3.length; i++) {\n blocks2[i].setAttribute(\"id\", i);\n blocks2[i].setAttribute(\"style\", \"cursor: pointer;\");\n blocks2[i].addEventListener(\"click\", (event) => {\n let target = event.currentTarget;\n target.parentElement.replaceChild(blocks3[target.id], blocks2[target.id]);\n }, false);\n }\n }\n console.log(\"Finished ScratchBlocks\");\n }\n };\n xhttp.open(\"GET\", url, true);\n xhttp.responseType = \"document\";\n xhttp.send(null);\n }\n }\n }", "function Element()\n{\n\tthis.types=!this.types?[]:this.types;//Types of the element\n\tthis.id=0;\t\t\t\t\t\t\t//Id of the element\n\tthis.x=0;\t\t\t\t\t\t\t//Abscissa\n\tthis.y=0;\t\t\t\t\t\t\t//Ordinate\n\tthis.xstart=0;\t\t\t\t\t\t//Start abscissa\n\tthis.ystart=0;\t\t\t\t\t\t//Start ordinate\n\tthis.xprev=0;\t\t\t\t\t\t//Abscissa on the previous step\n\tthis.yprev=0;\t\t\t\t\t\t//Ordinate on the previous step\n\tthis.vspeed=0;\t\t\t\t\t\t//Vertical speed\n\tthis.hspeed=0;\t\t\t\t\t\t//Horizontal speed\n\tthis.visible=true;\t\t\t\t\t//Is the element visible?\n\tthis.opacity=100;\t\t\t\t\t//Opacity of the element (0=transparent ; 100=opaque)\n\tthis.rotate=0;\t\t\t\t\t\t//Rotation of the element\n\tthis.zIndex=1;\t\t\t\t\t\t//Depth of the element \n\tthis.centerRotateX=0;\t\t\t\t//Abscissa of the center of rotation\n\tthis.centerRotateY=0;\t\t\t\t//Ordinate of the center of rotation\n\tthis.sprite=new Sprite(null,0,0);\t//Sprite of the element\n\tthis.gravity=0;\t\t\t\t\t\t//Gravity applied on the element\n\tthis.draws=[];\t\t\t\t\t\t//Array storing the graphics elements to draw\n\tthis.active=true;\t\t\t\t\t//Is the element active?\n\tthis.switchPositionWhenLeave=false;\t//Is the element teleported when it leaves the screen?\n\tthis.collideSolid=true;\t\t\t\t//Do we need to check precise collisions with solids objects?\n\tthis.solid=false;\t\t\t\t\t//Is the element a solid one?\n\tthis.moveToPointCallBack={};\t\t//JSON containing the function to call via moveToPoint()\n\tthis.alarm1=0;\t\t\t\t\t\t//Time to wait before the event for alarm 1 is triggered\n\tthis.alarm2=0;\t\t\t\t\t\t//Time to wait before the event for alarm 2 is triggered\n\tthis.alarm3=0;\t\t\t\t\t\t//Time to wait before the event for alarm 3 is triggered\n\tthis.alarm4=0;\t\t\t\t\t\t//Time to wait before the event for alarm 4 is triggered\n\tthis.alarm5=0;\t\t\t\t\t\t//Time to wait before the event for alarm 5 is triggered\n\tthis.alarm6=0;\t\t\t\t\t\t//Time to wait before the event for alarm 6 is triggered\n\tthis.alarm7=0;\t\t\t\t\t\t//Time to wait before the event for alarm 7 is triggered\n\tthis.alarm8=0;\t\t\t\t\t\t//Time to wait before the event for alarm 8 is triggered\n\tthis.alarm9=0;\t\t\t\t\t\t//Time to wait before the event for alarm 9 is triggered\n\tthis.alarm10=0;\t\t\t\t\t\t//Time to wait before the event for alarm 10 is triggered\n\tthis.state=0;\t\t\t\t\t\t//State of the element (defined below)\n\t\n\tif(Element.isLoaded==undefined)\n\t{\n\t\tElement.isLoaded=true;\t\t\t//The class is correctly loaded\n\t\tElement.STATE_STAND=0;\t\t\t\t\n\t\tElement.STATE_STAND_LEFT=1;\t\t\t\n\t\tElement.STATE_STAND_RIGHT=2;\t\t\n\t\tElement.STATE_STAND_UP=3;\t\t\t\n\t\tElement.STATE_STAND_UP_LEFT=4;\t\t\n\t\tElement.STATE_STAND_UP_RIGHT=5;\t\t\n\t\tElement.STATE_STAND_DOWN=6;\t\t\t\n\t\tElement.STATE_STAND_DOWN_LEFT=7;\t\n\t\tElement.STATE_STAND_DOWN_RIGHT=8;\t\n\t\tElement.STATE_MOVE=9;\t\t\t\t\n\t\tElement.STATE_MOVE_RIGHT=10;\t\t\n\t\tElement.STATE_MOVE_LEFT=11;\t\t\t\n\t\tElement.STATE_MOVE_UP=12;\t\t\t\n\t\tElement.STATE_MOVE_UP_LEFT=13;\t\t\n\t\tElement.STATE_MOVE_UP_RIGHT=14;\t\t\n\t\tElement.STATE_MOVE_DOWN=15;\t\t\t\n\t\tElement.STATE_MOVE_DOWN_LEFT=16;\t\n\t\tElement.STATE_MOVE_DOWN_RIGHT=17;\t\n\t\tElement.STATE_HURT=18;\t\t\t\t\n\t\tElement.STATE_HURT_LEFT=19;\t\t\t\n\t\tElement.STATE_HURT_RIGHT=20;\t\t\n\t\tElement.STATE_HURT_UP=21;\t\t\t\n\t\tElement.STATE_HURT_DOWN=22;\t\t\t\n\t\tElement.STATE_DEATH=23;\t\t\t\t\n\t\tElement.STATE_DEATH_LEFT=24;\t\t\n\t\tElement.STATE_DEATH_RIGHT=25;\t\t\n\t\tElement.STATE_DEATH_UP=26;\t\t\t\n\t\tElement.STATE_DEATH_DOWN=27;\t\t\n\n\t\t/*====================================================*/\n\t\t/*================ Internal methods ==================*/\n\t\t/*====================================================*/\n\n\t\t/*== Method moving the element ==*/\n\t\tElement.prototype.move=function()\n\t\t{\n\t\t\tthis.x+=this.hspeed;\n\t\t\tthis.vspeed+=this.gravity;\n\t\t\tthis.y+=this.vspeed;\n\t\t\t\n\t\t\tif(this.collideSolid)\n\t\t\t{\n\t\t\t\t//If we are on a solid element, we change the position\n\t\t\t\tvar thisMask=this.sprite.getMask(),\n\t\t\t\ts=Game.placeIsFree(this.x+thisMask.x,this.y+thisMask.y,thisMask.width,thisMask.height),\n\t\t\t\tsolids=(s===true?true:(s.length>1?s:(s[0].id==this.id?true:s)));\n\t\t\t\t\n\t\t\t\tif(solids!==true)\n\t\t\t\t{\n\t\t\t\t\tvar dir=this.getDirection();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(dir>0)\n\t\t\t\t\t{\t\t\t\n\t\t\t\t\t\tvar direction=((dir==360)?Element.STATE_MOVE_RIGHT:(dir==90?Element.STATE_MOVE_UP:(dir==180?Element.STATE_MOVE_LEFT:(dir==270?Element.STATE_MOVE_DOWN:((dir>0&&dir<90)?Element.STATE_MOVE_UP_RIGHT:((dir>90&&dir<180)?Element.STATE_MOVE_UP_LEFT:((dir>180&&dir<270)?Element.STATE_MOVE_DOWN_LEFT:Element.STATE_MOVE_DOWN_RIGHT))))))),\n\t\t\t\t\t\ttempX=this.xprev+thisMask.x,\n\t\t\t\t\t\ttempY=this.yprev+thisMask.y;\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile(solids!==true)\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\tif(solids.length>1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ts=this.instanceNearest(Element,thisMask.x,thisMask.y,solids);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ts=solids[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(s.id==this.id){break;}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar otherMask=s.sprite.getMask();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(direction==Element.STATE_MOVE_RIGHT)\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tthis.x=s.x+otherMask.x-thisMask.x-thisMask.width;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(direction==Element.STATE_MOVE_UP)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.y=s.y+otherMask.y+otherMask.height-thisMask.y;\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(direction==Element.STATE_MOVE_LEFT)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.x=s.x+otherMask.x+otherMask.width-thisMask.x;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(direction==Element.STATE_MOVE_DOWN)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.y=s.y+otherMask.y-thisMask.y-thisMask.height;\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(direction==Element.STATE_MOVE_UP_RIGHT)\n\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(tempY>=s.y+otherMask.y+otherMask.height)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tthis.y=s.y+otherMask.y+otherMask.height-thisMask.y;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tthis.x=s.x+otherMask.x-thisMask.x-thisMask.width;\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\telse if(direction==Element.STATE_MOVE_UP_LEFT)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif(tempY>=s.y+otherMask.y+otherMask.height)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tthis.y=s.y+otherMask.y+otherMask.height-thisMask.y;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tthis.x=s.x+otherMask.x+otherMask.width-thisMask.x;\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\telse if(direction==Element.STATE_MOVE_DOWN_LEFT)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif(tempY+thisMask.height<=s.y+otherMask.y)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tthis.y=s.y+otherMask.y-thisMask.y-thisMask.height;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tthis.x=s.x+otherMask.x+otherMask.width-thisMask.x;\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\telse if(direction==Element.STATE_MOVE_DOWN_RIGHT)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif(tempY+thisMask.height<=s.y+otherMask.y)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tthis.y=s.y+otherMask.y-thisMask.y-thisMask.height;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tthis.x=s.x+otherMask.x-thisMask.x-thisMask.width\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\n\t\t\t\t\t\t\tthis.eventCollisionWith(s);\n\t\t\t\t\t\t\ts.eventCollisionWith(this);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ts=Game.placeIsFree(this.x+thisMask.x,this.y+thisMask.y,thisMask.width,thisMask.height);\n\t\t\t\t\t\t\tsolids=(s===true?true:(s.length>1?s:(s[0].id==this.id?true:s)));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t/*== Method displaying the element ==*/\n\t\tElement.prototype.display=function()\n\t\t{\n\t\t\tif(this.active)\n\t\t\t{\n\t\t\t\tif(this.visible)\n\t\t\t\t{\n\t\t\t\t\tvar posXImage=0,\n\t\t\t\t\tposYImage=0;\n\t\t\t\t\tif(this.sprite.src!=null&& this.sprite.src.complete)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this.sprite.isTiles)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar position=this.sprite.getImage();\n\t\t\t\t\t\t\tposXImage=parseInt(position[0],10);\n\t\t\t\t\t\t\tposYImage=parseInt(position[1],10);\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar x=this.x-Game.room.view_x,\n\t\t\t\t\t\ty=this.y-Game.room.view_y;\n\t\t\t\t\t\tGame.context2D.globalAlpha=(this.opacity/100).toFixed(1);\n\t\t\t\t\t\tGame.context2D.save();\n\t\t\t\t\t\tGame.context2D.translate(this.centerRotateX,this.centerRotateY);\n\t\t\t\t\t\tGame.context2D.rotate((360-this.rotate) * Math.PI/180);\n\t\t\t\t\t\t\n\t\t\t\t\t\tGame.context2D.drawImage(this.sprite.src,posXImage,posYImage,this.sprite.width,this.sprite.height,Math.round(x-this.centerRotateX),Math.round(y-this.centerRotateY),this.sprite.width*this.sprite.stretchX,this.sprite.height*this.sprite.stretchY);\n\t\t\t\t\t\t\n\t\t\t\t\t\tGame.context2D.restore();\n\t\t\t\t\t}\n\t\t\t\t\tvar lengthDraws=this.draws.length;\n\t\t\t\t\tfor(var i=0; i<lengthDraws; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this.draws[i].opacity){Game.context2D.globalAlpha=(this.draws[i].opacity/100).toFixed(1);}\n\t\t\t\t\t\tif(this.draws[i].color){Game.context2D.fillStyle=this.draws[i].color;}\n\t\t\t\t\t\tif(this.draws[i].borderLength){Game.context2D.lineWidth=this.draws[i].borderLength;}\n\t\t\t\t\t\tif(this.draws[i].borderColor){Game.context2D.strokeStyle=this.draws[i].borderColor;}\n\t\t\t\t\t\t\n\t\t\t\t\t\tswitch(this.draws[i].type)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t\t\tGame.context2D.textBaseline = \"top\";\n\t\t\t\t\t\t\t\tGame.context2D.font=this.draws[i].font;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar nbr_lines=0,\n\t\t\t\t\t\t\t\tlines=[];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(this.draws[i].maxWidth>0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar l=Game.context2D.measureText(this.draws[i].text).width;\t\n\t\t\t\n\t\t\t\t\t\t\t\t\tif(l>this.draws[i].maxWidth)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar start=-1,\n\t\t\t\t\t\t\t\t\t\ttempText='',\n\t\t\t\t\t\t\t\t\t\tc='',\n\t\t\t\t\t\t\t\t\t\tmots=this.draws[i].text.split(' '),\n\t\t\t\t\t\t\t\t\t\tlength=mots.length;\n\t\t\t\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t\t\t\ttempText=c;\n\t\t\t\t\t\t\t\t\t\t\tc+=mots[++start]+' ';\n\t\t\t\t\t\t\t\t\t\t\tif(Game.context2D.measureText(c).width>this.draws[i].maxWidth || start==length)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tlines.push(tempText);\n\t\t\t\t\t\t\t\t\t\t\t\tc=mots[start]+' ';\n\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\t\t\t\t\t\t}while(start<length);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(lines.length==0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlines=this.draws[i].text.split('\\n');\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tnbr_lines=lines.length;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor(var k=0;k<nbr_lines;k++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tGame.context2D.fillText(lines[k],this.draws[i].x,this.draws[i].y+(k*this.draws[i].lineHeight));\n\t\t\t\t\t\t\t\t\tif(this.draws[i].borderLength>0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tGame.context2D.strokeText(lines[k],this.draws[i].x,this.draws[i].y+(k*this.draws[i].lineHeight));\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\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase 'rectangle':\n\t\t\t\t\t\t\t\tGame.context2D.fillRect(this.draws[i].x,this.draws[i].y,this.draws[i].width,this.draws[i].height);\n\t\t\t\t\t\t\t\tif(this.draws[i].borderLength>0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tGame.context2D.beginPath();\n\t\t\t\t\t\t\t\t\tGame.context2D.moveTo(this.draws[i].x,this.draws[i].y);\n\t\t\t\t\t\t\t\t\tGame.context2D.lineTo(this.draws[i].x+this.draws[i].width,this.draws[i].y);\n\t\t\t\t\t\t\t\t\tGame.context2D.lineTo(this.draws[i].x+this.draws[i].width,this.draws[i].y+this.draws[i].height);\n\t\t\t\t\t\t\t\t\tGame.context2D.lineTo(this.draws[i].x,this.draws[i].y+this.draws[i].height);\n\t\t\t\t\t\t\t\t\tGame.context2D.lineTo(this.draws[i].x,this.draws[i].y);\n\t\t\t\t\t\t\t\t\tGame.context2D.stroke();\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase 'circle':\n\t\t\t\t\t\t\t\tGame.context2D.beginPath();\n\t\t\t\t\t\t\t\tGame.context2D.arc(this.draws[i].x,this.draws[i].y,this.draws[i].radius,0,360,false);\n\t\t\t\t\t\t\t\tif(this.draws[i].borderLength>0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tGame.context2D.stroke();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tGame.context2D.fill();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase 'image':\n\t\t\t\t\t\t\t\tthis.draws[i].sprite.changeImage();\n\t\t\t\t\t\t\t\tvar position=this.draws[i].sprite.getImage();\n\t\t\t\t\t\t\t\tposXImage=parseInt(position[0],10);\n\t\t\t\t\t\t\t\tposYImage=parseInt(position[1],10);\n\t\t\t\t\t\t\t\tGame.context2D.drawImage(this.draws[i].sprite.src,posXImage,posYImage,this.draws[i].sprite.width,this.draws[i].sprite.height,this.draws[i].x,this.draws[i].y,this.draws[i].sprite.width*this.draws[i].sprite.stretchX,this.draws[i].sprite.height*this.draws[i].sprite.stretchY);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.draws=[];\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t\n\t\t/*== Method switching the position of the element when it leaves the room ==*/\n\t\tElement.prototype.switchPositionWhenOutsideRoom=function()\n\t\t{\n\t\t\tif(this.x>=Game.room.width && this.x>this.xprev)\n\t\t\t{\n\t\t\t\tthis.x=-(this.sprite.width/2);\n\t\t\t}\n\t\t\telse if(this.x<=0 && this.x<this.xprev)\n\t\t\t{\n\t\t\t\tthis.x=Game.room.width-(this.sprite.width/2);\n\t\t\t}\n\t\t\telse if(this.y<=0 && this.y<this.yprev)\n\t\t\t{\n\t\t\t\tthis.y=Game.room.height+(this.sprite.height/2);\n\t\t\t}\n\t\t\telse if(this.y>=Game.room.height && this.y>this.yprev)\n\t\t\t{\n\t\t\t\tthis.y=-(this.sprite.height/2);\n\t\t\t}\n\t\t};\n\t\t\n\t\t/*== Method returning all the elements in collision with this element ==*/\n\t\tElement.prototype.checkCollisions=function()\n\t\t{\n\t\t\tvar collisions=[],\n\t\t\telement=null,\n\t\t\t\n\t\t\tthisTopLeft=null,\n\t\t\tthisTopRight=null,\n\t\t\tthisBottomRight=null,\n\t\t\tthisBottomLeft=null,\n\t\t\tthisSegments=[],\n\t\t\t\n\t\t\telementTopLeft=null,\n\t\t\telementTopRight=null,\n\t\t\telementBottomRight=null,\n\t\t\telementBottomLeft=null,\n\t\t\telementSegments=[],\n\t\t\t\n\t\t\tthisMask=this.sprite.getMask();\n\t\t\t\n\t\t\tfor(var i=0,l=Game.activeElements.length; i<l; i++)\n\t\t\t{\n\t\t\t\telement=Game.activeElements[i];\n\t\t\t\tif(element.id==this.id){continue;}\n\t\t\t\tvar otherMask=element.sprite.getMask();\n\t\t\t\tif(element.id!=this.id)\n\t\t\t\t{\n\t\t\t\t\tif((this.rotate==0 || this.rotate==360) && (element.rotate==0 || element.rotate==360))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar x=Math.round(this.x*1000),\n\t\t\t\t\t\ty=Math.round(this.y*1000),\n\t\t\t\t\t\telemX=Math.round(element.x*1000),\n\t\t\t\t\t\telemY=Math.round(element.y*1000);\n\t\t\t\t\t\tthisMaskx=thisMask.x*1000,\n\t\t\t\t\t\tthisMasky=thisMask.y*1000,\n\t\t\t\t\t\totherMaskx=otherMask.x*1000,\n\t\t\t\t\t\totherMasky=otherMask.y*1000;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!((x+thisMaskx>=elemX+otherMaskx+otherMask.width*1000) \n\t\t\t\t\t\t|| (x+thisMaskx+thisMask.width*1000<=elemX+otherMaskx) \t\t\t\t\t\n\t\t\t\t\t\t|| (y+thisMasky>=elemY+otherMasky+otherMask.height*1000) \t\n\t\t\t\t\t\t|| (y+thisMasky+thisMask.height*1000<=elemY+otherMasky))) \t\t\t\t\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcollisions.push(element);\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{\n\t\t\t\t\t\tif(thisTopLeft==null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthisTopLeft=Game.getPointAfterRotation({'x':this.x+thisMask.x,'y':this.y+thisMask.y},this.rotate,{'x':this.centerRotateX,'y':this.centerRotateY});\n\t\t\t\t\t\t\tthisTopRight=Game.getPointAfterRotation({'x':this.x+thisMask.x+thisMask.width,'y':this.y+thisMask.y},this.rotate,{'x':this.centerRotateX,'y':this.centerRotateY});\n\t\t\t\t\t\t\tthisBottomRight=Game.getPointAfterRotation({'x':this.x+thisMask.x+thisMask.width,'y':this.y+thisMask.y+thisMask.height},this.rotate,{'x':this.centerRotateX,'y':this.centerRotateY});\n\t\t\t\t\t\t\tthisBottomLeft=Game.getPointAfterRotation({'x':this.x+thisMask.x,'y':this.y+thisMask.y+thisMask.height},this.rotate,{'x':this.centerRotateX,'y':this.centerRotateY});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthisSegments=[{'start': thisTopLeft, 'end': thisTopRight},\n\t\t\t\t\t\t\t{'start': thisTopRight, 'end': thisBottomRight},\n\t\t\t\t\t\t\t{'start': thisBottomRight, 'end': thisBottomLeft},\n\t\t\t\t\t\t\t{'start': thisBottomLeft, 'end': thisTopLeft}];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\telementTopLeft=Game.getPointAfterRotation({'x':element.x+otherMask.x,'y':element.y+otherMask.y},element.rotate,{'x':element.centerRotateX,'y':element.centerRotateY});\n\t\t\t\t\t\telementTopRight=Game.getPointAfterRotation({'x':element.x+otherMask.x+otherMask.width,'y':element.y+otherMask.y},element.rotate,{'x':element.centerRotateX,'y':element.centerRotateY});\n\t\t\t\t\t\telementBottomRight=Game.getPointAfterRotation({'x':element.x+otherMask.x+otherMask.width,'y':element.y+otherMask.y+otherMask.height},element.rotate,{'x':element.centerRotateX,'y':element.centerRotateY});\n\t\t\t\t\t\telementBottomLeft=Game.getPointAfterRotation({'x':element.x+otherMask.x,'y':element.y+otherMask.y+otherMask.height},element.rotate,{'x':element.centerRotateX,'y':element.centerRotateY});\n\t\t\t\t\t\n\t\t\t\t\t\telementSegments=[{'start': elementTopLeft, 'end': elementTopRight},\n\t\t\t\t\t\t{'start': elementTopRight, 'end': elementBottomRight},\n\t\t\t\t\t\t{'start': elementBottomRight, 'end': elementBottomLeft},\n\t\t\t\t\t\t{'start': elementBottomLeft, 'end': elementTopLeft}];\n\t\t\t\t\t\t\n\t\t\t\t\t\tloopFree:\n\t\t\t\t\t\tfor(var j=0; j<4; j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor(var k=0; k<4; k++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(Game.segmentsAreInCollision(thisSegments[j],elementSegments[k]))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcollisions.push(element);\n\t\t\t\t\t\t\t\t\tcontinue loopFree;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn collisions;\n\t\t};\n\t\t\n\t\t/*====================================================*/\n\t\t/*============= Methods the user can call ============*/\n\t\t/*====================================================*/\n\n\t\t/*== Method returning the nearest instance of the given type ==*/\n\t\tElement.prototype.instanceNearest=function(type,deltaX,deltaY,elements)\n\t\t{\n\t\t\telements=elements==undefined?Game.activeElements:elements;\n\t\t\t\n\t\t\tvar objet=null,\n\t\t\tmax=-1,\n\t\t\ttemp=0;\n\t\t\t\n\t\t\tdeltaX=(deltaX==undefined)?0:deltaX;\n\t\t\tdeltaY=(deltaY==undefined)?0:deltaY;\n\n\t\t\tfor(var i=0,l=elements.length; i<l; i++)\n\t\t\t{\n\t\t\t\tvar element=elements[i];\n\t\t\t\tif(element.instanceOf(type) && element.id!=this.id)\n\t\t\t\t{\n\t\t\t\t\ttemp=Math.pow((element.x-(this.x+deltaX)),2)+Math.pow((element.y-(this.y+deltaY)),2);\n\t\t\t\t\tif(max<0 || temp<max)\n\t\t\t\t\t{\n\t\t\t\t\t\tmax=temp;\n\t\t\t\t\t\tobjet=element;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn objet;\n\t\t};\n\t\t\n\t\t/*== Method setting the \"active\" statut of the element ==*/\n\t\tElement.prototype.setActive=function(active)\n\t\t{\n\t\t\tif(active==false && this.active)\n\t\t\t{\n\t\t\t\tthis.active=false;\n\t\t\t\t\n\t\t\t\tfor(var i=0,l=Game.activeElements.length; i<l; i++)\n\t\t\t\t{\t\n\t\t\t\t\tif(Game.activeElements[i].id==this.id)\n\t\t\t\t\t{\n\t\t\t\t\t\tGame.activeElements.splice(i,1);\n\t\t\t\t\t\tbreak;\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t\telse if(active==true && !this.active)\n\t\t\t{\n\t\t\t\tthis.active=true;\n\t\t\t\tGame.activeElements.push(this);\n\t\t\t}\n\t\t};\n\t\t\n\t\t/*== Method returning the direction (in °) of the element according to its hspeed and vspeed ==*/\n\t\tElement.prototype.getDirection=function()\n\t\t{\n\t\t\tvar angle=0;\n\t\n\t\t\tif(this.hspeed!=0 && this.vspeed!=0)\n\t\t\t{\n\t\t\t\tangle=180*Math.abs(Math.atan(this.vspeed/this.hspeed))/Math.PI;\t\n\t\t\t\tangle=(this.hspeed<0&&this.vspeed<0)?180-angle:((this.hspeed>0&&this.vspeed>0)?360-angle:((this.hspeed<0)?180+angle:angle));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tangle=(this.hspeed==0)?((this.vspeed>0)?270:((this.vspeed<0)?90:0)):((this.vspeed==0)?((this.hspeed<0)?180:360):0);\n\t\t\t}\n\t\t\t\n\t\t\treturn Math.round(angle);\n\t\t};\n\t\t\n\t\t/*== Method returning the gloal speed of the element (>=0) ==*/\n\t\tElement.prototype.getSpeed=function()\n\t\t{\n\t\t\treturn parseFloat(parseFloat(Math.sqrt(Math.pow(this.hspeed,2)+Math.pow(this.vspeed,2))).toFixed(2));\n\t\t};\n\t\t\n\t\t/*== Method modifing the hspeed and the vspeed in order to make the element moving to the given direction ==*/\n\t\tElement.prototype.moveToDirection=function(direction,speed)\n\t\t{\t\t\t\n\t\t\tdirection=360-direction;\n\t\t\tdirection*=Math.PI/180;\n\t\t\tthis.vspeed=speed*Math.sin(direction);\n\t\t\tthis.hspeed=speed*Math.cos(direction);\n\t\t};\n\t\t\n\t\t/*== Method modifing the hspeed and the vspeed in order to make the element moving to the given position ==*/\n\t\tElement.prototype.moveToPoint=function(x,y,speed,callBack)\n\t\t{\n\t\t\tvar deltaX=x-this.x,\n\t\t\tdeltaY=y-this.y,\n\t\t\tadj=Math.abs(deltaX),\n\t\t\top=Math.abs(deltaY),\t\t\t\n\t\t\tangle=0;\n\n\t\t\tif(callBack!=undefined)\n\t\t\t{\n\t\t\t\tthis.moveToPointCallBack=\n\t\t\t\t{\n\t\t\t\t\t'x':x,\n\t\t\t\t\t'y':y,\n\t\t\t\t\t'fromLeft':deltaX>0,\n\t\t\t\t\t'fromTop':deltaY>0,\n\t\t\t\t\t'f':callBack\n\t\t\t\t};\n\t\t\t}\n\t\t\t\n\t\t\tif(deltaX!=0 && deltaY!=0)\n\t\t\t{\n\t\t\t\tangle=180*Math.abs(Math.atan(deltaY/deltaX))/Math.PI;\t\n\t\t\t\tangle=(deltaX<0&&deltaY<0)?180-angle:((deltaX>0&&deltaY>0)?360-angle:((deltaX<0)?180+angle:angle));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tangle=(deltaX==0)?((deltaY>0)?270:((deltaY<0)?90:0)):((deltaY==0)?((deltaX<0)?180:0):0);\n\t\t\t}\n\n\t\t\tthis.moveToDirection(angle,speed);\n\t\t};\n\t\t\n\t\t/*== Method setting a path following by the element ==*/\n\t\tElement.prototype.setPath=function(points,speed,callBack)\n\t\t{\t\n\t\t\tif(points[0])\n\t\t\t{\n\t\t\t\tvar el=this;\n\t\t\t\tfunction a(i)\n\t\t\t\t{\n\t\t\t\t\tel.moveToPoint(points[i][0],points[i][1],speed,function()\n\t\t\t\t\t{\n\t\t\t\t\t\tif(points[++i])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ta(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(callBack)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(typeof callBack=='string')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tswitch(callBack)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcase 'repeat': a(0); break;\n\t\t\t\t\t\t\t\t\tcase 'reverse': points.reverse(); points.push(points.shift()); a(0); break;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcallBack.apply(el);\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\ta(0);\n\t\t\t}\n\t\t};\n\t\t\n\t\t/*== Method indicating if the element has the given type ==*/\n\t\tElement.prototype.instanceOf=function(type)\n\t\t{\n\t\t\tif(typeof type=='string')\n\t\t\t{\n\t\t\t\ttype=window[type];\n\t\t\t}\n\t\t\t\n\t\t\tfor(var i=0,l=this.types.length; i<l; i++)\n\t\t\t{\n\t\t\t\tif(window[this.types[i]]==type)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t\t\n\t\t/*== Method calling a parent method ==*/\n\t\tElement.prototype.callParent=function(methode,args,parent)\n\t\t{\n\t\t\tif(methode==undefined)\n\t\t\t{\n\t\t\t\talert('Erreur <callParent> (Méthode ['+methode+'] appelée par ['+this.types+']) : méthode non définie !');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\targs=(args==undefined)?[]:args;\n\t\t\tparent=(parent==undefined)?(this.types[1]==undefined?this.types[0]:this.types[1]):parent;\n\t\t\tif(typeof parent=='string')\n\t\t\t{\n\t\t\t\tparent=window[parent];\n\t\t\t}\n\t\t\tif(this.instanceOf(parent))\n\t\t\t{\n\t\t\t\treturn parent.prototype[methode].apply(this,args);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\talert('Erreur <callParent> (Méthode ['+methode+'] appelée par ['+this.types+']) : l\\'élément appelant n\\'est pas du type indiqué !');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\t\t\n\t\t/*== Method setting the depth of the element ==*/\n\t\tElement.prototype.setZIndex=function(newZIndex)\n\t\t{\n\t\t\tthis.zIndex=newZIndex;\n\t\t\tGame.zIndex=true;\n\t\t};\n\t\t\n\t\t/*== Method defining a time for the given alarm ==*/\n\t\tElement.prototype.setAlarm=function(id_alarm,temps_secondes)\n\t\t{\n\t\t\tif(id_alarm>=1 && id_alarm<=10)\n\t\t\t{\n\t\t\t\tif(temps_secondes>0)\n\t\t\t\t{\n\t\t\t\t\tthis['alarm'+id_alarm]=parseInt(temps_secondes*33,10);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\talert('Erreur <setAlarm> (Appelé par ['+this.types+']) : le temps spécifié doit être supérieur à 0 seconde !');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\talert('Erreur <setAlarm> (Appelé par ['+this.types+']) : le numéro de l\\'alarme doit être compris entre 1 et 10 inclus !');\n\t\t\t}\n\t\t};\n\t\t\n\t\t/*== Method adding a text to draw ==*/\n\t\tElement.prototype.drawText=function(objet)\n\t\t{\t\t\t\n\t\t\tthis.draws.push(Game.mergeJSON(\n\t\t\t{\n\t\t\t\t'type': 'text',\n\t\t\t\t'x': this.x,\n\t\t\t\t'y': this.y,\n\t\t\t\t'color': '#000000',\n\t\t\t\t'borderLength': 0,\n\t\t\t\t'maxWidth': -1,\n\t\t\t\t'borderColor': '#ffffff',\n\t\t\t\t'font': '20px Calibri',\n\t\t\t\t'opacity': 100,\n\t\t\t\t'lineHeight': 20,\n\t\t\t\t'text': ''\n\t\t\t},(objet==undefined?{}:objet)));\n\t\t};\n\t\t\n\t\t/*== Method adding a rectangle to draw ==*/\n\t\tElement.prototype.drawRectangle=function(objet)\n\t\t{\n\t\t\tthis.draws.push(Game.mergeJSON(\n\t\t\t{\n\t\t\t\t'type': 'rectangle',\n\t\t\t\t'x': 0,\n\t\t\t\t'y': 0,\n\t\t\t\t'width': 100,\n\t\t\t\t'height': 100,\n\t\t\t\t'color': '#000000',\n\t\t\t\t'borderLength': 0,\n\t\t\t\t'borderColor': '#ffffff',\n\t\t\t\t'opacity': 100\n\t\t\t},(objet==undefined?{}:objet)));\n\t\t};\n\t\t\n\t\t/*== Method adding a circle to draw ==*/\n\t\tElement.prototype.drawCircle=function(objet)\n\t\t{\n\t\t\tthis.draws.push(Game.mergeJSON(\n\t\t\t{\n\t\t\t\t'type': 'circle',\n\t\t\t\t'x': 0,\n\t\t\t\t'y': 0,\n\t\t\t\t'radius': 16,\n\t\t\t\t'color': '#000000',\n\t\t\t\t'borderLength': 0,\n\t\t\t\t'borderColor': '#ffffff',\n\t\t\t\t'opacity': 100\n\t\t\t},(objet==undefined?{}:objet)));\n\t\t};\n\t\t\n\t\t/*== Method adding an image to draw ==*/\n\t\tElement.prototype.drawSprite=function(objet)\n\t\t{\n\t\t\tthis.draws.push(Game.mergeJSON(\n\t\t\t{\n\t\t\t\t'type': 'image',\n\t\t\t\t'x': 0,\n\t\t\t\t'y': 0,\n\t\t\t\t'sprite': null,\n\t\t\t\t'opacity': 100\n\t\t\t},(objet==undefined?{}:objet)));\n\t\t};\n\t\t\n\t\t/*== Method indicating if the mouse is over the element or not ==*/\n\t\tElement.prototype.isMouseOver=function()\n\t\t{\n\t\t\tvar mouse=Game.getMouse(false),\n\t\t\tthisMask=this.sprite.getMask();\n\t\t\treturn !((this.x+thisMask.x>mouse[0]) \n\t\t\t|| (this.x+thisMask.x+thisMask.width<mouse[0]) \t\t\t\t\t\n\t\t\t|| (this.y+thisMask.y>mouse[1]) \t\n\t\t\t|| (this.y+thisMask.y+thisMask.height<mouse[1]))\n\t\t};\n\t\t\n\t\t/*====================================================*/\n\t\t/*==\t\tMethods defined by the user\t\t\t\t==*/\n\t\t/*====================================================*/\n\n\t\tElement.prototype.eventCreate=function(){};\t\t\t\t//Method called when the element is created\n\t\tElement.prototype.eventOutsideRoom=function(){};\t\t//Method called when the element is outside the room\n\t\tElement.prototype.eventOutsideView=function(){};\t\t//Method called when the element is outside the view\n\t\tElement.prototype.eventInsideView=function(){};\t\t\t//Method called when the element is inside the room\n\t\tElement.prototype.eventRoomStart=function(){};\t\t\t//Method called when the room starts\n\t\tElement.prototype.eventDestroy=function(){};\t\t\t//Method called when the element is destroyed\n\t\tElement.prototype.eventStartStep=function(){};\t\t\t//Method called at the beginning of each step\n\t\tElement.prototype.eventStep=function(){};\t\t\t\t//Method called at each step\n\t\tElement.prototype.eventEndStep=function(){};\t\t\t//Method called at the end of each step\n\t\tElement.prototype.eventCollisionWith=function(objet){};\t//Method called when a collision occurs\n\t\tElement.prototype.eventMouseDown=function(){};\t\t\t//Method called when a mouse button is pressed\n\t\tElement.prototype.eventMouseUp=function(){};\t\t\t//Method called when a mouse button is released\n\t\tElement.prototype.eventClick=function(){};\t\t\t\t//Method called when a click occurs\n\t\tElement.prototype.eventKeyDown=function(key){};\t\t\t//Method called when a key is pressed\n\t\tElement.prototype.eventKeyPressed=function(key){};\t\t//Method called when a key is continuously pressed\n\t\tElement.prototype.eventKeyUp=function(key){};\t\t\t//Method called when a key is released\n\t\tElement.prototype.eventEndAnimation=function(){};\t\t//Method called when the sprite animation is finished\n\t\tElement.prototype.eventAlarm1=function(){};\t\t\t\t//Method called when the alarm 1 is ready\n\t\tElement.prototype.eventAlarm2=function(){};\t\t\t\t//Method called when the alarm 2 is ready\n\t\tElement.prototype.eventAlarm3=function(){};\t\t\t\t//Method called when the alarm 3 is ready\n\t\tElement.prototype.eventAlarm4=function(){};\t\t\t\t//Method called when the alarm 4 is ready\n\t\tElement.prototype.eventAlarm5=function(){};\t\t\t\t//Method called when the alarm 5 is ready\n\t\tElement.prototype.eventAlarm6=function(){};\t\t\t\t//Method called when the alarm 6 is ready\n\t\tElement.prototype.eventAlarm7=function(){};\t\t\t\t//Method called when the alarm 7 is ready\n\t\tElement.prototype.eventAlarm8=function(){};\t\t\t\t//Method called when the alarm 8 is ready\n\t\tElement.prototype.eventAlarm9=function(){};\t\t\t\t//Method called when the alarm 9 is ready\n\t\tElement.prototype.eventAlarm10=function(){};\t\t\t//Method called when the alarm 10 is ready\n\t}\n}", "function Rj(a,b){this.Yc=A(\"div\",\"blocklyToolboxDiv\");this.Yc.setAttribute(\"dir\",C?\"RTL\":\"LTR\");b.appendChild(this.Yc);this.V=new Ph;a.appendChild(this.V.R());E(this.Yc,\"mousedown\",this,function(a){bd(a)||a.target==this.Yc?gg(!1):gg(!0)})}", "function makeAreasDropable(){\r\n // When a block is dropped, check the value and type global data variables\r\n // and append the appropriate block to that container.\r\n\r\n var blockBank = document.getElementById(\"block-bank\");\r\n var inBlock1 = document.getElementById(\"input-block-1\");\r\n var opBlock = document.getElementById(\"operator-block\");\r\n var inBlock2 = document.getElementById(\"input-block-2\");\r\n let list = [inBlock1,inBlock2,blockBank,opBlock];\r\n list.forEach(function(item){\r\n item.addEventListener(\"dragover\",function(event){\r\n event.preventDefault();\r\n });\r\n item.addEventListener(\"drop\",function(event){\r\n event.preventDefault();\r\n dropBlock(event);\r\n });\r\n })\r\n\r\n}", "function userClick(e){\n\n let dragCheck = userInput.dragOrClickCheckandStop()\n if(dragCheck){\n return;\n }\n\n if(!currentHover){\n console.log('none!')\n return;\n }\n\n\n\n //cant place things on top of roads so nothing happens on click\n if(currentHover.object.blockType == 'road' && process.clickOperation != 'delete-block'){\n return\n }\n\n if(process.randomColor){\n process.paintColor = {r:ts.rndmNum(0,1),g:ts.rndmNum(0,1),b:ts.rndmNum(0,1)}\n }\n\n\n const hoverPos = currentHover.object.position\n console.log(currentHover)\n let place = {x:hoverPos.x,y:hoverPos.y+1,z:hoverPos.z}\n if(process.clickOperation == 'place-road'){\n if(currentHover.object.blockType){\n return;\n }\n let newRoad = new cls.Road(editPlot,place.x,place.y,place.z)\n editPlot.blocks[place.x][place.y][place.z] = newRoad;\n newRoad.addToScene()\n // console.log(newRoad)\n newRoad.fitToSurroundings(true)\n } \n if(process.clickOperation == 'place-residential'){\n let newBlock = new cls.Residential(editPlot,place.x,place.y,place.z)\n newBlock.baseColor = process.paintColor\n console.log(newBlock.baseColor)\n newBlock.addToScene()\n newBlock.fitToSurroundings(true)\n }\n if(process.clickOperation == 'place-office'){\n let newBlock = new cls.Office(editPlot,place.x,place.y,place.z);\n newBlock.baseColor = process.paintColor\n console.log(newBlock.baseColor)\n newBlock.addToScene()\n newBlock.fitToSurroundings(true)\n }\n if(process.clickOperation == 'place-commercial'){\n let newBlock = new cls.Commercial(editPlot,place.x,place.y,place.z);\n newBlock.baseColor = process.paintColor\n newBlock.addToScene()\n newBlock.fitToSurroundings(true)\n }\n if(process.clickOperation == 'place-park' && currentHover.object.blockType == undefined){\n let newBlock = new cls.Park(editPlot,place.x,place.y,place.z);\n newBlock.addToScene()\n newBlock.fitToSurroundings(true)\n\n }\n if(process.clickOperation == 'delete-block' && currentHover.object.blockType){\n console.log(currentHover.object)\n // index.scene.remove(currentHover.object)\n let x = currentHover.object.position.x;\n let y = currentHover.object.position.y;\n let z = currentHover.object.position.z;\n\n if(currentHover.object.blockType == 'park'){\n y = 1;\n }\n\n ts.deleteAtandUp(x,y,z,editPlot.blocks,editPlot)\n // editPlot.blocks[x][y][z] = [];\n }\n if(process.clickOperation == 'paint-building' && currentHover.object.blockType){\n console.log(currentHover.object)\n ts.setBaseColor(currentHover.object,process.paintColor);\n currentHover.object.objectOf.baseColor = process.paintColor;\n }\n\n let exportable = exportBlocks(editPlot)\n ts.exporter.blockData(exportable)\n\n let allSides = editPlot.checkEdgesForRoads('boolean')\n ts.exporter.edgeRoadBoolean(allSides)\n\n\n}", "function setTargets() {\n const selectedBlock = wp.data.select('core/block-editor').getSelectedBlock();\n\n if (selectedBlock.attributes.designHeight && selectedBlock.attributes.designWidth) {\n if (typeof window.resourceBlocks !== 'undefined') {\n window.resourceBlocks = {\n targetWidth: selectedBlock.attributes.designWidth,\n targetHeight: selectedBlock.attributes.designHeight\n };\n }\n }\n }", "function blockButton({ id, className, onClick, text }) {\n return (\n <div id=\"first\">\n {/* <div id={id} className=\"flex-item\" onClick={() => this.updateClicks(blockArray[0][0])}>{text}</div> */}\n <div id=\"def\">Stuff shown on hover</div>\n </div>\n );\n}", "function renderBlocks(saveData,target){\n\t\t/**\n\t\t*init variables and reuse typeString later\n\t\t*/\t\n\t\tvar blockTypes = ['g_block_c2','g_block_c3','g_block_c4','g_block_c5','g_block_c6','g_block_c7','g_block_c8','g_block_c9','g_block_c12'];\n\t\n\t\t//var blockBox= $(\"#g_page \"+target+\" div.\"+blockTypes.join(\",#g_page div.\")),l,typeIs,i,ref,type,arrtest,assign=tdc.Grd.Templates.getByID('blockBox');\n\t\t\n\t\t// We use the following line until all block markup have been \"wrapped\"\n\t\tvar blockBox= $(\"#g_page \"+target+\" .g_block_content.\"+blockTypes.join(\",#g_page .g_block_content.\")),l,typeIs,i,ref,type,arrtest,assign=tdc.Grd.Templates.getByID('blockBox');\n\t\tvar data;\n\t\n\t\tif(blockBox.length){\n\t\t\tvar blength=blockBox.length;\n\t\n\t\t\tfor (i=0;i<blength; i++) {\n\t\t\t\tref=$(blockBox[i]);\n\t\t\t\tarrtest=ref.attr('class').split(' ');\n\t\t\t\tl = arrtest.length;\n\t\t\t\tfor (var j=0;j<l; j++) {\n\t\t\t\t\ttypeIs = blockTypes.indexOf(arrtest[j]);\n\t\t\t\t\tif(typeIs!=-1){\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t*if data is needed AGAIN\n\t\t\t\t\t\t*/\n\t\t\t\t\t\tif(saveData){\n\t\t\t\t\t\t\t$(this).data('blockType',blockTypes[typeIs]);\n\t\t\t\t\t\t}\n\t\t\n\t\t\t\t\t\tvar blockType=blockTypes[typeIs];\n\t\t\t\t\t\t\n\t\t\t\t\t\tdata = { //data object used in template rendering engine\n\t\t\t\t\t\t\ttype:blockType, //set type\n\t\t\t\t\t\t\tref:ref.removeClass(blockType).outerHTML() //cleanup the markup the class on the ref is not needed longer\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tref.fasterReplace($.renderTemplate(assign,data));\n\t\t\t\t//ref.replaceWith($.renderTemplate(assign,data)); this is alot slower, the new Custom function is 20-30% faster\n\t\t\t}\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t}", "function setupListInputBlocks(callback) {\n driver.addBlock('reifyScript').accept(ring => {\n driver.addBlock('doFaceTowards').accept(block => {\n const slot = ring.inputs()\n .find(child => child instanceof RingCommandSlotMorph)\n let target = slot.attachTargets().pop();\n\n SnapActions.moveBlock(block, target).accept(() => {\n callback(ring);\n });\n });\n });\n }", "function buildBoard(blockOrder, blockType, p1) {\n \n // variables we'll need\n var blockLocations = Array(BLOCK_COUNT).fill(NaN);\n var highestBlockIndex = 0;\n var currentlySelected = 0;\n \n var placeable = [BOX_SUPPLY, TURRET_SUPPLY, CANNON_SUPPLY];\n var counterClassNames = [\"box-selected\", \"turret-selected\", \"cannon-selected\"];\n var counterContainers = [];\n\n // What's gonna hold all our stuff\n var topLevel = document.createElement('div');\n topLevel.id = \"build_main\";\n\n // Instructional text\n var text = document.createElement('div');\n text.id = \"instructions\";\n var playerName = \"Player 1 \";\n if (!p1) {\n playerName = \"Player 2 \";\n }\n var instructionString = playerName + 'Click to place / remove a block';\n text.innerHTML = instructionString;\n topLevel.appendChild(text);\n\n // Hold grid board, and label of which unit is selected / how many you have\n var midParent = document.createElement('div');\n midParent.id = \"mid-parent\";\n\n\n // Set up unit selection\n var typeSelector = document.createElement('div');\n typeSelector.className = \"type-box\";\n\n // for box\n var boxContainer = document.createElement('div');\n boxContainer.className = \"counter-selected\";\n boxContainer.onclick = function() {\n if (placeable[BOX_TYPE] > 0) {\n currentlySelected = BOX_TYPE;\n boxContainer.className = \"counter-selected\";\n fixUnselected(counterContainers, currentlySelected);\n }\n }\n var boxLabel = document.createElement('div');\n boxLabel.className = \"label\";\n boxLabel.innerHTML = \"Box: \";\n boxContainer.appendChild(boxLabel);\n var boxCount = document.createElement('div');\n boxCount.id = \"box-count\";\n boxCount.innerHTML = BOX_SUPPLY;\n boxContainer.appendChild(boxCount);\n typeSelector.appendChild(boxContainer);\n counterContainers.push(boxContainer);\n\n // turret\n var turretContainer = document.createElement('div');\n turretContainer.className = \"counter\";\n turretContainer.onclick = function() {\n if (placeable[TURRET_TYPE] > 0) {\n currentlySelected = TURRET_TYPE;\n turretContainer.className = \"counter-selected\";\n fixUnselected(counterContainers, currentlySelected);\n }\n }\n var turretLabel = document.createElement('div');\n turretLabel.className = \"label\";\n turretLabel.innerHTML = \"Turret: \";\n turretContainer.appendChild(turretLabel);\n var turretCount = document.createElement('div');\n turretCount.id = \"turret-count\";\n turretCount.innerHTML = TURRET_SUPPLY;\n turretContainer.appendChild(turretCount);\n typeSelector.appendChild(turretContainer);\n counterContainers.push(turretContainer);\n\n // cannon\n var cannonContainer = document.createElement('div');\n cannonContainer.className = \"counter\";\n cannonContainer.onclick = function() {\n if (placeable[CANNON_TYPE] > 0) {\n currentlySelected = CANNON_TYPE;\n cannonContainer.className = \"counter-selected\";\n fixUnselected(counterContainers, currentlySelected);\n }\n }\n var cannonLabel = document.createElement('div');\n cannonLabel.className = \"label\";\n cannonLabel.innerHTML = \"Cannon: \";\n cannonContainer.appendChild(cannonLabel);\n var cannonCount = document.createElement('div');\n cannonCount.id = \"cannon-count\";\n cannonCount.innerHTML = CANNON_SUPPLY;\n cannonContainer.appendChild(cannonCount);\n typeSelector.appendChild(cannonContainer);\n counterContainers.push(cannonContainer);\n\n midParent.appendChild(typeSelector);\n\n // Grid that will have sub blocks to click in / off\n var gridParent = document.createElement('div');\n gridParent.className = \"grid-container\";\n gridParent.id = 'gridboard';\n\n for (let i = 0; i < BLOCK_COUNT; i++) {\n var gridObject = document.createElement('div');\n gridObject.className = \"unselected-grid-item\";\n gridObject.id = i; // so we can know where it is\n\n gridObject.onclick = function() {\n id = parseInt(this.id); // kinda annoying but whatever\n\n if (blockLocations[id] >= 0) { // it has already been selected\n this.className = \"unselected-grid-item\";\n this.innerHTML = \"\";\n var orderNumber = blockLocations[id];\n placeable[blockType[orderNumber]]++;\n blockOrder[orderNumber] = NaN;\n blockType[orderNumber] = NaN;\n updateBlockOrder(blockLocations[id], blockOrder, blockType, blockLocations);\n blockLocations[id] = NaN;\n highestBlockIndex--;\n updateCounterNumbers(placeable);\n } else if (placeable[currentlySelected] > 0) {\n this.className = counterClassNames[currentlySelected];\n var orderNumber = highestBlockIndex;\n highestBlockIndex++;\n blockLocations[id] = orderNumber;\n blockType[orderNumber] = currentlySelected;\n blockOrder[orderNumber] = id;\n this.innerHTML = orderNumber;\n placeable[blockType[orderNumber]]--;\n updateCounterNumbers(placeable);\n } else {\n alert(\"You can't place any more of those block types!\");\n }\n }\n \n gridParent.appendChild(gridObject);\n }\n\n midParent.appendChild(gridParent); // add our grid in\n\n // spacing\n var spacing = document.createElement('div');\n spacing.className = \"spacingMid\";\n midParent.appendChild(spacing);\n\n topLevel.appendChild(midParent);\n\n\n // Parent element for input, spawn block\n var bottomParent = document.createElement('div');\n bottomParent.className = \"spawnParent\";\n topLevel.appendChild(bottomParent);\n\n // add in a spawn block location for clarity\n var spawn = document.createElement('div');\n spawn.className = \"spawnBlock\";\n var text = document.createElement('div');\n text.innerHTML = \"Spawn\";\n spawn.appendChild(text);\n bottomParent.appendChild(spawn);\n\n // spacing\n var spacing = document.createElement('div');\n spacing.className = \"spacing\";\n bottomParent.appendChild(spacing);\n\n // Continue button\n var onwards = document.createElement('INPUT');\n onwards.type = 'button';\n if (p1) {\n onwards.value='Continue';\n } else {\n onwards.value='Begin';\n }\n onwards.id = \"continue-button\";\n onwards.className = \"fancyButton\";\n\n onwards.onclick = function() {\n $(\"#build_main\").remove();\n if (p1) {\n buildBoard(p2BlockOrder, p2BlockType, false);\n } else {\n mainGame();\n }\n };\n\n bottomParent.appendChild(onwards);\n\n document.body.appendChild(topLevel);\n}", "function AiBlock()\r\n{\r\n this.objectName = \"Ai\";\r\n\tthis.divHeight=16;\r\n\tthis.divWidth=120;\r\n\tthis.text=819;\r\n\tthis.rawValue=819;\r\n}", "function editBlock(element) {\n if (element.edit || element.getAttribute(\"block_type\") == \"img\") {\n return; // you can edit only block with type \"text\" or \"artifact\"\n } else {\n element.edit = \"true\";\n var textAreaEditBlock = document.createElement(\"textarea\");\n textAreaEditBlock.className = \"text_area_edit\";\n textAreaEditBlock.addEventListener(\"keypress\", endEditBlock)\n textAreaEditBlock.value = element.children[0].innerHTML; // value of textarea = value of block's text \n element.children[0].style.display = \"none\"\n element.className = \"block_story block_edited\";\n element.insertBefore(textAreaEditBlock, element.children[1])\n element.getElementsByClassName(\"key_panel\")[0].style.display = \"none\"\n textAreaEditBlock.focus();\n }\n}", "function EditBubbleEditScribble(){\n active_canvas = DRAW_CANVAS;\n main_handler.objEnter = document.getElementById('objEnter').value;\n // 'attributes' doesn't exist anymore ... maybe we should do something about it someday.\n //main_handler.attributes = document.getElementById('attributes').value;\n //main_handler.occluded = document.getElementById('occluded').value;\n\n document.getElementById('select_canvas').style.zIndex = -2;\n document.getElementById('select_canvas_div').style.zIndex = -2;\n \n // Remove polygon from the query canvas:\n select_anno.DeletePolygon();\n var anno = select_anno;\n select_anno = null;\n \n CloseEditPopup();\n this.SetDrawingMode(1);\n main_media.ScrollbarsOn();\n scribble_canvas.annotationid = anno.GetAnnoID();\n scribble_canvas.scribble_image = new Image();\n scribble_canvas.scribble_image.src = \"Scribbles/\"+main_media.GetFileInfo().GetDirName()+\"/\"+anno.GetScribbleName()+\"?t=\"+Math.random();\n scribble_canvas.setCurrentDraw(OBJECT_DRAWING);\n scribble_canvas.editborderrx = anno.GetCornerRX(); \n scribble_canvas.editborderlx = anno.GetCornerLX();\n scribble_canvas.editborderry = anno.GetCornerRY();\n scribble_canvas.editborderly = anno.GetCornerLY();\n scribble_canvas.scribble_image.onload = function(){\n scribble_canvas.redraw();\n }\n }", "function addBox(coin) {\nvar options = {\n width : \"18%\",\n height : \"25%\",\n content: \"Coin Pool Net Ratio\",\n tags: true,\n border: {\n type: 'line'\n },\n style: {\n fg: 'white',\n border: {\n fg: '#f0f0f0'\n },\n hover: {\n bg: 'green'\n }\n }\n}\nif (r == 1) {\n options.right = r\n} else {\n options.left = l\n}\noptions.label = \"{bold}\"+coin+\"{/bold}\";\nif (b == 1) {\n options.bottom = b;\n} else {\n options.top= t;\n}\nconsole.log(coin + t + b + l + r );\nbox[coin] = blessed.box( options);\n\n\n\nscreen.append(box[coin]);\n \n P++;\n l = P*20 + \"%\";\n \n if (P == '5' ) {\n r = '';\n rcount++;\n t = rcount * 25 + \"%\";\n l = '0%';\n P = 0;\n } \n \n \n\n}", "function textBox(x, y, w, h, textInside, typeIn){\r\n\tthis.objectType = typeIn;\r\n\tthis.pos = createVector(x, y);\r\n\tthis.size = createVector(w, h);\r\n\tthis.textInside = textInside;\r\n\tthis.id = objects.length;\r\n\tthis.boxcontain = new BoxContain(this);\r\n\r\n\tthis.show = function(){\r\n\t\tstrokeWeight(1);\r\n\t\ttextSize(this.size.y);\r\n\t\tif(typeIn == 'title' || typeIn == 'text'){\r\n\t\t\tif(typeIn == 'title'){\r\n\t\t\t\tif(info.title != this.textInside)\r\n\t\t\t\t\tthis.textInside = info.title;\r\n\t\t\t\tfill(VisualizeGui.titleColor);\r\n\t\t\t} else fill(VisualizeGui.textColor);\r\n\t\t\tnoStroke();\r\n\t\t\ttext(this.textInside, this.pos.x, this.pos.y);\r\n\t\t\r\n\t\t} else if(typeIn == 'time'){\r\n\t\t\tnoStroke();\r\n\t\t\tfill(255);\r\n\t\t\ttext(time(), this.pos.x, this.pos.y);\r\n\t\t}\r\n\t\ttextSize(20); // set textSize to default\r\n\t}\r\n\r\n\t// when delete one object , ID will change\r\n\tthis.updateID = function(newID){\r\n\t\tthis.id = newID;\r\n\t}\r\n\r\n\tthis.setPosition = function(x, y){\r\n\t\tthis.pos = createVector(x, y);\r\n\t}\r\n\r\n\tthis.setSize = function(w, h){\r\n\t\tthis.size = createVector(w, h);\r\n\t}\r\n\r\n\tthis.run = function(){\r\n\t\tthis.show();\r\n\r\n\t\tif(designMode)\r\n\t\t\tthis.boxcontain.show();\r\n\t}\r\n}", "function test_oneFieldBlock_blockClickShowsEditor() {\n svgTest_setUp();\n\n try {\n var block = svgTest_newOneFieldBlock();\n\n var showEditorCalled = false;\n block.getField('FIELD').showEditor_ = function() {\n showEditorCalled = true;\n };\n\n block.getSvgRoot().dispatchEvent(new Event('mouseup'));\n assertTrue('showEditor_() not called', showEditorCalled);\n } finally {\n svgTest_tearDown();\n }\n}", "BoardClick (nn, bb)\r\n {//style\r\n //nn = 0..63\r\n\r\n try\r\n {\r\n let ii0, jj0, ii1, jj1, mm, nnn, vv, ffull, ssearch, llst, ttmp, mmove0;\r\n let pp, ffst = 0, ssub;\r\n\r\n if (this.isSetupBoard) { this.SetupBoardClick(nn); return; }\r\n\r\n if (!this.isRecording) return;\r\n //if (this.isAutoPlay)\r\n this.SetAutoPlay(false);//TODO: to remove if, let just SetAutoPlay\r\n if (this.MoveCount == this.MaxMove) return;\r\n if (this.BoardClickMove (nn)) return;\r\n if (this.isDragDrop && (!bb)) return; //TODO: don't allow first click while drag & drop?\r\n\r\n //TODO: no need to check, there are only IDs now, no more indexes\r\n /*if (isRotated) nnn = 63 - nn;\r\n else */ nnn = nn;\r\n\r\n if (this.BoardClicked == nnn) { this.SetBoardClicked(-1); return; } //same pozition, reset and do nothing\r\n\r\n if (this.BoardClicked < 0) //click from\r\n {\r\n ii0 = nnn % 8;\r\n jj0 = 7 - (nnn - ii0) / 8;\r\n if (Math.sign(this.Board[ii0][jj0]) == 0) return;\r\n if (Math.sign(this.Board[ii0][jj0]) != ((this.MoveCount + 1) % 2) * 2 - 1)\r\n {\r\n mm=\"---\";\r\n if ((this.xdocument.BoardForm)&&(this.xdocument.BoardForm.PgnMoveText))\r\n this.ShortPgnMoveText[0][this.CurVar]=this.Uncomment(this.xdocument.BoardForm.PgnMoveText.value);\r\n ssearch=Math.floor(this.MoveCount/2+1)+\".\";\r\n ffst=this.ShortPgnMoveText[0][this.CurVar].indexOf(ssearch);\r\n if (ffst>=0)\r\n ssub=this.ShortPgnMoveText[0][this.CurVar].substring(0, ffst);\r\n else\r\n ssub=this.ShortPgnMoveText[0][this.CurVar];\r\n if (this.ParseMove(mm, false)==0) { this.SetBoardClicked(-1); return; } //TODO: throws error\r\n if (!isNullMove) return;\r\n if (this.MoveCount%2==0) { if (!confirm(\"White nullmove?\")) return; }\r\n else { if (!confirm(\"Black nullmove?\")) return; }\r\n for (vv=this.CurVar; vv<this.ShortPgnMoveText[0].length; vv++)\r\n {\r\n if ((vv==this.CurVar)||((this.ShortPgnMoveText[1][vv]==this.CurVar)&&(this.ShortPgnMoveText[2][vv]==this.MoveCount)))\r\n {\r\n ffull=this.Uncomment(this.ShortPgnMoveText[0][vv]);\r\n ssearch=Math.floor(this.MoveCount/2+2)+\".\";\r\n llst=ffull.indexOf(ssearch);\r\n ssearch=Math.floor(this.MoveCount/2+1)+\".\";\r\n ffst=ffull.indexOf(ssearch);\r\n if (ffst>=0)\r\n {\r\n ffst+=ssearch.length;\r\n if (llst<0) ttmp=ffull.substring(ffst);\r\n else ttmp=ffull.substring(ffst, llst);\r\n mmove0=this.GetMove(ttmp,this.MoveType);\r\n if ((mmove0.indexOf(mm)<0)&&(this.MoveType==1))\r\n {\r\n ttmp=Math.floor(this.MoveCount/2+1);\r\n ssearch=ttmp+\"....\";\r\n ffst=ffull.indexOf(ssearch);\r\n if (ffst < 0) { ssearch = ttmp + \". ...\"; ffst = ffull.indexOf (ssearch); }//TODO: isn't regex much better here?\r\n if (ffst < 0) { ssearch = ttmp + \". ..\"; ffst = ffull.indexOf (ssearch); }\r\n if (ffst < 0) { ssearch = ttmp + \" ...\"; ffst = ffull.indexOf (ssearch); }\r\n if (ffst < 0) { ssearch = ttmp + \"...\" ; ffst = ffull.indexOf (ssearch); }\r\n if (ffst < 0) { ssearch = ttmp + \" ..\" ; ffst = ffull.indexOf (ssearch); }\r\n if (ffst >= 0)\r\n {\r\n ffst+=ssearch.length;\r\n if (llst<0) ttmp=ffull.substring(ffst);\r\n else ttmp=ffull.substring(ffst, llst);\r\n mmove0=this.GetMove(ttmp,0);\r\n }\r\n }\r\n if (mmove0.indexOf(mm)==0)\r\n {\r\n this.SetMove(this.MoveCount+1, vv);\r\n vv=this.ShortPgnMoveText[0].length+1;\r\n //if (window.UserMove) setTimeout(\"UserMove(1,'\"+mmove0+\"')\",this.Delay/2, this); //TODO: review and remove\r\n }\r\n }\r\n }\r\n }\r\n if (vv<this.ShortPgnMoveText[0].length+1)\r\n {\r\n if ((this.RecordCount==0)&&(!((this.xdocument.BoardForm)&&(this.xdocument.BoardForm.PgnMoveText))))\r\n {\r\n vv=this.ShortPgnMoveText[0].length;\r\n this.ShortPgnMoveText[0][vv]=\"\";\r\n this.ShortPgnMoveText[1][vv]=this.CurVar;\r\n this.ShortPgnMoveText[2][vv]=this.MoveCount;\r\n this.CurVar=vv;\r\n }\r\n this.ParseMove(mm,true);\r\n //if (window.UserMove) setTimeout(\"UserMove(0,'\"+mm+\"')\",this.Delay/2, this); //TODO: review and remove\r\n if (this.MoveType==0)\r\n {\r\n this.HistMove[this.MoveCount-this.StartMove]=Math.floor((this.MoveCount+2)/2)+\".\"+mm;\r\n ssub+=Math.floor((this.MoveCount+2)/2)+\".\";\r\n }\r\n else\r\n {\r\n this.HistMove[this.MoveCount-this.StartMove]=Math.floor((this.MoveCount+2)/2)+\". ... \"+mm;\r\n if (this.MoveCount==this.StartMove) ssub+=Math.floor((this.MoveCount+2)/2)+\". ... \";\r\n else ssub+=this.HistMove[this.MoveCount-this.StartMove-1]+\" \";\r\n }\r\n if (this.RecordCount==0) this.RecordedMoves=this.HistMove[this.MoveCount-this.StartMove];\r\n else\r\n {\r\n ttmp=this.RecordedMoves.split(\" \");\r\n ttmp.length=this.RecordCount+((this.MoveCount-this.RecordCount)%2)*2;\r\n this.RecordedMoves=ttmp.join(\" \");\r\n if (this.MoveType==0) this.RecordedMoves+=\" \"+this.HistMove[this.MoveCount-this.StartMove];\r\n else this.RecordedMoves+=\" \"+mm;\r\n }\r\n this.RecordCount++;\r\n this.MoveCount++;\r\n this.MoveType=1-this.MoveType;\r\n if (this.xdocument.BoardForm)\r\n {\r\n if (this.xdocument.BoardForm.PgnMoveText) this.xdocument.BoardForm.PgnMoveText.value=ssub+mm+\" \";\r\n if (this.xdocument.BoardForm.Position)\r\n this.xdocument.BoardForm.Position.value=this.TransformSAN(this.HistMove[this.MoveCount-this.StartMove-1]);\r\n this.NewCommands.length=0;\r\n this.ExecCommands();\r\n this.RefreshBoard(); //TODO: what this does?\r\n }\r\n }\r\n }\r\n this.SetBoardClicked(nnn);\r\n return;\r\n } // this.BoardClicked < 0 => click from\r\n ii0=this.BoardClicked%8;\r\n jj0=7-(this.BoardClicked-ii0)/8;\r\n ii1=nnn%8;\r\n jj1=7-(nnn-ii1)/8;\r\n if (Math.abs(this.Board[ii0][jj0])==6)\r\n {\r\n if (ii0!=ii1) mm=String.fromCharCode(ii0+97)+\"x\";\r\n else mm=\"\";\r\n }\r\n else\r\n {\r\n mm=this.PieceName.charAt(Math.abs(this.Board[ii0][jj0])-1);\r\n if (this.Board[ii1][jj1]!=0) mm+=\"x\";\r\n }\r\n this.SetBoardClicked(-1);\r\n mm+=String.fromCharCode(ii1+97)+(jj1+1);\r\n if (Math.abs(this.Board[ii0][jj0])==1)\r\n {\r\n if (this.Piece[this.MoveType][0].Pos.Y==jj1)\r\n {\r\n if (this.Piece[this.MoveType][0].Pos.X+2==ii1) mm=\"O-O\";\r\n if (this.Piece[this.MoveType][0].Pos.X-2==ii1) mm=\"O-O-O\";\r\n if (this.Board[ii1][jj1]==(1-2*this.MoveType)*3) //for Chess960\r\n {\r\n if (ii1>ii0) mm=\"O-O\";\r\n if (ii1<ii0) mm=\"O-O-O\";\r\n }\r\n }\r\n }\r\n if ((this.xdocument.BoardForm)&&(this.xdocument.BoardForm.PgnMoveText))\r\n this.ShortPgnMoveText[0][this.CurVar]=this.Uncomment(this.xdocument.BoardForm.PgnMoveText.value);\r\n ssearch=Math.floor(this.MoveCount/2+1)+\".\";\r\n ffst=this.ShortPgnMoveText[0][this.CurVar].indexOf(ssearch);\r\n if (ffst>=0)\r\n ssub=this.ShortPgnMoveText[0][this.CurVar].substring(0, ffst);\r\n else\r\n ssub=this.ShortPgnMoveText[0][this.CurVar];\r\n if ((jj1==(1-this.MoveType)*7)&&(Math.abs(this.Board[ii0][jj0])==6)&&(Math.abs(jj0-jj1)<=1)&&(Math.abs(ii0-ii1)<=1))\r\n {\r\n pp=0;\r\n while(pp==0)\r\n {\r\n if (pp==0) { if (confirm(\"Queen \"+this.PieceName.charAt(1)+\" ?\")) pp=1; }\r\n if (pp==0) { if (confirm(\"Rook \"+this.PieceName.charAt(2)+\" ?\")) pp=2; }\r\n if (pp==0) { if (confirm(\"Bishop \"+this.PieceName.charAt(3)+\" ?\")) pp=3; }\r\n if (pp==0) { if (confirm(\"Knight \"+this.PieceName.charAt(4)+\" ?\")) pp=4; }\r\n }\r\n mm=mm+\"=\"+this.PieceName.charAt(pp);\r\n }\r\n pp=this.ParseMove(mm, false);\r\n if (pp==0) return;\r\n if (Math.abs(this.Board[ii0][jj0])!=1)\r\n {\r\n let mmm;\r\n if (Math.abs(this.Board[ii0][jj0])==6)\r\n {\r\n if (mm.charAt(1)==\"x\") mmm=mm.substr(0,1)+(jj0+1)+mm.substr(1,11);\r\n else mmm=String.fromCharCode(ii0+97)+(jj0+1)+mm;\r\n }\r\n else mmm=mm.substr(0,1)+String.fromCharCode(ii0+97)+(jj0+1)+mm.substr(1,11);\r\n if (this.ParseMove(mmm, false)==0) return;\r\n }\r\n if (pp > 1)\r\n {\r\n mm = mm.substr(0, 1) + String.fromCharCode (ii0 + 97) + mm.substr(1, 11);\r\n if (this.ParseMove(mm, false) != 1)\r\n {\r\n mm=mm.substr(0,1)+(jj0+1)+mm.substr(2,11);\r\n if (this.ParseMove(mm, false)!=1)\r\n mm=mm.substr(0,1)+String.fromCharCode(ii0+97)+(jj0+1)+mm.substr(2,11);\r\n }\r\n }\r\n for (vv = this.CurVar; vv<this.ShortPgnMoveText[0].length; vv++)\r\n {\r\n if ((vv==this.CurVar)||((this.ShortPgnMoveText[1][vv]==this.CurVar)&&(this.ShortPgnMoveText[2][vv]==this.MoveCount)))\r\n {\r\n ffull=this.Uncomment(this.ShortPgnMoveText[0][vv]);\r\n ssearch=Math.floor(this.MoveCount/2+2)+\".\";\r\n llst=ffull.indexOf(ssearch);\r\n ssearch=Math.floor(this.MoveCount/2+1)+\".\";\r\n ffst=ffull.indexOf(ssearch);\r\n if (ffst>=0)\r\n {\r\n ffst += ssearch.length;\r\n if (llst<0)\r\n ttmp=ffull.substring(ffst);\r\n else\r\n ttmp=ffull.substring(ffst, llst);\r\n mmove0=this.GetMove(ttmp,this.MoveType);\r\n if ((mmove0.indexOf(mm)<0)&&(this.MoveType==1))\r\n {\r\n ttmp=Math.floor(this.MoveCount/2+1);\r\n ssearch = ttmp + \"....\";\r\n ffst=ffull.indexOf(ssearch);\r\n if (ffst < 0 ) { ssearch = ttmp + \". ...\"; ffst=ffull.indexOf(ssearch); }\r\n if (ffst < 0 ) { ssearch = ttmp + \". ..\"; ffst=ffull.indexOf(ssearch); }\r\n if (ffst < 0 ) { ssearch = ttmp + \" ...\"; ffst=ffull.indexOf(ssearch); }\r\n if (ffst < 0 ) { ssearch = ttmp + \"...\"; ffst=ffull.indexOf(ssearch); }\r\n if (ffst < 0 ) { ssearch = ttmp + \" ..\"; ffst=ffull.indexOf(ssearch); }\r\n if (ffst >= 0 )\r\n {\r\n ffst+=ssearch.length;\r\n if (llst<0) ttmp=ffull.substring(ffst);\r\n else ttmp=ffull.substring(ffst, llst);\r\n mmove0=this.GetMove(ttmp,0);\r\n }\r\n }\r\n if ((mmove0.indexOf(mm)==0)&&(mmove0.indexOf(mm+mm.substr(1))!=0))\r\n {\r\n this.SetMove(this.MoveCount+1, vv);\r\n //if (window.UserMove) setTimeout(\"UserMove(1,'\"+mmove0+\"')\",this.Delay/2, this); //TODO: review and remove\r\n return;\r\n }\r\n }\r\n }\r\n }\r\n if ((this.RecordCount==0)&&(!((this.xdocument.BoardForm)&&(this.xdocument.BoardForm.PgnMoveText))))\r\n {\r\n vv=this.ShortPgnMoveText[0].length;\r\n this.ShortPgnMoveText[0][vv] = \"\";\r\n this.ShortPgnMoveText[1][vv] = this.CurVar;\r\n this.ShortPgnMoveText[2][vv] = this.MoveCount;\r\n this.CurVar = vv;\r\n }\r\n this.ParseMove(mm, true);\r\n if (this.IsCheck(this.Piece[1-this.MoveType][0].Pos.X, this.Piece[1-this.MoveType][0].Pos.Y, 1-this.MoveType)) mm+=\"+\";\r\n //if (window.UserMove) setTimeout(\"UserMove(0,'\"+mm+\"')\",this.Delay/2, this); //TODO: review and remove\r\n if (this.MoveType==0)\r\n {\r\n this.HistMove[this.MoveCount-this.StartMove]=Math.floor((this.MoveCount+2)/2)+\".\"+mm;\r\n ssub+=Math.floor((this.MoveCount+2)/2)+\".\";\r\n }\r\n else\r\n {\r\n this.HistMove[this.MoveCount-this.StartMove]=Math.floor((this.MoveCount+2)/2)+\". ... \"+mm;\r\n if (this.MoveCount==this.StartMove) ssub+=Math.floor((this.MoveCount+2)/2)+\". ... \";\r\n else ssub+=this.HistMove[this.MoveCount-this.StartMove-1]+\" \";\r\n }\r\n if (this.RecordCount==0) this.RecordedMoves=this.HistMove[this.MoveCount-this.StartMove];\r\n else\r\n {\r\n ttmp=this.RecordedMoves.split(\" \");\r\n ttmp.length=this.RecordCount+((this.MoveCount-this.RecordCount)%2)*2;\r\n this.RecordedMoves=ttmp.join(\" \");\r\n if (this.MoveType==0) this.RecordedMoves+=\" \"+this.HistMove[this.MoveCount-this.StartMove];\r\n else this.RecordedMoves+=\" \"+mm;\r\n }\r\n this.RecordCount++;\r\n this.MoveCount++;\r\n this.MoveType=1-this.MoveType;\r\n if (this.xdocument.BoardForm)\r\n {\r\n if (this.xdocument.BoardForm.PgnMoveText) this.xdocument.BoardForm.PgnMoveText.value=ssub+mm+\" \";\r\n if (this.xdocument.BoardForm.Position)\r\n this.xdocument.BoardForm.Position.value=this.TransformSAN(this.HistMove[this.MoveCount-this.StartMove-1]);\r\n this.NewCommands.length=0;\r\n this.ExecCommands();\r\n this.RefreshBoard(); //TODO: what this does?\r\n }\r\n }catch(e)\r\n {\r\n //alert(\"currentIVFChessGame.BoardClick>>error\" + e)\r\n throw(\"currentIVFChessGame.BoardClick>>rethrow error: \\n\" + e);\r\n }\r\n }", "static async _RectangleSelection(event){\n\t\t\tconst tool = game.activeTool;\n\t\t\tif(tool !== \"select\") return;\n\t\t\tif($(document.getElementById(\"tokenAttacher\")).find(\".control-tool.select.active\").length <= 0 ) return;\n\t\t\t$(document.getElementById(\"tokenAttacher\")).find(\".control-tool.select\")[0].classList.toggle(\"active\");\t\n\t\t\t\n\t\t\tconst {coords, originalEvent} = event.data;\n\t\t\tconst {x, y, width, height, releaseOptions={}, controlOptions={}}=coords;\n\t\t\tlet selected = {};\t\n\t\t\tconst baseId= canvas.scene.getFlag(moduleName, \"attach_base\").element;\t\t\n\t\t\tconst token = canvas.tokens.get(baseId);\n\t\t\tfor (const type of [\"AmbientLight\", \"AmbientSound\", \"Drawing\", \"MeasuredTemplate\", \"Note\", \"Tile\", \"Token\", \"Wall\"]) {\n\t\t\t\tconst layer = canvas.getLayerByEmbeddedName(type);\n\t\t\t\t//if (layer.options.controllableObjects) {\n\t\t\t\t\t// Identify controllable objects\n\t\t\t\t\tconst controllable = layer.placeables.filter(obj => obj.visible && (obj.control instanceof Function));\n\t\t\t\t\tconst newSet = controllable.filter(obj => {\n\t\t\t\t\t\tlet c = obj.center;\n\t\t\t\t\t\t//filter base out\n\t\t\t\t\t\tif(obj.data._id === baseId) return;\n\t\t\t\t\t\t//Filter attached elements except when they are already attached to the base\n\t\t\t\t\t\tconst parent = obj.getFlag(moduleName, 'parent') || \"\";\n\t\t\t\t\t\tif(parent !== \"\" && parent !== baseId) return;\n\t\t\t\t\t\t//filter all inside selection\n\t\t\t\t\t\treturn Number.between(c.x, x, x+width) && Number.between(c.y, y, y+height);\n\t\t\t\t\t});\t\t\n\t\t\t\t\tselected[type] = newSet.map(a => a.data._id);\n\t\t\t\t\tif(selected[type].length <= 0) delete selected[type];\t\t\n\t\t\t\t//}\n\t\t\t}\n\t\t\tif(selected.length === 0) return;\n\t\t\tTokenAttacher._attachElementsToToken(selected, token, false);\n\t\t\tui.notifications.info(game.i18n.format(localizedStrings.info.ObjectsAttached));\n\t\t}", "function syncBlocks() {\n let text = '';\n let board = document.querySelector('.board');\n let markup = document.querySelector('.schema');\n let c = board.children;\n console.log(c.children);\n \n for(let i = 0; i < c.length; i++) {\n text += renderTag(c[i]);\n } \n\n markup.innerHTML = text;\n}", "function snap() {\r\n\t\tvar snap = document.getElementById(\"snap\");\r\n\t\tif (snap.checked === true) {\r\n\t\t myDiagram.toolManager.draggingTool.isGridSnapEnabled = true;\r\n\t\t myDiagram.toolManager.resizingTool.isGridSnapEnabled = true;\r\n\t\t} else {\r\n\t\t myDiagram.toolManager.draggingTool.isGridSnapEnabled = false;\r\n\t\t myDiagram.toolManager.resizingTool.isGridSnapEnabled = false;\r\n\t\t}\r\n\t }", "function setupKnownBlocks(whites_reds){\n $(\".block\").remove();\n var numblocks = model.get_current_state_array().length -1;\n \n $(\"img\").css(\"height\", numblocks*15+75);\n \n for(var i=0; i<whites_reds[0]; i++){\n $(\".image-container\").append(\"<div class='block white-block block\"+i+\"'></div>\");\n $(\".block\"+i).css(\"top\",\"\"+(15*i+ parseInt($(\"img\").css(\"height\"))/2)+\"px\");\n }\n for(var i=whites_reds[0]; i<whites_reds[0]+whites_reds[1]; i++){\n $(\".image-container\").append(\"<div class='block red-block block\"+i+\"'></div>\");\n $(\".block\"+i).css(\"top\",\"\"+(15*i+parseInt($(\"img\").css(\"height\"))/2)+\"px\");\n }\n }", "function setupUnknownBlocks(){\n $(\".block\").remove();\n var numblocks = model.get_current_state_array().length -1;\n \n $(\"img\").css(\"height\", numblocks*15+75);\n \n for(var i=0; i<numblocks; i++){\n $(\".image-container\").append(\"<div class='block gray-block block\"+i+\"'>?</div>\");\n $(\".block\"+i).css(\"top\",\"\"+(15*i+parseInt($(\"img\").css(\"height\"))/2)+\"px\");\n }\n \n }", "function Nj(a,b){this.Wd=Dc(\"div\",\"blocklyToolboxDiv\");this.Wd.setAttribute(\"dir\",p?\"RTL\":\"LTR\");b.appendChild(this.Wd);this.Pa=new zh;a.appendChild(this.Pa.za());w(this.Wd,\"mousedown\",this,function(a){Xc(a)||a.target==this.Wd?we(!1):we(!0)})}", "function addBlocks (Blockly) {\n const QH_BEMFA_COLOR = '#5b67a5'\n const QH_BEMFA_ICO = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAAC4jAAAuIwF4pT92AAALhWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczpwaG90b3Nob3A9Imh0dHA6Ly9ucy5hZG9iZS5jb20vcGhvdG9zaG9wLzEuMC8iIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIiB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOCAoV2luZG93cykiIHhtcDpDcmVhdGVEYXRlPSIyMDE4LTA4LTEwVDE5OjI1OjI1KzA4OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDE5LTA0LTEyVDE0OjQzOjMwKzA4OjAwIiB4bXA6TW9kaWZ5RGF0ZT0iMjAxOS0wNC0xMlQxNDo0MzozMCswODowMCIgZGM6Zm9ybWF0PSJpbWFnZS9wbmciIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NWU5ZWIyZGMtM2U2ZC1kYzRlLTg5MmMtNmJjNjNmZjVkZmUwIiB4bXBNTTpEb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6YzBmYWUyM2QtZjEzZi02NTRhLTgyZWUtOTE3NWNjNGNiYTdiIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6MGViNzZhZTYtNTM4Ny00MDQxLWJhYzYtNjNhNDk4YzlkMGNmIiBwaG90b3Nob3A6Q29sb3JNb2RlPSIzIiBwaG90b3Nob3A6SUNDUHJvZmlsZT0ic1JHQiBJRUM2MTk2Ni0yLjEiIHRpZmY6T3JpZW50YXRpb249IjEiIHRpZmY6WFJlc29sdXRpb249IjMwMDAwMDAvMTAwMDAiIHRpZmY6WVJlc29sdXRpb249IjMwMDAwMDAvMTAwMDAiIHRpZmY6UmVzb2x1dGlvblVuaXQ9IjIiIGV4aWY6Q29sb3JTcGFjZT0iMSIgZXhpZjpQaXhlbFhEaW1lbnNpb249IjgwMCIgZXhpZjpQaXhlbFlEaW1lbnNpb249IjgwMCI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6MGViNzZhZTYtNTM4Ny00MDQxLWJhYzYtNjNhNDk4YzlkMGNmIiBzdEV2dDp3aGVuPSIyMDE4LTA4LTEwVDE5OjI1OjI1KzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOCAoV2luZG93cykiLz4gPHJkZjpsaSBzdEV2dDphY3Rpb249InNhdmVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjEyOTdhMjQ4LWEwYWUtZDA0OS1hMDE3LTRmMDBlYjc1NjdiMCIgc3RFdnQ6d2hlbj0iMjAxOC0wOC0yOVQxNzo1NzoxMCswODowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTggKFdpbmRvd3MpIiBzdEV2dDpjaGFuZ2VkPSIvIi8+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJzYXZlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDpkYmQ4OWExMy03OTMzLWQzNDUtYTIzNi1lZmIzYjkwYWY2NzAiIHN0RXZ0OndoZW49IjIwMTktMDQtMTJUMTQ6NDM6MzArMDg6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE4IChXaW5kb3dzKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0iY29udmVydGVkIiBzdEV2dDpwYXJhbWV0ZXJzPSJmcm9tIGFwcGxpY2F0aW9uL3ZuZC5hZG9iZS5waG90b3Nob3AgdG8gaW1hZ2UvcG5nIi8+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJkZXJpdmVkIiBzdEV2dDpwYXJhbWV0ZXJzPSJjb252ZXJ0ZWQgZnJvbSBhcHBsaWNhdGlvbi92bmQuYWRvYmUucGhvdG9zaG9wIHRvIGltYWdlL3BuZyIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6NWU5ZWIyZGMtM2U2ZC1kYzRlLTg5MmMtNmJjNjNmZjVkZmUwIiBzdEV2dDp3aGVuPSIyMDE5LTA0LTEyVDE0OjQzOjMwKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOCAoV2luZG93cykiIHN0RXZ0OmNoYW5nZWQ9Ii8iLz4gPC9yZGY6U2VxPiA8L3htcE1NOkhpc3Rvcnk+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOmRiZDg5YTEzLTc5MzMtZDM0NS1hMjM2LWVmYjNiOTBhZjY3MCIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOmVlZDRhMDdjLTQ5MjctODI0NC1iZDA0LTNkNmYzMzgwMzVmOSIgc3RSZWY6b3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjBlYjc2YWU2LTUzODctNDA0MS1iYWM2LTYzYTQ5OGM5ZDBjZiIvPiA8cGhvdG9zaG9wOkRvY3VtZW50QW5jZXN0b3JzPiA8cmRmOkJhZz4gPHJkZjpsaT5hZG9iZTpkb2NpZDpwaG90b3Nob3A6NDA4NTIwMjktNjMwZi0yZjRjLTlkMmItMGY0NGM4ZTI2YmFmPC9yZGY6bGk+IDxyZGY6bGk+eG1wLmRpZDowZWI3NmFlNi01Mzg3LTQwNDEtYmFjNi02M2E0OThjOWQwY2Y8L3JkZjpsaT4gPC9yZGY6QmFnPiA8L3Bob3Rvc2hvcDpEb2N1bWVudEFuY2VzdG9ycz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4WHlDIAAAXoUlEQVR4nNVdeXwUVbb+zq2q7vSaTifpbIQgCTvug4K4oI4O74k6g4jLqKOgojMuqKPOiAqKC6Lz1BGRUTYd3MYV1HFD4vIAFxBRNo0EWbIvZOlOd1dX3fv+qO6Q0EmnutPovO/3qx9J+m791Tn3nHvuuRcSQqArBr2RfeAXSYA6GKiFARLiwQFhAeDiABNAgIGCDJAEIAAIQLg4qE2CcHAIlw5o1FmdBAERAkgAzCgPZrSLIAEOYfzMAFD072SUq2prwsSBp2PVGat7GBgAQI4+erRWJNpDWsHS3eDPBa/Vhq8avsKu9l09fUwwXnkYBnEcgBUGoWnFfx6BFH1iP7Muv3eBQ3agtr0N71e/21MrCgzSYhKnwSCTAFjQsz6lhLS/kaQhcEBedCjQiCAEgWAonyBAERqY0MEPMMmj6r6l5duDW5SMTxDqoadI9DM5Wk6DQXTKoD7nwBAzugwTKBydszgAizE/ClkAsgAiDFAEoAMUIoiMaLsRAjJElAyjHlQC6QRBBnvCpylQSQZBQCWNdbASqDhNSPBBEhIF2X7h4utFtr6J1Uq6kAFSCcIiAKsAwgQ9pMPmsGPHlXusALRxbx6px77GXv8enDNoMhaeuAT17XU47l+j8NP0RilKpDZ4SZ4urBwQAIUZwAGeo3XOtz9NbuqVwF9UAkWRJiHALAiSoDALI4IS6mCPg+NskPEiIADIAtTKQC1si3CKmSJbW0O1cpxB2HHlHhkAxq08QF5v8C216fXTggwx2U8Rv9gcqBdGJASYlUIUoQ4WogDNpwCrhG6QB8Cw5l15EhhNflrN9ijvCyYGiRydwERX2yrBUFOzYDDUOGX8YgRShAQFKUTt0mQKsP0IsVs63ZjeEDMoEZxBfraLVckPN4mAFbLA7hsbFQBi/KqjTc1p9dOCCgAxeImvX3Pgz0ugIKNHSYDVKqOpTfoGYbwMHR5Iokdr2yNio+5gt+Q0ZjZSmP2+VW2Vyp4pUFvVVrRF2ro9LZEWdGiBzuo/TW9kANjg5blqf7/SIZ8DhU8jCjCAkzCMDTkoSEsRpKmdDnQqIBgqrsFJfmnF4Y8OvlPY6ZKBtkEbBefoahzDWggexWOMx9D3mIPdbxxaAhVBFCQZ0XmJOughqHQbOBlfPh1gAGPA3qrm4X8989bpD0ycv7FdbetGIBccimQBAOS58mUA8C21aU7m7Hf3h5ZAnQRCLELA7xCkJdCQFVPhdIGIUNNWgyGFA8N3nT5nHgC4LO5EVWQA/VbdGNI6Bwo7Z52tGvZtFAVpI/zsdXBkQYL5ec4kCIDfL/Dnk//yhE2x7+mjuAJADFqS0y/D0RVpkUCRrTPo3AI/42BChSAHBdhCROgyQBiBhkMAiRh2Nldj/JAxu68+7tpZJqqwulCtCkrfW0wsgSb6ETbBhEZWCjCdIqRSmP0JIWqBCoO8NEtcV6i6Cs6BO0+b8zD6UMvaYA3N+PgyXvxyASMJnaug/iIxgaKPDqIhK4pQCAE2jtpYBQJsARjk3oIA6YLEJOxubMQFR05eN3Hofz/ZV/l8W4H47Kd12jOjl55dVd34hN3isIqYk94PBUlMYG+GPubwSgAF2BDWIK0hP30CHWXpNBC9gUBoDbXA7bDinl/fd6/Zehsv+Vaa98nc+YqfrrPUZlRRB/uD8OqsP2NOzoh0j5xYoNIiCrAdCLEJnYbjZ4DEGOqbAvjTuBuWD8sd8b7ZevPKH7h2x95dQwZ4C8AjIpuapOWs0rIJEToG8kHLRpNIHI0BQJHo6iFEII0AjUABmgaVngCHPR2kERF0oSMYCaBdDaAjBEP6Y21Hh2jJADKtGfCHQxjgLsbG67eMcFndO8z0sat5Z/4xCw6vUBg53dbMmEMd1TIC7Px9kaVPB6cqhOkQRGNkAYQpg9rZBwjRSZD6sYqAoYZEQFOwGfvbw5AkoNiTi+F5o+uOyD9qT2HmANlmySAmMYTCITQHmtUttd9m72jeVtpQW4VbJt1+j1nyAODeNbP/0tIWdA4pKILOu8xNEgAIwM9+Q2HaJ1z8XFjFKrPt9k6giH6qIRbvs1CT9AV0OiIVUY+ByHitVW11CPk5hhUW4w9HTPry3JHnLT+i4Ohyr9O7G0Cwl+qstaNl6PaGbaNG5Y8uN9vnJ5Xlv3ru6+dvLM7xdievKywC0ABqllaKXO1CKOJlaNSngYknMGY5ZQGEGQMDh0pg1XJ5f8lTmIyGYDOamztw3GGHh68567qllx47bZ4sy305wDHwTLtnx9iSE0xLHgDcV37PXZwDGYqtdwIFOqWRmqWXyMX3CAdfDz2xK9EzgQSASJLqZMY9OqdmaT7CdAKU1MgjEBgDvm/YB7clA0umPrV42thrZgII9FW3v1i6YfFFq7d9ck5pQX7v5HWFDEAlsCrlRT44UgZZJIwXxhFIIWOhT0FGCBOnFnYUBejWlMkjAhc6dlbX48TBY2peuWTllPzMgnUpNZYkIrqK+Z/ef7fdAXRahL4gYGxNhKiE6qVZws6XAehVQ+IJbJRiDQlYuE4qTU1p9DDI04SG3dUNmD720u2LL3huLIC2VNtLFnPXzPnL91U/DR9SWAidJ7n8lQTIzyZBpRoAT/dWLM6OUoiMJ0wCKgHA2FRWFARD8nbXNOCGk67dsfiC58ahD/Law22oaa8CALy57TUUz8vGyU8fh+312wAAwUhvtiUe4UjIs+x/l92WYU9+7ABiG/1lpGFkX8Xi/xJ7CIBG3lTcFcYIu2rrcdmvLvrh8ckLTwDQ2ledfa17sbXuOwDA/mAz9lU3Y2vdtwjrIQjBEdKC0Li5LQyrktEy+zez3wsFgY5IMGr9kwR1bn/2ir6pIajJrhVlJqOisRonHDam8tmLXxgHYL+ZeoqkwK44AAAZsg3MCeQ6fJCZDCIGRlJSynDlCddcfNuEW1ZU1e9PNQATXe33jrQvvgiExmAjvFY7npv6wiUAmlNrp3ubPX/SNx6a9MgVpw09acePDTWQWZIJCaIzN6JXpJ9AAppbQpg1Yc68Ul/Z+qTqgmCJht7tFkMSLZIVLqsLgOFHpgDtkbMeu86uMLSr7anUT4i0EkggVLXX4NjiUfU3n3Lr/cnWd1icqGqrwvKNz1y2dMM/ns+225d0qP7l93x056IF6x89vz5Q75KSlSIARxcf89H0Y65+raa5DYzSKzPp3RMhIBgErjn+hidB8CdT9cemHwpuf2/mPR9WvHdBe5twO5wKBnh8UHUVz254Hku152fMdt+u/tfQcxbNPeOhOw7zliblhN8w/pa/rdj8z/MCET9scqqmOR6JXkfSnnNLaD/KsosCUw6f+lQy9RZ98fdzhjw8bN/r3757lcfmcZcWFiDflYOIroMgYZC3AKV5BbBIVsvzX712w9BHypqf/fqZs5Ppo8xXtv7c4ee+XdPadtCc2j8kIpBMlOlSmNDUHsJvR05Z6XF4GswO4O4P/3rhtStuXJnrdLAhviIozAohxIFwEwyfXggBu+LE0IIiuG12y+XLrl51X/ndF5ntBwB+O/q8lyEA0b+ErG6II0fIgJBBQoYkZABkLtdEgAMEnHjYBNOhoCfWPXrx3LfmvVhUmIXMjExTa1WN6/DaPCgs9OCuN+e+sOiLBZeY7e/EkpM/KMsuCqXTmJjxAzvMNOSP+DHYU9A+dsDYD82U316/tfSWf9+83JubAZtiAxfmpYILDrtihyfbipvfvnHJD407yszUy3bl1I8fePIHDQFTXymmg/32A01NGK2hAEbljd6W58lvBgDOeefTEx765MFZkRCUbHt2UuTFwAWHz5GDYIBbHii//7aeyggh4sYxJGfoNtP5WAIEkdhsp82mhyNAkXvATgAIdATQEeyAP+BHWA3Hla1pq7G+98M7k3xZDnMhpl6gcR35OS688/2bv93TsjvOtKqqCn/Aj45gBzqChtQVuooqIKHbHJsQfRRLn1PEAa8thwDAYXfA6XDC7XLDlmGLK7p+z9oL69pbcp2W/uem2BU7Gv3+3G9qNk05+DOr1Qq3yw2nwwmnw+jL58xjEoCD94JSRVq9SrfdbUrdN1Z/eSo0gNLQPcFIyd1St/lUM+XddjfJyUhgH0jvSsSkexWMBEVSapQAIpr9sK+lylxjXU8BpAHxK5F+fKeOkLl4HaX7vIsAJGau0WAwCF0/OECROuIJPCCTMSNuTkploL69TkcA2N26GwCgRlRke7LhzfR2K+qxeRl0I2Ld37koRkRp9tC479IeaEdtYy0sihGgKPGUYE/Tbp1J6RPCeHIkEXvI2PsVITPv1iID9f46W1ANGrsPgkef+MpjB45fL1nQLwscAwcHScBI3+i4fRYhRJdxGG5MbXuNTdUBSlNQoe9gAplLRrRJMvb6dx+JDGBgVgnCYcN94ZyDC94tCjJu4PgVxZ6CB1tCjZ5sW06/5sKW4H4MyipoPb543EsHf6bICgbml4CIjIi0BWhSG45M5wzS92sQ5qQ9y+bFpurvStfu/mwkABAzUkJkRY4LITktTv8FR/z+7ZbmCCSWuiTITML+ZhUXHXnZG5kZmXFbBrIsgxiBGMFisaCjI4BPK8uP8tiVvhs3NvGor++fNissQUJEAzbVbjwLACyKBVbFCkXuebBzfn3PvYOLirWdzVXJR4phkLeruQolBQWRO06d9WBPZRRZgdVi7ZwDN9ZuGLOlaccYj9WTdH+9IW0ECgjY7cCqba//zoyKZMj2iuem/vMqXQNq2uogJxFtlpmMOn8DIiqwZMryaxwW1w9m6r27450zVRWQKH1h0LT6gXkOH9bu2TDu/R3vjTVTfnzJKcvfuuK1P7YHNVQ07oPEKKF7QSDIjKGyaR9a21W8evmLfzq99MylZvpqD7bjlS0vXZHlsqTNiQbSTKBEEgQDnvri77earTNp+OSnNt20YdpwXwkq9tSgpr0OEX7AbsUI1XgEdf56/LCnGiVZBfhy5rpp5426cKHZfpZ8+fSMHxv2lnpt2X0XTgJpi8YAABcCJZ4crNzx7uS3t646zmy9owqOXfbNDd8XLbzo8VdG+IZhf3A/KptqUVlfi511NahsrEVDoAmDvYPEo1Mfevu7m3YOHzNg3DKz7bcF2vDE+sdmupxS2s+sJ3KkU4LCLJBlYPaHs/42acTZJ4GZ498iWauvHXvD1BnHX5f3fcO28zfXfjPhx6YKazAS1Euzy2xjisauHuEbuVBmctIJSbM+uH1OZcO+4UMLi6Clwffsit7T22LaQ4iPRyUAFxyDs4rw9d4tJ177+tV3PzXlGdM5zADAiNWN8I1eMMI3ekEy9YQQPWYfvLLppfEL1i2aPTAvJ+3kAT3JG+/yiOhfkhR7nXOU5OVg0frF9yxau+Cyfo+yFxgrjd4Ht61mS+n0N/6w0u1SYGWWVLqInSdOWKD7oDIEhE0IoQgGPbVDeQICCrMg1+vEtauuf3bFV8uvSraNvhAMd6CxpbHXnJe61urDJi799ecdXM3Od+RBTyHqDUAFxV0d0A3xEmjjgJ0Ddk4UISsI36ay9OaCI8uWCXBg/uqHHwSQmXCkuooPf3gXDa31vZZpD7bhy8rPsbnyG9Q01UCN9Dy77GrcOWjMgmM/3+uvyynzDjCdkNQNhmDvAkNFomI9e5QcgFUEhIu7wbGSQnR/5xGHJKDpGiCAWyfe+jT6yM6KCBXnL5uCBybMQ7PSgLyOQlx5xgyQlfDl11/i8a3zMSxrBGrq6zHl2PPhdXghd1nlxCRxzfcfDD93xdmfBLnqG5Y7ABE9BfIIQJggsvU3hIMn3GWMV2GbMB4LwH16BBrtgUvMjeYKmoZEDJVNdZg46rTNlx59+R19lWeMoTAzD5l2D9ZUrMFH36xGLLl2a8V3eGPT64iQhkJPHuxWe1z0ttXfghvfnDHr9MW/2U4SfGXZ/SBPJSBD/MjztLnCqyfM3+7dCgsAkgiKXN1OtfI8OPgEhOgks8kgQS0IWQLuPn3uHLNjl8jIasx35SFXy+98vZkuDwZ6i2GVLNHIDsHKrHBZXAAHFqx9dPJ95ffOr2ttKR3g88Im21IjDzBOJTCAF2kXQQGnSGK/LnFEWiVARYc+IGKjJmkKq5c/g4ahfWXqy0xCZe1+XH3i9FfHDTzhTbNjl0mBQ3aCC45cqw/MZrzNIlsxhC5gk+xQrBboXMfXNV8VvFfxzjlvVbxxc2VD7dCsTBtifl7KcUYdIJ3AC7XJwq1vQLjvgG9ieYruH1AYQTi4ELnaSdTGPkIHGw2555OYBEJjRxN8XjfuPPWuR82OfX+g2d2q77/91R9frN7XvmezVdgsH+9YQ9YMCz5uKAdTWPjz2rXZalg9csWuxeO+q98+MaQLZNkzUJpfAAj0z8+LEKAI8CxtolDE+4jQAQ4SwHRYggIsJJw8Ilz8OKqTb6EgzYUWPbrfpRNGhOaWEOaedfuyYk+J6Wz8J9c9ftOu1ro76sIr4VHcqLRU4OUXXoTggMOuwGvJxupdH0EwHRIY8l05kJjcpy/YJ3TjMI1w87dEln4F6WgizfyuTfxZuVUHnZULEsAEKCAZKq0I8Ewus1aWTW3sSYTpPOM2DgFGhH2tNRjsLQt9O3P7EInkfWYG8V3t5gHjnjp2u8vqcDoUh5FMBGFkLAgjOMvSnQuqR29gsoudws4vFS59PRhAfuOmOu7ROy+FSnRWLrlRRY9asEamQaM65POLhZ2fDFlsACdwnSMUAv464a77zZIHAHPXzH4gENSdLqurM9REIEgkQWJS+siLHRUx1LVRZOtX8VytDFa+HiozSE3SVUt+ZLF9VQ6INlJrHA1r+cDwKc5c23mVzXU4c/hpVZccfdl9Zptbte3NE1/ZtPLSQTm5adlkSojovCay9Pncp+UKF18MnaLEpTYNxM2BtaHuOeEFSBw/K/T7+M4ralUAbx+9dFjRkinL43M5EuCBj+fOlxRAZkpKSUamoBlxEW7nHwqvfikU1CFMB65m7AfiCByX/atuv//U2OMFh53YeX1t7Ai2OsQ7rHqAu9h05wvWP37RFzu/HldWUHBoyItdn5fB93K7uAQZ/FMoAlBZ9PC4MJ9O0QviCCw//atuvx/2ck5fbSgAuPwIicll5rNuW0Mt1v/57KF5LpeU/ns5BYyrRi1Ch1P/M3fwxyDIODwuI6quhyozIQlUXlUnAaDShXlJX2Tz4Mf337Srtmbg0KI0BzljJ+w9fDl3638EECQNabroKR79NW+xI9mmMHPtdQotILa9dtvxT6577MG8HGfyhwB7g25cRwAn3yDytZHcq10BJoIUIUOND9ENIilLYOWMOhkASp/I13sKOX66uxwvb30ePkceAGD2KfcrQ7KGSJAhZrx3+fEa1+CWMqH3VzQ4AE6AlVcLu5gmPLpxCYVKP8slGP1R4YSXHa7eVY6F/14C+ABxtyAA0nWvzgwhAlSM3PrUwKH527UmfTFCNBAkkr8W9sA8B+HmtyODzwcTB65ZPoR31nRFSgRWXlVvXF74TB7vbR832+YGfECZtwgwDI1e5i0C6QQ9HImomepqZFApa5auh5/NR5hkKCZvOtKMCyuEm/+LZ+pXgdBGYUJab4UziaSFvPKK+tgBPFPHHyqu28cA0JAFA4zysdVAGxMUII1n6Y/zIi1PZOnPdq4SeuNAhyFhGWIrL9CO5rnaBWBoo1idn0nquiKVWUIBwAf/I8/sq+55X4UACAJ1MA6gWeTr00W+fhSc/BMABlGxzS0dhpGwok549It5tjZa2Pg3UOmQWVezSEqFY27L4Gd8qpnXLe4WMgA2ZMGA3t2c6LIQQdKFIjaLPO006mCHI0ynIkKDwCHBIupgFV9BEeXgpJJGEMlcNXsIEReN6QNWRBXJZPkMGKreTU7O+vA0vFtdjhJHttESAVAAIQCK3XgfIQhHNLcsgqgDHP05dtU27/Jv7J59jgNiEVuqRde6wgJQ7D5rRP8uCQjFuOqg817qWBTmnN6jMDEko8JytGuz5Mk4oIDdcHLeqRCR9OUp/5JIhsDY1enJlO9R0SYV/w6ZdgkhPeGW6/8LmCXQAkP6zC4bLOj+nwF0w8is0TjMXYb2SFJHiv8j8X8D48AgBA7ImwAAAABJRU5ErkJggg==';\n\n //巴法云主题订阅\n Blockly.Blocks.QDP_tcp_device_cloud_subscription = {\n init: function () {\n this.jsonInit({\n message0: '%1',\n message1: Blockly.Msg.QDP_tcp_device_cloud_subscription,\n args0: [\n {\n type: 'field_image',\n src: QH_BEMFA_ICO,\n width: 40,\n height: 40\n }\n ],\n args1: [\n {\n type: 'field_dropdown',\n name: 'type',\n options:[[\"TCP创客云\",\"1\"], [\"TCP设备云\",\"2\"], [\"图云\",\"4\"]]\n },\n {\n type: \"field_input\",\n name: \"Key\",\n \"text\": \"d9efdd0413ec4b74ab0057a0b8675654\"\n },\n {\n type: \"field_input\",\n name: \"topic\",\n \"text\": \"led002\"\n },\n {\n type: \"input_dummy\"\n },\n {\n type: \"input_statement\",\n name: \"function\"\n }\n ],\n \"tooltip\": \"巴法云主题订阅\",\n colour:QH_BEMFA_COLOR,\n extensions: ['shape_statement']\n });\n }\n };\n\n //巴法云主题消息发送\n Blockly.Blocks.QDP_tcp_device_cloud_theme_push = {\n init: function () {\n this.jsonInit({\n message0: '%1',\n message1: Blockly.Msg.QDP_tcp_device_cloud_theme_push,\n args0: [\n {\n type: 'field_image',\n src: QH_BEMFA_ICO,\n width: 40,\n height: 40\n }\n ],\n args1: [\n {\n type: 'field_dropdown',\n name: 'type',\n options:[[\"TCP创客云\",\"1\"], [\"TCP设备云\",\"2\"], [\"图云\",\"4\"]]\n },\n {\n type: \"field_input\",\n name: \"Key\",\n \"text\": \"d9efdd0413ec4b74ab0057a0b8675654\"\n },\n {\n type: \"field_input\",\n name: \"topic\",\n \"text\": \"led002\"\n },\n {\n type: \"input_value\",\n name: \"data\"\n }\n ],\n \"tooltip\": \"巴法云主题消息发送\",\n colour:QH_BEMFA_COLOR,\n extensions: ['shape_statement']\n });\n }\n };\n\n //串口打印\n Blockly.Blocks.serialPrint = {\n init: function () {\n this.jsonInit({\n message0: Blockly.Msg.serialPrint,\n args0: [\n {\n type: 'field_dropdown',\n name: 'type',\n options:[[(Blockly.Msg.println),\"println\"], [(Blockly.Msg.print),\"print\"]]\n },\n {\n type: 'input_value',\n name: 'VALUE'\n }\n ],\n \"tooltip\": \"串口打印\",\n colour:QH_BEMFA_COLOR,\n extensions: ['shape_statement']\n });\n }\n };\n\n //变量get\n Blockly.Blocks.QH_variables_get = {\n init: function () {\n this.jsonInit({\n message0: '%1',\n args0: [\n {\n type: 'input_value',\n name: 'VAR'\n } \n ],\n \"tooltip\": \"获取变量\",\n colour:QH_BEMFA_COLOR,\n extensions: ['output_number']\n });\n } \n };\n\n return Blockly;\n}", "function draw() {\n\n // If not visible stop.\n var element = get_selected_element();\n if (check_with_parents(element, \"display\", \"none\", \"==\") === true || check_with_parents(element, \"opacity\", \"0\", \"==\") === true || check_with_parents(element, \"visibility\", \"hidden\", \"==\") === true) {\n return false;\n }\n\n // selected boxed.\n draw_box(\".yp-selected\", 'yp-selected-boxed');\n\n // Select Others.\n iframe.find(\".yp-selected-others:not(.yp-multiple-selected)\").each(function (i) {\n draw_other_box(this, 'yp-selected-others', i);\n });\n\n // Tooltip\n draw_tooltip();\n\n // Dragger update.\n update_drag_handle_position();\n\n }", "function checkBlocks(block) {\n let cmdBlock = null;\n SnapActions.traverse(block, block => {\n if (block.selector === 'doFaceTowards') cmdBlock = block;\n });\n if (!cmdBlock) return done('Did not traverse the cmd block');\n done();\n }", "addControls() {\n console.log('add controls',this.top_element);\n var html = `\n <div class='control_div'>\n <div id='marker' class='dragthing rounded-sm'><img src='/annotation/marker-blue.svg'/></div>\n <div id='arrow' class='dragthing rounded-sm'><img src='/annotation/myarrow.svg'/></div>\n <div id='circle' class='dragthing rounded-sm'><img src='/annotation/circle.svg'/></div>\n <div id='rect' class='dragthing rounded-sm'><img src='/annotation/rect.svg'/></div>\n <div id='text' class='dragthing rounded-sm'><img src='/annotation/text.svg'/></div>\n <div class='palette fill'>\n <span>Fill</span>\n <span class='palette-box' data-color=\"#000000\"></span>\n <span class='palette-box' data-color=\"#575757\"></span>\n <span class='palette-box' data-color=\"#ad2323\"></span>\n <span class='palette-box' data-color=\"#2a4bd7\"></span>\n <span class='palette-box' data-color=\"#1d6914\"></span>\n <span class='palette-box' data-color=\"#814a19\"></span>\n <span class='palette-box' data-color=\"#8126c0\"></span>\n <span class='palette-box' data-color=\"#a0a0a0\"></span>\n <span class='palette-box' data-color=\"#81c57a\"></span>\n <span class='palette-box' data-color=\"#9dafff\"></span>\n <span class='palette-box' data-color=\"#29d0d0\"></span>\n <span class='palette-box' data-color=\"#ff9233\"></span>\n <span class='palette-box' data-color=\"#ffee33\"></span>\n <span class='palette-box' data-color=\"#e9debb\"></span>\n <span class='palette-box' data-color=\"#ffcdf3\"></span>\n <span class='palette-box' data-color=\"#ffffff\"></span>\n <span class='palette-box' data-color=\"\"></span>\n </div>\n <div class='palette stroke'>\n <span>Line</span>\n <span class='palette-box' data-color=\"#000000\"></span>\n <span class='palette-box' data-color=\"#575757\"></span>\n <span class='palette-box' data-color=\"#ad2323\"></span>\n <span class='palette-box' data-color=\"#2a4bd7\"></span>\n <span class='palette-box' data-color=\"#1d6914\"></span>\n <span class='palette-box' data-color=\"#814a19\"></span>\n <span class='palette-box' data-color=\"#8126c0\"></span>\n <span class='palette-box' data-color=\"#a0a0a0\"></span>\n <span class='palette-box' data-color=\"#81c57a\"></span>\n <span class='palette-box' data-color=\"#9dafff\"></span>\n <span class='palette-box' data-color=\"#29d0d0\"></span>\n <span class='palette-box' data-color=\"#ff9233\"></span>\n <span class='palette-box' data-color=\"#ffee33\"></span>\n <span class='palette-box' data-color=\"#e9debb\"></span>\n <span class='palette-box' data-color=\"#ffcdf3\"></span>\n <span class='palette-box' data-color=\"#ffffff\"></span>\n <span class='palette-box' data-color=\"\"></span>\n </div>\n <div><span class='delete btn btn-primary'>&#9003;</span</div> \n </div>\n `;\n $(this.top_element).append(html);\n this.control_element = $('.control_div',this.top_element).get(0);\n this.top_element.tabIndex=1000;\n\n // For each individual little colored box, set color = data\n $('.palette-box',this.control_element).each(function(){\n var c = $(this).data('color');\n if(c.length>0) $(this).css('background-color',c);\n });\n\n // color controls: clicking fill or stroke\n var self=this;\n $('.fill .palette-box',this.control_element).on('click',function(){\n var obj = self.canvas.getActiveObject();\n var c = $(this).data('color');\n console.log('click fill color',obj,c,this);\n obj.set({fill:$(this).data('color')});\n self.canvas.renderAll();\n });\n\n $('.stroke .palette-box',this.control_element).on('click',function(){\n var obj = self.canvas.getActiveObject();\n var c = $(this).data('color');\n obj.set({stroke:c});\n if(obj.my_text_obj && c != '') obj.my_text_obj.set({fill:c,stroke:c});\n self.canvas.renderAll();\n });\n\n // delete if button pressed or ke pressed.\n var delete_selected = function() {\n var obj = self.canvas.getActiveObject();\n if(obj) {\n if(obj.my_text_obj) self.canvas.remove(obj.my_text_obj);\n self.canvas.remove(obj);\n self.canvas.renderAll();\n }\n }\n\n $('.delete',this.control_element).on('click',delete_selected);\n\n\n // undo/redo\n this.top_element.addEventListener('keydown',function(event){\n console.log('keydown',event.key);\n switch(event.key) {\n case \"Backspace\":\n case \"Delete\":\n delete_selected();\n break;\n case \"z\":\n //https://github.com/lyzerk/fabric-history#readme\n if(event.ctrlKey || event.metaKey){\n self.canvas.undo();\n }\n break;\n case \"Z\":\n if(event.ctrlKey || event.metaKey){\n self.canvas.redo();\n }\n break;\n }\n },false);\n\n\n // If you start dragging a thing, put it's id in the drag info\n $('.dragthing',this.canvas_element).on('dragstart',function(ev){\n ev.originalEvent.dataTransfer.setData(\"text\", this.id);\n });\n\n }", "getLogicalBox() {\n let rv = {};\n if (!this.updatedMetrics) {\n this._calculateBlockIndex();\n }\n const adjBox = (box) => {\n const nbox = svgHelpers.smoBox(box);\n nbox.y = nbox.y - nbox.height;\n return nbox;\n };\n this.blocks.forEach((block) => {\n if (!rv.x) {\n rv = svgHelpers.smoBox(adjBox(block));\n } else {\n rv = svgHelpers.unionRect(rv, adjBox(block));\n }\n });\n return rv;\n }", "function enableDragTitleToggle()\n{ \n $(\".msm_element_title_containers\").each(function() {\n $(this).mouseover(function() {\n $(this).children(\"span\").each(function(){\n $(this).css({\n \"visibility\": \"visible\",\n \"color\": \"#4e6632\",\n \"opacity\": \"0.5\",\n \"cursor\": \"move\",\n \"display\": \"inline\"\n });\n });\n });\n $(this).mouseout(function() {\n $(this).children(\"span\").css(\"visibility\", \"hidden\");\n });\n $(this).mouseup(function() {\n $(this).children(\"span\").css(\"visibility\", \"hidden\");\n });\n });\n \n $(\".msm_intro_child_dragareas\").each(function() {\n $(this).children(\"span\").css(\"display\", \"inline\");\n $(this).mouseover(function() {\n $(this).children(\"span\").each(function(){\n $(this).css({\n \"visibility\": \"visible\",\n \"color\": \"#4e6632\",\n \"opacity\": \"0.5\",\n \"cursor\": \"move\",\n \"display\": \"inline\"\n });\n });\n });\n $(this).mouseout(function() {\n $(this).children(\"span\").css(\"visibility\", \"hidden\");\n });\n $(this).mouseup(function() {\n $(this).children(\"span\").css(\"visibility\", \"hidden\");\n });\n });\n \n $(\".msm_associate_info_headers\").each(function() {\n $(this).mouseover(function() {\n $(this).children(\"span\").css({\n \"visibility\": \"visible\",\n \"color\": \"#4e6632\",\n \"opacity\": \"0.5\",\n \"cursor\": \"move\",\n \"display\": \"inline\"\n });\n });\n $(this).mouseout(function() {\n $(this).children(\"span\").css({\n \"visibility\": \"hidden\",\n \"display\": \"none\"\n });\n });\n $(this).mouseup(function() {\n $(this).children(\"span\").css({\n \"visibility\": \"hidden\",\n \"display\": \"none\"\n });\n });\n }); \n \n $(\".msm_theorem_statement_title_containers\").each(function(){\n $(this).mouseover(function() {\n $(this).children(\"span\").css({\n \"visibility\": \"visible\",\n \"color\": \"#4e6632\",\n \"opacity\": \"0.5\",\n \"cursor\": \"move\",\n \"display\": \"inline\"\n });\n });\n $(this).mouseout(function() {\n $(this).children(\"span\").css(\"visibility\", \"hidden\");\n });\n $(this).mouseup(function() {\n $(this).children(\"span\").css(\"visibility\", \"hidden\");\n });\n });\n \n $(\".msm_theorem_part_title_containers\").each(function() { \n $(this).children(\"span\").css(\"display\", \"inline\");\n $(this).mouseover(function() {\n $(this).children(\"span\").css({\n \"visibility\": \"visible\",\n \"color\": \"#4e6632\",\n \"opacity\": \"0.5\",\n \"cursor\": \"move\",\n \"display\": \"inline\"\n });\n });\n $(this).mouseout(function() {\n $(this).children(\"span\").css(\"visibility\", \"hidden\");\n });\n $(this).mouseup(function() {\n $(this).children(\"span\").css(\"visibility\", \"hidden\");\n });\n });\n \n $(\".msm_theoremref_statement_title_containers\").each(function(){\n $(this).mouseover(function() {\n $(this).children(\"span\").css({\n \"visibility\": \"visible\",\n \"color\": \"#4e6632\",\n \"opacity\": \"0.5\",\n \"cursor\": \"move\",\n \"display\": \"inline\"\n });\n });\n $(this).mouseout(function() {\n $(this).children(\"span\").css(\"visibility\", \"hidden\");\n });\n $(this).mouseup(function() {\n $(this).children(\"span\").css(\"visibility\", \"hidden\");\n });\n });\n \n $(\".msm_theoremref_part_title_containers\").each(function() {\n $(this).children(\"span\").css(\"display\", \"inline\");\n $(this).mouseover(function() {\n $(this).children(\"span\").css({\n \"visibility\": \"visible\",\n \"color\": \"#4e6632\",\n \"opacity\": \"0.5\",\n \"cursor\": \"move\",\n \"display\": \"inline\"\n });\n });\n $(this).mouseout(function() {\n $(this).children(\"span\").css(\"visibility\", \"hidden\");\n });\n $(this).mouseup(function() {\n $(this).children(\"span\").css(\"visibility\", \"hidden\");\n });\n });\n}", "function Elements() {\n\t\t// crtanje celog 'canvasa' datih dimenzija i boja\n\t\tctx.fillStyle = \"black\";\n\t\tctx.fillRect(0, 0, canWidth, canHeight);\n\t\tctx.fillStyle = \"white\";\n\t\tctx.strokeRect(0, 0, canWidth, canHeight);\n\t\t\n\t\t// glava\n\t\tvar newX = snake_parts[0].x; // uzimamo uvek X koor Glave zmije\n\t\tvar newY = snake_parts[0].y; // uzimamo uvek Y koor Glave zmije\n\t\t\n\t\t// smer pomeranja - POMERANJE\n\t\tif (direction == \"right\") { newX++; }\n\t\telse if (direction == \"left\") { newX--; }\n\t\telse if (direction == \"up\") { newY++; }\n\t\telse if (direction == \"down\") { newY--; }\n\t\t\n\t\t// provera sudara sa zidom ili sa telom zmije\n\t\tif (newX == -1 || newX == canWidth/snakeBodyWidth || newY == -1 || newY == canHeight/snakeBodyWidth || sudar(newX, newY, snake_parts)) {\n\t\t\tif(newX == -1) {\n\t\t\t\tnewX = canWidth/snakeBodyWidth;\n\t\t\t}\n\t\t\telse if(newX == canWidth/snakeBodyWidth) {\n\t\t\t\tnewX = 0;\n\t\t\t}\n\t\t\telse if(newY == -1) {\n\t\t\t\tnewY = canHeight/snakeBodyWidth;\n\t\t\t}\n\t\t\telse if(newY == canHeight/snakeBodyWidth) {\n\t\t\t\tnewY = 0;\n\t\t\t}\n\t\t\telse if ( sudar(newX, newY, snake_parts) ) {\n\t\t\t\tconsole.log(2);\n\t\t\talert(\"Game Over\");\n\t\t\tlocation.reload();\n\t\t\t}\n\t\t}\n\t\t\n\t\t\t// zmija jede metu - nastavlja da se krece\n\t\t\tif (newX == target.x && newY == target.y) {\n\t\t\t\tvar nDeoTela = { x: newX, y: newY }\n\t\t\t\tscore++;\n\t\t\t\tcreateTarget();\n\t\t\t}\n\t\t\t// kretanje\n\t\t\telse {\n\t\t\t\tvar nDeoTela = snake_parts.pop();\n\t\t\t\tnDeoTela.x = newX; nDeoTela.y = newY;\n\t\t\t}\n\t\t\t\n\t\t\tsnake_parts.unshift(nDeoTela); // produzuje zmiju ako pojede metu ili prebacuje postojeci zadnji deo (rep), na pocetku (na mestu glave)\n\t\t\n\t\t\tctx.fillText(\"Your score: \" + score, 10, 440);\n\t\t\n\t\t// crtanje zmije\n\t\tfor(var i=0; i<snake_parts.length; i++) {\n\t\tvar partInc = snake_parts[i];\n\t\tctx.fillStyle = \"green\";\n\t\tctx.beginPath();\n\t\tctx.arc(partInc.x*snakeBodyWidth + snakeBodyWidth/2, partInc.y*snakeBodyWidth + snakeBodyWidth/2,snakeBodyWidth/2, 0, 2 * Math.PI);\n\t\tctx.fill();\n\t\tctx.strokeStyle = '#003300';\n\t\tctx.stroke();\n\n\t\t}\n\t\t\n\t\t// crtanje mete\n\t\tctx.fillStyle = \"yellow\";\n\t\tctx.fillRect(target.x*snakeBodyWidth, target.y*snakeBodyWidth, snakeBodyWidth, snakeBodyWidth);\t\n\t}", "static PickRectObjects() {}", "enableObjectSelection() {\n const state = this.canvasStates[this.currentStateIndex];\n const scribbles = this.getFabricObjectsFromJson(state);\n\n this.rehydrateCanvas(scribbles, (scribble) => {\n if (scribble.type === 'i-text') {\n scribble.setControlsVisibility({\n bl: false,\n br: false,\n mb: false,\n ml: false,\n mr: false,\n mt: false,\n tl: false,\n tr: false,\n });\n }\n });\n }", "changeBlockUp(){\n this.brickSpawner.changeBlockType(1);\n this.updateUI();\n }", "function currentBlockIsChanged () {\n //Changes tools display on toolbar\n //Depens on the type of the current block\n toggleControlModule();\n \n //Update which blocks should be displayed on canvas\n //All blocks be of desination positon of bookmark should be hidden\n //Only one of them can be shown on page, which is the child of selected block\n updateBlocks();\n}", "function CALCULATE_TOUCH_DOWN_OR_MOUSE_DOWN() {\r\n \r\nif (GLOBAL_CLICK.CLICK_TYPE == \"right_button\") {\r\n \r\nfor (var x=0;x<HOLDER.length;x++){\r\n \r\n\tif (GET_DISTANCE_FROM_OBJECT.VALUE(x) < HOLDER[x].FI ) {\r\n\t\r\n\tHOLDER[x].FOKUS('R');\r\n HOLDER[x].SHOW_MENU();\r\n GLOBAL_CLICK.CLICK_PRESSED = true;\r\n \r\n E(\"NAME_OF_SELECTED\").value = HOLDER[x].NAME;\r\n E(\"NAME_OF_SELECTED\").dataset.index_ = x;\r\n \r\n VOICE.SPEAK(\"Object \" + HOLDER[x].NAME + \" SELECTED . \");\r\n \r\n }else {\r\n HOLDER[x].HIDE_MENU(x);\r\n }\r\n \r\n}\r\n/////////////\r\n//right\r\n//////////// \r\n}\r\nelse if (GLOBAL_CLICK.CLICK_TYPE == \"left_button\"){\r\n\r\nfor (var x=0;x<HOLDER.length;x++){\r\n if (GET_DISTANCE_FROM_OBJECT.VALUE(x) < HOLDER[x].FI ) {\r\n \r\n\t\r\n\tHOLDER[x].FOKUS('L');\r\n\t HOLDER[x].SHOW_MENU('L');\r\n HOLDER[x].SELECTED = true;\r\n \r\n \r\n \r\n \r\n GLOBAL_CLICK.CLICK_PRESSED = true;\r\n \r\n \r\n \r\n E(\"NAME_OF_SELECTED\").value = HOLDER[x].NAME;\r\n E(\"NAME_OF_SELECTED\").dataset.index_ = x;\r\n \r\n //VOICE.SPEAK(\"Object \" + HOLDER[x].NAME + \" SELECTED . \");\r\n \r\n }else {\r\n \r\n HOLDER[x].HIDE_MENU(x);\r\n \r\n \r\n }\r\n }\r\n}\r\n \r\n\r\n\r\n\r\n\r\n }", "function refresh(e) {\n var highlightClass = 'sc-cb-highlight-for-insert';\n var newDate = new Date();\n if ((!lastCall) || (newDate.getTime() - lastCall.getTime() > 1000)) {\n // console.log('refreshed contentblock and modules');\n lastCall = newDate;\n refreshDomObjects();\n }\n // find the closest content-blocks and modules\n var currentCoords = new ___WEBPACK_IMPORTED_MODULE_0__[\"PositionCoordinates\"](e.clientX, e.clientY);\n if (___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].config.innerBlocks.enable && ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].contentBlocks)\n ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].nearestCb = findNearest(___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].contentBlocks, currentCoords);\n if (___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].config.modules.enable && ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].modules)\n ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].nearestMod = findNearest(___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].modules, currentCoords);\n // hide the buttons for content-block or module, if they are not affected\n ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].modActions.toggleClass('sc-invisible', ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].nearestMod === null);\n ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].cbActions.toggleClass('sc-invisible', ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].nearestCb === null);\n var oldParent = ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].main.parentNode;\n if (___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].nearestCb !== null || ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].nearestMod !== null) {\n var alignTo = ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].nearestCb || ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].nearestMod;\n // find parent pane to highlight\n var parentPane = Object(_interfaces_sxc_controller_in_page__WEBPACK_IMPORTED_MODULE_1__[\"$jq\"])(alignTo.element).closest(___WEBPACK_IMPORTED_MODULE_0__[\"QeSelectors\"].blocks.mod.listSelector);\n var parentCbList = Object(_interfaces_sxc_controller_in_page__WEBPACK_IMPORTED_MODULE_1__[\"$jq\"])(alignTo.element).closest(___WEBPACK_IMPORTED_MODULE_0__[\"QeSelectors\"].blocks.cb.listSelector);\n var parentContainer = (parentCbList.length ? parentCbList : parentPane)[0];\n provideCorrectAddButtons(parentContainer);\n // put part of the pane-name into the button-labels\n if (parentPane.length > 0) {\n var paneName_1 = parentPane.attr('id') || '';\n if (paneName_1.length > 4)\n paneName_1 = paneName_1.substr(4);\n ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].modActions.filter('[titleTemplate]').each(function () {\n var t = Object(_interfaces_sxc_controller_in_page__WEBPACK_IMPORTED_MODULE_1__[\"$jq\"])(this);\n t.attr('title', t.attr('titleTemplate').replace('{0}', paneName_1));\n });\n }\n positionAndAlign(___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].main, alignTo);\n // Keep current block as current on menu\n ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].main.activeContentBlock = ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].nearestCb ? ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].nearestCb.element : null;\n ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].main.activeModule = ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].nearestMod ? ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].nearestMod.element : null;\n ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].main.parentNode = parentContainer;\n Object(_interfaces_sxc_controller_in_page__WEBPACK_IMPORTED_MODULE_1__[\"$jq\"])(parentContainer).addClass(highlightClass);\n }\n else {\n ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].main.parentNode = null;\n ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].main.hide();\n }\n // if previously a parent-pane was highlighted, un-highlight it now\n if (oldParent && oldParent !== ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].main.parentNode)\n Object(_interfaces_sxc_controller_in_page__WEBPACK_IMPORTED_MODULE_1__[\"$jq\"])(oldParent).removeClass(highlightClass);\n}", "function ClickBlock() {\n // for(let i = 0; i < itemEls.length; i++){\n // itemEls[i].style.pointerEvents = 'none';\n // }\n // setTimeout(()=>{\n // for(let i = 0; i < itemEls.length; i++){\n // itemEls[i].style.pointerEvents = 'auto';\n // }\n // }, 210);\n }", "constructor(layout, game, location, properties, underlay) {\n let that = this;\n\n this.location = location;\n\n this.properties = properties;\n this.state = {};\n this._itemInstances = {};\n\n let div = layout;\n\n let itemLayout;\n let updateItemPositions;\n let removeItem;\n if (properties.layout === \"stack\") {\n let itemsLayout = div.packed().overlay();\n itemsLayout.$.addClass(\"stack\");\n itemLayout = function () {\n return itemsLayout.overlay().packed();\n };\n updateItemPositions = function () {\n let widthToDivide = 0.3; // 30%\n let children = [];\n let randomFound = null;\n for (const key in that._itemInstances) {\n let i = that._itemInstances[key];\n if (\n i.item.properties.hidden === undefined &&\n i.item.properties.invisible === undefined\n ) {\n children.push(i);\n }\n if (i.item.properties.random !== undefined) {\n randomFound = i;\n }\n }\n if (randomFound !== null) {\n let filtered = [];\n for (const i of children) {\n if (i.infinite || i === randomFound) {\n filtered.push(i);\n }\n }\n children = filtered;\n }\n let n = children.length;\n if (n === 0) {\n return;\n }\n if (n === 1) {\n children[0].$.parent().css({\n left: 0,\n top: 0,\n });\n return;\n }\n for (const key in children) {\n let angle = Math.PI / 2 + ((Math.PI * 2.0) / n) * key;\n children[key].$.parent().css({\n left: Math.round(Math.cos(angle) * 100 * widthToDivide) + \"%\",\n top: Math.round(Math.sin(angle) * 100 * widthToDivide) + \"%\",\n });\n }\n };\n removeItem = function (i) {\n i.$.parent().remove(); //TODO Upgrade Layout class to handle remove/addClass/removeClass/attr on set()\n updateItemPositions();\n };\n } else {\n let cellLayout;\n if (properties.layout === \"vertical\") {\n cellLayout = div.vertical();\n } else {\n cellLayout = div.horizontal();\n }\n itemLayout = function () {\n return cellLayout.add();\n };\n updateItemPositions = function () {\n let stackableItems = [];\n for (const key in that._itemInstances) {\n if (that._itemInstances[key].item.properties.stackable !== undefined) {\n stackableItems.push(that._itemInstances[key]);\n }\n }\n for (const key in stackableItems) {\n if (key < stackableItems.length - 1) {\n stackableItems[key].$.addClass(\"stacking\");\n } else {\n stackableItems[key].$.removeClass(\"stacking\");\n }\n }\n };\n removeItem = function (i) {\n i.$.remove();\n updateItemPositions();\n };\n }\n\n div.$.addClass(\"spot\")\n .attr(\"data-location\", location)\n .attr(\"data-id\", \"spot:\" + location);\n for (const key in properties) {\n if (key !== \"layout\") {\n div.$.addClass(\"property-\" + key);\n }\n }\n\n let overlayDiv = layout.underlay();\n overlayDiv.$.addClass(\"overlay\");\n\n if (underlay !== undefined) {\n let underlayDiv = layout.underlay();\n underlayDiv.set(underlay);\n underlayDiv.$.addClass(\"underlay\");\n }\n\n this.$ = div.$;\n\n let updateRandom = function () {\n let randomFound = null;\n let total = 0;\n for (const key in that._itemInstances) {\n let i = that._itemInstances[key];\n if (i.item.properties.random !== undefined && !i.infinite) {\n randomFound = i;\n } else if (i.item.properties.hidden === undefined && !i.infinite) {\n total += i.count;\n }\n }\n div.$.removeClass(\"random\");\n if (randomFound !== null) {\n div.$.addClass(\"random\");\n randomFound.setState(\"auto_flag\", \"\" + total);\n }\n };\n /**\n * destroys the infos in the given instance\n * @param instance\n */\n let destroy = function (instance) {\n if (instance.faceIcon !== null) {\n instance.faceIcon.destroy();\n game.friendFaces.remove(instance.faceIcon);\n }\n\n instance.spot = null;\n //%% instance.$.addClass(\"destroyed\"); // In case it is cached somewhere\n game.dragAndDropManager.unconfigureItemInstance(instance);\n removeItem(instance);\n };\n /**\n * update the spot Overlays\n */\n let updateOverlays = function () {\n let overlayFound = new Multimap.Array();\n for (const key in that._itemInstances) {\n let i = that._itemInstances[key];\n if (i.item.properties.overlay !== undefined) {\n let consideredKind;\n let generalKinds = GeneralReference.getGeneralKinds(i.item.kind);\n if (generalKinds.length === 0) {\n consideredKind = i.item.kind;\n } else {\n consideredKind = generalKinds[generalKinds.length - 1].kind;\n }\n overlayFound.get(consideredKind).add(i);\n i.$.removeClass(\"overlayed\");\n }\n }\n overlayDiv.$.empty();\n overlayFound.each(function (overlayFoundPerKind, k) {\n // console.log(\"Found overlay [\" + k + \"] \" + overlayFoundPerKind[0].item.kind + \" (\" + overlayFoundPerKind[0].count + \")\");\n if (overlayFoundPerKind.length === 1) {\n let onlyOverlayFoundPerKind = overlayFoundPerKind[0];\n if (\n (properties.overlayable !== undefined &&\n onlyOverlayFoundPerKind.count === 1) ||\n (onlyOverlayFoundPerKind.item.properties.invisible !== undefined &&\n onlyOverlayFoundPerKind.infinite)\n ) {\n onlyOverlayFoundPerKind.item.createInstance(\n overlayDiv.overlay(),\n false,\n onlyOverlayFoundPerKind.liveId\n );\n onlyOverlayFoundPerKind.$.addClass(\"overlayed\");\n }\n }\n });\n };\n /**\n * update the spots modifiers\n */\n let updateModifiers = function () {\n let modifierFound = new Multimap.Array();\n for (const key in that._itemInstances) {\n let i = that._itemInstances[key];\n if (i.infinite) {\n return;\n }\n if (i.count !== 1) {\n return;\n }\n for (const key in i.item.modifiers) {\n modifierFound.get(key).add(i.item.modifiers[key]);\n }\n }\n that.state = {};\n modifierFound.each(function (a, k) {\n let s = null;\n for (const v of a) {\n s = v;\n }\n that.state[k] = s; // Let's keep only the last one\n });\n DomUtils.eachClass(div.$, function (c) {\n if (c.startsWith(\"state-\")) {\n div.$.removeClass(c);\n }\n });\n for (const key in that.state) {\n div.$.addClass(\"state-\" + key + \"-\" + that.state[key]);\n }\n };\n\n this._destroyItem = function (kind, count) {\n // console.log(\"Destroying \" + kind + \" from \" + location + \" (\" + count + \")\");\n if (kind === undefined) {\n for (const i of that._itemInstances) {\n destroy(i)\n }\n that._itemInstances = {};\n updateOverlays();\n updateRandom();\n updateModifiers();\n } else {\n let existingItemInstance = that._itemInstances[kind];\n if (existingItemInstance === undefined) {\n return;\n }\n if (count === undefined) {\n delete that._itemInstances[kind];\n destroy(existingItemInstance);\n } else {\n if (!existingItemInstance.infinite) {\n existingItemInstance.inc(-count);\n if (!(\"count\" in existingItemInstance.state) &&\n existingItemInstance.count === 0\n ) {\n delete that._itemInstances[existingItemInstance.item.kind];\n destroy(existingItemInstance);\n }\n }\n }\n if (existingItemInstance.item.properties.overlay !== undefined) {\n updateOverlays();\n }\n if ($.isEmptyObject(existingItemInstance.item.modifiers)) {\n updateModifiers();\n }\n //if (existingItemInstance.item.properties.random !== undefined) {\n updateRandom();\n //}\n }\n };\n\n this._setItemState = function (kind, key, value) {\n let existingItemInstance = that._itemInstances[kind];\n if (existingItemInstance === undefined) {\n return;\n }\n existingItemInstance.setState(key, value);\n };\n\n this._addItem = function (kind, count, liveId) {\n // console.log(\"Adding \" + kind + \" to \" + location + \" (\" + count + \") \" + liveId);\n\n let existingItemInstance = that._itemInstances[kind];\n if (\n existingItemInstance !== undefined &&\n existingItemInstance.faceIcon !== null\n ) {\n existingItemInstance.faceIcon.update(null, liveId);\n game.friendFaces.remove(existingItemInstance.faceIcon);\n if (existingItemInstance.liveId !== liveId) {\n existingItemInstance.setLiveId(liveId);\n game.friendFaces.add(existingItemInstance.faceIcon);\n } else {\n existingItemInstance.setLiveId();\n }\n /*\n\t\t\t\tif (existingItemInstance.infinite) {\n\t\t\t\t\tcount = undefined;\n\t\t\t\t}\n\t\t\t\tdelete that._itemInstances[kind];\n\t\t\t\tdestroy(existingItemInstance);\n\t\t\t\texistingItemInstance = undefined;\n\t\t\t\t*/\n }\n\n if (existingItemInstance === undefined) {\n let item = game.itemManager.getItem(kind);\n\n if (item !== null) {\n if (item.properties.unique !== undefined && count !== undefined) {\n for (const i of that._itemInstances) {\n if (\n i.item.properties.unique === item.properties.unique &&\n !i.infinite\n ) {\n delete that._itemInstances[i.item.kind];\n destroy(i);\n }\n }\n }\n\n existingItemInstance = item.createInstance(\n itemLayout(),\n true,\n liveId\n );\n existingItemInstance.spot = that;\n that._itemInstances[kind] = existingItemInstance;\n existingItemInstance.$.attr(\"data-location\", location).attr(\n \"data-id\",\n \"item:\" + location + \":\" + kind\n );\n if (item.properties.steady === undefined) {\n //%% existingItemInstance.$.addClass(\"hoverable\");\n game.dragAndDropManager.configureItemInstance(existingItemInstance);\n }\n\n if (existingItemInstance.faceIcon !== null) {\n existingItemInstance.setLiveId(); // Initialized deactivated\n // game.friendFaces.add(existingItemInstance.faceIcon);\n }\n updateItemPositions();\n } else {\n existingItemInstance = null;\n }\n }\n if (existingItemInstance !== null) {\n if (count === undefined) {\n existingItemInstance.setInfinite();\n } else {\n existingItemInstance.inc(count);\n }\n\n if (existingItemInstance.item.properties.overlay !== undefined) {\n updateOverlays();\n }\n if ($.isEmptyObject(existingItemInstance.item.modifiers)) {\n updateModifiers();\n }\n //if (existingItemInstance.item.properties.random !== undefined) {\n updateRandom();\n //}\n }\n };\n\n this._updateItem = function (kind, liveId) {\n let existingItemInstance = that._itemInstances[kind];\n if (\n existingItemInstance === undefined ||\n existingItemInstance.faceIcon === null\n ) {\n return;\n }\n if (existingItemInstance.liveId !== undefined) {\n game.friendFaces.remove(existingItemInstance.faceIcon);\n }\n existingItemInstance.faceIcon.update(null, liveId);\n if (existingItemInstance.liveId !== liveId) {\n existingItemInstance.setLiveId(liveId);\n game.friendFaces.add(existingItemInstance.faceIcon);\n } else {\n existingItemInstance.setLiveId();\n }\n };\n\n this._destroy = function () {\n //%% that.$.addClass(\"destroyed\");\n that.$.remove();\n };\n }", "get type() {\n return this.startSide < this.endSide ? exports.BlockType.WidgetRange\n : this.startSide <= 0 ? exports.BlockType.WidgetBefore : exports.BlockType.WidgetAfter;\n }", "function Abutton(){\n var tmp1=doraemon.style.left;\n var tmp2=doraemon.style.top;\n var currentX1=parseInt(tmp1.substring(0,tmp1.length-2));\n var currentY1=parseInt(tmp2.substring(0,tmp2.length-2));\n\n var tmp3=tmpBomb.style.left;\n var tmp4=tmpBomb.style.top;\n var currentX2=parseInt(tmp3.substring(0,tmp3.length-2));\n var currentY2=parseInt(tmp4.substring(0,tmp4.length-2));\n \n if(currentX1>=(currentX2-70)&&currentX1<=(currentX2+70)&&currentY1>=(currentY2-70)&&currentY1<=(currentY2+70)){\n takeItem(tmpBomb,currentX1,currentY1);\n handEmpty=false;\n }\n }", "function quanDraw(){\r\n var imageSize = 0;\r\n //hides the other button so that you can't interact with it.\r\n visPrice.hide();\r\n //sets the position of the quantity button so that there is more canvas space\r\n visQuan.position(10,630);\r\n for (var s = 0; s < 18; s++){\r\n imageSize = itemQuantity[s]/1000;\r\n if (imageSize < 10){\r\n imageSize = imageSize *5;\r\n }\r\n if (imageSize > 300) {\r\n imageSize = imageSize / 10;\r\n }\r\n for (var g = 0;g<6; g++){\r\n img[s] = createImg(itemImage[s]);\r\n img[s].mouseClicked(itemQuanClicked);\r\n img[s].size(imageSize, imageSize);\r\n img[s].position(random(1280)-random(imageSize*1.25),random(620) - random(imageSize*1.25));\r\n if (img[s].x <= 1280){\r\n img[s].position(img[s].x - imageSize, img[s].y);\r\n }\r\n if (img[s].y <= 720) {\r\n img[s].position(img[s].x, img[s].y - imageSize/1.25);\r\n }\r\n }\r\n}\r\n}", "function addListeners1(){\n for (let i = 0; i < talen.length; i++){\n talen[i].addEventListener('click', function(evt){\n if (hold == null) {\n camera.innerHTML += '<a-box id=\"js--hold\" class=\"js--talen js--interact\" color=\"'+ this.getAttribute(\"color\") + '\" height='+ this.getAttribute(\"height\") +' rotation=\"0 0 90\" position=\"2 -1 -2\" depth=\"0.1\" width=\"0.8\">'+ this.innerHTML + '</a-box>'\n hold = \"box\";\n console.log(\"true\");\n }\n });\n }\n }", "createDom_() {\n this.svgGroup_ = Blockly.utils.dom.createSvgElement(\n Blockly.utils.Svg.G, {}, null);\n const rnd = Blockly.utils.idGenerator.genUid();\n const clip = Blockly.utils.dom.createSvgElement(\n Blockly.utils.Svg.CLIPPATH,\n {'id': 'blocklyBackpackClipPath' + rnd},\n this.svgGroup_);\n Blockly.utils.dom.createSvgElement(\n Blockly.utils.Svg.RECT,\n {\n 'width': this.WIDTH_,\n 'height': this.HEIGHT_,\n },\n clip);\n this.svgImg_ = Blockly.utils.dom.createSvgElement(\n Blockly.utils.Svg.IMAGE,\n {\n 'class': 'blocklyBackpack',\n 'clip-path': 'url(#blocklyBackpackClipPath' + rnd + ')',\n 'width': this.SPRITE_SIZE_ + 'px',\n 'x': -this.SPRITE_LEFT_,\n 'height': this.SPRITE_SIZE_ + 'px',\n 'y': -this.SPRITE_TOP_,\n },\n this.svgGroup_);\n this.svgImg_.setAttributeNS(Blockly.utils.dom.XLINK_NS, 'xlink:href',\n BACKPACK_SVG_DATAURI);\n\n Blockly.utils.dom.insertAfter(\n this.svgGroup_, this.workspace_.getBubbleCanvas());\n }", "function createBlock(svg){\n return svg.rect(100, 25).addClass('standardBlock');\n}", "function attachEvents() {\n // scroll to top/left 0 when a box is generated\n $(\".drag, .decision, .end\").click(function (e) {\n e.preventDefault();\n $('.umb-panel-nobody').animate({\n scrollLeft: 0,\n scrollTop: 0\n }, 800);\n });\n $(\".dragged-doc, .dragged-decision, .dragged-end\").click(function () {\n $(\".dragged-doc, .dragged-decision, .dragged-end\").removeClass('current_procedure');\n $(this).addClass('current_procedure');\n });\n $(document).mouseup(function (e) {\n var container = $(\"#toolbox, #flowchart_backend .dragged-doc, .colpick\");\n if (!container.is(e.target) // if the target of the click isn't the container...\n && container.has(e.target).length === 0) // ... nor a descendant of the container\n $(\".dragged-doc, .dragged-decision, .dragged-end\").removeClass('current_procedure');\n });\n $(\".remove\").click(function () {\n instance.removeAllEndpoints($(this).parent().attr(\"id\"));\n normalizeEndpoints();\n if ($(this).parent().hasClass(\"existing\") && $(this).parent().hasClass(\"dragged-doc\")) {\n boxArr.push({\n umbracoId: parseInt($(this).parent().attr(\"umbracoId\")),\n docId: $(this).parent().attr(\"id\").toString(),\n name: \"\",\n colour: \"\",\n left: 0,\n top: 0,\n isNew: false,\n delete: true\n });\n }\n $(this).parents(\".box-wrap\").animate(\n { height: \"0\", width: \"0\" },\n { duration: 240, complete: function () { $(this).remove() } }\n );\n });\n }", "function visualiserEditeurControls(){\n //\"lbledPays\",\"cboxedPays\",\n var vControles = [\n \"lbledNomEditeur\", \"txtedNomEditeur\",\n \"lbledVille\", \"btnedaddVill\", \"cboxedVill\",\n \"lbledSaveEdit\",\"btnedSaveEdit\"//,\n //\"lbledaddVille\" , \"txtedaddVille\"\n ];\n visualiserControls(\"btnedaddEdit\",vControles,\"cboxedEdit\");\n} // end visualiser", "function makeBlocksDragable(){\r\n\r\n // Get all the block objects\r\n var blocks = document.getElementsByClassName(\"block\");\r\n\r\n // When a block is picked up, set global data variables to its values.\r\n for (i=0; i<blocks.length;i++){\r\n blocks[i].addEventListener('dragstart',function(event){\r\n //event.preventDefault();\r\n event.dataTransfer.setData(\"value\", event.target.getAttribute(\"value\"));\r\n event.dataTransfer.setData(\"type\", event.target.getAttribute(\"type\"));\r\n // set this block as the last selected, so that it gets removed when dropped\r\n // make sure not to remove the output block though or else it's gone forever lmao\r\n if (this.getAttribute(\"type\") != \"output\"){\r\n this.setAttribute(\"id\",\"last-selected\");\r\n }\r\n });\r\n\r\n }\r\n\r\n}", "function Block1() {\n \n //create the block\n block1 = rect(block1X, block1Y, blockWidth, block1Height);\n \n //move the block across the screen\n if (block1X > 0) {\n block1X -= blockMovement;\n }\n \n //box 1 location \n block1Right = block1X + 20;\n block1Left = block1X;\n block1Top = block1Y;\n block1Bottom = block1Y + block1Height;\n \n //if the block goes off the end of the screen:\n \t//start it off the screen\n \t//set a random starting height on screen\n \t//set a random starting block height\n \t//slowly increment block speed\n if (block1X <= 0) {\n block1X = width - random(5,25);\n block1Y = random(0,400);\n block1Height = random(50,150);\n blockMovement += .2;\n }\n}", "adjustGUI()\n\t{\n\t\tthis.slots[0].x = SLOT_PADDING;\n\t\tthis.slots[0].y = height - (SLOT_HEIGHT + SLOT_PADDING);\n\n\t\tthis.slots[1].x = width - (SLOT_WIDTH + SLOT_PADDING);\n\t\tthis.slots[1].y = height - (SLOT_HEIGHT + SLOT_PADDING);\n\n\t\tthis.slots[2].x = (width - SLOT_WIDTH) / 2 - SLOT_WIDTH;\n\t\tthis.slots[2].y = height - (SLOT_HEIGHT + SLOT_PADDING);\n\n\t\tthis.slots[3].x = (width - SLOT_WIDTH) / 2 + SLOT_WIDTH;\n\t\tthis.slots[3].y = height - (SLOT_HEIGHT + SLOT_PADDING);\n\n\n\n\t\tthis.text[0].x = width / 2 - SLOT_WIDTH / 2;\n\t\tthis.text[0].y = 20;\n\t}", "function boxClicked() {\r\n let clickedBox = this.className;\r\n let mark = this;\r\n let player = \"User\";\r\n mark.style.background = \"url(img/x-brush.png) no-repeat\";\r\n mark.style.backgroundSize = \"contain\";\r\n mark.style.backgroundPosition = \"center\";\r\n mark.style.pointerEvents = \"none\";\r\n checkClass(clickedBox, player);\r\n computerRandomizer(boxRow, mark);\r\n console.log(updateList.length);\r\n\r\n state();\r\n}", "function checkAreas() \n\t\t{\n\t\t\tfor (var b = 0; b < buttons.length; b++)\n\t\t\t{\n\t\t\t\t// get the pixels in a note area from the blended image\n\t\t\t\tvar blendedData = blendContext.getImageData( buttons[b].x, buttons[b].y, buttons[b].w, buttons[b].h );\n\t\t\t\t\t\n\t\t\t\t// calculate the average lightness of the blended data\n\t\t\t\tvar i = 0;\n\t\t\t\tvar sum = 0;\n\t\t\t\tvar countPixels = blendedData.data.length * 0.25;\n\t\t\t\twhile (i < countPixels) \n\t\t\t\t{\n\t\t\t\t\tsum += (blendedData.data[i*4] + blendedData.data[i*4+1] + blendedData.data[i*4+2]);\n\t\t\t\t\t++i;\n\t\t\t\t}\n\t\t\t\t// calculate an average between of the color values of the note area [0-255]\n\t\t\t\tvar average = Math.round(sum / (3 * countPixels));\n\t\t\t\tif (average > 50) // more than 20% movement detected\n\t\t\t\t{\n\t\t\t\t\t// evita multiples click en mismo sitio en un 1/segundo\n\t\t\t\t\tvar d = new Date();\n\t\t\t\t\tdiferenciaTiempo = parseFloat(d.getTime())-parseFloat(lastMotion.t);\n\t\t\t\t\tif(diferenciaTiempo>500) lastMotion.p='';\n\t\t\t\t\tif ( buttons[b].name != lastMotion.p ) {\n\t\t\t\t\t\tconsole.log( \"Button \" + buttons[b].name + \" \" + diferenciaTiempo ); // do stuff\n\t\t\t\t\t\tmessageArea.innerHTML = \"<font size='+4' color=\" + buttons[b].name + \"><b>Button \" + buttons[b].name + \" triggered.</b></font>\";\n\t\t\t\t\t\tlastMotion = {'p':buttons[b].name, 't':d.getTime()};\n\t\t\t\t\t\t// si ha pasado mas de un segundo permite clic otra vez en mismo boton\n\t\t\t\t\t\t// if(diferenciaTiempo>3000) lastMotion.p='';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "constructor() {\n this.backgroundDiv = CreateElement({\n type: 'div',\n className: 'MiscBGCover'\n });\n this.MiscDiv = CreateElement({\n type: 'div',\n className: 'MiscDiv',\n elements: [\n this.MiscSaveButton = CreateElement({\n type: 'button',\n className: 'MiscSaveButton',\n text: 'Save',\n onClick: CreateFunction(this, this.hide)\n }),\n this.MiscCancelButton = CreateElement({\n type: 'button',\n className: 'MiscCancelButton',\n text: 'Cancel',\n onClick: CreateFunction(this, this.hide)\n })\n ]\n });\n }", "hold() {\n if (hold[2] == 1) { // Checks for double shifting\n return false;\n }\n\n let curr_hold = null;\n // hold[0] represents the image object in hold. hold[1] represents the # corresponding the shape.\n if (hold[1] != null) {\n curr_hold = hold[1]; \n }\n\n imageMode(CENTER);\n // Updates hold array to hold the activeShape. \n // Images are loaded everytime to prevent blurriness\n if (this.activeShape.blocks[0].srcImg == purple_sq) {\n hold[0] = loadImage(\"assets/T_piece.png\", img => {\n img.resize(0, 45);\n });\n hold[1] = 5;\n } else if (this.activeShape.blocks[0].srcImg == lightblue_sq) {\n hold[0] = loadImage(\"assets/Line_piece.png\", img => {\n img.resize(0, 45);\n });\n hold[1] = 6;\n } else if (this.activeShape.blocks[0].srcImg == darkblue_sq) {\n hold[0] = loadImage(\"assets/J_piece.png\", img => {\n img.resize(0, 45);\n });\n hold[1] = 1;\n } else if (this.activeShape.blocks[0].srcImg == yellow_sq) {\n hold[0] = loadImage(\"assets/Box_piece.png\", img => {\n img.resize(0, 45);\n });\n hold[1] = 0;\n } else if (this.activeShape.blocks[0].srcImg == orange_sq) {\n hold[0] = loadImage(\"assets/L_piece.png\", img => {\n img.resize(0, 45);\n });\n hold[1] = 2;\n } else if (this.activeShape.blocks[0].srcImg == green_sq) {\n hold[0] = loadImage(\"assets/S_piece.png\", img => {\n img.resize(0, 45);\n });\n hold[1] = 4;\n } else if (this.activeShape.blocks[0].srcImg == pink_sq) {\n hold[0] = loadImage(\"assets/Z_piece.png\", img => {\n img.resize(0, 45);\n });\n hold[1] = 3;\n }\n\n // Removes the activeShape from the gameboard\n for (let i = 0; i < this.activeShape.blocks.length; i++) {\n let curr_block = this.activeShape.blocks[i]; \n\n this.splicePieces(curr_block.position); \n this.gameboard[curr_block.position[0]][curr_block.position[1]] = null;\n }\n\n // Spawns the shape that was previously on hold.\n if (curr_hold != null) {\n randomShape(curr_hold); \n } else {\n this.activeShape.shape = false;\n }\n\n hold[2] = 1; \n return true;\n }", "function manageBoxes() {\n AreaInput = document.getElementsByClassName(\"spellcheck_input\")[0];\n AreaOutput = document.getElementsByClassName(\"spellcheck_output\")[0];\n copyButton = document.getElementsByClassName(\"spellcheck_copy\")[0];\n AreaOutput.disabled = true;\n copyButton.disabled = true;\n spellcheck = document.getElementsByClassName(\"spellcheck\")[0];\n inputbox = document.getElementsByClassName(\"spellcheck_input_text\")[0];\n inputbox.setAttribute('style', 'height:' + (inputbox.scrollHeight) + 'px;overflow-y:hidden');\n spellcheck.setAttribute('style', 'height:' + (inputbox.scrollHeight + 95 + 32) + 'px');\n inputbox.addEventListener(\"input\", () => {resizeBoxes();});\n window.addEventListener('resize', () => {resizeBoxes();});\n}", "add_elements(){\n for (var i = 1; i < this.lines.length-1; i++) {\n var prev = this.lines[i-1];\n var cur = this.lines[i];\n var next = this.lines[i+1];\n\n if(prev.posx == cur.posx && cur.posx == next.posx && Math.random() > 0.98){\n cur.elem = \"vertical_resistor\";\n }\n else if(prev.posy == cur.posy && cur.posy == next.posy && Math.random() > 0.98){\n cur.elem = \"horizonzal_resistor\";\n }\n else if(prev.posx == cur.posx && cur.posx == next.posx && Math.random() > 0.98){\n cur.elem = \"vertical_capacitor\";\n }\n else if(prev.posy == cur.posy && cur.posy == next.posy && Math.random() > 0.98){\n cur.elem = \"horizontal_capacitor\";\n }\n else if(prev.posx == cur.posx && cur.posx == next.posx && Math.random() > 0.98){\n if(prev.posy < next.posy){\n cur.elem = \"down_diode\";\n }\n else{\n cur.elem = \"up_diode\";\n }\n }\n else if(prev.posy == cur.posy && cur.posy == next.posy && Math.random() > 0.98){\n if(prev.posx < next.posx){\n cur.elem = \"right_diode\";\n }\n else{\n cur.elem = \"left_diode\";\n }\n }\n }\n }", "portControl(helper) {\n stroke(83, 124, 123);\n strokeWeight(5);\n noFill();\n rect(this.x + this.width / 2 - 100, this.y + 280, 200, 200, 20);\n //headline\n textFont(myFontBold);\n textSize(60);\n fill(247, 240, 226);\n textAlign(CENTER);\n noStroke();\n text(\"Hafenkontrollen\", this.x + this.width / 2, this.y + 110);\n //describtion\n textSize(30);\n fill(83, 124, 123);\n text(\"Schütze deinen Hafen vor\", this.x + this.width / 2, this.y + 220);\n text(\"illegaler Fischerei\", this.x + this.width / 2, this.y + 250);\n //main image\n image(\n assets.visual.default.portControl,\n this.x + this.width / 2 - 75,\n this.y + 310,\n 150,\n 150\n );\n //clickable image array\n let x = this.x;\n let y = this.y;\n for (let i = 0; i < 10; i++) {\n image(assets.interactive.portControl, this.x + 130, this.y + 530, 40, 40);\n this.x += 45;\n if (i === 4) {\n this.y += 50;\n this.x = x;\n }\n }\n this.x = x;\n this.y = y;\n this.visualize.colorCheck();\n for (let i = 0; i < 10; i++) {\n image(\n assets.visual.default.portControl,\n this.x + 130,\n this.y + 530,\n 40,\n 40\n );\n if (\n mouseX > this.x + 130 &&\n mouseX < this.x + 170 &&\n mouseY > this.y + 530 &&\n mouseY < this.y + 570\n ) {\n this.chosenIndex = i + 1;\n }\n this.x += 45;\n if (i === 4) {\n this.y += 50;\n this.x = x;\n }\n }\n this.x = x;\n this.y = y;\n this.visualize.checkKey();\n this.visualize.doForKey(helper);\n this.portControlClicked();\n this.chosenIndex = 0;\n }", "function toBlock(el) {\n if(el.attributes['snake-head']) {\n el.removeAttribute('snake-head');\n el.removeAttribute('snake-num');\n el.removeAttribute('snake');\n el.setAttribute('block', 'true');\n el.className += ' block';\n removeClass(el, 'snake-head');\n } else {\n el.removeAttribute('snake-num');\n el.removeAttribute('snake');\n el.removeAttribute('part');\n el.setAttribute('block', 'true');\n el.className += ' block';\n removeClass(el, 'snake-body');\n }\n }", "constructor() {\n this.backgroundDiv = CreateElement({\n type: 'div',\n className: 'BasementFloorBGCover'\n });\n this.BasementFloorDiv = CreateElement({\n type: 'div',\n className: 'BasementFloorDiv',\n elements: [\n this.BasementFloorSaveButton = CreateElement({\n type: 'button',\n className: 'BasementFloorSaveButton',\n text: 'Save',\n onClick: CreateFunction(this, this.hide)\n }),\n this.BasementFloorCancelButton = CreateElement({\n type: 'button',\n className: 'BasementFloorCancelButton',\n text: 'Cancel',\n onClick: CreateFunction(this, this.hide)\n })\n ]\n });\n }", "function drawElements() {\n that.gameArea.paint(that.contex);\n that.food.paint(that.contex, that.gameArea.cellSize);\n that.snake.paint(that.contex, that.gameArea.cellSize);\n }", "function Button(parentInterface, name, topLeftX, topLeftY, width, height) {\n // assert(width >= 0);\n // assert(height >= 0);\n this.x = topLeftX;\n this.y = topLeftY;\n this.width = width;\n this.height = height;\n this.name = name;\n this.isVisible = true;\n this.parentInterface = parentInterface;\n this.isPressed = false;\n\n if (this.parentInterface.push) {\n this.parentInterface.push(this); // this button is pushed into parentInterface's array when instanced\n }\n\n //TODO I think this is ok in javascript with varable scope\n this.leftMouseClick = function(x=mouseX, y=mouseY) {\n if(isInPane(this, x, y) && this.isVisible) {\n this.isPressed = true;\n }\n };\n\n this.mouseOver = function(x=mouseX, y=mouseY) {\n if (!mouseHeld && isInPane(this, x, y)) {\n //mouse released while inside pane\n if(this.isPressed) {\n this.action();\n }\n this.isPressed = false;\n } else if (!isInPane(this, x, y)) {\n this.isPressed = false;\n }\n };\n\n // This function will be called when button is triggered\n this.action = function() {\n // assign custom function to do something\n };\n\n this.draw = function() {\n if(this.isVisible) {\n var drawColor;\n drawColor = (this.isPressed) ? buttonColorPressed : buttonColor;\n colorRect(this.x, this.y, this.width, this.height, drawColor);\n\n var str = this.name;\n var strWidth = canvasContext.measureText(this.name).width;\n //center text\n var textX = this.x + (this.width*0.5) - (strWidth*0.5);\n //TODO magic numbers going here.\n var textY = this.y + (this.height*0.5) + 4;\n colorText(str, textX, textY, \"black\");\n\n }\n }\n\n\n}", "function setNodeRect(_store){\n var currentSize = myNodeSizes[myExpandedMode];\n if(vpl_nodeBox != null && vpl_nodeBox.varname == myNodeVarName){\n var myBoxRect = vpl_nodeBox.rect;\n myBoxRect[2] = myBoxRect[0] + currentSize[0];\n if (myExpandedMode == 0) {\n myBoxRect[3] = myBoxRect[1] + currentSize[1] + myIOLetButtonSize + myTitleBarHeight;\n vpl_nodeLogicPatcher.message(\"script\", \"sendbox\", \"vpl_canvas\", \"presentation_size\", currentSize[0], currentSize[1] + myTitleBarHeight);\n vpl_nodeLogicPatcher.message(\"script\", \"sendbox\", \"vpl_body\", \"hidden\", 1);\n vpl_nodeLogicPatcher.message(\"script\", \"sendbox\", \"vpl_body\", \"size\", currentSize[0], currentSize[1]);\n vpl_nodePatcher.message(\"script\", \"sendbox\", \"vpl_nodelogic\", \"size\", currentSize[0], currentSize[1] + myIOLetButtonSize/2 + myTitleBarHeight);\n } else {\n myBoxRect[3] = myBoxRect[1] + currentSize[1] + myIOLetButtonSize + myTitleBarHeight + myPBodyOffset + 2 * myCanvasLowerSpacing;\n vpl_nodeLogicPatcher.message(\"script\", \"sendbox\", \"vpl_canvas\", \"presentation_size\", currentSize[0], currentSize[1] + myTitleBarHeight + myPBodyOffset + myCanvasLowerSpacing);\n vpl_nodeLogicPatcher.message(\"script\", \"sendbox\", \"vpl_body\", \"hidden\", 0);\n vpl_nodeLogicPatcher.message(\"script\", \"sendbox\", \"vpl_body\", \"size\", currentSize[0], currentSize[1]);\n vpl_nodePatcher.message(\"script\", \"sendbox\", \"vpl_nodelogic\", \"size\", currentSize[0], currentSize[1] + myIOLetButtonSize/2 + myTitleBarHeight + myPBodyOffset + myCanvasLowerSpacing);\n }\n vpl_nodeBox.rect = myBoxRect;\n if(_store == 1){\n storeKeyValueInDB(myNodeName, \"_rect\", myBoxRect);\n }\n }\n}", "function addListeners5(){\n for (let i = 0; i < pickups.length; i++){\n pickups[i].addEventListener('click', function(evt){\n if (hold == null) {\n camera.innerHTML += '<a-box id=\"js--hold\" class=\"js--pickup js--interact\" color=\"'+ this.getAttribute(\"color\") + '\" height='+ this.getAttribute(\"height\") +' rotation=\"0 0 -90\" position=\"2 -2 -4\" depth=\"0.1\">'+ this.innerHTML + '</a-box>'\n hold = \"box\";\n console.log(\"true\");\n }\n });\n }\n }", "constructor(){\n super();\n\n /**\n * @private\n * @type {Location}\n */\n this._location = Location.None;\n\n /**\n * @private\n * @type {number}\n */\n this._reserve = WYSIWYG_CAPTION_AUTO;\n\n /**\n * @private\n * @type {TextBlock}\n */\n this._textBlock = new TextBlock(\"\");\n\n /**\n * Indicates if we need to ensure the TextBlock is in the right location\n * @type {boolean}\n * @private\n */\n this._needToRecalc = true;\n\n /**\n * The last layout that was given to draw with. Used to know if we need to recalculate\n * @type {Layout}\n * @private\n */\n this._lastDrawLayout = new Layout();\n\n /**\n * The last border that was given to draw with. Used to know if we need to recalculate\n * @type {Border}\n * @private\n */\n this._lastDrawBorder = new Border();\n\n this._textBlock.font.subscribe(EVENT_PROPERTY_CHANGE, (e) => this._needToRecalc = true);\n }", "function Qh(a){Qh.k.constructor.call(this,null);this.zk=[];for(var b=0;b<a.length;b++){var c=D(\"block\",{type:a[b]});this.zk[b]=c}}" ]
[ "0.5565884", "0.5502996", "0.54520917", "0.53433204", "0.5341646", "0.533016", "0.5264438", "0.5259604", "0.52548414", "0.5243613", "0.5235779", "0.52287257", "0.52131337", "0.52106184", "0.5202586", "0.520198", "0.51878464", "0.5176747", "0.51706", "0.51617706", "0.5155396", "0.51519877", "0.51492405", "0.51381147", "0.51158947", "0.5105276", "0.51047295", "0.5091579", "0.50898063", "0.5089407", "0.5089339", "0.5087295", "0.5075719", "0.5066919", "0.50633526", "0.50627387", "0.50573725", "0.5054563", "0.5053177", "0.5047894", "0.5044877", "0.50329304", "0.50314516", "0.5018768", "0.50152284", "0.50004774", "0.5000032", "0.49995613", "0.4990484", "0.49820608", "0.4976026", "0.49724612", "0.49713957", "0.49669075", "0.4959248", "0.49579492", "0.49546742", "0.49500814", "0.49482003", "0.4938697", "0.4937586", "0.49331158", "0.49249953", "0.49242622", "0.4913647", "0.49092105", "0.49086913", "0.49066073", "0.4906067", "0.49000892", "0.4899208", "0.48942053", "0.489283", "0.488966", "0.48840088", "0.48830506", "0.48791522", "0.4878576", "0.48774686", "0.4876876", "0.48751366", "0.48748767", "0.48706856", "0.48695126", "0.48678473", "0.48646176", "0.4863337", "0.48623508", "0.48596877", "0.48594955", "0.48557287", "0.4854299", "0.48532856", "0.48530653", "0.48499775", "0.48453093", "0.48437244", "0.4843397", "0.4835571", "0.48300052" ]
0.5959678
0
creates editable text element and adds it in foreign container to SVG
createForeignText(text, editable){ var myforeign = document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject') myforeign.setAttribute("width", "350"); myforeign.classList.add("foreign"); //to make div fit text var textdiv = document.createElement("div"); textdiv.classList.add("divinforeign"); //to make div fit text var textpar = document.createElement("p"); textpar.innerHTML = text; textpar.className = "text-white"; if(editable) textpar.setAttribute("contentEditable", "true"); textpar.addEventListener("input", (ev) => this.onTextChange(ev.target, ev.data)); // ev.target is textpar textpar.addEventListener("tribute-replaced", (ev) => this.onTextChange(ev.target)); myforeign.textpar = textpar; // append everything textdiv.appendChild(textpar); myforeign.appendChild(textdiv); document.getElementById("drawsvg").appendChild(myforeign); myforeign.setAttribute("height", textpar.offsetHeight); return myforeign; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function text(){\n var att=['x', 'y', 'text'];\n var object = shape('text', att);\n\n // Override the function copy_shape mantaining the most part of\n // his code\n object.parent_copy_shape = object.copy_shape;\n object.copy_shape = function(target){\n this.parent_copy_shape(target);\n // Retrieve the 'text' and put it into the textarea\n var rows = [];\n var childs = target.childNodes;\n for (var n=0; n<childs.length; n++)\n // Between the child nodes, there are a lot of nodes\n // which are not useful (comments and any kind of\n // oddity), so take only the tspans\n if (childs[n].nodeName=='tspan')\n // Read the data of the textnode which is the first\n // child of the <tspan>\n rows.push(childs[n].childNodes[0].data);\n getById('textinput').value = rows.join('\\n');\n };\n\n object.mousedown = function(x, y){\n this.x = x;\n this.y = y;\n object.show_text_area(x, y);\n };\n\n object.server_create = function(par, id){\n this.create_group(id);\n var fill = par[1];\n var x = parseInt(par[2]);\n var y = parseInt(par[3]);\n if (id === undefined)\n //client call\n var content = unescape(unescape(par[4]));\n else\n //server call\n var content = unescape(par[4]);\n // Create the element (can't use create_element because this case\n // is not standard)\n this.element = document.createElementNS(svgns, 'text');\n sa(this.element, {'fill': fill, 'x':x, 'y':y});\n this.group.appendChild(this.element);\n var rows = content.split('\\n');\n // Process rows to create a <tspan> for each row. The vertical\n // coordinate ('y') will be incremented with rows\n for (var r=0; r < rows.length; r++){\n var tspan = document.createElementNS(svgns, 'tspan');\n // I found that characters like '<' are converted to their\n // corresponding HTML entities. I don't know if it is a\n // feature of the svgweb library or it is normal for\n // createTextNode. Differently, chat text is encoded to\n // HTML entities by the server-side code\n var tnode = document.createTextNode(rows[r], true);\n tspan.appendChild(tnode);\n tspan.setAttribute('x', x);\n tspan.setAttribute('y', y);\n this.element.appendChild(tspan);\n y = y + (g['fontSize']+1);\n }\n // In svgweb, text nodes can't inherit handlers from root like\n // other nodes do, so we have to add the handlers here\n if (svgweb.getHandlerType() == 'flash'){\n this.element.addEventListener('mousedown', handleMouseDown, false);\n this.element.addEventListener('mouseup', handleMouseUp, false);\n this.element.addEventListener('mousemove', handleMouseMove, false);\n }\n };\n return object;\n}", "onCreateText(e) {\n e.preventDefault()\n\n let newSel;\n this.transaction(function(tx) {\n let container = tx.get(this.props.containerId)\n let textType = tx.getSchema().getDefaultTextType()\n let node = tx.create({\n id: uuid(textType),\n type: textType,\n content: ''\n })\n container.show(node.id)\n\n newSel = tx.createSelection({\n type: 'property',\n path: [ node.id, 'content'],\n startOffset: 0,\n endOffset: 0\n })\n }.bind(this))\n this.rerender()\n this.setSelection(newSel)\n }", "function addText() {\r\n var newItemId = DRAWAPP.nextItemId;\r\n DRAWAPP.nextItemId += 1;\r\n var textVal = document.getElementById(\"id_body_text\").value;\r\n var angle = parseInt(document.getElementById(\"text_rotation\").value,10);\r\n var fontSize = parseInt(document.getElementById(\"text_size\").value,10);\r\n var newItem = DRAWAPP.pic.createText(newItemId,\r\n DRAWAPP.textXY[0], DRAWAPP.textXY[1],\r\n textVal, angle, fontSize);\r\n if (DRAWAPP.itemFontColor) {\r\n newItem.setFontColorStyle(DRAWAPP.itemFontColor);\r\n }\r\n else { newItem.setFontColorStyle(DRAWAPP.fontColor) ; }\r\n if ( !DRAWAPP.hideTextBox ) {\r\n newItem.setLineStyle(DRAWAPP.itemLineStyle);\r\n newItem.setFillStyle(DRAWAPP.itemFillStyle);\r\n var winWidth =\r\n parseInt(document.getElementById(\"text_box_width\").value, 10);\r\n if (winWidth) { newItem.setWidth(winWidth); }\r\n var winHeight =\r\n parseInt(document.getElementById(\"text_box_height\").value, 10);\r\n if (winHeight) { newItem.setHeight(winHeight); }\r\n }\r\n newItem.setBoxes();\r\n hideDiv();\r\n DRAWAPP.pic.redrawAll();\r\n }", "function editTextNode(event){\n // Set appropriate informative text on info model\n scope.$apply(function(){\n scope.main.info = handlerHelpers.editingText;\n });\n // The node that contains the text to change\n nodeID = $(event.toElement).closest('.literal-sequence, .literal').attr('id');\n text = event.target.innerHTML; // The current text in the diagram node\n\n // if the text in the node is default text, then initialize the text input box with a placeholder rather than a value attribute\n var valOrPlaceHolder = 'value';\n if (text === '&lt;text_here&gt;') {\n valOrPlaceHolder = 'placeholder';\n }\n\n var width = text.split('').length * 10;\n var textBox = '<div class=\"textEdit\" style=\"position: absolute\"><form class=\"textForm\"><input class=\"textBox\" type=\"text\" '+ valOrPlaceHolder +'=\"'+ text +'\" autofocus></input></form></div>';\n\n $('.work').append(textBox);\n\n $('.textBox').css('width', width); // Set the width of the textBox to fit the contained text\n\n // Move the textEdit form to directly under the mouse\n $('.textEdit').css({\n top: event.pageY - 15,\n left: event.pageX - width/2,\n });\n }", "updateTextPosition(blobDOM, x, y, width, height) {\n d3.select(blobDOM.node().parentNode).select(\"foreignObject\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .attr('width', width)\n .attr(\"height\", height)\n }", "function domtext ()\n {\n //\n // Check the font property to see if it contains the italic keyword,\n // and if it does then take it out and set the italic property\n //\n if (String(args.size).toLowerCase().indexOf('italic') !== -1) {\n args.size = args.size.replace(/ *italic +/, '');\n args.italic = true;\n }\n\n\n\n // Used for caching the DOM node\n var cacheKey = Math.abs(parseInt(args.x)) + '_' + Math.abs(parseInt(args.y)) + '_' + String(args.text).replace(/[^a-zA-Z0-9]+/g, '_') + '_' + obj.canvas.id;\n\n\n\n // Wrap the canvas in a DIV\n if (!obj.canvas.rgraph_domtext_wrapper) {\n\n var wrapper = document.createElement('div');\n wrapper.id = obj.canvas.id + '_rgraph_domtext_wrapper';\n wrapper.className = 'rgraph_domtext_wrapper';\n\n // The wrapper can be configured to hide or show the\n // overflow with the textAccessibleOverflow option\n wrapper.style.overflow = obj.properties.textAccessibleOverflow != false && obj.properties.textAccessibleOverflow != 'hidden' ? 'visible' : 'hidden';\n \n wrapper.style.width = obj.canvas.offsetWidth + 'px';\n wrapper.style.height = obj.canvas.offsetHeight + 'px';\n\n wrapper.style.cssFloat = obj.canvas.style.cssFloat;\n wrapper.style.display = obj.canvas.style.display || 'inline-block';\n wrapper.style.position = obj.canvas.style.position || 'relative';\n wrapper.style.left = obj.canvas.style.left;\n wrapper.style.right = obj.canvas.style.right;\n wrapper.style.top = obj.canvas.style.top;\n wrapper.style.bottom = obj.canvas.style.bottom;\n wrapper.style.width = obj.canvas.width + 'px';\n wrapper.style.height = obj.canvas.height + 'px';\n wrapper.style.lineHeight = 'initial';\n\n obj.canvas.style.position = 'absolute';\n obj.canvas.style.left = 0;\n obj.canvas.style.top = 0;\n obj.canvas.style.display = 'inline';\n obj.canvas.style.cssFloat = 'none';\n\n\n if ((obj.type === 'bar' || obj.type === 'bipolar' || obj.type === 'hbar') && obj.properties.variant === '3d') {\n wrapper.style.transform = 'skewY(5.7deg)';\n }\n\n obj.canvas.parentNode.insertBefore(wrapper, obj.canvas);\n \n // Remove the canvas from the DOM and put it in the wrapper\n obj.canvas.parentNode.removeChild(obj.canvas);\n wrapper.appendChild(obj.canvas);\n \n obj.canvas.rgraph_domtext_wrapper = wrapper;\n \n // TODO Add a subwrapper here\n\n } else {\n wrapper = obj.canvas.rgraph_domtext_wrapper;\n }\n\n\n\n var defaults = {\n size: 12,\n font: 'Arial',\n italic: 'normal',\n bold: 'normal',\n valign: 'bottom',\n halign: 'left',\n marker: true,\n color: context.fillStyle,\n bounding: {\n enabled: false,\n fill: 'rgba(255,255,255,0.7)',\n stroke: '#666',\n linewidth: 1\n }\n }\n\n \n // Transform \\n to the string [[RETURN]] which is then replaced\n // further down\n args.text = String(args.text).replace(/\\r?\\n/g, '[[RETURN]]');\n\n\n // Create the node cache array that nodes\n // already created are stored in\n if (typeof RGraph.text.domNodeCache === 'undefined') {\n RGraph.text.domNodeCache = new Array();\n }\n \n if (typeof RGraph.text.domNodeCache[obj.id] === 'undefined') {\n RGraph.text.domNodeCache[obj.id] = new Array();\n }\n\n // Create the dimension cache array that node\n // dimensions are stored in\n if (typeof RGraph.text.domNodeDimensionCache === 'undefined') {\n RGraph.text.domNodeDimensionCache = new Array();\n }\n \n if (typeof RGraph.text.domNodeDimensionCache[obj.id] === 'undefined') {\n RGraph.text.domNodeDimensionCache[obj.id] = new Array();\n }\n\n\n\n // Create the DOM node\n if (!RGraph.text.domNodeCache[obj.id] || !RGraph.text.domNodeCache[obj.id][cacheKey]) {\n\n var span = document.createElement('span');\n span.style.position = 'absolute';\n span.style.display = 'inline';\n \n span.className = ' rgraph_accessible_text'\n + ' rgraph_accessible_text_' + obj.id\n + ' rgraph_accessible_text_' + (args.tag || '').replace(/\\./, '_')\n + ' rgraph_accessible_text_' + obj.type\n + ' ' + (args.cssClass || '');\n\n // This is here to accommodate 3D charts\n //\n span.style.left = (args.x * (parseInt(obj.canvas.offsetWidth) / parseInt(obj.canvas.width))) + 'px';\n span.style.top = (args.y * (parseInt(obj.canvas.offsetHeight) / parseInt(obj.canvas.height))) + 'px';\n \n // This could be used for none-3d charts\n //\n //span.style.left = args.x + 'px';\n //span.style.top = args.y + 'px';\n \n span.style.color = args.color || defaults.color;\n span.style.fontFamily = args.font || defaults.font;\n span.style.fontWeight = args.bold ? 'bold' : defaults.bold;\n span.style.fontStyle = args.italic ? 'italic' : defaults.italic;\n span.style.fontSize = (args.size || defaults.size) + 'pt'; // Also see line-height setting a few lines down\n span.style.whiteSpace = 'nowrap';\n span.style.lineHeight = RGraph.ISIE ? 'normal' : 'initial'; // Also see font-size setting a few lines up\n span.tag = args.tag;\n\n\n // CSS angled text. This should be conasidered BETA quality code at the moment,\n // but it seems to be OK. You may need to use the labelsOffsety when using this\n // option.\n if (typeof args.angle === 'number' && args.angle !== 0) {\n \n var coords = RGraph.measureText(\n args.text,\n args.bold,\n args.font,\n args.size\n );\n \n //span.style.left = parseFloat(span.style.left) - coords[0] + 'px';\n var hOrigin, vOrigin;\n \n if (args.halign === 'center') {hOrigin = '50%';}\n else if (args.halign === 'right') {hOrigin = '100%';}\n else {hOrigin = '0%';}\n \n if (args.valign === 'center') {vOrigin = '50%';}\n else if (args.valign === 'top') {vOrigin = '0%';}\n else {vOrigin = '100%';}\n \n span.style.transformOrigin = '{1} {2}'.format(\n hOrigin,\n vOrigin\n );\n \n span.style.transform = 'rotate(' + args.angle + 'deg)';\n }\n\n\n\n\n // Shadow\n span.style.textShadow = '{1}px {2}px {3}px {4}'.format(\n context.shadowOffsetX,\n context.shadowOffsetY,\n context.shadowBlur,\n context.shadowColor\n );\n\n\n if (args.bounding) {\n span.style.border = '1px solid ' + (args['bounding.stroke'] || defaults.bounding.stroke);\n span.style.backgroundColor = args['bounding.fill'] || defaults.bounding.fill;\n span.style.borderWidth = typeof args['bounding.linewidth'] === 'number' ? args['bounding.linewidth'] : defaults.bounding.linewidth;\n }\n // Pointer events\n if (\n (typeof obj.properties.textAccessiblePointerevents === 'undefined' || obj.properties.textAccessiblePointerevents)\n && obj.properties.textAccessiblePointerevents !== 'none'\n ) {\n \n span.style.pointerEvents = 'auto';\n } else {\n span.style.pointerEvents = 'none';\n }\n\n span.style.padding = args.bounding ? '2px' : null; // Changed to 2px on 16th January 2019\n span.__text__ = args.text\n \n span.insertAdjacentHTML(\n 'afterbegin',\n args.text.replace('&', '&amp;')\n .replace('<', '&lt;')\n .replace('>', '&gt;')\n .replace(/\\[\\[RETURN\\]\\]/g, '<br />')\n );\n //span.innerHTML = args.text.replace('&', '&amp;')\n // .replace('<', '&lt;')\n // .replace('>', '&gt;');\n \n // Now replace the string [[RETURN]] with a <br />\n //span.innerHTML = span.innerHTML.replace(/\\[\\[RETURN\\]\\]/g, '<br />');\n\n wrapper.appendChild(span);\n\n // Alignment defaults\n args.halign = args.halign || 'left';\n args.valign = args.valign || 'bottom';\n \n // Horizontal alignment\n if (args.halign === 'right') {\n span.style.left = parseFloat(span.style.left) - span.offsetWidth + 'px';\n span.style.textAlign = 'right';\n } else if (args.halign === 'center') {\n span.style.left = parseFloat(span.style.left) - (span.offsetWidth / 2) + 'px';\n span.style.textAlign = 'center';\n }\n \n // Vertical alignment\n if (args.valign === 'top') {\n // Nothing to do here\n } else if (args.valign === 'center') {\n span.style.top = parseFloat(span.style.top) - (span.offsetHeight / 2) + 'px';\n } else {\n span.style.top = parseFloat(span.style.top) - span.offsetHeight + 'px';\n }\n \n \n var offsetWidth = parseFloat(span.offsetWidth),\n offsetHeight = parseFloat(span.offsetHeight),\n top = parseFloat(span.style.top),\n left = parseFloat(span.style.left);\n\n RGraph.text.domNodeCache[obj.id][cacheKey] = span;\n RGraph.text.domNodeDimensionCache[obj.id][cacheKey] = {\n left: left,\n top: top,\n width: offsetWidth,\n height: offsetHeight\n };\n span.id = cacheKey;\n\n\n \n } else {\n span = RGraph.text.domNodeCache[obj.id][cacheKey];\n span.style.display = 'inline';\n \n var offsetWidth = RGraph.text.domNodeDimensionCache[obj.id][cacheKey].width,\n offsetHeight = RGraph.text.domNodeDimensionCache[obj.id][cacheKey].height,\n top = RGraph.text.domNodeDimensionCache[obj.id][cacheKey].top,\n left = RGraph.text.domNodeDimensionCache[obj.id][cacheKey].left;\n }\n\n\n \n\n \n \n // If requested, draw a marker to indicate the coords\n if (args.marker) {\n obj.path(\n 'b m % % l % % m % % l % % s',\n args.x - 5, args.y,\n args.x + 5, args.y,\n args.x, args.y - 5,\n args.x, args.y + 5\n );\n }\n \n //\n // If its a drawing API text object then allow\n // for events and tooltips\n //\n if (obj.type === 'drawing.text') {\n\n // Mousemove\n //if (obj.properties.eventsMousemove) {\n // span.addEventListener('mousemove', function (e) {(obj.properties.eventsMousemove)(e, obj);}, false);\n //}\n \n // Click\n //if (obj.properties.eventsClick) {\n // span.addEventListener('click', function (e) {(obj.properties.eventsClick)(e, obj);}, false);\n //}\n \n // Tooltips\n if (obj.properties.tooltips) {\n span.addEventListener(\n obj.properties.tooltipsEvent.indexOf('mousemove') !== -1 ? 'mousemove' : 'click',\n function (e)\n {\n if ( !RGraph.Registry.get('tooltip')\n || RGraph.Registry.get('tooltip').__index__ !== 0\n || RGraph.Registry.get('tooltip').__object__.uid != obj.uid\n ) {\n \n RGraph.hideTooltip();\n RGraph.redraw();\n RGraph.tooltip(obj, obj.properties.tooltips[0], args.x, args.y, 0, e);\n }\n },\n false\n );\n }\n }\n\n // Build the return value\n var ret = {};\n ret.x = left;\n ret.y = top;\n ret.width = offsetWidth;\n ret.height = offsetHeight;\n ret.object = obj;\n ret.text = args.text;\n ret.tag = args.tag;\n\n \n // The reset() function clears the domNodeCache\n ////\n // @param object OPTIONAL You can pass in the canvas to limit the\n // clearing to that canvas.\n RGraph.text.domNodeCache.reset = function ()\n {\n // Limit the clearing to a single canvas tag\n if (arguments[0]) {\n \n if (typeof arguments[0] === 'string') {\n var canvas = document.getElementById(arguments[0])\n } else {\n var canvas = arguments[0];\n }\n\n var nodes = RGraph.text.domNodeCache[canvas.id];\n\n for (j in nodes) {\n \n var node = RGraph.text.domNodeCache[canvas.id][j];\n \n if (node && node.parentNode) {\n node.parentNode.removeChild(node);\n }\n }\n \n RGraph.text.domNodeCache[canvas.id] = [];\n RGraph.text.domNodeDimensionCache[canvas.id] = [];\n\n // Clear all DOM text from all tags\n } else {\n for (i in RGraph.text.domNodeCache) {\n for (j in RGraph.text.domNodeCache[i]) {\n if (RGraph.text.domNodeCache[i][j] && RGraph.text.domNodeCache[i][j].parentNode) {\n RGraph.text.domNodeCache[i][j].parentNode.removeChild(RGraph.text.domNodeCache[i][j]);\n }\n }\n }\n\n RGraph.text.domNodeCache = [];\n RGraph.text.domNodeDimensionCache = [];\n }\n };\n\n\n\n\n //\n // Helps you get hold of the SPAN tag nodes that hold the text on the chart\n //\n RGraph.text.find = function (args)\n {\n var span, nodes = [];\n \n if (args.object && args.object.isrgraph) {\n var id = args.object.id;\n } else if (args.id) {\n var id = typeof args.id === 'string' ? args.id : args.object.id;\n args.object = document.getElementById(id).__object__;\n } else {\n alert('[RGRAPH] You Must give either an object or an ID to the RGraph.text.find() function');\n return false;\n }\n\n for (i in RGraph.text.domNodeCache[id]) {\n \n span = RGraph.text.domNodeCache[id][i];\n\n // A full tag is given\n if (typeof args.tag === 'string' && args.tag === span.tag) {\n nodes.push(span);\n continue;\n }\n\n\n\n // A regex is given as the tag\n if (typeof args.tag === 'object' && args.tag.constructor.toString().indexOf('RegExp')) {\n\n var regexp = new RegExp(args.tag);\n\n if (regexp.test(span.tag)) {\n nodes.push(span);\n continue;\n }\n }\n\n\n\n // A full text is given\n if (typeof args.text === 'string' && args.text === span.__text__) {\n nodes.push(span);\n continue;\n }\n\n\n\n // Regex for the text is given\n // A regex is given as the tag\n if (typeof args.text === 'object' && args.text.constructor.toString().indexOf('RegExp')) {\n\n var regexp = new RegExp(args.text);\n\n if (regexp.test(span.__text__)) {\n nodes.push(span);\n \n continue;\n }\n }\n }\n \n // If a callback has been specified then call it whilst\n // passing it the text\n if (typeof args.callback === 'function') {\n (args.callback)({nodes: nodes, object:args.object});\n }\n\n return nodes;\n };\n\n\n\n\n //\n // Add the SPAN tag to the return value\n //\n ret.node = span;\n\n\n //\n // Save and then return the details of the text (but oly\n // if it's an RGraph object that was given)\n //\n if (obj && obj.isrgraph && obj.coordsText) {\n obj.coordsText.push(ret);\n }\n\n\n return ret;\n }", "createHTMLText(){\n let myText = document.createElement(\"text\");\n myText.contentEditable = true;\n myText.innerHTML = this.content;\n myText.setAttribute( 'class', 'textElementSlide');\n myText.setAttribute('spellcheck', \"false\");\n myText.setAttribute('id', this.id);\n return myText;\n }", "_drawTextSVG(x, y, svg_container) {\r\n const that = this;\r\n\r\n let textElem = document.createElementNS(\r\n 'http://www.w3.org/2000/svg',\r\n 'text'\r\n );\r\n textElem.setAttribute('x', x);\r\n textElem.setAttribute('y', y);\r\n textElem.setAttribute('text-anchor', 'middle');\r\n textElem.classList.add('jqx-barcode-label');\r\n textElem.style.fill = that.labelColor;\r\n textElem.style.fontFamily = that.labelFont;\r\n textElem.style.fontSize = that.labelFontSize + 'px';\r\n textElem.textContent = that.value;\r\n svg_container.appendChild(textElem);\r\n }", "static addText(svg, x, y, fontSize, textContent, anchor, transform) {\n const lines = textContent.split('\\n');\n let text;\n for (let i = 0; i < lines.length; ++i) {\n text = document.createElementNS(svgNS, 'text');\n text.setAttributeNS(null, 'x', x);\n text.setAttributeNS(null, 'y', y);\n text.setAttributeNS(null, 'fill', 'black');\n text.setAttributeNS(null, 'font-size', fontSize);\n if (anchor) {\n text.setAttributeNS(null, 'text-anchor', anchor);\n }\n if (transform) {\n text.setAttributeNS(null, 'transform', transform);\n }\n text.appendChild(document.createTextNode(lines[i]));\n svg.appendChild(text);\n y += fontSize;\n }\n return text;\n }", "function startDragText(evt)\r\n{\r\n\r\n if(ActiveElem&&!DraggingObj) //---prevents dragging conflicts on other draggable elements---\r\n {\r\n if(evt.target.parentNode.getAttribute(\"id\")==\"activeText\")\r\n {\r\n if(evt.target.parentNode.parentNode.getAttribute(\"class\")==\"dragTargetObj\") //---text elem w/ tspan--\r\n objDragTarget = evt.target.parentNode.parentNode\r\n\r\n }\r\n if(objDragTarget)\r\n {\r\n\r\n addNoSelectAtText()\r\n var pnt = objDragTarget.ownerSVGElement.createSVGPoint();\r\n pnt.x = evt.clientX;\r\n pnt.y = evt.clientY;\r\n //---elements in different(svg) viewports, and/or transformed ---\r\n var sCTM = objDragTarget.getScreenCTM();\r\n var Pnt = pnt.matrixTransform(sCTM.inverse());\r\n\r\n //---used for align of projection/zoom on end drag---\r\n ActiveElemStartTrans =[SVGx, SVGy]\r\n\r\n objTransformRequestObj = activeElem.ownerSVGElement.createSVGTransform()\r\n\r\n //---attach new or existing transform to element, init its transform list---\r\n var myTransListAnim = activeElem.transform\r\n objTransList = myTransListAnim.baseVal\r\n\r\n ObjStartX = Pnt.x\r\n ObjStartY = Pnt.y\r\n\r\n DraggingObj = true\r\n\r\n }\r\n }\r\n else\r\n DraggingObj = false\r\n\r\n}", "function saveText() {\n\t if (input.value.trim().length > 0) {\n\t var clientX = parseInt(input.style.left, 10);\n\t var clientY = parseInt(input.style.top, 10);\n\t var svg = (0, _utils.findSVGAtPoint)(clientX, clientY);\n\t if (!svg) {\n\t return;\n\t }\n\t\n\t var _getMetadata = (0, _utils.getMetadata)(svg),\n\t documentId = _getMetadata.documentId,\n\t pageNumber = _getMetadata.pageNumber;\n\t\n\t var rect = svg.getBoundingClientRect();\n\t var annotation = Object.assign({\n\t type: 'textbox',\n\t size: _textSize,\n\t color: _textColor,\n\t content: input.value.trim()\n\t }, (0, _utils.scaleDown)(svg, {\n\t x: clientX - rect.left,\n\t y: clientY - rect.top,\n\t width: input.offsetWidth,\n\t height: input.offsetHeight\n\t }));\n\t\n\t _PDFJSAnnotate2.default.getStoreAdapter().addAnnotation(documentId, pageNumber, annotation).then(function (annotation) {\n\t (0, _appendChild2.default)(svg, annotation);\n\t });\n\t }\n\t\n\t closeInput();\n\t}", "function changeText(){\n elementID = $(\"#textEditElementId\").val();\n var text = $(\".editTextArea\").val();\n var font = $(\"#font\").val();\n var color = $(\"#fontColor\").val();\n var size = $(\"#fontSize\").val();\n var style = $(\"#fontStyle\").val();\n for (var i = 0; i < diagram.length; i++) {\n if (diagram[i]._id == elementID) {\n $(\"#textEditElementId\").val();\n diagram[i].text = text;\n diagram[i].font = font;\n diagram[i].color = color;\n diagram[i].size = size;\n diagram[i].style = style;\n\n $(\"#\"+elementID).text(diagram[i].text);\n $(\"#\"+elementID).css(\"font-family\", font);\n $(\"#\"+elementID).css(\"color\", color);\n $(\"#\"+elementID).css(\"font-size\", size);\n $(\"#\"+elementID).css(\"font-style\", style);\n if($(\"#selectBold\").is(':checked')) {\n diagram[i].weight = \"bold\";\n $(\"#\"+elementID).css(\"font-weight\", \"bold\");\n }\n else{\n diagram[i].weight = \"normal\";\n $(\"#\"+elementID).css(\"font-weight\", \"normal\");\n }\n if($(\"#selectUnderline\").is(':checked')) {\n diagram[i].decoration = \"underline\";\n $(\"#\"+elementID).css(\"text-decoration\", \"underline\");\n }\n else{\n diagram[i].decoration = \"none\";\n $(\"#\"+elementID).css(\"text-decoration\", \"none\");\n }\n break;\n }\n \n }\n $(\"#text-edit-container\").hide(100);\n}", "function addText() {\n // Create a new div \n var maincanvas= document.getElementById(\"maincanvas\")\n var textbox = document.createElement('div')\n textbox.className = 'textbox';\n textbox.innerHTML = '<textarea id=text rows=\"1\" cols=\"50\" placeholder=\"Type Here...\"></textarea>'\n // Add it to the main canvas\n maincanvas.appendChild(textbox);\n $(textbox).draggable({cursor: \"crosshair\"})\n\n}", "function addText(text = \"Tap and Edit\", pos_top = 0, pos_left = 0) {\r\n canvas.add(new fabric.IText(text, {\r\n left: pos_left,\r\n id: canvas.getObjects().length + 1,\r\n top: pos_top,\r\n fontSize: 150,\r\n fontFamily: 'Helvetica',\r\n fontWeight: 'normal'\r\n }));\r\n}", "function addText(text = \"Tap and Edit\", pos_top = 0, pos_left = 0) {\r\n canvas.add(new fabric.IText(text, {\r\n left: pos_left,\r\n id: canvas.getObjects().length + 1,\r\n top: pos_top,\r\n fontSize: 150,\r\n fontFamily: 'Helvetica',\r\n fontWeight: 'normal'\r\n }));\r\n}", "addTexttoBlob(blob, text, font_family, font_size, text_align, vertical_align, color) {\n const xmlns = \"http://www.w3.org/1999/xhtml\"\n d3.select(blob.html.node().parentNode).select(\"foreignObject\")\n .select(\"div\")\n .append(\"xhtml:div\")\n .style(\"display\", \"table-row\")\n .append(\"xhtml:p\").text(text)\n .attr(\"xmlns\", xmlns)\n .style(\"font-family\", font_family)\n .style(\"font-size\", font_size)\n .style(\"text-align\", text_align)\n .style(\"vertical-align\", vertical_align)\n .style(\"color\", color)\n .style(\"display\", \"table-cell\")\n }", "function saveTextAsSVG() {\n\t\t\"use strict\";\n\t\t//var textToWrite = document.getElementById(\"inputTextToSave\").value;\n\t\tvar json = editor.get();\n\t\tvar textToWrite = myDoc.getElementById(\"drawing1\").innerHTML;\n\n\t\tvar textFileAsBlob = new Blob([textToWrite], {\n\t\t\ttype: 'text/plain'\n\t\t});\n\t\tvar fileNameToSaveAs = json.Header.Name + \"_svg.svg\";\n\n\t\tvar downloadLink = document.createElement(\"a\");\n\t\tdownloadLink.download = fileNameToSaveAs;\n\t\tdownloadLink.innerHTML = \"Download File\";\n\t\tif (typeof window.webkitURL !== \"undefined\") {\n\t\t\t// Chrome allows the link to be clicked\n\t\t\t// without actually adding it to the DOM.\n\t\t\tdownloadLink.href = window.webkitURL.createObjectURL(textFileAsBlob);\n\t\t} else {\n\t\t\t// Firefox requires the link to be added to the DOM\n\t\t\t// before it can be clicked.\n\n\t\t\tdownloadLink.href = window.URL.createObjectURL(textFileAsBlob);\n\t\t\tdownloadLink.onclick = destroyClickedElement;\n\t\t\tdownloadLink.style.display = \"none\";\n\t\t\tdocument.body.appendChild(downloadLink);\n\n\t\t}\n\t\tsimulateClick(downloadLink);\n\t}", "function addText(){\n var fontSelection = $('#fontselector').val();\n var addTextField = $('#addTextField').val();\n var link = document.createElement('link');\n link.rel = 'stylesheet';\n link.type = 'text/css';\n link.href = 'http://fonts.googleapis.com/css?family=' + fontSelection;\n $('head').append(link);\n\n\n //NOTE: For applying text to canvas -- get from inputs\n//TODO: Fonts should be placed here\n var unformatted = new fabric.Text(addTextField, {\n name: 'text',\n fill: 'white',\n fontFamily: fontSelection,\n fontSize: 25,\n top: 280,\n left: center.left,\n originX: 'center'\n });\n\n\n//need to fit within coordinates\n//TODO: change height and width to textcoord h/w and font selection\n var formatted = wrapCanvasText(unformatted, canvas, 280,120, 'left');\n formatted.name = 'text';\n formatted.selectable = false;\n\n var newText = canvas.getItemByName(unformatted.name);\n\n if(!newText)\n { canvas.add(formatted);\n }\n else {\n canvas.remove(newText);\n canvas.add(formatted);\n }\n}", "createSvgText(x, y, color, fontSize, text) {\n const t = document.createElementNS(this.svgNS, \"text\");\n t.setAttributeNS(null, \"x\", x);\n t.setAttributeNS(null, \"y\", y);\n t.setAttributeNS(null, \"fill\", color);\n t.setAttributeNS(null, \"font-size\", fontSize);\n t.textContent = text;\n return t;\n }", "static getTextBox(svg,attributes,classes,text) {\n\t\tvar el = svgHelpers.placeSvgText(svg,attributes,classes,text);\n\t\tvar box = el.getBBox();\n\t\tsvg.removeChild(el);\n\t\treturn box;\n\t}", "function writeText() {\n let outputText = \n ['g', getText().map(textData => ['g', {'attrs': {'transform': 'translate(-0.5 -0.5)'}},\n ['switch',\n ['foreignObject', {'attrs': {'style': 'overflow: visible; text-align: left;', 'pointer-events': 'none', 'width': '100%', 'height': '100%', 'requiredFeatures': 'http://www.w3.org/TR/SVG11/feature#Extensibility'}},\n ['div', {'attrs': {'style': `display: flex; align-items: unsafe center; justify-content: unsafe ${textData[\"justify\"]}; width: ${textData[\"width\"]}px; height: 1px; padding-top: ${textData[\"padding\"]}px; margin-left: ${textData[\"margin\"]}px;`}},\n ['div', {'attrs': {'style': 'box-sizing: border-box; font-size: 0; text-align: center;'}},\n ['div', {'attrs': {'style': `display: inline-block; font-size: 12px; font-family: Helvetica; color: ${textData[\"color-fill\"]}; line-height: 1.2; pointer-events: none; white-space: normal; word-wrap: normal; `}}, `${textData[\"text\"]}`]]]],\n ['text', {'attrs': {'x': `${textData[\"x\"]}`, 'y': `${textData[\"padding\"]+4}`, 'fill': `${textData[\"color-fill\"]}`, 'font-family': 'Helvetica', 'font-size': '12px', 'text-anchor': 'middle'}}, `${textData[\"text\"]}`]]])];\n \n return outputText;\n}", "function addText(base) {\n var text = svgContainer.append(\"text\").attr(\"fill\", \"white\")\n .attr(\"font-size\", baseSize + \"px\")\n .attr(\"text-anchor\", \"middle\")\n .text(base);\n}", "function createDE(){\n\t\tvar gc_enter=svg.selectAll(\"g\")\n\t\t.append(\"text\")\n\t\t.attr(\"class\",\"DEText\")\n\t\t.attr(\"opacity\",0)\n\t\t.attr(\"x\",\"-8em\")\n\t\t.attr(\"y\",\"0em\")\n\t\tgc_enter.call(addDEText,20);\n\t}", "function textProperties() {\n // create new\n if (selectedAnnos.length == 0) {\n // properties of text\n $('#' + iv.drawAnno.node.id).children().text($(textExample.COMMENTTEXT).val());\n $(\"#\" + iv.drawAnno.node.id).attr(\"fill\", $('#color').find(\":selected\").text());\n $(\"#\" + iv.drawAnno.node.id).attr(\"font-family\", $('#font').find(\":selected\").text());\n\n $(\"#\" + iv.drawAnno.node.id).attr(\"font-size\", $('#fontSize').find(\":selected\").text());\n if ($(textExample.FONTSTYLEID).find(\":selected\").text() == \"Regular\") {\n $(\"#\" + iv.drawAnno.node.id).attr(\"font-style\", \"\");\n $(\"#\" + iv.drawAnno.node.id).attr(\"font-weight\", \"\");\n }\n if ($(textExample.FONTSTYLEID).find(\":selected\").text() == \"Bold\") {\n $(\"#\" + iv.drawAnno.node.id).attr(\"font-style\", \"\");\n $(\"#\" + iv.drawAnno.node.id).attr(\"font-weight\", \"bold\");\n }\n if ($(textExample.FONTSTYLEID).find(\":selected\").text() == \"Italic\") {\n $(\"#\" + iv.drawAnno.node.id).attr(\"font-style\", \"italic\");\n $(\"#\" + iv.drawAnno.node.id).attr(\"font-weight\", \"\");\n }\n if ($(textExample.FONTSTYLEID).find(\":selected\").text() == \"Bold Italic\") {\n $(\"#\" + iv.drawAnno.node.id).attr(\"font-style\", \"italic\");\n $(\"#\" + iv.drawAnno.node.id).attr(\"font-weight\", \"bold\");\n }\n\n // create rect around\n var ctx = document.getElementById(iv.svg.node.id)\n , textElm = ctx.getElementById(iv.drawAnno.node.id)\n , SVGRect = textElm.getBBox();\n if (allAnnos.indexOf(iv.drawAnno.node.id) == -1) {\n allAnnos.push(\"SvgjsRect\"+SVG.did);\n allAnnos.push(iv.drawAnno.node.id);\n }\n var rect = document.createElementNS(\"http://www.w3.org/2000/svg\", \"rect\");\n rect.setAttribute(\"id\", \"SvgjsRect\"+SVG.did);\n SVG.did++;\n rect.setAttribute(\"class\", \"textDraw\");\n rect.setAttribute(\"x\", SVGRect.x);\n rect.setAttribute(\"y\", SVGRect.y);\n rect.setAttribute(\"width\", SVGRect.width);\n rect.setAttribute(\"height\", SVGRect.height);\n rect.setAttribute(\"fill\", $('#fill').find(\":selected\").text());\n rect.setAttribute(\"stroke\", $('#border').find(\":selected\").text());\n ctx.insertBefore(rect, textElm);\n }// exist text\n else {\n // properties of text\n $('#' + selectedAnnos[1]).children().text($(textExample.COMMENTTEXT).val());\n $('#' + selectedAnnos[1]).attr(\"fill\", $('#color').find(\":selected\").text());\n $('#' + selectedAnnos[1]).attr(\"font-family\", $('#font').find(\":selected\").text());\n\n $('#' + selectedAnnos[1]).attr(\"font-size\", $('#fontSize').find(\":selected\").text());\n if ($(textExample.FONTSTYLEID).find(\":selected\").text() == \"Regular\") {\n $('#' + selectedAnnos[1]).attr(\"font-style\", \"\");\n $('#' + selectedAnnos[1]).attr(\"font-weight\", \"\");\n }\n if ($(textExample.FONTSTYLEID).find(\":selected\").text() == \"Bold\") {\n $('#' + selectedAnnos[1]).attr(\"font-style\", \"\");\n $('#' + selectedAnnos[1]).attr(\"font-weight\", \"bold\");\n }\n if ($(textExample.FONTSTYLEID).find(\":selected\").text() == \"Italic\") {\n $('#' + selectedAnnos[1]).attr(\"font-style\", \"italic\");\n $('#' + selectedAnnos[1]).attr(\"font-weight\", \"\");\n }\n if ($(textExample.FONTSTYLEID).find(\":selected\").text() == \"Bold Italic\") {\n $('#' + selectedAnnos[1]).attr(\"font-style\", \"italic\");\n $('#' + selectedAnnos[1]).attr(\"font-weight\", \"bold\");\n }\n\n // set properties of exist rect around\n $('#' + selectedAnnos[0]).attr(\"fill\", $('#fill').find(\":selected\").text());\n $('#' + selectedAnnos[0]).attr(\"stroke\", $('#border').find(\":selected\").text());\n }\n}", "function text(index,value){var lView=getLView();ngDevMode&&assertEqual(lView[BINDING_INDEX],lView[TVIEW].bindingStartIndex,'text nodes should be created before any bindings');ngDevMode&&ngDevMode.rendererCreateTextNode++;var textNative=createTextNode(value,lView[RENDERER]);var tNode=createNodeAtIndex(index,3/* Element */,textNative,null,null);// Text nodes are self closing.\nsetIsParent(false);appendChild(textNative,tNode,lView);}", "function setSVGText(elemID, text)\n{\n\tvar textItem = svgDocument.getElementById(elemID);\n\t\t\n\tif(textItem != null)\n\t{\n var textNode = null;\n \n\t\tif(textItem == \"[object SVGTextElement]\")\n textNode = textItem.firstChild.firstChild;\n else if(textItem == \"[object SVGTSpanElement]\")\n textNode = textItem.firstChild;\n \n if(textNode != null)\n {\n // Following two lines workaround a problem in Safari 6\n textNode.nodeValue=\".\";\n textNode.nodeValue=\". \";\n \n textNode.nodeValue=text;\n return;\n }\n\t}\n \n alert(\"setSVGText(...) failed to update string to \" + text + \" on element ID \" + elemID);\n}", "function utils_createSVGTextElement(content, x, y, attributes = {}) {\n\n const text = document.createElementNS(\"http://www.w3.org/2000/svg\", \"text\");\n text.appendChild(document.createTextNode(content))\n\n text.setAttribute('x', x);\n text.setAttribute('y', y);\n \n Object.keys(attributes).forEach(key => {\n text.setAttribute(key, attributes[key]);\n });\n\n return text;\n}", "function update_text_display(){\n svg_element = document.getElementById('svg_container')\n var new_text = document.getElementById('animation_text_input').value;\n\n svg_text_element = document.getElementById('animation_text');\n document.getElementById('text_group').innerHTML = \"\"; //clear the text\n num_colours = colours.length //fixing this number to recreate the example on codepen\n\n var selected_font = document.getElementById('font_select').value;\n console.log('here');\n\n for (var colour_num = 0; colour_num < num_colours; colour_num++){\n var svg_text_element = document.createElementNS(svgns, \"text\"); //create an svg text element that the user's text will be put into\n document.getElementById('text_group').append(svg_text_element); \n svg_text_element.innerHTML = new_text;\n svg_text_element.setAttribute(\"class\", \"text--line text-copy \" + selected_font); //add css class \n }\n}", "function addTextEltToSVG(svg, attrs, text)\n{\n var element = document.createElementNS(\"http://www.w3.org/2000/svg\", \"text\");\n if (attrs === undefined) attrs = {};\n for (var key in attrs) {\n element.setAttributeNS(null, key, attrs[key]);\n }\n \n //Add text as child of text element\n element.appendChild(document.createTextNode(text));\n\n svg.appendChild(element);\n}", "function onDraw() {\n var svg = d3.select(\"#tag-cloud-wrapper\").append(\"svg\").attr({ width: w, height: h, \"class\": \"side-a\" }),\n vis = svg.append(\"g\").attr(\"transform\", \"translate(\" + [w >> 1, (h >> 1) - 10] + \")scale(2)\");\n var text = vis.selectAll(\"text\").data(data);\n text.enter().append(\"text\")\n .style(\"font-family\", function (d) { return d.font; })\n .style(\"font-size\", function (d) { return d.size + \"px\"; })\n .style(\"fill\", function (d, i) { return fill(i); })\n .style({ cursor: \"pointer\", opacity: 1e-6 })\n .attr(\"text-anchor\", \"middle\")\n .attr(\"transform\", function (d) {\n return \"translate(\" + [d.x, d.y] + \")rotate(\" + d.rotate + \")\";\n })\n .text(function (d) { return d.text; })\n .on(\"click\", function (d) {\n //[this] is the <text> element of svg\n alert(\"tag: \" + d.text);\n })\n .transition()\n .duration(1000)\n .style(\"opacity\", 1);\n vis.transition()\n .delay(450)\n .duration(750)\n .attr(\"transform\", \"translate(\" + [w >> 1, (h >> 1) + 10] + \")scale(1)\");\n }", "editCommand(){const richtext=this.shadowRoot.getElementById(\"richtext\"),editmode=richtext.contentDocument;editmode.designMode=\"on\"}", "function drawText()\n\t{\n\t\t// Figure out the correct text\n\t\tvar text = getText();\n\n\t\twid = that.add('text', {\n\t\t\ttext: text,\n\t\t\tcolor: style.color,\n\t\t\tfont: style.font,\n\t\t\tcursor: 'pointer'\n\t\t});\n\n\t\t// Set the width of the widget\n\t\tthat.w = wid.width();\n\n\t\t// Assign a toggler\n\t\twid.applyAction('click', {\n\t\t\tclick: toggleMode\n\t\t});\n\t}", "function link(){\n var att=['x', 'y', 'text'];\n var object = shape('link', att);\n\n // Override the function copy_shape mantaining the most part of\n // his code\n object.parent_copy_shape = object.copy_shape;\n object.copy_shape = function(target){\n this.parent_copy_shape(target);\n // Read the url and put it into the textarea\n // (text.textnode.data)\n getById('textinput').value =\n target.childNodes[1].data;\n }\n\n object.mousedown = function(x, y){\n this.x = x;\n this.y = y;\n object.show_text_area(x, y);\n };\n\n object.server_create = function(par, id){\n this.create_group(id);\n var x = par[2];\n var y = par[3];\n if (id === undefined)\n //client call\n var url = unescape(unescape(par[4]));\n else\n //server call\n var url = unescape(par[4]);\n // Create the element (can't use create_element because this case\n // is not standard)\n this.element = document.createElementNS(svgns, 'text');\n sa(this.element, {'fill': '#0000CD', 'x':x, 'y':y});\n this.group.appendChild(this.element);\n // First add an hidden tspan to distinguish the link from plain\n // text (this is read into handleMouseDown, branch \"select\")\n var tspan = document.createElementNS(svgns, \"tspan\");\n tspan.setAttribute('visibility', 'hidden');\n this.element.appendChild(tspan);\n // Add url content\n var tnode = document.createTextNode(url,true);\n this.element.appendChild(tnode);\n // In svgweb, text nodes can't inherit handlers from root like\n // other nodes do, so we have to add the handlers here\n if (svgweb.getHandlerType() == 'flash'){\n this.element.addEventListener('mousedown', handleMouseDown, false);\n this.element.addEventListener('mouseup', handleMouseUp, false);\n this.element.addEventListener('mousemove', handleMouseMove, false);\n }\n };\n\n return object;\n}", "_transformText () {\n // Collect all text elements into a list.\n const textElements = [];\n const collectText = domElement => {\n if (domElement.localName === 'text') {\n textElements.push(domElement);\n }\n for (let i = 0; i < domElement.childNodes.length; i++) {\n collectText(domElement.childNodes[i]);\n }\n };\n collectText(this._svgTag);\n convertFonts(this._svgTag);\n // For each text element, apply quirks.\n for (const textElement of textElements) {\n // Remove x and y attributes - they are not used in Scratch.\n textElement.removeAttribute('x');\n textElement.removeAttribute('y');\n // Set text-before-edge alignment:\n // Scratch renders all text like this.\n textElement.setAttribute('alignment-baseline', 'text-before-edge');\n textElement.setAttribute('xml:space', 'preserve');\n // If there's no font size provided, provide one.\n if (!textElement.getAttribute('font-size')) {\n textElement.setAttribute('font-size', '18');\n }\n let text = textElement.textContent;\n\n // Fix line breaks in text, which are not natively supported by SVG.\n // Only fix if text does not have child tspans.\n // @todo this will not work for font sizes with units such as em, percent\n // However, text made in scratch 2 should only ever export size 22 font.\n const fontSize = parseFloat(textElement.getAttribute('font-size'));\n const tx = 2;\n let ty = 0;\n let spacing = 1.2;\n // Try to match the position and spacing of Scratch 2.0's fonts.\n // Different fonts seem to use different line spacing.\n // Scratch 2 always uses alignment-baseline=text-before-edge\n // However, most SVG readers don't support this attribute\n // or don't support it alongside use of tspan, so the translations\n // here are to make up for that.\n if (textElement.getAttribute('font-family') === 'Handwriting') {\n spacing = 2;\n ty = -11 * fontSize / 22;\n } else if (textElement.getAttribute('font-family') === 'Scratch') {\n spacing = 0.89;\n ty = -3 * fontSize / 22;\n } else if (textElement.getAttribute('font-family') === 'Curly') {\n spacing = 1.38;\n ty = -6 * fontSize / 22;\n } else if (textElement.getAttribute('font-family') === 'Marker') {\n spacing = 1.45;\n ty = -6 * fontSize / 22;\n } else if (textElement.getAttribute('font-family') === 'Sans Serif') {\n spacing = 1.13;\n ty = -3 * fontSize / 22;\n } else if (textElement.getAttribute('font-family') === 'Serif') {\n spacing = 1.25;\n ty = -4 * fontSize / 22;\n }\n\n if (textElement.transform.baseVal.numberOfItems === 0) {\n const transform = this._svgTag.createSVGTransform();\n textElement.transform.baseVal.appendItem(transform);\n }\n\n // Right multiply matrix by a translation of (tx, ty)\n const mtx = textElement.transform.baseVal.getItem(0).matrix;\n mtx.e += (mtx.a * tx) + (mtx.c * ty);\n mtx.f += (mtx.b * tx) + (mtx.d * ty);\n\n if (text && textElement.childElementCount === 0) {\n textElement.textContent = '';\n const lines = text.split('\\n');\n text = '';\n for (const line of lines) {\n const tspanNode = SvgElement.create('tspan');\n tspanNode.setAttribute('x', '0');\n tspanNode.setAttribute('style', 'white-space: pre');\n tspanNode.setAttribute('dy', `${spacing}em`);\n tspanNode.textContent = line ? line : ' ';\n textElement.appendChild(tspanNode);\n }\n }\n }\n }", "function textAr(){\n const textArea1 = document.createElement('div');\n textArea1.id = \"textArea\";\n app.appendChild(textArea1);\n const textMover = document.createElement('h1');\n textMover.id = 'textMove';\n textArea1.appendChild(textMover);\n const textMandatory = document.createElement('h2');\n textMandatory.id = \"textMand\";\n textArea1.appendChild(textMandatory);\n}", "addText(value) {\n let textElement = new TextElement(value, this._xPos, this._yPos, this._width, this._height, this._line);\n this._textLines.push(textElement);\n this._line += 1;\n return textElement;\n }", "function renderEditDivs() {\n for (var i = 0; i < getTexts().length; i++) {\n let text = getTexts()[i]\n let editDiv = `<div \n data-id=\"${text.id}\"\n class=\"text-box\"\n contenteditable=\"true\"\n style=\"left:${text.pos.x}px; top:${text.pos.y}px; font-size:${text.size}px\"\n onmousedown=\"onEditDivClick(event, this)\"\n onkeyup=\"onKeyUp(this)\"\n \n ontouchstart=\"onTouchStart(event, this)\"\n >\n ${text.line}</div>`\n document.querySelector('.canvas-wrap span').innerHTML += editDiv;\n }\n\n}", "function onCreateText() {\n let elText = document.querySelector('.currText').value\n if (elText === '') return;\n createText()\n resetValues()\n draw()\n}", "function createEdgeTF(){\n\t\tvar gc_enter=svg.selectAll(\"g\")\n\t\t.append(\"text\")\n\t\t.attr(\"class\",\"TFText\")\n\t\t.attr(\"opacity\",0)\n\t\t.attr(\"x\",\"-8em\")\n\t\t.attr(\"y\",\"0em\")\n\t\tgc_enter.call(addTFText,20);\n\t\t\n\t}", "function textObjectDragStop(event, ui) {\n var id\n , objectData\n , shape_border_width\n ;\n if (event.target.id.indexOf(\"customShape\") != -1) {\n id = event.target.id.slice(\"customShape\".length);\n shape_border_width = $(\"#customShape\" + id + \" svg\").children().attr('stroke-width');\n }\n else if (event.target.id.indexOf(\"customText\") != -1) {\n id = event.target.id.slice(\"customText\".length);\n shape_border_width = 5;\n }\n\n objectData = event.target.outerHTML;\n\n\n editTextObject(id, {\n data: objectData\n });\n}", "function createSvg(text, kind){\n return d3.select(text)\n .attr(\"width\", viewWidth + margin.left + margin.right)\n .attr(\"height\", viewHeight + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"id\", kind)\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n}", "function addElement(mousedownx, mousedowny, mouseupx, mouseupy, strokesize,\n\t\tstrokecolor, fillcolor, shape, img, txt, obj) {\n\tvar el = new Element;\n\tel.strokesize = strokesize;\n\tel.strokecolor = strokecolor;\n\tel.fillcolor = fillcolor;\n\tel.shape = shape;\n\tel.text = txt;\n\tel.obj = obj;\n\tif (mousedownx <= mouseupx && mousedowny <= mouseupy) {\n\t\tel.x = el.new_x = el.selection.x = mousedownx - Math.ceil(el.strokesize / 2);\n\t\tel.y = el.new_y = el.selection.y = mousedowny - Math.ceil(el.strokesize / 2);\n\t\tel.w = el.new_w = el.selection.w = mouseupx - mousedownx + Math.ceil(el.strokesize / 2)\n\t\t\t\t* 2;\n\t\tel.h = el.new_h = el.selection.h = mouseupy - mousedowny + Math.ceil(el.strokesize / 2)\n\t\t\t\t* 2;\n\t} else if (mousedownx > mouseupx && mousedowny <= mouseupy) {\n\t\tel.x = el.new_x = el.selection.x = mouseupx - Math.ceil(el.strokesize / 2);\n\t\tel.y = el.new_y = el.selection.y = mousedowny - Math.ceil(el.strokesize / 2);\n\t\tel.w = el.new_w = el.selection.w = mousedownx - mouseupx + Math.ceil(el.strokesize / 2)\n\t\t\t\t* 2;\n\t\tel.h = el.new_h = el.selection.h = mouseupy - mousedowny + Math.ceil(el.strokesize / 2)\n\t\t\t\t* 2;\n\t} else if (mousedownx <= mouseupx && mousedowny > mouseupy) {\n\t\tel.x = el.new_x = el.selection.x = mousedownx - Math.ceil(el.strokesize / 2);\n\t\tel.y = el.new_y = el.selection.y = mouseupy - Math.ceil(el.strokesize / 2);\n\t\tel.w = el.new_w = el.selection.w = mouseupx - mousedownx + Math.ceil(el.strokesize / 2)\n\t\t\t\t* 2;\n\t\tel.h = el.new_h = el.selection.h = mousedowny - mouseupy + Math.ceil(el.strokesize / 2)\n\t\t\t\t* 2;\n\t} else {\n\t\tel.x = el.new_x = el.selection.x = mouseupx - Math.ceil(el.strokesize / 2);\n\t\tel.y = el.new_y = el.selection.y = mouseupy - Math.ceil(el.strokesize / 2);\n\t\tel.w = el.new_w = el.selection.w = mousedownx - mouseupx + Math.ceil(el.strokesize / 2)\n\t\t\t\t* 2;\n\t\tel.h = el.new_h = el.selection.h = mousedowny - mouseupy + Math.ceil(el.strokesize / 2)\n\t\t\t\t* 2;\n\t}\n\tel.selection.x -= mySelPadding;\n\tel.selection.y -= mySelPadding;\n\tel.selection.w += mySelPadding*2;\n\tel.selection.h += mySelPadding*2;\n//\tif(img){\n\t\ttry {\n\t\t\ttry {\n\t\t\t\tvar imgd = context.getImageData(el.x, el.y, el.w, el.h);\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\tnetscape.security.PrivilegeManager.enablePrivilege(\"UniversalBrowserRead\");\n\t\t\t\tvar imgd = context.getImageData(el.x, el.y, el.w, el.h);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tthrow new Error(\"unable to access image data: \" + e)\n\t\t}\n\t\tel.data = el.tmp_data = imgd;\n//\t} else {\n//\t\tel.data = el.tmp_data = context.getImageData(el.x, el.y, el.w, el.h);\n//\t}\n\telements.push(el);\n\tinvalidate();\n}", "function text_view(text, marker_coordinates) {\n // function text_view(text) {\n var pText = document.createElement(\"p\");\n pText.innerHTML = escape_html_tags(text);\n appendBlock(pText, \"text\");\n set_block_coordinates(pText, marker_coordinates);\n}", "function ExplorableHintedText(options) {\n let coordinates,\n text,\n string,\n alignmentBaseline,\n backgroundColor,\n backgroundStroke,\n fontFamily,\n fontWeight,\n fontSize,\n foregroundColor,\n textAnchor,\n where;\n\n\n text = this;\n\n init();\n\n return text;\n\n /* INITIALIZE */\n function init() {\n\n _required();\n _defaults();\n\n text.group = addGroup();\n text.innerGroup = addInnerGroup();\n text.background = addBackground();\n text.foreground = addForeground();\n\n text.move(coordinates);\n\n }\n\n\n /* PRIVATE METHODS */\n function _defaults() {\n alignmentBaseline = options.alignmentBaseline ? options.alignmentBaseline : \"middle\";\n backgroundColor = options.backgroundColor ? options.backgroundColor : \"white\";\n backgroundStroke = options.backgroundStroke ? options.backgroundStroke : 5;\n foregroundColor = options.foregroundColor ? options.foregroundColor : \"black\";\n fontSize = options.fontSize ? options.fontSize : \"18pt\";\n fontWeight = options.fontWeight ? options.fontWeight : \"normal\";\n textAnchor = options.textAnchor ? options.textAnchor : \"middle\";\n fontFamily = options.fontFamily ? options.fontFamily : \"sans-serif\";\n string = options.string ? options.string : \"\";\n coordinates = options.coordinates ? options.coordinates : {\"x\":0,\"y\":0};\n }\n\n function _required() {\n\n where = options.where;\n\n }\n\n function addBackground() {\n let background;\n\n background = addText(text.innerGroup,string);\n\n background\n .attr(\"stroke\",backgroundColor)\n .attr(\"stroke-width\",backgroundStroke)\n .attr(\"alignment-baseline\",alignmentBaseline)\n .attr(\"text-anchor\",textAnchor)\n .attr(\"font-weight\",fontWeight)\n .attr(\"font-size\",fontSize)\n .attr(\"font-family\",fontFamily)\n .attr(\"opacity\",1);\n\n return background;\n }\n\n function addForeground() {\n let foreground;\n\n foreground = addText(text.innerGroup,string);\n\n foreground\n .attr(\"fill\",foregroundColor)\n .attr(\"alignment-baseline\",alignmentBaseline)\n .attr(\"text-anchor\",textAnchor)\n .attr(\"font-weight\",fontWeight)\n .attr(\"font-size\",fontSize)\n .attr(\"font-family\",fontFamily)\n .attr(\"opacity\",1);\n\n return foreground;\n }\n\n function addGroup() {\n let group;\n\n group = explorableGroup({\n \"where\":where\n });\n\n return group;\n }\n\n function addInnerGroup() {\n let innerGroup;\n\n innerGroup = explorableGroup({\n \"where\":text.group\n });\n\n return innerGroup;\n }\n\n function addText(where,string) {\n let text;\n\n text = where\n .append(\"text\")\n .attr(\"x\",0)\n .attr(\"y\",0)\n .text(string);\n\n return text;\n }\n\n\n}", "updateSVGSelf() {\n const text = this.svgElement;\n\n // set all of the font attributes, since we can't use the combined one\n if ( this.dirtyFont ) {\n text.setAttribute( 'font-family', this.node._font.getFamily() );\n text.setAttribute( 'font-size', this.node._font.getSize() );\n text.setAttribute( 'font-style', this.node._font.getStyle() );\n text.setAttribute( 'font-weight', this.node._font.getWeight() );\n text.setAttribute( 'font-stretch', this.node._font.getStretch() );\n }\n\n // update the text-node's value\n if ( this.dirtyText ) {\n text.lastChild.nodeValue = Utils.safariEmbeddingMarkWorkaround( this.node.renderedText );\n }\n\n // text length correction, tested with scenery/tests/text-quality-test.html to determine how to match Canvas/SVG rendering (and overall length)\n if ( this.dirtyBounds && useSVGTextLengthAdjustments ) {\n const useLengthAdjustment = this.node._boundsMethod !== 'accurate' && isFinite( this.node.selfBounds.width );\n\n if ( useLengthAdjustment ) {\n if ( !this.hasLength ) {\n this.hasLength = true;\n text.setAttribute( 'lengthAdjust', 'spacingAndGlyphs' );\n }\n text.setAttribute( 'textLength', this.node.selfBounds.width );\n }\n else if ( this.hasLength ) {\n this.hasLength = false;\n text.removeAttribute( 'lengthAdjust' );\n text.removeAttribute( 'textLength' );\n }\n }\n\n // Apply any fill/stroke changes to our element.\n this.updateFillStrokeStyle( text );\n }", "createDragText (highlightedText) {\n this.isDragReleased[highlightedText.stepNumber] = true\n const highDragText = this.game.add.text(\n this.game.input.x,\n this.game.input.y,\n this.dialogSteps[highlightedText.stepNumber].dragText,\n {\n font: '14px Arial',\n fill: '#bfedf5'\n }\n )\n highDragText.lineSpacing = -8\n highDragText.inputEnabled = true\n highDragText.input.useHandCursor = true\n highDragText.input.enableDrag(true)\n highDragText.anchor.setTo(0.5, 0.5)\n highDragText.setShadow(0, 0, 'rgb(0, 0, 0)', 4)\n highDragText.events.onDragStop.add(() => {\n // check if it's in the yes or no zone\n this.dragStopHandler(highDragText, highlightedText)\n })\n }", "function generateTextBlob() {\n var idIndex = idUpdate();\n let tbId = \"tb\" + idIndex;\n //Generate Outer box: all, containshared outcontain\n var tblobbox = jQuery(\"<div/>\", {\n id: tbId,\n class: \"all tboxcontain\",\n });\n\n var txtbox = jQuery(\"<textarea/>\", {\n id: \"ta\" + idIndex,\n class: \"all textbox\",\n value: \"An Input Textbox.\",\n });\n\n let tagboxId = \"outtb\" + idIndex;\n var tagboxout = jQuery(\"<div/>\", {\n id: tagboxId,\n class: \"all tagshared parenttagcont\",\n value: \"\",\n });\n\n var oplusId = \"b\" + idIndex;\n var buttonpoint = jQuery(\"<span/>\", {\n id: oplusId,\n class: \"all tagshared plusbutton\",\n html: \"&oplus;\",\n });\n\n //We need to add tbId to our AddView DataStructure:\n addModeObj.addTB(tbId);\n\n $(\"body\").append(tblobbox);\n $(\"#\" + tbId).append(txtbox);\n $(\"#\" + tbId).append(tagboxout);\n $(\"#\" + tagboxId).append(buttonpoint);\n $(\"#\" + oplusId).on(\"click\", addTag);\n addMouseOver((oplusId));\n}", "function addText(){\n\t\t\tvar newTextadd = new fabric.Text('Текст можно редактировать двойным кликом', { fontFamily: 'Ubuntu', left: 100, top: 150, fontSize: 24, fontStyle: \"normal\", fontWeight: \"normal\", lineHeight: \"1\"});\t\n\t\t\tcanvas.add(newTextadd).setActiveObject(newTextadd);\n\t\t\tselectObjParam();\n\t\t\tcanvas.renderAll();\n\t\t}", "function createText (pai,texto) { \r\n\tvar t = document.createTextNode(texto); \r\n\tpai.appendChild(t); \r\n }", "function create_text_area(text) {\n var paragraph = document.createElement(\"p\");\n paragraph.classList.add(\"text\");\n paragraph.innerHTML = text;\n $('.project_content').prepend(paragraph);\n $('.close_cross').click(function() {\n paragraph.remove();\n });\n\n $('.close_text').click(function() {\n paragraph.remove();\n });\n}", "function createText()\n\t{\n\t\ttextWidget = that.add('text', {\n\t\t\ttype: that.id + '_text',\n\t\t\tid: that.id + '_0',\n\t\t\tx: that.x,\n\t\t\ty: that.y,\n\t\t\tw: that.w,\n\t\t\ttext: that.text,\n\t\t\tfont: style.unitFont,\n\t\t\tcolor: style.sectionTextColor,\n\t\t\thidden: that.hidden,\n\t\t\tcursor: 'pointer',\n\t\t\tdepth: that.depth\n\t\t});\n\n\t\tcurY = that.y + textWidget.height() + style.unitTextGap;\n\t}", "function createText() {\n gTxtCount++;\n gMeme.txts.push(\n {\n id: gTxtCount,\n text: '',\n size: 40,\n align: 'left',\n color: '#ffffff',\n stroke: '#000000',\n strokeSize: 1,\n x: 10,\n y: 50\n }\n );\n}", "function createElementText(value,attr,element,text,parent){\n\t\tlet elementHTML = createElementPerDiv(value,attr,element)\n\t\tlet textNode = document.createTextNode(text);\n\t\telementHTML.appendChild(textNode);\n\t\tparent.appendChild(elementHTML);\n\t}", "function textObjectResize(event, ui, shape_options) {\n var newWidth = ui.size.width\n , newHeight = ui.size.height\n ;\n\n $(\"svg\", ui.element).attr({\n width: newWidth,\n height: newHeight\n });\n $(\"svg > rect\", ui.element).attr({\n width: newWidth,\n height: newHeight\n });\n $(\"svg > ellipse\", ui.element).attr({\n rx: newWidth / 2 - shape_options['shape_border_width'] / 2,\n ry: newHeight / 2 - shape_options['shape_border_width'] / 2,\n cx: newWidth / 2,\n cy: newHeight / 2\n });\n var n = $(\"br\", ui.element).length;\n if (n) {\n $(\"p\", ui.element).css({\n \"font-size\": newHeight / (n * 1.5 + 1)\n });\n } else {\n $(\"p\", ui.element).css({\n \"font-size\": newHeight / 2\n });\n }\n if ($(\"p\", ui.element).length && $(ui.element).width() > newWidth) {\n ui.size.width = $(ui.element).width();\n }\n}", "function createText() { \n var translateText = \"translate(\" + ((window.innerWidth/2)+70) + \", -40)\";\n \n var text = d3.select(\"body\")\n .append(\"svg\")\n .attr(\"width\", chartWidth - 44)\n .attr(\"height\", 100)\n .attr(\"class\", \"text\")\n .attr(\"transform\", translateText);\n \n var content1 = \"For more information about the 2019 Cost of Living Index, visit\";\n \n var content2 = \"http://worldpopulationreview.com/states/cost-of-living-index-by-state/\"\n \n var line1 = text.append(\"text\")\n .attr(\"y\", 10)\n .attr(\"class\", \"textContent\")\n .text(content1);\n \n var line2 = text.append(\"text\")\n .attr(\"y\", 30)\n .attr(\"class\", \"textContent\")\n .text(content2);\n \n \n \n }", "update(txt) {\n this.domElement.innerText = txt;\n this.rect = this.domElement.getBoundingClientRect();\n }", "function appendTextToElement(element, text){\n jQuery(element).append(currentDocument.createTextNode(\"\"+text));\n jQuery(element).append(currentDocument.createElement(\"br\"));\n }", "function redraw() {\n if (mainSvg == null)\n return;\n let textfield = document.querySelector(\"#textfield\");\n let sentence = Parse.ParseSentence(textfield.value);\n Render.render(mainSvg, sentence);\n if (downloadButton != null)\n downloadButton.disabled = false;\n}", "function GenerateObject(rectX, text)\n{\n rectWidth = (text.length * 10) + 10;\n\n svg.innerHTML += \"<rect x='\" + (rectX - (rectWidth/2)) + \"' y='\" + ((svgCurrentY - rectHeight) - 3) + \"' width='\" + rectWidth + \"' height='\" + rectHeight + \"' class='svgRect' />\"; //Rectangle\n\n svg.innerHTML += \"<text x='\" + (rectX - (rectWidth/2) + 5) + \"' y='\" + ((svgCurrentY - rectHeight) + (rectHeight/1.5)) + \"' class='svgText'>\" + text + \"</text>\" //Text\n}", "function St(e){return e.node==e.text&&(e.node=n(\"div\",null,null,\"position: relative\"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),vo&&wo<8&&(e.node.style.zIndex=2)),e.node}", "function ISSUE_ELEMENT_TEXT$static_(){IssuesPanelBase.ISSUE_ELEMENT_TEXT=( IssuesPanelBase.ISSUE_BLOCK.createElement(\"text\"));}", "function textC(vm, text) {\n let tc = document.createElementNS(SVG_NS, 'text');\n tc.setAttribute('x', vm.x);\n tc.setAttribute('y', vm.y);\n tc.setAttribute('class', `tc f${vm.stroke}`);\n tc.textContent = text;\n vm.svg.appendChild(tc);\n vm.traceInfo('textC:\"', tc);\n}", "function addTextLabel(root,node){var domNode=root.append(\"text\");var lines=processEscapeSequences(node.label).split(\"\\n\");for(var i=0;i<lines.length;i++){domNode.append(\"tspan\").attr(\"xml:space\",\"preserve\").attr(\"dy\",\"1em\").attr(\"x\",\"1\").text(lines[i])}util.applyStyle(domNode,node.labelStyle);return domNode}", "function makeViewText(text)\n{\n const textSpan = makeSpan();\n textSpan.attr(\"id\", text);\n textSpan.addClass(\"view\");\n setText(textSpan, text);\n return textSpan;\n}", "function showNewText(text) {\n firstText.innerHTML = `${text}`;\n gsap.to(\".m402-text-relative\", {\n duration: 0.3,\n opacity: 1\n });\n}", "function showNewText(text) {\n firstText.innerHTML = `${text}`;\n gsap.to(\".m402-text-relative\", {\n duration: 0.3,\n opacity: 1\n });\n}", "function latex(p,st,id,fontsty) {\n if (!myCreateElementSVG(\"foreignObject\")) return text(p,\"foreignObject not supported\",\"below right\");\n else { // foreignObject supported, so...\n var node;\n var frag = myCreateElementXHTML(\"div\");\n frag.setAttribute(\"style\",\"float:left\");\n frag.innerHTML = st;\n var uid = \"_asciisvg_f_foreign_object_content_\"\n frag.id = uid; \n if (id!=null) node = doc.getElementById(id);\n if (node==null) {\n node = myCreateElementSVG(\"foreignObject\");\n node.setAttribute(\"id\", id);\n svgpicture.appendChild(node);\n node.appendChild(frag);\n }\n if (typeof MathJax != \"undefined\") {\n MathJax.Hub.Queue([\"Typeset\",MathJax.Hub,node]);//!!\n MathJax.Hub.Queue(function() {\n node.setAttribute(\"width\",document.getElementById(uid).offsetWidth);\n node.setAttribute(\"height\",document.getElementById(uid).offsetHeight); \n });\n } else {\n node.setAttribute(\"width\",document.getElementById(uid).offsetWidth);\n node.setAttribute(\"height\",document.getElementById(uid).offsetHeight);\n }\n node.setAttribute(\"x\",p[0]*xunitlength+origin[0]);\n node.setAttribute(\"y\",height-p[1]*yunitlength-origin[1]);\n node.setAttribute(\"font-style\",(fontsty!=null?fontsty:fontstyle));\n node.setAttribute(\"font-family\",fontfamily);\n node.setAttribute(\"font-size\",fontsize);\n node.setAttribute(\"font-weight\",fontweight);\n if (fontstroke!=\"none\") node.setAttribute(\"stroke\",fontstroke);\n if (fontfill!=\"none\") node.setAttribute(\"fill\",fontfill);\n\n return p;\n } // end case foreignObject supported\n}", "function drawText (x, y, size, align, color, text){\n\treturn svg.append(\"text\")\n .text(text)\n .attr(\"x\", x) \n .attr(\"y\", y)\n .attr(\"font-family\", \"Verdana\")\n .attr(\"font-size\", size+\"px\")\n .attr(\"fill\", color)\n .attr(\"text-anchor\", align);\n}", "fillText(text, x, y) {\n CanvasManager.fillText(findNodeHandle(this), text, x, y)\n }", "function trackDrawText()\r\n{\r\n\r\n if(ActiveElem==null&&DrawTextStarted==true)\r\n {\r\n\r\n DrawX.style(\"display\", \"inline\")\r\n DrawX.attr(\"transform\", \"translate(\"+SVGx+\" \"+SVGy+\")\")\r\n\r\n }\r\n}", "function textBox(x, y, w, h, textInside, typeIn){\r\n\tthis.objectType = typeIn;\r\n\tthis.pos = createVector(x, y);\r\n\tthis.size = createVector(w, h);\r\n\tthis.textInside = textInside;\r\n\tthis.id = objects.length;\r\n\tthis.boxcontain = new BoxContain(this);\r\n\r\n\tthis.show = function(){\r\n\t\tstrokeWeight(1);\r\n\t\ttextSize(this.size.y);\r\n\t\tif(typeIn == 'title' || typeIn == 'text'){\r\n\t\t\tif(typeIn == 'title'){\r\n\t\t\t\tif(info.title != this.textInside)\r\n\t\t\t\t\tthis.textInside = info.title;\r\n\t\t\t\tfill(VisualizeGui.titleColor);\r\n\t\t\t} else fill(VisualizeGui.textColor);\r\n\t\t\tnoStroke();\r\n\t\t\ttext(this.textInside, this.pos.x, this.pos.y);\r\n\t\t\r\n\t\t} else if(typeIn == 'time'){\r\n\t\t\tnoStroke();\r\n\t\t\tfill(255);\r\n\t\t\ttext(time(), this.pos.x, this.pos.y);\r\n\t\t}\r\n\t\ttextSize(20); // set textSize to default\r\n\t}\r\n\r\n\t// when delete one object , ID will change\r\n\tthis.updateID = function(newID){\r\n\t\tthis.id = newID;\r\n\t}\r\n\r\n\tthis.setPosition = function(x, y){\r\n\t\tthis.pos = createVector(x, y);\r\n\t}\r\n\r\n\tthis.setSize = function(w, h){\r\n\t\tthis.size = createVector(w, h);\r\n\t}\r\n\r\n\tthis.run = function(){\r\n\t\tthis.show();\r\n\r\n\t\tif(designMode)\r\n\t\t\tthis.boxcontain.show();\r\n\t}\r\n}", "function createText(text) {\n return document.createTextNode(text);\n }", "function createText(text) {\n return document.createTextNode(text);\n }", "onAdd () {\r\n this.div = document.createElement('div');\r\n this.div.classList.add('marker');\r\n this.div.style.position = 'absolute';\r\n this.div.innerHTML = this.text;\r\n this.getPanes().overlayImage.appendChild(this.div);\r\n\r\n this.div.addEventListener('click', event => {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n this.div.innerHTML = this.html;\r\n this.div.classList.add('is-poped');\r\n this.active();\r\n });\r\n }", "function drawDetails(message, line, player)\n{\n\tvar x1, y1;\n\t\n\t//...specifying dimensions...\n\t\n\tvar width = 100;\n\tvar height = 40;//This is line height\n\t//... a new id is created for each element...\n\tvar textId = \"e_\" + textIdCounter;\n\ttextIdCounter++;\n\t//...deciding position based on the player's name...\n\tif (player == \"dealer\")\n\t{\n\t\tx1 = 30;\n\t\ty1 = 60 + line * height;\n\t}\n\telse if (player == \"player\")\n\t{\n\t\tx1 = 30;\n\t\ty1 = 399 + line * height;\n\t}\n\telse if (player == \"bot\")\n\t{\n\t\tx1 = 30;\n\t\ty1 = 230 + line * height;\n\t}\n\t//Having decided the postion, the next text element is being created...\n\t\n\tvar newTextElement = createSVGElement(\"text\");\n\t//Specifing coordinates...\n\t\tnewTextElement.setAttributeNS(null, \"x\", x1);\n\t\tnewTextElement.setAttributeNS(null, \"y\", y1);\n\t//Specifying style...\n\t\tnewTextElement.setAttributeNS(null, \"style\", \"fill:white; font-size:16px\");\n\t//Adding id\t...\n\t\tnewTextElement.setAttributeNS(null, \"id\", textId);\n\t//Creating the textNode...\n\tvar newTextNode = document.createTextNode(message);\n\t//Appending the textNode to the SVG Text element...\n\t\tnewTextElement.appendChild(newTextNode);\n\t//Appending te SVG text element to the main SVG element...\n\tmySVG.appendChild(newTextElement);\n\t//...returning the ID for later use.\n\treturn textId;\n}", "_onDragCreate(event) {\n // A single click could create \n let object = event.data.object;\n this._onDragCancel(event);\n // Text objects create their sheets for users to enter the text, otherwise create the drawing\n if (object.type == CONST.DRAWING_TYPES.TEXT) {\n // Render the preview sheet\n object.sheet.preview = this.preview;\n object.sheet.render(true);\n\n // Re-render the preview text\n this.preview.addChild(object);\n object.refresh();\n } else if (!object.isPolygon || object.data.points.length > 1) {\n // Only create the object if it's not a polygon/freehand or if it has at least 2 points\n this.constructor.placeableClass.create(object.data);\n }\n }", "function appendTextChild(text, node, element, idname) {\n\n // Check input.\n if ( text === undefined || text === null || node === undefined\n || node === null || element === undefined || element === null) {\n return null;\n }\n\n // Create styled text node.\n var txt = document.createTextNode(text);\n var el = _createel(element, idname);\n el.appendChild(txt);\n node.appendChild(el);\n\n return el;\n}", "function doneTyping () {\nvar content = document.getElementById(\"first\");\ncontent.textContent += \"and I am from\";\ncontent.innerHTML += \"&nbsp;\"\n\n\n\nconsole.log(\"im typinggggg\");\nvar newSpan = document.createElement('span');\ndocument.getElementById('first').appendChild(newSpan);\nnewSpan.contentEditable =\"true\";\nnewSpan.setAttribute(\"contenteditable\" , \"true\");\nnewSpan.setAttribute(\"id\", \"edit2\");\nnewSpan.onkeyup = myListener;\n}", "keyPress(ev) {\n if (!Notey.mouseEvent) return;\n ev.stopPropagation();\n if ((this._keyX != Notey.mouseEvent.offsetX) || (this._keyY != Notey.mouseEvent.offsetY)) {\n this._keyX = Notey.mouseEvent.offsetX;\n this._keyY = Notey.mouseEvent.offsetY;\n this._keyText = '';\n if (ev.keyCode > 31) this._keyText = ev.key;\n } else if ((ev.keyCode > 31) && (this._keyText != undefined)) {\n this._keyText += ev.key;\n } else if ((ev.keyCode == 8) && (this._keyText.length > 0)) {\n this._keyText = this._keyText.substring(0, this._keyText.length - 1);\n } else {\n return;\n }\n if (this._keyText == undefined) return;\n//console.log('%d (%d,%d) %s', ev.keyCode, this._keyX, this._keyY, this._keyText);\n var tid = 'text-' + this._keyX + '-' + this._keyY;\n var tel = this.svg.getElementById(tid);\n if (!tel) {\n tel = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n tel.id = tid;\n tel.setAttribute('class', 'notey-svg-text');\n tel.setAttribute('fill', (this.strokeColorId ? Notey.colorChoices[this.strokeColorId] : '#000'));\n tel.setAttribute('x', this._keyX);\n tel.setAttribute('y', this._keyY);\n this.svg.appendChild(tel);\n }\n Notey._needTextSave = this;\n tel.innerHTML = this._keyText;\n }", "prepareEditor(svg, conns, nodes, subnodes) {\n nodes\n .attr('class', 'mindmap-node mindmap-node--editable')\n .on('dblclick', (node) => {\n node.fx = null;\n node.fy = null;\n });\n\n nodes.call(d3Drag(this.state.simulation, svg, nodes));\n\n this.state.simulation\n .alphaTarget(0.5).on('tick', () => onTick(conns, nodes, subnodes));\n }", "function updateSample1(textpara,fontfamily,textsize,bold,italic,weight) {\n var f = getText(textpara,fontfamily,textsize,bold,italic,weight)\n if(f.textWidth >=45)\n {\n $(\"#textToolTooWide\").show();\n }\n else {\n $(\"#textToolTooWide\").hide();\n }\n newlayer.clearBeforeDraw(true);\n newlayer.clearCache();\n gridHiddenTextGroup.destroy();\n newlayer.draw();\n var q = gridSize;\n var g = applyDeselRatio(q);\n var d = Math.ceil(stage.width() / g);\n var p = Math.ceil(stage.height() / q);\n var o = Math.max(0, Math.floor((f.width - d) / 2));\n var m = Math.max(0, Math.floor((f.height - p) / 2));\n var j = Math.min(f.width, 1 + Math.ceil((f.width + d) / 2));\n var h = Math.min(f.height, 1 + Math.ceil((f.height + p) / 2));\n var b = Math.floor(stage.width() / 2 - g * f.width / 2);\n var a = Math.floor(stage.height() / 2 - q * f.height / 2);\n\n for (var l = m; l < h; l++) {\n var k = (false && (l & 1)) ? Math.round(g / 2) : 0;\n for (var n = o; n < j; n++) {\n var e = (l * f.width + n) * 4;\n var fillStyle = f.data[e + 3] == 255 ? \"#000000\" : \"#ffffff\";\n var complexText = new Konva.Text({\n x: b + n * g + k,\n y: a + l * q,\n text: 'X',\n fill: fillStyle,\n align: 'center',\n });\n gridHiddenTextGroup.add(complexText);\n }\n }\n newlayer.add(gridHiddenTextGroup);\n gridHiddenTextGroup.draw();\n stage.batchDraw();\n }", "function removeD_text(){\r\n d_text.destroy();\r\n}", "function btnAddTextClick() {\n myPresentation.getCurrentSlide().addText(inTxt.value);\n inTxt.value = \"\";\n}", "function buildBoxTextsHTML(node, index, clickedNode){\n\t\t\td3.selectAll('g')\n\t\t\t.append('text')\n\t\t\t.attr('class', 'box_text')\n\t\t\t.attr('text-anchor', () => { return 'middle';})\n\t\t\t.attr('alignment-baseline', () => { return 'central';})\n\t\t\t.html(()=>{\n\t\t\t\tconst TSPAN_HEAD = '<tspan';\n\t\t\t\tconst TSPAN_X = ' x=';\n\t\t\t\tconst TSPAN_Y =' y=';\n\t\t\t\tconst TSPAN_HEAD_CLOSE = '>';\n\t\t\t\tconst TSPAN_TAIL = '</tspan>';\n\t\t\t\tconst TSPAN_GAP = 25;\n\n\t\t\t\tvar html = '';\n\t\t\t\tvar titleName = node.data.name;\n\t\t\t\tvar title_parts = titleName.split(\",\");\n\t\t\t\tvar beginOfX = (index * BOX_WIDTH) + (BOX_WIDTH/2) - (Math.floor(index/MAX_BOX_PER_LINE)*1000);\n\t\t\t\tvar beginOfY = 0;\n\t\t\t\tvar yTextPadding = TEXT_PADDING;\n\t\t\t\tif(title_parts.length > 2){\n\t\t\t\t\tyTextPadding = TEXT_PADDING_FOR_LONG_TEXT;\n\t\t\t\t}\n\n\t\t\t\tif(node.depth <= clickedNode.depth){//ancestors and me lvl\n\t\t\t\t\t// beginOfY = TITLE_HIGHT + 0 + TEXT_PADDING;\n\t\t\t\t\tbeginOfY = TITLE_HIGHT + yTextPadding;\n\n\t\t\t\t}else{//children lvl\n\t\t\t\t\t// beginOfY = (2 * TITLE_HIGHT) + (1 * BOX_HIGHT) + TEXT_PADDING + (Math.floor(index/MAX_BOX_PER_LINE)*BOX_HIGHT);\n\t\t\t\t\tbeginOfY = (2 * TITLE_HIGHT) + (1 * BOX_HIGHT) + (Math.floor(index/MAX_BOX_PER_LINE)*BOX_HIGHT) + yTextPadding;\n\t\t\t\t}\n\t\t\t\tvar textSpanYRange = BOX_HIGHT / title_parts.length;\n\t\t\t\t// var y = beginOfY / title_parts.length\n\t\t\t\tfor(var i=0;i<title_parts.length;i++){\n\t\t\t\t\tvar y = beginOfY + (i*TSPAN_GAP);\n\t\t\t\t\thtml += TSPAN_HEAD + TSPAN_X + beginOfX + TSPAN_Y + y + TSPAN_HEAD_CLOSE+ title_parts[i] + (i == title_parts.length -1 ? '':',') + TSPAN_TAIL;\n\t\t\t\t}\n\t\t\t\treturn html;\n\t\t\t})\n\t\t}", "createNode() {\n super.createNode();\n // Node created is stored as this.node by super\n this.node.setAttribute(\"contenteditable\", true);\n this.hoverListenerOn();\n this.node.setAttribute(\"spellcheck\", false);\n }", "function createRTFs(){\n\t\tvar gc_enter=svg.selectAll(\"g\")\n\t\t.append(\"text\")\n\t\t.attr(\"class\",\"RTFText\")\n\t\t.attr(\"opacity\",0)\n\t\t.attr(\"x\",\"0em\")\n\t\t.attr(\"y\",\"0em\")\n\t\tgc_enter.call(addRTFText,20);\n\t}", "function updateDrawingTextOfAPeer(oldTextObj, newTextObj) {\n oldTextObj.setText(newTextObj.text);\n}", "function __create_text_element() { \n var input_text = document.createElement(\"input\");\n input_text.setAttribute(\"id\", cssid);\n input_text.setAttribute(\"value\", value);\n input_text.setAttribute(\"name\", key);\n input_text.setAttribute(\"type\", \"text\"); // NB: input1.type doesn't work in IE6\n input_text.setAttribute(\"tabIndex\", 1);\n div2.appendChild(input_text);\n }", "function editable() {\n text.blur();\n setTimeout(function() {\n text.setEditable(true);\n }, 500);\n\n win.removeEventListener('postlayout', editable);\n }", "function editable() {\n text.blur();\n setTimeout(function() {\n text.setEditable(true);\n }, 500);\n\n win.removeEventListener('postlayout', editable);\n }", "function createEditor() {\n\tif (editor)\n\t\tremoveEditor();\n\n\t// Create a new editor inside the <div id=\"editor\">, setting its value to html\n\t//var config = {language: 'en'};\n\t//editor = CKEDITOR.appendTo('txtDescription', config, html);\n\t\n\teditor = CKEDITOR.replace( 'txtDescription', {\n\t\t\t // //Load the English interface.\n\t\t\t language: 'en'\n\t\t\t});\n\t\n\t editor.addCommand(\"mySimpleCommand\", { // create named command\n\t\t exec: function(edt) {\n\t\t\t\n\t\t\t // Retrieve the editor contents. In an Ajax application, this data would be\n\t\t\t // sent to the server or used in any other way.\n\t\t\t //document.getElementById('editorcontents').innerHTML = html = editor.getData();\n\t\t\t //document.getElementById('contents').style.display = '';\n\t\t\t\n\t\t\t var cell = graph.getSelectionCell();\n\t\t\t\n\t\t\t graph.getModel().beginUpdate();\n\n\t\t\t try {\n\t\t\t\tvar edit = new mxCellAttributeChange(cell, \"spDescription\", editor.getData());\n\t\t\t\tgraph.getModel().execute(edit);\n\t\t\t\t\n\t\t\t\t //graph.updateCellSize(cell);\n\t\t\t }\n\t\t\t finally {\n\t\t\t\tgraph.getModel().endUpdate();\n\t\t\t\tmxLog.debug('Description saved.');\n\t\t\t }\n\t\t\t\n\t\t\t\n\t\t\t //alert(edt.getData());\n\t\t }\n\t });\n\t\n\t editor.ui.addButton('SuperButton', { // add new button and bind our command\n\t\t label: \"Save HTML\",\n\t\t command: 'mySimpleCommand',\n\t\t toolbar: 'insert',\n\t\t icon: 'https://gavinet.sharepoint.com/sites/km/SiteAssets/fh_mxgraph/mxgraph/images/Saveimg.png'\n\t });\n\n\n}", "function textL(vm, text) {\n let tl = document.createElementNS(SVG_NS, 'text');\n tl.setAttribute('x', vm.x);\n tl.setAttribute('y', vm.y);\n tl.setAttribute('class', `tl f${vm.stroke}`);\n tl.textContent = text;\n vm.svg.appendChild(tl);\n vm.traceInfo('textL:', tl);\n}", "function addTextBlock(element) {\n element\n .append('text')\n .classed('text', true)\n .attr('text-anchor', 'middle');\n }", "function setText(name, textX, textY, value, color, fontSize) {\n var text = new createjs.Text(value, \"bold \" + fontSize + \"em Tahoma, Geneva, sans-serif\", color);\n text.x = textX;\n text.y = textY;\n text.textBaseline = \"alphabetic\";\n text.name = name;\n text.text = value;\n text.color = color;\n\t/** Adding text to the stage */\n compound_pendulam_stage.addChild(text); \n}", "function addTextBox_custom() {\n var textLiarCustom = new fabric.Textbox(\"TEXTBOX TAMBAHAN\", teksOptions);\n fabric.Image.fromURL(\"imgs/note.png\", function (img) {\n img.scale(0.15).set({\n top: 250,\n left: 250,\n });\n canvas_custom.add(img);\n canvas_custom.sendToBack(img);\n canvas_custom.requestRenderAll();\n });\n canvas_custom.add(textLiarCustom);\n}", "function setCaption(isNew){\r\n\tcaptionObjects.forEach(function(cap){\r\n\t\tcap.remove();\r\n\t});\r\n\tcaptionObjects = [];\r\n\r\n\tif(isNew){\r\n\t\tvar caption = document.getElementById(\"caption\").value.split('\\n');\r\n\t\tif(caption.length==1 && caption[0]==\"\"){\r\n\t\t\tcaptionText = [];\r\n\t\t}else{\r\n\t\t\tcaptionText = caption;\r\n\t\t}\r\n\t}\r\n\tconsole.log(captionText);\r\n\tif(captionText.length>0){\r\n\t\tvar leftbound = getClosestPoint([paper.view.viewSize.width, paper.view.viewSize.height/2]);\r\n\r\n\r\n\t\topentype.load(\"BO-2am.ttf\", function(err, font) {\r\n\r\n\t\t\tcaptionText.forEach(function(text, i, arr){\r\n\t\t\t\tvar shape = null;\r\n\t\t\t\tvar fontpaths = font.getPaths(text,200,groundheight+i*100,100);\r\n\r\n\t\t\t\tfor(var i = 0; i<fontpaths.length; i++){\r\n\t\t\t\t\tvar paperpath = paper.project.importSVG(fontpaths[i].toSVG());\r\n\t\t\t\t\tif(hope){\r\n\t\t\t\t\t\tpaperpath.fillColor = leafColor;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tpaperpath.fillColor = textColor;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(shape){\r\n\t\t\t\t\t\tvar newshape = shape.unite(paperpath);\r\n\t\t\t\t\t\tpaperpath.remove();\r\n\t\t\t\t\t\tshape.remove();\r\n\t\t\t\t\t\tshape = newshape;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tshape = paperpath;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tshape.bounds.topRight.x = leftbound.point.x;\r\n\t\t\t\tshape.rotate(state.rnd(0,10)-5);\r\n\t\t\t\tshape.onMouseDrag = function(event) {\r\n\t\t\t\t\tif(moveCaption){\r\n\t\t\t\t\tevent.target.bounds.topRight.x = event.target.bounds.topRight.x + event.delta.x;\r\n\t\t\t\t\tevent.target.bounds.topRight.y = event.target.bounds.topRight.y + event.delta.y;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcaptionObjects.push(shape);\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n}", "create () {\n this.timeMark = -1\n this.textCard = this.add.text(gs.centerX, gs.centerY, sc.text, sc.styles)\n this.textCard.x -= this.textCard.width * 0.5\n this.textCard.y -= this.textCard.height * 0.5\n }", "function insertSuperSubscriptExistingNode(text, renderedX, renderedY, parentNodeEle){\r\n\ttextData = convertLatexStyleSupSub(text);\r\n\t\r\n\tparentID = parentNodeEle.id();\r\n\t\r\n\tparentNodeEle.children().remove();\r\n\tparentNodeEle.removeClass(\"base\");\r\n\tparentNodeEle.addClass(\"superSubscriptContainer\");\r\n\tparentNodeEle.selectify();\r\n\t\r\n\t var posX = parentNodeEle.position(\"x\");\r\n\t var posY = parentNodeEle.position(\"y\");\r\n\t\r\n\tvar curTotalwidth = 0;\r\n\t$(textData).each(function(ind, elm){\r\n\t\tvar textNode = { data: { id: getNewID(), parent: parentID , name: elm.text, order: ind}, classes: ['superSubscriptText', 'noSnap', 'templateNoRecalculation']};\r\n\t\tvar textNodeEle = cy.add(textNode);\r\n\t\ttextNodeEle.position({x: posX + curTotalwidth + textNodeEle.width()/2, y: posY});\r\n\t\t\t\t\r\n\t\tcurTotalwidth += textNodeEle.width();\r\n\t\t\r\n\t\tvar subWidth = 0;\r\n\t\tvar supWidth = 0;\r\n\t\tif(elm.sub != \"\"){\r\n\t\t\tvar subNode = { data: { id: getNewID(), parent: parentID , name: elm.sub, order: ind}, classes: [\"subscript\", 'noSnap', 'templateNoRecalculation']};\r\n\t\t\tvar subNodeEle = cy.add(subNode);\r\n\t\t\tsubWidth = subNodeEle.width();\r\n\t\t\tsubNodeEle.position({x: posX + curTotalwidth + subWidth/2, y: posY + 4});\r\n\t\t}\r\n\t\tif(elm.sup != \"\"){\r\n\t\t\tvar superNode ={ data: { id: getNewID(), parent: parentID , name: elm.sup, order: ind}, classes: [\"superscript\", 'noSnap', 'templateNoRecalculation']};\r\n\t\t\tvar superNodeEle = cy.add(superNode);\r\n\t\t\tsupWidth = superNodeEle.width();\r\n\t\t\tsuperNodeEle.position({x: posX + curTotalwidth + supWidth/2, y: posY - 4});\r\n\t\t}\r\n\t\t\r\n\t\tcurTotalwidth += Math.max(subWidth, supWidth);\r\n\t});\r\n\t\r\n\tparentNodeEle.renderedPosition();\r\n\tparentNodeEle.renderedPosition({x: renderedX, y: renderedY});\r\n\t\r\n\treturn parentNodeEle;\r\n}", "draw(editable, group){\n this._editable = editable;\n this._g = group;\n this._height = 0;\n let cornerRadius = this._roundedCornerRadius;\n\n\n // draw rect\n this._rect = this._s.rect(\n 0, 0,\n this._width, this._height,\n cornerRadius\n );\n group.add(this._rect);\n \n // draw nr\n if(editable) {\n this._nrTxt = this._s.text(20, 20, this._nr);\n group.add(this._nrTxt);\n }\n \n if(this._type == blocktype.definition)\n this._height = this.drawDefElements(group, editable);\n\n // draw text\n let cleantext = (!editable) ? this.textWithoutBrInMath() : this._text;\n this._txt = this.createForeignText(cleantext, editable);\n this._height += parseInt(this._txt.getAttribute(\"height\"))+45;\n group.node.appendChild(this._txt); // foreignObject\n \n // draw checkbox for conclusion\n if(editable && this._type != blocktype.premise && this._type != blocktype.definition) {\n this._check = this.createConclCheckbox();\n group.node.appendChild(this._check); // foreignObject\n }\n\n \n // adjust rect height\n this._rect.attr({\n fill: \"#4e5d6c\",\n stroke: \"#000\",\n height : this._height,\n });\n if(this._type == blocktype.proof)\n this._rect.addClass(\"rect-proof\"); // manage style e.g. stroke-width, hover\n\n\n // draw buttons\n if(editable && this._type != blocktype.definition) {\n if(this._type != blocktype.premise) { // premise has no top or topright button\n this._btns.topright = this.createAddButton(buttonpos.topright);\n this._btns.top = this.createAddButton(buttonpos.top);\n group.add(this._btns.topright, this._btns.top);\n }\n this._btns.bottomright = this.createAddButton(buttonpos.bottomright);\n this._btns.bottom = this.createAddButton(buttonpos.bottom);\n group.add(this._btns.bottomright, this._btns.bottom);\n }\n\n // trigger positioning of blocks objects\n this.x = 0;\n this.y = 0; \n }", "function itemText(texto, posx, posy){\n var style= {fill:\"rgb(255,255,255)\", font: \"14px Press Start 2P\", align:\"center\"};\n var miTexto = game.add.text(posx, posy, texto, style);\n iGroup.add(miTexto);\n miTexto.anchor.x = 0.5;\n\n this.update = function(){ //El texto desaparece poco a poco y va subiendo\n miTexto.alpha -= 0.006;\n miTexto.y -= 0.15;\n if(miTexto.alpha <= 0.01){\n \t iGroup.remove(miTexto);\n miTexto.destroy();\n delete this;\n }\n }\n this.fixedToCamera = function(){\n miTexto.fixedToCamera = true;\n }\n}" ]
[ "0.6952405", "0.66341835", "0.66031826", "0.6577088", "0.6465521", "0.64469", "0.64155585", "0.6400974", "0.6380137", "0.6374758", "0.63710266", "0.6344246", "0.6307608", "0.6289739", "0.6289739", "0.6266213", "0.62391365", "0.6223653", "0.6220332", "0.61983484", "0.617812", "0.61609554", "0.61587274", "0.61024594", "0.6099061", "0.60702497", "0.60500926", "0.6048357", "0.60254663", "0.5999792", "0.5979057", "0.59767586", "0.597502", "0.5952978", "0.59440416", "0.5939349", "0.59352255", "0.59136945", "0.5883779", "0.58801305", "0.5879226", "0.5870333", "0.5852343", "0.5849419", "0.5833395", "0.5808294", "0.5799554", "0.5794538", "0.57916045", "0.57868433", "0.5786165", "0.57783884", "0.5777866", "0.57676196", "0.5767213", "0.57670987", "0.5758852", "0.57582605", "0.5756552", "0.5752064", "0.5738106", "0.5735119", "0.5725311", "0.5723231", "0.5714246", "0.5714246", "0.5712012", "0.5705152", "0.5697751", "0.56936264", "0.56860995", "0.5673166", "0.5673166", "0.56676805", "0.5655967", "0.5654009", "0.5647629", "0.5632651", "0.56290036", "0.5626854", "0.5625528", "0.56217855", "0.5613383", "0.5611792", "0.5608422", "0.56060755", "0.5603888", "0.55963045", "0.55783415", "0.55783415", "0.55512613", "0.5545591", "0.5544811", "0.5542474", "0.5541088", "0.55368084", "0.5515063", "0.5514432", "0.55137503", "0.55085194" ]
0.81736207
0
fn(hdif) Parameters: block (obj) block who is rescaled hdif (number) height change in pixel
onRescale(fn) { this.onRescaleFn = fn }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SizeDependHeight() {\n hImageCur = va.hRuby;\n wImageCur = M.R(hImageCur * rateImage);\n }", "function height(param) {\n if (param) {\n return param.h;\n } else {\n return 0;\n }\n }", "function adjustVizHeight(){\n viz.style(\"height\", function(){\n w = parseInt(viz.style(\"width\"), 10);\n h = w*heightRatio;\n return h;\n })\n}", "function getScaledHeight(y){\n var y1 = 0, deltaHeight = 0;\n var heightScaleUp = false; \n // calculate the scaling factor for height\n if(height > oHeight){\n heightScaleUp = true;\n deltaHeight = height / oHeight;\n } else if(height < oHeight){\n heightScaleUp = false;\n deltaHeight = oHeight / height;\n }\n if(heightScaleUp){\n y1 = Math.round(y / deltaHeight);\n } else {\n y1 = Math.round(y * deltaHeight);\n }\n console.log('y : '+y+' , y1 : '+y1);\n return y1;\n}", "function changeHeight() {\t\n\t//console.log(this);\n\t//console.log(this.previousSibling);\n\tvar ratio = this.parentNode.offsetHeight / this.previousSibling.offsetHeight ;\t//20 means original height\n\t//var axis_y = -(this.parentNode.offsetHeight - this.previousSibling.offsetHeight) / 8;\n\tvar axis_y = this.parentNode.offsetTop + this.parentNode.offsetHeight/2 - this.previousSibling.offsetTop - this.previousSibling.offsetHeight/2;\n\tthis.previousSibling.setAttribute(\"style\", \"transform:scale(1,\"+ratio+\");\");//matrix(1, 0, 0, \"+ ratio + \", 0,\"+ 0.9*axis_y +\");\");\n\tconsole.log(this.previousSibling.offsetTop);\n\tconsole.log(this.offsetTop);\n}", "function changeHeight() {\t\r\n\t//console.log(this);\r\n\t//console.log(this.previousSibling);\r\n\tvar ratio = this.parentNode.offsetHeight / this.previousSibling.offsetHeight ;\t//20 means original height\r\n\t//var axis_y = -(this.parentNode.offsetHeight - this.previousSibling.offsetHeight) / 8;\r\n\tvar axis_y = this.parentNode.offsetTop + this.parentNode.offsetHeight/2 - this.previousSibling.offsetTop - this.previousSibling.offsetHeight/2;\r\n\tthis.previousSibling.setAttribute(\"style\", \"transform:scale(1,\"+ratio+\");\");//matrix(1, 0, 0, \"+ ratio + \", 0,\"+ 0.9*axis_y +\");\");\r\n\tconsole.log(this.previousSibling.offsetTop);\r\n\tconsole.log(this.offsetTop);\r\n}", "function heightsizeeneuf($obj){\n \tvar height = $obj.parent().width() / 1.77;\n\n \t$obj.height(height);\n }", "function H(){var t=f.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][n.ort];return 0===n.ort?t.width||f[e]:t.height||f[e]}", "calcHeight(diff, maxVal, maxHeight){\n\t\treturn Math.abs(maxHeight*0.75*diff/maxVal);\n\t}", "function calcH(divVal){\n var heyt = $(this).height()-365;\n $(divVal).height(heyt+\"px\");\n}", "function resizesection2 (nb)\r\n{\r\n\tvar nb = nb;\r\n\tvar height = nb * 150 + 50 ; // 150 / guitare + 25 pout l'en-tête et 25 pour le bas\r\n\t// maj de la hauteur du block\r\n\tdocument.getElementById('Index_Section2').style.height = height+\"px\";\r\n}", "set height(value) {}", "function h(t){return t.width/t.resolution}", "get estimatedHeight() { return -1; }", "function hitungBmi(weight, height) {\n return weight / (height * height);\n}", "function exponentHeight(){\n return(totalHeight()**2);\n}", "getHeight(){return this.__height}", "function fAnimateHeight (elem, eHeight) {\n //tMx.to (elem, animTym, {css: {height: eHeight}, ease: easePower});\n tMx.to (elem, animTym, {height: (eHeight + \"px\"), ease: easePower});\n }", "function getHeight(height) {\n return Math.round(obj.height * scale);\n }", "function TNodes_doDOM_FitHeightEnh(nd,dh,caller){\n\t\t\tdh=dh || 0;\n\t\t\tcaller=caller || 'default'; // the function, calling this routine\n\t\t\tvar myalign = 'none';\n\t\t\tvar myspin = nd.Spin;\n\n // first the zeroNode\n this.Item[0].changeHeight(dh);\n this.Item[0].doDOM_Refresh();\n this.Height+=dh;\n\n\t\t\t// node HasParent ??? ==> normal node or zeronode\n if (nd.ZeroNodeType=='none') {\n\t\t\t\tvar cursplit = nd.Parent;\n\n // 1. ::::> \n //set the current split from the node that triggered the change of height \n\t\t\t\t\n\t\t\t\tcursplit.doFitHeight(dh, nd.Align);\t\t\t\t\n\n // 2. ::::> \n\t\t\t\t// the line of the parentnode has been dragged, position * is changed\n\t\t\t\t// fit the UpNode-Child of the bifork-split\n\t\t\t\t/*\t\t\t\t|-- +\n\t\t\t\t * \t|--\t* --\n\t\t\t\t * 0 --\t\t|-- +\n\t\t\t\t *\t\t|--\n\t\t\t\t * \n\t\t\t\t */\n\t\t\t\t\n\t\t\t\tif (cursplit.Orientation == 'h') {\n\t\t\t\t\tif (nd.Spin == 1) {\n\t\t\t\t\t\tif (cursplit.UpNode.HasChild) {\n\t\t\t\t\t\t\tcursplit.UpNode.Child.doRecursiveDrillDownFitHeight(dh, cursplit.UpNode.Align);// call through down node\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}\n\t\t\t\t}\n\n // 3. ::::> \n\t\t\t\t// call recursiv down for drilldown all splits below\n\t\t\t\t// call it just for the opposite node \n\t\t\t\tif (cursplit.Orientation == 'v') {\n\t\t\t\t\tif (nd.Spin == 1) {\n\t\t\t\t\t\tif (cursplit.DownNode.HasChild) {\n\t\t\t\t\t\t\tcursplit.DownNode.Child.doRecursiveDrillDownFitHeight(dh, cursplit.DownNode.Align);// call through down node\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\tif (cursplit.UpNode.HasChild) {\n\t\t\t\t\t\t\tcursplit.UpNode.Child.doRecursiveDrillDownFitHeight(dh, cursplit.UpNode.Align);// call through up node \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// 4. ::::>\n\t\t\t\t// query for list of all split-above the current split\n\t\t\t\t// in down to up order, parent is from type node\n\t\t\t\tif (cursplit.HasParent) {\n\t\t\t\t\tvar splitlist = this.doStepper('upsplits', cursplit.Parent);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\n\t\t\t\t// node is zero-node !!!\n\t\t\t\t}\n\t\t\t\t\n \t\t\tmyalign = cursplit.Parent.Align; // tell last align \n\t\t\t\tmyspin = cursplit.Parent.Spin; // tell last spin (means up- or down-node)\n\t\t\t\tfor (var e in splitlist) {\n\t\t\t\t\tcursplit = splitlist[e];\n\t\t\t\t\tcursplit.doFitHeight(dh, myalign);\n\t\t\t\t\tif (cursplit.Orientation == 'v') {\n\t\t\t\t\t\tif (myspin == 1) {\n\t\t\t\t\t\t\tif (cursplit.DownNode.HasChild) {\n\t\t\t\t\t\t\t\tcursplit.DownNode.Child.doRecursiveDrillDownFitHeight(dh, cursplit.DownNode.Align);// call through down node\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif (cursplit.UpNode.HasChild) {\n\t\t\t\t\t\t\t\tcursplit.UpNode.Child.doRecursiveDrillDownFitHeight(dh, cursplit.UpNode.Align);// call through up node \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tmyalign = cursplit.Parent.Align;\n\t\t\t\t\tmyspin = cursplit.Parent.Spin;\n\t\t\t\t}\n\t\t\t}// has parent\n\t\t\telse{\n\t\t\t\t// else is zero-node\n // 2. ::::> \n\n // fit the Node-Child of the zero-node --> this.Item[0]\n if (nd.ZeroNodeType=='root'){ \n if (nd.HasChild){\n nd.Child.doRecursiveDrillDownFitHeight(dh, 'bottom')\n } \n if (nd.ContainerList.Count==1){\n if (nd.ContainerList.Item[1].IsFitToParent){\n // calculate the new height ( = dh for the moment)\n var ctdh=this.Item[0].Height-nd.ContainerList.Item[1].Height;\n nd.ContainerList.Item[1].doFitToParent(nd.Height);\n }\n }\n }\t\t\t\t\n if (nd.ZeroNodeType=='container'){\n //if (this.Item[0].Owner.Owner.IsFitToParent){\n if (nd.HasChild){\n nd.Child.doRecursiveDrillDownFitHeight(dh, 'bottom');\n } \n //}\n } \n /* STICKER_mp \n if (nd.ZeroNodeType=='sticker'){\n doPrint('nodes-heightEnh sticker ->' + nd.Ident)\n nd.ContainerList.Item[1].doFitToParent(nd.Height);\n }\n */\n\t\t\t} \n\t\t\t\t\t\t\t\t\t \t\t\t\n\t\t\tvar i=0;\t\n\n\t\t} // end of Fit Height", "function maxHealthUpdate() {\n hbIncrement = hbWidth/maxHealth; \n}", "function calcVh(vh) {\n let cacheVh = cache.vh[vh];\n if(cacheVh || cacheVh === 0) {\n return cacheVh;\n } else {\n return cache.vh[vh] = vh / 100 * height;\n }\n}", "setHeight(valueNew){let t=e.ValueConverter.toNumber(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"Height\")),t!==this.__height&&(this.__height=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"Height\"}),this.__processHeight())}", "function sortByHeight() {}", "function calcDiveHeight(){ \n if (windowposition <= 20000) {\n diveHeight = windowposition / 10;\n convRate = 10;\n } else if (windowposition < 40000) {\n diveHeight = (2000) + (windowposition - 20000)/ 5;\n convRate = 5;\n } else {\n diveHeight = (6000) + (windowposition - 40000)/ 2;\n convRate = 2;\n }\n \n }", "updateInnerHeightDependingOnChilds(){}", "function getRatio(imageHeight, verticalBlockResolution) {\r\n\r\n return Math.floor(imageHeight / verticalBlockResolution);\r\n\r\n}", "function maxHealthUpdate() {\r\n hbIncrement = hbWidth/maxHealth; \r\n}", "setBackgroundImageHeightUnit(valueNew){let t=e.ValueConverter.toDimensionUnit(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"BackgroundImageHeightUnit\")),t!==this.__background.imageHeightUnit&&(this.__background.imageHeightUnit=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"BackgroundImageHeightUnit\"}),this.__processBackgroundImageHeightUnit())}", "function paint(element) {\n element.offsetHeight\n }", "updateInnerHeightDependingOnChilds(){this.__cacheWidthPerColumn=null,this.__asyncWorkData[\"System.TcHmiGrid.triggerRebuildAll\"]=!0,this.__asyncWorkData[\"System.TcHmiGrid.triggerRecheckHeight\"]=!0,this.__requestAsyncWork()}", "function setHeightHT(element) {\n let height;\n if (element.length) {\n if (element.height() > 601) {\n height = 622\n } else {\n height = element.height() + 30\n }\n } else {\n height = 320\n }\n return height;\n }", "function computeH(min, max, value, maxpixels) {\n // console.log(\"comptuteH. min/max=\"+min+\"/\"+max+\",\n // maxpixels=\"+maxpixels);\n return maxpixels - Math.round((value - min) / max * maxpixels);\n }", "function calculate16by9($item) {\n $item.each(function(){\n $(this).css('height', $(this).parent().width() * 9 / 16);\n });\n }", "function heightChange(event,slider){\n $slider.css('height',slider.value + 'px');\n $('#higVal').text(slider.value + 'px');\n }", "changeModuleHeight(height){\n if(height>0){\n var axesHeight=height/2;\n this.module_top_face_dimensions_axes[4]=(this.module_top_face_dimensions_axes[4]-this.module_left_face_dimensions_axes[1]/2)+axesHeight;\n this.module_base_face_dimensions_axes[4]=(this.module_base_face_dimensions_axes[4]+this.module_left_face_dimensions_axes[1]/2)-axesHeight;\n this.module_left_face_dimensions_axes[1]=height;\n this.module_right_face_dimensions_axes[1]=height;\n \n }\n }", "function detectedHeight(targetWidth, origWidth, origHeight) {\n return origHeight * targetWidth / origWidth;\n}", "function change_height() {\n\tvar w = document.getElementById(\"input_width\").value;\n\tvar h = document.getElementById(\"input_height\").value;\n\tvar dh = document.getElementById(\"input_dest_height\").value;\n\tvar dw = document.getElementById(\"input_dest_width\");\n\n\tdw.value = (w*dh/h)\n}", "_reflow() {\n if(!this.options.equalizeOnStack){\n if(this._isStacked()){\n this.$watched.css('height', 'auto');\n return false;\n }\n }\n if (this.options.equalizeByRow) {\n this.getHeightsByRow(this.applyHeightByRow.bind(this));\n }else{\n this.getHeights(this.applyHeight.bind(this));\n }\n }", "setBackgroundImageHeight(valueNew){let t=e.ValueConverter.toNumber(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"BackgroundImageHeight\")),t!==this.__background.imageHeight&&(this.__background.imageHeight=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"BackgroundImageHeight\"}),this.__processBackgroundImageHeight())}", "async getBlockHeight() {\n // Add your code here\n let blockCount = await this.bd.getBlocksCount();\n return blockCount -1;\n }", "function setHeight(obj) {\n $(mainBlock).height(function () {\n return (obj.descriptionHeight + obj.menuListBlock) + 100;\n });\n }", "function calcSameHeight(){\t\n\tvar $block1Height = $block1.height();\t\t\n\tif ( $jCarouselImgCont.find('img').length > 8 ) {\n\t\t$aboutCompanySH.height( $block1Height );\t\n\t\t$jCarousel1.add( $jCarousel2 ).height( $block1Height * 0.4);\n\t\t$jCarouselImgCont.height( $block1Height * 0.8 / 2 ).find('img').height( $block1Height * 0.8 / 2 );\n\t}\n\telse {\n\t\t$aboutCompanySH.height( $block1Height );\t\n\t\t$jCarousel1.add( $jCarousel2 ).height( $block1Height * 0.8);\n\t\t$jCarouselImgCont.height( $block1Height * 0.74 ).find('img').height( $block1Height * 0.8 - 36);\n\t}\n}", "setHeightUnit(valueNew){let t=e.ValueConverter.toDimensionUnit(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"HeightUnit\")),t!==this.__heightUnit&&(this.__heightUnit=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"HeightUnit\"}),this.__processHeightUnit())}", "getHeightMode(){return this.__heightMode}", "function distanceFromHqInBlocks(block) {\n return Math.abs(block - 42)\n}", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;\n } // Returns a function that estimates the height of a line, to use as", "function distanceFromHqInBlocks(currentBlock){\n if(currentBlock>hq){\n return currentBlock-hq \n } else{\n return hq- currentBlock \n }\n return currentBlock - hq \n}", "function changeHeight(h) {\n\t//if( $(\"#htmlContainer\").css( \"display\" ) != \"none\" ){\n\t\t//alert( \"from AS3 setting flash height to html height: \" + ($(\"#htmlContainer\").height() + 80) );\n\t\t//$(\"#flashContent\").height( $(\"#htmlContainer\").height() + 80 );\n\t//}else{\n\t\t//alert( \"from AS3 setting flash height to: \" + h );\n \t//swffit.configure( {target:\"flashContent\", minHei:h } );\n\t //}\n}", "function changeHeight(h) {\n\t//if( $(\"#htmlContainer\").css( \"display\" ) != \"none\" ){\n\t\t//alert( \"from AS3 setting flash height to html height: \" + ($(\"#htmlContainer\").height() + 80) );\n\t\t//$(\"#flashContent\").height( $(\"#htmlContainer\").height() + 80 );\n\t//}else{\n\t\t//alert( \"from AS3 setting flash height to: \" + h );\n \t//swffit.configure( {target:\"flashContent\", minHei:h } );\n\t //}\n}", "function oldOuterHeight(element){\r\n //return 100;\r\n return element.height();\r\n}", "function getHeight(oneBlock) {\n\t\t\treturn Math.max($(oneBlock).height(), $(oneBlock).outerHeight());\n\t\t}", "handleOnResize () {\n const contentHeight = this.contentNode.offsetHeight\n const minimumHeight = this.minimumLinesNode\n ? this.minimumLinesNode.offsetHeight\n : 0\n const newHeight = Math.max(contentHeight, minimumHeight)\n\n const { currentHeight, onResize } = this.props\n\n if (newHeight !== currentHeight) {\n onResize(newHeight)\n }\n }", "function fAnimateHeight (elem, eHeight) {\n tMx.to (elem, animTym, {css: {height: eHeight}, ease: easePower});\n }", "function Ba(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var a=e.widgets[t],n=a.node.parentNode;n&&(a.height=n.offsetHeight)}}", "function scaleheight() {\n if (!dw.isTurnable()) return;\n var proj = dw.initProj();\n var projh = document.getElementById('projh').value * 1000,\n cx = proj.long0 * 180 / Math.PI,\n cy = proj.lat0 * 180 / Math.PI;\n // set height\n var proj = dw.initProj(' +h=' + projh + ' +lon_0=' + cx + ' +lat_0=' + cy);\n // skyratio\n var rhscale = Math.sqrt((proj.p15 - 1.0) / (proj.p15 + 1.0));\n dw.scaleCarta(1);\n dw.scaleCarta(1 / rhscale * 4 / proj.p15);\n}", "function imgratio() {\n var w = $('#kvimg').outerWidth();\n var h = w * 1068 / 1600;\n $('#kvimg').css('height', h + 'px');\n}", "function fdibHum(h){\r\n\tthis.drawHum = h;\r\n}", "function detectVerticalSquash( img, iw, ih ) {\n var canvas = document.createElement('canvas'),\n ctx = canvas.getContext('2d'),\n sy = 0,\n ey = ih,\n py = ih,\n data, alpha, ratio;\n \n \n canvas.width = 1;\n canvas.height = ih;\n ctx.drawImage( img, 0, 0 );\n data = ctx.getImageData( 0, 0, 1, ih ).data;\n \n // search image edge pixel position in case\n // it is squashed vertically.\n while ( py > sy ) {\n alpha = data[ (py - 1) * 4 + 3 ];\n \n if ( alpha === 0 ) {\n ey = py;\n } else {\n sy = py;\n }\n \n py = (ey + sy) >> 1;\n }\n \n ratio = (py / ih);\n return (ratio === 0) ? 1 : ratio;\n }", "function detectVerticalSquash( img, iw, ih ) {\n var canvas = document.createElement('canvas'),\n ctx = canvas.getContext('2d'),\n sy = 0,\n ey = ih,\n py = ih,\n data, alpha, ratio;\n \n \n canvas.width = 1;\n canvas.height = ih;\n ctx.drawImage( img, 0, 0 );\n data = ctx.getImageData( 0, 0, 1, ih ).data;\n \n // search image edge pixel position in case\n // it is squashed vertically.\n while ( py > sy ) {\n alpha = data[ (py - 1) * 4 + 3 ];\n \n if ( alpha === 0 ) {\n ey = py;\n } else {\n sy = py;\n }\n \n py = (ey + sy) >> 1;\n }\n \n ratio = (py / ih);\n return (ratio === 0) ? 1 : ratio;\n }", "function detectVerticalSquash( img, iw, ih ) {\n var canvas = document.createElement('canvas'),\n ctx = canvas.getContext('2d'),\n sy = 0,\n ey = ih,\n py = ih,\n data, alpha, ratio;\n \n \n canvas.width = 1;\n canvas.height = ih;\n ctx.drawImage( img, 0, 0 );\n data = ctx.getImageData( 0, 0, 1, ih ).data;\n \n // search image edge pixel position in case\n // it is squashed vertically.\n while ( py > sy ) {\n alpha = data[ (py - 1) * 4 + 3 ];\n \n if ( alpha === 0 ) {\n ey = py;\n } else {\n sy = py;\n }\n \n py = (ey + sy) >> 1;\n }\n \n ratio = (py / ih);\n return (ratio === 0) ? 1 : ratio;\n }", "function handleSize() {\n const height = document.getElementById('image').clientHeight\n console.log(height)\n setHeight(-height)\n }", "function heightAtLine(lineObj) {\n\t\t lineObj = visualLine(lineObj);\n\t\t\n\t\t var h = 0, chunk = lineObj.parent;\n\t\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i];\n\t\t if (line == lineObj) break;\n\t\t else h += line.height;\n\t\t }\n\t\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t\t for (var i = 0; i < p.children.length; ++i) {\n\t\t var cur = p.children[i];\n\t\t if (cur == chunk) break;\n\t\t else h += cur.height;\n\t\t }\n\t\t }\n\t\t return h;\n\t\t }", "heightToCM(){\n return this.height * 2.54; \n }", "function detectVerticalSquash(img, iw, ih) {\n var canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = ih;\n var ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0);\n var data = ctx.getImageData(0, 0, 1, ih).data; // search image edge pixel position in case it is squashed vertically.\n\n var sy = 0;\n var ey = ih;\n var py = ih;\n\n while (py > sy) {\n var alpha = data[(py - 1) * 4 + 3];\n\n if (alpha === 0) {\n ey = py;\n } else {\n sy = py;\n }\n\n py = ey + sy >> 1;\n }\n\n var ratio = py / ih;\n return ratio === 0 ? 1 : ratio;\n }", "function scale(elen, e, b, h) {\n let Q, sum, hh, product1, product0;\n let bvirt, c, ahi, alo, bhi, blo;\n\n c = splitter * b;\n bhi = c - (c - b);\n blo = b - bhi;\n let enow = e[0];\n Q = enow * b;\n c = splitter * enow;\n ahi = c - (c - enow);\n alo = enow - ahi;\n hh = alo * blo - (Q - ahi * bhi - alo * bhi - ahi * blo);\n let hindex = 0;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n for (let i = 1; i < elen; i++) {\n enow = e[i];\n product1 = enow * b;\n c = splitter * enow;\n ahi = c - (c - enow);\n alo = enow - ahi;\n product0 = alo * blo - (product1 - ahi * bhi - alo * bhi - ahi * blo);\n sum = Q + product0;\n bvirt = sum - Q;\n hh = Q - (sum - bvirt) + (product0 - bvirt);\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n Q = product1 + sum;\n hh = sum - (Q - product1);\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n }", "function weird() {\n height = 50;\n}", "async getBlockHeight () {\n return await this.getBlockHeightLevel()\n }", "getHeight() {\n return this.$node.innerHeight();\n }", "calculateHeightH(node) {\n if (node.key === \"null\") return 0\n else {\n var left = this.calculateHeightH(node.left);\n var right = this.calculateHeightH(node.right);\n this.treedpth = Math.max(left, right) + 1;\n } \n }", "changeClosetHeight(height) {\n if (height > 0) {\n var axesHeight = height / 2;\n var heighpos = this.faces.get(FaceOrientation.TOP).Y()[4]; //TODO: Remove heighpos ?\n this.faces.get(FaceOrientation.TOP).changeYAxis((this.faces.get(FaceOrientation.TOP).Y()-this.faces.get(FaceOrientation.LEFT).height()/2)+axesHeight);\n this.faces.get(FaceOrientation.TOP).changeYAxis((this.faces.get(FaceOrientation.BASE).Y()+this.faces.get(FaceOrientation.LEFT).height()/2)-axesHeight);\n this.faces.get(FaceOrientation.LEFT).changeHeight(height);\n this.faces.get(FaceOrientation.RIGHT).changeHeight(height);\n this.faces.get(FaceOrientation.BACK).changeHeight(height);\n for(let closetSlot of this.getSlotFaces()){\n closetSlot.changeHeight(height);\n }\n }\n }", "setHeight(x,z,height,refresh=true) {\n var index = this.findIndex(x,z);\n this.terrain.mapData[index+1]=height;\n this.refresh(refresh);\n return index;\n }", "calcHeight() {\n\n const card = document.querySelector('.card');\n const { width } = card.getBoundingClientRect();\n const aspectRatio = 409 / 663;\n const height = Math.min(width, 350) / aspectRatio;\n\n this.setState({ height });\n\n }", "function augmenter() {\n if (hauteur < 300) {\n hauteur = hauteur + 10;\n rectangle.style.height = hauteur+\"px\";\n }\n else {\n hauteur = 100;\n var nbHauteur = hauteur+\"px\";\n }\n}", "get Height() { return this.y2 - this.y1; }", "get Height() { return this.y2 - this.y1; }", "function detectVerticalSquash(img, iw, ih) {\n var canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = ih;\n var ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0);\n var data = ctx.getImageData(0, 0, 1, ih).data;\n // search image edge pixel position in case it is squashed vertically.\n var sy = 0;\n var ey = ih;\n var py = ih;\n while (py > sy) {\n var alpha = data[(py - 1) * 4 + 3];\n if (alpha === 0) {\n ey = py;\n } else {\n sy = py;\n }\n py = (ey + sy) >> 1;\n }\n var ratio = (py / ih);\n return (ratio===0)?1:ratio;\n }", "function calculateHeight(response) {\n\tvar height;\n\ttemperature = Math.round(response.current_observation.temp_f);\n\t \n\tif (temperature == 0) {\n\t\theight = 50;\n\t\treturn height;\n\t} else if (temperature > 0) {\n\t\theight = temperature * 2 + 50;\n\t\treturn height;\n\t} else {\n\t\theight = 50 + temperature * 2;\n\t\treturn height;\n\t}\n}", "setElementHeights () {\n var imgHeight = el_flickrImg.height;\n var screenSize = document.documentElement.clientHeight;\n\n this.maxheightWikiContentElement((screenSize - imgHeight) + 'px');\n }", "function heightAtLine(lineObj) {\n\t\t lineObj = visualLine(lineObj);\n\n\t\t var h = 0, chunk = lineObj.parent;\n\t\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i];\n\t\t if (line == lineObj) { break }\n\t\t else { h += line.height; }\n\t\t }\n\t\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t\t for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n\t\t var cur = p.children[i$1];\n\t\t if (cur == chunk) { break }\n\t\t else { h += cur.height; }\n\t\t }\n\t\t }\n\t\t return h\n\t\t }", "function tp_lheight(layer)\n{\n\treturn layer.bounds[3].value - layer.bounds[1].value;\n}", "function getImgHeight(width) {\n return scalar * width;\n}", "function offsetHeigthOnStroke(elm) {\n elm.offsetHeight;\n}", "function calculateKenBurnScales(proc,sloth,opt) {\n\t\t\tvar ow = sloth.data('owidth');\n\t\t\tvar oh = sloth.data('oheight');\n\n\t\t\tvar factor = (opt.container.width() /ow);\n\t\t\tvar nheight = oh * factor;\n\n\t\t\tvar hfactor = (nheight / opt.container.height())*proc;\n\n\n\n\t\t\treturn (proc+\"% \"+hfactor+\"%\");\n\t\t}", "function calculateKenBurnScales(proc,sloth,opt) {\n\t\t\tvar ow = sloth.data('owidth');\n\t\t\tvar oh = sloth.data('oheight');\n\n\t\t\tvar factor = (opt.container.width() /ow);\n\t\t\tvar nheight = oh * factor;\n\n\t\t\tvar hfactor = (nheight / opt.container.height())*proc;\n\n\n\n\t\t\treturn (proc+\"% \"+hfactor+\"%\");\n\t\t}", "function calculateKenBurnScales(proc,sloth,opt) {\n\t\t\tvar ow = sloth.data('owidth');\n\t\t\tvar oh = sloth.data('oheight');\n\n\t\t\tvar factor = (opt.container.width() /ow);\n\t\t\tvar nheight = oh * factor;\n\n\t\t\tvar hfactor = (nheight / opt.container.height())*proc;\n\n\n\n\t\t\treturn (proc+\"% \"+hfactor+\"%\");\n\t\t}", "function handleDynamicHeight(value){$element.toggleClass('md-dynamic-height',value);}", "function getHeight (data) {\n const ROW_SPACING = 198.125\n totalPostNum = data.length\n totalRow = (totalPostNum%stepsX !== 0) ? Math.floor(totalPostNum/stepsX) + 1 : totalPostNum/stepsX\n section_height = (ROW_SPACING * totalRow) + 110\n return section_height\n }", "function adaptiveHeight() {\n\t\tlet takeHeihgt = [];\n\t\t$('.header_slider__item').each(function(item, index) {\n\t\t\ttakeHeihgt.push($(this).outerHeight());\n\t\t});\n\t\t$('.header_slider__item').css('height', Math.max.apply(null, takeHeihgt));\n\t}", "function lineAtHeight(chunk, h) {\n\t\t var n = chunk.first;\n\t\t outer: do {\n\t\t for (var i = 0; i < chunk.children.length; ++i) {\n\t\t var child = chunk.children[i], ch = child.height;\n\t\t if (h < ch) { chunk = child; continue outer; }\n\t\t h -= ch;\n\t\t n += child.chunkSize();\n\t\t }\n\t\t return n;\n\t\t } while (!chunk.lines);\n\t\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i], lh = line.height;\n\t\t if (h < lh) break;\n\t\t h -= lh;\n\t\t }\n\t\t return n + i;\n\t\t }", "function detectVerticalSquash(img, iw, ih) {\n var canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = ih;\n var ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0);\n var data = ctx.getImageData(0, 0, 1, ih).data;\n // search image edge pixel position in case it is squashed vertically.\n var sy = 0;\n var ey = ih;\n var py = ih;\n while (py > sy) {\n var alpha = data[(py - 1) * 4 + 3];\n if (alpha === 0) {\n ey = py;\n } else {\n sy = py;\n }\n py = (ey + sy) >> 1;\n }\n var ratio = (py / ih);\n return (ratio === 0) ? 1 : ratio;\n }", "set height(value) {\n if (value === this.heightIn) {\n return;\n }\n this.heightIn = value;\n this.notifyPropertyChanged('height');\n }", "setHeight(height) {\n const realFeet = ((height * 3.93700) / 12);\n const feet = Math.floor(realFeet);\n const inches = Math.round((realFeet - feet) * 12);\n this.height = `${feet}' ${(`0${inches}`).substr(-2)}''`;\n }", "function setHeightByOriginalRatio(){\n\t\t\n\t\tvar objSize = t.getSize();\n\t\t\t\t\n\t\tvar ratio = objSize.width / objSize.height;\n\t\t\n\t\tif(ratio != objSize.orig_ratio){\n\t\t\t\n\t\t\tvar newHeight = objSize.width / objSize.orig_ratio;\n\t\t\tnewHeight = Math.round(newHeight);\n\t\t\t\n\t\t\tif(newHeight < g_options.gallery_min_height)\n\t\t\t\tnewHeight = g_options.gallery_min_height;\n\t\t\t\n\t\t\tg_objWrapper.height(newHeight);\n\t\t}\n\t\n\t}", "function changePfolioHeight(){ \n pfolioRatio = $this.outerWidth() / pfCurrScr;\n pfolioRatio = pfolioRatio\n }", "function detectVerticalSquash (img, iw, ih) {\n const canvas = document.createElement('canvas')\n\n canvas.width = 1\n canvas.height = ih\n\n const ctx = canvas.getContext('2d')\n\n ctx.drawImage(img, 0, 0)\n\n const data = ctx.getImageData(0, 0, 1, ih).data\n // search image edge pixel position in case it is squashed vertically.\n let sy = 0\n let ey = ih\n let py = ih\n\n while (py > sy) {\n const alpha = data[(py - 1) * 4 + 3]\n if (alpha === 0) {\n ey = py\n } else {\n sy = py\n }\n py = (ey + sy) >> 1\n }\n\n const ratio = (py / ih)\n\n return (ratio === 0) ? 1 : ratio\n}", "function getTenBlocksAfterHeight() {\r\n let blq = blocknumber.value;\r\n if (blq == \"\" || isNaN(blq)) {\r\n blocknumber.focus();\r\n blocknumber.value = \"\";\r\n return false;\r\n }\r\n let blqnum = parseInt(blq);\r\n let data = {\r\n \"height\": blqnum\r\n };\r\n _doPost('/local/chain/blocks-after', data);\r\n }", "handleHeightChange(event) {\n let processedData = event.nativeEvent.text;\n this.setState({ height: processedData })\n this.bmi(processedData, this.state.weight);\n }", "function getHeight(width, origWidth, origHeight) {\n var height = parseInt((origHeight/origWidth) * width, 10);\n return height;\n }", "set minHeight(value) {}", "function fImageHeightWidth (imgsArray, ht, wt) {\n /**----( aHorizonImages: Setting array member's heights and widths )----**/\n for (var i = 0; i < imgsArray.length; i++) {\n fAnimateHeightWidth (imgsArray[i], ht, wt); //rowImgRightColmnWidth);\n ////console.log (\"imgsArray[i]: \", imgsArray[i]);\n }\n }" ]
[ "0.6170123", "0.61641544", "0.6026879", "0.5851804", "0.58301896", "0.58087075", "0.5797593", "0.5789551", "0.57616484", "0.5736356", "0.570691", "0.57056236", "0.5701173", "0.56964505", "0.5692151", "0.56545985", "0.5648779", "0.5630481", "0.56152964", "0.5597911", "0.55963534", "0.5595779", "0.55949724", "0.5592952", "0.5581791", "0.55725133", "0.55711156", "0.55496687", "0.5542999", "0.554219", "0.5539809", "0.55307513", "0.5505683", "0.5500724", "0.54818845", "0.54733217", "0.5473255", "0.5470213", "0.546164", "0.54596484", "0.545801", "0.5445032", "0.54411703", "0.5440788", "0.5438441", "0.5431382", "0.5430427", "0.5423309", "0.5416662", "0.5416662", "0.5415023", "0.5414895", "0.5409485", "0.54030275", "0.5400858", "0.5382115", "0.5370082", "0.5363597", "0.53559023", "0.53559023", "0.53559023", "0.5354608", "0.5348852", "0.5340318", "0.5330652", "0.5329313", "0.5327789", "0.5325848", "0.5319375", "0.53185606", "0.5309458", "0.5307746", "0.5299149", "0.5298069", "0.52968687", "0.52968687", "0.5292155", "0.529032", "0.5276501", "0.5275121", "0.52745664", "0.52738655", "0.5272595", "0.52692753", "0.52692753", "0.52692753", "0.52637357", "0.52632326", "0.5254829", "0.52547526", "0.5254417", "0.5252404", "0.5251857", "0.525055", "0.52408355", "0.52395755", "0.52358514", "0.52336854", "0.5231629", "0.52274555", "0.5226566" ]
0.0
-1
fn(relativePos) Parameters: block (obj) block whose button was clicked relativePos (buttonpos) position of button (14)
onAddButtonClick(fn) { this.onAddButtonClickFn = fn }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cb_beforeClick(cb, pos) { }", "mouseClick(button) {\r\n //check if mouse pointer is locked\r\n if (BOX.Engine.noa.container.hasPointerLock) {\r\n if (this.parent && this.parent.isDeveloper) {\r\n let devComponent = this.parent.components['DeveloperMode']; //need to fix this !!!\r\n if (devComponent && devComponent.status) {\r\n switch (button) {\r\n case 0:\r\n // add block\r\n if (BOX.Engine.noa.targetedBlock) {\r\n devComponent.addBlock();\r\n }\r\n break;\r\n case 2:\r\n // remove block\r\n if (BOX.Engine.noa.targetedBlock) {\r\n devComponent.removeBlock();\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }", "clicked(x, y) {}", "function update_button_location(act,key){\r\n //console.log(act);\r\n return $('a.act_block#button-'+(key+1))\r\n .css('top',base_position.top+act.top*zoomRatio)\r\n .css('height',act.height*zoomRatio)\r\n .css('left',base_position.left+act.left*zoomRatio)\r\n .css('width',act.width*zoomRatio);\r\n }", "function blockButton({ id, className, onClick, text }) {\n return (\n <div id=\"first\">\n {/* <div id={id} className=\"flex-item\" onClick={() => this.updateClicks(blockArray[0][0])}>{text}</div> */}\n <div id=\"def\">Stuff shown on hover</div>\n </div>\n );\n}", "click(x, y, _isLeftButton) {}", "function buttonsClick(e) {\n var target = e.target;\n while (target.id != \"story_content\") {\n switch (target.className) {\n case \"top\":\n moveBlockUp(target);\n return;\n case \"bottom\":\n moveBlockDown(target);\n return;\n case \"delete\":\n deleteBlock(target);\n return;\n case \"addmarker\":\n setactiveMarker(target);\n return;\n case \"addmarkerArtifact\":\n setactiveMarker(target);\n return;\n case \"removemarker\":\n removeMarker(target);\n return;\n case \"image_story gallery\":\n galleryChangePicture(target);\n return;\n case \"block_story\":\n editBlock(target);\n return;\n }\n target = target.parentNode;\n }\n}", "function ClickBlock() {\n // for(let i = 0; i < itemEls.length; i++){\n // itemEls[i].style.pointerEvents = 'none';\n // }\n // setTimeout(()=>{\n // for(let i = 0; i < itemEls.length; i++){\n // itemEls[i].style.pointerEvents = 'auto';\n // }\n // }, 210);\n }", "function canvasClick(e) {\n\tblockus.mouseClicked();\n}", "clickHandler (event) {\n const { target } = event\n if (target && target[BLOCK_DOM_PROPERTY] === this) {\n const lastChild = this.lastChild\n const lastContentBlock = lastChild.lastContentInDescendant()\n const { clientY } = event\n const lastChildDom = lastChild.domNode\n const { bottom } = lastChildDom.getBoundingClientRect()\n if (clientY > bottom) {\n if (lastChild.blockName === 'paragraph' && lastContentBlock.text === '') {\n lastContentBlock.setCursor(0, 0)\n } else {\n const state = {\n name: 'paragraph',\n text: ''\n }\n const newNode = ScrollPage.loadBlock(state.name).create(this.muya, state)\n this.append(newNode, 'user')\n const cursorBlock = newNode.lastContentInDescendant()\n cursorBlock.setCursor(0, 0, true)\n }\n }\n }\n }", "function give_up(){\n // if button on line \n}", "activateBlock(fretBoard, el) {\n\t\t//console.log(fretBoard);\n\t\tvar index = 1;\n\t\tif(el) {\n\t\t\tindex = parseInt(el.currentTarget.innerHTML.replace('block', '') );\n\n\t\t\t// Remove active class from all blocks\n\t\t\tvar blockEls = document.querySelectorAll('.block');\n\t\t\tfor(var i = 0; i < blockEls.length; i++) {\n\t\t\t\tblockEls[i].classList.remove('active');\n\t\t\t}\n\t\t\t// Add the active class to this button\n\t\t\tel.currentTarget.classList.add('active');\n\n\t\t\t// Hide all pattern images\n\t\t\tvar allPatterns = document.querySelectorAll(fretBoard.bodyID + ' img');\n\t\t\tfor(var i = 0; i < allPatterns.length; i++) {\n\t\t\t\tallPatterns[i].style.display= 'none';\n\t\t\t}\n\t\t} else {\n\t\t\t// Add the active class to the first button\n\t\t\tvar firstBtn = document.querySelector(fretBoard.bodyID + ' button:nth-child(' + index + ')');\n\t\t\tfirstBtn.classList.add('active');\n\t\t}\n\t\t// Get and show image related to this button\n\t\tvar img = document.querySelector(fretBoard.bodyID + ' img:nth-child(' + index + ')');\n\t\timg.style.display = 'block';\n\n\t\tmixpanel.track(\"Block Activated\", \n\t\t\t{ \"Block\" : index });\n\t}", "function isHowToClicked(x,y) {\n return x >= buttonX - buttonWidth/2 &&\n x <= buttonX + buttonWidth/2 &&\n y >= buttonY - buttonHeight/2 &&\n y <= buttonY + buttonHeight/2;\n\n}", "function mouseClicked() {\n //i cant figure out how to do mouse controls\n //player.mouseControls *= -1\n\n for (b = 0; b < buttons.length; b++){\n switch (buttons[b].shape) {\n case \"rect\":\n if (mouseX >= (buttons[b].x + camOffsetX) * canvasScale &&\n mouseX <= (buttons[b].x + camOffsetX + buttons[b].w) * canvasScale &&\n mouseY >= (buttons[b].y + camOffsetY) * canvasScale &&\n mouseY <= (buttons[b].y + camOffsetY + buttons[b].h) * canvasScale){\n if (options.optionsMenuHidden === -1 && buttons[b].tab === options.optionsMenuTab){\n buttons[b].testClick();\n return;\n }\n }\n break;\n case \"circle\":\n if (Math.sqrt(Math.pow(mouseX - ((buttons[b].x + camOffsetX) * canvasScale), 2)+Math.pow(mouseY - ((buttons[b].y + camOffsetY) * canvasScale),2) < buttons[b].w)){\n if (options.optionsMenuHidden === -1 && buttons[b].tab === options.optionsMenuTab){\n buttons[b].testClick();\n return;\n }\n }\n default:\n break;\n }\n \n }\n}", "click(btn) {\r\n\r\n canvas.addEventListener(\"click\",\r\n function buttonClick(e) {\r\n\r\n let x = fix_X(e.clientX);\r\n let y = fix_Y(e.clientY);\r\n\r\n // Check for collision.\r\n if (x >= btn.x - btn.w / 2 & x <= btn.x + btn.w / 2) {\r\n if (y >= btn.y - btn.h / 2 & y <= btn.y + btn.h / 2) {\r\n btn.click_extra();\r\n btn.action();\r\n }\r\n\r\n }\r\n });\r\n }", "function Abutton(){\n var tmp1=doraemon.style.left;\n var tmp2=doraemon.style.top;\n var currentX1=parseInt(tmp1.substring(0,tmp1.length-2));\n var currentY1=parseInt(tmp2.substring(0,tmp2.length-2));\n\n var tmp3=tmpBomb.style.left;\n var tmp4=tmpBomb.style.top;\n var currentX2=parseInt(tmp3.substring(0,tmp3.length-2));\n var currentY2=parseInt(tmp4.substring(0,tmp4.length-2));\n \n if(currentX1>=(currentX2-70)&&currentX1<=(currentX2+70)&&currentY1>=(currentY2-70)&&currentY1<=(currentY2+70)){\n takeItem(tmpBomb,currentX1,currentY1);\n handEmpty=false;\n }\n }", "function btn1(e) {\n\tvar bot = this.getElementsByClassName(\"math-button-mount-point\")[0];\n\t//console.log(bot);\n\tif (bot.style.display == \"block\") {\n\t\tbot.style.display = \"none\";\n\t\tthis.className = \"math-button\";\n\t} else {\n\t\tbot.style.display = \"block\";\n\t\tthis.className = \"math-button math-button-in\";\n\t}\n\te.stopPropagation();\t\n}", "function onButtonDown3(){\n for(var i = 0;i<blockPressArray.length;i++){\n for(var j = 0;j<blockPressArray[i].length;j++){\n if(i==0&&j==0 || blockPressArray[i][j] == 0){continue}\n else{blockPressArray[i][j].texture = block_to_press_up}\n }\n }\n gameWinnable=true;\n stage.addChild(blockMov);\n blockMov.position.set(0,0);\n stage.removeChild(winText);\n stage.removeChild(lostText);\n stage.removeChild(tryAgain);\n blip.play();\n }", "setupEvents() {\n let $blocks = document.querySelectorAll(`.block`);\n //Yuk....Apolgies, I neevr usually do the whole var that = this thing, I dont like it, but for this purpose it works. \n let that = this;\n let listener = function (ev) {\n var blockObj = {\n x: this.getAttribute('xpos'),\n y: this.getAttribute('ypos'),\n colour: this.style.backgroundColor\n }\n that.blockClicked(ev, blockObj);\n };\n\n for (let i = $blocks.length - 1; i >= 0; i--) {\n $blocks[i].addEventListener('click', listener, false);\n };\n \n }", "click(btn) {\r\n\r\n canvas.addEventListener(\"click\",\r\n function buttonClick(e) {\r\n \r\n let x = fix_X(e.clientX);\r\n let y = fix_Y(e.clientY);\r\n \r\n // Check for collision.\r\n if (x >= btn.x - btn.w / 2 & x <= btn.x + btn.w / 2) {\r\n if (y >= btn.y - btn.h / 2 & y <= btn.y + btn.h / 2) {\r\n btn.action();\r\n canvas.removeEventListener(\"click\", buttonClick);\r\n }\r\n \r\n }\r\n });\r\n }", "function click_block(mapid, block) {\n var id = id_from_block(mapid, block);\n $(\"#\" + id).click();\n}", "placeBlock () {\r\n this.mouseFocus.updateFocus(this.player.getCamera(), this.currentMeshes)\r\n const newBlockPosition = this.mouseFocus.getNewBlockPosition()\r\n if (newBlockPosition) this.world.placeBlock(newBlockPosition)\r\n }", "function btn1(e) {\r\n\tvar bot = this.getElementsByClassName(\"math-button-mount-point\")[0];\r\n\t//console.log(bot);\r\n\tif (bot.style.display == \"block\") {\r\n\t\tbot.style.display = \"none\";\r\n\t\tthis.className = \"math-button\";\r\n\t} else {\r\n\t\tbot.style.display = \"block\";\r\n\t\tthis.className = \"math-button math-button-in\";\r\n\t}\r\n\te.stopPropagation();\t\r\n}", "function buttonDown(event) {\n this.isdown = true;\n // calculate offset\n var pos = event.data.getLocalPosition(this.parent);\n this.offX = pos.x - this.x;\n this.offY = pos.y - this.y;\n this.alpha = 1;\n}", "function onButtonDown2(){\n //stage.addChild(block_to_press);\n for(var i=0;i<blockPressArray.length;i++){\n for(var j=0;j<blockPressArray[i].length;j++){\n if(i==0&&j==0 || blockPressArray[i][j] == 0){continue}\n else{\n stage.addChild(blockPressArray[i][j]);\n }\n }\n }\n stage.removeChild(aboutButton);\n stage.removeChild(aboutText);\n stage.addChild(goal);\n stage.addChild(blockMov);\n stage.removeChild(startButton);\n startButton.visible = false;\n blip.play();\n }", "clicked(mx,my){\n\n //if( (my == this.y) && (mx <= (this.begin+5)) && (mx >= this.begin) ){\n if( (my <= this.y) && (my >= (this.y)-8) && (mx <= (this.begin+8)) && (mx >= this.begin) ){\n if(this.pressed==0){\n this.pressed = 1;\n console.log(this.begin);\n console.log(this.mirna_sequence);\n console.log(this.mirna_id);\n }\n else{\n this.pressed = 0;\n console.log(this.end);\n }\n }\n }", "function mousePressed(){\n b_location_x = random (position);\n b_location_y = random (position);\n \n }", "clickedOn(xPos, yPos) {\n return(xPos > this.x && xPos < this.x + this.w && yPos > this.y && yPos < this.y +this.w);\n }", "function Button(parentInterface, name, topLeftX, topLeftY, width, height) {\n // assert(width >= 0);\n // assert(height >= 0);\n this.x = topLeftX;\n this.y = topLeftY;\n this.width = width;\n this.height = height;\n this.name = name;\n this.isVisible = true;\n this.parentInterface = parentInterface;\n this.isPressed = false;\n\n if (this.parentInterface.push) {\n this.parentInterface.push(this); // this button is pushed into parentInterface's array when instanced\n }\n\n //TODO I think this is ok in javascript with varable scope\n this.leftMouseClick = function(x=mouseX, y=mouseY) {\n if(isInPane(this, x, y) && this.isVisible) {\n this.isPressed = true;\n }\n };\n\n this.mouseOver = function(x=mouseX, y=mouseY) {\n if (!mouseHeld && isInPane(this, x, y)) {\n //mouse released while inside pane\n if(this.isPressed) {\n this.action();\n }\n this.isPressed = false;\n } else if (!isInPane(this, x, y)) {\n this.isPressed = false;\n }\n };\n\n // This function will be called when button is triggered\n this.action = function() {\n // assign custom function to do something\n };\n\n this.draw = function() {\n if(this.isVisible) {\n var drawColor;\n drawColor = (this.isPressed) ? buttonColorPressed : buttonColor;\n colorRect(this.x, this.y, this.width, this.height, drawColor);\n\n var str = this.name;\n var strWidth = canvasContext.measureText(this.name).width;\n //center text\n var textX = this.x + (this.width*0.5) - (strWidth*0.5);\n //TODO magic numbers going here.\n var textY = this.y + (this.height*0.5) + 4;\n colorText(str, textX, textY, \"black\");\n\n }\n }\n\n\n}", "function userClick(e){\n\n let dragCheck = userInput.dragOrClickCheckandStop()\n if(dragCheck){\n return;\n }\n\n if(!currentHover){\n console.log('none!')\n return;\n }\n\n\n\n //cant place things on top of roads so nothing happens on click\n if(currentHover.object.blockType == 'road' && process.clickOperation != 'delete-block'){\n return\n }\n\n if(process.randomColor){\n process.paintColor = {r:ts.rndmNum(0,1),g:ts.rndmNum(0,1),b:ts.rndmNum(0,1)}\n }\n\n\n const hoverPos = currentHover.object.position\n console.log(currentHover)\n let place = {x:hoverPos.x,y:hoverPos.y+1,z:hoverPos.z}\n if(process.clickOperation == 'place-road'){\n if(currentHover.object.blockType){\n return;\n }\n let newRoad = new cls.Road(editPlot,place.x,place.y,place.z)\n editPlot.blocks[place.x][place.y][place.z] = newRoad;\n newRoad.addToScene()\n // console.log(newRoad)\n newRoad.fitToSurroundings(true)\n } \n if(process.clickOperation == 'place-residential'){\n let newBlock = new cls.Residential(editPlot,place.x,place.y,place.z)\n newBlock.baseColor = process.paintColor\n console.log(newBlock.baseColor)\n newBlock.addToScene()\n newBlock.fitToSurroundings(true)\n }\n if(process.clickOperation == 'place-office'){\n let newBlock = new cls.Office(editPlot,place.x,place.y,place.z);\n newBlock.baseColor = process.paintColor\n console.log(newBlock.baseColor)\n newBlock.addToScene()\n newBlock.fitToSurroundings(true)\n }\n if(process.clickOperation == 'place-commercial'){\n let newBlock = new cls.Commercial(editPlot,place.x,place.y,place.z);\n newBlock.baseColor = process.paintColor\n newBlock.addToScene()\n newBlock.fitToSurroundings(true)\n }\n if(process.clickOperation == 'place-park' && currentHover.object.blockType == undefined){\n let newBlock = new cls.Park(editPlot,place.x,place.y,place.z);\n newBlock.addToScene()\n newBlock.fitToSurroundings(true)\n\n }\n if(process.clickOperation == 'delete-block' && currentHover.object.blockType){\n console.log(currentHover.object)\n // index.scene.remove(currentHover.object)\n let x = currentHover.object.position.x;\n let y = currentHover.object.position.y;\n let z = currentHover.object.position.z;\n\n if(currentHover.object.blockType == 'park'){\n y = 1;\n }\n\n ts.deleteAtandUp(x,y,z,editPlot.blocks,editPlot)\n // editPlot.blocks[x][y][z] = [];\n }\n if(process.clickOperation == 'paint-building' && currentHover.object.blockType){\n console.log(currentHover.object)\n ts.setBaseColor(currentHover.object,process.paintColor);\n currentHover.object.objectOf.baseColor = process.paintColor;\n }\n\n let exportable = exportBlocks(editPlot)\n ts.exporter.blockData(exportable)\n\n let allSides = editPlot.checkEdgesForRoads('boolean')\n ts.exporter.edgeRoadBoolean(allSides)\n\n\n}", "function calcbuttonstick() {\n var parPosition = $('.bfs-income-tax-calc-parent').offset();\n var btnParentPosition = $(\".investment-products-wrapper-m:nth-last-child(2)\").offset();\n// var buttonsPosition = $(\".scrollsett\").offset();\n if($('.bfs-income-tax-calc-parent').length > 0){\n \tif ($(window).scrollTop() > parPosition.top) {\n// $('.calc-tax-btn').addClass('calc-btn-stick');\n \t\t$('.income-tax-cal-buttons').css(\"display\",\"block\");\n\n }\n if ($(window).scrollTop() > btnParentPosition.top) {\n// $('.calc-tax-btn').removeClass('calc-btn-stick');\n $('.income-tax-cal-buttons').css(\"display\",\"none\");\n\n }\n }\n \n// if ($(\".income-tax-edit-done-w\").length > 0) {\n// if ($(window).scrollTop() > buttonsPosition.top) {\n// if ($(\".calc-tax-btn\").hasClass(\"btn-hidden\")) {\n// if ($('.income-tax-edit-done-w').css(\"display\") == \"none\") {\n// $('.income-tax-edit-done-w').show();\n// }\n// }\n// }\n// if ($(window).scrollTop() > btnParentPosition.top) {\n// if ($(\".calc-tax-btn\").hasClass(\"btn-hidden\")) {\n// if ($('.income-tax-edit-done-w').css(\"display\") == \"block\") {\n// $('.income-tax-edit-done-w').hide();\n// }\n// }\n//\n// }\n// }\n}", "function determinebuton(e) {\n if (e.target.tagName == 'BUTTON' && gameState === true) {\n if( colordiv.style.color == document.getElementById(e.target.id).style.backgroundColor){\n playerScore = playerScore + 1\n document.getElementById(\"points\").innerHTML = \"Score: \"+ playerScore\n moveButton()\n changeColor()\n }\n else{\n playerScore = playerScore - 1\n document.getElementById(\"points\").innerHTML = \"Score: \"+ playerScore\n moveButton()\n changeColor()\n }\n }\n}", "moveBlock(block) {\n block.state.pos.add(block.state.spe);\n }", "addBlock()\n\t{\n\t\t$('.'+this.cssAddBlock).on('click',function()\n\t\t{\n\t\t\t$(this).before(block.getNewBlock());\n\t\t\t\n\t\t});\n\t}", "function min1() {\n\n /***** ACTION *****/\n buttonPress(-1);\n}", "touchBlock(row, col) {\n const id = this.rowColToIndex(row, col);\n const element = document.getElementById(`block-${id}`);\n let order = this.grid[row][col].order;\n if (!this.errorInTest &&\n this.previousTouchedIndex == order - 1 && element) {\n element.classList.add('succeed');\n this.previousTouchedIndex = order;\n } else {\n if (element) element.classList.add('failed');\n this.errorInTest = true;\n }\n }", "onAddBlockClick() {\n const blocksToBeAdded = this.props.blocksToBeAdded;\n const overlayComponents = {\n kind: 'MultiBlockSelect',\n props: {\n key: this.props.model.getID(),\n model: this.props.model,\n blocksToBeAdded,\n },\n };\n\n this.props.model.viewState.showOverlayContainer = true;\n this.props.model.viewState.overlayContainer = overlayComponents;\n this.context.editor.update();\n }", "function makeClickHandler( row, col ) {\n\treturn function() {\n\t\tclickOnBlock( row, col );\n\t};\n}", "function getButton(index, col, row){\n var button = PIXI.Sprite.fromFrame(index);\n\tbutton.buttonMode = true;\n\tbutton.anchor.set(0.5);\n\tbutton.position.x = 45+col*70;\n\tbutton.position.y = 45+row*70;\n\tbutton.interactive = true;\n\treturn button;\n}", "function isDancingClicked(x,y) {\n return x >= buttonX - buttonWidth/2 &&\n x <= buttonX + buttonWidth/2 &&\n y >= secondButtonYpos - buttonHeight/2 &&\n y <= secondButtonYpos + buttonHeight/2;\n}", "function blockTheWin(toBlock) {\n if (!(screenWin.style.display === 'block')) {\n let randomCell = document.querySelector(`#${toBlock}`);\n if (!(randomCell.classList.contains('clicked'))) {\n randomCell.classList.add('box-filled-2');\n randomCell.classList.add('clicked');\n player2Moves.push(randomCell.id);\n checkForActive(player2, player1);\n checkForWin(player2Moves);\n addRemoveEL(1);\n theCount1++\n theCount2++\n }\n }\n}", "function __clickhandler() {\n buttonfunc(elemnode); return false;\n }", "function scrollToBlock() {\n $('.js-scrollToBlock').on('click', function (e) {\n e.preventDefault();\n // console.log($(this).attr('href'))\n var blockOffset = $($(this).attr('href')).offset().top;\n\n $('html, body').animate({\n scrollTop: blockOffset - 96\n }, 2000);\n })\n\n}", "function mousePressed() {\n for (let i = 0; i < musicBlocks.length; i++) {\n let musicBlock = musicBlocks[i];\n\n musicBlock.mousePressed(width / 2, height / 2);\n\n }\n}", "function button0() {buttonAll(0, c0);}", "mouseUp(x, y, _isLeftButton) {}", "buttonClick(ev) {\n\n\t\t// Get the button using the index\n\t\tvar btn = this.props.buttons[ev.currentTarget.dataset.index];\n\n\t\t// If there's a callback\n\t\tif(typeof btn.callback == 'function') {\n\t\t\tbtn.callback(btn);\n\t\t} else {\n\t\t\tthis.props.close();\n\t\t}\n\t}", "function test_oneFieldBlock_blockClickShowsEditor() {\n svgTest_setUp();\n\n try {\n var block = svgTest_newOneFieldBlock();\n\n var showEditorCalled = false;\n block.getField('FIELD').showEditor_ = function() {\n showEditorCalled = true;\n };\n\n block.getSvgRoot().dispatchEvent(new Event('mouseup'));\n assertTrue('showEditor_() not called', showEditorCalled);\n } finally {\n svgTest_tearDown();\n }\n}", "pressed(){\n //if mouse is on the button and pressed\n if (mouse.x > this.x1 && mouse.x < this.x2 && mouse.y > this.y1 && mouse.y < this.y2 && mouse.press){\n //if button can be pressed\n if (time > this.button_cooldown){\n //call function with arguments\n this.func(this.args);\n //set cooldown\n this.button_cooldown = time+1000\n }\n }\n }", "function scrollToBlock() {\n\t$('.js-scrollToBlock').on('click', function (e) {\n\t\te.preventDefault();\n\t\t// console.log($(this).attr('href'))\n\t\tvar blockOffset = $($(this).attr('href')).offset().top;\n\t\t\n\t\t$('html, body').animate({\n\t\t\tscrollTop: blockOffset - 96\n\t\t}, 2000);\n\t})\n\t\n}", "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 delegateButtonClicks(evt, that, theSenderName, locObj) {\n\n if (!locObj.theTarget.disabled) {\n // console.log(\"delegateButtonClicks> evt: \" + evt + \" that: \" + that + \" theSenderName: \" + theSenderName + \"locObj.theTarget : \" + locObj.theTarget + \"locObj.theTargetType: \" + locObj.theTargetType);\n\n //var theSource = locObj.theTargetName;\n // The Image of Button\n //var str = locObj.theTarget.firstChild;\n\n switch (theSenderName) {\n case \"previous\":\n case \"next\":\n toggleSequence(theSenderName);\n break;\n case \"notesb\":\n handleNotes(theSenderName);\n break;\n case \"goBack\" :\n UpALevel();\n break;\n case \"audiopl\":\n case \"audiorew\":\n case \"audiofor\":\n handleAudio(theSenderName);\n break;\n case \"tapescr\":\n tapescriptShow(theSenderName);\n break;\n case \"checkB\" :\n case \"showB\" :\n case \"resetB\" :\n case \"showtext\" :\n case \"showjust\" :\n case \"showgrammar\" :\n case \"showLF\" :\n case \"showUE\" :\n case \"showCU\" :\n case \"videoB\" :\n case \"showaudio\" :\n assignFooterExtraTextButtons(locObj);\n break;\n\t\t\tcase \"showgrade\" :\n\t\t\t\t$(\"#grade\").toggle();\n\t\t\t\tbreak;\n default :\n }\n }\n}", "function eXcell_addTeaPickedBlockBtn(cell) { // the eXcell name is defined here\n if (cell) { // the default pattern, just copy it\n this.cell = cell;\n this.grid = this.cell.parentNode.grid;\n }\n this.edit = function () {} // read-only cell doesn't have edit method\n // the cell is read-only, so it's always in the disabled state\n this.isDisabled = function () {\n return true;\n }\n this.setValue = function (val) {\n var row_id = this.cell.parentNode.idd; // gets the id of the related row\n var rowIndex = myGrid.getRowIndex(row_id);\n this.setCValue(\"<input type='button' value='+' onclick='addNewTeaPickedBlock(\" + row_id + \",\" + rowIndex + \")'>\");\n }\n}", "function whichButton(event){\n\nif(event.keyCode=='39'){\n\nx=x+5;\nlienzo();\n\n}\n\nif(event.keyCode=='37'){\n\nx=x-5;\nlienzo();\n\n}\n\nif(event.keyCode=='38'){\n\ny=y-5;//\nlienzo();\n\n}\n\nif(event.keyCode=='40'){\n\ny=y+5;\nlienzo();\n\n}\n\n}", "hovered(){\n //if mouse is over butotn\n if (mouse.x > this.x1 && mouse.x < this.x2 && mouse.y > this.y1 && mouse.y < this.y2){\n //return that button is being hovered over\n return true;\n }\n }", "blockClicked(block) {\n this.blocksFlaggedForRemoval = [];\n this.getSameColourNeighbours(block);\n\n this.blocksFlaggedForRemoval.map(block => this.clearBlock(block));\n\n this.reorderColumn();\n this.render();\n }", "buttonClicked() {\n alert(\"buttonclicked of button\");\n }", "function buttonSetter(){\n footer.appendChild(btnUp)\n btnUp.innerHTML = '^';\n btnUp.setAttribute('onClick',\"goToTop()\");\n \n}", "onButtonUp() {\n\t\tif(character.isClicked) {\n\t\t\tcharacter.sprite.y += 100;\n\t\t\tcharacter.isClicked = false;\n\t\t}\n\t}", "function InventoryItemMiscPandoraPadlockClick() {\n\tif ((MouseX >= 1885) && (MouseX <= 1975) && (MouseY >= 25) && (MouseY <= 110)) DialogFocusItem = null;\n}", "reRenderLocationIndBlock(posData) {\n console.log(' in reRenderLocationIndBlock method');\n let blockReference = this.getBlockReferenceHelper(posData) ; \n let coinsInNewPosition = getCoinsOnPositionList(this.coinObjectList, positionToInt);\n blockReference.reRenderLocation(posData, coinsInNewPosition);\n\n }", "function changePosition(e) {\n\n const columns = document.getElementsByClassName(\"column\");\n\n ///////////////////////////////////////\n // Alle Top-Buttons gangbar machen\n //////////////////////////////////////\n if (this.parentElement.classList.contains(\"top\")) {\n if (this.classList.contains(\"toRight\")) {\n\n if (this.parentElement.parentElement === columns[2] &&\n this.parentElement.nextElementSibling.hasChildNodes() === false) {\n jumpRightToLeftTop(this);\n\n // schaue ob das folgende Element (die zu verschiebenden Boxen)\n // ein, oder mehrere Kinder haben. Die Boxen haben keine, die \n // Bottom-Navigation aber schon. Falls nein, dann führe Funktion aus.\n // Bzw. verschiebe Elemente bis die Boxen alle weg sind.\n } else if (this.parentElement.nextElementSibling.hasChildNodes() === false) {\n moveRightTop(this);\n }\n }\n if (this.classList.contains(\"toLeft\")) {\n if (this.parentElement.parentElement === columns[0] &&\n // verhindert, dass die Buttons mit verschoben werden\n this.parentElement.nextElementSibling.hasChildNodes() === false) {\n jumpLeftToRightTop(this);\n\n // verhindert, dass die Buttons mit verschoben werden\n } else if (this.parentElement.nextElementSibling.hasChildNodes() === false) {\n moveLeftTop(this);\n }\n }\n } // Ende if contains \"top\"\n\n ///////////////////////////////////////\n // Alle Bottom-Buttons gangbar machen\n //////////////////////////////////////\n if (this.parentElement.classList.contains(\"bottom\")) {\n if (this.classList.contains(\"toRight\")) {\n\n if (this.parentElement.parentElement === columns[2] &&\n this.parentElement.previousElementSibling.hasChildNodes() === false) {\n jumpRightToLeftBottom(this);\n\n // schaue ob das folgende Element (die zu verschiebenden Boxen)\n // ein, oder mehrere Kinder haben. Die Boxen haben keine, die \n // Bottom-Navigation aber schon. Falls nein, dann führe Funktion aus.\n // Bzw. verschiebe Elemente bis die Boxen alle weg sind.\n } else if (this.parentElement.previousElementSibling.hasChildNodes() === false) {\n moveRightBottom(this);\n }\n }\n if (this.classList.contains(\"toLeft\")) {\n if (this.parentElement.parentElement === columns[0] &&\n // verhindert, dass die Buttons mit verschoben werden\n this.parentElement.previousElementSibling.hasChildNodes() === false) {\n jumpLeftToRightBottom(this);\n\n // verhindert, dass die Buttons mit verschoben werden\n } else if (this.parentElement.previousElementSibling.hasChildNodes() === false) {\n moveLeftBottom(this);\n }\n }\n } // Ende if contains \"top\"\n\n }", "mouseDown(x, y, _isLeftButton) {}", "function createBlockCommentPosition(event, eventElement) {\n\t\tvar physicianVO = appController.getComponent(\"Context\").getPhysicianVO();\n\t\tif(!physicianVO.physicianId){\n\t\t\theader.physicianAlart(\"Select Physician\");\n\t\t\treturn;\n\t\t}\n\t\tvar hour = parseDate(event.start).getHours();\n\t\tvar day = parseDate(event.start).getDay();\n\t\tvar cssArrow = \"\";\n\t\tvar position = false, revTop = 0;\n\t\tvar $scrollable = $(currentView.element).find(\"#scroll-slots\");\n\t\tvar top = $scrollable.find(\"#dragable-\" + event.id).css(\"top\");\n\t\tvar height = $scrollable.find(\"#dragable-\" + event.id).css(\"height\");\n\t\trevTop = parseInt(top);\n\t\t// top = parseInt(top) - 75;\n\t\tif (event.id == blockId){\n\t\t\ttop = parseInt(top) - 150;\n\t\t}else{\n\t\t\ttop = parseInt(top) - 75;\n\t\t}\n\t\tif (top < 0) {\n\t\t\ttop = 0;\n\t\t\tposition = true;\n\t\t\ttop += parseInt(height) + (revTop + 6);\n\t\t}\n\n\t\tvar left = $scrollable.find(\"#dragable-\" + event.id).css(\"left\");\n\t\tleft = parseInt(left);\n\t\tvar width = $scrollable.find(\"#dragable-\" + event.id).css(\"width\");\n\t\twidth = parseInt(width);\n\n\t\tvar bgStyle = event.backgroundColor != undefined ? \"background-color:\" + event.backgroundColor :\"\";\n\t\tif (position) {\n\t\t\tif ((day == 5 || day == 6) && (currentView.name != \"agendaDay\")) {\n\t\t\t\tleft = left - 200;\n\t\t\t\tcssArrow = \"margin: -14px 0 8px 200px;\";\n\t\t\t} else {\n\t\t\t\tcssArrow = \"margin: -14px 0 8px 13px;\";\n\t\t\t}\n\t\t\tcssArrow += \"box-shadow: 0 0 0 #444444;\";\n\t\t\tbgStyle = \"box-shadow: 0 6px 6px #000000;\";\n\t\t} else {\n\t\t\tif ((day == 5 || day == 6) && (currentView.name != \"agendaDay\")) {\n\t\t\t\tleft = left - 200;\n\t\t\t\tcssArrow = \"margin: 22px 0 0 245px;\";\n\t\t\t}\n\t\t}\n\n\t\tvar commentsWidth = \"\";\n\t\tif (currentView.name == \"agendaDay\") {\n\t\t\tcommentsWidth = \"width:\" + (width - 100) + \"px\";\n\t\t}\n\n\t\tvar selector = $(\"<div id='blocking-area' class='appointment-comments'></div>\");\n\t\tvar blockCommentPosition = $('<div id=\"formBlockCommentContent\" class=\"parentFormdemographicsForm formComment\" style=\"position: absolute; z-index:100;top: '\n\t\t\t\t+ top\n\t\t\t\t+ 'px; left: '\n\t\t\t\t+ left\n\t\t\t\t+ 'px; margin-top: 0px;opacity:1;\"> '\n\t\t\t\t+ '<img title=\"Close\" src=\"js/calendar/images/close.png\" class=\"closeCommentImage\"></img>'\n\t\t\t\t+ '<div class=\"formBlockCommentContent\" style=\"'\n\t\t\t\t+ bgStyle\n\t\t\t\t+ ';'\n\t\t\t\t+ commentsWidth\n\t\t\t\t+ ';\">'\n\t\t\t\t+ '<div id=\"topArroy\" class=\"formBlockCommentArrow\" style=\"'\n\t\t\t\t+ cssArrow\n\t\t\t\t+ '\"> </div>'\n\t\t\t\t+ '<div id=\"commentTextbox\"> Reason'\n\t\t\t\t+ '<div id=\"comment\" dataField=\"true\" isEditor=\"true\" editorLabel=\"\" pathFields=\"\" tagName=\"code\" editorType =\"CDInplace\" dataType=\"CD\"/></div>'\n\t\t\t\t+ '<div id=\"colorTextbox\"> Color'\n\t\t\t\t+ '<div isEditor=\"true\" editorLabel=\"\" pathFields=\"\" tagName=\"reasonCode\" editorType =\"ColorPicker\" dataType=\"CD\"></div>'\n\t\t\t\t+ '<br></div> '\n\t\t\t\t+ '<div class=\"ui-process-button taskOutcome\" style=\"width:45%;margin-top:-13px;\" >Comment Finish <img src=\"images/finish.png\"/></div>'\n\t\t\t\t+ '<div id=\"downArroy\" class=\"formBlockCommentArrow\" style=\"'\n\t\t\t\t+ cssArrow + '\"> </div>' + '</div>');\n\n\t\tvar commentHtml = \"\";\n\t\tvar i = 0;\n\t\tif (!position) {\n\t\t\tfor (i = 10; i > 0; i--) {\n\t\t\t\tcommentHtml += '<div class=\"line' + i + '\" style=\"' + bgStyle\n\t\t\t\t\t\t+ '\"></div>';\n\t\t\t}\n\t\t\tblockCommentPosition.find('#topArroy').remove();\n\t\t\tblockCommentPosition.find('#downArroy').append(commentHtml);\n\t\t} else {\n\t\t\tfor (i = 1; i < 11; i++) {\n\t\t\t\tcommentHtml += '<div class=\"line' + i + '\" style=\"' + bgStyle\n\t\t\t\t\t\t+ 'box-shadow:0 0 0;\"></div>';\n\t\t\t}\n\t\t\tblockCommentPosition.find('#downArroy').remove();\n\t\t\tblockCommentPosition.find('#topArroy').append(commentHtml);\n\t\t}\n\n\t\tblockCommentPosition.find(\".closeCommentImage\").bind(\"click\",\n\t\t\t\tfunction() {\n\t\t\t\t\t$(this).fadeOut(150, function() {\n\t\t\t\t\t\t// remove prompt once invisible\n\t\t\t\t\t\t\t// $(this).parent('.formCommentOuter').remove();\n\t\t\t\t\t\t\t// $(this).remove();\n\t\t\t\t\t\t\tblockCommentPosition.remove();\n\t\t\t\t\t\t});\n\t\t\t\t});\n\t\tvar buttonUI = blockCommentPosition.find(\"div.ui-process-button\");\n\t\tbuttonUI.hover( function() {\n\t\t\t$(this).css('background', '#8d007f');\n\t\t}, function() {\n\t\t\t$(this).css('background', '#6B1E64');\n\t\t});\n\n\t\tbuttonUI\n\t\t\t\t.bind(\n\t\t\t\t\t\t\"click\",\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\tvar messageObj = event.msgObject;\n\t\t\t\t\t\t\tif (messageObj.message != null) {\n\t\t\t\t\t\t\t\tvar value = XmlUtil\n\t\t\t\t\t\t\t\t\t\t.getXPathResult(\n\t\t\t\t\t\t\t\t\t\t\t\tmessageObj.message,\n\t\t\t\t\t\t\t\t\t\t\t\tAppConstants.XPaths.Appointment.COMMENTS,\n\t\t\t\t\t\t\t\t\t\t\t\tXPathResult.STRING_TYPE);\n\t\t\t\t\t\t\t\tevent.comment = (value && value.stringValue) ? value.stringValue\n\t\t\t\t\t\t\t\t\t\t: event.comment;\n\t\t\t\t\t\t\t\tvar value = XmlUtil.getXPathResult(messageObj.message,\n\t\t\t\t\t\t\t\t\t\tAppConstants.XPaths.Appointment.REASONCODE,\n\t\t\t\t\t\t\t\t\t\tXPathResult.STRING_TYPE);\n\t\t\t\t\t\t\t\tevent.backgroundColor = (value && value.stringValue) ? value.stringValue\n\t\t\t\t\t\t\t\t\t\t: event.backgroundColor;\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\teventElement.find(\".physician-comment\").html(\n\t\t\t\t\t\t\t\t\t\tevent.comment);\n\t\t\t\t\t\t\t\tevent.start = parseDate(event.start);\n\t\t\t\t\t\t\t\tevent.end = parseDate(event.end);\n\t\t\t\t\t\t\t\tblockCommentPosition.remove();\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tevent.start = parseDate(event.start);\n\t\t\t\t\t\t\t\tevent.end = parseDate(event.end);\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcurrentView.clearEvents();\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tevents = updateSelectedEvent(events, event);\n\t\t\t\t\t\t\t\tcurrentView.renderEvents(events);\n\t\t\t\t\t\t\t\teventEditComment(event);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\tif ($scrollable.find('#blocking-area').html() != null) {\n\t\t\t$scrollable.find('#blocking-area').html('');\n\t\t\t$scrollable.find('#blocking-area').append(blockCommentPosition);\n\t\t} else {\n\t\t\tblockCommentPosition.appendTo(selector);\n\t\t\t$scrollable.append(selector);\n\n\t\t}\n\n\t\tvar parentContainerID = $scrollable.find(\".parentFormdemographicsForm\")\n\t\t\t\t.attr(\"id\");\n\n\t\tvar message = event.msg;\n\t\t// var message = event.msgObject;\n\t\tvar messageAndUIBinder = new MessageAndUIBinder(parentContainerID,\n\t\t\t\tmessage, AppConstants.XPaths.Appointment.MESSAGE_TYPE);\n\t\tif (messageAndUIBinder) {\n\t\t\tvar lookupHandler = appController.getComponent(\"DataLayer\").lookupHandler;\n\t\t\tmessageAndUIBinder.loadDataOntoForm(lookupHandler);\n\n\t\t\t// Update for blocked physician\n\t\t\tvar fields = \"consultant,employmentStaff\";\n\t\t\tvar type = \"II\";\n\t\t\tvar tagName = \"id\";\n\t\t\tvar pathFields = fields.split(',');\n\t\t\tif(physicianVO.physicianId){\n\t\t\t\tvar instanceObject = [ \"SUBSCRIBER_ID\",physicianVO.physicianId, null ];\n\t\t\t\tmessageAndUIBinder.writeValueToMessage(tagName, pathFields, type,\n\t\t\t\t\t\tinstanceObject);\n\t\t\t\n\t\t\t\tvar fields = \"consultant,employmentStaff,employeePerson\";\n\t\t\t\tvar type = \"PN\";\n\t\t\t\tvar tagName = \"name\";\n\t\t\t\tvar pathFields = fields.split(',');\n\t\t\t\tvar instanceObject = [ null, physicianVO.prefixName,\n\t\t\t\t\t\t physicianVO.givenName,physicianVO.familyName,\n\t\t\t\t\t\tphysicianVO.suffixName ];\n\t\t\t\tmessageAndUIBinder.writeValueToMessage(tagName, pathFields,\n\t\t\t\t\t\ttype, instanceObject)\n\t\t\t}\t\n\t\t\t// Update for effectiveTime\n\t\t\tvar fields = \"\";\n\t\t\tvar type = \"IVL_TS\";\n\t\t\tvar tagName = \"effectiveTime\";\n\t\t\tvar pathFields = fields.split(',');\n\t\t\tevent.start = CommonUtil.dateFormat(parseDate(event.start),\n\t\t\t\t\t\"fullDateTime\");\n\t\t\tevent.end = CommonUtil.dateFormat(parseDate(event.end),\n\t\t\t\t\t\"fullDateTime\");\n\t\t\tinstanceObject = [ event.start, event.end ];\n\t\t\tmessageAndUIBinder.writeValueToMessage(tagName, pathFields, type,\n\t\t\t\t\tinstanceObject);\n\t\t\tevent.start = parseDate(event.start);\n\t\t\tevent.end = parseDate(event.end);\n\t\t\tvar orgId = appController.getComponent(\"Context\").getSelectedOrganizationVO().subscriberId;\n\t\t\tmessageAndUIBinder.updateId(\"ORGANIZATION_ID\", orgId);\n\t\t\tvar blockCode = AppConstants.XPaths.Appointment.BLOCK_CODE;\n\t\t\tmessageAndUIBinder.updateId('MSG_TITLE', blockCode);\n\t\t\tmessageAndUIBinder.bindFieldEvents();\n\t\t\t$(messageAndUIBinder.parentContainerID).trigger(\"change\");\n\t\t}\n\t\t//event.msg = messageAndUIBinder.messageObject;\n\t}", "function createCodeProgressions(code_block) {\n let code_button_container = $(code_block).find(\".code-buttons\");\n\n $(code_button_container).append(createButton(\"Before\", \"before-button\"));\n $(code_button_container).append(createButton(\"After\", \"after-button\"));\n $(code_button_container).append(createButton(\"Snippets\", \"snippet-button\"));\n\n let code_buttons = $(code_block).find(\".code-buttons\").children();\n let before_code = $(code_block).find(\".before-code\");\n let after_code = $(code_block).find(\".after-code\");\n let snippet_code = $(code_block).find(\".snippet-code\");\n let code_blocks = [before_code, after_code, snippet_code]\n $(code_buttons[2]).addClass(\"selected\");\n $(code_blocks[0]).addClass(\"hidden\");\n $(code_blocks[1]).addClass(\"hidden\");\n\n $(code_buttons).click(function () {\n let button_index = Array.from(code_buttons).indexOf(this);\n let selected = $(code_block).find(\".code-buttons\").find(\".selected\");\n let selected_index = Array.from(code_buttons).indexOf(selected[0]);\n if (button_index != selected_index) {\n $(code_buttons[selected_index]).removeClass(\"selected\");\n $(code_buttons[button_index]).addClass(\"selected\");\n $(code_blocks[selected_index]).addClass(\"hidden\");\n $(code_blocks[button_index]).removeClass(\"hidden\");\n }\n })\n}", "handleButton() {}", "function moveBtn(btn) {\n var height = body.offsetHeight;\n var width = body.offsetWidth;\n var x = getRndInteger(0, width - 100);\n var y = getRndInteger(0, height - 80);\n\n btn.style.position = \"absolute\";\n btn.style.left = x + 'px';\n btn.style.top = y + 'px';\n}", "menuButtonClicked() {}", "function _clicked_ele_trigger(oEle,e)\r\n{\r\n\tif(isNaN(e))\r\n\t{\r\n\t\tvar mLeft = app.findMousePos(e)[0];\r\n\t}\r\n\telse\r\n\t{\r\n\t\tvar mLeft = e;\r\n\t}\r\n\r\n\tvar eleMaxRight = oEle.offsetWidth + app.eleLeft(oEle);\r\n\tvar eleMinRight = eleMaxRight - 16;\r\n\r\n\tif((mLeft>eleMinRight)&&(mLeft<eleMaxRight))\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "function checkAboveClick(pos) {\n if (currentPosition === PositionEnums.REACHING)\n return false;\n if (pos.y < 350 && pos.x > WIDTH / 2 - 240 && pos.x < WIDTH / 2 + 240) {\n if (currentPosition === PositionEnums.LYING || currentPosition === PositionEnums.SLEEPING)\n changePosition(PositionEnums.STANDING);\n else if (pos.y < 260)\n changePosition(PositionEnums.REACHING);\n return true;\n }\n return false;\n}", "function buttonFunctions(){\n var rootNode = getRootNode();\n var currentNode = rootNode.children[0].children[0]; // brings us to the top-left non-header node\n var updateNodeColor = function(myNode){\n currentNode.style.backgroundColor = \"yellow\";\n }\n var updateNode = function(myNode){\n if(myNode !== -1){ // Did we make a valid movement?\n currentNode = myNode; // update currentNode\n currentNode.style.border = \"3px solid black\"; // update node so it is \"selected\"\n }else{ // we did not make a valid movement - currentNode is not updated\n currentNode.style.border = \"3px solid black\"; // update node again so it is \"reselected\"\n console.log(\"Out of bounds error caught!\"); // notify user that an error has occured\n }\n }\n var checkButton = function(myButton) {\n switch(myButton){\n case \"Move Up\":\n updateNode(getNodeAbove(currentNode));\n break;\n case \"Move Down\":\n updateNode(getNodeBelow(currentNode));\n break;\n case \"Move Left\":\n updateNode(getNodeLeft(currentNode));\n break;\n case \"Move Right\":\n updateNode(getNodeRight(currentNode));\n break;\n case \"Mark Node\":\n updateNodeColor(currentNode);\n currentNode.style.border = \"3px solid black\";\n break;\n }\n };\n var buttonCall = function(myButton) {\n currentNode.style.border = \"1px solid black\"; \n checkButton(myButton);\n }\n return buttonCall;\n}", "function whichFlexModal(row, $tr) {\n\n $btnConfirmFlex1.data(\"event-id\", row.id);\n $btnConfirmFlex1.attr(\"href\", $tr.data(\"flex1-register-url\"))\n $btnConfirmFlex2.data(\"event-id\", row.id);\n $btnConfirmFlex2.attr(\"href\", $tr.data(\"flex2-register-url\"))\n $btnConfirmBoth.data(\"event-id\", row.id);\n $btnConfirmBoth.attr(\"href\", $tr.data(\"both-register-url\"))\n\n $blockConfirmModalTitle.text(row.titletext);\n\n var eventBlocks = row.blockselection.trim()\n if (eventBlocks == F1_OR_F2) {\n $btnConfirmFlex1.text(BTN_TEXT_F1);\n $btnConfirmFlex2.text(BTN_TEXT_F2);\n $btnConfirmBoth.text(BTN_TEXT_BOTH);\n $blockConfirmModalBody.html(OR_HTML);\n $btnConfirmFlex2.show();\n $btnConfirmBoth.show();\n }\n else if (eventBlocks == F1_XOR_F2) {\n $btnConfirmFlex1.text(BTN_TEXT_F1);\n $btnConfirmFlex2.text(BTN_TEXT_F2);\n $blockConfirmModalBody.html(XOR_HTML);\n $btnConfirmFlex2.show();\n $btnConfirmBoth.hide();\n }\n else if (eventBlocks == F1_AND_F2) {\n $blockConfirmModalBody.html(AND_HTML);\n $btnConfirmFlex1.text(BTN_TEXT_BOTH);\n $btnConfirmFlex2.hide();\n $btnConfirmBoth.hide();\n }\n else if (eventBlocks == FLEX1) {\n $blockConfirmModalBody.html(ONE_HTML);\n $btnConfirmFlex1.text(BTN_TEXT_F1);\n $btnConfirmFlex2.hide();\n $btnConfirmBoth.hide();\n }\n else if (eventBlocks == FLEX2) {\n $blockConfirmModalBody.html(ONE_HTML);\n $btnConfirmFlex1.hide();\n $btnConfirmFlex2.text(BTN_TEXT_F2);\n $btnConfirmBoth.hide();\n }\n else {// shouldn't get here\n console.log(eventBlocks)\n console.log(\"Block selection not understood\")\n return;\n }\n $blockConfirmModal.modal();\n}", "function positionNavigator(settings, modalBox){\n\t\t\n\t\t//Offset the clicked buttons parent is at\n\t\tvar locationOffset = settings.locationElm.offset();\n\t\t\n\t\tmodHolder.css(\"top\", locationOffset.top + settings.height);\n\t\tmodHolder.css(\"left\", locationOffset.left);\n\n\t\t//settings.width = the width of the clicked element (the button)\n\t\tvar thisOffset = modalBox.outerWidth() - settings.width;\n\t\t\t\n\t\t$(\".g_block_modal\", modHolder).css(\"margin-left\", -thisOffset);\n\t}", "function scribblePoser() {\n\tvar $elt = $(\"#poser_chooser\");\n\t$elt.click();\n}", "function canvasMouseDown(e) {\n\tblockus.mouseDown();\n}", "function showBlock(i) {\n return (<Block value={squares[i]} onClick={() => handleClick(i)}/>);\n }", "function cellClick(event) {\n // getting position of empty cell\n const emptyCell = getEmptyCell();\n const { target } = event;\n const targetClasses = target.className.split(' ');\n const position = targetClasses.find(name => /(x[1-4]y[1-4])/.test(name));\n // if block was not empty cell himself (empty cell don't have positioning class)\n if (position) {\n // position is string (e.g. x1y1) so we take x and y values from it and convert to number\n const x = Number(position[1]);\n const y = Number(position[3]);\n\n // check if clicked block is nearby empty cell\n if (\n ((x - 1 === emptyCell.x || x + 1 === emptyCell.x) && y === emptyCell.y)\n || ((y - 1 === emptyCell.y || y + 1 === emptyCell.y) && x === emptyCell.x)\n ) {\n // increase score and move clicked block to empty cell, check if game was won\n setScore(score + 1);\n target.classList.remove(position);\n target.classList.add(`x${emptyCell.x}y${emptyCell.y}`);\n checkWin();\n }\n }\n}", "function sendEvent(button, pos) {\n // self.emit('mouse', {\n // x: pos.x - 32,\n // y: pos.x - 32,\n // button: button\n // });\n if (self.vt300Mouse) {\n // NOTE: Unstable.\n // http://www.vt100.net/docs/vt3xx-gp/chapter15.html\n button &= 3;\n pos.x -= 32;\n pos.y -= 32;\n var data = '\\x1b[24';\n if (button === 0)\n data += '1';\n else if (button === 1)\n data += '3';\n else if (button === 2)\n data += '5';\n else if (button === 3)\n return;\n else\n data += '0';\n data += '~[' + pos.x + ',' + pos.y + ']\\r';\n self.send(data);\n return;\n }\n if (self.decLocator) {\n // NOTE: Unstable.\n button &= 3;\n pos.x -= 32;\n pos.y -= 32;\n if (button === 0)\n button = 2;\n else if (button === 1)\n button = 4;\n else if (button === 2)\n button = 6;\n else if (button === 3)\n button = 3;\n self.send('\\x1b['\n + button\n + ';'\n + (button === 3 ? 4 : 0)\n + ';'\n + pos.y\n + ';'\n + pos.x\n + ';'\n + (pos.page || 0)\n + '&w');\n return;\n }\n if (self.urxvtMouse) {\n pos.x -= 32;\n pos.y -= 32;\n pos.x++;\n pos.y++;\n self.send('\\x1b[' + button + ';' + pos.x + ';' + pos.y + 'M');\n return;\n }\n if (self.sgrMouse) {\n pos.x -= 32;\n pos.y -= 32;\n self.send('\\x1b[<'\n + ((button & 3) === 3 ? button & ~3 : button)\n + ';'\n + pos.x\n + ';'\n + pos.y\n + ((button & 3) === 3 ? 'm' : 'M'));\n return;\n }\n var data = [];\n encode(data, button);\n encode(data, pos.x);\n encode(data, pos.y);\n self.send('\\x1b[M' + String.fromCharCode.apply(String, data));\n }", "function click(el){\n \n \n}", "function handleBoxClick() {\n increasePoints();\n increaseSpeed();\n resetPosition();\n }", "function ShowButton(message, x, y, width, height, selection, buttonID){\n var active = selection == buttonID;\n var magicValue = 3;\n var color = active ? 'red' : 'blue';\n colorRect(x, y, width, height, color);\n var w = Math.round(width/2) - Math.round( measurePixelfont(message) / 2 );\n drawPixelfont(message, Math.round(x + w)+magicValue, Math.round( y + height/2)-3 ) ;\n\n\n //Mouse Bound Check \n if( mouseCanvasY < (y + height) && mouseCanvasY > y && mouseCanvasX < (x+width) && mouseCanvasX > x) {\n mainMenuCurrentSelection = buttonID; //note(keenan): HACK BLAH!!!\n }\n}", "function putOpenInPlaygroundButton(block, button) {\n if (!block.openButton) {\n block.iconBar.appendChild(button)\n } else {\n block.openButton.replaceWith(button)\n }\n block.openButton = button\n}", "function mousePressed() {\r\n\tstartPosX = mouseX;\r\n\tstartPosY = mouseY;\r\n\tif (positionMatchesOverlay(startPosX, startPosY)) {\r\n\t\tblockDrawing = true;\r\n\t} else {\r\n\t\tblockDrawing = false;\r\n\t}\r\n}", "function AddSign(IndexOfBlock, Block) {\n if (TypeOfSignSwitch == true && FullBlock[IndexOfBlock] == true) {\n TypeOfSignSwitch = !TypeOfSignSwitch;\n Block.innerHTML = '<i class=\"far fa-circle\"></i>';\n BlockArray[IndexOfBlock] = Sings.O;\n FullBlock[IndexOfBlock] = false;\n }\n else if (FullBlock[IndexOfBlock] == true) {\n TypeOfSignSwitch = !TypeOfSignSwitch;\n Block.innerHTML = '<i class=\"fas fa-times\"></i>';\n BlockArray[IndexOfBlock] = Sings.X;\n FullBlock[IndexOfBlock] = false;\n }\n else {\n console.log('Zajęta!!!');\n }\n CheckWin();\n}", "action(type, px, py, evt) { console.log('Action callback'); }", "renderButton() {\n if (this.props.enableEdit) {\n return (\n <div style={{ width:this.props.width }}>\n <Button\n size=\"small\"\n color=\"primary\"\n variant=\"fab\"\n disabled={!this.state.mapEditted && this.state.edittable}\n onClick={() => {\n this.setState({edittable: !this.state.edittable});\n console.log(x,y);\n console.log('in map');\n if (this.state.edittable)\n this.props.onChangePosition(x, y);\n }}\n style={{\n position: 'relative',\n bottom: this.props.height*0.4,\n left:this.props.width*0.84}}\n >\n {this.renderIcon()}\n </Button>\n </div>\n );\n }\n }", "setTileOnClick(x, y, func) {\n // bounds checking\n if (x >= 0 && x < this._width && y >= 0 && y < this._height) \n this.getTile(x, y).onClick = func;\n }", "setTileOnClick(x, y, func) {\n // bounds checking\n if (x >= 0 && x < this._width && y >= 0 && y < this._height) \n this.getTile(x, y).onClick = func;\n }", "function i(e){var t=H=e,n=t.clientX,i=t.clientY;if(Q.popperInstance){var r=Q.reference.getBoundingClientRect(),o=Q.props.followCursor,a=\"horizontal\"===o,s=\"vertical\"===o;Q.popperInstance.reference={getBoundingClientRect:function e(){return{width:0,height:0,top:a?r.top:i,bottom:a?r.bottom:i,left:s?r.left:n,right:s?r.right:n}},clientWidth:0,clientHeight:0},Q.popperInstance.scheduleUpdate()}}", "function blockPointer(){\n //highlight blocks to place/break\n let start = new THREE.Vector3();\n let end = new THREE.Vector3();\n start.setFromMatrixPosition(camera.matrixWorld);\n end.set(0,0,1).unproject(camera);//0,0 = center of screen\n var dir = new THREE.Vector3();\n dir.subVectors(end,start).normalize();\n var roundDir = roundVec(dir)\n end.copy(start);\n end.addScaledVector(dir,maxReach);//enable max reach\n let intersection = intersectWorld.intersectRay(start,end);\n if(intersection){\n //hit something, move outline to pos\n let voxid = currentVoxel;\n let posHit = intersection.position.map((v, ndx) => {\n return v + intersection.normal[ndx] * -0.5\n });\n //clamp (no in betweens)\n posHit[0] = (Math.floor(posHit[0])+.5)\n posHit[1] = (Math.floor(posHit[1])+.5)\n posHit[2] = (Math.floor(posHit[2])+.5)\n pointerBlock.position.set(posHit[0],posHit[1],posHit[2]);//set wireframe @ pos\n }\n}", "function canvasClickEvent(event){\r\n if((typeof clickeventFlag !== 'undefined') && clickeventFlag){\r\n //desactive le focus\r\n if(document.getElementById(\"tooltip\")!=null)\r\n document.getElementById(\"tooltip\").remove();\r\n clickeventFlag= false;\r\n canvasMouseEvent(event);\r\n return;\r\n }\r\n\r\n canvasMouseEvent(event);\r\n //Active le drapeau pour bloquer le tooltip\r\n clickeventFlag=true;\r\n var tooltip= document.getElementById(\"tooltip\");\r\n var doc = document.documentElement;\r\n //Position du scroll de la page\r\n var scrolltop = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);\r\n var scrollleft = (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);\r\n\r\n var mytop = tooltip.offsetTop+scrolltop;\r\n var myleft = tooltip.offsetLeft+scrollleft;\r\n\r\n tooltip.style.position=\"absolute\";\r\n tooltip.style.left = myleft+\"px\";\r\n tooltip.style.top = mytop+\"px\";\r\n var div = document.createElement(\"div\");\r\n div.innerHTML=\"Actions : <br>\";\r\n var a = document.createElement(\"a\");\r\n a.innerHTML=\"Afficher plus d'information (lot de 500)\";\r\n a.onclick=function (ev) {\r\n showLot();\r\n return false;\r\n };\r\n a.className=\"btn btn-default btn-xs\";\r\n div.appendChild(a);\r\n /*var a2 = document.createElement(\"a\");\r\n a2.innerHTML=\"Afficher plus d'information (tous)\";\r\n a2.onclick=function (ev) {\r\n showLot();\r\n return false;\r\n };\r\n a2.className=\"btn btn-default btn-xs\";\r\n div.appendChild(a2);*/\r\n tooltip.appendChild(div);\r\n}", "function indexOfClickedBlock(element) {\n while (element.className != \"block_story\") {\n element = element.parentNode;\n }\n var my = document.getElementsByClassName(\"block_story\")\n for (var i = 0; i < my.length; i++) {\n if (my[i] == element) return i;\n }\n}", "function mouseClicked(){\n // the x position will take the value of the horizontal mouse position\n xPos=mouseX;\n // the y position will take the value of the vertical mouse position\n yPos = mouseY;\n}", "_scrollButtonNearClickHandler() {\n const that = this;\n\n if (that.$.scrollButtonNear.disabled) {\n return;\n }\n\n that._scroll(-1);\n }", "function clickHandler(){ // declare a function that updates the state\n elementIsClicked = true;\n isElementClicked();\n }", "mouseUp(pt) {}", "mouseUp(pt) {}", "function frame() {\r\n let currentTop = parseInt(cookiebutton.style.top);\r\n let currentLeft = parseInt(cookiebutton.style.left);\r\n if (x >= 30) {\r\n setTimeout(animation);\r\n } else {\r\n x += 1;\r\n y = Math.sqrt(80 - Math.sqrt(x));\r\n cookiebutton.style.top = currentTop + x + \"px\";\r\n cookiebutton.style.left = currentLeft + y + \"px\";\r\n }\r\n }", "function triggerToggleButton(e) {\n $(e).parent().children(\"button\").click();\n}", "function click_gameopts()\n{\n var fast_btn = spr[sn_btn_fastgame];\n var pt = fast_btn.globalToLocal(stage.mouseX, stage.mouseY);\n if (Math.abs(pt.x) < sz(70) && Math.abs(pt.y) < sz(20)) {\n fast_play.value = !fast_play.value;\n stage.update();\n }\n}", "function survoler(contexte){\n //console.log(contexte.target.id);\n //clientX, client Y: coordonnées souris sur l'écran \n //quand je survole la banniere (#nom)? quand le buttom?\n //quel est l'element survole?\n //contexte.target\n var elementID= contexte.target.id;\n \n switch(elementID){\n case \"buttonActu\": \n refBulle.innerHTML = \"cliquer pour actualiser\";\n break;\n case \"automatiquement\": \n refBulle.innerHTML = \"cocher pour actualiser\";\n break;\n case \"labelAutour\": \n refBulle.innerHTML = \"cliquer pour cocher\";\n break;\n default:\n //refBulle.innerHTML= \"\";\n return; \n }\n //if(refBulle.innerHTML!=\"\"){\n refBulle.style.top=(parseInt(contexte.clientY) +15) + \"px\";\n //console.log(contexte.clientY);\n\n //window.innerWidth pour calculer et connaitre la tailler de l'écran\n if(contexte.clientX < window.innerWidth/2) {\n //bulle a droite\n refBulle.style.left=(parseInt(contexte.clientX)) + \"px\";\n refBulle.style.right=\"\";\n }\n else{\n //bulle a gauche\n refBulle.style.left =\"\";\n refBulle.style.right=(parseInt(window.innerWidth) - parseInt(contexte.clientX)) + \"px\";\n \n }\n refBulle.style.display = \"inline\";\n\n //cacher la boule dans 2 seconde\n window.setTimeout(cacherBulle,1000)\n}" ]
[ "0.70069075", "0.6390816", "0.6178574", "0.61248124", "0.6052308", "0.59823453", "0.58458877", "0.576432", "0.57399786", "0.57159585", "0.570172", "0.5666817", "0.56515926", "0.56508595", "0.5580216", "0.55685747", "0.55512786", "0.55323565", "0.5532082", "0.5505736", "0.5497011", "0.5487068", "0.54772824", "0.5468435", "0.5467384", "0.5445196", "0.5444909", "0.5438693", "0.5407643", "0.5403481", "0.5402623", "0.5388619", "0.53682375", "0.53619385", "0.5357076", "0.5357035", "0.53567994", "0.5353513", "0.53532636", "0.53472596", "0.53393644", "0.5314627", "0.5309802", "0.5309401", "0.5308611", "0.53028697", "0.52966166", "0.52838385", "0.52802134", "0.5279233", "0.5279092", "0.5278249", "0.52695376", "0.52647144", "0.5247355", "0.524692", "0.524322", "0.52422374", "0.5239371", "0.5237903", "0.52354306", "0.5234712", "0.5232937", "0.5232663", "0.5232092", "0.52310497", "0.52308124", "0.52304894", "0.52234256", "0.5221961", "0.5210455", "0.5205737", "0.51998895", "0.51943195", "0.5182477", "0.51804847", "0.5174859", "0.51721126", "0.51657414", "0.5163963", "0.516367", "0.5158621", "0.51533896", "0.515319", "0.5134237", "0.51342237", "0.5127821", "0.5127821", "0.51276326", "0.51218694", "0.51173246", "0.5115256", "0.51103944", "0.5104973", "0.5100616", "0.5095024", "0.5095024", "0.5093691", "0.5088784", "0.5088413", "0.5086967" ]
0.0
-1
fn(p) Parameters: p (obj) paragraph element in which text is written
onSpecialLetter(letter, fn) { this._specialLetters.push(letter); this._specialLetterFns.push(fn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function paraWithText(t) {\n let tn = document.createTextNode(t);\n let ptag = document.createElement(\"p\");\n ptag.appendChild(tn);\n return ptag;\n}", "function para(args) {\n var p;\n \n p = node(\"p\");\n p.className = args.className||\"\";\n p.innerHTML = args.text||\"\";\n\n return p; \n }", "function p(text){\n\tconsole.log(text);\n}", "function addPara(content) {\n var outputPara = document.createElement(\"p\");\n outputPara.innerHTML = content;\n output.appendChild(outputPara);\n}", "function displayParagraph(receivedText) {\n myParagraph.innerHTML = receivedText;\n}", "function p (text){\n let divAffichage = document.querySelector(\"#affichage\");\n let ajoutTexte = document.createTextNode(text);\n\n divAffichage.append(ajoutTexte);\n}", "function createText (pai,texto) { \r\n\tvar t = document.createTextNode(texto); \r\n\tpai.appendChild(t); \r\n }", "function text(str: string) {\n document.querySelector('p').textContent = str;\n}", "function handlerFn(evt){ \n para.textContent = \"custom para with id 1\";\n}", "function paragraphFunction(p_tags) {\n var html = '<div id=\"paragraphs\">';\n html += '<h1>' + \"Thanks for stopping by! Here are a few quotes :)\" + '</h1>';\n html += '<p>' + 'They say a person needs just three things to be truly happy in this world: Someone to love, something to do, and something to hope for.' + '</p>';\n html += '<p>' + \"It's so hard to forget pain, but it's even harder to remember sweetness. We have no scar to show for happiness. We learn so little from peace.\" + '</p>';\n html += '<p>' + \"It isn't what you have or who you are or where you are or what you are doing that makes you happy or unhappy. It is what you think about it.\" + '</p>';\n html += '</div>';\n\n return html;\n }", "function makeParagraph(text) {\n let element = document.createElement(\"p\");\n element.textContent = text\n return element;\n}", "function changePcontent(){\n let parapgraphs = document.querySelectorAll('div p') \n for (let i = 0; i < parapgraphs.length; i++) {\n parapgraphs[i].innerText = 'Paragraph text changed using the changePcontent function'\n }\n }", "function paragraph_changer(){\r\n\tdocument.getElementById('demo').innerHTML=\"The p-tag has been changed\"\r\n}", "function createP(text){\n const p = document.createElement('p');\n p.textContent = text;\n return p;\n}", "function outp(text) {\n\t$(\"#content\").html(text);\n}", "function addP(text, p) {\n return text + \"\\n(\" + (100 * p).toFixed(0) + \" in 100)\";\n}", "function addPara(parent, text) {\n const p = document.createElement('p');\n addText(p, text);\n parent.appendChild(p);\n return p;\n }", "function addParagraph( p_textString, p_class ) {\n //Create paragraph element\n var par = document.createElement(\"p\");\n // Bootstrap class\n par.className = p_class; \n //Add text to paragraph\n par.appendChild(document.createTextNode( p_textString ));\n //Return paragraph\n return par;\n}", "function parg(e){\n var edittext = \"Lorem ipsum dolor sit amet dolor ilet lorime aop hos hyteo sjaloe\";\n document.getElementById(\"parg\").innerHTML = edittext;\n}", "function chText() {\n\tidpar = document.getElementById(\"idPar\")\n idpar.innerHTML = \"New text for Last Paragraph.\"\n}", "function createParagraph(formResult, text) {\n const paragraph = document.createElement(\"p\");\n\n //usando o appendChild tenho um ganho em performace em comparação com o innerHTML\n paragraph.appendChild(text);\n formResult.appendChild(paragraph)\n}", "function paragraphEvent(paragraphID) {\n if (!featureEnabled) return;\n var currentParagraph = document.getElementById(paragraphID + simplifyBoxIdSuffix);\n \n if ( currentParagraph === null) {\n logger().logParagraph(simpaticoEservice, paragraphID);\n currentParagraph = document.getElementById(paragraphID);\n var text = currentParagraph.textContent ? currentParagraph.textContent : currentParagraph.innerText;//IE uses innerText\n taeCORE.getInstance().simplifyText(paragraphID, text, showSimplificationBox);\n } else {\n hideSimplificationBox(paragraphID);\n }\n }", "function print_cismapper_doc_para(id, doc_type, extra) {\n html = `<p>` + get_cismapper_doc_text(doc_type, extra) + `</p>`;\n document.getElementById(id).insertAdjacentHTML('beforeend', html);\n} // print_cismapper_doc_para", "function appendTextToElement(element, text){\n jQuery(element).append(currentDocument.createTextNode(\"\"+text));\n jQuery(element).append(currentDocument.createElement(\"br\"));\n }", "function displayPoem(string, container) {\n container.append(\"<p>\"+string+\"</p>\");\n}", "function writeTo(element, text) {\n document.getElementById(element).innerHTML = text;\n}", "function outf(text) { \n var mypre = document.getElementById(\"output\"); \n mypre.innerHTML = mypre.innerHTML + text; \n}", "function HTMLPar(textStr)\n{\n var parElem = new XMLElement('p');\n\n var textElem = new XMLText(textStr);\n\n textElem.toString = function (document, indent)\n {\n // Escape and indent the string\n return indentText(escapeXMLString(this.text, true), indent); \n };\n\n parElem.addChild(textElem);\n\n return parElem;\n}", "enterParagraph(ctx) {\n\t}", "addElementToLine(paragraph, element) {\n this.viewer.cutFromLeft(this.viewer.clientActiveArea.x + element.width);\n if (paragraph.paragraphFormat.textAlignment === 'Justify' && element instanceof TextElementBox) {\n this.splitTextElementWordByWord(element);\n }\n }", "function print(text) \n{\n outputElm.innerHTML = text.replace(/\\n/g, '<br>');\n}", "function paragraph(text) {\n function p(t) {\n t = t.replace(RegExp('(<(?:' + B + '|' + AUTO + ')(?:' + Z + '))', 'g'), '$1\\n\\n');\n t = t.replace(RegExp('(<\\/(?:' + B + '|' + AUTO + ')>)', 'g'), '\\n\\n$1');\n var tt = t.split(/(\\n\\s*){2,}/),\n oo = \"\";\n for (var i = 0, len = tt.length; i < len; ++i) {\n var s = trim(tt[i]);\n if (s.length && (s[0] !== '<' || s.match(RegExp('^<(?:' + I + ')[\\\\s>]')))) {\n s = s.replace(/\\n\\s*/g, '<br>');\n oo += '\\n<p>' + s + '</p>\\n';\n } else {\n oo += s;\n }\n }\n return fix(oo);\n }\n function fix(u) {\n var ii = AUTO.split('|');\n for (var i in ii) {\n var t = ii[i];\n u = u.replace(RegExp('<(' + t + ')(' + Z + ')\\\\n*<p(?:' + Z + ')([^\\\\n]*?)<\\\\/p>\\\\n*<\\\\/' + t + '>', 'g'), '<$1$2$3</$1>');\n }\n return u;\n }\n text = text.replace(/\\r\\n|\\r/g, '\\n') + '\\n\\n';\n text = text.replace(RegExp('\\\\s*<br(' + ZZ + ')\\\\s*', 'g'), '\\n');\n var o = [];\n text.replace(RegExp('([\\\\s\\\\S]*?)(<\\\\/?(?:' + IGNORE + '|p)(?:' + Z + ')|<!\\-\\-[\\\\s\\\\S]*?\\-\\->|$)', 'g'), function(a, b, c) {\n if (b) o.push(b);\n if (c) o.push(c);\n });\n var output = \"\",\n skip = 0;\n for (var i = 0, len = o.length; i < len; ++i) {\n var s = o[i];\n if (s.length && s[0] === '<' && s.slice(-1) === '>') {\n skip = s[1] && (s[1] === '/' || s[1] === '!') ? 0 : 1;\n output += s;\n } else {\n output += !skip ? p(s) : s;\n }\n }\n return tidy(output);\n}", "function createPElement (text, direction, idname) {\n\tvar pElement = document.createElement(\"p\");\n\tvar pElementText = document.createTextNode(text);\n\tpElement.appendChild(pElementText);\n\tif (idname != undefined) {\n\t\tpElement.id = idname;\n\t}\n\telse if (direction != undefined) {\n\t\tpElement.id = direction + day;\n\t}\n\telse {\n\t\tpElement.id = \"sentence\"\n\t}\n\tdocument.getElementById(\"story\").appendChild(pElement);\n\twindow.scrollTo(0,document.body.scrollHeight);\n}", "function textsForAnswers(index, answer, texts) {\n var copyWriting = 'p' + index + 'r' + answer;\n var tag = 'p' + index ;\n var elTag = tag.toString();\n\n $(document).ready(function(){\n document.getElementById(elTag).innerHTML = texts[copyWriting]\n });\n\n }", "function addText(element, message) {\n\tconst newPara = document.createElement('p')\n\tconst newParaText = document.createTextNode(message)\n\tnewPara.appendChild(newParaText)\n\telement.appendChild(newPara)\n}", "function addAPara(){\n $('#randPara').append('<p>CooOooOool</p>');\n}", "function $t(text,on) {\r\n var e = document.createTextNode(text);\r\n if (on) on.appendChild(e);\r\n return e;\r\n}", "function writeP(data) {\r\n var el = document.createElement(\"p\");\r\n var txtNode = document.createTextNode(data);\r\n\r\n el.appendChild(txtNode);\r\n receiveBox.appendChild(el);\r\n}", "function print(text) {\n outputElm.innerHTML = text.replace(/\\n/g, '<br>');\n}", "function createParagraph(content) {\n return createHTML(\"p\", content);\n}", "function print(text) {\n\toutputElm.innerHTML = text.replace(/\\n/g, '<br>');\n}", "function processParagraph(paragraph) {\n\t\t\t\tvar header = 0;\n\n\t\t\t\twhile (paragraph.charAt(0) == '%') {\n\t\t\t\t\t\t\t\tparagraph = paragraph.slice(1);\n\t\t\t\t\t\t\t\theader++;\n\t\t\t\t}\n\n\t\t\t\treturn {type: (header === 0 ? 'p' : 'h' + header), content: paragraph};\n}", "function PPTCloseCallback(result, target) {\r\n if (result === SP.UI.DialogResult.OK) {\r\n var range = RTE.Cursor.get_range();\r\n range.deleteContent();\r\n var selection = range.parentElement();\r\n if (!selection) {\r\n return;\r\n }\r\n\r\n //Here we take the returned value from the dialog and replace any instance of 2 consecutive line breaks with a unique comination of characters\r\n var PPT = target.replace(/[\\r\\n][\\r\\n]/g, \"|/@/|\");\r\n PPT = PPT.replace(/[\\r\\n]/g, \"<br />\");\r\n\r\n //Here we split returned value at the points where the unique comination of characters we inserted above appear\r\n //This creates an array in which every element is the content of a paragraph\r\n var paragraphsContent = PPT.split('|/@/|');\r\n var totalParagraphs = paragraphsContent.length - 1;\r\n\r\n //Here we create the array that will hold the DOM paragraph nodes\r\n //We then fill those nodes with the content from the array above\r\n var paragraphNode = new Array();\r\n paragraphNode[totalParagraphs] = selection.ownerDocument.createElement(\"p\");\r\n paragraphNode[totalParagraphs].innerHTML = paragraphsContent[totalParagraphs];\r\n\r\n //Insert the last paragraph from the array into the RTE\r\n range.insertNode(paragraphNode[totalParagraphs]);\r\n\r\n //This loop starts with the last remaining item in our array, and inserts it ahead of the element that was just inserted\r\n //It will do this until all array elements have been added, starting from the end and working backward\r\n var remainingParagraphs = totalParagraphs - 1;\r\n for (i = remainingParagraphs; i >= 0; i--) {\r\n paragraphNode[i] = selection.ownerDocument.createElement(\"p\");\r\n paragraphNode[i].innerHTML = paragraphsContent[i];\r\n paragraphNode[i + 1].parentNode.insertBefore(paragraphNode[i], paragraphNode[i + 1]);\r\n\r\n //This line is for IE.\r\n //For some reason, IE thinks it's necessary to add an empty P element after all of the elements we insert\r\n //This tests if the element we just inserted is immediately followed by an empty P element\r\n //If it is, that empty element will be removed.\r\n if ((paragraphNode[i].nextSibling.innerHTML == '&#160;') || (paragraphNode[i].nextSibling.innerHTML == '&nbsp;') || (paragraphNode[i].nextSibling.innerHTML == '')) {\r\n paragraphNode[i].parentNode.removeChild(paragraphNode[i].nextSibling);\r\n }\r\n }\r\n\r\n RTE.Cursor.get_range().moveToNode(paragraphNode[totalParagraphs]);\r\n RTE.Cursor.update();\r\n }\r\n}", "function print(text) {\n outputElm.innerHTML = text.replace(/\\n/g, '<br>');\n}", "function cText(element, content) {\r\n document.getElementById(element).innerHTML = content;\r\n}", "function readMoreInParagraph() {\n var sentence = ' Try to think about paragraphs in terms of thematic unity: a paragraph is a sentence or a group of sentences that supports one central, unified idea. Paragraphs add one idea at a time to your broader argument.';\n document.getElementsByTagName('a')[0].innerHTML = '';\n document.getElementsByTagName('p')[0].innerText += sentence;\n }", "function myText(text){\r\n document.getElementById(\"ex10-3\").innerHTML = text;\r\n}", "function addEl(par, tag, text) {\n\t\t\tvar x = document.createElement(tag);\n\t\t\tx.textContent = text;\n\t\t\tpar.appendChild(x);\n\t\t}", "function addEl(par, tag, text) {\n\t\t\tvar x = document.createElement(tag);\n\t\t\tx.textContent = text;\n\t\t\tpar.appendChild(x);\n\t\t}", "function addAPara() {\n $('#randPara').append('<p>ADDED</p>');\n}", "function updateText(elementID, text){\n \n}", "function addAPara() {\n $('#randPara').append('<p>ADDED</p>');\n\n}", "function mostrarPregunta1(texto) {\r\n document.getElementById(\"p01\").innerHTML = texto;\r\n}", "function convertFromHTMLParagraph(data){\r\n\tdata = data.replace(/<\\/p><p>/g,'\\n').replace(/<p>/g,'').replace(/<\\/p>/g,'');\t\t\r\n\tdata = $('<div />').html(data).text();\r\n\treturn data;\r\n}", "function writeToPre(text) {\n document.getElementById('info').innerHTML = text;\n}", "function generateRandomParagraph(){\n index= Math.floor(Math.random()*sizeOfArray);\n txt= paragraphs[index];\n len= txt.length;\n $('.randomParagraphGenerated').html('');\n const singleLetter= txt.split('');\n singleLetter.forEach(character=>{\n const charSpan= document.createElement('span');\n charSpan.innerText= character;\n displayUnit.appendChild(charSpan);\n })\n}", "function changePcontent() {\n let changeP = document.querySelector(\"div p\");\n changeP.innerText = \"now its changed\";\n}", "function paragraphKeyUp(p) {\n\t\t\tvar curId = p.id.substr(1);\n\t\t\tvar nextId = parseInt(curId) + 1;\n\t\t\tnextParagraph = document.getElementById('paragraph' + nextId); \n\t\n\t\t\tif(p.innerText === \"\") {\n\t\t\t\t if (nextParagraph && nextParagraph.innerText === \"\") {\n\t\t\t\t\tnextParagraph.parentNode.removeChild(nextParagraph);\n\t\t\t\t }\n\t\t\t}\n\t\t\telse if (!nextParagraph) { \n\t\t\t\tnewParagraph(\"\", nextId, document.getElementById(\"paragraph\" + curId).nextSibling);\n\t\t\t}\n\t}", "enterParagraphParameter(ctx) {\n\t}", "function ontext (text) {\n return text;\n}", "function TTextNode() {}", "function TTextNode() {}", "function TTextNode() {}", "function style_paragraph(lines, style_word) {\n var styled_text = \"\";\n\n for(i=0; i<lines.length; i++){\n var line = lines[i];\n for(j=0; j< line.length; j++){\n var word = line[j];\n styled_text += \" \" + style_word(word);\n } \n }\n \n styled_text = styled_text.substring(1, styled_text.length);\n\n return styled_text;\n}", "function changeText(value) {\ndocument.getElementById('pText').innerHTML = value;\n\n}", "function paragraph({ id, text, cls } = {}) {\n\treturn new Paragraph({ id, text, cls });\n}", "function paragraph({ id, text, cls } = {}) {\n\treturn new Paragraph({ id, text, cls });\n}", "function printResult(fn) {\n\t// *todo -- C2. Print result to the scre\n\treturn (resultParagraph.innerText = `The Result Is : ${fn}`);\n}", "function myStory(text, numDiv){\n $('<p>'+text+'</p>').appendTo(numDiv);\n }", "function processDescriptionText(doclet, p, scope){\r\n\r\n\tvar t;\r\n\tif(typeof doclet === 'string'){\r\n\t\tt = doclet;\r\n\t\t//shift argument:\r\n\t\tscope = p;\r\n\t} else {\r\n\t\tt = doclet[p];\r\n\t}\r\n\r\n\tvar isModified = false;\r\n\tvar modText;\r\n\tif (t) {\r\n\t\tmodText = expandLinks( t, scope );\r\n\t\tif(modText){\r\n\t\t\tisModified = true;\r\n\t\t\tdoclet[p] = modText;\r\n\t\t}\r\n\t}\r\n\treturn isModified;\r\n}", "function readMore() {\n\n var text1 = \"which can be used to design program how the web pages behave on the occurrence of an event. JavaScript is an easy to learn and also powerful scripting language, widely used for controlling web page behavior.\";\n\n var paragraph = document.getElementById('para');\n paragraph.innerHTML = text1;\n}", "function addText(data, target) {\n let lines = data.split('\\n');\n let text = [];\n lines.forEach(function(line) {\n text.push(`${line}<br>`)\n });\n let paragraph = `<p>${text.join('')}</p>`;\n document.querySelector(target).innerHTML = paragraph;\n}", "function change(){\n document.getElementsByTagName(\"p\")[1].innerHTML = \"new paragraph\";\n}", "function genText(el, state) {\n return el.text;\n}", "function paragraph(string) {\n // Removes ALL HTML: \n // var str = string.replace(/\\(Insert.*\\)/, \"\").replace(/<{1}[^<>]{1,}>{1}/g,\" \"); \n // Removes (Insert ...) statements \n var str = string.replace(/\\(Insert.*\\)/, \"\");\n\n // Removes certain tags and replaces them with flags for later use \n // var tags = [\"em\", \"strong\"];\n // for (var i = 0; i < tags.length; i++) {\n // var tag = tags[i];\n // var regexp = new RegExp(`<${tag}>.\\s<\\\\/${tag}>|<${tag}>[\\S]{0,1}<\\\\/${tag}>`, 'gi');\n // str.replace(regexp, `||${tag}||`);\n // }\n var options = {\n allowedTags: [ 'p', 'em', 'strong', 'sup' ],\n allowedAttributes: {\n 'sup': [\"type\"],\n },\n allowedClasses: {},\n exclusiveFilter: function(frame) {\n // return frame.tag === 'a' && !frame.text.trim();\n return !frame.text.trim();\n }\n }\n var clean = sanitizeHtml(str, options);\n return clean;\n}", "function toHtml(text) {\n text = text.replace(/\\n/g, \"</p><p>\")\n .replace(/ /g, \" &nbsp;\");\n return \"<p>\" + text + \"</p>\";\n }", "function addFunction(){\n i++;\n var paragraph = document.createElement(\"p\");\n var node = document.createTextNode(document.getElementById(\"input\").value);\n paragraph.appendChild(node);\n var element = document.getElementById(\"output\");\n element.insertBefore(paragraph,element.childNodes[i]);\n}", "function montaTexto(dado, classe) {\n var p = document.createElement(\"p\");\n p.textContent = dado;\n p.classList.add(classe);\n return p;\n}", "function text_view(text, marker_coordinates) {\n // function text_view(text) {\n var pText = document.createElement(\"p\");\n pText.innerHTML = escape_html_tags(text);\n appendBlock(pText, \"text\");\n set_block_coordinates(pText, marker_coordinates);\n}", "function log(text) {\n\tvar l = document.getElementById('log');\n\tl.innerHTML += \"<p>\" + text + \"</p>\";\n}", "function addParagraph ()\n{\n \n var task2 = document.getElementById('task2a');\n var paragraph = document.createElement('p');\n paragraph.innerText = \"Hello World\";\n task2.appendChild(paragraph);\n \n}", "function addParagraph(content){\n let div = document.querySelectorAll('div')[0]\n let addedParagraph = document.createElement('p')\n addedParagraph.innerText = \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\"\n div.appendChild(addedParagraph)\n }", "function printText(xOffset, yOffset, widthOffset, text, textSizePercent, textAlign) {\n Crafty.e(\"2D, DOM, Text\")\n .attr({x: xOffset*xviewport, y: yOffset*yviewport, w: widthOffset*xviewport})\n .text(text)\n .textFont({size: textSizePercent*xviewport + \"px\"})\n .textColor(\"#FFFFFF\")\n .css({\n \"text-align\" : textAlign\n })\n}", "function paragraphSelector () {\n return $('p');\n}", "function eltP(tag, content, className, style) {\r\n var e = elt(tag, content, className, style);\r\n e.setAttribute(\"role\", \"presentation\");\r\n return e\r\n}", "function writeText(text) {\n document.getElementById(\"fieldToComplet\").innerHTML += text + '<br>';\n }", "processInline(paragraph) {\n let obj = linepar.toObject(paragraph);\n let url = String(obj[\"url\"]);\n // get type ( html or txt );\n let lastIndex = url.lastIndexOf(\".\");\n let ext = url.substring(lastIndex + 1, url.length);\n var stringData = $.ajax({\n url: url,\n async: false\n }).responseText;\n if (ext == \"txt\") {\n this.parseText(stringData);\n }\n else {\n let div = html.Html.createElement(\"div\", \"\", \"\");\n div.innerHTML = stringData;\n this.elArray.push(div);\n }\n }", "function output(text, result) {\n\tvar outputElement = document.createElement(\"p\");\n\tvar outputText = document.createTextNode(text + result + \".\");\n\toutputElement.appendChild(outputText);\n\tvar outputBox = document.getElementById(\"result-box\");\n\toutputBox.insertBefore(outputElement, outputBox.childNodes[0]);\n}", "function mkp(value){\n return '<p>'+ value + '</p>'\n }", "function insertText() {\n\t\t\tconst addTextAgain = document.createElement(\"p\");\n\t\t\tdocument.body.appendChild(addTextAgain);\n\n\t\t\tconst textP = document.createTextNode (\"Voy en medio!\");\n\t\t\taddTextAgain.innerHTML += textP;\n}", "function sandboxAsPara(divID) {\r\n\tvar text = document.getElementById(divID).innerHTML;\r\n\tif (text.charAt(0) != '<') { return; } // already done\r\n\t$(divID).innerHTML = text.stripTags();\r\n}", "function eltP(tag, content, className, style) {\n\t\t var e = elt(tag, content, className, style);\n\t\t e.setAttribute(\"role\", \"presentation\");\n\t\t return e\n\t\t }", "print(text, id){\n if (typeof text !== \"undefined\"){\n text = String(text);\n let foo = document.createElement(\"p\");\n let bar = document.createTextNode(text);\n if(typeof id !== \"undefined\"){\n id = String(id);\n foo.setAttribute(\"id\", id);\n }\n document.body.appendChild(foo);\n foo.appendChild(bar);\n } else {\n console.log(\"print - \" + \"(\" + \" VALUE IS NULL \" + \")\");\n } // end if\n }", "function overText(x){\n x.innerText = \"created by Timothy Joe Axford II\"\n}", "function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }", "function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }", "function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }", "function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }", "function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }", "function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }", "function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }" ]
[ "0.68790555", "0.66615236", "0.65699625", "0.65561515", "0.65346223", "0.63981396", "0.6343784", "0.6320454", "0.631141", "0.63092947", "0.6303548", "0.62509185", "0.6245516", "0.6163874", "0.61385554", "0.6136865", "0.61234", "0.61076856", "0.60620725", "0.60594153", "0.60142165", "0.59618473", "0.5959567", "0.5946989", "0.5943503", "0.5913727", "0.5910811", "0.5888549", "0.5880921", "0.58797663", "0.5865393", "0.5864212", "0.5863727", "0.586108", "0.5840827", "0.58186805", "0.5814915", "0.58054835", "0.5797374", "0.5795086", "0.5790346", "0.5782346", "0.5776321", "0.57610637", "0.5760731", "0.5751302", "0.5748041", "0.5731752", "0.5731752", "0.572721", "0.5725825", "0.571471", "0.56989914", "0.56901306", "0.5682632", "0.5680689", "0.56797284", "0.56776", "0.56772536", "0.56670713", "0.5660409", "0.5660409", "0.5660409", "0.56461895", "0.5644138", "0.5642816", "0.5642816", "0.56416065", "0.5623286", "0.56179684", "0.56159914", "0.561019", "0.560274", "0.5601304", "0.55984473", "0.559495", "0.55842674", "0.5571382", "0.55695474", "0.55640775", "0.55639994", "0.5563462", "0.55626595", "0.5561897", "0.5559443", "0.5548396", "0.55468374", "0.55373013", "0.5533016", "0.55218345", "0.55182457", "0.55180997", "0.55137986", "0.5510232", "0.55062735", "0.55062735", "0.55062735", "0.55062735", "0.55062735", "0.55062735", "0.55062735" ]
0.0
-1
could make another helper function that will do the math and returns the values
function addTwoNumbershelper(ll1,ll2) { if (!ll1.next && !ll2.next) { let carryOver = Math.floor((ll1.val + ll2.val)/10); ll2.val = (ll1.val + ll2.val) % 10; return carryOver; } let returnVal = addTwoNumbershelper(ll1.next,ll2.next) let carryOver = Math.floor((ll1.val + ll2.val + returnVal)/10); ll2.val = (ll1.val + ll2.val) % 10; return carryOver; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculation(value1, value2) {\r\n let totalSum = value1 + value2 + value1*value2;\r\n let totalSum2 = value1 / value2;\r\n return [totalSum, totalSum2];\r\n}//return multiple values, using array", "function getValue(v1, v2, v3, h, l, e) {\r\n\r\n\tvar vsum = v1+v2+v3;\r\n\r\n\tvar sum = h+l+e;\r\n\r\n\tvar proz_h = (h/sum) * ((h/sum*100) - (v1/vsum*100));\r\n\r\n\tvar proz_l = (l/sum) * ((l/sum*100) - (v2/vsum*100));\r\n\r\n\tvar proz_e = (e/sum) * ((e/sum*100) - (v3/vsum*100));\r\n\r\n\treturn proz_h + proz_l + proz_e;\r\n\r\n}", "do_calculation( bunch_of_numerical_data)\n {\n var total = 0 ;\n bunch_of_numerical_data.forEach(element => {\n total += element\n });\n return total ;\n }", "function calculate(){}", "function calc (one, two, three){\n //start by declaring our new var. & whatever it is (calculation/value holder).\n let total = one + two + three;// base logic\n let average = Math.round(total/3);//clean base logic\n return average;\n}", "function calcule (param1, param2,param3,param4) {\n\nreturn param1 * param2 * param3 /param4 ; \n\n\n}", "function calc(params) {\n return 22; \n}", "function getPazymiuVidurkis2(x1,x2,x3,x4,x5){\n var atsakymas=(x1 + x2 + x3 + x4 + x5)/5;\n return atsakymas;\n}", "function calculate(rpn) {\n var v1, v2;\n var value = null;\n var values = [];\n for (var i = 0; i < rpn.length; i++) {\n value = rpn[i];\n switch (value) {\n case '+':\n v2 = values.pop();\n v1 = values.pop();\n values.push(v1 + v2);\n break;\n case '-':\n v2 = values.pop();\n v1 = values.pop();\n values.push(v1 - v2);\n break;\n case '*':\n v2 = values.pop();\n v1 = values.pop();\n values.push(v1 * v2);\n break;\n case '/':\n v2 = values.pop();\n v1 = values.pop();\n values.push(v1 / v2);\n break;\n default:\n values.push(parseFloat(value));\n }\n }\n return values[0];\n }", "function getPazymiuVidurkis2(x1,x2,x3,x4,x5){\n var pazymiuVidurkis3 = (x1+x2+x3+x4+x5)/5;\n return pazymiuVidurkis3;\n}", "function woodCalculator(value1, value2, value3) {\n var result1 = value1 * 1;\n var result2 = value2 * 3;\n var result3 = value3 * 5;\n var totalResult = result1 + result2 + result3;\n return totalResult;\n}", "function getTotal(){//basically, if we have a string of 8 + 8 - 5.2, getTotal will then evaluate it and return u a single number\n //we want to evaluate to that with getTotal similar to previous function i think\n //set totalString=inputs array and then join it together as a string\n totalString = inputs.join(\"\");\n //target our steps array and evaluate it and then return the total of it \n //to evaluate a string as a math operator, u r gonna use eval method to do that for u\n $(\"#steps\").html(eval(totalString));\n \n }", "function calculate() {\n\tgetTempBonuses();\n\tgetNumberBoonsValues();\n\tgetRelicBonuses();\n\tgetFatebondBonuses();\n\tgetCoreTraitsValues();\n\tgetAttributesValues();\n\tgetSkillsValues();\n\tgetVirtuesValues();\n\tgetBoonsDiceValues();\n\tgetPresetRolls();\n\tgetAttackBonuses();\n}", "calcVars () {}", "function getAvgValue(values) {\n // your code here\n}", "function getPazymiuVidurkis2(x1, x2, x3, x4, x5){\n var pazymiuVidurkis = (x1 + x2 + x3 + x4 + x5) / 5;\n return pazymiuVidurkis;\n}", "function calculates(a, b, c, d) {\n var rez;\n rez = (a + b + c + d) / 4;\n return rez;\n}", "getResult() {\n var nominator = 0;\n var denominator = 0;\n\n const criteriaList = [\n this.criteriaCloud,\n this.criteriaWind,\n this.criteriaHumidity,\n this.criteriaVisibility\n ]\n\n criteriaList.forEach((criteria) => {\n nominator += criteria.getScore() * criteria.weight;\n denominator += criteria.weight;\n });\n return Math.floor((nominator/denominator));\n }", "static calcValue(diceExp: string) {\n return baseBalcValue(diceExp);\n }", "function calculateWeightsAndValues(value, weight){\r\n return(value * weight)\r\n}", "function calcPowerContractValues(){\r\n\t\t$scope.energyContractKWH_Year = $scope.fhemPower.Readings.energy_contract_kWh_Year.Value;\r\n\t\t$scope.energyContractKWH_Month = $scope.energyContractKWH_Year / 12;\r\n\t\t$scope.energyContractKWH_Day = $scope.energyContractKWH_Month / moment().daysInMonth();\r\n\t\t$scope.energyContractKWH_Week = $scope.energyContractKWH_Day * 7;\r\n\r\n\t\tcalcPowerPercentToYearValues();\r\n\t}", "function calculateNumbers() {\r\n console.log(currentCalc);\r\n let finalInt;\r\n for (let x = 0; x < currentCalc.length; x+=2) {\r\n if (x == 0) {\r\n finalInt = currentCalc[x];\r\n console.log(finalInt);\r\n }\r\n switch(currentCalc[x-1]) {\r\n case \"/\":\r\n finalInt = Number(finalInt) / Number(currentCalc[x]);\r\n break;\r\n case \"*\":\r\n finalInt = Number(finalInt) * Number(currentCalc[x]);\r\n break;\r\n case \"-\":\r\n finalInt = Number(finalInt) - Number(currentCalc[x]);\r\n break;\r\n case \"+\":\r\n finalInt = Number(finalInt) + Number(currentCalc[x]);\r\n break;\r\n case \"%\":\r\n finalInt = Number(finalInt) % Number(currentCalc[x]);\r\n break;\r\n }\r\n }\r\n //let finalString = $(\"#screen-row-field2\").text() + $(\"#screen-row-field3\").text();\r\n //console.log(finalString);\r\n //finalInt = eval(finalString);\r\n //using eval is for pussies and idiots.\r\n //was also a lot more fun doing it this way.\r\n //ok so i made a mockup for an algorithm that splits operators, but i felt\r\n //it was extremely overkill, instead im going to fix the bidmas problem\r\n //by making the calculator only perform 1 calculation at a time.\r\n return finalInt;\r\n}", "function calculated (operator, a, b) {\n if (operator === '+') {\n return Math.round((a + b) * 1000000) / 1000000\n } else if (operator === '-') {\n return Math.round((a - b) * 1000000) / 1000000\n } else if (operator === '*') {\n return Math.round((a * b) * 1000000) / 1000000\n } else if (operator === '/') {\n return Math.round((a / b) * 1000000) / 1000000\n }\n }", "get abs() {\n return subrequirements.map(sub => sub.abs).reduce((a, e) => a + e, 0); \n }", "function doMath()\n\t{\n\t\treturn pixels/baseValue;\n\t}", "calc(){\n let lastIndex =\"\";\n //armazenando o ultimo operador\n this._lastOperator = this.getLastItem(true);\n\n if(this._operation.length < 3){\n let firstNumber = this._operation[0];\n this._operation =[];\n this._operation = [firstNumber, this._lastOperator, this._lastNumber];\n }\n\n //arrumando para quando o método for chamado pelo sinal de igual =\n if(this._operation.length > 3){\n\n lastIndex = this._operation.pop();\n //armazenando o ultimo número digitado na calcl\n this._lastNumber = this.getResult();\n\n }else if(this._operation.length == 3){\n //armazenando o ultimo número digitado na calcl\n this._lastNumber = this.getLastItem(false);\n }\n\n //transforma um vetor em uma string, usando um separador, qo separador é definido pelo parametro passado no método\n let result = this.getResult();\n\n if(lastIndex == \"%\"){\n result /= 100;\n this._operation = [result];\n }else{\n this._operation =[result];\n //se o ultimo index for diferente de vazio, então adiciona ele no vetor\n if(lastIndex){\n this._operation.push(lastIndex);\n }\n \n }\n this.setLastNumberToDisplay();\n \n }", "calculate(modify) {\n return this.total = [].slice.call(arguments, 1)\n .reduce((total, y) => modify(total, y), this.total);\n }", "function multiple(){\n results.value = Number(a.value) * Number(b.value);\n }", "function bottomDischargeCalculations(){\r\n\t//1. Assign 0 if input left blank\r\n\tvar assign_zero = [$bottomSpoutDiameter, $bottomSpoutLength];\r\n\t$.each(assign_zero, (index, $item) => {\r\n\t\tassignDefaultIfNull($item, 0);\r\n\t});\r\n\t\r\n\t//2. Unit MF\r\n\tmultiplyAccordingToUnit[$bottomSpoutDiameter, $bottomSpoutLength];\r\n}", "function obtainUnitValues(values){\n var ANDQUERY = ( values.indClone != undefined ) ? \"data-clone-index=\"+values.indClone : \"type='text'\",\n _identify = values.from,\n _parent = values.padre,\n _cantidad = _parent.find('#'+_identify+'_amount['+ANDQUERY+']'),\n _componentValue = values.component[ values.periodTxt ].value,\n _valorUnitario = _parent.find('#'+_identify+'_unitario['+ANDQUERY+']'),\n _valorTotalInpu = _parent.find('#'+_identify+'_total['+ANDQUERY+']'),\n _cantidadVal = ( isNaN( _cantidad.val() ) == true ) ? _cantidad.val(1) : _cantidad.val();\n\n _valorUnitario.val( fNumber.go( _componentValue ,\"COP\"));\n _valorTotal = _cantidadVal * _componentValue;\n _valorTotalInpu.val( fNumber.go( _valorTotal ,\"COP\") ).data('cost', _valorTotal);\n\n /* console.clear();\n console.error(\"componentValue\", _componentValue );\n console.error(\"ANDQUERY\", ANDQUERY );\n console.error(\"_parent\", _parent );\n console.error(\"_identify\", _identify );\n console.error(\"_cantidad\", _cantidad.val() );*/\n }", "function f(x) { //Вычисление нужной функции\n //window.alert(document.getElementById('a_1').value);\n //window.alert(Math.sin(document.getElementById('b_1').value * Math.PI * document.getElementById('c_1').value * x))\n //window.alert(document.getElementById('a_1').value * Math.sin(document.getElementById('b_1').value * Math.PI * document.getElementById('c_1').value));\n\n return (document.getElementById('a_1').value * Math.sin(document.getElementById('b_1').value * Math.PI * document.getElementById('c_1').value * x)) + (document.getElementById('a_2').value * Math.sin(document.getElementById('b_2').value * Math.PI * document.getElementById('c_2').value * x));\n}", "function cal(num1,num2,op){\n let y ;\n if(op == \"*\"){\n return duplicate(num1,num2);\n }\n else if(op == \"/\"){\n return division(num1,num2);\n }\n else if(op == \"-\"){\n y = num1.valueOf() - num2.valueOf(); \n return y.toString();\n }\n else if(op == \"+\"){\n num1 = parseFloat(num1);\n num2 = parseFloat(num2);\n y = num1+ num2;\n return y.toString();\n }\n\n }", "mapValues(n, start1, stop1, start2, stop2) {\n return ((n-start1)/(stop1-start1))*(stop2-start2)+start2;\n }", "calcula(i){\n let vP = this.arrCamisas[i].camisap*10;\n let vM = this.arrCamisas[i].camisam*12;\n let vG = this.arrCamisas[i].camisag*15;\n\n let valortotal = vP+vM+vG;\n\n return valortotal;\n }", "function computeValues() {\n\t\t\t\n\t\t\tvar scaler;\n\t\t\t// deal with loop\n\t\t\tif (repeat > 0) {\n\t\t\t\t// not first run, save last scale ratio\n\t\t\t\txFrom = xTo;\n\t\t\t\tyFrom = yTo;\n\t\t\t\tratioFrom = ratioTo;\n\t\t\t} else {\n\t\t\t\t// get the scaler using conf options\n\t\t\t\tscaler = $.pixelentity.Geom.getScaler(zoom == \"out\" ? \"fill\" : \"none\",align.w,align.h,w,h,tw,th);\n\t\t\t\txFrom = scaler.offset.w;\n\t\t\t\tyFrom = scaler.offset.h;\n\t\t\t\tratioFrom = scaler.ratio;\n\t\t\t}\n\t\t\t\n\t\t\tscaler = $.pixelentity.Geom.getScaler(zoom == \"in\" ? \"fill\" : \"none\",pan.w,pan.h,w,h,tw,th);\n\t\t\txTo = scaler.offset.w;\n\t\t\tyTo = scaler.offset.h;\n\t\t\tratioTo = scaler.ratio;\n\t\t\t\n\t\t\txPrev = 0;\n\t\t\tyPrev = 0;\n\t\t\t\n\t\t\tduration = parseFloat(normalized)*33;\n\t\t\t\n\t\t\t// reset counter\n\t\t\tcounter = 0;\n\t\t\t\n\t\t\t// update runs count\n\t\t\trepeat++;\n\t\t\t\n\t\t}", "function profit(arg){\n\nlet result = 0;\nresult = ( arg.sellPrice * arg.inventory) - (arg.costPrice * arg.inventory) ;\nresult = Math.round(result);\nconsole.log(result);\nreturn result;\n}", "function calc_power()\n {\n //military_science = parseInt(GM_getValue(\"milisci\", parseInt($('#milisci option:selected').text()).toString()));\n //magic_science = parseInt(GM_getValue(\"magisci\", parseInt($('#milisci option:selected').text()).toString());\n military_science = parseInt($('#milisci option:selected').text());\n magic_science = parseInt($('#magisci option:selected').text());\n unit_op[1][4] = 3*magic_science;\n unit_dp[1][4] = 3*magic_science;\n\n raw_op = parseInt($('#s1').text().replace(',',''))*unit_op[race-1][0] + parseInt($('#s2').text().replace(',',''))*unit_op[race-1][1] + parseInt($('#s3').text().replace(',',''))*unit_op[race-1][2] +\n parseInt($('#s4').text().replace(',',''))*unit_op[race-1][3] + parseInt($('#s5').text().replace(',',''))*unit_op[race-1][4];\n raw_dp = parseInt($('#s1').text().replace(',',''))*unit_dp[race-1][0] + parseInt($('#s2').text().replace(',',''))*unit_dp[race-1][1] + parseInt($('#s3').text().replace(',',''))*unit_dp[race-1][2] +\n parseInt($('#s4').text().replace(',',''))*unit_dp[race-1][3] + parseInt($('#s5').text().replace(',',''))*unit_dp[race-1][4] + parseInt($('#army_peasants').text().replace(',',''))*0.05;\n mod_op = Math.round(raw_op*(1 + military_science*0.1)); //*(1 + parseInt($('#experience'))*0.015)*(parseInt($('#morale'))/100);\n mod_dp = Math.round(raw_dp*(1 + military_science*0.1)); //Math.round((raw_dp*(1 + military_science*0.1) + 0.00001)*100)/100 //*(1 + parseInt($('#experience'))*0.015)*(parseInt($('#morale'))/100);\n if (in_self_city)\n {\n craw_op = parseInt($('#cityS1').text().replace(',',''))*unit_op[race-1][0] + parseInt($('#cityS2').text().replace(',',''))*unit_op[race-1][1] + parseInt($('#cityS3').text().replace(',',''))*unit_op[race-1][2] +\n parseInt($('#cityS4').text().replace(',',''))*unit_op[race-1][3] + parseInt($('#cityS5').text().replace(',',''))*unit_op[race-1][4];\n craw_dp = parseInt($('#cityS1').text().replace(',',''))*unit_dp[race-1][0] + parseInt($('#cityS2').text().replace(',',''))*unit_dp[race-1][1] + parseInt($('#cityS3').text().replace(',',''))*unit_dp[race-1][2] +\n parseInt($('#cityS4').text().replace(',',''))*unit_dp[race-1][3] + parseInt($('#cityS5').text().replace(',',''))*unit_dp[race-1][4] + parseInt($('#city_peasants').text().replace(',',''))*0.05;\n cmod_op = Math.round(craw_op*(1 + military_science*0.1)); //*(1 + parseInt($('#experience'))*0.015)*(parseInt($('#morale'))/100);\n cmod_dp = Math.round(craw_dp*(1 + military_science*0.1)); //*(1 + parseInt($('#experience'))*0.015)*(parseInt($('#morale'))/100);\n }\n }", "function calcular(a, b) {\r\n console.log(\"SUMA: \" + (a + b));\r\n console.log(\"RESTA: \" + (a - b));\r\n console.log(\"MULTIPLICACIÓN: \" + (a * b));\r\n console.log(\"DIVISIÓN: \" + (a / b));\r\n}", "function getPelnas(pajamos, mokesciai, mokesciai2){\nvar pelnas = (pajamos - (pajamos * mokesciai)) - (pajamos - (pajamos * mokesciai)) * mokesciai2;\n return pelnas;\n}", "_processCalculations(order) {\n order.forEach((cellRef) => {\n this._setCellValue(cellRef, this._calculateCellValue(cellRef, true));\n });\n\n return this.vals;\n }", "function myFunctionCalc( x, a, y) {\n\n return x a y;\n\n //var x = Number(document.getElementById(\"myNumber1\").value);\n \n \n document.getElementById(\"result\").innerHTML = x a y;\n }", "function calculate_results() {\n let e_val = 20 + r[0] - r[5] + r[10] - r[15] + r[20] - r[25] + r[30] - r[35] + r[40] - r[45];\n let a_val = 14 - r[1] + r[6] - r[11] + r[16] - r[21] + r[26] - r[31] + r[36] + r[41] + r[46];\n let c_val = 14 + r[2] - r[7] + r[12] - r[17] + r[22] - r[27] + r[32] - r[37] + r[42] + r[47];\n let n_val = 38 - r[3] + r[8] - r[13] + r[18] - r[23] - r[28] - r[33] - r[38] - r[43] - r[48];\n let o_val = 8 + r[4] - r[9] + r[14] - r[19] + r[24] - r[29] + r[34] + r[39] + r[44] + r[49];\n\n o_val = Math.round((o_val/40)*100);\n c_val = Math.round((c_val/40)*100);\n e_val = Math.round((e_val/40)*100);\n a_val = Math.round((a_val/40)*100);\n n_val = Math.round((n_val/40)*100);\n\n console.log(e_val + \" \" + a_val + \" \" + c_val + \" \" + n_val + \" \" + o_val);\n\n save_results(e_val, a_val, c_val, n_val, o_val);\n}", "function calc(value) {\n var operators = {\n '+': function(a, b) { return a + b },\n '-': function(a, b) { return a - b },\n '/': function(a, b) { return a / b },\n '*': function(a, b) { return a * b },\n };\n\n\n\n\n\n var buffer = Array.from(value);\n var num = [];\n var op = [];\n var resultTemp = 0;\n\n for (var i = 0; i < buffer.length; i++) {\n if(i === 0 || i%2===0) {\n num.push(buffer[i]);\n } else if (i===1 || i%2===1){\n op.push(buffer[i]);\n }\n }\n\n var base = num[0];\n var x = 0;\n\n for (var i = 0; i < op.length; i++) {\n if (op[i] == '*' || op[i] == '/'){\n resultTemp = operators[op[i]](num[i], num[i+1]);\n num.splice(i, 2, resultTemp);\n op.splice(i,1);\n console.log('num: ' + num + ' op: ' + op);\n }\n }\n\n var result = num.reduce(function (a,b){\n var temp = operators[op[x]](a,b);\n x++;\n return temp;\n });\n\n return Math.round( result * 100000000) / 100000000;\n}", "calc() {\n\n let last = '';\n\n this._lastOperator = this.getLastItem(true); //verifica o ultimo operador\n //a variavel e menor que tres elementos \n if (this._operation.length < 3) {\n let firstItem = this._operation[0]; //primeiro item do array e 0\n this._operation = [firstItem, this._lastOperator, this._lastNumber]; //o array fica o primeiro, o ultimo operador e o numero\n }\n //tira o ultimo se for maior que 3 itens\n if (this._operation.length > 3) {\n last = this._operation.pop();\n this._lastNumber = this.getResult();\n } else if (this._operation.length == 3) {\n this._lastNumber = this.getLastItem(false);\n }\n\n let result = this.getResult();\n\n if (last == '%') {\n result /= 100;\n this._operation = [result];\n } else {\n this._operation = [result];\n //se for diferente de vazio\n if (last) this._operation.push(last);\n }\n\n this.setLastNumberToDisplay();\n\n }", "function calculateResult(array) {\n let answer1 = array[0] * 12;\n let answerModified = turnToNumber(1);\n console.log(\"answerModified\", answerModified);\n let answer2 = (answer1 * answerModified) / 100 + answer1;\n console.log(\"answer2\", answer2);\n let terminalValue = answer2 * 2;\n console.log(\"treminalValue\", terminalValue);\n let postMV = terminalValue / 20;\n console.log(\"postMV\", postMV);\n let preMV = postMV - array[0];\n console.log(\"preMV\", preMV);\n let answerThreeModified = turnIndexToNumber(2);\n let answer3 = (answerThreeModified * 30) / 10000;\n console.log(\"answer3\", answer3);\n let answerFourModified = turnIndexToNumber(3);\n let answer4 = (answerFourModified * 25) / 10000;\n let answerFiveModified = turnIndexToNumber(4);\n let answer5 = (answerFiveModified * 15) / 10000;\n let answerSixModified = turnIndexToNumber(5);\n let answer6 = (answerSixModified * 10) / 10000;\n let answerSeventhModified = turnIndexToNumber(6);\n let answer7 = (answerSeventhModified * 10) / 10000;\n // //figure out how to make it prettier\n let answer81 = (answerSeventhModified * 100) / array[0];\n let answer8 = (answer81 * 5) / 10000;\n let answer9 = (array[8] * 5) / 10000;\n let sumOfFactors =\n answer3 + answer4 + answer5 + answer6 + answer7 + answer8 + answer9;\n let preFinalResult = sumOfFactors * preMV;\n //this is THE RESULT\n let finalResult = parseFloat(preFinalResult.toFixed(2));\n // console.log(\"sumOfFactors\", sumOfFactors)\n return finalResult;\n}", "function getValues(curvename, newtotalenergy, currentvalues) {\n let values = [];\n let scale = newtotalenergy;\n const currenttotalenergy = currentvalues.reduce((a, b) => a + b, 0);\n const numsteps = currentvalues.length;\n\n if (currenttotalenergy === 0) {\n const val = newtotalenergy / numsteps;\n values = currentvalues.map(_ => val);\n } else if (curvename === \"ACTUAL\") {\n if (currenttotalenergy !== newtotalenergy) {\n scale = newtotalenergy === 0 ? 0 : newtotalenergy / currenttotalenergy;\n } else {\n return currentvalues;\n }\n values = currentvalues.map(value => value * scale);\n } else {\n let coefs = getcoefs(curvename, numsteps);\n values = coefs.map(value => value * scale);\n }\n return values;\n}", "function woodCalculator(value1, value2, value3) {\n var totalResult = 0;\n if (value1 > 0 && value2 > 0 && value3 > 0) {\n var chair = value1 * 1;\n var table = value2 * 3;\n var bed = value3 * 5;\n totalResult = chair + table + bed;\n // return totalResult;\n }\n else {\n // var negativeResult = console.log('Negative value is not accepted');\n // totalResult = negativeResult;\n console.log('Negative value is not accepted')\n }\n return totalResult;\n}", "calculate(){\r\n \r\n switch(this.operator){//evaluate the operator \r\n case \"^\"://if the operator is ^, then use the power formula\r\n return Math.pow(this.num1,this.num2); \r\n case \"*\"://if the operator is *, multiple the two numbers\r\n return this.num1*this.num2;\r\n case \"/\"://if the operator is ^,divide the two numbers\r\n return this.num1/this.num2; \r\n case \"+\"://if the operator is ^, add the two numbers\r\n return this.num1+this.num2;\r\n case \"-\"://if the operator is ^, subtract the two numbers\r\n return this.num1-this.num2; \r\n default://else error\r\n return \"ERROR\" \r\n }\r\n }", "function addValues(num1,num2){\r\n return num1 + num2;\r\n}", "function calcSum(){\n var sum = 0;\n for (var i = 0; i < data.length ; i++) {\n if (data[i].type === 'inc') {\n sum += parseInt(data[i].value);\n\n }else if (data[i].type === 'exp') {\n sum -= parseInt(data[i].value);\n }\n }\n return sum;\n}", "function addValues(num1, num2){\r\n return num1+num2;\r\n}", "calcCurrentValues() {\n const { values, tier } = this.props;\n\n let quantity, amount, singleAmount, interval, presets;\n\n // Case 1: handle presets. Both interval and amount are changeable\n if (tier.presets) {\n presets = tier.presets.filter(p => !isNaN(p)).map(p => parseInt(p, 10));\n interval = (values && values.interval) || null;\n amount = (values && values.amount) || presets[Math.floor(presets.length / 2)];\n quantity = 1;\n } else if (tier.type === 'TICKET') {\n // Case 2: handle quantity. Can't be active at same time as presets\n quantity = (values && values.quantity) || 1;\n singleAmount = tier.amount;\n amount = tier.amount * quantity;\n } else if (tier.amount || values.amount) {\n // Case 3: nothing is changeable, comes with amount (and interval optional)\n interval = tier.interval || values.interval;\n amount = tier.amount || values.amount;\n quantity = 1;\n }\n return { interval, amount, singleAmount, quantity, presets };\n }", "function getResult(val1, val2, operation) {\n\t\tif (operation === '+') {\n\t\t\treturn val1 + val2;\n\t\t} else if (operation === '-') {\n\t\t\treturn val1 - val2;\n\t\t} else if (operation === '*') {\n\t\t\treturn val1 * val2;\n\t\t} else {\n\t\t\treturn val1 / val2;\t\n\t\t} \n\t}", "getAmount(){ \n var totalAmount = (this.gallonsRequested * this.getPrice());\n\n return totalAmount;\n }", "function questionCalculations()\r\n\t{\r\n\t\t// here, calculations for all the above variables should occur\r\n\t}", "function calculate_value()\n{\n\tvar row_val = rowCount - 1;\n\tvar total_val = 0;\n\tfor (row of document.getElementById(\"abacus-bottom\").childNodes)\n\t{\n\t\tvar col_val = 0;\n\t\tfor(bead of row.childNodes)\n\t\t{\n\t\t\tif(bead.className.includes(\"grow-space\")) break;\n\t\t\tif(bead.className.includes(\"bead\")) col_val++;\n\t\t}\n\t\ttotal_val += col_val * Math.pow(10, row_val)\n\t\trow_val --;\n\t}\n\tvar row_val = rowCount - 1;\n\tfor (row of document.getElementById(\"abacus-top\").childNodes)\n\t{\n\t\tvar col_val = 2;\n\t\tfor(bead of row.childNodes)\n\t\t{\n\t\t\tif(bead.className.includes(\"grow-space\")) break;\n\t\t\tif(bead.className.includes(\"bead\")) col_val--;\n\t\t}\n\t\ttotal_val += col_val * Math.pow(10, row_val) * 5\n\t\trow_val --;\n\t}\n\treturn total_val;\n}", "function mathsGetHarder(numOne, numTwo, numThree) {\n console.log('numOne is ' + numOne);\n console.log('numTwo is ' + numTwo);\n console.log('numThree is ' + numThree);\n var oneTimesTwo = numOne * numTwo;\n var twoOverThree = numTwo / numThree;\n var sum = numOne + numTwo + numThree;\n var results = [sum, oneTimesTwo, twoOverThree];\n return results;\n // return [sum, oneTimesTwo, twoOverThree];\n}", "calculateCal(){\n let BMR;\n BMR = (66 + (6.3*this.props.user.weight) + (12.9*this.props.user.height) - (6.8 * this.props.user.age))\n return BMR * 1.55;\n }", "function sumValues(a,b,c){\n return a + b + c;\n}", "function calcular(){\r\n num1 = parseFloat(num1);\r\n num2 = parseFloat(num2);\r\n switch(operador){\r\n case operacion.SUMAR:\r\n num1+=num2;\r\n break;\r\n case operacion.RESTAR:\r\n num1 = num1-num2;\r\n break;\r\n case operacion.MULTIPLICAR:\r\n num1*=num2;\r\n break;\r\n case operacion.DIVIDIR:\r\n num1 = (num1/num2);\r\n break;\r\n case operacion.PORTENCIA:\r\n num1 = Math.pow(num1,num2);\r\n break;\r\n }\r\n actualizarValor1();\r\n num2 = 0;\r\n actualizarValor2();\r\n}", "function getFunctionzValues(quantDec,quantRes){\n\tvar funcValues = [];\n\tvar xvalue = [];\n\n\tvar maxOrMin = (($(\"#max\").is(':checked')) ? -1 : 1);\n\n\tfor (let i = 1; i <= quantDec; i++ ) {\n\t\tvar input = $(\"input[name='valX\"+i+\"']\").val()\n\n\t\tif( input.length == 0) {\n\t\t\txvalue[i-1] = 0;\t\t\t\n\t\t} else {\n\t\t\txvalue[i-1] = parseFloat(input) * maxOrMin;\n\t\t}\n\n\t}\n\tfuncValues = xvalue ;\n\n\tfor (let i = 0; i <= quantRes; i++) {\n\t\tfuncValues.push(0);\n\t}\n\n\treturn funcValues;\n}", "processValue() {\n let processing\n const prev = parseFloat(this.prevOperand)\n const curr = parseFloat(this.currOperand)\n if(isNaN(prev) || isNaN(curr)) return\n\n switch (this.operation) {\n case '+':\n processing = prev + curr\n break\n case '-':\n processing = prev - curr\n break\n case '*':\n processing = prev * curr\n break\n case '÷':\n processing = prev / curr\n break\n default:\n return\n }\n this.currOperand = processing\n this.operation = undefined\n this.prevOperand = ''\n }", "function priceCalculation() {\n\n const bestPrice = getValue('primary-price');\n const extraMemory = getValue('extra-memory');\n const extraStorage = getValue('extra-storage');\n const fastDelivery = getValue('extra-delivery');\n const priceTotal = bestPrice + extraStorage + fastDelivery + extraMemory;\n return priceTotal;\n}", "function calcular() {\r\n console.log(\"SUMA: \" + (6 + 6));\r\n console.log(\"RESTA: \" + (6 - 6));\r\n console.log(\"MULTIPLICACIÓN: \" + (6 * 6));\r\n console.log(\"DIVISIÓN: \" + (6 / 6));\r\n}", "function calcularPromedioTemperatura(...temperaturas){\r\n\r\n let temperaturaMaxima= Math.max(...temperaturas);\r\n\r\n let temperaturaMinima =Math.min(...temperaturas);\r\n\r\n let promedio = (temperaturaMaxima+temperaturaMinima)/2;\r\n\r\n return (promedio);\r\n}", "var(arr) {\r\n let av = this.avg(arr);\r\n let sum = 0;\r\n for (let i = 0; i < arr.length; i++) {\r\n sum += parseFloat(arr[i]) * parseFloat(arr[i]);\r\n }\r\n return sum / arr.length - av * av;\r\n }", "function totalSales(totalShirtSale,totalPantSale,totalShoesSale){ \n let perShirtMRP = 100;\n let perPantMRP = 200;\n let perShoesMRP = 500;\n\n let totalShirtSalePrice = totalShirtSale * perShirtMRP;\n let totalPantSalePrice = totalPantSale * perPantMRP;\n let totalShoesSalePrice = totalShoesSale * perShoesMRP;\n let totalSalesPrice = totalShirtSale + totalPantSale + totalShoesSale;\n\n return totalSalesPrice;\n }", "function doDatShit(num1, num2, mathToDo) {\n var value = mathToDo(num1, num2);\n console.log(\"value\", value);\n output.innerHTML = value;\n return value\n}", "function calculation(oper, v, field, rc) {\r\n\t\t\t\tvar ret;\r\n\t\t\t\tswitch (oper) {\r\n\t\t\t\t\tcase \"sum\" : \r\n\t\t\t\t\t\tret = parseFloat(v||0) + parseFloat((rc[field]||0));\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"count\" :\r\n\t\t\t\t\t\tif(v===\"\" || v == null) {\r\n\t\t\t\t\t\t\tv=0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(rc.hasOwnProperty(field)) {\r\n\t\t\t\t\t\t\tret = v+1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tret = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"min\" : \r\n\t\t\t\t\t\tif(v===\"\" || v == null) {\r\n\t\t\t\t\t\t\tret = parseFloat(rc[field]||0);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tret =Math.min(parseFloat(v),parseFloat(rc[field]||0));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"max\" : \r\n\t\t\t\t\t\tif(v===\"\" || v == null) {\r\n\t\t\t\t\t\t\tret = parseFloat(rc[field]||0);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tret = Math.max(parseFloat(v),parseFloat(rc[field]||0));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\treturn ret;\r\n\t\t\t}", "function getPelnas() {\nvar pajamos = 12500;\nvar islaidos = 18500;\nvar pelnas = pajamos - islaidos;\nreturn pelnas;\n}", "function calculateValue(Calculation) {\n\t\tvar ReturnValue = 0;\n\t\tvar m;\n\t\ttry {\n\t\t\t//For each calculation in the array 'Calculation'\n\t\t\tfor (m = 0; m < Calculation.length-1; m++) {\n\t\t\t\tif (Calculation[m].charAt(1) == \"B\" || Calculation[m].charAt(1) == \"b\") {\n\t\t\t\t\t//If rest of string contains only digits then convert to boxNum and update ReturnValue\n\t\t\t\t\tif (/^\\d+$/.test(Calculation[m].substring(2))) {\n\t\t\t\t\t\tvar boxNum = parseFloat(Calculation[m].substring(2));\n\t\t\t\t\t\tswitch(Calculation[m].charAt(0)) {\n\t\t\t\t\t\t\tcase \"+\":\n\t\t\t\t\t\t\t\tif (!(Number.isNaN(parseFloat(allBoxes[boxNum].value)))) {\n\t\t\t\t\t\t\t\t\tReturnValue += parseFloat(allBoxes[boxNum].value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\tcase \"-\":\n\t\t\t\t\t\t\t\tif (!(Number.isNaN(parseFloat(allBoxes[boxNum].value)))) {\n\t\t\t\t\t\t\t\t\tReturnValue -= parseFloat(allBoxes[boxNum].value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\tcase \"/\":\n\t\t\t\t\t\t\t\tif (!(Number.isNaN(parseFloat(allBoxes[boxNum].value)))) {\n\t\t\t\t\t\t\t\t\tReturnValue /= parseFloat(allBoxes[boxNum].value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\tcase \"*\":\n\t\t\t\t\t\t\t\tif (!(Number.isNaN(parseFloat(allBoxes[boxNum].value)))) {\n\t\t\t\t\t\t\t\t\tReturnValue *= parseFloat(allBoxes[boxNum].value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tReturnValue += 0;\n\t\t\t\t\t\t} //End Switch\n\t\t\t\t\t} //End of IF in IF statement\n\t\t\t\t} else {\n\t\t\t\t\t//If string contains only digits then convert to number and update ReturnValue\n\t\t\t\t\tif (/^\\d+$/.test(Calculation[m].substring(1))) {\t\n\t\t\t\t\t\tvar numberValue = parseFloat(Calculation[m].substring(1));\n\t\t\t\t\t\tswitch(Calculation[m].charAt(0)) {\n\t\t\t\t\t\t\tcase \"+\":\n\t\t\t\t\t\t\t\tReturnValue += numberValue;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"-\":\n\t\t\t\t\t\t\t\tReturnValue -= numberValue;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"/\":\n\t\t\t\t\t\t\t\tReturnValue /= numberValue;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"*\":\n\t\t\t\t\t\t\t\tReturnValue *= numberValue;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tReturnValue += 0;\n\t\t\t\t\t\t} //End Switch\n\t\t\t\t\t} //End of IF in ELSE statement\n\t\t\t\t} //End IF ELSE\n\t\t\t} // End FOR Loop\n\t\t}\n\t\tcatch(err) {\n\t\t\t//For errors such as invalid boxNum or out of range boxNum, or invalid absolute number\n\t\t\t//Whole calculation is stopped, need to change question code\n\t\t}\n\t\t\n\t\t//Round to given number of decimal places - if not given as integer between 0 and 5, then ignored\n\t\tvar\tDecPl = Calculation[Calculation.length - 1];\n\t\tif (Number.isInteger(DecPl) && (DecPl >=0 && DecPl <=5)) {\n\t\t\tvar temp = parseFloat(ReturnValue.toFixed(DecPl));\n\t\t\tReturnValue = temp;\n\t\t}\n\t\treturn ReturnValue;\n\t}", "function MultiplicarPorDois(valor){\n return valor * 2;\n}", "function calculate() {\r\n //---- FORM VALUES ----\r\n //variables: miles_driving, average_miles_per_gallon, cost_per_gallon, hotel_cost, snacks, other_costs\r\n //Estimate Distance\r\n var miles_driving = Number($(\"#miles_driving\").val()); //YOUR CODE HERE TO GET THE VALUE\r\n console.log(\"miles_driving \" + miles_driving);\r\n //MPG\r\n var average_miles_per_gallon = Number($(\"#average_miles_per_gallon\").val()); //YOUR CODE HERE TO GET THE VALUE\r\n console.log(\"average_miles_per_gallon \" + average_miles_per_gallon);\r\n //PPG\r\n var cost_per_gallon = Number($(\"#cost_per_gallon\").val()); //YOUR CODE HERE TO GET THE VALUE\r\n console.log(\"cost_per_gallon \" + cost_per_gallon);\r\n //Hotel\r\n var hotel_cost = Number($(\"#hotel_cost\").val());\r\n console.log(\"hotel_cost \" + hotel_cost);\r\n //Snacks\r\n var snacks_cost = Number($(\"#snacks_cost\").val());\r\n console.log(\"snacks_cost \" + snacks_cost);\r\n //other_costs\r\n var other_costs = Number($(\"#other_costs\").val());\r\n console.log(\"other_costs\" + other_costs);\r\n\r\n //----- CALCULATED VALUES -----\r\n //calculate: distance / mpg\r\n var number_of_gallons = miles_driving / average_miles_per_gallon; //YOUR CODE HERE TO GET THE VALUE\r\n console.log(\"number_of_gallons\" + number_of_gallons);\r\n //calculate: total_mileage_cost = estimate distance * ppg\r\n var total_mileage_cost = number_of_gallons * cost_per_gallon; //YOUR CODE HERE TO GET THE VALUE\r\n console.log(\"total_mileage_cost \" + total_mileage_cost);\r\n\r\n\r\n var sum = total_mileage_cost + hotel_cost + snacks_cost + other_costs;\r\n\r\n alert(\"$\" + sum);\r\n }", "doCalculation() {\n const { questAPI, idAPI, timer } = this.props;\n const { difficulty } = questAPI[idAPI];\n const staticPoint = 10;\n let points = 1;\n const TRES = 3;\n switch (difficulty) {\n case \"hard\":\n points = TRES;\n break;\n case \"medium\":\n points = 2;\n break;\n default:\n points = 1;\n }\n return staticPoint + points * timer;\n }", "function pazymiuVidurkis1(x1, x2, x3, x4, x5) {\n var vidurkis = (x1 + x2 + x3 + x4 + x5) / 5;\n return vidurkis;\n}", "function giveResult(){\n\n\tif (calculation['operator'] == \"+\"){\n\t\tlet result = parseFloat(calculation['operand']) + parseFloat(calculation['operand2']);\n\t\treturn Math.round((result + Number.EPSILON) * 100) / 100;\n\t\n\t}else if (calculation['operator'] == \"-\"){\n\t\tlet result = parseFloat(calculation['operand']) - parseFloat(calculation['operand2']);\n\t\treturn Math.round((result + Number.EPSILON) * 100) / 100;\n\t\n\t}else if (calculation['operator'] == \"*\"){\n\t\tlet result = parseFloat(calculation['operand']) * parseFloat(calculation['operand2']);\n\t\treturn Math.round((result + Number.EPSILON) * 100) / 100;\n\t\n\t}else if (calculation['operator'] == \"/\"){\n\t\t\n\t\t// Dividing by 0 case\n\t\tif (calculation['operand2'] == \"0\"){\n\t\t\treturn \"XD\";\n\t\t}\n\t\tlet result = parseFloat(calculation['operand']) / parseFloat(calculation['operand2']);\n\t\treturn Math.round((result + Number.EPSILON) * 100) / 100;\n\t}\n}", "function resolver(){\n var res = 0;\n switch(operacion){\n case \"+\":\n res += parseFloat(operandoa) + parseFloat(operandob);\n break;\n case \"-\":\n res += parseFloat(operandoa) - parseFloat(operandob);\n break;\n case \"*\":\n res += parseFloat(operandoa) * parseFloat(operandob);\n break;\n case \"/\":\n res += parseFloat(operandoa) / parseFloat(operandob);\n break;\n }\n limpiar();\n resultado.innerHTML += (Math.round(res * 100) / 100).toFixed(2);;\n }", "function exam(a)\r\n{\r\n //solving fexam\r\nlet fexam = (60/100)*a\r\n//allowing access to fexam result\r\nreturn fexam\r\n\r\n}", "function calcul(a,b)\n\t\t{\n\t\treturn a+b;\n\t\t}", "compute() {\r\n let computation\r\n //parseFloat converts a string argument and converts it to a float\r\n const prev = parseFloat(this.previousOperand)\r\n const current = parseFloat(this.currentOperand)\r\n //NaN means Not a Number\r\n if (isNaN(prev) || isNaN(current)) return\r\n //here, you are matching up the values and operations buttons\r\n switch (this.operation) {\r\n case '+':\r\n computation = prev + current\r\n break\r\n case '-':\r\n computation = prev - current\r\n break\r\n case 'x':\r\n computation = prev * current\r\n break\r\n case '/':\r\n computation = prev / current\r\n break\r\n \r\n default:\r\n return\r\n }\r\n //actual computation taking place\r\n this.currentOperand = computation\r\n this.operation = undefined\r\n this.previousOperand = ''\r\n }", "function calculator(one, two, three) {\n let totalWeight = one + two + three;\n let average = Math.round(totalWeight / 3);\n return average;\n return totalWeight; //this doesn't get executed since there is another return prior getting executed first\n}", "function calculate(num1, num2) {\n var suma = returnNumberIntOrWithDecimal(num1 + num2);\n result.push(num1 + \" + \" + num2 + \" = \" + suma);\n\n var resta = returnNumberIntOrWithDecimal(num1 - num2);\n result.push(num1 + \" - \" + num2 + \" = \" + resta);\n\n var mult = returnNumberIntOrWithDecimal(num1 * num2);\n result.push(num1 + \" * \" + num2 + \" = \" + mult);\n\n var div = returnNumberIntOrWithDecimal(num1 / num2);\n result.push(num1 + \" / \" + num2 + \" = \" + div);\n}", "numberGenerator(arr1, arr2, type) {\n var str1 = \"\";\n var str2 = \"\";\n // Getting first number\n for (let i = 0; i < arr1.length; i++) {\n str1 = str1.concat(arr1[i]);\n }\n let firstFloatNumber = parseFloat(str1);\n // Getting second number\n for (let i = 0; i < arr2.length; i++) {\n str2 = str2.concat(arr2[i]);\n }\n let secondFloatNumber = parseFloat(str2);\n // Type of operation selection\n switch (type) {\n case \"+\": {\n let result = firstFloatNumber + secondFloatNumber;\n return result;\n break;\n }\n case \"-\": {\n let result = firstFloatNumber - secondFloatNumber;\n return result;\n break;\n }\n case \"*\": {\n let result = firstFloatNumber * secondFloatNumber;\n return result;\n break;\n }\n case \"/\": {\n let result = firstFloatNumber / secondFloatNumber;\n return result;\n break;\n }\n case \"%\": {\n let result = (firstFloatNumber * secondFloatNumber) / 100;\n return result;\n break;\n }\n }\n }", "static Sum(a,b) {\n //create new object, good for data + actions\n let calculation = new Calculation(a,b,Sum);\n Calculator.Calculations.push(calculation);\n return calculation.GetResults();\n }", "function getSaleValue() {\n for (var _len = arguments.length, items = new Array(_len), _key = 0; _key < _len; _key++) {\n items[_key] = arguments[_key];\n }\n\n return items.map(item => {\n if (valueMap.has(item)) return valueMap.get(item) || 0;\n\n if (item.discardable) {\n valueMap.set(item, (0, _kolmafia.mallPrice)(item) > Math.max(2 * (0, _kolmafia.autosellPrice)(item), 100) ? MALL_VALUE_MODIFIER * (0, _kolmafia.mallPrice)(item) : (0, _kolmafia.autosellPrice)(item));\n } else {\n valueMap.set(item, (0, _kolmafia.mallPrice)(item) > 100 ? MALL_VALUE_MODIFIER * (0, _kolmafia.mallPrice)(item) : 0);\n }\n\n return valueMap.get(item) || 0;\n }).reduce((s, price) => s + price, 0) / items.length;\n}", "function performCalc(numArr, operArr) {\n\n for (var i = 0; i < numArr.length; i++) {\n numArr[i] = parseFloat(numArr[i]);\n }\n\n while (operArr.length > 0) {\n for (var i = 0; i < operArr.length; i++) {\n if (operArr[i] == \"/\") {\n tempAns = numArr[i] / numArr[i + 1];\n numArr.splice(i,2, tempAns);\n operArr.splice(i,1);\n i--;\n }\n }\n for (var i = 0; i < operArr.length; i++) {\n if (operArr[i] == \"x\") {\n tempAns = numArr[i] * numArr[i + 1];\n numArr.splice(i,2, tempAns);\n operArr.splice(i,1);\n i--;\n }\n }\n for (var i = 0; i < operArr.length; i++) {\n if (operArr[i] == \"+\") {\n tempAns = numArr[i] + numArr[i + 1];\n numArr.splice(i,2, tempAns);\n operArr.splice(i,1);\n i--;\n }\n }\n for (var i = 0; i < operArr.length; i++) {\n if (operArr[i] == \"-\") {\n tempAns = numArr[i] - numArr[i + 1];\n numArr.splice(i,2, tempAns);\n operArr.splice(i,1);\n i--;\n }\n }\n }\n\n numArr[0] = Math.round(100 * numArr[0]) / 100;\n\n return numArr[0];\n\n}", "calcBetAmount() {\n let total = this.chipTotalAmount.reduce((a, b) => {\n return a + b;\n });\n return total;\n }", "function getPazymiuVidurkis2(x1, x2, x3, x4, x5) {\n var vidurkis = (x1, x2, x3, x4, x5) / 5;\n return vidurkis;\n}", "function compcalc(x){return ((42 - ((6-x)*(7-x))) / 2);}", "function exam(a)\n{\n\nlet fexam = (60/100)*a\n\n//Stores the value of \"fexam\"\nreturn fexam\n\n}", "calc() {\n let currentLast = '';\n this._lastOperator = this.getLastItem();\n\n if (this._operation.length < 3) {\n let firstItem = this._operation[0];\n this._operation = [firstItem, this._lastOperator, this._lastNumber]\n }\n\n if (this._operation.length > 3) {\n currentLast = this._operation.pop();\n this._lastNumber = this.getResult();\n } else if (this._operation.length == 3) {\n this._lastNumber = this.getLastItem(false);\n }\n\n let currentResult = this.getResult();\n if (currentLast == '%') {\n currentResult /= 100;\n this._operation = [currentLast]\n } else {\n this._operation = [currentResult];\n if (currentLast) this._operation.push(currentLast);\n }\n this.setLastNumberToDisplay();\n }", "function topFillingCalculations(){\r\n\t//1. Assign 0 if input left blank\r\n\tvar assign_zero = [$topSkirtLength, $topSpoutDaimeter, $topSpoutLength];\r\n\t$.each(assign_zero, (index, $item) => {\r\n\t\tassignDefaultIfNull($item, 0);\r\n\t});\r\n\t\r\n\t//2. Unit MF\r\n\tmultiplyAccordingToUnit[$topSkirtLength, $topSpoutDaimeter, $topSpoutLength];\r\n}", "function calc(x,y){ // A fucntion fo x and y addition\n\treturn x+y;\n}", "function calc(){\r\n\"use strict\";\r\nnumPFail = (numFail/numTotalRuns)*100;\r\nnumP0 = (num0/numTotalRuns)*100;\r\nnumP1 = (num1/numTotalRuns)*100;\r\nnumP2 = (num2/numTotalRuns)*100;\r\nnumP3 = (num3/numTotalRuns)*100;\r\nnumP4 = (num4/numTotalRuns)*100;\r\nnumP5 = (num5/numTotalRuns)*100;\r\nnumRatePSB = numTotalPSB/numTotalRuns;\r\nnumRateRML = numTotalRML/numTotalRuns;\r\n}", "function add(){\n let sumFunc = sumOfThirty(30, 2, 20)\n let divFunc = divideProductFunc(sumFunc, 10, 2)\n return divFunc \n }", "function getResult(val1, val2, operation) {\r\n\tif(operation === '+') {\r\n\t\treturn val1 + val2;\r\n\t} else if(operation === '-') {\r\n\t\treturn val1 - val2;\r\n\t} else if(operation === '*') {\r\n\t\treturn val1 * val2;\r\n\t} else if(operation === '/') {\r\n\t\treturn val1 / val2;\r\n\t}\r\n\t}", "promedio(){\n let promedio = 0;\n let i =0;\n for(let x of this._data){\n i = i++;\n promedio = promedio + x;\n }\n return promedio/i;\n }", "function exam(a)\r\n{\r\n\r\nlet fexam = (60/100)*a\r\n\r\n//Calling the value in the variable fexam\r\nreturn fexam\r\n\r\n}", "asistenciasTotalesPorDia(equipo){\n let len = equipo.length;\n let asistencia_total = [];\n let total_lunes=0;\n let total_martes=0;\n let total_miercoles=0;\n let total_jueves=0;\n let total_viernes=0;\n let total_sabado=0;\n let total_domingo=0;\n \n for (var i = 0; i <len; ++i) {\n total_lunes = total_lunes + (equipo[i].asistencia.lunes * equipo[i].factor_dias_laborados);\n total_martes = total_martes+ (equipo[i].asistencia.martes * equipo[i].factor_dias_laborados);\n total_miercoles = total_miercoles + (equipo[i].asistencia.miercoles * equipo[i].factor_dias_laborados);\n total_jueves = total_jueves + (equipo[i].asistencia.jueves * equipo[i].factor_dias_laborados);\n total_viernes = total_viernes + (equipo[i].asistencia.viernes * equipo[i].factor_dias_laborados);\n total_sabado = total_sabado + (equipo[i].asistencia.sabado * equipo[i].factor_dias_laborados);\n // total_domingo = total_domingo + (equipo[i].asistencia.domingo * equipo[i].factor_dias_laborados);\n }\n\n asistencia_total.push(total_lunes);\n asistencia_total.push(total_martes);\n asistencia_total.push(total_miercoles);\n asistencia_total.push(total_jueves);\n asistencia_total.push(total_viernes);\n asistencia_total.push(total_sabado);\n // asistencia_total.push(total_domingo);\n\n \n return asistencia_total;\n }", "function valFor(c) {\n\tswitch(c) {\n\t\tcase 0:\n\t\treturn [10,0.1,9,0.07];\n\t\tcase 1:\n\t\treturn [100,0,20,0]\n\t\tcase 2:\n\t\tcase 3:\n\t\tcase 4:\n\t\treturn [40,0.1,9,0.1]\n\t}\n}", "function calcPerim() {\n\tthis.perimetr=0;\n\tfor(key in this){\n\t\tif(checkisNum(this[key])&&key!=='perimetr'){\n\t\t\tthis.perimetr+=this[key];\n\t\t}\n\t}\n\treturn this.perimetr;\n}" ]
[ "0.69347334", "0.6865171", "0.67737347", "0.6578917", "0.64733905", "0.6374314", "0.6285968", "0.6276899", "0.627248", "0.62392217", "0.6205157", "0.6161034", "0.6138364", "0.6108401", "0.60773736", "0.60757315", "0.6068575", "0.60634595", "0.6063118", "0.6054659", "0.6038279", "0.60360914", "0.6023704", "0.6022465", "0.60159916", "0.6014745", "0.5991878", "0.59882385", "0.5975094", "0.59723103", "0.59717405", "0.59676516", "0.5967482", "0.59624785", "0.595979", "0.59580016", "0.5938351", "0.5929321", "0.592932", "0.59225786", "0.591712", "0.5915784", "0.591427", "0.5913785", "0.5912807", "0.590989", "0.589724", "0.58869296", "0.58796287", "0.58727884", "0.5871596", "0.587103", "0.5864538", "0.58643585", "0.5851344", "0.5846973", "0.5846645", "0.58459586", "0.58445626", "0.58376455", "0.5836034", "0.583515", "0.5829135", "0.5828095", "0.5819022", "0.58152765", "0.58091915", "0.5801955", "0.579987", "0.57988185", "0.57932967", "0.5790555", "0.5788841", "0.57844204", "0.5783547", "0.5781672", "0.57800716", "0.5760432", "0.5759457", "0.5756435", "0.5755955", "0.5753685", "0.5752307", "0.5750982", "0.5750931", "0.5748751", "0.57424426", "0.574195", "0.5737457", "0.5732207", "0.57272404", "0.57241756", "0.57216114", "0.5720414", "0.5719436", "0.571879", "0.5710312", "0.57093126", "0.57084996", "0.570756", "0.5703525" ]
0.0
-1
Test if a URL is valid
function isValidUrl(url) { // Try and create a URL object // If it TypeErrors we know it's invalid try { new URL(url); return true; } catch (e) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static valid_url(value) {\n if (!value) return false;\n\n // check for illegal characters\n if (/[^a-z0-9:/?#[\\]@!$&'()*+,;=.\\-_~%]/i.test(value)) return false;\n\n // check for hex escapes that aren't complete\n if (/%[^0-9a-f]/i.test(value)) return false;\n if (/%[0-9a-f](:?[^0-9a-f]|$)/i.test(value)) return false;\n\n return this.check_url_fragments(value);\n }", "isValidUrl (url) {\n if (!url) {\n return false;\n }\n return new RegExp('^(https?:\\/\\/)?(.+)\\.(.+)').test(url);\n }", "function isValidUrl(url) {\n result = true;\n\n try {\n new URL(url);\n }\n catch (err) {\n result = false;\n }\n return result;\n}", "function urlIsValid(url) {\n let regEx = /^https?:\\/\\/(\\S+\\.)?(\\S+\\.)(\\S+)\\S*/;\n return regEx.test(url);\n}", "function isValidURL(url) {\n return URL_PATTERN.test(url);\n}", "function valid_url(url) {\n\tvar reg =/^([\\x20-\\x21]|[\\x23-\\x5b]|[\\x5d-\\x7e])*$/;\n\tif (!reg.test(url)) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "function isUrlValid(userInput) {\n\t var res = userInput.match(/(http(s)?:\\/\\/.)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/g);\n\t if(res == null)\n\t return false;\n\t else\n\t return true;\n\t}", "function validateInput(url) {\n if (url == null) {\n return false;\n } else {\n const regex = new RegExp(/^https?:\\/\\/\\S*$/);\n return regex.test(url);\n }\n}", "function check_url(address) {\n const parsed = url.parse(address);\n if (parsed.protocol === null) {\n // This is not a URL, should be used as a file name\n return null;\n }\n // Check whether we use the right protocol\n if (['http:', 'https:'].includes(parsed.protocol) === false) {\n throw new Error(`Only http(s) url-s are accepted (${address})`);\n }\n // Run through the URL validator\n const retval = validUrl.isWebUri(address);\n if (retval === undefined) {\n throw new Error(`The url ${address} isn't valid`);\n }\n // Check the port\n if (parsed.port !== null && Number.parseInt(parsed.port, 10) <= 1024) {\n throw new Error(`Unsafe port number used in ${address} (${parsed.port})`);\n }\n // Don't allow local host in a CGI script...\n // (In Bratt's python script (<http://dev.w3.org/2004/PythonLib-IH/checkremote.py>) this step was much\n // more complex, and has not yet been reproduced here...\n if (parsed.hostname === 'localhost' || parsed.hostname === '127.0.0.1') {\n throw new Error(`Localhost is not accepted in ${address}`);\n }\n // If we got this far, this is a proper URL, ready to be used.\n return retval;\n}", "function validateURL(url) {\n var urlRegex = /^(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$/;\n return urlRegex.test(url);\n}", "function httpURLValidate(url) {\r\n\tlet urlObj = require('url').parse(url);\r\n\tlet protocols = ['http:', 'https:'];\r\n\r\n\treturn (!!~protocols.indexOf(urlObj.protocol) &&\r\n\t\t\t\t\t!!urlObj.slashes &&\r\n\t\t\t\t\t!!urlObj.host.match(/\\w+\\.{1,}\\w+/));\r\n}", "function isValidUrl(url) {\n\t\tvar uriRE = /(^https?:\\/\\/)?[a-z0-9~_\\-\\.]+(\\.[a-z]{2,9})?(\\/|:|\\?[!-~]*)?$/i;\n\t\treturn uriRE.test(url);\n\t}", "function validURL(str) {\r\n var pattern = new RegExp('^(https?:\\\\/\\\\/)?'+ // protocol\r\n '((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|'+ // domain name\r\n '((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))'+ // OR ip (v4) address\r\n '(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*'+ // port and path\r\n '(\\\\?[;&a-z\\\\d%_.~+=-]*)?'+ // query string\r\n '(\\\\#[-a-z\\\\d_]*)?$','i'); // fragment locator\r\n return !!pattern.test(str);\r\n }", "function isValidUrl(url) {\n let validUrl = \"https?:\\\\/\\\\/(www\\\\.)?[-a-zA-Z0-9@:%._\\\\+~#=]{1,256}\\\\.[a-zA-Z0-9()]{1,6}\\\\b([-a-zA-Z0-9()@:%_\\\\+.~#?&//=]*)\";\n let regex = new RegExp(validUrl);\n\n if (url.match(regex)) {\n return true\n } else {\n return console.log(\"nul\")\n }\n }", "function isValidURL(url) {\n var res = url.match(/(http(s)?:\\/\\/.)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/g);\n return (res !== null)\n}", "function validateURL(value) {\n var regexp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\n return regexp.test(value);\n}", "validURL(str) {\n var pattern = new RegExp('^(https?:\\\\/\\\\/)?'+ // protocol\n '((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|'+ // domain name\n '((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))'+ // OR ip (v4) address\n '(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*'+ // port and path\n '(\\\\?[;&a-z\\\\d%_.~+=-]*)?'+ // query string\n '(\\\\#[-a-z\\\\d_]*)?$','i'); // fragment locator\n return !!pattern.test(str);\n }", "function isValidUrl(url) {\n var result = validate({website: url}, {\n \twebsite: {\n \t url: {\n allowLocal: true,\n schemes: ['ftp','http','https', 'ws', 'wss']\n }\n }\n });\n if(result === undefined)\n \treturn { result: true };\n else\n \treturn { result: false, message: result['website'][0] };\n}", "function isUrlValid(url) {\n return /^(https?|s?ftp):\\/\\/(((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:)*@)?(((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?)(:\\d*)?)(\\/((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)+(\\/(([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)*)*)?)?(\\?((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)|[\\uE000-\\uF8FF]|\\/|\\?)*)?(#((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)|\\/|\\?)*)?$/i.test(url);\n}", "function isValidURL(url)\r\n{\r\n var RegExp = /^(([\\w]+:)?\\/\\/)?(([\\d\\w]|%[a-fA-f\\d]{2,2})+(:([\\d\\w]|%[a-fA-f\\d]{2,2})+)?@)?([\\d\\w][-\\d\\w]{0,253}[\\d\\w]\\.)+[\\w]{2,4}(:[\\d]+)?(\\/([-+_~.\\d\\w]|%[a-fA-f\\d]{2,2})*)*(\\?(&?([-+_~.\\d\\w]|%[a-fA-f\\d]{2,2})=?)*)?(#([-+_~.\\d\\w]|%[a-fA-f\\d]{2,2})*)?$/;\r\n if(RegExp.test(url))\r\n\t{\r\n return true;\r\n }\r\n\telse\r\n\t{\r\n return false;\r\n }\r\n}", "function validURL(str) {\n var pattern = new RegExp('^(https?:\\\\/\\\\/)?' + // protocol\n '((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|' + // domain name\n '((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))' + // OR ip (v4) address\n '(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*' + // port and path\n '(\\\\?[;&a-z\\\\d%_.~+=-]*)?' + // query string\n '(\\\\#[-a-z\\\\d_]*)?$', 'i'); // fragment locator\n return !!pattern.test(str);\n}", "function validURL(str) {\n var pattern = new RegExp('^(https?:\\\\/\\\\/)?' + // protocol\n '((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|' + // domain name\n '((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))' + // OR ip (v4) address\n '(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*' + // port and path\n '(\\\\?[;&a-z\\\\d%_.~+=-]*)?' + // query string\n '(\\\\#[-a-z\\\\d_]*)?$', 'i'); // fragment locator\n return !!pattern.test(str);\n}", "function checkUrl(url)\n {\n //regular expression for URL\n var pattern = /^(http|https)?:\\/\\/[a-zA-Z0-9-\\.]+\\.[a-z]{2,4}/;\n\n if(pattern.test(url)){\n return true;\n } else {\n return false;\n }\n }", "function validateIsURL(string) {\n var res = string.match(/(http(s)?:\\/\\/.)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/g);\n return (res !== null);\n }", "function isValidUrl(s) {\n\tvar regexp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\n\treturn regexp.test(s);\n}", "function validateURL(url) {\n splitURL = url.split(\"/\").filter(Boolean);\n if (splitURL.length !== 5) {\n return false;\n }\n if (!splitURL[0].match('http')) {\n return false;\n }\n if (splitURL[1] !== 'www.meetup.com') {\n return false;\n }\n if (splitURL[3] !== 'events') {\n return false;\n }\n if (isNaN(parseInt(splitURL[4]))) {\n return false;\n }\n return true;\n}", "function validateUrl(value)\n{\n\tvar url = value.toLowerCase();\n\tvar urlReg = /^(https?:\\/\\/)?.+\\..+$/i;\n\treturn urlReg.test(url);\n}", "function validURL(str) {\n var pattern = new RegExp(\n \"^(https?:\\\\/\\\\/)?\" + // protocol\n \"((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|\" + // domain name\n \"((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))\" + // OR ip (v4) address\n \"(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*\" + // port and path\n \"(\\\\?[;&a-z\\\\d%_.~+=-]*)?\" + // query string\n \"(\\\\#[-a-z\\\\d_]*)?$\",\n \"i\"\n ); // fragment locator\n return !!pattern.test(str);\n}", "function validateUrl(valUrl) {\n \n var regex = /(http|https):\\/\\/(\\w+:{0,1}\\w*)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%!\\-\\/]))?/;\n if(!regex .test(valUrl)) {\n console.log(\"Please enter valid URL!!\");\n } else {\n console.log(\"Great, the url is valid! \" + valUrl);\n makeShortUrl(valUrl);\n }\n }", "validURL(str) {\n var pattern = new RegExp('^(https?:\\\\/\\\\/)?'+ // protocol\n '((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|'+ // domain name\n '((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))'+ // OR ip (v4) address\n '(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*'+ // port and path\n '(\\\\?[;&a-z\\\\d%_.~+=-]*)?'+ // query string\n '(\\\\#[-a-z\\\\d_]*)?$','i'); // fragment locator\n return !!pattern.test(str);\n }", "function isValidUrl(str: string): boolean {\n const isRelative = str.indexOf('://') === -1;\n try {\n new URL(str, isRelative ? 'http://example.com' : undefined);\n return true;\n } catch (_) {\n return false;\n }\n}", "function is_valid_url(str) {\n\tvar urlPattern = /\\b((?:https?:\\/\\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?������]))/i;\n\t if(!urlPattern.test(str)) { \n\t return false;\n\t } else {\n\t return true;\n\t }\n\t}", "function validateUrl(value){\n if(value){ //if value isn't null\n if(/https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/.test(value)){ //use regex to see if all the characters are between a to z or A to Z\n return {isValid: true, error: null, details: null};\n }\n return {isValid: false, error: 'Must be valid url', details: '\"'+value+'\" is NOT a valid URL. A url should in https://www.example.com format.'};\n }\n return {isValid: true, error: null, details: null};\n}", "function ValidURL(str) {\n var pattern = new RegExp(/^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$/i); if(!pattern.test(str)) {\n return false;\n } else {\n return true;\n }\n}", "function isValidHttpUrl(string) {\n\tlet url;\n\t\n\ttry {\n\t url = new URL(string);\n\t} catch (_) {\n\t return false; \n\t}\n \n\treturn url.protocol === \"http:\" || url.protocol === \"https:\";\n}", "function isValidURL(url) {\n if (url.search(/['\",]/) != -1) { // we have , ' \" in the URL\n return false;\n }\n var regx = RegExp(\"^\\\\w\\\\w+:/.*|file:.*|mailto:.*|vfs:.*\");\n if (!(url.match(regx))) {\n return false;\n }\n return true;\n}", "function isValidHttpUrl(string) {\r\n let url;\r\n\r\n try {\r\n url = new URL(string);\r\n } catch (_) {\r\n return false;\r\n }\r\n\r\n return url.protocol === \"http:\" || url.protocol === \"https:\";\r\n}", "function validURL(str) {\n var regexp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\n return regexp.test(str);\n}", "function ValidURL(str) {\n\t\t\tvar pattern = /(http(s)?:\\/\\/.)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/g\n\t\t\treturn pattern.test(str)\n\t\t}", "function isURL(input) {\n let res = isString(input);\n if (res !== true) {\n return \"Not a URL > \" + res;\n }\n res = validator.isURL(input);\n if (!res) {\n return \"Not a URL > \" + input;\n }\n return true;\n}", "function vpb_url_validated(url)\n{\n\tvar vpb_url_exp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/;\n\tif(vpb_url_exp.test(url)) { return true; }\n\telse { return false; }\n}", "function isUrl(url) {\n\n return !!(url.match(/^http(s)?:\\/\\/\\S+$/));\n \n}", "function checkArticleUrl(articleUrl) {\n if (validUrl.isUri(articleUrl)) {\n return true;\n } else {\n return false;\n }\n}", "validateUrl(value) {\n \t\treturn /^(?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#]\\S*)?$/i.test(value);\n\t}", "function isValidURL (urlString) {\n let valid = false\n if (isSupportedProtocol(urlString) || isExtraProtocol(urlString)) valid = true\n return valid\n}", "function isValidURL(url) {\n if(String(url) !== url) return false\n const regex = /(https?:\\/\\/)?(www\\.)?\\w{2,}(\\.\\w{2,}){1,}/g,\n didMatch = url.match(regex)\n return Array.isArray(didMatch)\n}", "function checkURL(str) {\n var pattern = /[-a-zA-Z0-9@:%_\\+.~#?&//=]{2,256}\\.[a-z]{2,4}\\b(\\/[-a-zA-Z0-9@:%_\\+.~#?&//=]*)?/gi;\n return pattern.test(str)\n }", "function isValidURL(field) {\n\tvar bBad;\n\t\n\tbBad = false;\n\t\n\t\n\tif ((field.value.substring(0,7).toLowerCase() != \"http://\") && (field.value.substring(0,8).toLowerCase() != \"https://\")){\n\t\tbBad = true;\n\t}\t\n\t\n\tif ( ((field.value.substring(0,7).toLowerCase() == \"http://\") && (field.value.length < 8)) || ( (field.value.substring(0,8).toLowerCase() == \"https://\") && (field.value.length < 9)) ){\n\t\tbBad = true;\n\t}\t\n\t\n\tif (bBad == false) {\n\t\tfor (i=0;i<field.value.length;i++){\n\t\t\tvar strTemp = field.value.charCodeAt(i);\n\t\t\tif (strTemp == 32) {\t\t\t\n\t\t\t\tbBad = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\t\n\t}\n\t\n\tif (bBad == true) {\n\t\talert('The URL is invalid. The URL must start with either http:// or https:// and no spaces are allowed. Please enter a valid URL.');\n\t\tfield.focus();\n\t\treturn false;\n\t}\n\t\n\treturn true;\n}", "function internal_isValidUrl(iri) {\n const iriString = internal_toIriString(iri);\n // If the runtime environment supports URL, instantiate one.\n // If the given IRI is not a valid URL, it will throw an error.\n // See: https://developer.mozilla.org/en-US/docs/Web/API/URL\n /* istanbul ignore if [URL is available in our testing environment, so we cannot test the alternative] */\n if (typeof URL !== \"function\") {\n // If we can't validate the URL, do not throw an error:\n return true;\n }\n try {\n // const here is needed to avoid a \"no-new\" warning:\n const url = new URL(iriString);\n return true;\n } catch (_a) {\n return false;\n }\n}", "function validateURL(urlToTest) {\n\n const protocolString = \"http://\";\n let charToCheck = [];\n charToCheck = urlToTest.split('');\n\n if(charToCheck[3] === 'p' && charToCheck[4] === ':'){\n return urlToTest;\n }else {\n return protocolString + urlToTest;\n }\n\n}", "function isURL(s) {\n return /^(http|https):/.test(s)\n}", "function get_valid_URL(string){\n try {\n return new URL(string).href\n } catch (_) {\n return false;\n }\n}", "function validateURL(textval) {\n // regex modified from https://github.com/jquery-validation/jquery-validation/blob/c1db10a34c0847c28a5bd30e3ee1117e137ca834/src/core.js#L1349\n var urlregex = /^(?:(?:(?:https?):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})).?)(?::\\d{2,5})?(?:[/?#]\\S*)?$/i;\n return urlregex.test(textval);\n}", "function isValidUrl(url,obligatory,ftp)\n{\n // Si no se especifica el paramatro \"obligatory\", interpretamos\n // que no es obligatorio\n if(obligatory==undefined)\n obligatory=0;\n // Si no se especifica el parametro \"ftp\", interpretamos que la\n // direccion no puede ser una direccion a un servidor ftp\n if(ftp==undefined)\n ftp=0;\n\n if(url==\"\" && obligatory==0)\n return true;\n\n if(ftp)\n var pattern = /^(http|https|ftp)\\:\\/\\/[a-z0-9\\.-]+\\.[a-z]{2,4}/gi;\n else\n var pattern = /^(http|https)\\:\\/\\/[a-z0-9\\.-]+\\.[a-z]{2,4}/gi;\n\n if(url.match(pattern))\n return true;\n else\n return false;\n}", "function validURI(uri) {\n return uri.match(/^(http|ftp)s?:\\/\\/[\\w.-]+\\.\\w+(\\/.*)?/);\n}", "function chkUrl(url, pattern) {\n\n if (!pattern) {\n pattern = /^(http|https)?:\\/\\/[a-zA-Z0-9-\\.]+\\.[a-z]{2,4}/;\n } else {\n pattern = /^[a-z0-9-_]/;\n }\n\n return (pattern.test(url)) ? true : false;\n}", "function get_valid_URL(string) {\n try {\n return new URL(string).href;\n } catch (_) {\n return false;\n }\n}", "function invalidURL(consoleurl) {\n var pattern = new RegExp(/^(?:(?:https?|ftp):\\/\\/)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:\\/\\S*)?$/);\n if (pattern.test(consoleurl)) {\n return false\n } else {\n return true\n }\n}", "function isUrl(string) {\n\t\treturn isUrlRegex.test(string);\n\t}", "function is_url(str) {\n\t\treturn starts_with(str, 'http://') || starts_with(str, 'https://') || starts_with(str, '//');\n\t}", "isUrl(value) {\n return new RegExp(\n \"^(https?:\\\\/\\\\/)?((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*(\\\\?[;&a-z\\\\d%_.~+=-]*)?(\\\\#[-a-z\\\\d_]*)?$\"\n ).test(String(value).toLowerCase());\n }", "function checkUrl(url) {\n if ((url.match(DOC_REGEX) != null) &&\n (url.match(DOC_REGEX) != undefined) &&\n (url.match(DOC_REGEX)[0] == url)) {\n return true;\n }\n return false;\n}", "validateUrl(url) {\n return !!url && !!url.trim();\n }", "isImageUrlValid(url) {\n var http = new XMLHttpRequest();\n http.open('HEAD', url, false);\n http.send();\n //302 is the code from unspash.com specifically for valid image URLs\n if (http.status != 0) {\n return true;\n }\n return false;\n }", "function URLCheck(text) \n{\n var urlRegex =/(\\b(https?|ftp|file):\\/\\/[-A-Z0-9+&@#\\/%?=~_|!:,.;]*[-A-Z0-9+&@#\\/%=~_|])/ig;\n if(urlRegex.test(text))\n {\n \treturn true;\n }\n else\n {\n \treturn false;\n }\n}", "function isURL(url) {\r\n\r\n // If no phone number or wrong value gets passed in (or nothing is passed in), immediately return false.\r\n if(typeof url === 'undefined') return null;\r\n if(typeof url !== 'string') return false;\r\n\r\n // Get phone number parts\r\n var urlParts = url.split(':');\r\n\r\n // Name the parts\r\n var part1 = urlParts[0];\r\n var part2 = urlParts[1];\r\n\r\n // === Validate the parts === \\\\\r\n\r\n var validCharsSet1 = 'https';\r\n var validCharsSet2 = '/';\r\n\r\n //validating part1\r\n var flag = 0; //flag for http/https\r\n\r\n if(part1.length != 4 && part1.length != 5) {\r\n alert(\"Invalid string length before : sign\");\r\n return false;\r\n }\r\n\r\n for(var i = 0; i < part1.length; i += 1) {\r\n if(url.charAt(i) === validCharsSet1.charAt(i)) {\r\n flag = 1;\r\n }\r\n else {\r\n alert(\"Its netiher HTTP nor HTTPS\");\r\n return false;\r\n }\r\n }\r\n\r\n for(var i = 0; i < 2; i += 1) {\r\n if(validCharsSet2.indexOf(url.charAt(i+part1.length+1)) < 0) {\r\n console.log(url.charAt(i+part1.length));\r\n alert(\"Invalid character after : sign\");\r\n return false;\r\n }\r\n }\r\n\r\n //validating part 2\r\n for(var i = 0; i < 2; i += 1) {\r\n if(validCharsSet2.indexOf(url.charAt(i+part1.length+1)) < 0) {\r\n alert(\"Invalid character after : sign\");\r\n return false;\r\n }\r\n }\r\n\r\n if(flag === 1) {\r\n alert(\"This string looks like a URL\");\r\n return true;\r\n }\r\n}", "function validate_url_address(value) {\n var patt = /^(?:https?|s?ftp|telnet|ssh|scp):\\/\\/(?:(?:[\\w]+:)?\\w+@)?(?:(?:(?:[\\w-]+\\.)*\\w[\\w-]{0,66}\\.(?:[a-z]{2,6})(?:\\.[a-z]{2})?)|(?:(?:25[0-5]\\.|2[0-4][0-9]\\.|1[0-9]{2}\\.|[0-9]{1,2}\\.)(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\.){2}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})))(?:\\:\\d{1,5})?(?:\\/(~[\\w-_.])?)?(?:(?:\\/[\\w-_.]*)*)?\\??(?:(?:[\\w-_.]+\\=[\\w-_.]+&?)*)?$/i;\n return patt.test(value);\n}", "function validate_websiteUrl(input_url) {\n\tvar res = input_url.match(/(http(s)?:\\/\\/.)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/g);\n\tif (res == null) return false;\n\telse return true;\n}", "function isurl(theurl) {\n\treturn /^\\s*https?:\\/\\/.+$/.test(theurl);\n}", "function isUrl(line) {\r\n\tif (line != null) {\r\n\t\tif (line.search('http')==0) return true;\r\n\t}\r\n\treturn false;\r\n}", "function isUrl(string) {\n var regexp = /^(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\n return regexp.test(string);\n }", "function isURL( string )\n {\n \tvar substr1;\n \tvar substr2;\n \t\n \tsubstr1 = string.substr( 0, 5 );\n \tsubstr2 = string.substr( 0, 6 );\n \t\n \tif ( substr1 == \"http:\" || substr2 == \"https:\" )\n \t\treturn true;\n \telse\n \t\treturn false;\n }", "function isURL(url){\n\n var regexp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\n return regexp.test(url);\n /*var pattern='|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i';\n if(preg_match(pattern, url) > 0) return true;\n else return false;*/\n }", "function isExternalUrl(url) {\n return protocolReg.test(url);\n }", "function isValidUrl(url, allowRelative) {\n if (!url || typeof url !== 'string') {\n return false;\n }\n // RFC 3986 (http://tools.ietf.org/html/rfc3986#section-3.1)\n // scheme = ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n var protocol = /^[a-z][a-z0-9+\\-.]*(?=:)/i.exec(url);\n if (!protocol) {\n return allowRelative;\n }\n protocol = protocol[0].toLowerCase();\n switch (protocol) {\n case 'http':\n case 'https':\n case 'ftp':\n case 'mailto':\n case 'tel':\n return true;\n default:\n return false;\n }\n }", "function isUrl(s) {\r\n\tvar regexp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/i;\r\n\treturn regexp.test(s);\r\n}", "function checkURL(url) {\n return url.match(/\\.(jpeg|jpg|gif|png)$/) != null;\n}", "function validateURI(uri) {\n return uri.slice(-4) === '.xml' || /^http_{3}/.test(uri);\n}", "function isValidUrl(url, allowRelative) {\n if (!url) {\n return false;\n }\n // RFC 3986 (http://tools.ietf.org/html/rfc3986#section-3.1)\n // scheme = ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n var protocol = /^[a-z][a-z0-9+\\-.]*(?=:)/i.exec(url);\n if (!protocol) {\n return allowRelative;\n }\n protocol = protocol[0].toLowerCase();\n switch (protocol) {\n case 'http':\n case 'https':\n return true;\n default:\n return false;\n }\n}", "function isUrl(s) {\n var urlRegex = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\n return urlRegex.test(s);\n}", "function isURL(str){\n\t\tif(typeof str === 'string'){\n\t\t\tif(str.indexOf('http') >= 0) return true;\n\t\t}\n\t\treturn false;\n\t}", "function checkUrl(field, rules, i, options) {\n //regular expression for URL\n var regex = /([\\d\\w]+?:\\/\\/)?([\\w\\d\\.\\-]+)(\\.\\w+)(:\\d{1,5})?(\\/\\S*)?/;\n //Match Reguler expression with user input data\n if (!regex.test(field.val())) {\n ///Show Message if Invalid Information\n return \"Please Enter Valid URL.\"\n }\n}", "function verifyValidCodeforcesURL(url) {\n\tif (url.includes(\"https://codeforces.com\") || url.includes(\"http://codeforces.com\")) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "function is_url(str) {\n let regexp = /^(?:(?:https?|ftp):\\/\\/)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:\\/\\S*)?$/;\n if (regexp.test(str)) {\n return true;\n } else {\n return false;\n }\n }", "function isURL(url) {\n const regex = /^(?:(?:https?|ftp):\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))\\.?)(?::\\d{2,5})?(?:[/?#]\\S*)?$/i\n return string.regex(regex)(url)\n}", "_notValidURL() {\n toast.mostrar(\"Doesn't look like a valid URL 😕\", {color: '#fff', fondo: '#fe4440'});\n }", "function isUrl(s)\n{\n var regexp = /(http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\n return regexp.test(s);\n}", "function isUrl(url) {\n return /^(https?|s?ftp):\\/\\/(((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:)*@)?(((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?)(:\\d*)?)(\\/((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)+(\\/(([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)*)*)?)?(\\?((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)|[\\uE000-\\uF8FF]|\\/|\\?)*)?(#((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)|\\/|\\?)*)?$/i.test(url);\n}", "function isUrl(s){\n\tvar testFor =new Array(\"http\",\"https\",\"ftp\",\"ftps\",\".com\",\".net\",\".org\",\".edu\",\".gov\",\".int\",\".mil\",\".biz\",\".info\",\".jobs\",\n\t\".mobi\",\".name\",\"@\");\n\tfor (i=0;i<testFor.length;i++)\n\t{\n\t \tif (s.indexOf(testFor[i])!= -1)\n\t \t{\n\t \t\treturn true;\n\t \t}\n\t}\n\treturn false;\n}", "function isValidUrl(url, allowRelative) {\n if (!url) {\n return false;\n }\n // RFC 3986 (http://tools.ietf.org/html/rfc3986#section-3.1)\n // scheme = ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n var protocol = /^[a-z][a-z0-9+\\-.]*(?=:)/i.exec(url);\n if (!protocol) {\n return allowRelative;\n }\n protocol = protocol[0].toLowerCase();\n switch (protocol) {\n case 'http':\n case 'https':\n case 'ftp':\n case 'mailto':\n case 'tel':\n return true;\n default:\n return false;\n }\n}", "function isValidUrl(url, allowRelative) {\n if (!url) {\n return false;\n }\n // RFC 3986 (http://tools.ietf.org/html/rfc3986#section-3.1)\n // scheme = ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n var protocol = /^[a-z][a-z0-9+\\-.]*(?=:)/i.exec(url);\n if (!protocol) {\n return allowRelative;\n }\n protocol = protocol[0].toLowerCase();\n switch (protocol) {\n case 'http':\n case 'https':\n case 'ftp':\n case 'mailto':\n case 'tel':\n return true;\n default:\n return false;\n }\n}", "function isValidImageURL(image_url) {\n return /^(?:\\w+:)?\\/\\/([^\\s\\.]+\\.\\S{2}|localhost[\\:?\\d]*)\\S*$/.test(image_url);\n}", "function isInternalUrl(url){return /^(https?:|\\/\\/|mailto:|tel:)/.test(url)===false;}", "ValidateUrl() {\n let isYtRegex = /www\\.youtube\\.com\\/watch\\?v=/;\n\n if(isYtRegex.test(this.ActiveTabData.url)) {\n console.log(\"Url validation - success\");\n return true;\n }\n\n console.log(\"Url validation - fail\");\n return false;\n }", "function isUrlError(ob) {\t\r\n\tob.style.fontWeight = 'normal';\r\n\tob.style.backgroundColor='#FFFFFF';\r\n\tvar url = ob.value = trim(ob.value);\r\n\tif (url.length < 1) return true;\r\n\tif (!isUrl(url)) {\r\n\t\talert('Sorry, but the web address you entered \"'+url+'\" does not appear to be a proper URL (e.g., http://google.com). Please fix it and try again.');\r\n\t\tob.style.fontWeight = 'bold';\r\n\t\tob.style.backgroundColor = '#FFB7BE';\r\n\t\tsetTimeout(function () { ob.focus() }, 1);\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function checkUrl(){\n // get hash the URL\n var hash = window.location.hash;\n // check if something is in the hash\n if (hash){\n var splitted = hash.split(\"/\");\n if (splitted.length == 3){\n var zoom = parseInt(splitted[0].substr(1)),\n lat = parseFloat(splitted[1]),\n lng = parseFloat(splitted[2]);\n // check if parameters are within the swiss createBounds and the allowed zoom levels\n if (zoom >= config.min_zoom && zoom <= config.max_zoom &&\n lat >= config.swiss_bounds[0] && lat <= config.swiss_bounds[2] &&\n lng >= config.swiss_bounds[1] && lng <= config.swiss_bounds[3]\n ){\n return true\n }\n }\n error.showError('Ungültiger Weblink!');\n return false\n }\n else{\n return false\n }\n }", "function isUrl(str) {\n return isString(str) && !!str.match(/^((https?|ftp|rtsp|mms):\\/\\/)(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?(([0-9]{1,3}\\.){3}[0-9]{1,3}|([0-9a-z_!~*'()-]+\\.)*([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\\.[a-z]{2,6}|localhost)(:[0-9]{1,4})?((\\/?)|(\\/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+\\/?)$/i);\n }", "function isURL(string){\n\treturn /((?:(http|https|Http|Https|rtsp|Rtsp):\\/\\/(?:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,64}(?:\\:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,25})?\\@)?)?((?:(?:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}\\.)+(?:(?:aero|arpa|asia|a[cdefgilmnoqrstuwxz])|(?:biz|b[abdefghijmnorstvwyz])|(?:cat|com|coop|c[acdfghiklmnoruvxyz])|d[ejkmoz]|(?:edu|e[cegrstu])|f[ijkmor]|(?:gov|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(?:info|int|i[delmnoqrst])|(?:jobs|j[emop])|k[eghimnrwyz]|l[abcikrstuvy]|(?:mil|mobi|museum|m[acdghklmnopqrstuvwxyz])|(?:name|net|n[acefgilopruz])|(?:org|om)|(?:pro|p[aefghklmnrstwy])|qa|r[eouw]|s[abcdeghijklmnortuvyz]|(?:tel|travel|t[cdfghjklmnoprtvwz])|u[agkmsyz]|v[aceginu]|w[fs]|y[etu]|z[amw]))|(?:(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[0-9])))(?:\\:\\d{1,5})?)(\\/(?:(?:[a-zA-Z0-9\\;\\/\\?\\:\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])|(?:\\%[a-fA-F0-9]{2}))*)?(?:\\b|$)/gi.test(string);\n}", "function isUrl(str) {\n return isString(str) && !!str.match(/^((https?|ftp|rtsp|mms):\\/\\/)(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?(([0-9]{1,3}\\.){3}[0-9]{1,3}|([0-9a-z_!~*'()-]+\\.)*([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\\.[a-z]{2,6}|localhost)(:[0-9]{1,4})?((\\/?)|(\\/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+\\/?)$/i);\n }", "function isURL(t)\n{\n // detect strings that look like URLs or filenames\n prot = new RegExp(\"^(http://|https://|ftp://)([\\\\-a-z0-9]+\\\\.)*[\\\\-a-z0-9]+\" +\n \"|^[a-z]:($|\\\\\\\\)\" +\n \"|^\\\\\\\\\\\\\\\\[a-z0-9]+($|\\\\\\\\($|[a-z0-9]+($|\\\\\\\\)))\", \"i\");\n if (prot.exec(t))\n return t;\n\n // detect strings that look like DNS names\n dns = new RegExp(\"^www\\.([\\\\-a-z0-9]+\\\\.)+[\\\\-a-z0-9]+(/\\\\S*)?$\" +\n \"|^([\\\\-a-z0-9]+\\\\.)+(com|net|org|edu|gov|mil|[a-z]{2})(/\\\\S*)?$\", \"i\");\n if (dns.exec(t))\n {\n t = \"http://\" + t;\n return t;\n }\n return false;\n}" ]
[ "0.8212457", "0.81672513", "0.81602883", "0.8061537", "0.7998464", "0.79887223", "0.79749054", "0.79209757", "0.78805083", "0.7863487", "0.78495777", "0.7833165", "0.7812309", "0.78092265", "0.779994", "0.77716887", "0.77540344", "0.7736699", "0.77102196", "0.7686806", "0.7680812", "0.7680812", "0.7672438", "0.7671178", "0.76568633", "0.76500803", "0.7635494", "0.76344377", "0.7633753", "0.7629361", "0.760588", "0.75842565", "0.7583892", "0.75805384", "0.75731367", "0.75633234", "0.75489974", "0.75383973", "0.751432", "0.7501618", "0.74980944", "0.74396855", "0.7426751", "0.74143636", "0.7384142", "0.7378377", "0.7361571", "0.73579115", "0.7350177", "0.7324651", "0.7311351", "0.730965", "0.7306201", "0.72785294", "0.7270145", "0.7268907", "0.7256458", "0.72402203", "0.7202185", "0.7185331", "0.7180239", "0.7146461", "0.714499", "0.71363765", "0.7131607", "0.71270734", "0.7115793", "0.71000206", "0.7093278", "0.7081065", "0.70798635", "0.7074839", "0.7071517", "0.70671034", "0.7048218", "0.7038714", "0.70278245", "0.7026618", "0.7022771", "0.70131004", "0.7008", "0.70037925", "0.69857365", "0.697809", "0.697081", "0.6964784", "0.6962072", "0.6960088", "0.6956578", "0.69528794", "0.69528794", "0.69463974", "0.69328237", "0.6924555", "0.69223064", "0.69164836", "0.69090056", "0.69074035", "0.68909866", "0.6888631" ]
0.82583463
0
helper functions for connectedCallback
initPhysProps(attr) { if (this.hasAttribute(attr) && this.getAttribute(attr) == 'true') { this[attr] = 'true'; this.button.classList.add(attr); } else { this[attr] = 'false'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "connectedCallback(){}", "connectedCallback()\n\t{\n\n\t}", "connectedCallback () {\n\n }", "connectedCallback() {\n //\n }", "connectedCallback() {\n \n }", "connectedCallback() {\n }", "connectedCallback(){\r\n }", "connectedCallback(){\r\n }", "connectedCallback() {\n }", "connectedCallback() {\n }", "connectedCallback() {\n\t\t// super.connectedCallback()\n\t}", "attachedCallback() { self.connectedCallback() }", "connectedCallback(){super.connectedCallback()}", "connectedCallback() {\n if (!this.isConnected) return;\n super.connectedCallback();\n \n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback(){\n console.log(\"vua co 1 cai meme dc tao \");\n }", "connectedCallback() {\n console.log(\"Connected Callback called\")\n }", "connectedCallback () {\n this.log_('connected');\n this.connected_ = true;\n }", "attachedCallback() {\r\n this.connectedCallback()\r\n }", "beforeConnectedCallbackHook(){\n\t\t\n\t}", "connectedCallback() {\n // Using this pattern as it seems that the component\n // is immune to overriding connectedCallback at runtime.\n // Most probably the browser keeps a reference to connectedCallback\n // existing/defined at the time of upgrading and calls that one instead of the\n // latest (monkey patched / runtime evaluated) one.\n // Now, we can monkey patch onConnectedCallback if we want.\n this._onConnectedCallback();\n }", "connectedCallback() {\n this.connected = true;\n this.init();\n }", "connectedCallback() {\n this.connected = true;\n this.init();\n }", "connectedCallback() {\n super.connectedCallback();\n this.initializeFun();\n }", "attachedCallback() {\n this.connectedCallback();\n }", "connected() {\n // implement if needed\n }", "connectedCallback() {\n this.setAttributes();\n super.connectedCallback();\n }", "disconnectedCallback () {\n\n }", "disconnectedCallback () {}", "disconnectedCallback() { }", "disconnectedCallback () {\n }", "disconnectedCallback(){\n\t\t\t\n\t\t}", "connected() {}", "disconnectedCallback() {}", "disconnectedCallback() {}", "disconnectedCallback(){super.disconnectedCallback()}", "disconnectedCallback(){super.disconnectedCallback()}", "disconnectedCallback(){}", "disconnectedCallback(){}", "disconnectedCallback(){}", "disconnectedCallback() {\n\n }", "disconnectedCallback() {\n\n }", "disconnectedCallback() {\n //\n }", "disconnectedCallback() {\n }", "disconnectedCallback() {\n }", "disconnectedCallback() {\n }", "disconnectedCallback() {\n }", "afterConnect() {}", "afterConnect() {}", "disconnectedCallback(){\n \n }", "disconnectedCallback(){\n \n }", "disconnectedCallback(){\n \n }", "disconnectedCallback() {\n \n }", "connectedCallback()\n\t{\n\t\tthis.updateAccountInfo(this._mInfo);\n\t}", "disconnectedCallback()\n\t{\n\n\t}", "disconnectedCallback()\n\t{\n\n\t}", "disconnectedCallback()\n\t{\n\n\t}", "disconnectedCallback()\n\t{\n\n\t}", "disconnectedCallback() {\n }", "disconnectedCallback() {\n }", "connectedCallback() {\n this.subscribeToMessageChannel();\n }", "connectedCallback() {\n super.connectedCallback?.();\n\n /* istanbul ignore next */\n if (this.reset) {\n this.#addReset();\n }\n }", "connectedCallback() {\n\t\tif (skyMapVerbose) {\n\t\t\tconsole.log(\"connectedCallback invoked\");\n\t\t}\n\t}", "connectedCallback() {\n this._update();\n }", "function connected( connection ) {\n}", "connectedCallback() {\n super.connectedCallback();\n LocalizationHelper.onStringsUpdated(this.handleLocalizationChanged);\n LocalizationHelper.onDirectionUpdated(this.handleDirectionChanged);\n }", "connectedCallback() {\n this.subscribeToMessageChannel();\n }", "connectedCallback() {\n this.connected = true;\n\n if (this.needToInit) {\n this.init();\n }\n }", "disconnectedCallback() {\n // nop\n }", "connectedCallback() {\n // Detect super?\n if (this.addEvents) this.addEvents();\n }", "function callback(){}", "connectedCallback() {\n // Callback function to be passed in the subscribe call after an event is received.\n // This callback prints the event payload to the console.\n // A helper method displays the message in the console app.\n var self = this;\n const messageCallback = function(response) {\n self.onReceiveEvent(response);\n };\n // Subscribe to the channel and save the returned subscription object.\n subscribe(this.channelName, -1, messageCallback).then(response => {\n this.subscription = response;\n });\n }", "connectedCallback() {\n this.parseParams();\n this.parseHeaders();\n this.generateData();\n }", "disconnectedCallback() {\r\n console.log('disconnectedCallback called')\r\n }", "connectedCallback() {\n\t\tif (this.parentNode.sequenceAdd) {\n\t\t\tthis.parentNode.sequenceAdd(this);\n\t\t}\n\t}", "onClientConnected(callback) {\n this.connCallback = callback;\n }", "disconnectedCallback() {\n super.disconnectedCallback();\n }", "connected() {\n event();\n }", "disconnectedCallback() {\n console.log('disconnectedCallback called')\n }", "connectedCallback () {\n // This allows the elements to be detatched/reattached without losing\n // handlers.\n this._listeners.forEach(([evt, f]) => this.addEventListener(evt, f));\n\n // Allows element to be detatched and reattached while automatically cleaning up\n // on eventual deletion.\n this._mutationObservers.forEach(([o, target, conf]) => o.observe(target, conf));\n }", "function connectCallback(){\n\t\tconsole.log('connected');\t\t\n\t\tvar subscription = client.subscribe(\"/fx/prices\", \n\t\t\t function( message ) {\n onCallBack(message)\n }\n\t\t);\n\t}", "connectedCallback() {\n super.connectedCallback();\n this.addEventListener(this._leaveEvent, this._iStateOnLeave);\n this.addEventListener(this._valueChangedEvent, this._iStateOnValueChange);\n this.initInteractionState();\n }", "onConnect(callback) {\n const callbackId = this.__internal.addConnectCallback(callback)\n const self = this\n return () => self.removeConnectCallback(callbackId)\n }", "disconnectedCallback () {\n console.log('disconnected')\n }", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "onConnection(delegate) {\n this.connected = delegate\n }" ]
[ "0.84261596", "0.8314686", "0.81911165", "0.8189821", "0.8189266", "0.81177", "0.8093153", "0.8093153", "0.80819744", "0.80819744", "0.80140436", "0.7949497", "0.7862404", "0.7635698", "0.75514764", "0.75514764", "0.75514764", "0.75514764", "0.75514764", "0.75514764", "0.75514764", "0.75514764", "0.75514764", "0.75514764", "0.75514764", "0.75514764", "0.7539692", "0.74850225", "0.7430172", "0.74142563", "0.73922926", "0.73768294", "0.73054504", "0.73054504", "0.7286311", "0.7256507", "0.710828", "0.7060588", "0.7037234", "0.7027612", "0.7024562", "0.70201707", "0.6997399", "0.69904304", "0.6965034", "0.6965034", "0.6947474", "0.6947474", "0.6927165", "0.6927165", "0.6927165", "0.69248515", "0.69248515", "0.69028825", "0.6890927", "0.6890927", "0.6890927", "0.6890927", "0.6882896", "0.6882896", "0.68414843", "0.68414843", "0.68414843", "0.6830529", "0.6813342", "0.6797638", "0.6797638", "0.6797638", "0.6797638", "0.6789559", "0.6789559", "0.6758209", "0.67498887", "0.6747966", "0.67358375", "0.6651784", "0.66201943", "0.66180634", "0.6600594", "0.6555375", "0.6549928", "0.65214247", "0.64967245", "0.6495197", "0.64858073", "0.64698505", "0.64677835", "0.6405181", "0.6401643", "0.6398038", "0.6387981", "0.6385716", "0.6380361", "0.63650763", "0.63625515", "0.6343774", "0.6343774", "0.6343774", "0.6343774", "0.6343774", "0.63383985" ]
0.0
-1
Helper function for attributeChangedCallback
classNameSwitch(attr, value) { if (value == "false") { this.button.classList.remove(attr); } else { this.button.classList.add(attr); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "attributeChangedCallback() { }", "attributeChangedCallback(name, old, value) {}", "attributeChangedCallback(name, old, value) {}", "attributeChangedCallback(/*attr, oldValue, newValue, namespace*/) {\n\t}", "attributeChangedCallback(attrName, oldVal, newVal) {\n }", "attributeChangedCallback(attrName, oldValue, newValue) {}", "attributeChangedCallback(attr, oldVal, newVal) {}", "attributeChangedCallback(attr, oldVal, newVal) {}", "attributeChangedCallback(attr, oldVal, newVal) {}", "attributeChangedCallback(attr, oldVal, newVal) {}", "attributeChangedCallback(name, oldValue, newValue) {\n // do stuff\n }", "attributeChangedCallback(e,t,n){t!==n&&this._attributeToProperty(e,n)}", "attributeChangedCallback(attributeName, oldValue, newValue) {\n if (attributeName === '???') {\n // handle changes to an attribute\n\n }\n }", "attributeChangedCallback(attributeName, oldValue, newValue, namespace) {\r\n console.log(`attributeChangedCallback ${attributeName} ${oldValue} ${newValue} ${namespace}`)\r\n }", "onAttributeChangedCallback(name, oldValue, newValue) {\n const attrDef = this.definition.attributeLookup[name];\n\n if (attrDef !== void 0) {\n attrDef.onAttributeChangedCallback(this.element, newValue);\n }\n }", "attributeChangedCallback(attributeName, oldValue, newValue, namespace) {\n console.log(`attributeChangedCallback ${attributeName} ${oldValue} ${newValue} ${namespace}`)\n }", "attributeChangedCallback(name, oldValue, newValue) {\n // Update the attribute internally\n this[name] = newValue;\n // Update the component\n this.updateComponent();\n }", "attributeChangedCallback(name, oldValue, newValue) {\n // Update the attribute internally\n this[name] = newValue;\n // Update the component\n this.updateComponent();\n }", "attributeChangedCallback(name, oldValue, newValue) {\n //this._who = newValue; this is handled by WebComponent decorator\n this._updateRendering();\n }", "attributeChangedCallback(name,old,value){if(old!==value){this._attributeToProperty(name,value);}}", "attributeChangedCallback(name,old,value){if(old!==value){this._attributeToProperty(name,value)}}", "attributeChangedCallback(attrName, oldVal, newVal) {\n console.log('value change', attrName, 'old:', oldVal, 'new ', newVal);\n }", "attributeChangedCallback (name, oldVal, newVal) {\n console.log('attributeChangedCallback', name, newVal);\n this[name] = newVal;\n }", "attributeChangedCallback(name, old, value) {\n if (old !== value) {\n this._attributeToProperty(name, value);\n }\n }", "attributeChangedCallback(name, old, value) {\n if (old !== value) {\n this._attributeToProperty(name, value);\n }\n }", "attributeChangedCallback(name, old, value) {\n if (old !== value) {\n this._attributeToProperty(name, value);\n }\n }", "attributeChangedCallback(name, old, value) {\n if (old !== value) {\n this._attributeToProperty(name, value);\n }\n }", "attributeChangedCallback(name, oldVal, newVal) {\n console.info(`AttributeChangedCallback called for | ${name} |.`)\n switch (name) {\n case 'rainbow':\n this.updateStyle(this);\n break;\n case 'lang':\n this.updateLang(this, newVal);\n break;\n }\n }", "attributeChangedCallback(key, o, n) {\n // assign attribute changes based on key\n this[`set${key}`](n)\n }", "attributeChangedCallback(name, oldValue, newValue) {\n this.input_[name] = newValue;\n }", "attributeChangedCallback(name, oldVal, newVal) {\n if (oldVal !== newVal) {\n this[name] = newVal;\n }\n }", "attributeChangedCallback(attr, oldVal, newVal) {\n // Cambios de acuerdo a lo que exista en los atributos\n if(oldVal !== newVal) {\n this[attr] = newVal;\n }\n }", "attributeChangedCallback(attr, oldVal, newVal) {\n console.log('inside attributeChangedCallback', 'attr:', attr, 'oldVal:', oldVal, 'newVal:', newVal);\n if (attr === 'value') {\n this.value = newVal;\n }\n }", "attributeChangedCallback(attribute, old, newVal){\n if(old !== newVal){\n this[attribute] = newVal\n }\n }", "attributeChangedCallback(name2, _old, value) {\n this._$attributeToProperty(name2, value);\n }", "attributeChangedCallback(name, oldValue, newValue) {\n let newPropertyValue;\n if (this._doNotSyncAttributes.has(name)) {\n // This attribute is mutated internally, not by the user\n return;\n }\n const properties = this.constructor.getMetadata().getProperties();\n const realName = name.replace(/^ui5-/, \"\");\n const nameInCamelCase = (0, _StringHelper.kebabToCamelCase)(realName);\n if (properties.hasOwnProperty(nameInCamelCase)) {\n // eslint-disable-line\n const propData = properties[nameInCamelCase];\n const propertyType = propData.type;\n let propertyValidator = propData.validator;\n if (propertyType && propertyType.isDataTypeClass) {\n propertyValidator = propertyType;\n }\n if (propertyValidator) {\n newPropertyValue = propertyValidator.attributeToProperty(newValue);\n } else if (propertyType === Boolean) {\n newPropertyValue = newValue !== null;\n } else {\n newPropertyValue = newValue;\n }\n this[nameInCamelCase] = newPropertyValue;\n }\n }", "attributeChangedCallback(name, oldValue, newValue) {\n this._src = newValue;\n this._update();\n }", "attributeChangedCallback(attribute, oldVal, newVal) {\n\t\tnewVal = __autoCast(newVal);\n\n\t const _attribute = attribute;\n\n\t // process the attribute to camelCase\n\t attribute = __camelize(attribute);\n\n\t // do nothing if the value is already the same\n\t if (this.props[attribute] === newVal) return;\n\n\t // when the prop is false\n\t // and the element has not this attribute\n\t // we assume that the prop will stay to false\n\t if (this.props[attribute] === false\n\t\t && ! this.hasAttribute(_attribute)) {\n\t\t return;\n\t }\n\n\t // if there's no new value but that the element has\n\t // the attribute on itself, we assume the newVal\n\t // is equal to true\n\t if ( ! newVal\n\t\t && newVal !== 0\n\t\t // && ! this.props[attribute]\n\t\t && newVal !== 'false'\n\t\t && newVal !== 'null'\n\t\t && this.hasAttribute(_attribute)\n\t ) {\n\t\t this.setProp(attribute, true);\n\t\t return;\n\t }\n\n\t // update the props\n\t const val = __autoCast(newVal);\n\n\t // set the new prop\n\t this.setProp(attribute, val);\n\t}", "attributeChangedCallback(attrName, oldVal, newVal) {\n\t\tif (skyMapVerbose) {\n\t\t\tconsole.log(\"attributeChangedCallback invoked on \" + attrName + \" from \" + oldVal + \" to \" + newVal);\n\t\t}\n\t\tswitch (attrName) {\n\t\t\tcase \"width\":\n\t\t\t\tthis._width = parseInt(newVal);\n\t\t\t\tbreak;\n\t\t\tcase \"height\":\n\t\t\t\tthis._height = parseInt(newVal);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t\tthis.repaint();\n\t}", "attributeChangedCallback(attrName, oldValue, newValue) {\n if (oldValue !== newValue) {\n const propName = kebabToCamelCase(attrName);\n if (this.getAttribute(attrName) === \"\") {\n this[propName] = true;\n } else {\n this[propName] = this.getAttribute(attrName);\n }\n }\n }", "attributeChangedCallback(attrName, oldVal, newVal) {\n this.render();\n }", "attributeChangedCallback(attrName, oldVal, newVal) {\n this.render();\n }", "attributeChangedCallback(attrName, oldVal, newVal) {\n this.currentCount = newVal;\n this.update();\n }", "attributeChangedCallback() {\n this._checkbootstrap(this.shadowRoot);\n this.updateButtonValue();\n }", "attributeChangedCallback(name, oldValue, newValue) {\n console.log(\"Attribute changed to: \" + newValue);\n if (name == 'lat') this.lat = newValue;\n if (name == 'lng') this.lng = newValue;\n if (name == 'zoom') this.zoom = parseInt(newValue);\n }", "attributeChangedCallback(name, oldValue, newValue) {\n if (oldValue === newValue) {\n return;\n }\n if (name === 'text') {\n this._tooltipText = newValue;\n }\n }", "attributeChangedCallback(name, oldValue, newValue) {\n this[name] = newValue;\n this._render();\n }", "attributeChangedCallback(name, oldValue, newValue) {\n this.displayName = newValue;\n }", "attributeChangedCallback(name, oldValue, newValue){//nombre del atrubuto del componente, valor antiguo y nuevo del atributo del componente\n //switch para ejecutar codigo en base a que atributo esta recibiendo datos\n switch(name){\n case \"nombre\":\n this.nombre = newValue; //pasamos el nuevo valor al atributo de la clase\n break;\n case \"apellido\":\n this.apellido = newValue;\n break;\n }\n }", "attributeChangedCallback(name, oldValue, newValue) {\n switch (name) {\n case 'valid-from':\n this._update();\n break;\n }\n }", "attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'expanded') {\n if (Boolean(this.flagAttributeIsTruthy(newValue)) === Boolean(this.expanded)) return;\n }\n oldValue !== newValue && (this[name] = newValue);\n }", "attributeChangedCallback(name, oldValue, newValue) {\n if (!this.isConnected) return;\n super.attributeChangedCallback(name, oldValue, newValue);\n }", "attributeChangedCallback(name, oldValue, newValue) {\n if (!this.isConnected) return;\n super.attributeChangedCallback(name, oldValue, newValue);\n }", "attributeChangedCallback(attr, _oldValue, newValue) {\n\t\t\t\tif (this.$$r) return;\n\t\t\t\tattr = this.$$g_p(attr);\n\t\t\t\tthis.$$d[attr] = get_custom_element_value(attr, newValue, this.$$p_d, 'toProp');\n\t\t\t\tthis.$$c?.$set({ [attr]: this.$$d[attr] });\n\t\t\t}", "attributeChangedCallback (attrName, oldVal, newVal) {\n console.log('attribute changed')\n this.render()\n }", "attributeChangedCallback(name, oldValue, newValue){\n if(oldValue == newValue){\n return;\n }\n if(name == \"tooltiptext\"){\n this.tooltipText = newValue;\n }\n }", "attributeChangedCallback( name, oldValue, newValue ) {\n switch( name ) {\n case 'classification':\n this.classification = newValue;\n break;\n }\n }", "attributeChangedCallback (attrName, oldVal, newVal) {\n // Only care about the attributes in the observed list.\n if (this.constructor.observedAttributes.indexOf(attrName) === -1) {\n return;\n }\n\n // If this attribute is already being updated, do not trigger a reaction again.\n if (this.isUpdating_(attrName)) {\n return;\n }\n\n this.log_('attributeChangedCallback', {\n attrName,\n oldVal,\n newVal\n });\n\n let cancelled = false;\n\n try {\n // Mark the attribute as being updated so changing its value during the process doesn't cause another reaction (and dead loop).\n this.setUpdateFlag_(attrName);\n\n const propName = this.constructor.getPropertyNameByAttributeName_(attrName),\n eventName = `changed:${propName}`,\n oldPropVal = this.getPropertyValueFromAttribute_(attrName, oldVal !== null, oldVal), //this[propName],\n newPropVal = this.getPropertyValueFromAttribute_(attrName, newVal !== null, newVal);\n\n if (this.isIdenticalPropertyValue_(propName, oldPropVal, newPropVal)) {\n this.log_(eventName, 'no change', {\n oldPropVal,\n newPropVal\n });\n } else {\n // Setter should verify new property value and throw if needed.\n this[propName] = newPropVal;\n\n this.log_(eventName, {\n oldVal: oldPropVal,\n newVal: newPropVal\n });\n\n // Dispatch change event.\n const event = new CustomEvent(eventName, {\n bubbles: true,\n cancelable: true,\n scoped: false,\n composed: false,\n detail: {\n property: propName,\n newValue: newPropVal\n }\n });\n\n cancelled = !this.dispatchEvent(event);\n }\n } catch (error) {\n this.logError_(`Failed to handle attribute change. ${error.message}`, {\n attrName,\n oldVal,\n newVal\n });\n\n //! Handle the error better?\n cancelled = true;\n } finally {\n this.clearUpdateFlag_(attrName);\n\n if (cancelled) {\n // Either cancelled or errored.\n if (this.hasWorkingAttributes_[attrName]) {\n // Revert the attribute to the old value.\n if (oldVal === null) {\n this.removeAttribute(attrName);\n } else {\n this.setAttribute(attrName, oldVal);\n }\n } else {\n this.logWarn_('No acceptable value to revert to.', {\n attrName,\n oldVal,\n newVal\n });\n }\n } else {\n // No error and not cancelled.\n this.hasWorkingAttributes_[attrName] = true;\n }\n }\n }", "attributeChangedCallback(attribute, oldValue, newValue) {\n\t\tif (attribute === 'name' && oldValue !== newValue) {\n\t\t\tthis.nameElement.innerText = newValue;\n\t\t}\n\n\t\tif (attribute === 'link' && oldValue !== newValue && newValue !== 'undefined') {\n\t\t\tthis.nameElement.href = newValue;\n\t\t}\n\n\t\tif (attribute === 'description' && oldValue !== newValue) {\n\t\t\tthis.descriptionElement.innerText = newValue;\n\t\t}\n\n\t\tif (attribute === 'label' && oldValue !== newValue) {\n\t\t\tthis.labelElement.innerText = newValue;\n\t\t}\n\n\t\tif (attribute === 'estimate' && oldValue !== newValue) {\n\t\t\tthis.estimateElement.innerText = newValue;\n\t\t}\n\t}", "attributeChangedCallback() {\n this.render();\n }", "attributeChangedCallback(attrName, oldVal, newVal) {\n if (!this.connected) {\n return;\n }\n }", "attributeChangedCallback(attrName, oldVal, newVal) {\n if (!this.connected) {\n return;\n }\n }", "attributeChangedCallback(attrName, oldVal, newVal) {\n let needInit = false;\n if (attrName.toLowerCase() == 'modulename' && newVal && newVal != '') {\n this.moduleName = newVal;\n needInit = true;\n }\n else if (attrName.toLowerCase() == 'objectname' && newVal && newVal != '') {\n this.objectName = newVal;\n needInit = true;\n }\n else if (attrName.toLowerCase() == 'objectwhere' && newVal && newVal != '') {\n this.objectWhere = newVal;\n needInit = true;\n }\n else if (attrName.toLowerCase() == 'value' && newVal && newVal != '') {\n this.value = newVal;\n if (this.connected) {\n this.setValue(newVal);\n }\n }\n if (this.connected && needInit) {\n this.init();\n }\n }", "attributeChangedCallback(attr, oldVal, newVal) {\n if(!this.editor){\n return false;\n }\n switch(attr){\n // case \"theme\":\n // this.editor.setTheme( newVal );\n // break;\n case \"mode\":\n this.editor.setOption('mode', newVal);\n break;\n // case \"fontsize\":\n // this.editor.setFontSize( newVal );\n // break;\n // case \"softtabs\":\n // this.editor.getSession().setUseSoftTabs( newVal );\n // break;\n // case \"tern\":\n // if (newVal)\n // this.enableTern()\n // break;\n\n case \"tabsize\":\n\t\t\t\tthis.setOption(\"tabSize\", newVal)\n break;\n // case \"readonly\":\n // this.editor.setReadOnly( newVal );\n // break;\n case \"wrapmode\":\n this.setOption(\"lineWrapping\", newVal)\n break;\n }\n }", "attributeChangedCallback(attr, oldVal, newVal) {\n if (!this.editor) {\n return false;\n }\n switch (attr) {\n // case \"theme\":\n // this.editor.setTheme( newVal );\n // break;\n case \"mode\":\n this.editor.setOption('mode', newVal);\n break;\n // case \"fontsize\":\n // this.editor.setFontSize( newVal );\n // break;\n // case \"softtabs\":\n // this.editor.getSession().setUseSoftTabs( newVal );\n // break;\n // case \"tern\":\n // if (newVal)\n // this.enableTern()\n // break;\n\n case \"tabsize\":\n this.setOption(\"tabSize\", newVal);\n break;\n // case \"readonly\":\n // this.editor.setReadOnly( newVal );\n // break;\n case \"wrapmode\":\n this.setOption(\"lineWrapping\", newVal);\n break;\n }\n }", "attributeChangedCallback(attrName,oldValue,newValue){\n console.log(attrName, newValue);\n if(attrName == 'name'){\n this.shadowRoot.querySelector(\".meme-name\").innerHTML= newValue;\n }else if(attrName == 'date-modified'){\n this.shadowRoot.querySelector(\".meme-date-modified\").innerHTML = newValue\n }else if(attrName == 'image'){\n this.shadowRoot.querySelector(\".meme-photo\").src = newValue;\n }else if(attrName == 'description'){\n this.shadowRoot.querySelector(\".meme-description\").innerHTML = newValue\n }\n }", "attributeChangedCallback(attribute, oldValue, newValue){\n\n // * Process new input values.\n switch (attribute) {\n\n // User ID:\n case ProfileBadge.rsc().attribute.id:\n this._id = (oldValue !== newValue) ? newValue : oldValue;\n break;\n\n // Badge profile image URL:\n case ProfileBadge.rsc().attribute.image:\n this._profileImageURL = newValue;\n break;\n\n // Badge name:\n case ProfileBadge.rsc().attribute.name:\n this._name = (oldValue !== newValue) ? newValue : oldValue;\n break;\n\n // Badge address:\n case ProfileBadge.rsc().attribute.address:\n this._address = (oldValue !== newValue) ? newValue : oldValue;\n break;\n }\n\n // * Update.\n this.update();\n\n }", "attributeChangedCallback(name, oldValue, newValue) {\n // switch (name) {\n // case \"title\":\n // this.$title.innerText = newValue;\n // break;\n // default:\n // break;\n // }\n }", "attributeChangedCallback(name, oldValue, newValue) {\n // check the name and run your desired method\n if (name === 'open') {\n if (!this.hold) this.toggleOpen();\n } else if (name === 'disabled') {\n // TODO - change style on disabled\n return this.disabled ? this._setDisabled() : this._clearDisabled();\n } else if (name === 'selectedDate') {\n }\n }", "attributeChangedCallback (name, oldValue, newValue) {\n /**\n * Some frameworks will set attributes as `undefined`\n * when they are first initalized. So make sure you\n * handle that case. In this case we make sure we also\n * have a map and view initalized before we do anything.\n */\n if(this.view && this.map && newValue){\n switch (name) {\n case 'zoom':\n this.view.zoom = this.zoom;\n break;\n case 'lat':\n this.view.center = this.center;\n break;\n case 'lng':\n this.view.center = this.center;\n break;\n case 'basemap':\n this.map.basemap = this.basemap;\n break;\n }\n }\n }", "attributeChangedCallback(attrName, oldVal, newVal) {\n let isDirty = false;\n if (!this.connected) {\n return;\n }\n if (attrName.toLowerCase() == 'mode' && newVal && newVal != '') {\n this.mode = newVal;\n if (this.mode) {\n isDirty = true;\n }\n }\n if (attrName.toLowerCase() == 'modulename' && newVal && newVal != '') {\n this.moduleName = newVal;\n if (this.moduleName) {\n isDirty = true;\n }\n }\n if (isDirty) {\n this.refresh();\n }\n }", "attributeChangedCallback(name, oldValue, newValue) {\n this._setInterval(newValue);\n }", "attributeChangedCallback(attrName, oldVal, newVal) {\n let isDirty = false;\n if (!this.connected) {\n return;\n }\n if (attrName.toLowerCase() == 'modulename' && newVal && newVal != '') {\n this.moduleName = newVal;\n if (this.moduleName) {\n isDirty = true;\n }\n }\n if (this && attrName.toLowerCase() == 'objectname' && newVal && newVal != '') {\n this.objectname = newVal;\n if (this.objectname) {\n isDirty = true;\n }\n }\n if (this && attrName.toLowerCase() == 'objectwhere' && newVal && newVal != '') {\n this.objectwhere = newVal;\n if (this.objectwhere) {\n isDirty = true;\n }\n }\n if (this.connected === true && (isDirty === true)) {\n this.refresh();\n }\n }", "attributeChangedCallback(attr, oldValue, newValue) {\n if (attr == 'name') {\n this.textContent = `Hello, ${newValue}`;\n }\n }", "onAttributeChanged (name, value) {\n value = toNullOrString(value);\n\n // A new attribute value voids the pending one\n this._clearPendingValue(name);\n\n const changed = this.lastSetValues[name] !== value;\n this.lastSetValues[name] = value;\n return changed;\n }", "attributeChangedCallback(attrName, oldVal, newVal) {\n if (attrName === 'value') {\n // This will override any usage of the value attribute\n // inherited by the FAST Foundation BaseProgress component\n // so that VSCodeProgressRing can never set to be a\n // determinate state\n this.removeAttribute('value');\n }\n }", "attributeChangedCallback($name, $prevValue, $nextValue) {\n switch ($name) {\n case 'src':\n this.load($nextValue);\n break;\n }\n }", "setUpdateFlag_ (attrName) {\n this.changingAttributes_[attrName] = true;\n }", "function attrFunction() {\n var x = value.apply(this, arguments);\n if (x == null) this.removeAttribute(name);\n else this.setAttribute(name, x);\n }", "attributeChangedCallback(attrName, oldVal, newVal) {\n let needInit = false;\n if (attrName.toLowerCase() == 'modulename' && newVal && newVal != '') {\n this.moduleName = newVal;\n needInit = true;\n }\n else if (attrName.toLowerCase() == 'url' && newVal && newVal != '') {\n this.url = newVal;\n if (this.connected) {\n this.changeUrl();\n }\n }\n else if (attrName.toLowerCase() == 'mode' && newVal && newVal != '') {\n this.ionicMode = newVal;\n if (this.connected) {\n this.changeMode();\n }\n }\n if (this.connected && needInit) {\n this.init();\n }\n }", "attributeChangedCallback(attrName, oldValue, newValue) {\n if (attrName == \"lesson\") {\n let lesson = JSON.parse(newValue); \n this.setAttribute(\"questions\", JSON.stringify(lesson));\n this.all = lesson.length;\n } \n else if (attrName == \"questions\") {\n this.questions = JSON.parse(this.getAttribute(\"questions\"));\n this.$numberQuestion = this.indexQuestion + 1;\n this.$answerForm.setAttribute(\n \"question\",\n JSON.stringify(this.questions[this.indexQuestion])\n );\n } else if (attrName == \"clicked\") {\n this.indexQuestion++;\n if (this.indexQuestion == this.all) {\n router.navigate(\"/homeScreen\");\n } else {\n this.$messageBoxContainer.style.display = \"none\";\n this.$answerForm.setAttribute(\n \"question\",\n JSON.stringify(this.questions[this.indexQuestion])\n );\n }\n }\n }", "attributeChangedCallback(attr, oldValue, newValue) {\n\n if (attr == 'style') {\n\n if (this.servochannel == undefined) return;\n\n // Get Color in RGB\n var transform = window.getComputedStyle(this, null)[\"transform\"];\n\n if (transform!= \"\" && transform!= \"none\") {\n // Style defined through CSS, thus we can't get this.style.\n\n var newAngle = this.getAngle(transform);\n if (newAngle != this.angle) {\n this.angle = newAngle;\n\n // Move Servo\n var angle = this.getAngle(transform);\n //console.log(this.getAngle(transform));\n var pulselen = Linuxduino.map(angle, 0, 180, this.SERVOMIN, this.SERVOMAX);\n this.PWM.setPWM(this.servochannel, 0, pulselen);\n\n }\n \n } else {\n console.log(\"No transform\");\n }\n\n } else if (attr == 'servo-channel') {\n this.servochannel = parseFloat(newValue);\n } else if (attr == 'i2c-port') {\n this.i2cport = newValue;\n } else if (attr == 'i2c-addr') {\n this.i2caddr = parseFloat(newValue);\n }\n }", "handleAttributeChange(key, value) {\n if(this.$initialized) {\n if(this.$changed[key] === value) {\n delete this.$changed[key];\n }\n else if(!(key in this.$changed)) {\n this.$changed[key] = this.getAttribute(key);\n }\n }\n\n this.handlePrimaryKeyChange(key, value);\n }", "attributeChangedCallback(name, oldValue, newValue) {\n // check the name and run your desired method\n if (name === 'checked') {\n this.toggleChecked();\n } else if (name === 'disabled') {\n // TODO - change style on disabled\n this.toggleDisabled();\n }\n }", "function attrFunction() {\n var x = value.apply(this, arguments);\n if (x == null) this.removeAttribute(name);\n else this.setAttribute(name, x);\n }", "function attrFunction() {\n var x = value.apply(this, arguments);\n if (x == null) this.removeAttribute(name);\n else this.setAttribute(name, x);\n }", "attributeChangedCallback(attrName, oldVal, newVal) {\n // In the case when an icon only button is created add a default ARIA\n // label to the button since there is no longer button text to use\n // as the label\n if (attrName === 'appearance' && newVal === 'icon') {\n // Only set the ARIA label to the default text if an aria-label attribute\n // does not exist on the button\n const ariaLabelValue = this.getAttribute('aria-label');\n\n if (!ariaLabelValue) {\n this.ariaLabel = 'Icon Button';\n }\n } // In the case when the aria-label attribute has been defined on the\n // <vscode-button>, this will programmatically propogate the value to\n // the <button> HTML element that lives in the Shadow DOM\n\n\n if (attrName === 'aria-label') {\n this.ariaLabel = newVal;\n }\n\n if (attrName === 'disabled') {\n this.disabled = newVal !== null;\n }\n }", "attributeChangedCallback(attrName, oldValue, newValue) {\n if (attrName === 'path') {\n this.getImg(this.shadowRoot).src = newValue;\n }\n }", "attributeChangedCallback(attr, oldValue, newValue) {\n switch (attr) {\n case 'type':\n if (!newValue || ['info', 'primary', 'warning', 'success', 'danger'].indexOf(newValue) === -1) {\n this.type = 'info';\n }\n break;\n case 'dismiss':\n case 'acknowledge':\n if (!newValue || newValue === 'true') {\n if (this.firstElementChild && this.firstElementChild.tagName && this.firstElementChild.tagName.toLowerCase() !== 'button') {\n this.appendCloseButton.bind(this)();\n }\n } else if (this.firstElementChild.tagName && this.firstElementChild.tagName.toLowerCase() === 'button') {\n this.removeCloseButton.bind(this)();\n }\n break;\n case 'href':\n if (!newValue || newValue === '') {\n if (this.firstElementChild.tagName && this.firstElementChild.tagName.toLowerCase() !== 'button') {\n this.removeCloseButton.bind(this)();\n }\n } else if (this.firstElementChild.tagName && this.firstElementChild.tagName.toLowerCase() !== 'button' && this.firstElementChild.classList.contains('tk-alert-button--close')) {\n this.appendCloseButton.bind(this)();\n }\n break;\n case 'auto-dismiss':\n if (!newValue || newValue === '') {\n this.removeAttribute('auto-dismiss');\n }\n break;\n default:\n break;\n }\n }", "attributeChangedCallback(attr, oldValue, newValue) {\n if (attr == 'name') {\n this.textContent = `HELLO, ${newValue}`;\n signon();\n }\n }", "attributeChangedCallback(attr, oldValue, newValue) {\r\n if (attr == \"gpio\") {\r\n this.gpio = parseFloat(newValue);\r\n console.log(\"GPIO: \", this.gpio);\r\n }\r\n }", "updateChangedAttributes() {\n var changedAttributes = this.changedAttributes();\n var changedAttributeNames = Object.keys(changedAttributes);\n var attrs = this._attributes;\n\n for (var i = 0, length = changedAttributeNames.length; i < length; i++) {\n var attribute = changedAttributeNames[i];\n var data = changedAttributes[attribute];\n var oldData = data[0];\n var newData = data[1];\n\n if (oldData === newData) {\n delete attrs[attribute];\n }\n }\n }", "attributeChangedCallback(attrName, oldValue, newValue) {\n if (attrName == \"lesson\") {\n newValue = JSON.parse(newValue);\n console.log(newValue);\n this.setAttribute(\"id\", newValue.id);\n this.$lessonName.innerHTML = newValue.name;\n this.$lessonImage.src = newValue.background;\n let content = \"\";\n let value = newValue.read[0];\n for (let i in value) {\n if (value[i].indexOf(\":\") > 0 && value[i].indexOf(\":\") < 10) {\n console.log(value[i].indexOf(\":\"));\n let tmp = value[i].split(\":\");\n content += `<p style=\"margin-bottom: 10px;\"><b>${tmp[0]}</b>:${tmp[1]}</p>`;\n } else {\n content += `<p style=\"margin-bottom: 10px;\">${value[i]}</p>`;\n }\n }\n this.$content.innerHTML = content;\n }\n }", "function attributeChangeObserver(mutations) {\n\n var changes = _.filter(mutations, isInterestingMutation);\n if (changes.length > 0) {\n console.log('changes', changes);\n }\n\n // target is the DOM elemenet containing\n // the attribute\n _.pluck(changes, 'target')\n .forEach(attachEventHandlerForEl)\n}", "static get observedAttributes() {return ['w', 'l']; }", "static get observedAttributes() {\n return ['value'];\n }", "function _attribute()\r\n\t{\r\n\t return this._attributeHandler;\r\n\t}", "attributeChangedCallback(attrName, oldVal, newVal) {\n if (!this.connected) {\n return;\n }\n if (attrName.toLowerCase() == 'params' && newVal && newVal != '') {\n this.gridId = newVal;\n if (this.gridId) {\n this.refresh();\n }\n }\n }", "handleWebviewAttributeMutation (attributeName, oldValue, newValue) {\n if (!this.attributes[attributeName] || this.attributes[attributeName].ignoreMutation) {\n return\n }\n\n // Let the changed attribute handle its own mutation\n this.attributes[attributeName].handleMutation(oldValue, newValue)\n }", "attributeChangedCallback(prop) {\n if(prop === 'inputId' || prop === 'label' || prop === 'suggestionList') {\n this.renderAndUpdateDom();\n }\n }", "_updateAttributeTransition() {\n const attributeManager = this.getAttributeManager();\n if (attributeManager) {\n attributeManager.updateTransition();\n }\n }" ]
[ "0.9073653", "0.88553005", "0.88553005", "0.85720354", "0.85351837", "0.8505681", "0.85036683", "0.85036683", "0.85036683", "0.85036683", "0.846776", "0.8230596", "0.8113971", "0.8096207", "0.8074251", "0.80715334", "0.8002767", "0.8002767", "0.7990789", "0.79661644", "0.79405075", "0.7922928", "0.7845526", "0.782398", "0.7811749", "0.7811749", "0.7811749", "0.78065234", "0.77464604", "0.7727232", "0.7697989", "0.76239914", "0.7621931", "0.7619005", "0.75857294", "0.75838083", "0.75622857", "0.75052863", "0.7382124", "0.7373595", "0.73500866", "0.73500866", "0.73377085", "0.7336947", "0.73235816", "0.73154706", "0.72857594", "0.7285", "0.7243714", "0.723209", "0.72278285", "0.72273767", "0.72273767", "0.72091895", "0.7181537", "0.7164406", "0.713772", "0.7136083", "0.71060336", "0.7088051", "0.7086351", "0.7086351", "0.7057651", "0.69288623", "0.6903054", "0.69002146", "0.68982714", "0.68635064", "0.68580014", "0.68308514", "0.6825538", "0.679782", "0.67861235", "0.67843395", "0.677428", "0.67313325", "0.66180044", "0.6589927", "0.6544597", "0.6530344", "0.6508505", "0.64944756", "0.64638305", "0.64613116", "0.6436185", "0.6436185", "0.63961774", "0.62603635", "0.6256255", "0.6250462", "0.62312585", "0.6181395", "0.6175659", "0.615581", "0.61305606", "0.61119956", "0.6094295", "0.6078688", "0.6068721", "0.6065476", "0.6045459" ]
0.0
-1
Toggle click on menu
function menu(){ menuNav.classList.toggle("show"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function togglemenu(){\n this.isopen = !this.isopen;\n }", "Click(){\n\t\tthis.setState({ showMenu: !this.state.showMenu})\n\t}", "function menuToggleClickHandler() {\n setSideMenuIsOpen(!sideMenuIsOpen);\n }", "function toggleMenu(menu) {\n menu.toggleClass('show');\n}", "function toggleOnMenuClick(e) {\n\t\t\tconst button = e.currentTarget;\n\n\t\t\t// close open menu if there is one\n\t\t\tif (currentMenuItem && button !== currentMenuItem) {\n\t\t\t\ttoggleSubmenu(currentMenuItem);\n\t\t\t}\n\n\t\t\ttoggleSubmenu(button);\n\t\t}", "function my_toggle_menudropdown(){\n\n $('.js-toggle-menu-dropdown').off();\n $('.js-toggle-menu-dropdown').click(function(){\n $('.js-menu-dropdown').toggleClass('is-active');\n $('.js-header').toggleClass('is-active');\n });\n\n }", "static toggleMenu() {\n var win = $(\"#window\")[0];\n\n if (win.classList.contains(MENU_ACTIVE)) {\n this.menuOff();\n }\n else {\n this.menuOn();\n }\n }", "function burgerMenu(e) {\n $('.icon-one').click(function() {\n $('.sideSection nav ul li').toggle('show')\n })\n }", "function toggleMenu() {\r\n //console.log('menu clicked');\r\n if ($menuList.hasClass('menu-active')) {\r\n $menuList.removeClass('menu-active');\r\n $areaCloseMenu.removeClass('menu-active');\r\n $buttonOpenMenu.removeClass('menu-not-active');\r\n $buttonCloseMenu.removeClass('menu-active');\r\n } else {\r\n $menuList.addClass('menu-active');\r\n $areaCloseMenu.addClass('menu-active');\r\n $buttonOpenMenu.addClass('menu-not-active');\r\n $buttonCloseMenu.addClass('menu-active');\r\n }\r\n}", "function toggle_button_click(e) {\n var $button = $(e.currentTarget);\n var $menu = $button.parent().parent().children('ul');\n var was_closed = $button.hasClass('menu-closed');\n\n if (was_closed) {\n expand($menu, $button);\n }\n else {\n collapse($menu, $button);\n }\n }", "function toggleMenu(menu) {\n\tmenu.classList.toggle(\"active\");\n}", "function toggle() {\n if ($scope.menuState === openState) {\n close();\n } else {\n open();\n }\n }", "function toggleMenu(e) {\n if (menu.classList.contains('show')) {\n menu.classList.remove('show')\n } else {\n menu.classList.add('show')\n }\n}", "function toggle()\n {\n menuBtn.classList.toggle(\"open\");\n menuItems.classList.toggle(\"open\");\n }", "function togglemenu(){\r\n\t\tvar menuToggle = document.querySelector('.toggle');\r\n\t\tvar menu = document.querySelector('.menu');\r\n\t\tmenuToggle.classList.toggle('active');\r\n\t\tmenu.classList.toggle('active');\r\n\t}", "function toggle_button_click(e) {\n var $button = $(e.currentTarget);\n var $menu = $button.parent().children('ul.menu');\n var was_closed = $button.hasClass('menu-closed');\n\n if (was_closed) {\n $menu.removeClass('menu-closed').attr('aria-hidden', 'false');\n $button.removeClass('menu-closed').attr('aria-expanded', 'true').attr('title', 'Collapse menu');\n }\n else {\n $menu.addClass('menu-closed').attr('aria-hidden', 'true');\n $button.addClass('menu-closed').attr('aria-expanded', 'false').attr('title', 'Expand menu');\n }\n }", "function onClickMenu(){\n\tdocument.getElementById(\"menu\").classList.toggle(\"change\");\n\tdocument.getElementById(\"nav\").classList.toggle(\"change\");\n\tdocument.getElementById(\"menu-bg\").classList.toggle(\"change-bg\");\n}", "function menuToggle() {\n \"use strict\";\n\n jQuery('#header-service-menu-list a.sub-section').click(function (e) {\n e.preventDefault();\n jQuery(this).next().stop().slideToggle();\n jQuery(this).toggleClass('is-active');\n }).next().stop().hide();\n} //------------------------", "function openMenu() {\n vm.showMenu=!vm.showMenu;\n }", "function toggleMenuOn() {\n if (menuState !== 1) {\n menuState = 1;\n menu.classList.add(contextMenuActive);\n }\n}", "function toggleMenuOn() {\n if (menuState !== 1) {\n menuState = 1;\n menu.classList.add(contextMenuActive);\n }\n }", "function toggleMenu(event) {\n\tif (event.type === \"touchstart\") event.preventDefault();\n\n\n\tconst navigationMenu = document.querySelector(\".c-menu\");\n\n\tnavigationMenu.classList.toggle(\"is-menu--active\");\n\n\tconst activeNavigation = navigationMenu.classList.contains(\n\t\t\"is-menu--active\"\n\t);\n\tevent.currentTarget.setAttribute(\"aria-expanded\", activeNavigation);\n\n\n\tif (activeNavigation) {\n\t\tevent.currentTarget.setAttribute(\"aria-label\", \"Fechar Menu\");\n\t\t\n\t} else {\n\t\tevent.currentTarget.setAttribute(\"aria-label\", \"Abrir Menu\");\n\t}\n}", "function toggleMenu() {\n open = !open;\n let bars = this.children[0];\n if(open) {\n bars.style.color = '#ffffff';\n selectors.sideMenu.style.left = 0;\n } else {\n bars.style.color = '#000000';\n selectors.sideMenu.style.left = -400 + 'px';\n }\n}", "function toggleMenuOn() {\n if ( menuState !== 1 ) {\n menuState = 1;\n menu.classList.add( contextMenuActive );\n }\n }", "function openMobileMenu() {\n\t\tsetClick(!click);\n\t}", "function sidemenuToggle() {\n if(isSideMenuOpen) {\n sidemenuClose();\n } else {\n sidemenuOpen();\n }\n}", "function sidemenuToggle() {\n if(isSideMenuOpen) {\n sidemenuClose();\n } else {\n sidemenuOpen();\n }\n}", "function toggleMenu(){\n if(onNewsPost == \"yes\"){\n goBackToTabs();\n return;\n }\n console.log(\"Toggle Menu\");\n $(\".mdl-layout__drawer-button\").click();\n}", "toggleTheMenu() {\n\t\t// alert(this);\n\t\tthis.menuContent.toggleClass(\"site-header__menu-content--is-visible\");\n\t\tthis.siteHeader.toggleClass(\"site-header--is-expanded\");\n\t\tthis.menuIcon.toggleClass(\"site-header__menu-icon--close-x\");\n\t}", "menuToggle(event) {\n var navItem = document.getElementsByTagName('nav')[0];\n if ('block' === navItem.style.display) {\n navItem.style.display = 'none';\n } else {\n navItem.style.display = 'block';\n navItem.className = navItem.className + ' menuhidden';\n }\n\n }", "function onClickMenu() {\n document.getElementById(\"menu\").classList.toggle(\"change\");\n \n document.getElementById(\"nav\").classList.toggle(\"change\");\n \n document.getElementById(\"menu-bg\").classList.toggle(\"change-bg\");\n }", "function menu() {\n html.classList.toggle('menu-active');\n }", "toggleMenu() {\n this.tl.reversed(!this.tl.reversed());\n\n if (!this.state.isMenuExpanded) {\n this.showTargetElement();\n }\n else {\n\n }\n\n this.setState({ isMenuExpanded: !this.state.isMenuExpanded });\n }", "toggleMenu(){\n const toggleButton = document.querySelector('.header-toggle-menu')\n const headerMenu = document.querySelector('.header-menu')\n\n toggleButton.classList.toggle('clicked-toggle')\n headerMenu.classList.toggle('display-menu')\n }", "function toggleMenu(event) {\n event.preventDefault();\n menu.classList.toggle('is-active');\n menu1.classList.toggle('is_active');\n}", "function toggleHamburgerMenu() {\n $('.hamburger-icon').click(event => {\n $('.main-menu-link').toggleClass('toggle-links');\n });\n}", "function toggleHamburgerMenu() {\n $('.hamburger-icon').click(event => {\n $('.main-menu-link').toggleClass('toggle-links');\n });\n}", "function toggleHamburgerMenu() {\n $('.hamburger-icon').click(event => {\n $('.main-menu-link').toggleClass('toggle-links');\n });\n}", "handleMenuClick(e){\n this.toggleMenu();\n \n e.stopPropagation(); //parents not told of the click\n }", "function toggleMenu() {\n menuNav.classList.toggle('menu-toggle');\n }", "function onClickMenuIcon() {\n\t\t$(this).toggleClass(\"active\");\n\t\t$mobileNav.toggleClass(\"active\");\n\t}", "toggleMenu(context) {\n context.commit('toggleMenu');\n }", "function _mainmenuToggle() {\n\t\tvar $this = $( this );\n\t\t_toggleAria( $this, 'aria-pressed' );\n\t\t_toggleAria( $this, 'aria-expanded' );\n\t\t$this.toggleClass( 'activated' );\n\t\t$this.next( 'nav' ).slideToggle( 'fast' );\n\t}", "function _mainmenuToggle() {\n\t\tvar $this = $( this );\n\t\t_toggleAria( $this, 'aria-pressed' );\n\t\t_toggleAria( $this, 'aria-expanded' );\n\t\t$this.toggleClass( 'activated' );\n\t\t$this.next( 'nav' ).slideToggle( 'fast' );\n\t}", "events (){\n this.menuIcon.click(this.toggleMenu.bind(this));\n }", "function toggleMenu() {\n $(\".menu-content\").toggleClass(\"show\");\n}", "function openMenu () {\n $(this).toggleClass('open');\n $('ul, .social-links').toggleClass('active open');\n }", "function toggleMenu(e) {\n e.preventDefault();\n $mainNav.slideToggle(function (){\n if ($mainNav.is(':hidden')) {\n $mainNav.removeAttr('style');\n }\n });\n $menuToggle.toggleClass('open');\n }", "toggleMenu() {\n return this._menuOpen ? this.closeMenu() : this.openMenu();\n }", "function toggle() {\n const state = isActiveMenuState();\n const burgerMenuMarketingImage = document.querySelector('.js-burger-menu-marketing-widget__img');\n\n initLayeredMenuState();\n\n if (state) { // closing the menu\n switchClass(document.body, 'nav-is-closed-body', 'nav-is-open-body');\n switchClass(getContentWrapper(), 'nav-is-closed', 'nav-is-open');\n switchClass(getCurtain(), 'nav-is-closed-curtain', 'nav-is-open-curtain');\n switchClass(getButton(), INACTIVE_STATE_CLASS, ACTIVE_STATE_CLASS);\n } else { // opening the menu\n switchClass(document.body, 'nav-is-open-body', 'nav-is-closed-body');\n switchClass(getContentWrapper(), 'nav-is-open', 'nav-is-closed');\n switchClass(getCurtain(), 'nav-is-open-curtain', 'nav-is-closed-curtain');\n switchClass(getButton(), ACTIVE_STATE_CLASS, INACTIVE_STATE_CLASS);\n\n // lazyload the image for the burger-menu-marketing widget\n if (burgerMenuMarketingImage) {\n lazyLoading.lazyLoadImage(burgerMenuMarketingImage);\n }\n }\n\n triggerMenuStateEvent(state);\n}", "handleToggleMenu(listId) {}", "function menuClick(thisMenu) {\n // Determine if the menu is visible. Check BEFORE closing.\n visibleTest = (document.getElementById(thisMenu).style.visibility == \"visible\");\n // Hide any visible menu, including thisMenu\n closeAllMenus();\n // Toggle the menu. Note that if it was open, it has already been closed.\n if (! visibleTest) {\n menusSetAllOptionChecks(thisMenu);\n openMenu(thisMenu); }\n // Save state. Used to clear menus by clicking anywhere on browser.\n lastClickOnMenu = true;\n return false; }", "function toggleMenu() {\n if (menu.classList.contains('active')) {\n menu.classList.remove('active')\n toggle.querySelector('a').querySelector('img').src = \"/feather_icon/menu.svg\";\n } else {\n menu.classList.add('active')\n toggle.querySelector('a').querySelector('img').src = \"/feather_icon/x.svg\";\n }\n}", "function burgerclick(evt) {\n $(this).toggleClass(\"change\");\n $(\"body\").toggleClass(\"translateMenu\");\n remouvEventMenuClick();\n }", "function toggleMenu() {\n\t// checks if menu is open or close\n\tif(!showMenu) { \n\t\t// adds close class to menu button and open clase to menu navigation\n\t\tmenuBtn.classList.add('close');\n\t\tmainNav.classList.add('open');\n\t\tmenuList.classList.add('open');\n\n\t\t// sets new menu state to be opened\n\t\tshowMenu = true;\n\t} else {\n\t\t// removes close class from menu button and open class from menu naigation\n\t\tmenuBtn.classList.remove('close');\n\t\tmainNav.classList.remove('open');\n\t\tmenuList.classList.remove('open');\n\n\t\t// sets menu state to be closed\n showMenu = false;\n }\n}", "toggleTheMenu() { // run the action \"Toggle the menu content\" (visible/unvisible)\n // console.log(\"Hooray - the icon was clicked!\"); // test message\n // Attention \"this\" variable points to object, from which method was called\n // from! In this particular case: Jquery menuIcon object\n // console.log(this);\n this.menuContent.toggleClass(\"site-header__menu-content--is-visible\");\n this.siteHeader.toggleClass(\"site-header--is-expanded\");\n this.menuIcon.toggleClass(\"site-header__menu-icon--close-x\");\n }", "function toggleMenu() {\n document.getElementById(\"nav-menu\").classList.toggle(\"show-menu\");\n}", "onToggle() {}", "function handleMenuClick(event) {\n setMenuOpen(event.currentTarget);\n }", "function triggerClick() {\n $('.menu-icon-link').trigger('click');\n checkClass();\n }", "function toggleMenu() {\n\tif (document.getElementsByClassName(\"animated\")[0].classList.contains('show'))\n hideMenu();\n else\n showMenu();\n}", "function toggleMenu() {\n if(!showmenu) {\n menubtn.classList.add('close');\n menu.classList.add('show');\n menunav.classList.add('show');\n menuitem.forEach(item => item.classList.add('show'));\n \n //set menu state\n showmenu = true;\n\n } else {\n menubtn.classList.remove('close');\n menu.classList.remove('show');\n menunav.classList.remove('show');\n menuitem.forEach(item => item.classList.remove('show'));\n \n //set menu state\n showmenu = false;\n \n }\n}", "function click_lyrMenu_1_조회() {\n\n var args = {\n target: [\n\t\t\t\t\t{\n\t\t\t\t\t id: \"frmOption\",\n\t\t\t\t\t focus: true\n\t\t\t\t\t}\n\t\t\t\t]\n };\n gw_com_module.objToggle(args);\n\n }", "function click_lyrMenu_1_조회() {\n\n var args = {\n target: [\n\t\t\t\t\t{\n\t\t\t\t\t id: \"frmOption\",\n\t\t\t\t\t focus: true\n\t\t\t\t\t}\n\t\t\t\t]\n };\n gw_com_module.objToggle(args);\n\n }", "function handleToggleMenu(e) { dispatch(toggleMenuAction(!toggleMenu));}", "function toggleMenu() {\n var dropdown = document.querySelector(\"#dropdown\");\n if (dropdown.classList.contains(\"hidden\")) {\n dropdown.classList.remove(\"hidden\");\n var slide = document.querySelector(\"#slide\");\n var fade = document.querySelector(\"#fade\");\n var snap = document.querySelector(\"#snap\");\n var toggle_sequence = document.querySelector(\"#toggle_sequence\");\n slide.addEventListener(\"click\", effectSlide, false);\n fade.addEventListener(\"click\", effectFade, false);\n snap.addEventListener(\"click\", effectSnap, false);\n toggle_sequence.addEventListener(\"click\", toggleSequence, false);\n } else {\n dropdown.classList.add(\"hidden\");\n\n }\n }", "@bind\n toggleMenu() {\n if (this.props.disabled || !this.hasMenu()) {\n return;\n }\n\n if (this.state.expanded) {\n this.hideMenu();\n } else {\n this.showMenu();\n }\n }", "function toggleMenu() {\n\t\t$('.header__burger').toggleClass('active');\n\t\t$('.header__menu').toggleClass('active');\n\t\t$('body').toggleClass('lock');\n\t}", "function toggleNav() {\n if (menuOpen) {\n closeNav();\n } else {\n openNav();\n }\n}", "function onClickMenu(){\n\tdocument.getElementById(\"menu\").classList.toggle(\"change\");\n\t\n\tif (!menuOpen){\n\t\tdocument.getElementById(\"slideInMenu\").style.height = \"100vh\";\n\t\tmenuOpen = true;\n\t\tsetTimeout(function(){\n\t\t\tdocument.getElementById('menuOptions').classList.remove('d-none');\n\t\t}, 200);\n\t} else {\n\t\tdocument.getElementById('slideInMenu').style.height = \"0vh\";\n\t\tdocument.getElementById('menuOptions').classList.add('d-none');\n\t\tmenuOpen = false;\n\t}\n\n\n}", "function toggleMenu(){\n liensMenu.classList.toggle('visible');\n blcIcon.classList.toggle(\"active\");\n}", "function toggleMenu() {\r\n var sidemenu = document.getElementById(\"sidemenu\");\r\n sidemenu.classList.toggle(\"active\");\r\n\r\n var menuBtnIcon = document.querySelector(\"#menuBtn i\");\r\n menuBtnIcon.classList.toggle(\"fa-bars\");\r\n menuBtnIcon.classList.toggle(\"fa-times\");\r\n }", "function toggleMenu() {\n var menu = document.getElementById('menu');\n if (menu) {\n if (menu.style.display === \"none\") {\n menu.style.display = \"block\";\n } else {\n menu.style.display = \"none\";\n }\n\n }\n}", "function toggleMenuBtn() {\n document.querySelector(\".menu-btn\").classList.toggle(\"toggle-nav-btn\");\n}", "function showMenu() {\n scope.menu = !scope.menu;\n $document.find('body').toggleClass('em-is-disabled-small', scope.menu);\n }", "toggleMainMenu(event) {\n event.preventDefault();\n\n if (this.isClosing || !this.isNavMenuOpen) {\n this.openMenu();\n } else if (this.isExpanding || this.isNavMenuOpen) {\n this.closeMenu();\n }\n }", "menuButtonClicked() {}", "function toggleMenu() {\n if (nav.classList.contains(\"show-menu\")) {\n nav.classList.remove(\"show-menu\")\n } else {\n nav.classList.add(\"show-menu\")\n }\n}", "toggleMenu()\n {\n this.setState({ menuOpen: !this.state.menuOpen })\n }", "toggleMenu() {\n this.setState({ menuOpen: !this.state.menuOpen })\n }", "toggleMenu() {\n this.setState({\n menuOpen: !this.state.menuOpen\n });\n }", "function toggleMobileMenu() {\n \ttoggleIcon.addEventListener('click', function(){\n\t\t this.classList.toggle(\"open\");\n\t\t mobileMenu.classList.toggle(\"open\");\n \t});\n }", "toggleMenu() {\n this.setState({\n active: !this.state.active,\n });\n }", "function menuToggle() {\n var s_options = DOM.options.style;\n var s_obutton = DOM.optionsButton.style;\n var s_content = DOM.container.style;\n\n if (s_options.display == \"\" || s_options.display == \"none\") {\n s_obutton.background = \"#1D8EC2\";\n s_options.display = \"block\";\n s_content.display = \"none\";\n } else {\n s_obutton.background = \"inherit\";\n s_options.display = \"none\";\n s_content.display = \"block\";\n }\n}", "function clickOnMobileMenu() {\n /* toggle the mobile nav menu */\n $('.js--mobile-menu').click(function() {\n const mainNav = $('.js--main-nav');\n mainNav.slideToggle(200);\n\n /* toggle the mobile menu icon */\n if ($('.js--menu-outline').hasClass('icon-hidden')) {\n $('.js--menu-outline').removeClass('icon-hidden');\n $('.js--close-outline').addClass('icon-hidden');\n } else {\n $('.js--menu-outline').addClass('icon-hidden');\n $('.js--close-outline').removeClass('icon-hidden');\n }\n\n });\n}", "function clickListener() {\n document.addEventListener( \"click\", function(e) {\n var clickeElIsLink = clickInsideElement( e, contextMenuLinkClassName );\n\n if ( clickeElIsLink ) {\n e.preventDefault();\n menuItemListener( clickeElIsLink );\n } else {\n var button = e.which || e.button;\n if ( button === 1 ) {\n toggleMenuOff();\n }\n }\n });\n }", "function closeDrawerMenu() {\n\t\t\t$('.pure-toggle-label').click();\n\t\t}", "function toggleMenu() {\n menuHead.addEventListener(\"click\", function () {\n if (menuBody.style.display === \"none\") {\n menuBody.style.display = \"block\";\n } else {\n menuBody.style.display = \"none\";\n }\n });\n\n menuBody.addEventListener(\"click\", function (ev) {\n if (ev.target !== ev.currentTarget) {\n menuHead.children[0].textContent = ev.target.textContent;\n }\n\n menuBody.style.display = \"none\";\n });\n }", "function toggle_sharing_menu(e){\n clickSound.play();\n\n if (sharing_menu_state == 1){\n $('#menu_partage').animate(\n {\n height: '0'\n },\n function(){\n $('#menu_partage').hide();\n }\n );\n \n sharing_menu_state = 0;\n }\n else if (sharing_menu_state == 0){\n $('#menu_partage').show(\n function(){\n $('#menu_partage').animate({\n height: $(window).height() - 44\n });\n }\n );\n\n sharing_menu_state = 1;\n }\n \n e.stopPropagation();\n}", "toggleMenu(){\n this.setState({\n visibleMenu: !this.state.visibleMenu\n });\n }", "function openMenu() {\n g_IsMenuOpen = true;\n}", "handleMenuClick() {\r\n const open = this.state.menuOpen ? false:true;\r\n this.setState({menuOpen: open});\r\n }", "function activeMenu() {\n $('header').click(function() {\n $(this).toggleClass('active');\n })\n}", "function toggleMenu() {\n console.log(\"toggleMenu\");\n // toggle betyder at jeg kan tilføje noget hvis det ikke er der, eller fjerne det hvis det er der\n document.querySelector(\"#menu\").classList.toggle(\"hidden\");\n\n //Skjuler burger menu\n let erSkjult = document.querySelector(\"#menu\").classList.contains(\"hidden\");\n\n //hvis den indeholder class hidden, og det er sandt, så skjuler den det. Og hvis den ikke indeholder hidden, så er det falsk.\n if (erSkjult == true) {\n document.querySelector(\"#menuknap\").textContent = \"☰\";\n } else {\n document.querySelector(\"#menuknap\").textContent = \"✕\";\n }\n}", "toggleMenu(){\n this.menuContent.toggleClass('site-nav--is-visible');\n this.siteHeader.toggleClass('site-header--is-expanded');\n this.menuIcon.toggleClass('site-header__menu-icon--close-x');\n this.siteHeaderLogo.toggleClass ('site-header__logo--transparent');\n }", "toggleMenu() {\n if (!Foundation.MediaQuery.atLeast(this.options.hideFor)) {\n /**\n * Fires when the element attached to the tab bar toggles.\n * @event ResponsiveToggle#toggled\n */\n if(this.options.animate) {\n if (this.$targetMenu.is(':hidden')) {\n Foundation.Motion.animateIn(this.$targetMenu, this.animationIn, () => {\n this.$element.trigger('toggled.zf.responsiveToggle');\n this.$targetMenu.find('[data-mutate]').triggerHandler('mutateme.zf.trigger');\n });\n }\n else {\n Foundation.Motion.animateOut(this.$targetMenu, this.animationOut, () => {\n this.$element.trigger('toggled.zf.responsiveToggle');\n });\n }\n }\n else {\n this.$targetMenu.toggle(0);\n this.$targetMenu.find('[data-mutate]').trigger('mutateme.zf.trigger');\n this.$element.trigger('toggled.zf.responsiveToggle');\n }\n }\n }", "function clickOnNav() {\n\t\t//click nav event\n\t\t$('.nav-icon, .left-menu').click(function(){\n\t\t\t//when menu is open\n\t\t\tif ($(this).hasClass('active')) {\n\t\t\t\tcloseSubNav();\n\t\t\t} else {\n\t\t\t//when menu is closed\n\t\t\t\topenSubNav($(this));\n\t\t\t}\n\t\t});\n\t}", "function toggleMenu(){\n //e.preventDefault;//fixes safari ios bug\n document.querySelector('.leveltwo').classList.toggle('fold');\n //document.querySelector('.boxMinus').style.visibility = 'visible';\n document.querySelector('.boxMinus').classList.toggle('boxHide');\n document.querySelector('.boxPlus').classList.toggle('boxHide');\n }", "toggleMenu() {\n const navEle = document.querySelector('.header-wrapper .navigation');\n\n if (navEle) {\n if (navEle.classList.contains('active')) {\n navEle.classList.remove('active');\n this.showOverlay(false);\n } else {\n navEle.classList.add('active');\n this.showOverlay(true);\n }\n }\n }", "toggle(doToggle) {\n // If the menu is horizontal the sub-menus open below and there is no risk of premature\n // closing of any sub-menus therefore we automatically resolve the callback.\n if (this._menu.orientation === 'horizontal') {\n doToggle();\n }\n this._checkConfigured();\n const siblingItemIsWaiting = !!this._timeoutId;\n const hasPoints = this._points.length > 1;\n if (hasPoints && !siblingItemIsWaiting) {\n if (this._isMovingToSubmenu()) {\n this._startTimeout(doToggle);\n }\n else {\n doToggle();\n }\n }\n else if (!siblingItemIsWaiting) {\n doToggle();\n }\n }", "function toggleMenu(target){\n target.next().hide();\n target.click(function(){\n if($(this).hasClass('open')){\n $(this).removeClass('open').next().slideUp();\n }else {\n target.removeClass('open').next().slideUp();;\n $(this).addClass('open').next().slideDown();;\n }\n });\n }" ]
[ "0.78393286", "0.73902136", "0.7362316", "0.7337262", "0.73360604", "0.73011404", "0.728817", "0.72384167", "0.722282", "0.71938086", "0.71899277", "0.71560705", "0.7154729", "0.7115897", "0.70938075", "0.70915407", "0.70818263", "0.7080277", "0.70679224", "0.7065622", "0.7040053", "0.70399386", "0.7033223", "0.70268154", "0.70229924", "0.7015325", "0.7015325", "0.6977543", "0.6969797", "0.6960069", "0.6958114", "0.69551414", "0.6954002", "0.6948713", "0.69341123", "0.69083846", "0.69083846", "0.69083846", "0.6903435", "0.69001526", "0.68830585", "0.6879046", "0.6874843", "0.6874843", "0.68507516", "0.683894", "0.68374145", "0.68298554", "0.6822883", "0.6818082", "0.6810905", "0.67836857", "0.67718136", "0.6770632", "0.6759705", "0.67496103", "0.6748094", "0.67425215", "0.67402416", "0.67310596", "0.67289335", "0.6727377", "0.6719163", "0.6719163", "0.6715646", "0.6712862", "0.6710655", "0.66974074", "0.66913676", "0.66881025", "0.6682024", "0.66797936", "0.66652805", "0.666377", "0.6658393", "0.66582257", "0.6651992", "0.66484755", "0.66381454", "0.66378146", "0.66358924", "0.6633559", "0.6630881", "0.66126794", "0.6602225", "0.6598952", "0.6597559", "0.65966135", "0.65965277", "0.6590224", "0.6588201", "0.6581524", "0.6566468", "0.655829", "0.6557859", "0.65532374", "0.65503085", "0.6550044", "0.653357", "0.653328", "0.6527261" ]
0.0
-1
i = 1 sss i = 2 ss i = 3 s i = 4
function staircase(n) { let hashes = '' let result = '' for (let i = 1; i <= n; i++) { hashes += '#' // concat n - i amount of spaces let spaces = " ".repeat(n - i) // add another line of correct amount of spaces and hashes result += spaces + hashes + "\n" } console.log(result) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function s(t,e,n,i,r){return r?(r[0]=t,r[1]=e,r[2]=n,r[3]=i,r):[t,e,n,i]}", "function sumConsecutives(s) {\n \n}", "function solution(s) {\n\n}", "function marsExploration(s) {\n let count = 0;\n s = s.split('');\n\n for (let i = 0; i < s.length; i += 3) {\n let newArr = s.slice(i, i + 3);\n if (newArr[0] != 'S') count++;\n if (newArr[1] != 'O') count++;\n if (newArr[2] != 'S') count++;\n }\n return count;\n}", "function repeatedString(s, n) {\n const length = s.length\n const times = Math.floor(n/length)\n const remain = n - times * length\n\n let as = 0\n for (let j = 0; j < s.length; j++) {\n if (s[j] === \"a\") {\n as++\n }\n }\n\n as *= times\n\n for (let i = 0; i < remain; i++) {\n if (s[i] === \"a\") {\n as++\n }\n }\n\n return as\n\n\n\n}", "function oddSubstrings(s){\n return [...s].reduce((count,n,i) => count + (+n % 2 ? i + 1 : 0), 0);\n}", "function marsExploration(s) {\n let scrambled = 0;\n \n let SIdx = 0;\n let OIdx = 1;\n \n for (let i = 0; i < s.length; i++) {\n if (i === OIdx && s[i] !== \"O\") {\n scrambled++;\n } else if ((i === SIdx || i === SIdx + 2) && s[i] !== \"S\") {\n scrambled++;\n }\n \n if (i === SIdx + 2) {\n SIdx += 3;\n OIdx += 3;\n }\n }\n \n return scrambled;\n}", "function S(e,t,a){for(;(a<0?t>0:t<e.length)&&E(e.charAt(t));)t+=a;return t}", "takeHowMany(i, s) {\n const last_index = s.length - 1;\n const current = s[i];\n let current_pair;\n let next_pair;\n\n // If we don't have a value that is part of a surrogate pair, or we're at\n // the end, only take the value at i\n if (!this.isFirstOfSurrogatePair(current) || i === last_index) {\n return 1\n }\n \n // If the array isn't long enough to take another pair after this one, we\n // can only take the current pair\n if ((i + 3) > last_index) {\n return 2\n }\n \n current_pair = current + s[i + 1]\n next_pair = s.substring(i + 2, i + 5)\n \n // Country flags are comprised of two regional indicator symbols,\n // each represented by a surrogate pair.\n // See http://emojipedia.org/flags/\n // If both pairs are regional indicator symbols, take 4\n if (this.isRegionalIndicatorSymbol(current_pair) &&\n this.isRegionalIndicatorSymbol(next_pair)) {\n return 4\n }\n \n // If the next pair make a Fitzpatrick skin tone\n // modifier, take 4\n // See http://emojipedia.org/modifiers/\n // Technically, only some code points are meant to be\n // combined with the skin tone modifiers. This function\n // does not check the current pair to see if it is\n // one of them.\n if (this.isFitzPatrickModifier(next_pair)) {\n return 4\n }\n \n return 2\n }", "function countWaysToSplit(s) {\n let counter = 0;\n for (let i = 1; i < s.length - 1; i++) {\n const a = s.slice(0, i);\n for (let j = i + 1; j < s.length; j++) {\n const b = s.slice(i, j);\n const c = s.slice(j, s.length);\n const ab = a + b;\n const bc = b + c;\n const ca = c + a;\n if (ab != bc && bc != ca && ca != ab) {\n counter++;\n }\n }\n }\n return counter;\n}", "function s(c, l, a) {\n a = a || 0;\n for (var i = 0; i < l; i++) {\n this.push(c);\n c += a;\n }\n}", "function s(c, l, a) {\n a = a || 0;\n for (var i = 0; i < l; i++) {\n this.push(c);\n c += a;\n }\n}", "function findIs () {\n var countIs = [];\n\n for (var i = 0; i < strings.length; i++) {\n var word = strings[i];\n for (var count = 0; count < word.length; count++){\n if (word[count] === \"i\" && word[count+1] === \"s\"){\n countIs.push(word);\n }\n }\n } return countIs;\n}", "function s(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "function printManyTimes(str) {\n const SENTENCE = str + \" is cool!\";\n for (let i = 0; i < str.length; i+=2) {\n console.log(SENTENCE);\n }\n \n }", "function printManyTimes(str){\n const SENTENCE= str+ \" is cool!\";\n for(let i=0;i<SENTENCE.length;i+=2){\n console.log(SENTENCE);\n \n }\n}", "function stringShifter(s) {\n let counter = 0;\n for(let i=0; i < s.length; i++) {\n let tempVar = s.substring(i, s.length)+s.slice(0,i);\n if(tempVar[0] === tempVar[tempVar.length-1]) {\n counter++;\n }\n }\n return counter;\n}", "function t$i(t,...n){let o=\"\";for(let r=0;r<n.length;r++)o+=t[r]+n[r];return o+=t[t.length-1],o}", "function repeatedString(s, n){\r\n var countA=s=>s.split('a').length-1;\r\n \r\n let len= s.length \r\n let fl=Math.floor(n/len);\r\n let remainder=s.slice(0,n%len);\r\n \r\n return fl*countA(s)+countA(remainder);\r\n }", "function sg(i, e){\n\n}", "function StrSymmetryPoint(S) {\n var i, j;\n \n if (S.length === 0 || S.length % 2 === 0) {\n return -1;\n }\n \n if (S.length === 1) {\n return 0;\n }\n\n i = 0;\n j = S.length - 1;\n \n while (i !== j) {\n if (S[i] !== S[j]) {\n return -1;\n }\n \n i += 1;\n j -= 1;\n }\n \n return i;\n}", "function s(c, l, a) {\n a = a || 0;\n for (var i = 0; i < l; i++) {\n this.push(c);\n c += a;\n }\n }", "function s(c, l, a) {\n a = a || 0;\n for (var i = 0; i < l; i++) {\n this.push(c);\n c += a;\n }\n }", "function sp(n = 1){\n for( let i = 0; i < n; i++ ){\n s();\n }\n}", "function printManyTimes(str) {\n \"use strict\";\n\n const SENTENCE = str + \" is cool!\";\n for(let i = 0; i < str.length; i+=2) {\n console.log(SENTENCE);\n }\n}", "function repeatedString(s, n) {\n let numA = s.split('').filter(x => x === 'a').length;\n if (Number.isInteger(n / s.length)) {\n return n / s.length * numA;\n } else {\n let extra = n - (Math.floor(n / s.length) * s.length);\n let plus = 0;\n s.split('').forEach((ele, i, a) => { \n if (i < extra && ele === 'a') {\n plus++;\n console.log(plus);\n } \n })\n return Math.floor(n / s.length) * numA + plus;\n }\n}", "function printManyTimes(str){\n \"use strict\";\n const SENTENCE = str + \" is cool!\";\n for (let i = 0; i < str.length; i += 2){\n console.log(SENTENCE);\n }\n}", "function solve(s) {\n let subStrings = [];\n for (let index = 0; index < s.length; index++) {\n for (let index2 = index; index2 < s.length; index2++) {\n let subString = s.slice(index, index2 + 1);\n subStrings.push(subString);\n }\n }\n return subStrings.reduce((count, subStr) => {\n if (Number(subStr) % 2 === 1) {\n count += 1;\n }\n return count;\n }, 0);\n}", "function main() {\n var S = readLine();\n var other = 0;\n var s = 'S'.charCodeAt();\n var o = 'O'.charCodeAt();\n for (i = 0; i < S.length; i+= 3){\n \n if( S[i].charCodeAt() != s){\n other++\n } \n \n if (S[i+1].charCodeAt() != o){\n other++\n } \n \n if(S[i+2].charCodeAt() != s){\n other++\n }\n }\n console.log(other);\n}", "function findIs(){\n var is = [];\n for ( i=0; i<strings[i].length; i++ ){\n var word = strings[i];\n for (count = 0; count < word.length; count++) {\n if (word[count] === \"i\" && word[count + 1] === \"s\"){\n is.push(word);\n }\n }\n }return is;\n}", "function repeatedString(s, n) {\n // Write your code here\n let fix = Math.floor(n / s.length);\n let count = countA(s) * fix;\n \n let leftOut = n % s.length;\n count = count + countA(s.substring(0,leftOut));\n return count;\n \n}", "function lastpris (n, m, s) {\n\treturn (m + s - 2) % n + 1;\n}", "function printManyTimes(str) {\n \"use strict\";\n\n const SENTENCE = str + \"is cool!\";\n\n // sentence = str + \"is amazing!\";\n\n for (let i = 0; i < str.length; i += 2) {\n console.log(SENTENCE);\n }\n}", "function repeatedString(s, n) {\n if (s === 'a') { return n }\n const getAs = chars => chars.split('').filter(char => char === 'a').length;\n \n const completeS = Math.trunc(n / s.length);\n let totalA = getAs(s) * completeS;\n\n const partialS = n % s.length;\n totalA += getAs(s.slice(0, partialS));\n\n return totalA;\n}", "function s$2(c, l, a) {\n a = a || 0;\n for (var i = 0; i < l; i++) {\n this.push(c);\n c += a;\n }\n}", "function ssStates(array) {\n var ssStatesArray = [];\n array.forEach(function(element) {\n var s = 0;\n var charArray = element.split('');\n charArray.forEach(function(letter) {\n if (letter == 's') {\n s++;\n }\n });\n if (s >= 2) {\n ssStatesArray.push(element);\n }\n });\n return ssStatesArray;\n}", "function marsExploration(s) {\n // Write your code here\n let expectedWords = s.length / 3;\n let expectedString = '';\n let changedLetters = 0;\n\n for (let x = 0; x < expectedWords; x++) {\n expectedString += 'SOS';\n }\n console.log('es', expectedString)\n for (let y = 0; y < s.length; y++){\n if (s[y] != expectedString[y]) {\n changedLetters++;\n }\n }\n\n return changedLetters;\n}", "function repeatedString(s, n) {\n let counter = 0;\n for (let i = 0; i < s.length; i++) {\n if (s[i] === \"a\") {\n counter += 1;\n }\n }\n if (n % s.length === 0) {\n let multiplier = n / s.length;\n return counter * multiplier;\n } else {\n let remainder = n % s.length;\n let multiplier = Math.floor(n / s.length);\n let extra = 0;\n for (let j = 0; j < remainder; j++) {\n if (s[j] === \"a\") {\n extra += 1;\n }\n }\n return counter * multiplier + extra;\n }\n}", "function stairsIn20(s){\n return s.reduce((arr, day) => arr.concat(day)).reduce((acc, n) => acc + n) * 20;\n}", "function s(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function s(t, i) {\n for (; i + 1 < t.length; i++)\n t[i] = t[i + 1];\n t.pop()\n }", "function printManyTimes(str) {\n \"use strict\";\n //endre til var til const\n //når du er sikker på at du ikke vil reassgine en variable\n //CAPS for å huske\n const SENTENCE = str + \" is cool\";\n\n //change to LET fordi:\n for (let i = 0; i < str.length; i += 2) {\n console.log(SENTENCE);\n }\n}", "function marsExploration(s) {\n let radiation = s;\n\n let total = 0;\n\n let j = 0;\n\n while (j < radiation.length) {\n if (radiation.indexOf('SOS') === 0) {\n radiation = radiation.slice(3);\n continue;\n }\n\n if (radiation[j] != 'S') {\n total++;\n }\n\n if (radiation[j + 1] != 'O') {\n total++;\n }\n\n if (radiation[j + 2] != 'S') {\n total++;\n }\n\n j += 3;\n }\n\n return total;\n}", "function interseccion( sset, ssubset )\n{\n\tif ( sset == \"\" || ssubset == null) return \"\";\n\n\tvar set = new String(sset).split(\",\");\n\tvar subset = new String(ssubset+\",\");\t//suspend_data empieza por , y acaba sin ella\n\n\tvar elementos=0;\n\tfor (var i=0;i<set.length;i++ )\n\t{\n\t\tif ( subset.indexOf(\",\"+set[i]+\",\")!= -1 ) elementos++;\n\t}\n\treturn elementos;\n}", "function singles(number) {\n input = \"\";\n for (var i = 1; i <= number; i +=1) {\n input += \"I\";\n if (i === 4) {\n input = \"IV\";\n } else if (i === 5) {\n input = \"V\";\n } else if (i === 9) {\n input = \"IX\";\n } else {}\n };\n return input;\n }", "function repeatedString(s, n) {\n /*while the string length is less than n, we want to concatenate the string on itself\n then we want to slice it at n\n then we make a new array and slice on each letter\n then we have an aCount and a for loop that says if array[i] === 'a' then aCount incerments\n then we return aCount\n */\n\n /*second way...\n do the loop first, see what a count is\n divide n by sting.length\n multiply by aCount?\n */\n let aCount = 0\n for (let i = 0; i < s.length; i++) {\n if (s[i] === 'a')\n aCount++\n }\n return Math.round(aCount * (n / s.length))\n //something here... possibly with modulo remainder, to add... 16/23 passed\n\n\n}", "function s$1(c, l, a) {\n a = a || 0;\n for (var i = 0; i < l; i++) {\n this.push(c);\n c += a;\n }\n}", "function repeatedString(s, n) {\n const repeats = n % s.length;\n const repeatMath = (n - repeats)/ s.length;\n let count = 0;\n\n for(let i = 0; i < s.length; i++) {\n if(s[i] === \"a\") {\n count += repeatMath + (i < repeats);\n }\n }\n return count;\n}", "function repeatedString(s, n) {\n const repeats = n % s.length;\n const repeatMath = (n - repeats)/ s.length;\n let count = 0;\n\n for(let i = 0; i < s.length; i++) {\n if(s[i] === \"a\") {\n count += repeatMath + (i < repeats);\n }\n }\n return count;\n}", "function repeatedString(s, n) {\n const sLength = s.length;\n const remainder = n % sLength;\n const times = (n - remainder) / sLength;\n let aCount = 0;\n let theRest = 0;\n for (let i = 0, j = 0; i < sLength; i += 1, j += 1) {\n const char = s.charAt(i);\n if (char === 'a') {\n aCount += 1;\n if (j < remainder) {\n theRest += 1;\n }\n }\n }\n return aCount * times + theRest;\n}", "function aa(n){\r\n var a=1\r\n for(var i=1;i<=n;i++){\r\n var str=\"\"\r\n for(var j=i;j>=1;j--){\r\n str=str+(j%2)\r\n \r\n }\r\n console.log(str)\r\n }\r\n \r\n }", "function solve(s) {\n // Write your code here\n const ht = {};\n let retstr = '';\n \n for(let i=0; i<s.length; i++) {\n if(ht[s[i]] !== undefined) {\n if(s[i] === s[i-1]) {\n continue\n }\n else {\n retstr += s[i]\n }\n }\n else {\n ht[s[i]] = s[i]\n retstr += s[i]\n }\n }\n s = retstr\n return s\n}", "function repeatedString(s, n) {\n var count = 0;\n var sum = 0;\n var aTail = 0;\n var array = s.split('');\n var sumEnter = (n - n % array.length) / array.length;\n var tail = n - (sumEnter * array.length);\n console.log('sumEnter ' + sumEnter);\n console.log('tail ' + tail);\n\n for (var i = 0; i < array.length; i++) {\n if ('a' == array[i]) {\n count++;\n }\n }\n\n if (n % array.length == 0) {\n sum = count * (n / array.length);\n } else {\n tail = s.substring(0, tail).split('');\n console.log('qwerty' + tail);\n tail.forEach(element => {\n if (element === 'a') {\n aTail++;\n }\n });\n sum = count * sumEnter + aTail;\n }\n console.log('sum ' + sum);\n return sum;\n}", "function consecutivosSimilares(string) {\n let sum = 0;\n\n for (let i = 1; i < string.length; i++) {\n if (string[i - 1] === string[i]) {\n sum++;\n }\n }\n return sum;\n}", "function sslothable(s, n) {\n if\n (\n (s == 4 && n == 37) ||\n (s == 5 && n == 38) ||\n (s == 6 && n == 39) ||\n (s == 7 && n == 40) ||\n (s == 8 && n == 41) ||\n (s == 9 && n == 42) ||\n (s == 10 && n == 43) ||\n (s == 11 && n == 43) ||\n (s == 12 && n == 44) ||\n (s == 13 && n == 45)\n ) {\n return true;\n }\n else {\n return false;\n }\n}", "function calculateSquareAround(s){\n \n return s * 4;\n}", "function LV(i) {\n if (i <= 1) {\n return 0;\n }\n return THETA * (i - 1) * (S + i - 1);\n}", "function countingValleys(s) {\n let counter = 0\n let valleys = 0\n for(var i=0; i<s.length;i++){\n if(s[i] == \"F\"){\n console.log(\"forward\")\n } else if (s[i] == \"D\"){\n counter -= 1\n } else if (s[i] == \"U\"){\n counter += 1\n if(counter == 0){\n valleys += 1\n }\n }\n }\n return valleys\n }", "function solve(s){\n if (s.length % 2 !== 0) return -1;\n\n var openedCount = 0\n var swapped = 0;\n var count;\n\n for (let i = 0; i < s.length; i++) {\n let bracket = s[i];\n if (bracket === \"(\") {\n openedCount++;\n }\n if (bracket === \")\") {\n if (openedCount > 0)\n openedCount--;\n else {\n openedCount++;\n swapped++;\n }\n }\n }\n count = openedCount / 2 + swapped;\n return count;\n}", "function printManyTimes(str) {\n \"use strict\";\n \n // change code below this line\n \n \n for(let i = 0; i < str.length; i+=2) {\n const SENTENCE = str + \" is cool!\";\n console.log(SENTENCE);\n }\n \n // change code above this line\n \n }", "function main() {\n var s = parseInt(readLine());\n for(var a0 = 0; a0 < s; a0++){\n var n = parseInt(readLine()); \n function stairs(n) {\n if ( n === 0) {\n return 0;\n }\n\n stairs.cache = stairs.cache || {};\n if (Number.isInteger(stairs.cache[n])) {\n return stairs.cache[n];\n }\n\n const arr = [1, 2, 4];\n if (n < 4) {\n return arr[n - 1]; \n }\n\n stairs.cache[n] = stairs(n - 1) + stairs(n - 2) + stairs(n - 3);\n return stairs.cache[n];\n }\n console.log(stairs(n))\n }\n \n\n}", "function staircase(n) {\n let hash = \"#\";\n let space = \" \";\n let x = n - 1;\n let y = n - (n - 1);\n for (let i = 0; i < n; i++) {\n console.log(`${space.repeat(x)}${hash.repeat(y)}`);\n x -= 1;\n y += 1;\n }\n}", "function eval_stream(s, n) {\n if (n === 0) {\n return [];\n } else {\n return pair(head(s),\n eval_stream(stream_tail(s),\n n - 1));\n }\n}", "function printManyTimes(str) {\n \"use strict\";\n const sentence = str + \" is cool!\";\n for (let i = 0; i < str.length; i += 2) {\n console.log(sentence);\n }\n}", "function repeatStr (n, s) {\n\t\t//your code is here\n\t\tvar result = \"\"\n\t\tfor(var i = 0; i < s; i++){\n\t\t\tresult+= n;\n\t\t}\n\t\treturn result;\n\t}", "function s(s) {\n // const map = \"$abcdefghijklmnopqrstuvwxyz\"\n // .split(\"\")\n // .reduce((acc, char, idx) => ({ ...acc, [char]: idx }), {});\n\n return helper(0);\n\n function helper(i) {\n if (i >= s.length) {\n return 1;\n }\n if (s[i] === \"0\") {\n return 0;\n }\n\n let ways = helper(s, i + 1);\n if (i + 2 <= s.length && Number(s.substring(i, i + 2)) <= 26) {\n ways += helper(i + 2);\n }\n return ways;\n }\n}", "static get S() {\n return [\n [1, 0],\n [0, i]\n ];\n }", "function sherlockAndAnagrams(s) {\n let counter = 0;\n let hashMap = {};\n\n for (let i = 0; i < s.length; i++) {\n for (let j = i + 1; j < s.length + 1; j++) {\n let sub = s.slice(i, j);\n sub = sub.split('').sort().join('');\n if (hashMap[sub]) {\n // at least two anagrams were found.\n // tricky here, we need to count number of pair occurances.\n // we need to sum from 1 to n-1 (triangular number).\n //for example: n=5 ,sum = 1+2+3+4 = 10 pair of anagrams\n counter += hashMap[sub];\n hashMap[sub]++;\n } else {\n hashMap[sub] = 1;\n }\n }\n }\n return counter;\n}", "function pofi(n) {\n return [\"1\", \"i\", \"-1\", \"-i\"][n % 4];\n}", "function staircase(n) {\n var space = \" \";\n var pound = \"#\";\n for (var i = 1; i <= n; i++) {\n while (i <=n) {\n return space.repeat(n-i) + pound.repeat(i);\n }\n }\n}", "function countingValleys(n, s) {\n s = s.split('');\n let level = 0, countValey = 0;\n for (let el of s) {\n el === 'U' ? level++ : level--;\n el === 'U' && level === 0 ? countValey++ : ''\n }\n return countValey;\n}", "function repeatStr (n, s) {\n\t\tvar str=\"\"\n\t\tfor (var i =0 ;i<s; i++) {\n\t\t\tstr+=n\n\t\t}\n\t\treturn str\n\t}", "function threeEx(string, i) {\n return string.slice(0, i) + string.slice(i + 1);\n}", "function r(e,t){var n=i.length?i.pop():[],r=s.length?s.pop():[],a=o(e,t,n,r);return n.length=0,r.length=0,i.push(n),s.push(r),a}", "function getSrepeatCount() {\r\n srepeat_examples = [];\r\n srepeats_for_sentences = [];\r\n result = [];\r\n for(i=0; i<sentences.length; i++) {\r\n sentence = [];\r\n sentence = sentences[i].replace(/[^a-zA-Zа-яА-ЯёЁ \\n']/g, \" \");\r\n sentence = sentence.replace(/\\s+/g, \" \");\r\n sentence = sentence.toLowerCase();\r\n sentence = sentence.substring(0,sentence.length-1);\r\n sentence = sentence.split(\" \");\r\n \r\n sub_result = sentence.reduce(function (acc, el) {\r\n acc[el] = (acc[el] || 0) + 1;\r\n return acc;\r\n }, {});\r\n\r\n tmp = [];\r\n for(key in sub_result) {\r\n if(sub_result[key] > 1 && unions.indexOf(key) == -1 && prepositions.indexOf(key) == -1) {\r\n tmp.push(key);\r\n result.push(key);\r\n }\r\n }\r\n srepeat_examples.push([sentences[i], tmp]);\r\n }\r\n tmp = []\r\n for(key in srepeat_examples) {\r\n tmp = []\r\n for(i=0; i<srepeat_examples[key][1].length; i++){\r\n if(srepeat_examples[key][1].length != 0) {\r\n if(srepeat_examples[key][1][i] != \"'\" || srepeat_examples[key][1][i] == \"i\") {\r\n tmp.push(srepeat_examples[key][1][i])\r\n }\r\n }\r\n }\r\n srepeat_examples[key][1] = tmp;\r\n }\r\n\r\n count = 0;\r\n for(i=0; i<srepeat_examples.length; i++) {\r\n if(srepeat_examples[i][1].length != 0) {\r\n for(j=0; j<srepeat_examples[i][1].length; j++) {\r\n count++;\r\n }\r\n }\r\n }\r\n\r\n return count;\r\n}", "function main() {\n var S = readLine();\n\n var damagedSignalCount = 0;\n\n //loop through string in sets of three, seeking S, O and S at appropriate relative subindex within three positions\n for (var i = 0; i < S.length; i += 3) {\n \tif (S.charAt(i) !== \"S\") {\n \t\tdamagedSignalCount += 1;\n \t}\n \tif (S.charAt(i+1) !== \"O\") {\n \t\tdamagedSignalCount += 1;\n \t}\n \tif (S.charAt(i+2) !== \"S\") {\n \t\tdamagedSignalCount += 1;\n \t}\n }\n\n //print total variance\n console.log(damagedSignalCount);\n\n}", "function getSpine(cs) {\n var a = cs[1]\n var w = detag(a)\n var rs = Array(w - 1).fill()\n for (var i = 0; i < w - 1; i++) {\n var x = cs[3 + i]\n var t = tagOf(x)\n if (R != t)\n throw \"*** getSpine: unexpected tag=\" + t\n rs[i] = detag(x)\n }\n//trace('getSpine', cs, rs)\n return rs;\n}", "function fn(s) {\n\tvar freq = [];\n\t(function(n) {\n\t\twhile (n < 26) {\n\t\t\tfreq.push(0);\n\t\t\tn++;\n\t\t}\n\t})(0);\n\tvar current;\n\tvar dual;\n\tfor (let i = 0; i < s.length; i++) {\n\t\tif (i < s.length - 3 && s[i + 1] === '(') {\n\t\t\tcurrent = freq[s[i] - 1];\n\t\t\tcurrent += +s[i + 2];\n\t\t\tfreq[s[i] - 1] = current;\n\t\t\ti += 3;\n\t\t} else if (i < s.length - 2 && s[i + 2] === '#') {\n\t\t\t\n\t\t\tif (i < s.length - 5 && s[i + 3] === '(') {\n\t\t\t\tdual = s[i] + s[i + 1] - 1;\n\t\t\t\tcurrent = freq[+dual];\n\t\t\t\tcurrent += +s[i + 4];\n\t\t\t\tfreq[+dual] = current;\n\t\t\t\ti += 5;\n\t\t\t} else {\n\t\t\t\tdual = s[i] + s[i + 1] - 1;\n\t\t\t\tcurrent = freq[+dual];\n\t\t\t\tcurrent++\n\t\t\t\tfreq[+dual] = current;\n\t\t\t\ti += 2;\n\t\t\t}\n\n\t\t} else {\n\t\t\tcurrent = freq[s[i] - 1];\n\t\t\tcurrent++\n\t\t\tfreq[s[i] - 1] = current;\n\t\t}\n\t}\n\treturn freq;\n}", "function makeStim(i) {\n\n var condition = _.sample([\" all of them \",\" any of them \"]);\n var sentence = stimuli[i];\n\n //segment 4\n if (sentence.type != \"critical\") {\n var segment4 = sentence.segment4;\n } else {\n var segment4 = _.sample([\" some of them \",\" only some of them \"]);\n }\n //segment2\n if (sentence.type == \"critical\") {\n var segment2 = sentence.segment2a + condition + sentence.segment2b;\n } else {\n var segment2 = sentence.segment2;\n }\n //comprehension\n var comque = sentence.comque\n var answer1 = _.sample([sentence.corans, sentence.incorans])\n if (answer1 == sentence.corans) {\n var answer2 = sentence.incorans\n } else {\n var answer2 = sentence.corans\n }\n\n var stimuli_sentence = sentence.segment1 + segment2 + sentence.segment3 +\n segment4 + sentence.segment5 + sentence.segment6 + sentence.segment7 +\n sentence.segment8 + sentence.segment9 + sentence.segment10 + sentence.segment11 +\n sentence.segment12\n\n var full_sentence = [sentence.segment1, segment2, sentence.segment3,\n segment4, sentence.segment5, sentence.segment6, sentence.segment7,\n sentence.segment8, sentence.segment9, sentence.segment10, sentence.segment11,\n sentence.segment12];\n\n exp.all_stims.push({\n \"condition\": condition,\n \"segment4\": segment4,\n \"type\": sentence.type,\n \"segment1\": sentence.segment1,\n \"segment2\": segment2,\n \"segment3\": sentence.segment3,\n \"segment4\": segment4,\n \"segment5\": sentence.segment5,\n \"segment6\": sentence.segment6,\n \"segment7\": sentence.segment7,\n \"segment8\": sentence.segment8,\n \"segment9\": sentence.segment9,\n \"segment10\": sentence.segment10,\n \"segment11\": sentence.segment11,\n \"segment12\": sentence.segment12,\n \"comque\": sentence.comque,\n \"corans\": sentence.corans,\n \"answer1\": answer1,\n \"answer2\": answer2,\n \"sentence\": full_sentence,\n \"complete_sentence\": stimuli_sentence\n });\n }", "function jk(n){\r\n for(var i=1;i<=n;i++){\r\n var str=\"\"\r\n for(var j=n;j>=i;j--){\r\n if(i<=3){\r\n str=str+(i)\r\n }\r\n else{\r\n str=str+(6-i)\r\n }\r\n \r\n }\r\n console.log(str)\r\n }\r\n \r\n }", "function it(t, n) {\n return t + \" \" + n + (1 === t ? \"\" : \"s\");\n}", "function word_to_sseq(word) {\n\tres = [];\n\tfor(char of word) {\n\t\tsplit = split_char_map[char];\n\t\tif(split)\n\t\t\tres = res.concat(split);\n\t\telse\n\t\t\tres.push(char);\n\t}\n\treturn res;\n}", "function groupBy(s, n) {\r\n var result = \"\";\r\n for (var i = 0; i < s.length; i++) {\r\n if (i % n == 0 && i > 0) {\r\n result += \" \";\r\n }\r\n result += s[i];\r\n }\r\n return result;\r\n}", "function solve(s){\n let countL=0;\n let countU=0\n for(let i=0; i<s.length; i++){\n if(s[i]==s[i].toLowerCase()){\n countL++\n }\n if(s[i]==s[i].toUpperCase()){\n countU++\n }\n }\n if(countU==countL) {return s.toLowerCase()}\n if(countU>countL) {return s.toUpperCase()}\n if(countU<countL) {return s.toLowerCase()}\n\n}", "function front_times(string, n){\n var str = string.substring(0, 3);\n var newString = \"\";\n for (var i = 0; i < n; i++){\n newString += str;\n }\n return newString;\n}", "function iqTest(numbers){\n const even = [], odd = [];\n numbers = numbers.split(' ').map( x => { return parseInt(x) });\n numbers.map(function(x){\n if(x % 2 == 0)\n even.push(numbers.indexOf(x) + 1)\n else\n odd.push(numbers.indexOf(x) + 1)\n })\n return even.length > odd.length ? odd[0] : even[0]\n}", "function five(n){\r\n for(var i=1;i<=n;i++){\r\n var str=\"\"\r\n kk=n+1-i\r\n for(var k=1;k<i;k++){\r\n str=str+(kk)\r\n kk++\r\n }\r\n for(var j=i;j<=n;j++){\r\n str=str+(\"5\")\r\n }\r\n console.log(str)\r\n }\r\n \r\n }", "function encryption(s) {\n var rowC = Math.floor(Math.sqrt(s.length));\n var columns = Math.ceil(Math.sqrt(s.length));\n var result = '';\n var count = 0;\n console.log(rowC);\n console.log(columns);\n\n for (var j = 0; j <= rowC; j++) {\n for (var i = j; i < s.length && count < columns; i = i + columns) {\n\n result = result + s[i];\n /*count++;\n if (count % rowC == 0 || i+columns > s.length) {\n result = result + ' ';\n }\n console.log(result);\n console.log(i); */\n\n }\n result = result + ' ';\n count++;\n console.log(result);\n }\n return result;\n}", "function repeatedString(s,n) {\n //Check if there are any a's in the input string\n if (!s.includes('a')) {\n return 0;\n }\n //Find number of matches in original string\n const matches = s.match(/a/g).length;\n //Find number of full repeats needed\n const repeats = Math.floor(n / s.length);\n //Calculate initial result\n let initialResult = matches * repeats;\n //Find how many extra characters are needed\n const remainder = n % s.length;\n //If there is a remainder, add the number of 'a's from it\n if (remainder !== 0) {\n const extras = s.slice(0,remainder).match(/a/g);\n if (extras !== null) {\n return initialResult + extras.length;\n }\n } \n return initialResult;\n}", "function sc(screws) {\n if (!screws || !screws.length) return 0;\n\n const move = 1;\n const remove = 1;\n const swapTool = 5;\n\n let time = 1;\n\n for (let i = 1; i < screws.length; i++) {\n time += move + remove + (screws[i] === screws[i - 1] ? 0 : swapTool);\n }\n\n return time;\n}", "function stairsIn20(s) {\n let total = 0\n for (i = 0; i < s.length; i++) {\n let dayCount = 0\n for (j = 0; j < s[i].length; j++) {\n dayCount += s[i][j]\n }\n total += dayCount\n }\n return total * 20\n}", "function staircase(n) {\n // Write your code here\n let stairs = '#'\n let spaces = Array(n).join(' ')\n for (let i=0; i < n; i++) {\n console.log(spaces + stairs)\n stairs += '#'\n spaces = Array(n - 1 - i).join(' ')\n }\n\n}", "function printManyTimes(str) {\n \"use strict\";\n \n // change code below this line\n \n const SENTENCE = str + \" is cool!\";\n for(let i = 0; i < str.length; i+=2) {\n console.log(SENTENCE);\n }\n \n // change code above this line\n \n }", "function substrings(n){\n /* \n \tWanted to try something with ASCII and String.fromCharCode(i), but it seems too hard for me tonight\n */\n let abc = \"abcdefghijklmnopqrstuvwxyz\";\n for (let i = 0; i < n; i++){\n for (let j = i + 1; j < n + 1; j++){\n \tconsole.log(abc.slice(i, j));\n \t}\n } \n}", "function repeatStr(n, s) {\n\t// create a newStr variable and assign to an empty string to concat elements\n\tlet newStr = '';\n\t// iterate through starting at 0 and ending at number\n\tfor (let i = 0; i < n; i++) {\n\t\t// join together the strings\n\t\tnewStr += s;\n\t}\n\t// return the new str\n\treturn newStr;\n}", "function ex_2_I(a) {\n var tot = 0;\n for(i = 0; i < a; ++i) {\n tot += 1 + 2 * i;\n }\n return tot;\n}", "function solve2(s) {\n // Write your code here\n let ret_str = ''\n for (let i = 0; i < s.length; i++) {\n if (s[i] !== s[i+1] || i + 1 > s.length) ret_str += s[i]\n }\n // console.log(ret_str)\n return ret_str\n}", "function sherlockAndAnagrams(s) {\n let count = 0;\n //글자 수\n for (let i = 1; i < s.length; i++) {\n for (let j = 0; j < s.length - i; j++) {\n const target = s.substring(j, j + i, j);\n // console.log(\"-------\");\n for (let k = 1 + j; k < s.length - i + 1; k++) {\n let compared = s.substring(k, k + i);\n if (isAnagram(target, compared)) {\n count++;\n }\n }\n }\n }\n return count;\n}", "function jewelsAndStones(strJ, strS){\n let jewels = new Map();\n let count = 0;\n for(let i = 0; i < strJ.length; i++){\n let currentLetter = strJ.charAt(i);\n if(!jewels.has(currentLetter)){\n jewels.set(currentLetter, i);\n } \n }\n for(let j = 0; j < strS.length; j++){\n let currentStone = strS.charAt(j);\n if(jewels.has(currentStone)){\n count++;\n }\n }\n return count;\n}", "function accum(s) {\n let result = [];\n \n for (let i = 0; i < s.length; i++) {\n const firstChar = s[i].toUpperCase();\n const repeatingChar = s[i].toLowerCase().repeat(i);\n result.push(firstChar + repeatingChar);\n }\n return result.join('-')\n}", "function googleInterview1(str) {\n\n for(i = 0; i < str.length; i = i + 1) {\n console.log(str[i])\n }\n}" ]
[ "0.67079896", "0.63269496", "0.59213847", "0.5896417", "0.58526134", "0.583644", "0.5830061", "0.5802946", "0.5802124", "0.57975495", "0.572009", "0.572009", "0.5715825", "0.56932217", "0.5657332", "0.5652202", "0.5650859", "0.5647468", "0.56297094", "0.5618851", "0.5602054", "0.5586707", "0.5586707", "0.5581847", "0.55812675", "0.5576922", "0.55601376", "0.55502677", "0.5536475", "0.55305195", "0.5527576", "0.5514449", "0.5499796", "0.5490988", "0.5475454", "0.5462785", "0.5460801", "0.5459347", "0.5451458", "0.5445306", "0.5437702", "0.54367656", "0.5431503", "0.54256517", "0.5410426", "0.53913814", "0.5391115", "0.53812844", "0.53812844", "0.53802586", "0.534434", "0.53139305", "0.53055274", "0.53034896", "0.5285905", "0.52849716", "0.52834964", "0.5282033", "0.52714187", "0.52678186", "0.5263838", "0.52557117", "0.5254465", "0.52524483", "0.5245929", "0.5243866", "0.52434653", "0.52354383", "0.5234033", "0.52338874", "0.5233201", "0.5232959", "0.5215059", "0.52071416", "0.5198681", "0.5196332", "0.51931167", "0.51901615", "0.5189019", "0.51766884", "0.5176265", "0.51755977", "0.5174551", "0.5173076", "0.51724607", "0.5170216", "0.51659924", "0.51623785", "0.51558757", "0.51516986", "0.5151665", "0.5151124", "0.5149763", "0.51475656", "0.5140672", "0.51357985", "0.5134974", "0.51310235", "0.51285154", "0.5127379", "0.5127169" ]
0.0
-1
function that well, deletes an entry
function deleteData(tableId, id){ var deleteItem = "delete" + id; //will match assigned hidden ID's var table = document.getElementById("exerciseTable"); var numRows = table.rows.length; for(var i = 1; i < numRows; i++){ var row = table.rows[i]; var findData = row.getElementsByTagName("td"); var erase = findData[findData.length -1]; if(erase.children[1].id === deleteItem){ //matches delete ID with row table.deleteRow(i); i = numRows; } } var req = new XMLHttpRequest(); req.open("GET", "/delete?id=" + id, true); req.addEventListener("load",function(){ if(req.status >= 200 && req.status < 400){ console.log('success'); } else { console.log('error'); } }); req.send("/delete?id=" + id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteEntry(ENTRY){\n ENTRY_LIST.splice(ENTRY.id,1)\n updateUI()\n}", "function deleteEntry(entry){\n ENTRY_LIST.splice(entry.id, 1);\n// after we call the deleteEntry funciton we need to update the Total values again\n updateUI();\n }", "function deleteEntry(id) {\n API.deleteEntry(id)\n }", "_onTempDelete(entry) {\n this._removeEntries([entry])\n }", "async function deleteEntry() {\n\n\t\t// 1) Delete the entry from the database by title\n\t\tawait Snapshot.destroy({\n\t\t\twhere: {\n\t\t\t\tTitle: req.params.title\n\t\t\t}\n\t\t});\n\n\t\tres.sendStatus(200).end()\n\t}", "function deleteEntry (req, res) {\n logger.debug('Request recieved to cease entry by id', { loggerModule, URL: req.originalUrl, id: req.params.id })\n _performDatabaseUpdate(req, res, {endDate: new Date()})\n }", "static deleteEntry(path) {\n Databases.fileMetaDataDb.remove({path: path}, (err, numDeleted) => {\n if (err) {\n console.log(err);\n }\n });\n }", "deleteEntry(id) {\n if (id == null) { return this._rejectRequired('deleteEntry', 'id'); }\n let method = 'delete';\n let path = `/${this._userName}/${this._blogId}/atom/entry/${id}`;\n let statusCode = 200;\n return this._request({ method, path, statusCode });\n }", "function _deleteEntry() {\n\t\ttry {\n\t\t\t//Get the Request Body\n\t\t\tvar oBody = JSON.parse($.request.body.asString());\n\n\t\t\t//Get the Database connection\n\t\t\tvar oConnection = $.db.getConnection();\n\n\t\t\t//Build the Statement to delete the entries\n\t\t\tvar oStatement = oConnection.prepareStatement(\"DELETE FROM \\\"\" + gvSchemaName + \"\\\".\\\"\" + gvTableName +\n\t\t\t\t\"\\\" WHERE CONDITION_ID = ? AND ITEM = ?\");\n\n\t\t\t//Condition Id\n\t\t\toStatement.setInt(1, parseInt(oBody.CONDITION_ID));\n\t\t\toStatement.setInt(2, parseInt(oBody.ITEM));\n\n\t\t\toStatement.addBatch();\n\n\t\t\t//Execute the Insert\n\t\t\toStatement.executeBatch();\n\n\t\t\t//Close the connection\n\t\t\toStatement.close();\n\t\t\toConnection.commit();\n\t\t\toConnection.close();\n\n\t\t\tgvTableUpdate = \"Table entries deleted successfully from Table:\" + gvTableName + \";\";\n\t\t\tgvStatus = \"Success\";\n\n\t\t} catch (errorObj) {\n\t\t\tif (oStatement !== null) {\n\t\t\t\toStatement.close();\n\t\t\t}\n\t\t\tif (oConnection !== null) {\n\t\t\t\toConnection.close();\n\t\t\t}\n\t\t\tgvTableUpdate = \"There was a problem deleting entries in the Table: \" + gvTableName + \", Error: \" + errorObj.message + \";\";\n\t\t\tgvStatus = \"Error\";\n\t\t}\n\t}", "function removeEntry(entryId) {\n return Restangular.one(foodDiaryEndpoint, entryId).remove();\n }", "function deleteblogrecoed(jah){\n\t//var deleteref = firebase.database().ref().child('/transportation/' + u).child(key);\n\n\twindow.alert(jah);\n\treturn jah.remove();\n\t\n\n}", "function deleteEntry(itemNum) {\n var item = $('#item' + itemNum);\n var itemId = item.find('.invisible').text();\n $.post('/delete', {entryID: itemId});\n item.html('');\n}", "function deleteEntry(entryID) {\n var url = apiURL + '/entries/' + entryID;\n $.ajax({\n url: url,\n type: 'delete',\n success: function(data, status) {\n if (data['message'] == 'Entry deleted successfully.') {\n $.snackbar({\n content: 'Eintrag erfolgreich gel&ouml;scht'\n });\n getCourseEntries();\n } else {\n $.snackbar({\n content: 'Es ist ein Fehler aufgetreten. Bitte versuche es erneut.'\n });\n }\n },\n error: function(xhr, desc, err) {\n //console.log(xhr);\n //console.log(\"Details: \" + desc + \"\\nError:\" + err);\n },\n headers: { auth: store.get(activeUser).auth }\n });\n }", "function removeEntry(item){\n var d = $.Deferred();\n\n db.transaction(function (tx) {\n tx.executeSql('DELETE FROM entries WHERE id=?', [item.id]);\n },\n function (error) {\n console.log(\"Transaction Error: \" + error.message);\n d.reject();\n },\n function () {\n //console.log(\"Removed item with id \" + item.id);\n d.resolve();\n });\n\n return d;\n }", "function deleteEntry(idx) {\n var c = confirm(\"Are you sure you want to delete this entry?\");\n if (c) {\n contacts.splice(idx, 1);\n displayEntries();\n }\n}", "deleteEntry(groupId) {\n if (Object.keys(this.table).includes(groupId)) {\n delete this.table[groupId];\n this.total--;\n }\n }", "function deleteResource(){\n\t//Recoge el value del boton pulsado\n\tvar recurso = this.value;\n\t/* LINEAS AÑADIDAS EN LA PRACTICA 9 */\n\t//Abre la conexion con la base de datos \n\tvar resourcesDB = indexedDB.open(nombreDB);\n\t//Si ha salido bien\n\tresourcesDB.onsuccess = function(event) { \n\t\t\tvar db = event.target.result; \n\t\t\tvar deleteObjectStore = db.transaction([\"recursos\"],\"readwrite\").objectStore(\"recursos\");\n\t\t\tvar objeto = deleteObjectStore.get(recurso);\n\t\t\tobjeto.onsuccess = function(event) {\n\t\t\t\t//Se elimina por el key path\n\t\t\t\tdeleteObjectStore.delete(objeto.result.link);\n\t\t\t\t//Muestra el modal y la pagina de inicio\n\t\t\t\texito();\n\t\t\t};//FIn de objeto.onsuccess\n\t};//Fin de resourcesDB.onsuccess\n}//Fin de deleteResource", "function deleteEntry(){\n //get the book div and the book's id\n let bookDiv = this.parentElement;\n let bookDivIndex = Number(bookDiv.getAttribute('data-index'));\n //remove the div with the book entry on the HTML\n bookDiv.remove();\n //find the index of the book that has the matching book id and remove it from the library\n let chosenBookIndex = myLib.findIndex(book => book.numID === bookDivIndex);\n myLib.splice(chosenBookIndex, 1);\n}", "function deleteEntry(id, event) {\n\n\tlet tail = \"?id=\" + id;\n\n\tvar req = new XMLHttpRequest();\n\t\treq.open('GET', FLIP + PORT + '/delete-park' + tail, true);\n\t\treq.addEventListener('load',function(){\n\t\tif(req.status >= 200 && req.status < 400){\n\n\t\t\t\n\t\t\tloadTable();\t\n\t\t\t\n\t\t\tevent.preventDefault();\n\t\t\treturn;\t\n\n\t } else {\n \tconsole.log(\"Error in network request: \" + req.statusText);\n\t }});\n\t req.send();\n\t event.preventDefault();\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}", "deleteCurrentEditEntry(key) {\n let newUserData = this.state.userData;\n delete newUserData[key];\n firebase.database().ref('userData/' + this.props.user.uid + '/userJournalEntries').set(newUserData);\n }", "removeEntry(id) {\n //remove the entry\n this.entries = this.entries.filter(e => e.id !== id);\n\n //reset the content\n this.content = \"\";\n\n //add each entry back to the content\n this.entries.forEach(entry => {\n this.content += entry.text;\n });\n\n //upload the updated content\n Net.updateFile(this.id, btoa(this.content));\n }", "function deleteButtonPressed(todo) {\n db.remove(todo);\n}", "function deleteItem(elem) {\r\n var id = elem.parent().attr(\"id\");\r\n firebase\r\n .database()\r\n .ref(\"/todos/\" + id)\r\n .remove();\r\n }", "todo_delete(todo){\n todosRef.child(todo['.key']).remove();\n this.activity_add(\"Todo with text \" + todo.task + \" removed\");\n var index = this.todos.indexOf(todo);\n if(index > -1){\n this.todos.splice(index, 1);\n }\n }", "function deleteentry(event)\n{\n //alert(jQuery(event.target).attr(\"id\"));\n if(confirm(\"Are you sure to delete?\") == false)\n return;\n var id_str = jQuery(event.target).attr(\"id\").substring(jQuery(event.target).attr(\"id\").indexOf(\"deletebutton\")+12);//get the influencer's id\n var id = parseInt(id_str);\n //delete the influencer with this id\n var i;\n for(i = 0;i<newJsonObj.influencers.length;i++)\n {\n if(newJsonObj.influencers[i].id == id)\n break;\n }\n newJsonObj.influencers.splice(i,1);\n parseJSON(newJsonObj);\n}", "delete(node) {\n mona_dish_1.DQ.byId(node.id.value, true).delete();\n }", "function deleteLogEntry(worker, entryId) {\n if (entryId != null) {\n datastore.deleteLogEntry(entryId);\n }\n}", "delete(key){\n const address = this._hash(key);\n if(this.data[address]){\n for (let i = 0; i < this.data[address].length; i++) {\n let currenctBucket = this.data[address][i];\n if (currenctBucket) {\n if (currenctBucket[0] === key) {\n this.data[address].splice(i,1);\n return;\n }\n }\n }\n }\n return undefined;\n }", "removeTickerMonitorEntry(id)\n{\n let query = 'DELETE FROM tickerMonitor WHERE id = $id';\n this._db.run(query, {$id:id}, function(err){\n if (null === err)\n {\n return;\n }\n logger.error(\"Could not remove TickerMonitor entry '%s' : %s\", sid, err.message);\n });\n}", "function deleteEntry(name){\r\n\treadFile((res)=>{\r\n\t\tvar writelist = [];\r\n\t\tvar contactList = JSON.parse(res);\r\n\t\tcontactList.forEach((item,index)=>{\r\n\t\t\tif(item.name.toUpperCase()!==name.toUpperCase()) writelist.push(item);\r\n\t\t})\r\n\t\twriteFile(writelist);\r\n\t})\r\n}", "function _deleteLogEntry(pGuid) {\n\t\ttry {\n\t\t\t//Get the Database connection\n\t\t\tvar oConnection = $.db.getConnection();\n\n\t\t\t//Build the Statement to delete the entries\n\t\t\tvar oStatement = oConnection.prepareStatement(\"DELETE FROM \\\"\" + gvSchemaName + \"\\\".\\\"\" + gvTableName + \"\\\" WHERE MESSAGE_GUID = ?\");\n\n\t\t\t//Entry Date\n\t\t\toStatement.setString(1, pGuid);\n\n\t\t\toStatement.addBatch();\n\n\t\t\t//Execute the Insert\n\t\t\toStatement.executeBatch();\n\n\t\t\t//Close the connection\n\t\t\toStatement.close();\n\t\t\toConnection.commit();\n\t\t\toConnection.close();\n\n\t\t\tgvTableUpdate += \"Table entries deleted for update \" + gvTableName + \";\";\n\n\t\t} catch (errorObj) {\n\t\t\tif (oStatement !== null) {\n\t\t\t\toStatement.close();\n\t\t\t}\n\t\t\tif (oConnection !== null) {\n\t\t\t\toConnection.close();\n\t\t\t}\n\t\t\tgvTableUpdate += \",There was a problem deleting entries in the \" + gvTableName + \" table, Error: \" + errorObj.message;\n\t\t}\n\t}", "function deleteItem(evt) {\n\tvar button = evt.target;\n\tvar row = button.parentNode.parentNode;\n\tvar cells = row.getElementsByTagName(\"td\");\n\tvar name = cells[1].innerHTML;\n\tvar type = cells[2].innerHTML;\n\tvar group = row.id.slice(0, row.id.indexOf(\"-\"));\n\tif (group === \"base\") {\n\t\tbaseItems.delete(type, name);\n\t} else {\n\t\toptionalItems.delete(type, name);\n\t}\n\trow.parentNode.removeChild(row);\n\tsyncToStorage();\n}", "deleteAnEntry() {\n document.querySelector(\".entryLog\").addEventListener(\"click\", function (e) {\n console.log(e.target.id)\n if (event.target.id.startsWith(\"delete-button\")) {\n const entryToDelete = event.target.id.split(\"--\")[1]\n console.log(`Please delete entry number! ${entryToDelete}`)\n API.deleteJournalEntry(entryToDelete)\n API.getJournalEntries()\n }\n })\n }", "function removeEntry(listName, title,titleId){\r\n console.log(\"title: \" + title + \" id: \" + titleId)\r\n let listInfo = JSON.parse(window.localStorage.getItem(listName))\r\n let entryList = listInfo.entries;\r\n // loop through all entries until found remove element from array and call loadPage()\r\n for (let i = 0; i < entryList.length; i++){\r\n let info = entryList[i].split(\"-:\");\r\n\r\n let entryTitle = info[0]\r\n let entryID = info[1]\r\n if (entryTitle == title && entryID == titleId){\r\n entryList.splice(i,1)\r\n console.log(\"new list: \" + entryList);\r\n }\r\n }\r\n listInfo.entries = entryList;\r\n window.localStorage.setItem(listName,JSON.stringify(listInfo));\r\n loadPage(listName,listInfo.entries);\r\n}", "function EditLogItemDelete () {}", "function adminDelete(id){\n manga = biblioteca[id]\n let validar = confirm(`Esta seguro de querer eliminar a ${manga.titulo}`)\n\n if(validar){\n biblioteca.splice(id,1)\n localStorage.setItem('biblioteca',JSON.stringify(biblioteca))\n alert(`Se borro ${manga.titulo}`)\n cargarManga4(biblioteca)\n }\n}", "static deleteOne(id) {\n if (DummyDataHelpers.deleteEntry(dummyEntries, id)) {\n return this.success(`An entry with ${id} has been deleted successfully`, true);\n }\n return this.notFound('Entries not available');\n }", "function deleteEntry(identifier) {\n // get the entry-type name\n var entryType = $(identifier).data('type');\n\n if ($(identifier).closest('.gcconnex-' + entryType + '-entry').hasClass('temporarily-added')) {\n $(identifier).closest('.gcconnex-' + entryType + '-entry').remove();\n }\n else {\n // mark the entry for deletion and hide it from view\n $(identifier).closest('.gcconnex-' + entryType + '-entry').hide();\n }\n console.log(entryType);\n \n //for tabbing users\n //add additional 's' to skill to grab right class\n if(entryType == 'skill'){\n $('.cancel-' + entryType + 's').focus();\n } else {\n $('.cancel-' + entryType).focus();\n }\n \n}", "function deleteButtonPressed(todo) {\n db.remove(todo);\n }", "function deleteCard(id){\n\n clearMap();\n\n var rowID = id.substring(13);\n $(\"#\"+ rowID).empty();\n console.log(\"rowID = \"+ rowID)\n console.log(\"temp OBJ = \"+ temp)\n \n var temp = getItemFromStorage('cards')\n var index = parseInt(temp['cards'].findIndex(x => x.taskID == rowID));\n temp['cards'].splice(index);\n pushToStorage('cards',temp);\n\n}", "function deleteSettings() {\n var tx = db.transaction(['setting'], 'readwrite');\n var store = tx.objectStore('setting');\n let request = store.delete(1);\n request.onerror = function (e) {\n console.log('Error', e.target.error.name);\n throw 'Error' + e.target.error.name;\n };\n request.onsuccess = function () {\n console.log('setting entry deleted successful');\n };\n}", "function deleteTask(key,element) {\n firebase.database().ref('todoList').child(key).remove();\n element.parentElement.parentElement.remove();\n}", "function deleteTodo(key) {\n //Retrieve the index of the todo entry in the collection\n const index = todoItems.findIndex((item) => item.id === Number(key));\n //set delete attribute to true for the todo entry\n const todo = {\n deleted: true,\n ...todoItems[index],\n };\n todoItems = todoItems.filter((item) => item.id !== Number(key));\n //Trigger page update by (invoking) calling the renderTodo function\n renderTodo(todo);\n}", "function delItem(id) {\n connection.query(\"DELETE FROM itemList where id = ?\", [id], function(\n error,\n results,\n fields\n ) {\n if (error) throw error;\n console.log(results);\n });\n }", "function deleteBookInfo() {\n\n}", "function deleteTodo(key) {\n //Retrieve the index of the todo entry in the collection. \n const index = todoItems.findIndex((item) => item.id === Number(key));\n //Set delete attribute to true for todo entry\n const todo = {\n deleted: true,\n ...todoItems[index],\n\n };\n todoItems = todoItems.filter((item) => item.id !== Number(key));\n // console.table(todoItems)\n //trigger page update by invoking renderTodo function.\n renderTodo(todo);\n}", "function deleteStorageEntry(index) {\n chrome.storage.sync.get(['youtubeBookmarks'], function (result) {\n let bookmarks = JSON.parse(result.youtubeBookmarks);\n\n bookmarks.value.splice(index, 1);\n\n chrome.storage.sync.set({\n youtubeBookmarks: JSON.stringify(bookmarks)\n });\n });\n location.reload();\n}", "function deleteEntry(event){\n\n // important info to send\n var target = document.location.href;\n var patientID = event.dataset.patient;\n var operation = event.dataset.operation;\n var uniqid = event.dataset.uniqid;\n\n //creates a package that will be sent as a request to the server\n $.post(target, {operation: operation, patientID: patientID,uniqid: uniqid})\n\n}", "function removeProd() {\n var id = document.getElementById(\"idProdDel\").value;\n requestDB = db.transaction([\"produtos\"], \"readwrite\")\n .objectStore(\"produtos\")\n .delete(Number(id));\n\n requestDB.onsuccess = function () {\n console.log(\"Removido \" + id);\n };\n requestDB.onerror = function () {\n console.log(\"Erro ao remover\");\n };\n}", "function deleteStory(title) {\r\n if(stories.has(title)) {\r\n\tstories.delete(title);\r\n } else {\r\n alert(\"Story not in database!\");\r\n }\r\n}", "function del(a){\n var row = a.parentNode.parentNode;\n row.parentNode.removeChild(row)\n \n }", "remove() {\r\n if (this.removed) {\r\n throw new Error(\"This entry has already been removed\");\r\n }\r\n this.set.remove(this.data[this.nextIndex - 1]);\r\n this.removed = true;\r\n }", "function deleteIt(){\n \tupdateDB(\"delete\", pageElements.alertText.dataset.id);\n }", "function delReview(argument) {\n console.log(argument);\n var ref = new Firebase(\"https://nss-jer-trippin.firebaseio.com/trips/\" + argument);\n ref.remove();\n location.reload();\n }", "function handlePostDelete() {\n\n var currentId = $(this).attr(\"entryID\");\n\n deletePost(currentId);\n }", "function handleDeleteButtonPress() {\n var id = $(this).parent(\"td\").parent(\"tr\").data(\"tableRow\");\n console.log(id);\n $.ajax({\n method: \"DELETE\",\n url: \"api/timesheets/entries/\" + id\n })\n .then(getLastEntries);\n }", "function eliminar(key_empleado){\n const dbRef_empleados = firebase.database().ref('empleados/' + key_empleado);//.child('empleados');\n dbRef_empleados.remove();\n}", "async delete(key) {}", "function deleteItem(){\r\n// todo\r\n var id = readNonEmptyString('please type the id of the item you wish to delete :');\r\n if (!isNaN(id)){\r\n var item = getItemById(id);\r\n item.parent.items.forEach(function(childItem,index,array){\r\n if (childItem.id == id){\r\n array.splice(index,1);\r\n }\r\n })\r\n }\r\n\r\n}", "function deleteItem(e){\n}", "function del( path, urn ){\n\t\treturn json.del( path ).then(\n\t\tfunction( data ){\n\t\t\tlog_item( urn, data );\n\t\t});\n\t}", "function deleteTask(key) {\n //Getting task to delete\n let taskToDelete = firebase.database().ref(\"task/\" + key);\n taskToDelete.remove();\n //Calling Function To display Updated Data\n taskList.innerHTML = \"\";\n displayData();\n}", "function delRentLocation(argument) {\n\tif (rentMarkerArray) map.remove(rentMarkerArray);\n rentMarkerArray = [];\n}", "function deleteRecord(id) {\n bookmarkTable.get(id).deleteRecord();\n }", "function deleteContact(){\n var id = readLineSync.question(\"Lua chon id contact can xoa: \");\n listContact.splice(id,1);\n save();\n console.log(\"\\nXoa thanh cong nhe!\")\n\n}", "static delete(to,t,p,op,couleur,cb){\n\t\tconsole.log(couleur.substr(couleur.length -1));\n\t\tquery.execute(conn, 'echec','delete data {:cell'+to+' rdf:type <'+op+'> . :cell'+to+' rdf:type <'+couleur+'>}',\n\t\t'application/sparql-results+json', {\n\t\t\toffset:0,\n\t\t\treasoning: true\n\t\t}).then(res =>{\n\t\t\tthis.getId(to,t,p,op,couleur.substr(couleur.length -1), cb);\n\t\t}).catch(e=> {console.log(e);});\t\n\t}", "function deleteActor(){\n\t//Recoge el valor del boton pulsado\n\tvar act = this.value;\n\t/* LINEAS AÑADIDAS EN LA PRACTICA 8 */\n\t//Abre la conexion con la base de datos\n\tvar actoresDB = indexedDB.open(nombreDB);\n\t//Si ha salido bien\n\tactoresDB.onsuccess = function(event) { \n\t\t\tvar db = event.target.result; \n\t\t\tvar deleteObjectStore = db.transaction([\"actores\"],\"readwrite\").objectStore(\"actores\");\n\t\t\tvar objeto = deleteObjectStore.get(act);\n\t\t\tobjeto.onsuccess = function(event) {\n\t\t\t\tvar objetoActor = new Person (objeto.result.name, objeto.result.lastName1, objeto.result.born, objeto.result.lastName2, objeto.result.picture);\n\t\t\t\t//Se elimina por el key path\n\t\t\t\tdeleteObjectStore.delete(objetoActor.completo);\n\t\t\t\t//Abre la conexion con la base de datos\n\t\t\t\tvar actoresDB = indexedDB.open(nombreDB);\n\t\t\t\t//Si ha salido bien\n\t\t\t\tactoresDB.onsuccess = function(event) { \n\t\t\t\t\t\tvar db = event.target.result; \n\t\t\t\t\t\tvar deleteObjectStore = db.transaction([\"repartoPro\"],\"readwrite\").objectStore(\"repartoPro\");\n\t\t\t\t\t\tvar borrar = deleteObjectStore.delete(objetoActor.completo);\n\t\t\t\t\t\tborrar.onsuccess = function(event) {\n\t\t\t\t\t\t\t//Muestra el modal y la pagina de inicio\n\t\t\t\t\t\t\texito();\n\t\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};//FIn de objeto.onsuccess\n\t\t\t\n\t};//Fin de actoresDB.onsuccess\n}//Fin de deleteActor", "function deleteAstronaut(r){\r\n var index = r.parentNode.parentNode.rowIndex-1;\r\n var astro = JSON.parse(localStorage.getItem('astro'));\r\n var name = astro[index].name;\r\n var surname = astro[index].surname;\r\n if(confirm('Do you want to delete '+name+' '+surname+' from the record?')){\r\n astro.splice(index, 1);\r\n }\r\n localStorage.setItem('astro', JSON.stringify(astro));\r\n addAstronaut();\r\n}", "function del(key) {\n return db.delete(key);\n}", "function deleteDirector(){\n\t//Recoge el valor del boton pulsado\n\tvar dir = this.value;\n\t/* LINEAS AÑADIDAS EN LA PRACTICA 8 */\n\t//Abre la conexion con la base de datos categorias\n\tvar directoresDB = indexedDB.open(nombreDB);\n\t//Si ha salido bien\n\tdirectoresDB.onsuccess = function(event) { \n\t\t\tvar db = event.target.result; \n\t\t\tvar deleteObjectStore = db.transaction([\"directores\"],\"readwrite\").objectStore(\"directores\");\n\t\t\tvar objeto = deleteObjectStore.get(dir);\n\t\t\tobjeto.onsuccess = function(event) {\n\t\t\t\tvar objetoDirector = new Person (objeto.result.name, objeto.result.lastName1, objeto.result.born, objeto.result.lastName2, objeto.result.picture);\n\t\t\t\t//Se elimina por el key path\n\t\t\t\tdeleteObjectStore.delete(objetoDirector.completo);\n\t\t\t\t//Abre la conexion con la base de datos\n\t\t\t\tvar directoresDB = indexedDB.open(nombreDB);\n\t\t\t\t//Si ha salido bien\n\t\t\t\tdirectoresDB.onsuccess = function(event) { \n\t\t\t\t\t\tvar db = event.target.result; \n\t\t\t\t\t\tvar deleteObjectStore = db.transaction([\"directorPro\"],\"readwrite\").objectStore(\"directorPro\");\n\t\t\t\t\t\tvar borrar = deleteObjectStore.delete(objetoDirector.completo);\n\t\t\t\t\t\tborrar.onsuccess = function(event) {\n\t\t\t\t\t\t\t//Muestra el modal y la pagina de inicio\n\t\t\t\t\t\t\texito();\n\t\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};//FIn de objeto.onsuccess\n\t};//Fin de directoresDB.onsuccess\n}//Fin de deleteDirector", "comment_delete(comment){\n commentsRef.child(comment['.key']).remove();\n this.activity_add(\"Comment with text \" + comment.text + \" removed\");\n var index = this.comments.indexOf(comment);\n if(index > -1){\n this.comments.splice(index, 1);\n }\n }", "function delete_work(id){\n console.log(\"INSIDE DELETE_WORK\");\n const key = datastore.key([WORK, parseInt(id,10)]);\n return datastore.get(key).then( result => {\n\n //Delete the artwork\n return datastore.delete(key).then(()=>{\n console.log(\"EXITING DELETE WORK\");\n return true;\n });\n }).catch( err => {\n return false;\n });\n}", "function delRecord(rowid) {\r\n var db = window.openDatabase(\"Database\", \"1.0\", \"STUMBLEAPP\", 2000000);\r\n db.transaction(\r\n function (tx) {\r\n tx.executeSql(\"DELETE FROM demo WHERE id = ?\", [rowid]);\r\n }\r\n ); \r\n\r\n location.reload(false); // refresh page to show changes\r\n}", "delete(key) {\n\t\tthis.update( state => {\n\t\t\t\tthis.removeChildAt(key);\n\n\t\t\t\treturn { name: `delete(${key})`, nextState: omit(state, key) };\n\t\t\t});\n\t}", "deleteTask(task) {\n const deleteItem = task.key;\n const deleteRef = firebase.database().ref(`${this.props.userId}/${deleteItem}`);\n deleteRef.remove();\n }", "function delCat(e) {\n database.database_call(\n \"UPDATE note SET category_id=1 WHERE category_id=\" + args[0] + \"\"\n );\n\n database.database_call(\"DELETE FROM category WHERE id=\" + args[0] + \"\");\n $.name.value = \"\";\n alerted.note(\n \"The current category was deleted!\\n All notes in this category have been left unclassified\",\n 1\n );\n goBack(\"category_list\");\n}", "function deleteItem(id) {\n executeHTTPRequest(id, 'DELETE', '/remove')\n}", "function deletePerson3(person) {\n document.getElementById('tblPerson').removeChild(person);\n}", "async function deleteEntry(data){\n const response = await fetch(`https://creaters-alley.herokuapp.com/api/public/`,{\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(data)\n })\n return response.json()\n}", "function deleteItem(link){\n $(link).parent().remove();\n}", "function deleteResult()\n{\n\t\t\n\tvar results = getSortedResults();\n\tvar editId = document.getElementById('editid').value;\n\tvar key = findResultKeyById(editId);\n\t\n\tresults.splice(key,1);\n\tsaveResults(results);\n\n\tupdateList('editform');\n\t\n\treturn false;\n}", "function doDeleteRow(tablename, rowid) {\n if (window.confirm(\"Delete instance \" + rowid.toString() + \" of \" + tablename +\"?\")) {\n var d = window.db.deleterow(tablename, rowid);\n d.addCallbacks( function (result) {\n if (result[0]) {\n removeElement($(\"rowid_\" + rowid));\n showMessage(\"Item '\" + result[1] + \"' deleted.\");\n } else {\n window.alert(\"There was a problem deleting this item. \" + result[1]);\n };\n }, \n function () {\n console.log(\"Error requesting deletion.\"); \n window.alert(\"Could not delete item.\");\n }\n );\n }\n}", "function delClick(e) {\n const index = getItemIndex(\n srcList,\n e.target.parentElement.getAttribute('name'),\n );\n\n if (index < 0) return;\n\n srcList.splice(index, 1);\n chrome.storage.sync.set({ storageSrcKey: srcList }, () =>\n console.log(`${storageSrcKey} value saved. List : ${srcList}`),\n );\n e.target.closest('tr').remove();\n }", "function deleteRecord(db, table, key) {\n var $def = $.Deferred();\n var transaction = db.transaction([table], 'readwrite');\n var req = transaction.objectStore(table).delete(key);\n req.onerror = function(e) {\n $def.reject('delete record failed');\n };\n transaction.oncomplete = function(event) {\n $def.resolve(key);\n };\n return $def;\n }", "function del(data, callback){\n function del(key, callback){\n db.del(key, function(err) {\n if (err) return console.log('Something went wrong!', err);\n console.log('del(\"' + data + '\"): success');\n if(callback)callback();\n }); \n }\n if (typeof data == 'object') {\n // Batch del\n if(typeof data.length == 'number') {\n var i = 0;\n for(i in data)data[i].type = 'del';\n db.batch(data, function(err) {\n if (err) return console.log('Something went wrong!', err);\n console.log('Batch delete success: ' + data.length + ' records deleted');\n if(callback)callback();\n }); \n }\n // Del\n else\n {\n del(data.key, callback);\n } \n }\n if (typeof data == 'string') {\n del(data, callback);\n }\n\n}", "function deleteBook(id ,indx){\n console.log(id,indx)\n firebase.database().ref(\"availableBooks/\"+id).remove()\n .then(()=>{\n console.log(\"success\")\n AvailableBooks.splice(indx,1)\n })\n .catch((error)=>console.log(\"error\",error.message)) \n display();\n}", "function deleteRecord(rowID) {\n var answer = confirm(\"Delete this run?\");\n if (answer) {\n global.db.execute('DELETE FROM Times WHERE ROWID = (?)', [rowID]);\n global.db.execute('DELETE FROM Positions where TimeID = (?)', [rowID]);\n go('journeys');\n }\n}", "function deleteMe(item){\n fetch(\"/remove/\" + item.innerText,{\n method: \"delete\"\n }).then(res=>res.json())\n .then(res2 => {\n // console.log(res2)\n location.reload()\n });\n }", "delete() {\n\t\tthis.data.delete();\n\t}", "function deleteRecord(id) {\n\t\t\n\t\t\n\t\taddOverLay();\n\t\t$.ajax({\n\t\t\turl : HOST_PATH + \"admin/article/movetotrash\",\n\t\t\tmethod : \"post\",\n\t\t\tdata : {\n\t\t\t\t'id' : id\n\t\t\t},\n\t\t\tdataType : \"json\",\n\t\t\ttype : \"post\",\n\t\t\tsuccess : function(data) {\n\t\t\t\t\n\t\t\t\tif (data != null) {\n\t\t\t\t\t\n\t\t\t\t\twindow.location.href = HOST_PATH + \"admin/article\";\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\twindow.location.href = HOST_PATH + \"admin/article\";\n\t\t\t\t}\n\t\t\t}\n\t\t});\t\n\t}", "function delete_cargo(id){\n console.log(\"INSIDE DELETE_CARGO\");\n\n const key = datastore.key([CARGO, parseInt(id,10)]);\n return datastore.get(key).then( result => {\n console.log(\"EXITING DELETE_CARGO\");\n\n //Delete the cargo\n return datastore.delete(key);\n }).catch( err => {\n return false;\n });\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 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}", "delete(key: K) {\n this.tree.remove([key, null]);\n }", "deleteNote(key) {\n const dbRef = firebase.database().ref();\n dbRef.child(key).remove();\n }", "function delete_item(table, item, callback) {\n db.transaction(function (tx) {\n var where;\n if (typeof(item) == \"number\") {\n item = {id: item};\n }\n if (item['id']) {\n executeSqlLog(tx, \"DELETE FROM \" + table + \" WHERE id = ?\", [item['id']], callback);\n } else {\n retrieveSchema(table, item, function(schema) {\n executeSqlLog(tx, \"DELETE FROM \" + table + \" WHERE \" + placeholders(schema), sql_values(schema,item), callback);\n });\n }\n });\n }", "_deleteItem () {\n let itemToDelete = favs.filtered('name = $0', name)\n realm.write(() => {\n realm.delete(itemToDelete)\n })\n this.forceUpdate()\n }", "function delete_button_pressed(obj)\n{\n firebase.database().ref('Article').child(obj).remove().then(function()\n {\n window.alert(\"Message Deleted\");\n window.location.reload(false);\n }).catch(function(error){\n });\n}", "deleteItem(id) {\n\n if (confirm(\"Delete this entry forever?\")) {\n\n submitDataAsync({id: id}, \"/journal/delete\", false, (responseData) => {\n\n console.log(responseData);\n\n if (responseData.success === true) {\n this.setState(prevState => ({\n items: prevState.items.filter((item) => {\n return item._id.$oid !== id;\n })\n }));\n }\n\n });\n }\n\n }", "static delete(id) {\n try{\n delete IdentifyMap[id];\n const data = connection.query(`SELECT * FROM resource where id=${id}`);\n if (data.length > 0){\n const type = data[0].type;\n const resource_line_item_data = connection.query(`DELETE FROM resource_line_item WHERE resource_id=${id}`);\n const child_data = connection.query(`DELETE FROM ${type} where resource_id=${id}`);\n const resource_data = connection.query(`DELETE FROM resource where id=${id}`);\n return {status : 0, message : 'Resource deleted.'};\n } else {\n return {status : 1, message : 'Nothing to delete.'}\n }\n }\n catch(error){\n return {status : 1, message : 'Error' +error, error}\n }\n }" ]
[ "0.79990464", "0.7729666", "0.7536845", "0.72609234", "0.7095049", "0.708659", "0.70797235", "0.7009879", "0.6986784", "0.6915469", "0.68576914", "0.6851584", "0.68260324", "0.6789809", "0.67314297", "0.6681159", "0.66657573", "0.6641444", "0.66402435", "0.6638916", "0.6628171", "0.66096306", "0.6608614", "0.6606609", "0.6596989", "0.65791905", "0.6572809", "0.6528477", "0.6505098", "0.64928997", "0.64819634", "0.64554346", "0.6441912", "0.6417362", "0.6392719", "0.6384894", "0.63653743", "0.63567287", "0.63501585", "0.6347836", "0.63428056", "0.63414305", "0.6332281", "0.63169265", "0.62946683", "0.6289703", "0.627464", "0.62604576", "0.62525916", "0.6243051", "0.62419116", "0.62408984", "0.6239381", "0.62336445", "0.6228293", "0.62154716", "0.62072456", "0.62056106", "0.62014186", "0.620095", "0.61922103", "0.61900395", "0.61747444", "0.6166922", "0.6166248", "0.6161637", "0.6159617", "0.61583555", "0.6143375", "0.613692", "0.61285627", "0.61018336", "0.6092206", "0.60825545", "0.6078895", "0.60772556", "0.6073186", "0.6071481", "0.6063596", "0.60609156", "0.6059873", "0.6058841", "0.6050681", "0.60472006", "0.60470617", "0.6046963", "0.60460466", "0.60310405", "0.60305583", "0.6030057", "0.6030053", "0.6028915", "0.6028615", "0.6028131", "0.60275304", "0.6026099", "0.602524", "0.60235435", "0.6023115", "0.6013524", "0.6009772" ]
0.0
-1
Variables applied to each of our instances go here, we've provided one for you to get started
constructor() { // The image for the sprite this.sprite = 'images/enemy-bug.png'; this.x = xStartPosEnemy; this.speed = speeds[Math.floor(Math.random() * 5)]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initInstance() {\n this.instance = {};\n this.instance.epiHiperSchema = '';\n this.instance.diseaseModel = {};\n this.instance.sets = [];\n this.instance.variables = [];\n this.instance.initializations = [];\n this.instance.triggers = [];\n this.instance.interventions = [];\n this.instance.traits = [];\n this.instance.personTraitDBs = [];\n this.instance.network = {};\n this.instance.runParameters = {};\n }", "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 }", "function _accessInstances() {\n load(circle.stage).onComplete.once(() => {\n const circleStage = new circle.stage();\n app.stage.addChild(circleStage);\n });\n\n load(square.stage).onComplete.once(() => {\n const squareStage = new square.stage();\n app.stage.addChild(squareStage);\n });\n}", "function setupInstanceVars(args) {\n for(let a in args) {\n this[a] = args[a];\n }\n}", "getInstances() {}", "instances() {\n }", "initialize() { this._saveInstanceProperties(); }", "init () {\n // Load application configuration\n this.config = require('./config').init(this)\n\n // Axios Http client\n this.http = require('./http').init(this)\n\n // TigoPesa API client\n this.api = require('./api').init(this)\n\n // Init express app instance\n this.express = require('./express').init(this)\n\n // Init job queue\n this.jobs = require('./jobs').init(this)\n }", "initialize(instance) {\n this.instance = instance;\n }", "function setupInstance(){\n\t\tMongoClient.connect(\"mongodb://ordertrackinguser:[email protected]:31812/heroku_app36432204\", function(err, db) {\n\t\t\t\tif (err) {\n\t\t\t\t\t logger.error('unable to open mongo client instance');\n\n\t\t\t\t}\n\t\t\t\telse {\n\t \t\t\t\t_db = db;\n\t\t\t\t}\n\t \t\t});\n\t}", "setup() {\n\t\tthis.bpm = Persist.exists('bpm') ? Persist.get('bpm') : 100;\n\t\tthis.startTime = Persist.exists('startTime') ? Persist.get('startTime') : Date.now();\n\t\tthis.tempos = {\n\t\t\tmaster: 'four',\n\t\t\t...TEMPO_CONFIG\n\t\t}\n\t\tObject.keys(this.tempos).filter(k => k !== 'master').forEach(tempoKey => {\n\t\t\tthis.tempos[tempoKey].getBeatDuration = this.tempos[tempoKey].getBeatDuration.bind(this)\n\t\t})\n\n\t\tif (ENV.IS_HOST) {\n\t\t\tthis.attachHostEventHandlers();\n\t\t} else {\n\t\t\t$io.onBPMChange(this.dataReceived.bind(this))\n\t\t\t$io.onMasterTempoChange(this.dataReceived.bind(this))\n\t\t}\n\t}", "static initializeInstances() {\n [\n () => EventManager.getInstance(),\n () => AppDispatcher.getInstance(),\n () => DialogStore.getInstance(),\n () => GameStore.getInstance(),\n () => ScreenStore.getInstance(),\n () => AppInput.getInstance()\n ].forEach(task => task());\n }", "initValues() {\n // Ad top position, used when sticky ad is sticking\n this.adTop = $( 'body' ).is( '.admin-bar' ) ? 82 : 50\n\n // Sidebar height, used to place sticky ad before stick\n this.sidebarHeight = this.sidebar.outerHeight()\n\n this.setStickyRight()\n this.setStickyTop()\n this.setStickyBottom()\n }", "static definition() {\n this.instanceVariables = []\n this.assumes = [WidgetBuilder]\n }", "function init() {\n cookies = new Cookies();\n ui = new UI();\n game = new Game();\n}", "function init() {\n\n\t\t\t// WOW일때 컬러칩 active 안 되는 경우 처리\n\t\t\tif( $('.layout-2 #selectColor').length > 0 && $('.layout-2 #selectColor .active').length == 0 ){\n\t\t\t\t$('.layout-2 #selectColor').find('.swatch').first().addClass('active');\n\t\t\t}\n\n\t\t\tnew ss.PDPStandard.PDPFeaturesController();\n\t\t\tnew ss.PDPStandard.PDPAccessories();\n\n\t\t\tnew ss.PDPStandard.PDPThreeSixty();\n\t\t\tnew ss.PDPStandard.PDPGallery();\n\t\t\t//new ss.PDPStandard.PDPKeyVisual();\n\n\t\t\tif ($('.media-module').find('.sampleimages').length > 0) {\n\t\t\t\tnew ss.PDPStandard.PDPSampleImages();\n\t\t\t}\n\n\t\t\tcurrentMetrics = ss.metrics;\n\n\t\t\tbindEvents();\n\t\t\theroSize();\n\t\t\tthrottleCarousel();\n\n\t\t\tnew ss.PDPStandard.PDPCommon();\n\t\t\tnew ss.PDPStandard.PDPeCommerceWOW();\n\t\t\tss.PDPStandard.optionInitWOW();\n\t\t}", "init() {\n }", "function init () {\n // Here below all inits you need\n }", "init(){\n\t\tthis._active = true\n\t}", "constructor() {\n this.gameState = LOBBY;\n this.host = null;\n this.options = {\n numMafia: 1,\n numCops: 0,\n numDoctors: 0\n };\n this.numMafia = this.options.numMafia;\n this.numCops = this.options.numCops;\n this.numDoctors = this.options.numDoctors;\n this.numTown = 0;\n this.players = {};\n this.socketNames = {};\n }", "initialize(){// ensures first update will be caught by an early access of\n// `updateComplete`\nthis._saveInstanceProperties(),this._requestUpdate()}", "init() { }", "init() { }", "init() { }", "init() { }", "init() { }", "init () {}", "init () {}", "constructor() {\n super();\n this._init();\n }", "function _init() {\r\n $sc['_name'] = CONTROLLER_NAME;\r\n\r\n //Set page title\r\n $hs.$scope.setTitle([\r\n characterInfo['serverName'],\r\n '->',\r\n characterInfo['characterName']\r\n ].join(' '));\r\n\r\n //Set up character and server names and stats\r\n $sc['serverName'] = characterInfo['serverName'];\r\n $sc['character'] = characterInfo;\r\n\r\n //Set up chart\r\n $sc['chart'] = _setUpChart(characterInfo);\r\n\r\n //Set up pagination\r\n $sc['pagination'] = _setUpPagination(characterInfo['status'], 10);\r\n\r\n //Search...\r\n $sc['search'] = _search;\r\n }", "function Game_Variables() {\n this.initialize.apply(this, arguments);\n}", "setupMain() {\n const stats = this.createCurrentStats();\n this.model = new Model(\n this.numCommunities, // TODO determine the number of communities\n this.agentView,\n this.width,\n this.height,\n stats,\n this.receiveNewStatsAndUpdateChart.bind(this),\n this.updateDemographicChart.bind(this),\n this.updateTimeline.bind(this),\n this.borderCtx\n );\n }", "function setup (instance, data) {\n for (let i = 0; i < setupFunctions.length; i++) {\n setupFunctions[i](instance, data)\n }\n }", "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "function init() {\r\n _lives = 5;\r\n _weapons = 10;\r\n }", "Init()\n {\n this.my_state_machine = new StateMachine();\n this.overlay_manager_inst = new OverlayManager();\n this.level_viewer = null;\n this.information_log = document.getElementById(\"informationLog\");\n this.level_object_manager = new LevelObjectManager();\n this.level_complete = document.getElementById(\"complete\");\n this.stats_manager = new StatManager();\n this.AI_bridge = new AIBridge();\n this.memento = new Memento();\n this.toolbar_manager = new ToolbarManager();\n }", "function init () {\n\t\t//Get the unique [charity] userId so we know \n\t\t//which url to used for the server-side API\n\t\tvar userId = $('[data-event-config=\"userId\"]').val();\n\t\t\n\t\t//Initialise events collection\n\t\tfunction initCollection () {\n\t\t\tvar evts = new Evts({\n\t\t\t\tuserId: userId\n\t\t\t});\n\n\t\t\tinitFormView(evts);\n\t\t\tinitEventsBoard(evts);\n\t\t}\n\n\t\t//Initialise event form view\n\t\tfunction initFormView (evts) {\n\t\t\tvar $el = $('[data-event=\"configure\"]');\n\t\t\tnew EventForm({\n\t\t\t\tel: $el,\n\t\t\t\tcollection: evts\n\t\t\t});\n\t\t}\n\n\t\t//Initialise events board with persisted events\n\t\tfunction initEventsBoard (evts) {\n\t\t\tvar $el = $('[data-events-board]');\n\t\t\tnew EventBoard({\n\t\t\t\tel: $el,\n\t\t\t\tcollection: evts\n\t\t\t});\n\t\t}\n\n\t\t//Start up everything\n\t\tinitCollection();\n\t}", "function Instance() {\n this.model = new ManagementModel(this);\n this.controller = new ManagementController(this);\n}", "function initCollectibles() {\n if (collectibles.key === true) {\n collectibles.key = new Key();\n }\n\n if (collectibles.life === true) {\n collectibles.life = new Star();\n }\n\n if (collectibles.gem === true) {\n collectibles.gem = new Gem();\n }\n }", "function initVariables() {\n enemies = [];\n Scene = this;\n eActive = 0;\n wActive = 0;\n rActive = 0;\n rCharges = 3;\n cooldown = 0;\n qCooldown = 0;\n wCooldown = 0;\n eCooldown = 0;\n rCooldown = 0;\n enemyShootCooldown = 0;\n playerSpeed = 140;\n inv = 30;\n hp = 20;\n mouseX = 0;\n mouseY = 0;\n moving = false;\n waveCount = 1;\n enemyCount = 2;\n}", "function defineResources() {\n\n graphingModel = Data.GraphingModel;\n graphingModel.interval = pollServiceInterval;\n graphingModel.startTimer();\n }", "constructor() {\n this.init();\n }", "_applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n this._instanceProperties = undefined;\n }", "_applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n this._instanceProperties = undefined;\n }", "_applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n this._instanceProperties = undefined;\n }", "function init() {\n\t \t\n\t }", "init()\r\n {\r\n var self = this;\r\n\r\n // set the template file for uri set method\r\n this.raumkernel.getSettings().uriMetaDataTemplateFile = \"node_modules/node-raumkernel/lib/setUriMetadata.template\";\r\n\r\n // set some other settings from the config/settings file\r\n // TODO: @@@\r\n //this.raumkernel.getSettings().\r\n\r\n // if there is no logger defined we do create a standard logger\r\n if(!this.parmLogger())\r\n this.createLogger(this.settings.loglevel, this.settings.logpath);\r\n\r\n this.logInfo(\"Welcome to raumserver v\" + PackageJSON.version +\" (raumkernel v\" + Raumkernel.PackageJSON.version + \")\");\r\n\r\n // log some information of the network interfaces for troubleshooting\r\n this.logNetworkInterfaces();\r\n\r\n // Do the init of the raumkernel. This will include starting for the raumfeld multiroom system and we\r\n // do hook up on some events so the raumserver knows the status of the multiroom system\r\n this.logVerbose(\"Setting up raumkernel\");\r\n this.raumkernel.parmLogger(this.parmLogger());\r\n // TODO: listen to events like hostOnline/hostOffline\r\n this.raumkernel.init();\r\n\r\n this.logVerbose(\"Starting HTTP server to receive requests\");\r\n this.startHTTPServer();\r\n\r\n this.logVerbose(\"Starting bonjour server for advertising\");\r\n // TODO: @@@\r\n }", "function Server() {\n this.esitScale = new EsitScale(); \n //this.log = new Log();\n \n}", "initSliderVariablesApp(){\n super.initSliderVariablesApp();\n\n this._initAppVariable(\"Speed\", 1);\n this._initAppVariable(\"Gravity\", 5);\n }", "constructor() {\r\n super()\r\n this.init()\r\n }", "function initialisationOfVariables() {\n oilDensities = [920,1260]; /** Density value of olive oil and glycerin */\n density = oilDensities[0]; /** Density of olive oil assign to density variable */ \n oilViscocity = [0.081,1.49]; /** Viscocity of olive oil and glycerin */\n viscocity = oilViscocity[0]; /** Viscocity of olive oil assign to density variable */ \n airDensity = 1; /** Density of aire */\n dropDB = []; /** Array to store data related to each drop */\n appar_dropDB = []; /** Array to store data related to each drop in apparatus that move vertically */\n currentTime = 0;\n}", "init() {\n this.isUpdating = false;\n this.errors = {};\n this.copied = null;\n this.isLoading = false;\n this.tracks = [];\n this.einsteinCategories = [];\n\n this.tempUserName = this.user.lastName;\n\n if (!this.user.firstName) {\n this.user.firstName = this.user.name;\n }\n\n this.currentInput = {\n name: null,\n value: null,\n };\n }", "static get instances() {\n return instances;\n }", "init(){\n \n }", "init() {\n\n this.assignPlayer();\n gameView.init(this);\n gameView.hide();\n scoreBoardView.init(this);\n registerView.init(this);\n this.registerSW();\n }", "__previnit(){}", "function init() {\n\n }", "function init() {\n\n }", "async init(){\r\n await this.setName();\r\n await this.setPrice();\r\n await this.setImage();\r\n }", "async init(){\r\n await this.setName();\r\n await this.setPrice();\r\n await this.setImage();\r\n }", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "static initialize()\n {\n RPM.songsManager = new SongsManager();\n RPM.settings = new Settings();\n RPM.datasGame = new DatasGame();\n RPM.gameStack = new GameStack();\n RPM.loadingDelay = 0;\n RPM.clearHUD();\n }", "constructor() {\n this.controller = new Controller();\n this.receiver = new Receiver();\n this.enabled = false;\n this.initialized = false;\n }", "constructor(){\n\t\tthis.life=0;\n\t\tthis.magic=0;\n\t\tthis.strength=0;\n\t\tthis.dexterity=0;\n\t\tthis.damage_reduction_magic=0;\n\t\tthis.damage_reduction_strength=0;\n\t\tthis.damage_reduction_dexterity=0;\n\t\tthis.damage_increase_magic=0;\n\t\tthis.damage_increase_strength=0;\n\t\tthis.damage_increase_dexterity=0;\n\t\tthis.poison=0;\n\t\tthis.vampirism=0;\n\t\tthis.gold=0;\n\t\tthis.affinity=getRndInteger(0, 2);\n\t}", "function init() {\r\n\r\n }", "constructor() {\n this.strategies = new Map();\n this.systems = new Map();\n }", "constructor() { //this literally makes shit\n super() //this will take then take the props from Car and allow the ability to add more props to be called \n // later on from the Ford class that are added onto the Car class in this instance of Car (Ford class)\n\n this.windows = 4; // this takes the props from Car and adds onto them \n }", "consructor() {\n }", "init() {\n\t\tthis.mousePos = {x: 0, y: 0};\n\t\tthis.gameWidth = Math.max(screen.width, window.innerWidth);\n\t\tthis.gameHeight = Math.max(screen.height, window.innerHeight);\n\t\tthis.skier.init();\n\t\tthis.yeti.init();\n\t\tthis.lift.init();\n\t\tthis.slalom.init();\n\t\tthis.isPaused = false;\n\t\tthis.yDist = 0;\n\t\tthis.timestampFire = this.util.timestamp();\n\t\tthis.skierTrail = [];\n\t\tthis.currentTreeFireImg = this.tree_bare_fire1;\n\t\tthis.stylePointsToAwardOnLanding = 0;\n\t\tthis.style = 0;\n\t\tsocket.emit('new_point', 0);\n\t\tthis.logo = { x: -50, y: -40 };\n\t\tthis.gameInfoBtn.title = 'Pause';\n\t}", "constructor() {\n /**\n * @member {Object} Utils.Utils#_env The Environment variables to be stored for a given runtime\n */\n privateStuff.set(_env, {\n WORKDIR: process.cwd(),\n RUNTIMEDIR: path.resolve(__dirname + \"/../\"),\n RUNTIMEINFO: require(__dirname + \"/../package.json\")\n });\n /**\n * @member {Symbol.iterable} Utils.Utils#_args The arguments object that will keep the arguments schema (descriptions, pattern to extract)\n */\n privateStuff.set(_args,require(__dirname + \"/../data/arguments.json\"));\n }", "function _init() {\n\t\t// If multiple players on page/domain, get intance name in order to use it in local storage\n\t\tthis.instanceName = this.dom.getAttribute(\"ln-player\") || \"main\";\n\n\t\tthis.audio = this.dom.getElementsByTagName(\"audio\")[0];\n\n\t\tthis.ls = {};\n\t\tthis.ls.volume = this.instanceName + \".volume\";\n\n\t\tthis._eventDetails = {\n\t\t\tplayer: this.instanceName,\n\t\t};\n\n\t\treturn this;\n\t}", "function setVariables() {\n /* y-axis */\n y = 15;\n\n /*call imgSelect() to select a random image*/\n selectedimg = imgSelect();\n\n /*set height and width of objects depending on the type of selectedimg selected*/\n if(selectedimg === red_ball || selectedimg === purple_ball){\n objectHeight = 25;\n objectWidth = 25;\n }else if(selectedimg === dog){\n objectHeight = 175;\n objectWidth = 180;\n }else if(selectedimg === fire){\n objectWidth = 50;\n objectHeight = 80;\n }\n else{\n objectHeight = 50;\n objectWidth = 15;\n }\n\n /*select random number along x-axis */\n randomX = random(1, width-objectWidth);\n}", "constructor() {\n this.store = {};\n this.fastStore = {};\n this.images = [];\n this.controllers = [];\n this.viewers = [];\n // TODO: make it configurable in the url\n this.devMode = true;\n }", "function init() {\n }", "init() { \n this.ecs.set(this, \"Game\", \"game\", \"scene\")\n }", "constructor(){\n this.manager;\n this.engineers = [];\n this.interns = [];\n }", "init () {\n }", "function init(){\t\n\t\tbase.toggle = new Toggle (base, key);\n\t\tbase.audio = new AudioPlayer(base, key);\n\t\tbase.videos = [];\n\t\t\n\t\tfor (var i = 0; i < videoList.length; i++) {\n\t\t\tvar video = new VideoPlayer(base, videoList[i])\n\t\t\tbase.videos.push( video );\n\t\t\tvideos.push( video );\n\t\t}\n\t}", "initializeRegularBeaker()\n {\n //Water should be some reasonable value.\n this.water = STARTING_WATER_LEVEL;\n\n //Everything else should be Zero.\n this.red = this.green = this.blue = 0;\n\n this.ph = 7.0;\n\n this.color = Difficulty_1_Colors.WATER;\n\n\n this.temperature = STARTING_TEMPERATURE;\n }", "_applyInstanceProperties() {\n for (const [p, v] of this._instanceProperties) {\n this[p] = v;\n }\n this._instanceProperties = undefined;\n }", "function init() {\n\n\n\n\t}", "_setup() {\n this.wrapper = this._setupWrapper();\n this.canvas = this._setupCanvas();\n this.context = this._setupCanvasContext();\n this.stage = this._setupStage();\n this.bricks = this._setupBricks();\n this._setupPaddle();\n this._setupBall();\n this.collisionDetection = this._setupCollisionDetection();\n }", "constructor() {\n super();\n this.services = null;\n this.instances = null;\n this.classBuilder = new ClassBuilder();\n }", "init() {\n }", "init() {\n }", "init() {\n }", "constructor()\n {\n this.init();\n }", "initialise () {}" ]
[ "0.680135", "0.6550668", "0.646188", "0.6198976", "0.616119", "0.6151368", "0.61162347", "0.6062928", "0.58999926", "0.58256704", "0.5797813", "0.5791412", "0.57866913", "0.57830083", "0.5770955", "0.5769084", "0.57578593", "0.57387656", "0.5737451", "0.5708502", "0.56754524", "0.5672518", "0.5672518", "0.5672518", "0.5672518", "0.5672518", "0.5668273", "0.5668273", "0.56524026", "0.5650327", "0.5644754", "0.56359184", "0.5630489", "0.56287074", "0.56287074", "0.56216156", "0.5615256", "0.56114846", "0.5611293", "0.56081766", "0.5601514", "0.5596787", "0.5588077", "0.55762166", "0.55762166", "0.55762166", "0.55604595", "0.55546254", "0.55497736", "0.5549612", "0.55410874", "0.5533115", "0.5519515", "0.55180764", "0.5512488", "0.5511813", "0.5507622", "0.5505743", "0.5505743", "0.5501965", "0.5501965", "0.5496566", "0.5496566", "0.5496566", "0.5496566", "0.5496566", "0.5496566", "0.5496566", "0.5496566", "0.5496566", "0.5496566", "0.5496566", "0.5496566", "0.5496566", "0.54947746", "0.54940563", "0.54932934", "0.5490844", "0.54892814", "0.5489068", "0.5485382", "0.5485076", "0.547927", "0.54779553", "0.5475263", "0.54746485", "0.5473248", "0.5472523", "0.54710525", "0.5468207", "0.5465475", "0.5458644", "0.5450953", "0.5448104", "0.54473317", "0.54429007", "0.54413855", "0.54413855", "0.54413855", "0.54400086", "0.5438713" ]
0.0
-1
Draw the enemy on the screen
render() { ctx.drawImage(Resources.get(this.sprite), this.x, this.y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawEnemy(EnemyX,EnemyY){\n image(Enemy,EnemyX,EnemyY,50,50);\n}", "draw() {\n ctx.fillStyle = this.color\n ctx.shadowColor = this.color\n ctx.shadowBlur = 30\n ctx.fillRect(this.pos.x, this.pos.y, this.size.w, this.size.h)\n\n if (this.color === this.hitColor) {\n setTimeout(() => {\n this.color = this.defaultColor // sets the color of the enemy to normal after 100 ms\n }, 100)\n }\n\n ctx.closePath()\n }", "draw() {\n this.drawExistingEntities();\n this.disableEntities();\n this.blockHeroMovement();\n this.killedEnemiesCounter();\n }", "function draw() {\n if (isRunning) {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n const enemyStyle = '#ff0000';\n drawRect(randomEnemyX, dy, 50, enemyHeight, enemyStyle);\n drawPlayer();\n\n if ((playerX == randomEnemyX)\n && (dy >= canvas.height - playerHeight - enemyHeight)) {\n gameOver();\n }\n\n if (dy <= canvas.height) {\n dy = dy + 1;\n } else {\n marcaPonto(1);\n drawScore();\n\n if (score % 4 == 0) {\n changeControls();\n }\n\n dy = 1;\n randomEnemyX = getEnemyX();\n }\n}\n}", "function drawScreen() {\n clearScreen()\n updateEnemyPosition()\n checkforCollisions()\n winningCollision()\n drawCharacter()\n}", "draw() {\n if (this.waves.lives == 0) {\n this.ctx.fillStyle = colours.flat_davys_grey;\n this.ctx.fillRect(0, 0, this.size.x, this.size.y);\n this.ctx.fillStyle = colours.flat_electric_blue;\n this.ctx.font = (this.wallSize) + 'px \"Press Start 2P\"';\n this.ctx.fillText('GAME OVER ', this.canvas.width / 2 - this.wallSize * 4, this.canvas.height / 2);\n this.ctx.font = (this.wallSize)/2 + 'px \"Press Start 2P\"';\n this.ctx.fillText('You reached wave ' + (this.waves.waveNo - 1), this.canvas.width / 2 - this.wallSize * 4, this.canvas.height / 2 + this.wallSize);\n let enemy = new Sprite (\n this.canvas,\n this.ctx,\n new Vector((this.canvas.width/2) - this.wallSize * 2.5, this.wallSize * 3), // position\n new Vector(0, 0),\n new Vector(this.wallSize * 5, this.wallSize * 5), // size\n new Spritesheet(images.enemy),\n [0, 11]\n );\n enemy.draw();\n document.getElementById('Game').classList.add(\"hide\");\n document.getElementById('GameOver').classList.remove(\"hide\");\n } else {\n this.walls.forEach(sprite => sprite.draw());\n // this.enemywalls.forEach(sprite => sprite.draw());\n this.towers.forEach(sprite => sprite.draw());\n if (this.wavesStart)\n this.waves.draw();\n this.moveTower.draw();\n }\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 EnemyChar() {\r\n this.width = enemySize;\r\n this.height = enemySize;\r\n this.xPos = canvas.width - enemySize; // print outside the screen\r\n this.yPos = canvas.height - enemySize;\r\n}", "function drawEnemy(){\n\tfor(let i=0;i<enemyArr.length; i++){\n\n\t\tif(enemyArr[i].name === 'redFregat'){\n\t\t\tif(enemyArr[i].y >= enemyArr[i].yPos){\n\t\t\t\tenemyArr[i].speedY = 0;\n\t\t\t\tif(enemyArr[i].speedX === 0){\n\t\t\t\t\tenemyArr[i].speedX = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tenemyArr[i].x += enemyArr[i].speedX;\n\t\tenemyArr[i].y += enemyArr[i].speedY;\n\t\tif (enemyArr[i].name != 'redFregatBoss'){\n\t\t\tif(enemyArr[i].x + enemyArr[i].width >=500 || enemyArr[i].x <=0){\n\t\t\t\tenemyArr[i].speedX *= -1;\n\t\t\t}\n\t\t}\n\n\t\t//Drawing ship enemy============================\n\t\t\tenemyArr[i].N_x += 0.2;\n\t\t\tship_01()\n\n\t\t//Drawing ship enemy============================\n\n\t\t//Drawing AsteroidRed enemy============================\n\t\t\t\n\t\t\tasteroidDraw()\n\n\t\t//Drawing AsteroidRed enemy============================\n\n\n\t\t//Drawing redShip Freg Lazer enemy============================\n\t\t\t\tif(enemyArr[i].name === 'redShip'){\n\n\t\t\t\t\tenemyArr[i].fire++;\n\n\t\t\t\t\tif(enemyArr[i].fire%80 === 0){\n\t\t\t\t\t\taddEnemyLazer(enemyLazerImg, enemyArr[i].x+10, (enemyArr[i].y+enemyArr[i].height) , 0, 3, 10, 15,'enemyLazer', 1)\n\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\tif(enemyArr[i].name === 'redFregat'){\n\n\t\t\t\t\tenemyArr[i].fire++;\n\n\t\t\t\t\tif(enemyArr[i].fire%160 === 0){\n\n\t\t\t\t\t\tlet firstL;\n\t\t\t\t\t\tif(enemyArr[i].x+10 > hero.x){\n\t\t\t\t\t\t\tfirstL = randomNum(-2, -1)\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfirstL = randomNum(1, 2)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taddEnemyLazer(enemyLazerImg, enemyArr[i].x+10, (enemyArr[i].y+enemyArr[i].height) , firstL, 2, 10, 15,'enemyLazer', 1)\n\n\t\t\t\t\t\tlet secondL;\n\t\t\t\t\t\tif(enemyArr[i].x+10 > hero.x){\n\t\t\t\t\t\t\tsecondL = randomNum(-2, -1)\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tsecondL = randomNum(1, 2)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taddEnemyLazer(enemyLazerImg, enemyArr[i].x+70, (enemyArr[i].y+enemyArr[i].height) , secondL, 2, 10, 15,'enemyLazer', 1)\n\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\tredShipFregLazer()\n\t\t//Drawing redShip Freg Lazer enemy============================\n\n\t\t//delete enemy from array===================\n\t\tif( enemyArr[i].y >=300 || enemyArr[i].y < -50 || enemyArr[i].x >=520 || enemyArr[i].x < -10){\n\n\t\t\tenDead = true;\n\t\t\tif(enDead){\n\t\t\t\tenemyArr.splice(i, 1);\n\n\t\t\t}\n\t\t}\n\t\t//delete enemy from array===================\n\t}\n}", "drawPlayer() {\n ctx.fillStyle = this.sprite;\n ctx.fillRect(this.positionX, this.positionY, this.height, this.width);\n }", "function draw()\n{\n translate(400, 300);\n if (j == 1 && orderArr.length == 1)\n {\n draw_enemy(orderArr[0]);\n }\n if( frameCount % 6 == 0 && j < orderArr.length)\n {\n if (j == 1)\n {\n draw_enemy(orderArr[0]);\n }\n push();\n stroke(0, 0, 255, 90);\n strokeWeight(4);\n lastEnemy = orderArr[j-1];\n enemy = orderArr[j];\n x = lastEnemy.pos.x;\n y = lastEnemy.pos.y;\n x1 = enemy.pos.x;\n y1 = enemy.pos.y;\n line(x,y,x1,y1);\n draw_enemy(lastEnemy);\n draw_enemy(enemy);\n pop();\n ++j;\n }\n}", "function Enemy() {\n this.srcX = 131;\n this.srcY = 500;\n this.width = 128;\n this.height = 78;\n this.speed = 2;\n this.drawX = Math.floor(Math.random() * 1000) + gameWidth;\n this.drawY = Math.floor(Math.random() * 422);\n}", "drawExistingEnemies() {\n const enemies = this.enemiesManager.entitiesDisplayed;\n for (let index = 0; index < enemies.length; index++) {\n enemies[index].draw(this.ctx);\n }\n }", "Draw(){\n\t\tthis.context.beginPath();\n\t\tthis.context.fillRect(this.posX, this.posY, this.width, this.height);\n\t\tthis.context.closePath();\n }", "function draw() {\n\tbackground(0, 204, 0); // Background color\n\timageMode(CENTER); // Expands the image from the center of the coordinate it'll be located from\n\timage(stageBackground, width / 2, height / 2, width, height); // Stage the background to expand in the center and fit the canvas width and height\n\ttextTemplate.displayScore(); // Displays the score on screen, will increment by 100 everytime an enemy is killed\n\tdisplayFrequency();\n\n\tvirus.virusX -= virus.virusSpeed; // Virus move towards the left\n\n\t// If the shoot button has been pressed it'll display the bullet\n\tif (bullet.shootButton === true) {\n\t\t// Causes the bullet to be displayed\n\t\tbullet.display();\n\t}\n\t// Have to be displayed below if statement above otherwise bullet will display ontop of megaman\n\timage(imgMegaman, megaman.megamanX, megaman.megamanY, 100, 100); // Displays megaman based on coordinates\n\timage(imgVirus, virus.virusX, virus.virusY, 100, 100); // Displays the virus enemy based on coordinates\n\n\tbulletHitEnemy(); // Uses the custom built function for what happens when the bullet hits the enemy\n\n\t// This if statement makes the virus automatically change it's sprite as it moves\n\t// if (round(virus.virusX) - virus.virusX === 0.5) {\n\t// \timgVirus = loadImage(stage.stageVirusDefault[0]);\n\t// } else {\n\t// \timgVirus = loadImage(stage.stageVirusAction[0]);\n\t// }\n\n\t// I use this if statement to show print to console the position of my mouse location when the mouse is pressed\n\t// if (mouseIsPressed) {\n\t// \tprint(`x: ${mouseX} y: ${mouseY}`);\n\t// }\n}", "draw() {\n let sprite = this.sprite;\n if (sprite == null)\n return;\n ctx.drawImage(sprite.sprite, sprite.animationFrame * sprite.width, 0, sprite.width, sprite.height, this.rect.x + sprite.xOffset, this.rect.y + sprite.yOffset, this.rect.width * sprite.xStretch, this.rect.height * sprite.yStretch);\n if (Entity.showEntityRects) {\n ctx.beginPath();\n ctx.lineWidth = \"5\";\n ctx.strokeStyle = \"#00ff00\";\n ctx.rect(this.rect.x, this.rect.y, this.rect.width, this.rect.height);\n ctx.stroke();\n }\n }", "function _draw(ctx){\r\n\t\t// the _draw() method renders all of our game objects on the stage\r\n\t\t// for now we just have single object (our ship)\r\n\t\tship.draw(ctx);\r\n\t}", "function paintEnemies(enemies) {\n enemies.forEach(function (enemy) {\n enemy.y += 5;\n enemy.x += getRandomInt(-15, 15);\n\n // Paint only if not dead\n if (!enemy.isDead) {\n paintTriangle(enemy.x, enemy.y, 20, '#ff0000', 'down');\n }\n\n // Paint enemy shots\n enemy.shots.forEach(function (shot) {\n shot.y += SHOOTING_SPEED; // Enemy shots go down\n paintTriangle(shot.x, shot.y, 5, '#00ffff', 'down');\n });\n });\n}", "function drawElements(){\r\n // console.log(\"drawElements CALLED\")\r\n // console.log(`player.x = ${player.x} - - - player Y = ${player.y}`)\r\n \r\n ctx.rect(player.x, player.y, 40, 40);\r\n ctx.stroke()\r\n}", "function Enemy (width, height, color, x, y){\n //set the current active enemy to true\n this.active = true;\n this.width = width;\n this.height = height;\n this.x = x;\n this.y = y;\n this.xVelocity = 1;\n //keep enemies in bounds\n this.inBounds = function(){\n return this.x >= 0 && this.x <= 6656\n && this.y >= 0 && this.y <= 468;\n };\n this.image= './images/enemy.png';\n this.draw = function (){\n const enemyImg = new Image();\n enemyImg.src = this.image;\n ctx.drawImage(enemyImg, this.x, this.y, this.width, this.height)\n },\n this.update = function (){\n //enemy starts at position x which changes negatively\n this.x -= this.xVelocity;\n this.xVelocity = 1; \n this.active = this.active && this.inBounds();\n };\n this.die = function(){\n this.active = false;\n };\n \n }", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // drawCharacters();\n\n // don't draw them on first few screens\n if( adventureManager.getStateName() === \"Splash\" ||\n adventureManager.getStateName() === \"Instructions\" ||\n adventureManager.getStateName() === \"Characters\" ) {\n ;\n }\n else {\n //drawCharacters();\n }\n \n // draw the p5.clickables, in front of the mazes but behind the sprites\n clickablesManager.draw();\n}", "draw(ctx) {\n if (this.walkingRight) {\n this.walkRightAnimation.drawFrame(this.game, this.game.clockTick, ctx, this.x, this.y, 1);\n }\n else if (this.walkingLeft) {\n this.walkLeftAnimation.drawFrame(this.game, this.game.clockTick, ctx, this.x, this.y, 1);\n }\n else if (this.walkingForward) {\n this.walkForwardAnimation.drawFrame(this.game, this.game.clockTick, ctx, this.x, this.y, 1);\n }\n else if (this.walkingDownward) {\n this.walkDownwardAnimation.drawFrame(this.game, this.game.clockTick, ctx, this.x, this.y, 1);\n }\n else if (this.shooting) {\n this.shootBolt(ctx);\n }\n else if (this.raising) {\n this.raiseShield(ctx);\n }\n else if (this.swinging) {\n this.swingSword(ctx);\n }\n else if (this.casting) {\n this.castSpell(ctx);\n }\n else {\n this.standStill(ctx);\n }\n\n Entity.prototype.draw.call(this);\n }", "function draw(){\r\n ctx.globalAlpha = 1;\r\n ctx.clearRect(0,0,_WIDTH,_HEIGHT);\r\n //DRAW BG\r\n ctx.drawImage(_BG,0,0);\r\n //DRAW ENEMY PATH\r\n if(DRAWPATHFLAG==1){\r\n\t ctx.beginPath();\r\n\t ctx.moveTo(_DESTARRAY[0][0],_DESTARRAY[0][1]);\r\n\t for(var i=0;i<_DESTARRAY.length;i++){\r\n\t\t ctx.lineTo(_DESTARRAY[i][0],_DESTARRAY[i][1]);\r\n\t }\r\n\t ctx.stroke();\r\n\t ctx.fillStyle = \"rgba(0,0,0,0.4)\";\r\n \t\tif(_POLYARRAY.length > 0){\r\n \t\t ctx.beginPath();\r\n\t\t ctx.moveTo(_POLYARRAY[0][0],_POLYARRAY[0][1]);\r\n\t\t for(var i=0;i<_POLYARRAY.length;i++){\r\n\t\t\t ctx.lineTo(_POLYARRAY[i][0],_POLYARRAY[i][1]);\r\n \t\t }\r\n \t\t ctx.closePath();\r\n \t\t ctx.fill();\r\n \t\t}\r\n }\r\n \r\n \r\n\t \r\n \r\n //Handle towers\r\n for(var i=0;i<allTowers.length;i++){\r\n\tvar collide = 0;//stores collision info\r\n allTowers[i].draw();\r\n\t//Handle tower bullets\r\n\tfor(var i2=0;i2<allTowers[i].allBullets.length;i2++){\r\n\t //Propel bullets\r\n\t allTowers[i].allBullets[i2].shootTowards();\r\n\t //Clean up bullets\r\n\t collide = allTowers[i].detectBulletCollision(i2,allEnemies);\r\n\t if(allTowers[i].allBullets[i2].x>=_WIDTH || allTowers[i].allBullets[i2].x<=0 || allTowers[i].allBullets[i2].y>=_HEIGHT || allTowers[i].allBullets[i2].y<=0 || collide>-1 || collide==-2){\r\n\t\tif(collide>-1){\r\n\t\t\tallEnemies[collide].health-=allTowers[i].damage;\r\n\t\t}\r\n\t allTowers[i].allBullets.splice(i2,1);\r\n\t }\r\n\t}\r\n }//End handling of towers\r\n \r\n //Handle enemies\r\n for(var i=0;i<allEnemies.length;i++){\r\n\t if(allEnemies[i].x>_WIDTH || allEnemies[i].x<0 || allEnemies[i].y>_HEIGHT || allEnemies[i].y<0){\r\n\t allEnemies.splice(i,1);\r\n\t\tplayer.health-=10;\r\n\t }\t\t \r\n\t if(allEnemies[i].health<=0){\r\n\t\tplayer.money+=allEnemies[i].reward;\r\n\t\tallEnemies.splice(i,1);\r\n\t }\r\n\t allEnemies[i].draw(); \t \r\n }//End handling of enemies\r\n \r\n for(var i=0;i<towerButtons.length;i++){\r\n\t towerButtons[i].draw();\r\n }\r\n if(selectedTower==-1)\r\n button[2].fill = \"rgba(240,0,50,.6)\";\r\n else\r\n button[2].fill = \"rgba(0,0,0,1)\";\r\n for(var i=2;i<button.length;i++){\r\n\t button[i].draw();\r\n }\r\n button[0].text = _ESPEED;\r\n button[1].text = _ESPEED\r\n button[0].draw();\r\n button[1].draw();\r\n \r\n //Draw upgrade buttons\r\n for(var i=0;i<allTowers.length;i++){\r\n\tfor(var i2=0;i2<allTowers[i].upgradeButtons.length;i2++){\r\n\t\tif(allTowers[i].upgradeButtons[i2].value.cost > player.money){\r\n\t\t allTowers[i].upgradeButtons[i2].fill = \"rgba(255,10,10,.6)\";\r\n\t\t}else\r\n\t\t allTowers[i].upgradeButtons[i2].fill = \"rgba(10,20,200,.8)\";\r\n\t\tif(allTowers[i].rangeFlag == 1)\r\n\t\tallTowers[i].upgradeButtons[i2].draw();\r\n\t}\r\n }\r\n \r\n //Draw player stats\r\n ctx.font = \"bold 12px sans-serif\";\r\n ctx.fillText(\"Health: \"+player.health, 0, 20);\r\n ctx.fillText(\"Money: \"+player.money, 0, 40)\r\n ctx.fillText(\"Next Wave: \"+waveTime,0,60);\r\n ctx.fillText(\"Wave: \"+_WAVECOUNT+\"/\"+_WAVE.length,0,80);\r\n\r\n //Draw building preview\r\n ctx.globalAlpha = 0.5;\r\n if(!notInPolygon(_MOUSEX,_MOUSEY)&&_CURRTOWER!=\"\"||player.money<_CURRTOWER.cost){\r\n ctx.fillStyle=\"rgba(255,20,20,1)\";\r\n ctx.fillRect(_MOUSEX-(_CURRTOWER.width/2),_MOUSEY-(_CURRTOWER.height/2),_CURRTOWER.width,_CURRTOWER.height);\r\n ctx.fillStyle=\"rgba(0,0,0,1)\";\r\n }\r\n ctx.drawImage(_CURRTOWER.img,_MOUSEX-(_CURRTOWER.width/2),_MOUSEY-(_CURRTOWER.height/2));\r\n \r\n}", "function Enemy() {\n this.speed = 1;\n this.word;\n \n \n this.draw = function() {\n \n // Update moved location\n this.y += this.speed;\n // Draw\n this.context.drawImage(this.word.img, this.x, this.y);\n };\n \n this.init = function(x,y, index) {\n this.x=x;\n this.y=y;\n this.word = game.wordBank[index];\n\tgame.wordBank.splice(index, 1);\n };\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 Enemy() {\n var percentFire = .01;\n var chance = 0;\n this.alive = false;\n /*\n * Sets the Enemy values\n */\n this.spawn = function (x, y, speed) {\n this.x = x;\n this.y = y;\n this.speed = speed;\n this.speedX = 0;\n this.speedY = speed;\n this.alive = true;\n this.leftEdge = this.x - 90;\n this.rightEdge = this.x + 90;\n this.bottomEdge = this.y + 140;\n };\n /*\n * Move the enemy\n */\n this.draw = function () {\n this.context.clearRect(this.x - 1, this.y, this.width + 1, this.height);\n this.x += this.speedX;\n this.y += this.speedY;\n if (this.x <= this.leftEdge) {\n this.speedX = this.speed;\n } else if (this.x >= this.rightEdge + this.width) {\n this.speedX = -this.speed;\n } else if (this.y >= this.bottomEdge) {\n this.speed = 1.5;\n this.speedY = 0;\n this.y -= 5;\n this.speedX = -this.speed;\n }\n this.context.drawImage(imageRepository.enemy, this.x, this.y);\n // Enemy has a chance to shoot every movement\n chance = Math.floor(Math.random() * 101);\n if (chance / 100 < percentFire) {\n this.fire();\n }\n };\n /*\n * Fires a bullet\n */\n this.fire = function () {\n game.enemyBulletPool.get(this.x + this.width / 2, this.y + this.height, -2.5);\n }\n /*\n * Resets the enemy values\n */\n this.clear = function () {\n this.x = 0;\n this.y = 0;\n this.speed = 0;\n this.speedX = 0;\n this.speedY = 0;\n this.alive = false;\n };\n}", "draw(ctx) {\n let xOffset = 0;\n let yOffset = 0;\n if (this.dead) {\n if (this.deadAudio) {\n ASSET_MANAGER.playAsset(\"./audio/player_death.mp3\")\n this.deadAudio = false;\n }\n\n if (this.weapon === 0 && this.facing === 0) {\n xOffset = -45;\n yOffset = -23;\n } else if (this.weapon === 0 && this.facing === 1) {\n xOffset = -35;\n yOffset = -20;\n } else if (this.weapon === 1 && this.facing === 0) {\n xOffset = -75;\n yOffset = -45;\n } else if (this.weapon === 1 && this.facing === 1) {\n xOffset = -0;\n yOffset = -42;\n } else if (this.weapon === 2 && this.facing === 0) {\n xOffset = -65;\n yOffset = -40;\n } else if (this.weapon === 2 && this.facing === 1) {\n xOffset = -30;\n yOffset = -30;\n\n }\n if (this.facing === 0) {\n this.deadAnimR[this.weapon].drawFrame(this.game.clockTick, ctx, this.x - this.game.camera.x + xOffset,\n this.y - this.game.camera.y + yOffset, 1);\n } else {\n this.deadAnimL[this.weapon].drawFrame(this.game.clockTick, ctx, this.x - this.game.camera.x + xOffset,\n this.y - this.game.camera.y + yOffset, 1);\n }\n } else {\n if (this.weapon === 0) {\n xOffset = 0;\n yOffset = 0;\n } else if (this.weapon === 1) {\n if (this.state === 0) {\n if (this.facing === 1) yOffset = 1;\n this.facing === 0 ? xOffset = 0 : xOffset = -27;\n } else if (this.state === 1 && this.facing === 1) {\n xOffset = -15;\n yOffset = 0;\n } else if (this.state === 2 && this.facing === 0) {\n xOffset = -18;\n yOffset = -15;\n } else if (this.state === 2 && this.facing === 1) {\n xOffset = -68;\n yOffset = -15;\n } else if (this.state === 3 && this.facing === 1) {\n xOffset = -45;\n yOffset = 0;\n } else if (this.state === 4 && this.facing === 1) {\n xOffset = -20;\n yOffset = -5;\n }\n } else { //if bow\n //console.log(this.facing + \" \" + this.state);\n if (this.state === 0) {\n yOffset = 1;\n this.facing === 0 ? xOffset = 0 : xOffset = 0;\n } else if (this.state === 2) {\n this.facing === 0 ? xOffset = 0 : xOffset = -7;\n } else if (this.state === 4) {\n yOffset = 5;\n }\n\n }\n yOffset -= 5;\n this.animations[this.state][this.facing][this.weapon].drawFrame(this.game.clockTick, ctx,\n this.x - this.game.camera.x + xOffset, this.y - this.game.camera.y + yOffset, 1);\n\n }\n\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.BB.width, this.BB.height);\n ctx.strokeStyle = 'Blue';\n ctx.strokeRect(this.ABB.x - this.game.camera.x, this.ABB.y - this.game.camera.y, this.ABB.width, this.ABB.height);\n\n } else if (this.weapon === 2) {\n ctx.strokeStyle = 'White';\n //ctx.arc()\n ctx.strokeRect(this.ABB.x - this.game.camera.x, this.ABB.y - this.game.camera.y, this.ABB.width, .25);\n }\n }", "function drawChar(){\r\n\t\t\r\n\t\tgc.beginPath();\r\n\t\tgc.rect(player.x, player.y, player.w, player.h);\r\n\t\tgc.fillStyle = playerColour;\r\n\t\tgc.fill();\r\n\t\tgc.closePath();\r\n\t\t\r\n\t}", "function draw(){\ncanCon.clearRect(0, 0, canCon.width, canCon.height);\n\n//stuff to draw\nbearer.draw();\nshield.draw();\n\n// draw Backscatter Buster Shots\nfor(var index = 0; index < playerPro.length; index++){\n playerPro[index].draw();\n}\n\n// draw enemies\nfor(var index = 0; index < enemies.length; index++){\n enemies[index].draw();\n}\n\n// draw enemy projectiles\nfor(var index = 0; index < enemyPro.length; index++){\n enemyPro[index].draw();\n}\n\n// draw HUD over everything\nScoreDisplay.draw();\nHealthDisplay.draw();\n}", "draw() {\n\n spiel.ctx.beginPath();\n spiel.ctx.fillStyle = \"ghostwhite\";\n spiel.ctx.fillRect(this.posX, this.posY, this.height, this.width);\n\n spiel.ctx.closePath();\n }", "function drawShooting(x, y){\n graphics.fillRect(x, y, 10, 5);\n graphics.fillStyle = \"Red\";\n //graphics.fillRect(225, 480, 15, 15);\n //graphics.fillRect(x, y, 15, 15);\n }", "function draw() {}", "function draw() {}", "function drawEverything() {\n\tcolorRect(0,0,canvas.width,canvas.height,\"black\"); // background screen size and color\n\tcolorRect(player1X,player1Y,PLAYER_WIDTH,PLAYER_HEIGHT,\"green\"); // player\n\tcolorRect(enemy1X,enemy1Y,ENEMY_1_WIDTH,ENEMY_1_HEIGHT,\"red\"); // enemy 1\n\t\n\tcanvasContext.font=\"26px Helvetica\";\n\tcanvasContext.fillStyle=\"white\";\n\tcanvasContext.fillText((\"Time: \" + time.toString()), 25, 50); \n\n}", "function draw() {\n\t\t\t\tctx.fillStyle = \"black\";\n\t\t\t\tctx.fillRect(0,0,canvasWidth, canvasHeight);\n\t\t\t\tplayer.draw();\n\t\t\t\tcomputer.draw();\n\t\t\t\tball.draw();\n\t\t\t}", "drawSelf(theCanvas, user, theGame) {\n theCanvas.clearEnemy(this);\n this.playerInVicinity(user);\n if (!this.playerIsSeen) {\n let enemyDirection = this.direction % 4;\n if (enemyDirection === 0 && (this.id === 0 || this.id === 4)) {\n if (!theCanvas.detectLine(this.x, this.y + 35)) {\n this.y += 5;\n this.currDirection = \"S\";\n } else {\n if (this.id === 0) {\n this.direction += 2;\n } else {\n this.direction++;\n }\n }\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingDown[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n } else if (enemyDirection === 1 && (this.id === 5 || this.id === 4)) {\n if (!theCanvas.detectLine(this.x + 35, this.y)) {\n this.x += 5;\n this.currDirection = \"E\";\n } else {\n if (this.id === 5) {\n this.direction += 2;\n } else {\n this.direction++;\n }\n }\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingRight[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n } else if (enemyDirection === 2 && (this.id === 0 || this.id === 4)) {\n if (!theCanvas.detectLine(this.x, this.y - 15)) {\n this.y -= 5;\n this.currDirection = \"N\";\n } else {\n if (this.id === 0) {\n this.direction += 2;\n } else {\n this.direction++;\n }\n }\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingUp[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n } else if (enemyDirection === 3 && (this.id === 5 || this.id === 4)) {\n if (!theCanvas.detectLine(this.x - 15, this.y)) {\n this.x -= 5;\n this.currDirection = \"W\";\n } else {\n if (this.id === 5) {\n this.direction += 2;\n } else {\n this.direction++;\n }\n }\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingLeft[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n }\n\n //changes behavior of enemy once player is in distance\n } else {\n if (user.x === this.x || user.x === this.x + 5 || user.x === this.x - 5) {\n if(user.y > this.y){\n this.currDirection = 'S';\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingDown[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n }else{\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingUp[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n this.currDirection = 'N'\n }\n this.attackPlayer(user, theGame);\n \n } else if(user.y === this.y || user.y === this.y + 5 || user.y === this.y - 5){\n if(user.x > this.x){\n this.currDirection = 'E';\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingRight[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n }else{\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingLeft[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n this.currDirection = 'W'\n }\n this.attackPlayer(user, theGame);\n }else{\n if (user.x > this.x && !theCanvas.detectLine(this.x + 35, this.y) && !theCanvas.detectLine(this.x, this.y + 40) && !theCanvas.detectLine(this.x, this.y + 45)) {\n this.x += 5;\n this.currDirection = \"E\";\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingRight[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n } else if (\n user.y < this.y &&\n !theCanvas.detectLine(this.x, this.y - 15)\n ) {\n this.y -= 5;\n this.currDirection = \"N\";\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingUp[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n }else if (\n user.x < this.x &&\n !theCanvas.detectLine(this.x - 15, this.y)\n ) {\n this.x -= 5;\n this.currDirection = \"W\";\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingLeft[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n } else if (\n user.y > this.y &&\n !theCanvas.detectLine(this.x, this.y + 35) && !theCanvas.detectLine(this.x, this.y + 40) && !theCanvas.detectLine(this.x, this.y + 45)\n ) {\n this.y += 5;\n this.currDirection = \"S\";\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingDown[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n }else{\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingDown[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n }\n }\n }\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\tif(gameOn){\n\t\tupdate();\n\t\tmonsterFun();\n\t\tnewMonsterFun();\n\t}\n\t\n\tcontext.drawImage(backgroundImage, 0,0);\n\tcontext.drawImage(hero, heroLocation.x, heroLocation.y);\n\tcontext.drawImage(monster, monsterLocation.x, monsterLocation.y);\n\n\tif (hero.bombPlace == true){\n\t\tcontext.drawImage(bomb, bombLocation.x, bombLocation.y);\n\t}\n\tif (hero.bombTimer == true){\n\t\thero.bombTimer = false;\n\t\tsetTimeout(function(){\n\t\t\thero.bombPlace = false;\n\t\t}, 6000);\n\t\t\n\t}\n\tif (hero.explosion == true){\n\t\tcontext.drawImage(explosion, bombLocation.x, bombLocation.y);\n\t\tbombLocation.x = 900;\n\t\tbombLocation.y = 900;\n\t\thero.explosion = false;\n\t\tnewMonsterLocation.spawn = true;\n\t\t// setTimeout(function(){\n\t\t// \thero.explosion = false;\n\t\t// }, 1000);\n\t}\n\tif (newMonsterLocation.spawn == true){\n\t\tcontext.drawImage(newMonster, newMonsterLocation.x, newMonsterLocation.y);\n\t}\n\trequestAnimationFrame(draw);\n}", "function draw() {\n\tctx.clearRect(0, 0, WIDTH, HEIGHT);\n\tctx.fillStyle = \"rgba(0,0,0,0)\";\n\tctx.fillRect(0, 0, WIDTH, HEIGHT);\n\tctx.save();\n\tctx.fillStyle = \"#fff\";\n\tplayer.draw();\n\tdrawlist(bullets);\n\tdrawlist(enemies);\n\tctx.fillStyle = \"blue\";\n\tctx.font = \"25px Helvetica\";\n\tctx.fillText(\"SCORE: \" + score, 10, 30);\n\tif (player.dead) {\n\t ctx.fillStyle = \"red\";\n ctx.font = \"35px Helvetica\";\n ctx.fillText(\"Game Over!\", WIDTH/2 - ctx.measureText(\"Game Over!\").width/2, (HEIGHT)/1.35);\n ctx.font = \"30px Helvetica\";\n ctx.fillText(\"press 'R' to play again\", WIDTH/2 - ctx.measureText(\"press 'R' to play again\").width/2, (HEIGHT)/1.25);\n };\n\tctx.restore();\n}", "function draw() {\r\n\r\n // draw game background\r\n display.fill('white');\r\n\r\n // draw game map\r\n drawMap();\r\n\r\n // draw potential tower if player is dragging a tower\r\n if (controller.dragging && controller.isMouseInCanvas()) {\r\n drawNewTower();\r\n };\r\n\r\n // display buffer\r\n display.draw(); \r\n}", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n clickablesManager.draw();\n\n for( let i = 0; i < clickables.length; i++ ) {\n clickables[i].visible = false;\n }\n\n if( gDebugMode == true ) {\n drawDebugInfo();\n }\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}", "update(dt) {\n this.x += (level * fasterEnemySpeed) * dt;\n\n // When the enemy moves off the screen, the X and Y positions will be reset\n if (this.x > CANVAS_WIDTH) {\n this.x = randomX();\n this.y = randomY();\n }\n\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 canvasTurn() {\n /* Ensuring that object do not go over the canvas */\n if (this.x >= (canvas.width - this.width)) { //transporting enemy from the right side of canvas to left side.\n this.x = 0;\n }\n if (this.y >= (canvas.height - this.height)) { //transporting enemy from the botton side of canvas to up side.\n this.y = 0;\n }\n if (this.x < 0) { //transporting enemy from the left side of canvas to right side.\n this.x = canvas.width - this.width;\n }\n if (this.y < 0) { //transporting enemy from the up side of canvas to botton side.\n this.y = canvas.height - this.height;\n }\n}", "update(dt) {\n this.x += (level * enemySpeed) * dt;\n\n // When the enemy moves off the screen, the X position will be reset\n if (this.x > CANVAS_WIDTH) {\n this.x = randomX();\n }\n\n }", "function Enemy()\n{\n\tvar percentFire = .01; //controls how many bullets are fired\n\tvar chance = 0;\n\tthis.alive = false;\n\tthis.collidableWith = \"bullet\";\n\tthis.type = \"enemy\";\n\t/*\n\t * Sets the Enemy values\n\t */\n\tthis.spawn = function(x, y, speed)\n {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.speed = speed;\n\t\tthis.speedX = 0;\n\t\tthis.speedY = speed;\n\t\tthis.alive = true;\n\t\tthis.lives = 2;\n\t\tthis.leftEdge = this.x - 100;\n\t\tthis.rightEdge = this.x;\n\t\tthis.bottomEdge = this.y + 140;\n\t};\n\t/*\n\t * Move the enemy\n\t */\n\tthis.draw = function()\n {\n\t\tthis.context.clearRect(this.x-1, this.y, this.width+1, this.height);\n\t\tthis.x += this.speedX;\n\t\tthis.y += this.speedY;\n\t\tif (this.x <= this.leftEdge)\n {\n\t\t\tthis.speedX = this.speed;\n\t\t}\n\t\telse if (this.x >= this.rightEdge + this.width)\n {\n\t\t\tthis.speedX = -this.speed;\n\t\t}\n\t\telse if (this.y >= this.bottomEdge)\n {\n\t\t\tthis.speed = 4;\n\t\t\tthis.speedY = 0;\n\t\t\tthis.y -= 5;\n\t\t\tthis.speedX = -this.speed;\n\t\t}\n if (!this.isColliding)\n {\n\t\t\tthis.context.drawImage(imageRepository.enemy, this.x, this.y);\n\n\t\t\t// Enemy has a chance to shoot every movement\n\t\t\tchance = Math.floor(Math.random()*101);\n\t\t\tif (chance/100 < percentFire)\n {\n\t\t\t\tthis.fire();\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t\telse if(this.isColliding && this.lives > 0)\n {\n\t\t\tthis.lives--;\n\t\t\tthis.isColliding = false;\n\t\t}\n\t\telse if(this.isColliding && this.lives == 0)\n {\n game.playerScore += 20;\n game.explosion.get();\n\t\t\treturn true;\n\t\t}\n\t};\n\t/*\n\t * Fires a bullet\n\t */\n\tthis.fire = function() {\n\t\tgame.enemyLaser.get();\n\t\tgame.enemyBulletPool.get(this.x+this.width/2, this.y+this.height, -2.5);\n\t}\n\t/*\n\t * Resets the enemy values\n\t */\n\tthis.clear = function() {\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t\tthis.speed = 0;\n\t\tthis.speedX = 0;\n\t\tthis.speedY = 0;\n\t\tthis.alive = false;\n this.isColliding = false;\n\t};\n}", "function displayEnemy(x, y, text) {\n var pos = document.getElementById(x + y)\n pos.innerHTML = text\n // console.log(`Enemy Loaded: ${text}`);\n }", "function drawEnemies() {\n\n for (i = 0; i < numberOfEnemies; i++) {\n\n fill(enemyFill, enemyHealth);\n ellipse(enemyX[i], enemyY[i], enemyRadius * 2);\n\n }\n}", "draw() {\n\n // only display the dirt if it is visible... \n if (this.visible){\n\n ctxDATA.fillStyle = this.color; \n ctxDATA.fillRect(this.x, this.y, this.w, this.h);\n \n // end of visibility check \n }\n\n // end of the draw method for the Dirt \n }", "function renderEntities() { \n allEnemies.forEach(function(enemy) {\n enemy.render();\n }); \n\n player.render();\n }", "drawExistingEntities() {\n this.drawExistingBullets();\n this.drawExistingEnemies();\n this.hero.draw(this.ctx);\n }", "function draw() {\n\t//clear the board\n\tctx.clearRect(0, 0, canvas[0].width, canvas[0].height);\n\n\t//draw the player\n\tplayer.draw(ctx);\n\n\t//draw the turrets\n\t$.each(turrets, function(i,turr) {\n\t\tturr.draw(ctx);\n\t});\n\n\t//draw the projectiles\n\t$.each(projectiles, function(i,proj) {\n\t\tproj.draw(ctx);\n\t});\n\n\t//draw the effects\n\t//make sure damaging effects are on top\n\tvar damagingEffects = [];\n\t$.each(effects, function(i,eff) {\n\t\tif (eff.getDoesDamage()) {\n\t\t\tdamagingEffects.push(eff);\n\t\t} else {\n\t\t\teff.draw(ctx);\n\t\t}\n\t});\n\n\t$.each(damagingEffects, function(i,eff) {\n\t\teff.draw(ctx);\n\t});\n}", "render(cam){\n //get the position that the camera sees\n let x = this.x - cam.x + canvas.width/2;\n let y = this.y - cam.y + canvas.height/2;\n\n //draw the enemy\n if (!this.walking){\n c.drawImage(this.images[this.dir-1][2],x-this.width,y-this.height,this.width*2,this.height*2);\n }\n else{\n c.drawImage(this.images[this.dir-1][this.animation],x-this.width,y-this.height,this.width*2,this.height*2);\n if (time > this.animation_cooldown){\n this.animation_cooldown = time+200;\n if (this.animation == 1){\n this.animation = 0;\n }\n else{\n this.animation = 1;\n }\n }\n }\n\n //if recently damaged\n if (this.show_health){\n //display health\n progress_bar(this.health,this.max_health, x-this.width/2, y-(this.height/2+10), this.width, this.height/10, '#BB0000', '#000000')\n }\n }", "function enemys()\r\n {\r\n // potential enemy\r\n fill(300, 150, 100);\r\n // draw the shape\r\n fill(\"red\");\r\n rect(210, shapeY, 50, 25); //bottom half of ghost\r\n ellipse(235, shapeY, 50, 50); //top half of ghost\r\n fill(\"white\"); //eye whites\r\n ellipse(225, shapeY, 15, 15);\r\n ellipse(245, shapeY, 15, 15);\r\n fill(\"blue\");//blue part of eyes\r\n ellipse(245, shapeY, 10, 10);\r\n ellipse(225, shapeY, 10, 10);\r\n\r\n\r\n // Enemy 2\r\n fill(\"purple\");\r\n rect(310, shapeY, 50, 25); //bottom half of ghost\r\n ellipse(335, shapeY, 50, 50); //top half of ghost\r\n fill(\"white\"); //eye whites\r\n ellipse(325, shapeY, 15, 15);\r\n ellipse(345, shapeY, 15, 15);\r\n fill(\"blue\");//blue part of eyes\r\n ellipse(345, shapeY, 10, 10);\r\n ellipse(325, shapeY, 10, 10);\r\n\r\n\r\n // Enemy 3\r\n fill(\"orange\");\r\n rect(110, shapeY, 50, 25); //bottom half of ghost\r\n ellipse(135, shapeY, 50, 50); //top half of ghost\r\n fill(\"white\"); //eye whites\r\n ellipse(125, shapeY, 15, 15);\r\n ellipse(145, shapeY, 15, 15);\r\n fill(\"blue\");//blue part of eyes\r\n ellipse(145, shapeY, 10, 10);\r\n ellipse(125, shapeY, 10, 10);\r\n\r\n // get a random speed when the it first starts\r\n shapeXSpeed = Math.floor(Math.random() * (Math.floor(Math.random() * 5)) + 1);\r\n shapeYSpeed = Math.floor(Math.random() * (Math.floor(Math.random() * 5)) + 1);\r\n\r\n // move the shape\r\n shapeX += shapeXSpeed;\r\n shapeY += shapeYSpeed;\r\n }", "function Enemy(x, y, r ,g, b, s, range)\n{\n this.x = x;\n this.y = y;\n this.r = r;\n this.g = g;\n this.b = b;\n this.s = s;\n this.range = range;\n this.currentX = x;\n this.inc = 1;\n \n this.update = function()\n {\n this.currentX += this.inc; \n if(this.currentX >= this.x + this.range)\n {\n this.inc = -1;\n }\n else if(this.currentX < this.x)\n {\n this.inc = 1;\n }\n };\n \n this.draw = function()\n {\n this.update();\n push();\n translate(this.currentX, this.y);\n \n scale(this.s); // Set the scale\n var c = color(this.r, this.g, this.b);\n stroke(c); // Set the body colour\n strokeWeight(70);\n line(0, -35, 0, -65); // Body\n noStroke();\n fill(255 - this.g); //face\n ellipse(-17.5, -65, 35, 35); // Left eye dome\n ellipse(17.5, -65, 35, 35); // Right eye dome\n arc(0, -65, 70, 70, 0, PI); // Chin\n fill(this.g);\n ellipse(-14, -65, 8, 8); // Left eye\n ellipse(14, -65, 8, 8); // Right eye\n quad(0, -58, 4, -51, 0, -44, -4, -51); // Beak\n pop();\n \n };\n this.checkContact = function(gc_x, gc_y)\n {\n var d = dist(gc_x, gc_y, this.currentX, this.y); \n if(d < 20)\n { \n if(lives != 0){\n lives -= 1;\n } \n player.isDead = true;\n deathSound.setVolume(0.1);\n deathSound.play();\n return true;\n } \n return false;\n }\n}", "function createEnemy(x, y) {\n var enemy = game.createGameItem('enemy',25);\n enemy.x = x;\n enemy.y = groundY-50;\n game.addGameItem(enemy);\n var enemyImage = draw.bitmap('img/bad guy clock.png');\n enemy.addChild(enemyImage);\n enemyImage.x = -25;\n enemyImage.y = -25;\n enemy.velocityX = -4;\n enemyImage.scaleX=.08;\n enemyImage.scaleY=.08;\n enemy.onPlayerCollision = function() {\n game.changeIntegrity(-30);\n enemy.shrink();\n console.log('Halle got smacked lol');\n };\n enemy.onProjectileCollision = function() {\n console.log('Halle did the smacking lol');\n game.increaseScore(50);\n enemy.fadeOut();\n };\n }", "function draw() {\n background(0);\n for (let i = 0; i < agents.length; i++) {\n agents[i].update();\n agents[i].display();\n }\n\n for (let i = 1; i < agents.length; i++) {\n\n if (agents[0].collide(agents[i])) {\n agents[0].eat(agents[i]);\n }\n}\n\n}", "draw(ctx){\n ctx.save();\n ctx.fillStyle = \"green\";\n ctx.fillRect(this.x-this.width/2,this.y-this.height/2,this.width,this.height);\n ctx.restore();\n }", "function draw_die(context){\n context.fillStyle = \"#003399\";\n context.beginPath();\n context.moveTo(ball_visual.centre_x, ball_visual.centre_y - 75);\n context.lineTo(ball_visual.centre_x + 70, ball_visual.centre_y + 50);\n context.lineTo(ball_visual.centre_x - 70, ball_visual.centre_y + 50);\n context.fill();\n}", "function drawPlayer () {\r\n rect(player.x, player.y, player.w, player.h, player.col, \"fill\");\r\n}", "function Enemy() {\n\tvar percentFire = 0.0001;\n\tvar chance = 0;\n\tthis.alive = false;\n\tthis.collidableWith = \"bullet\";\n\tthis.type = \"enemy\";\n\n\tthis.spawn= function(x,y,speed) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.speed = speed;\n\t\tthis.speedX = 0;\n\t\tthis.speedY = 2;\n\t\tthis.alive = true;\n\t\tthis.leftEdge = this.x -200;\n\t\tthis.rightEdge = this.x + 100;\n\t\tthis.bottomEdge = this.y + this.height*5 + 30;\n\t};\n\t/**\n\t\tMove the enemy\n\t*/\n\tthis.draw = function() {\n\t\tthis.ctx.clearRect(this.x-1,this.y,this.width+1,this.height);\n\t\tthis.x += this.speedX;\n\t\tthis.y += this.speedY;\n\t\tif (this.x <= this.leftEdge) {\n\t\t\tthis.speedX = this.speed;\n\t\t} else if (this.x >= this.rightEdge + this.canvasWidth) {\n\t\t\tthis.speedX = -this.speed;\n\t\t} else if (this.y >= this.bottomEdge) {\n\t\t\tthis.speedY = 0;\n\t\t\tthis.y -= 5;\n\t\t\tthis.speedX = -this.speed;\n\t\t}\n\n\t\tif (!this.isColliding) {\n\t\t\tthis.ctx.drawImage(imgRepo.enemy, this.x,this.y);\n\t\t\t//Enemy has a chance to shoot everytime it moves\n\t\t\tchance = Math.floor(Math.random()*101);\n\t\t\tif (chance/100 <= percentFire) {\n\t\t\t\tthis.fire();\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\tgame.playerScore += 10;\n\t\t\tgame.explosion.get();\n\t\t\treturn true;\n\t\t}\n\t};\n\n\t/**\n\t\tFire a bullet\n\t*/\n\tthis.fire = function() {\n\t\t//Grab a bullet and place it at the center of the ships \n\t\t//position and at the front. It's negative speed because we want to go down the screen.\n\t\tgame.enemyBulletPool.get(this.x+this.width/2,this.y+this.height, -2.5);\n\t}\n\t/**\n\t\tClear and reset the position of the enemy\n\t*/\n\tthis.clear = function() {\n\t\tthis.x = 0;\n\t\tthis.y =0;\n\t\tthis.speed = 0;\n\t\tthis.speedX = 0;\n\t\tthis.speedY = 0;\n\t\tthis.alive = false;\n\t\tthis.isColliding = false;\n\t}\n}", "update(dt){\n //set the point when the enemy is outside the screen\n if (this.x > 5) {\n this.offscreen = true;\n }\n\n\t\tvar random = Math.floor(Math.random() * 5);\n\n\t\t//replace the enemy\n\t\tif (this.offscreen) {\n\t\t\tthis.x = -random;\n this.offscreen = false;\n\t\t} else {\n\t\t\tthis.x += dt;\n\t\t}\n }", "function createEnemy(x,y){\n var enemy = game.createGameItem('enemy',25);\n var redSquare = draw.bitmap('img/dogenemy.png');\n redSquare.x = -25;\n redSquare.y = -25;\n redSquare.scaleX = 0.2;\n redSquare.scaleY = 0.2;\n enemy.addChild(redSquare);\n \n enemy.x = x;\n enemy.y = y;\n \n game.addGameItem(enemy);\n enemy.velocityX = -3;\n enemy.onPlayerCollision = function() {\n console.log('The enemy has hit Halle');\n game.changeIntegrity(-10);\n game.increaseScore(100);\n enemy.fadeOut();\n };\n enemy.onProjectileCollision = function() {\n console.log('Halle has hit the enemy');\n enemy.fadeOut();\n };\n}", "render() {\n\t\tif(this.getHealth() <= 0)\n\t\t\treturn;\n\n\t\tlet tank = this.getMapping();\n\t\tthis.term.bold();\n\t\tthis.term.red();\n\n\t\tif (!this.enemy) {\n\t\t\tthis.term.green();\n\t\t}\n\n\t\t// terminal coordinates are [1,1 - width,height]\n\t\tfor (let i = 0; i < tank.length; i++) {\n\t\t\tfor (let j = 0; j < tank[i].length; j++) {\n\t\t\t\tthis.term.moveTo(this.x + j + 1, this.y + i + 1, tank[i][j]);\n\t\t\t}\n\t\t}\n\n\t\tthis.term.styleReset();\n\t}", "draw(context){\n if(this.depth < this.maxDepth){\n context.drawImage(this.buffer, 0, Math.ceil(this.depth));\n if(this.creature){\n this.drawSprite(context);\n //context.strokeStyle = this.creature.type === \"plant\" ? '#008000':'#f00'; // some color/style\n //context.lineWidth = 2; // thickness\n //context.strokeRect(x, y, 32, 32);\n }\n }\n //context.fillText(this.name, this.center.x - 20, this.center.y + 10);\n }", "draw()\n {\n Renderer.drawImage(this.tex.texture, this.tex.width, this.tex.height, 0, 0, this.tex.width, this.tex.height, this.x, this.y, this.width, this.height);\n }", "renderPlayer() {\r\n this.ctx.beginPath();\r\n this.ctx.arc(this.posX, this.posY, 40, 0, 2 * Math.PI);\r\n this.ctx.stroke();\r\n }", "function draw() {\n // A pink background\n image(bgimg2, 400, 250)\n\n // Default the avatar's velocity to 0 in case no key is pressed this frame\n avatarVX = 0;\n avatarVY = 0;\n\n // Check which keys are down and set the avatar's velocity based on its\n // speed appropriately\n\n // Left and right\n if (keyIsDown(LEFT_ARROW)) {\n avatarVX = -avatarSpeed;\n }\n else if (keyIsDown(RIGHT_ARROW)) {\n avatarVX = avatarSpeed;\n }\n\n // Up and down (separate if-statements so you can move vertically and\n // horizontally at the same time)\n if (keyIsDown(UP_ARROW)) {\n avatarVY = -avatarSpeed;\n }\n else if (keyIsDown(DOWN_ARROW)) {\n avatarVY = avatarSpeed;\n }\n\n // Move the avatar according to its calculated velocity\n avatarX = avatarX + avatarVX;\n avatarY = avatarY + avatarVY;\n\n // The enemy always moves at enemySpeed\n enemyVX = enemySpeed;\n // Update the enemy's position based on its velocity\n enemyX = enemyX + enemyVX;\n\n // Check if the enemy and avatar overlap - if they do the player loses\n // We do this by checking if the distance between the centre of the enemy\n // and the centre of the avatar is less that their combined radii\n if (dist(enemyX,enemyY,avatarX,avatarY) < enemySize/2 + avatarSize/2) {\n // Reset the enemy's position\n enemyX = 0;\n enemyY = random(0,height);\n // Reset the avatar's position\n avatarX = width/2;\n avatarY = height/2;\n // Reset the dodge counter\n dodges = 0;\n }\n\n // Check if the avatar has gone off the screen (cheating!)\n if (avatarX < 0 || avatarX > width || avatarY < 0 || avatarY > height) {\n // If they went off the screen they lose in the same way as above.\n console.log(\"YOU LOSE!\");\n enemyX = 0;\n enemyY = random(0,height);\n avatarX = width/2;\n avatarY = height/2;\n dodges = 0;\n }\n\n // Check if the enemy has moved all the way across the screen\n if (enemyX > width) {\n // This means the player dodged so update its dodge statistic\n dodges = dodges + 1;\n // Tell them how many dodges they have made\n console.log(dodges + \" DODGES!\");\n // Reset the enemy's position to the left at a random height\n enemyX = 0;\n\n //changed the spawn location of a successful dodge to make it so the enemy will spawn at the avatar's current Y position.... It will ALWAYS go after you!\n enemyY = avatarY;\n\n //Enemy size will increase according to how many successful dodges there are\n enemySize = 70+dodges*10;\n\n //enemy speed will multiply according to how many successful dodges there are\n enemySpeed = 5+dodges;\n }\n\n//background will change if dodge score reachs 5..... or more (if you avoid more than 10, you're going to hell)\n\n if(dodges>=5){\n image(bgimg3, 400,250);\n }\n\n if(dodges>=10){\n image(bgimg, 400, 250);\n }\n\n//will display total number of dodges when the enemy's speed = 0, aka when it resets (amount of responsibilities avoided)\n if(enemySpeed===0){\n\n }\n else{dodgesScore=\"# of responsibilities you have avoided: \" + dodges;}\n textSize(15+dodges);\n fill(255); //white font\n text(dodgesScore,20,50);\n\n // Display the number of successful dodges in the console\n console.log(dodges);\n\n // The player is a student\n image(student,avatarX,avatarY,avatarSize,avatarSize);\n\n // The enemy is are books.... responsibilities\n image(books,enemyX,enemyY,enemySize,enemySize);\n\n}", "draw() {\n rect(this.x1, this.y1, this.Width, this.Height);\n }", "draw() {\n rect(this.x1, this.y1, this.Width, this.Height);\n }", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // Only draw scorecard on certain screens\n if( adventureManager.getStateName() === \"Splash\" ||\n adventureManager.getStateName() === \"Instructions\" ||\n adventureManager.getStateName() === \"Characters\" ||\n adventureManager.getStateName() === \"Four\" ||\n adventureManager.getStateName() === \"Five\" ||\n adventureManager.getStateName() === \"Eight\" ||\n adventureManager.getStateName() === \"Eleven\") {\n ;\n }\n else {\n stressCard.draw();\n }\n\n // draw the p5.clickables in front\n clickablesManager.draw();\n}", "function Enemy(x,y,range)\n{\n\n //Local variables for the enemy character. \n this.x = x;\n this.y = y;\n this.range = range;\n this.current_x = x;\n this.incr = 1;\n\n //Constructor function that draws the enemy character.\n\n this.draw = function()\n {\n fill(0);\n ellipse(this.current_x, this.y -25, 50);\n fill(255,0,0);\n ellipse(this.current_x -8,this.y -25, 10);\n ellipse(this.current_x +8,this.y -25, 10);\n rect(this.current_x +5, this.y -50, 5);\n \n }\n\n //Updates position of the enemy character and makes it move on it's own.\n\n this.update = function()\n {\n this.current_x += this.incr;\n if(this.current_x < this.x)\n {\n this.incr = 1.5; \n }\n else if(this.current_x > this.x + this.range)\n {\n this.incr = -1.5;\n }\n\n }\n\n this.isContact = function(gc_x, gc_y)\n {\n //This function will return true if game character makes contact.\n\n var distance = dist(gc_x, gc_y, this.current_x, this.y);\n\n if(distance < 25)\n {\n return true;\n }\n\n return false;\n }\n}", "draw(){\n \n \n \n image(this.spriteSheet, this.charX, this.charY, this.frameWidth*1.5, this.frameHeight*1.5, this.currentFrameX, this.currentFrameY, this.frameWidth, this.frameHeight);\n }", "function enemy(x,y){\n this.width = 64;\n this.height = 64;\n id=\"enemy1\";\n type=\"motion\";\n layer=2;\n var tags=[\"damaging\",\"enemy\"];\n Entity.call(this,x,y,id,layer,type,tags);\n this.wentUp=false;\n this.yVel=0;\n this.hp=100;\n this.flashFrames=0;\n this.facing=\"left\";\n this.update = function(){\n this.wentUp=false;\n if(this.flashFrames>0){\n this.flashFrames=this.flashFrames-1;\n }\n distance=getDistance(this, game.currentLevelData.playerRef);\n if(this.hp<=0){\n playASound(\"soundEffects/slimeEnemyDeath.mp3\")\n this.remove();\n }\n if(distance<=500){\n this.yVel=this.yVel+1\n if(this.yVel>30){\n (this.yVel=30);\n }\n this.y=this.y+this.yVel;\n if(player.x-this.x <= 0){\n this.x=this.x-3;\n this.facing=\"left\";\n }\n else{\n this.x=this.x+3;\n this.facing=\"right\";\n }\n }\n }\n this.draw = function(){\n if(this.flashFrames%2==0){\n if(this.facing==\"left\"){\n var img = ImageAtlas[this.id];\n ctx.drawImage(\n img, // image\n 600+(this.x-player.x), // target x\n 330+(this.y-player.y), // target y\n 64, // target width\n 64 // target height\n );\n }\n else{\n var img = ImageAtlas[enemy1RKey];\n ctx.drawImage(\n img, // image\n 600+(this.x-player.x), // target x\n 330+(this.y-player.y), // target y\n 64, // target width\n 64 // target height\n );\n } \n }\n }\n this.collision = function(entityC){\n entitySide=checkSide(this,entityC);\n if(entityC.tags.includes(\"block\")){\n sideColided=checkSide(this , entityC)\n if(sideColided==\"bottom\"){\n this.y=entityC.y-64;\n this.yVel=0;\n }\n if(sideColided==\"top\"){\n this.y=entityC.y+64;\n }\n if(sideColided==\"left\"){\n if(this.wentUp==false && game.currentLevelData.playerRef.y<=this.y+5){\n this.y=this.y-15;\n this.wentUp=true;\n }\n this.x=entityC.x+64;\n }\n if(sideColided==\"right\"){\n if(this.wentUp==false && game.currentLevelData.playerRef.y<=this.y+5){\n this.y=this.y-15;\n this.wentUp=true;\n }\n this.x=entityC.x-64;\n }\n }\n if(entityC.tags.includes(\"ladder\")){\n if(game.currentLevelData.playerRef.y<=this.y){\n if(this.wentUp==false){\n this.y=this.y-15;\n this.wentUp=true;\n }\n }\n if(game.currentLevelData.playerRef.y>=this.y){\n this.y=this.y+5;\n }\n this.y=this.y+1;\n }\n if(entityC.id.includes(\"water\")){\n if(game.currentLevelData.playerRef.y<=this.y){\n if(this.wentUp==false){\n this.y=this.y-15;\n this.wentUp=true;\n }\n }\n }\n }\n}", "function render() {\n enemyLaunchTimer = game.time.events.add(game.rnd.integerInRange(min_enemy_spacing, max_enemy_spacing), enemyLaunchTimer);\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 // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // draw the p5.clickables, in front of the mazes but behind the sprites \n clickablesManager.draw();\n\n // No avatar for Splash screen or Instructions screen\n if( adventureManager.getStateName() !== \"Splash\" && \n adventureManager.getStateName() !== \"Instructions\" ) {\n \n // responds to keydowns\n moveSprite();\n\n // this is a function of p5.js, not of this sketch\n drawSprite(playerSprite);\n } \n}", "function Invasion(){\n \n\t\tfor(var i = AlienToShoot() ; i < Enemyx.length; i++){\n \n\t\t\tif(AlienToShoot() <= 40 ){\n\t\t\t\tEnemyShoot[i] == true\n\t\t\t\n\t\t\t}\n\n\t\t\tif(EnemyShoot[i] == true){\n\n \n\t\t\t\t\tctx.fillStyle = 'red';\n\t\t\t\t\tctx.fillRect(EnemyLx[i] + 13, EnemyLy[i] + 13 , 5, 10);\n\t\t\t\t\tEnemyLy[i] += 15;\n\t\t\t\t}\n\t\t\t\tif(EnemyLy[i] >= 460){\n\t\t\t\t\tEnemyShoot[i] = false;\n\t\t\t\t}\n\t\t\t\tif(EnemyLy[i] >= 460 && EnemyShoot[i] == false){\n\t\t\t\t\t\tEnemyLy[i] = 300000;\n\t\t\t\t\t\tEnemyLy[i] -= 0;\n\t\t\t\t}\n \n\t\t}\n\t}", "function draw(){\n background(0);\n moveBullet();\n drawGame();\n ellipse(x, y, 50, 50);\n if (keyIsDown(LEFT_ARROW)) {\n if(x>25){\n x -=5;\n }\n \n }\n \n if (keyIsDown(RIGHT_ARROW)) {\n \n if(x+30 <600){\n x +=5;\n }\n\n }\n if (keyIsDown(UP_ARROW)){\n bullets.push([x, y]);\n }\n for(let i=0; i<14;i++){\n e[i].drawEnemy();\n e[i].moveEnemy(); \n }\n}", "function draw() {\n background(100, 100, 200);\n drawBorder();\n\n if (!gameOver) {\n handleInput();\n\n movePlayer();\n moveEnemies();\n movePrey();\n\n updateHealth();\n checkCollisions();\n\n drawPrey();\n drawEnemies();\n drawPlayer();\n } else {\n showGameOver();\n }\n}", "function draw() {\r\n requestAnimationFrame(draw);\r\n if (numberOfMissiles < 50) {\r\n missileGeneration();\r\n }\r\n moveMissile();\r\n TWEEN.update();\r\n renderer.render(scene,camera);\r\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 }", "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}", "draw()\n {\n this.ctx.clearRect(0, 0, this.surfaceWidth, this.surfaceHeight);\n this.ctx.save();\n for (let i = 0; i < this.entities.length; i++)\n {\n this.entities[i].draw(this.ctx);\n }\n this.ctx.restore();\n }", "function draw_character(character,pose){\r\n var iindex = character[_ID_IMAGE];\r\n var ipose = 0;\r\n if (character[_ID_SIDE]=='hero'){\r\n switch (pose){\r\n case (ACT_WALK) :\r\n ipose = _ID_L_WALK;\r\n break;\r\n case (ACT_ATTACK) :\r\n ipose = _ID_L_ATTACK;\r\n break;\r\n case (ACT_STAND) :\r\n ipose = _ID_L_STAND;\r\n break;\r\n case (ACT_CAST) :\r\n ipose = _ID_L_CAST;\r\n break;\r\n }\r\n //OBJ_CHARACTER[iindex][ipose];\r\n $('hero_image').innerHTML='<img src=\"public/image/'+OBJ_CHARACTER[iindex][ipose][0]+\r\n '\" style=\"top:'+(CFG_SCREEN_HEIGHT-(OBJ_CHARACTER[iindex][ipose][2]*CFG_SCALE)-CFG_SCREEN_OFFSET_BOTTOM)+\r\n ';left:'+(CFG_SCREEN_OFFSET_LEFT)+\r\n ';width:'+(OBJ_CHARACTER[iindex][ipose][1]*CFG_SCALE)+'px;'+\r\n 'height:'+(OBJ_CHARACTER[iindex][ipose][2]*CFG_SCALE)+'px;\" />';\r\n }else{\r\n switch (pose){\r\n case (ACT_WALK) :\r\n ipose = _ID_R_WALK;\r\n break;\r\n case (ACT_ATTACK) :\r\n ipose = _ID_R_ATTACK;\r\n break;\r\n case (ACT_STAND) :\r\n ipose = _ID_R_STAND;\r\n break;\r\n case (ACT_CAST) :\r\n ipose = _ID_R_CAST;\r\n break;\r\n }\r\n $('enemy_image').innerHTML='<img src=\"public/image/'+OBJ_CHARACTER[iindex][ipose][0]+\r\n '\" style=\"top:'+(CFG_SCREEN_HEIGHT-(OBJ_CHARACTER[iindex][ipose][2]*CFG_SCALE)-CFG_SCREEN_OFFSET_BOTTOM)+\r\n ';left:'+(CFG_SCREEN_WIDTH-(OBJ_CHARACTER[iindex][ipose][1]*CFG_SCALE)-CFG_SCREEN_OFFSET_RIGHT)+\r\n ';width:'+(OBJ_CHARACTER[iindex][ipose][1]*CFG_SCALE)+'px;'+\r\n 'height:'+(OBJ_CHARACTER[iindex][ipose][2]*CFG_SCALE)+'px;\" />';\r\n }\r\n}", "function drawEverything(){\n myGameArea.clear();\n //draw moving background\n drawBackground();\n //add the new position of the bullet to the update step\n playerBullets.forEach(function(bullet){\n bullet.update();\n });\n playerBullets.forEach(function(bullet){\n bullet.draw();\n });\n //filter the list of bullet to only add the active bullets\n playerBullets = playerBullets.filter(function(bullet){\n return bullet.active;\n });\n //add the new enemy to the array of enemies\n enemies.forEach(function(enemy){\n enemy.update();\n });\n // filter the list of enemies\n enemies = enemies.filter(function(enemy){\n return enemy.active;\n })\n enemies.forEach(function(enemy){\n enemy.draw();\n });\n \n player.newPos();\n player.update();\n // myGameArea.score();\n \n \n }", "function draw() {\n //~~~ intro 1 ~~~//\n if (gameState === \"intro1\") {\n // play the ambient sound effect\n ambience.play();\n //display the screen\n introScreen1.display();\n\n //~~~ intro 2 ~~~//\n } else if (gameState === \"intro2\") {\n // play the ambient sound effect\n ambience.play();\n //play the siren sound effect\n siren.play();\n //display the screen\n introScreen2.display();\n\n //~~~ playing ~~~//\n } else if (gameState === \"playing\") {\n ambience.play();\n //display the background image\n background(backgroundImage);\n //display the destination planet\n planetAmazon.display();\n //display the enemies\n displayEnemies();\n //display the explosions\n displayExplosions();\n // Handle movment of the player\n player.move();\n // display the phazers, and check for collision with enemies\n handlePhazers();\n //detects if player has collided with enemy\n player.detectCollision();\n //displays the player's crosshairs, and the ship\n player.display();\n\n\n //~~~ game Over ~~~//\n } else if (gameState === \"gameOver\") {\n //play the gameover bells\n gameOverBells.play();\n //play the evil evilLaugh\n evilLaugh.play();\n //display the game over screen\n gameOverScreen.display();\n //remove any stray enemies\n for (let e = 0; e < enemies.length; e++) {\n enemies.splice(e, 1);\n }\n }\n\n //~~~ game won ~~~//\n else if (gameState === \"gameWon\") {\n gameWonScreen.display()\n //remove any stray enemies\n for (let e = 0; e < enemies.length; e++) {\n enemies.splice(e, 1);\n console.log(enemies.length);\n }\n }\n}", "function renderEntities() {\n allEnemies.forEach(function(enemy) {\n enemy.render();\n });\n player.render();\n }", "function draw() {\n context.fillStyle = '#212121';\n context.fillRect(0, 0, canvas.width, canvas.height);\n \n drawMatrix(arena, {x: 0, y:0});\n drawMatrix(player.matrix, player.pos); \n}", "constructor(enemy){\n this.height = 10;\n this.width = 10;\n this.dead = false;\n this.x = enemy.x + Math.floor(enemy.width/2) - Math.floor(this.width/2);\n this.y = enemy.y + enemy.abdomen - Math.floor(this.height/2);\n this.dx = Math.floor((bearer.x + Math.floor(bearer.width/2) - (this.x + Math.floor(this.width/2)))/100);\n this.dy = Math.floor((bearer.y + Math.floor(bearer.height/2) - (this.y + Math.floor(this.height/2)))/100);\n this.dmgPlayer = 5;\n }", "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() {\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 drawAlienShoot() {\n graphics.drawImage(bullet, bulletX, bulletY + 35, 50, 50);\n }", "postDraw(c) {\n\n if (this.progress.isIntro && this.progress.isNight) {\n\n for (let e of this.enemies) {\n\n if (e.postDraw != undefined) {\n\n e.postDraw(c);\n }\n }\n }\n }", "function draw(){\n\t\t// Needed to comply with Tool Delegate design pattern\n\t}", "function createEnemy(x, y)\n{\t\n\tvar enemy = enemies.create(x, y, 'enemy');\n\tenemy.animations.add('left', [0, 1, 2, 3, 4, 5], 10, true);\n\tenemy.animations.add('right', [6, 7, 8, 9, 10, 11], 10, true);\n\tenemy.animations.add('stunLeft', [12, 13, 12, 13, 12, 13], 10, true);\n\tenemy.animations.add('stunRight', [14, 15, 14, 15, 14, 15], 10, true);\n\tgame.physics.arcade.enable(enemy);\n\n\t//enemy can't go off world bounds\n\tenemy.body.collideWorldBounds = true;\n\n\tenemy.body.gravity.y = 350;\n\tenemy.direction = game.rnd.integerInRange(0,1) * 2 - 1;\n\t\n\tif(enemy.direction > 0){\n\t\tenemy.animations.play('right');\n\t}\n\telse{\n\t\tenemy.animations.play('left');\n\t}\n\n\tenemy.isStunned = false;\n\tenemy.stunnedTime = 5000;\n\tenemy.spawnTime = 7500;\n\n\t//set animations\n\t\n}", "function drawPlayer(player){\n ctx.fillStyle = 'red';\n if (player.id != selfID){\n ctx.fillRect(\n (player.x - (player.width/2)) + objOffsetX,\n (player.y - (player.height/2)) + objOffsetY,\n player.width,\n player.height\n );\n ctx.fillText(player.id, player.x+player.width + objOffsetX, player.y + objOffsetY);\n } else {\n ctx.fillRect(\n cameraPositionX - (player.width/2),\n cameraPositionY - (player.height/2),\n player.width,\n player.height\n );\n ctx.fillText(player.id, cameraPositionX+player.width, cameraPositionY);\n }\n\n //ctx.fillText(player.id, player.x+player.width, player.y);\n}", "function draw()\n{\n context.clearRect(0, 0, canvas.width, canvas.height);\n context.drawImage(playerStickman,240,100);\n context.drawImage(enemyStickman,1280,100);\n context.drawImage(playerFace,240,100);\n \n context.drawImage(enemyFace,1280,100);\n \n //context.drawImage(enemyHead,1280,100);\n \n \n //fire element\n //context.beginPath();\n //context.arc(200, 785, 40, 0, 2 * Math.PI);\n //context.lineWidth = 5;\n //context.stroke();\n //context.closePath();\n //air element\n //context.beginPath();\n //context.arc(320, 785, 40, 0, 2 * Math.PI);\n //context.stroke();\n //context.closePath();\n //water element\n //context.beginPath();\n //context.arc(440, 785, 40, 0, 2 * Math.PI);\n //context.stroke();\n //context.closePath();\n \n //earth element\n //context.beginPath();\n //context.arc(560, 785, 40, 0, 2 * Math.PI);\n //context.stroke();\n //context.closePath();\n //player head\n //context.beginPath();\n //context.arc(372, 250, 40, 0, 2 * Math.PI);\n //context.stroke();\n //context.closePath();\n //timer\n context.beginPath();\n context.arc(950, 120, 60, 0, 2 * Math.PI);\n context.stroke();\n context.closePath();\n //enemy head\n //context.beginPath();\n //context.arc(1500, 250, 40, 0, 2 * Math.PI);\n //context.stroke();\n //context.closePath();\n //middle line\n context.beginPath();\n context.moveTo(950, 250);\n context.lineTo(950,900);\n context.stroke();\n //context.lineWidth = 10;\n context.closePath();\n //enemyElement;\n //window.onload = enemyElement;\n context.font=\"16pt Arial\";\n context.strokeText(timer, 50,101);\n\n}", "function draw() {\r\n if(backgroundImg)\r\n background(backgroundImg);\r\n //background(40);\r\n console.log(monster1.y);\r\n Engine.update(engine);\r\n arrow.display();\r\n slingshot.display();\r\n slingshot1.display();\r\n speed(monster1,ground1);\r\n speed(monster2,ground2);\r\n speed(monster3,ground3);\r\n speed(monster4,ground4);\r\n speed(monster5,ground5);\r\n speed(monster6,ground6);\r\n\r\n\r\n //TEXT INSTRUCTIONS\r\n textSize(24);\r\n fill(\"red\");\r\n text(\"Arrows Used: \"+arrowScore,30,50);\r\n text(\"/6\",195,50); \r\n text(\"Monsters Hit: \"+monsterScore,30,90);\r\n if(arrowScore===6&&monsterScore<6){\r\n textSize(36);\r\n text(\"All Arrows Used!\",500,400);\r\n text(\"Refresh to Play Again!\",450,450);\r\n }\r\n if(arrowScore<=6&&monsterScore===6){\r\n textSize(64);\r\n text(\"YOU WIN!\",500,400);\r\n }\r\n //TEXT INSTRUCTIONS END\r\n drawSprites(); \r\n}", "draw(g, x, y, friendo) {\n this.anim.draw(g, x, y, friendo)\n }" ]
[ "0.7651879", "0.7623985", "0.7455392", "0.73705465", "0.73646516", "0.7218339", "0.7204746", "0.70851266", "0.7044181", "0.7024406", "0.70161104", "0.70125526", "0.6978179", "0.69721955", "0.69200844", "0.6911573", "0.68684286", "0.6850782", "0.679081", "0.6760563", "0.67593104", "0.6752871", "0.67484695", "0.66895324", "0.6689007", "0.6688919", "0.6656762", "0.6647681", "0.6630527", "0.66207826", "0.66203874", "0.6601863", "0.6601863", "0.65804535", "0.65789735", "0.6577868", "0.6575952", "0.6551359", "0.65470815", "0.65444124", "0.6543209", "0.6543052", "0.654197", "0.6530714", "0.6527312", "0.65270084", "0.65226203", "0.65185803", "0.6517085", "0.6516633", "0.6515014", "0.6512805", "0.6512663", "0.649977", "0.6494234", "0.648995", "0.64894736", "0.6479536", "0.64772993", "0.6476215", "0.6471427", "0.64713866", "0.64681965", "0.64638263", "0.6461618", "0.6459233", "0.6458307", "0.6455519", "0.64528304", "0.64526534", "0.64526534", "0.64522547", "0.6451543", "0.64476806", "0.6446388", "0.6443873", "0.64419526", "0.64388686", "0.6428711", "0.64271927", "0.64146495", "0.6409215", "0.6407565", "0.6403928", "0.6403404", "0.6402549", "0.6391296", "0.6380329", "0.63783824", "0.63776475", "0.63656205", "0.63642603", "0.6363416", "0.6361555", "0.6360871", "0.63595814", "0.6359431", "0.6352742", "0.6350131", "0.63460135", "0.63451535" ]
0.0
-1
Update the enemy's position
update(dt) { // multiply any movement by the dt parameter // which will ensure the game runs at the same speed for // all computers. this.x += this.speed * 75 * dt; //return Enemy to start when leaves screen if (this.x >= 500) { this.x = xStartPosEnemy; this.y = yPositions[Math.floor(Math.random() * 4)]; this.speed = speeds[Math.floor(Math.random() * 5)]; } else { this.x = this.x; } //check collision of Enemy by avaluating x y positions if (this.x < player.x + 55 && this.x > player.x - 55 && this.y < player.y + 45 && this.y > player.y - 45) { window.setTimeout(player.loseLife(), 50); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "move() {\r\n this.y = this.y + Enemy.v;\r\n }", "updatePos() {\n if (this.x != this.player.x || this.y != this.player.y) {\n this.x = this.player.x;\n this.y = this.player.y;\n }\n }", "update(dt) {\n this.x += (level * enemySpeed) * dt;\n\n // When the enemy moves off the screen, the X position will be reset\n if (this.x > CANVAS_WIDTH) {\n this.x = randomX();\n }\n\n }", "update(dt) {\n // You should multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n // handles enemy movement- use dt(time delta) to normalize gamse speed\n\n // check enemies position status\n // within the grid -> move forward by x = v(dt)\n // stopping position of the enemy -> off screen\n if (this.x < this.endPoint) {\n this.x += this.speed * dt\n } else {\n //reset to start startPosition when enemy is offscreen\n this.x = this.startPosition;\n }\n }", "update(dt) {\n this.x += (level * fasterEnemySpeed) * dt;\n\n // When the enemy moves off the screen, the X and Y positions will be reset\n if (this.x > CANVAS_WIDTH) {\n this.x = randomX();\n this.y = randomY();\n }\n\n }", "update(dt){\n //set the point when the enemy is outside the screen\n if (this.x > 5) {\n this.offscreen = true;\n }\n\n\t\tvar random = Math.floor(Math.random() * 5);\n\n\t\t//replace the enemy\n\t\tif (this.offscreen) {\n\t\t\tthis.x = -random;\n this.offscreen = false;\n\t\t} else {\n\t\t\tthis.x += dt;\n\t\t}\n }", "update(dt) {\n // Any movement is multiplied by the dt parameter to ensure the game runs at\n // the same speed for all computers\n this.x += this.speedCoefficient * 75 * dt; // Move the enemy to the right\n // Check if the enemy has reached the end of the canvas\n if (this.x > ctx.canvas.width) {\n // Reposition the enemy at the start of the canvas\n this.x = -101;\n // Generate a new random speed for the enemy\n this.speedCoefficient = Math.ceil(Math.random() * 3);\n }\n }", "update(dt) {\n\t\t//Set enemy speed\n \tthis.x += this.s*dt;\n\n \tthis.checkOutside();\n\t}", "update(dt) {\n // multiplying the movements by the dt parameter will\n // ensure the game runs at the same speed for all computers.\n\n this.x += this.enemySpeed * dt ;\n if (this.x > 510 ){\n this.x = -102;\n this.y = posArray[Math.floor(Math.random() * posArray.length)];\n this.enemySpeed = enemySpeed[Math.floor(Math.random() * enemySpeed.length)];\n this.x += this.enemySpeed * dt ; \n }\n }", "updateOtherEnemiesWithCurrentInfo(){\n\t\tfor(var i = 0; i < this.enemies.length; i++){\t\n\t\t\tthis.enemies[i].position.x += this.enemies[i].velX;\n\t\t\tthis.enemies[i].position.y += this.enemies[i].velY;\n\t\t}\n\t}", "update(dt) {\n //Sets the speed of the enemy\n this.x = this.x + this.speed * dt;\n\n //Sets the column based on the location of the enemy\n if(this.x < 62) {\n this.col = 1;\n } else if(this.x < 163) {\n this.col = 2;\n } else if(this.x < 264) {\n this.col = 3;\n } else if(this.x < 365) {\n this.col = 4;\n } else if(this.x < 465) {\n this.col = 5;\n } else if(this.x < 510) {\n this.col = 7;\n }\n\n //Changes the column based on the location of the enemy\n switch(this.y) {\n case 48:\n this.row = 2;\n break;\n case 131:\n this.row = 3;\n break;\n case 214:\n this.row = 4;\n }\n\n //Monitors collisions by comparing the player's and the enemy's columns and rows\n for(const enemy of allEnemies) {\n if (this.col === player.col && this.row === player.row) {\n player.reset();\n allEnemies = [];\n }\n }\n }", "update(dt) {\n // You should multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n this.x += this.speed * dt;\n\n if (this.x > 555) {\n this.x = -60; //when ememy is visually off the canvas, enemy then resets initially at -60 position so it can smoothly appear starting from it's head\n this.speed = 100 + Math.floor(Math.random() * 330); //the added 100 ensures that the enemy will travel at minimum 100 and at maximum of 430 (100+330)\n }\n\n if (player.x < this.x + 50 && //player resets when oncomming(front) enemy interseccts with the player's full visual width (about 50)\n player.x + 50 > this.x && //player resets when player visual width(about 50) is too close to the enemy from the back\n player.y < this.y + 50 && //player resets when the height of player(upwards) exceed's enemy's position\n 50 + player.y > this.y) { //player resets when the height of player(downwards) exceed's enemy's position\n player.x = 200; //reset position when player dies\n player.y = 380;\n\n $('.num').empty(); //empty the .num span, getting ready to replace with updated score\n score -= 2; //score decrements by 2 and minuses score's total value when player gets in range of enemy\n $('.num').append(score); //updated score then gets appended to .num span\n }\n }", "update(dt) {\n if (this.x < 505) {//it checks that enemies should not move outside\n this.x += this.speed * dt; // speed muliply by delta time\n }\n else {//this resets enemy's location to -101(initial)\n this.x = -101;\n }\n }", "update() {\n if (this.x > 406) {\n this.x = 406;\n } else if (this.x < 0) {\n this.x = 0;\n } else if (this.y > 400) {\n this.y = 400;\n // increasing the speed of eniemies by each next level\n } else if (this.y < 0) {\n player.x = 200\n player.y = 400\n\n enemy1.speed = random(100, this.counter * 100);\n enemy2.speed = random(130, this.counter * 150);\n enemy3.speed = random(150, this.counter * 200);\n // swet alert when player complete the level\n swal(\n \"Good job!\",\n \"You Win!!! Play next level\",\n \"success\",\n );\n level.textContent = `LEVEL ${++this.counter}`;\n highestLevel.textContent = `Highest Level${this.counter}`;\n }\n\n }", "update(dt) {\n // You should multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n this.x += this.speed * dt;\n if (this.x > 550) {\n // moves enemy back to left side of screen when they reach the right\n this.x = -120;\n // random # sets/changes row enemy is in each time they reach the right side of the screen\n let random = Math.floor((Math.random() * 4) + 1);\n if (random < 2) {\n this.y = 60;\n }\n else if (random >= 2 && random < 3) {\n this.y = 143;\n }\n else {\n this.y = 226;\n }\n }\n }", "update(dt){\n // If enemy hits player, decrease score by 5, update score on screen, and reset player to starting locations\n if (Math.abs(player.x - this.x) < 50 && Math.abs(player.y - this.y) < 50) {\n if (player.currentScore > 0) {\n player.currentScore -= 5;\n }\n player.updateScoreboard();\n player.reset();\n }\n \n // Moves the enemy across the screen\n this.x += this.speed * dt;\n \n // When enemy is off screen, loop him back to beginning of board.\n if (this.x > 505) {\n this.x = Math.ceil((Math.random() * -300) - 100);\n }\n }", "update(dt) {\n // Multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n this.x += this.speed * dt;\n // Check if the enemy is off screen\n if (this.x >= 600) {\n // If so, move it to start\n this.x = -200;\n }\n }", "update (dt){\n\n // You should multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n this.x = this.x + this.speed * dt;\n if (this.x >= this.ENEMY_END_X) {\n this.x = this.ENEMY_START_X;\n this.speed = this.ENEMY_SPEED;\n }\n this.checkCollision();\n }", "update () {\n this.position = [this.x, this.y];\n }", "update(dt){\n this.x = this.x + this.speed * dt;\n // starting the enemy again randomly\n if (this.x > 700 ){\n this.x = -10\n }\n\n // Collison with enemy when two objects hit each others\n if (Math.abs(this.x - player.x) < 75 && Math.abs(this.y - player.y) < 77) {\n player.x = 202;\n player.y = 405;\n player.lives -= 1;\n }\n }", "function update() {\n playerMove();\n cooldowns.call(this);\n moveEnemies();\n // this.cameras.main.centerOn(player.x, player.y);\n}", "update(dt) {\n // You should multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n\n this.x += this.speed * dt;\n\n // DONE: enemy comes back on the stage after leaving it with different paramters\n if (this.x > globals.canvasWidth) {\n this.resetEnemy();\n }\n }", "update (dt) {\n this.x += this.speed * dt;\n this.position = [[this.x - 40, this.x + 40], [this.y - 15, this.y + 15]];\n\n /* when enemys move off canvas, this resets their position and speed ta random number */\n if (this.x > 550) {\n this.x = -100;\n this.speed = 150 + (gameVar.speedOfGame * (Math.floor(Math.random() * 300)));\n this.y = [65, 145, 225][Math.floor(Math.random() * 3)]\n }\n }", "update(viewX, viewY) {\n this.sprite.position.set(this.x - viewX, this.y - viewY);\n }", "update(dt){\n // You should multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n if (this.x <=510) {\n this.x += this.movement * dt;\n }\n\n else if (this.x > 510){\n if (this.y === 50){\n enemy50 = new Enemy(-100,50,Math.floor(Math.random() * 400)+ 150);\n allEnemies.splice(0,1,enemy50);\n }\n else if (this.y === 140){\n enemy140 = new Enemy(-100,140,Math.floor(Math.random() * 400)+ 150);\n allEnemies.splice(1,1,enemy140);\n }\n else if (this.y === 220){\n enemy220 = new Enemy(-100,220,Math.floor(Math.random() * 400)+ 150);\n allEnemies.splice(2,1,enemy220);\n }\n }\n\n // Check if player collisions the enemies, if a collision happened the game will start again\n // If the enemies are in the same rectangle of player then collision happened\n if ((this.x>=player.x-50 && this.x<=player.x+50) && ( this.y===player.y || this.y===player.y+10)){\n start();\n }\n }", "update(dt){\n // You should multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n this.x += this.speed * dt;\n\n //Updates the Enemy location (you need to implement)\n if(this.x > gameCanvas.canvasWidth){\n this.x =-100;\n this.speed= (Math.floor(Math.random() * 200) + 50);\n }\n\n //Handles collision with the Player (you need to implement)\n if ((player.x + 80 > this.x) && (player.x < this.x + 80) &&\n (player.y + 60 > this.y) && (player.y < this.y + 60)\n ){\n player.x = Math.floor(Math.random() * 5)*100;\n player.y = 400;\n };\n }", "update() {\n // initialize next move\n let nextPosition = this.getNextPosition();\n // if next position is not blocked by an object\n if (this.isPositionFree(nextPosition)) {\n this.position.x = nextPosition.x;\n this.position.y = nextPosition.y;\n\n // if successful, send movement to server\n this.game.broadcastPosition({id: this.id, x: this.position.x, y: this.position.y, direction: this.direction});\n }\n\n }", "update (dt) {\n // You should multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n this.x += this.speed * dt;\n // relocate enemies at the start when they cross the board\n if (this.x >= 505) {\n this.x = -60;\n // set random speed for each enemy. It gets faster as the player earns points (lives) in the game.\n if (gameLevel == 1) {\n this.speed = Math.floor( (Math.random() * 250) + 150 );\n }\n if (gameLevel == 2) {\n this.speed = Math.floor( (Math.random() * 350) + 200 );\n }\n if (gameLevel == 3) {\n this.speed = Math.floor( (Math.random() * 350) + 250 );\n }\n if (gameLevel == 4) {\n this.speed = Math.floor( (Math.random() * 450) + 300 );\n }\n }\n this.checkForCollision();\n }", "update() {\n super.update();\n this.move();\n }", "update(dt) {\n if (this.x > 606) {\n //if the enemy is leaving the screen reset enemy height and speed\n this.y = this.setY();\n this.speed = this.setSpeed();\n this.x = -115;\n } else {\n // progress enemy in positive x direction using universal time factor\n this.x += this.speed * dt;\n\n }\n\n // You should multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n }", "update(){\n // Prevent player from moving off canvas\n if(this.y > startY){\n this.y = startY;\n }\n if(this.x < 3){\n this.x = 3;\n }\n if(this.x > xPos[xPos.length - 1]){\n this.x = xPos[xPos.length - 1];\n }\n if(this.y < -50){\n this.y = -50;\n }\n\n // When the player reaches the top of the canvas, reset player positon\n if(this.y === -50 && this.x === goal.x){\n this.goalReached();\n }\n\n }", "function moveEnemy1() {\n posX = parseInt($(\"#enemy1\").css(\"left\"));\n $(\"#enemy1\").css(\"left\", posX - vel);\n $(\"#enemy1\").css(\"top\", posY);\n\n if (posX <= 0) {\n posY = parseInt(Math.random() * 334);\n $(\"#enemy1\").css(\"left\", 634);\n $(\"#enemy1\").css(\"top\", posY);\n }\n }", "update(dt){\n // Multiplying any movement by the dt parameter\n // will ensure the game runs at the same speed for all computers.\n\n this.x += this.speed * dt;\n // if x is gerater than the length of the canvas, reset pos to -100\n if(this.x > canvasWidth){\n this.x = -100;\n //generate a random number for the speed\n let randomSpeed = Math.floor(Math.random() * topEnemySpeed);\n this.speed = 100 + randomSpeed;\n }\n }", "update(dt) {\n // Enemy is not controlled by player so automated code is necessary\n // You should multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for all computers\n // dt is the function parameter\n // dt is declared in the engine.js file under main() function\n\n // This function will check if enemy is still within the playing board\n // If the enemy passes the playing board on the right side...\n // ...the enemy's x/y pos will reset so it can move across the board again(loop)\n\n if (this.x < this.boundary) {\n // If the condition is true, the enemy will continue to move forward\n // Increment x pos by (speed * dt)\n // Multiplying by dt will give the enemy bug a constant speed across theboard\n this.x += this.speed * dt;\n }\n else {\n // Reset enemy position to starting point\n // The above if statement will start to loop again once the enemy posresets..\n // ..because of the code below\n this.x = this.resetEnemy;\n }\n }", "update() {\n for(let enemy of allEnemies) {\n if ((this.y === enemy.y) && (enemy.x + 60 > this.x) && (this.x + 60 > enemy.x)) {\n this.reset();\n } else if (this.y === -20) {\n this.win();\n }\n }\n }", "_updatePositionWithVelocity() {\n this._x += this._dx;\n this._y += this._dy;\n }", "update() {\n this.moveNinja();\n }", "step(){\n\t\tvar min_distance_player = null;\n\t\tvar min_distance = Infinity;\n\t\tfor (let playerid in this.stage.players){\n\t\t\tlet distance = (this.stage.players[playerid].x - this.x)**2 + (this.stage.players[playerid].y - this.y)**2;\n\t\t\tif (distance < min_distance){\n\t\t\t\tmin_distance = distance;\n\t\t\t\tmin_distance_player = this.stage.players[playerid];\n\t\t\t}\n\t\t}\n\n\t\tif (min_distance_player === null){ // there is no player so the enemy moves randomly\n\t\t\tvar random_value = Math.random();\n\t\t\tif (random_value < 0.2){\n\t\t\t\tthis.velocity = new Pair(this.speed,0);\n\t\t\t} else if (random_value >= 0.2 && random_value< 0.4){\n\t\t\t\tthis.velocity = new Pair(-this.speed,0);\n\t\t\t} else if (random_value >= 0.4 && random_value < 0.6){\n\t\t\t\tthis.velocity = new Pair(0,0);\n\t\t\t} else if (random_value >= 0.6 && random_value < 0.8){\n\t\t\t\tthis.velocity = new Pair(0,this.speed);\n\t\t\t} else{\n\t\t\t\tthis.velocity = new Pair(0,-this.speed);\n\t\t\t} \n\t\n\t\t\tsuper.step(); // move the enemy and check if it overlaps with anything\n\t\t\treturn;\n\t\t}\n\n\t\tvar x_distance = this.x - min_distance_player.x;\n\t\tvar y_distance = this.y - min_distance_player.y;\n\n\t\t// check which direction the enemy should go since enemy should always move towards the player\n\t\tvar x_velocity = 0;\n\t\tvar y_velocity = 0;\n\t\t// assign the velocity so the enemy can move to the player\n\t\tif (y_distance > 0){ // enemy is below the player\n\t\t\ty_velocity = -this.speed;\n\t\t} else if (y_distance < 0){ // enemy is above the player\n\t\t\ty_velocity = this.speed;\n\t\t}\n\t\tif (x_distance > 0){ // enemy is to the right of the player\n\t\t\tx_velocity = -this.speed;\n\t\t} else if (x_distance < 0){ // enemy is to the left of the player\n\t\t\tx_velocity = this.speed;\n\t\t}\n\t\tthis.velocity = new Pair(x_velocity,y_velocity);\n\n\t\tsuper.step(); // move the enemy and check if it overlaps with anything\n\n\t\tif (this.cooldown_remaining <= 0){\n\t\t\t// the cooldown has finished so the enemy should fire towards player\n\t\t\tsuper.fire(min_distance_player.x, min_distance_player.y);\n\t\t\tthis.cooldown_remaining = this.cooldown; // reset the cooldown so the enemy can fire again later\n\t\t} else{\n\t\t\t// the cooldown hasn't finished yet\n\t\t\tthis.cooldown_remaining -= 1;\n\t\t}\n\t}", "newPos() {\n this.x += this.speedX;\n this.y += this.speedY + this.gravity;\n this.hitBottom();\n this.update();\n }", "newPos() {\n this.x += this.speedX;\n this.y += this.speedY + this.gravity;\n this.hitBottom();\n this.update();\n }", "update() {\r\n this.x += this.xspeed;\r\n this.y += this.yspeed;\r\n }", "updatePosition() {\n this.position = Utils.convertToEntityPosition(this.bmp);\n }", "move() {\n // Set velocity via noise()\n this.vx = map(noise(this.tx), 0, 1, -this.speed, this.speed);\n this.vy = map(noise(this.ty), 0, 1, -this.speed, this.speed);\n\n if (this.x + this.vx < 0 + this.size / 2 || this.x + this.vx > width - this.size / 2) {\n this.vx = -this.vx;\n }\n\n if (this.y + this.vy < 0 + this.size || this.y + this.vy > cockpitVerticalMask - this.size) {\n //this.speed = -this.speed;\n this.vy = -this.vy;\n }\n\n // Update position\n this.x += this.vx;\n this.y += this.vy;\n // Update time properties\n this.tx += 0.01;\n this.ty += 0.01;\n //increases enemy's size every frame,\n this.size += this.speed / 10;\n //constrain enemies on screen\n this.x = constrain(this.x, 0, width);\n this.y = constrain(this.y, 0, height * 75 / 100);\n }", "function updateEnemies() {\n\tfor (let i = 0; i < enemies.length; i++) {\n\t\tlet xDir;\n\t\tif (enemies[i].enemyDxDir === 1) {\n\t\t\txDir = 1;\n\t\t} else {\n\t\t\txDir = -1;\n\t\t}\n\t\tenemies[i].enemyX += enemies[i].enemyDx * xDir;\n\t\tenemies[i].enemyY += enemies[i].enemyDy;\n\t\tif (\n\t\t\tenemies[i].enemyX < 0 ||\n\t\t\tenemies[i].enemyX > canvas.width ||\n\t\t\tenemies[i].enemyY > canvas.height ||\n\t\t\tenemies[i].enemyAlive === false\n\t\t) {\n\t\t\tenemies.splice(i, 1);\n\t\t}\n\t}\n}", "function moveEnemy() {\n enemy.rotation -= 0.02;\n\n // move the enemy right\n if(enemy.position.x < player.position.x) {\n enemy.position.x = enemy.position.x + 1 * enemyProjectileSpeed;\n }\n // move the enemy left\n else if(enemy.position.x > player.position.x) {\n enemy.position.x = enemy.position.x - 1 * enemyProjectileSpeed;\n }\n // move the enemy down\n if(enemy.position.y < player.position.y) {\n enemy.position.y = enemy.position.y + 1 * enemyProjectileSpeed;\n }\n // move the enemy up\n else if(enemy.position.y > player.position.y) {\n enemy.position.y = enemy.position.y - 1 * enemyProjectileSpeed;\n }\n}", "update()\n\t{\n\t\tthis.x += this.xspeed;\n\t\tthis.y += this.yspeed;\n\t}", "update () {\n this.pos.x += this.vel.x;\n this.pos.y += this.vel.y;\n }", "update () {\n this.pos.x += this.vel.x;\n this.pos.y += this.vel.y;\n }", "update (dt) {\n // You should multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n const {x, y} = this.getCurrentPosition();\n let newX;\n if (x >= 500) {\n newX = -100;\n } else {\n newX = (x + dt * this.speed * 150) % (500)\n }\n\n this.setCurrentPosition(newX, y);\n }", "update() {\n if (this.y > 380) { //if player attempts to go over the 380 limit, player will remain at the 380 position\n this.y = 380;\n } else if (this.y < 0) { //if player a reaches to the top of the canvas (where the water is), player will be relocated to the default location\n this.x = 202;\n this.y = 380;\n\n score++; //score increments by 1 when player gets in range of the water\n $('.num').text(score); //updated score then gets appended to .num span\n }\n\n if (this.x > 400) { //if player attempts to go over 400 on the right or 0 on the left, player's position with remain at the 400 or 0 position\n this.x = 400;\n } else if (this.x < 0) {\n this.x = 0;\n }\n }", "update(dt) {\n this.x += this.speed * dt; //they move only in x-axis\n if (this.x > 505) {\n this.x = -50;\n } \n //Check for collision\n if (player.x < this.x + 80 && player.x + 60 > this.x &&\n player.y < this.y + 70 && 65 + player.y > this.y) {\n player.x = 200;\n player.y = 400;\n //Remove a point when collision occurs\n if (scoreCurrent != 0 && scoreCurrent > 0) {\n scoreCurrent--;\n scoreUpdate.textContent = 'Score: ' + scoreCurrent;\n } \n }\n //End the game \n if (scoreCurrent === 10) {\n winModal.style.display = \"block\";\n scoreCurrent = 0;\n allEnemies = [];\n\n } \n \n }", "update() {\r\n for (let enemy of allEnemies) {\r\n\r\n if (this.y === enemy.y && (enemy.x + enemy.step / 4 > this.x &&\r\n enemy.x < this.x + this.step / 4)) {\r\n this.reset();\r\n }\r\n\r\n if (this.y === 120) {\r\n console.log(\"Hi\");\r\n this.reset();\r\n\r\n };\r\n //Matthew Crawford's arcade game walkthrough was used to get a basic start on collision and enemy rendering\r\n\r\n //Shows when the player wins after level 3 has been reached\r\n\r\n if (this.y === 17) {\r\n this.reset();\r\n level++;\r\n if (level > 3) {\r\n $('h3').css(\"display\", \"block\").append('You have Won!');\r\n setTimeout(Result, 999);\r\n level = 1;\r\n }\r\n document.getElementById(\"myspan\").innerHTML = level;\r\n }\r\n }\r\n\r\n }", "sendToStartPos() {\n this.x = this.spawnX;\n this.y = this.spawnY;\n }", "update() {\n this.x += this.ballvx;\n this.y += this.ballvy;\n }", "update(dt){\n //Handling collisions\n for(let enemy of allEnemies) {\n if (this.y >= enemy.y - 40 && this.y <= enemy.y + 40 && this.x >= enemy.x - 40 && this.x <= enemy.x + 40){\n this.reset();\n }\n }\n //handle winning\n if(this.y === -15){\n alert(\"you won! you escaped the enemy\");\n this.reset();\n }\n\n }", "update () {\n for(let enemy of allEnemies) {\n // CHECK IF A HIT - ADDED /2 SO HIT REGISTERS AT RIGHT TIME\n if(this.y === enemy.y && (enemy.x + enemy.upDown/2 > this.x && enemy.x < this.x + this.upDown/2)) {\n //console.log('HIT!');\n this.reset();\n }\n\n }\n // CHECK IF PLAYER WINS\n // DID PLAYER REACH END ROW\n // CHECK IF PLAYERS Y PROPERTY IS = THE TOP OF THE GRID 0 + THE CENTERING OFFSET OF 60px\n if(this.y === 60) {\n\n //console.log('win!!');\n this.winGame = true;\n\n }\n }", "update() {\n\n // Workaround to make buildings and enemies stop moving once the player has died\n if (scene == \"game_level\" && (player.isAlive || this.moveSpeed > 0)) {\n // Move all entities to give the illusion that the player is moving\n this.rect.x += deltaTime * this.moveSpeed * speedMultiplier;\n }\n\n // If an entity goes out of bounds, it is destroyed\n if (this.rect.x < -this.rect.width * 2 || this.rect.y > canvas.height) {\n this.toDestroy = true;\n }\n\n // Check for collisions\n for (var i = 0; i < entities.length; i++) {\n let e = entities[i];\n if (e !== this) {\n if (this.rect.y + this.rect.height > e.rect.y &&\n this.rect.y < e.rect.y + e.rect.height &&\n this.rect.x + this.rect.width > e.rect.x &&\n this.rect.x < e.rect.x + this.rect.width) {\n this.onCollision(e);\n }\n }\n }\n }", "update(dt) {\n //Making enemy move every second\n this.x = this.x + this.speed * dt;\n // When Enemy Finishes one round start again\n if(this.x > 500) { \n this.x = 0;\n }\n \n // To check if player collides with enemy and what should happen if collided\n collision();\n \n // If all lives are over\n if(lives <= 0) {\n //Make game over modal appear\n gameOver();\n }\n }", "update (){\n for(let enemy of allEnemies){\n console.log(this.y,enemy.y);\n if(this.y === enemy.y&& (enemy.x + 101/2> this.x && enemy.x < this.x + 101/2)){\n console.log(this.y,enemy.y);\n console.log('hit');\n this.reset();\n console.log(this.y,enemy.y);\n }\n \n } \n// check if player reach to the rever\n if(this.y===-28){\n this.winner=true;\n }\n}", "update(dt) {\n if (this.x > 500) {\n this.x = 0;\n this.y = this.getRandomPositionY(30, 250)\n this.move(dt)\n } else {\n this.move(dt)\n }\n this.playerPosition(player, 30)\n }", "update (x, y) {\n if (this.x >= 405) {\n this.x = 400;\n } else if (this.x <= -1) {\n this.x = 0;\n } else if (this.y >= 400) {\n this.y = 400;\n } else if (this.y <= -20) {\n this.x = 200;\n this.y = 400;\n gameWon();\n \n }\n }", "function move_enemy()\n{\t\t\t\n\tfor(var i = 0;i<enemies.length;i++)\n\t{\n\t\tif (player['position'][0] > enemies[i]['position'][0] && player['position'][1] > enemies[i]['position'][1])\n\t\t{\n\t\t\tenemies[i]['position'][0] += 2;\n\t\t\tenemies[i]['position'][1] += 2;\n\t\t\tenemies[i]['direction'] = 'downright';\n\n\t\t} \n\t\telse if (player['position'][0] < enemies[i]['position'][0] && player['position'][1] < enemies[i]['position'][1])\n\t\t{\n\t\t\tenemies[i]['position'][0] -= 2;\n\t\t\tenemies[i]['position'][1] -= 2;\n\t\t\tenemies[i]['direction'] = 'upleft';\n\t\t}\n\t\telse if (player['position'][0] > enemies[i]['position'][0] && player['position'][1] < enemies[i]['position'][1])\n\t\t{\n\t\t\tenemies[i]['position'][0] += 2;\n\t\t\tenemies[i]['position'][1] -= 2;\n\t\t\tenemies[i]['direction'] = 'upright';\n\t\t}\n\t\telse if (player['position'][0] < enemies[i]['position'][0] && player['position'][1] > enemies[i]['position'][1])\n\t\t{\n\t\t\tenemies[i]['position'][0] -= 2;\n\t\t\tenemies[i]['position'][1] += 2;\n\t\t\tenemies[i]['direction'] = 'downleft';\n\t\t}\n\t else if (player['position'][0] > enemies[i]['position'][0])\n\t\t{\n\t\t\tenemies[i]['position'][0] += 2;\n\t\t\tenemies[i]['direction'] = 'right';\n\t\t} \n\t\telse if (player['position'][0] < enemies[i]['position'][0])\n\t\t{\n\t\t\tenemies[i]['position'][0] -= 2;\n\t\t\tenemies[i]['direction'] = 'left';\n\t\t}\n\t\telse if (player['position'][1] > enemies[i]['position'][1])\n\t\t{\n\t\t\tenemies[i]['position'][1] += 2;\n\t\t\tenemies[i]['direction'] = 'down';\n\t\t}\n\t\telse if (player['position'][1] < enemies[i]['position'][1])\n\t\t{\n\t\t\tenemies[i]['position'][1] -= 2;\n\t\t\tenemies[i]['direction'] = 'up';\n\t\t}\n\t}\n}", "update(data){\n this.enemy.x = data.x;\n this.enemy.y = data.y;\n this.dir = data.dir;\n switch (this.dir) {\n case \"UP\":\n this.enemy.angle = 0;\n break;\n case \"DOWN\":\n this.enemy.angle = 180;\n break;\n case \"LEFT\":\n this.enemy.angle = -90;\n break;\n case \"RIGHT\":\n this.enemy.angle = 90;\n break;\n }\n }", "update(x, y){\n this.location.x = x\n this.location.y = y\n }", "function moveEnemy(){\n for(var i =0;i<total.length;i++){\n \n var x =player.centerX-total[i].x;\n var y=player.centerY-total[i].y;\n total[i].body.velocity.x=enemySpeed*x/Math.hypot(x,y);\n total[i].body.velocity.y=enemySpeed*y/Math.hypot(x,y);\n\n if(x>0){\n total[i].animations.play('right')\n }\n\n else{\n total[i].animations.play('left')\n }\n }\n }", "function setEnemiesPosition(area,enemies,shiftY){\r\n\tlet count=enemies.length;\r\n\tlet startX=area.canvas.width;\t\r\n\tlet startY=(area.canvas.height/2+shiftY/2)-(enemies[0].height+shiftY)*count/2;\r\n\t\r\n\tfor(let i=0;i<count;i++){\r\n\t\tenemies[i].x=startX;\r\n\t\tenemies[i].y=startY+(enemies[i].height+shiftY)*i;\r\n\t\tenemies[i].angle=180;\r\n\t\tenemies[i].updatePath();\r\n\t}\t\r\n}", "newPos() {\n this.gravitySpeed += this.gravity;\n this.y += this.speedY - this.gravitySpeed;\n }", "function updatePosition(x, y) {\n queen.position.xcor = x;\n queen.position.ycor = y;\n}", "update(dt) {\n // You should multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n\n // move enemies!\n // if on canvas then move else reset off canvas and generate new speed\n if (this.x <= 505) {\n this.x = this.x + this.speed * dt;\n } else {\n this.x = -101;\n // speed between 100 and 400\n // https://www.w3schools.com/jsref/jsref_random.asp\n // todo: increase difficulty later on\n this.speed = Math.floor((Math.random() * 400) + 100);\n }\n\n this.collisionDetection();\n }", "function descend() {\n\t\t\n\t\t//aliens.y += 10; //original\n\t\t\n\t\tenemies.y += 1000; //test\n\t}", "update() {\n if (this.dead) return;\n\n this.position.y += DEFAULT_SHIP_SPEED * this.speed;\n }", "function Update () \n\t{\n\t\t//Get the position\n\t\ttargetPos = this.transform.position;\n\t\ttargetPos.y = target.position.y;\n\t\ttargetPos.x = target.position.x - 12;\n\t\t//Go to the position\n\t\tthis.transform.position = targetPos;\n\t}", "update() {\n this.location.add(this.velocity);\n\t}", "move() {\n this.posX += this.deltaX;\n this.posY += this.deltaY;\n }", "update() {\n this.move();\n this.age();\n }", "function update(dt) {\n allEnemies.forEach(function(enemy) {\n enemy.update(dt);\n });\n player.update();\n }", "update_enemy_pos( ){\n for (let i=0; i<this.enemy_pos.length; i++){\n if(this.enemy_pos[i][2]>3)\n {\n this.enemy_pos[i][2]-=this.fallRate;\n }\n //check collision here\n else if(this.enemy_pos[i][0] < 2.0)\n {\n \n this.player_got_hit();\n \n //dont move\n this.enemy_pos.splice(i,1);\n i--;\n } \n else\n {\n // random chance to shoot bullet\n if(this.enemy_pos[i][0] > 5.0 && Math.random()>0.9995){\n var new_pos = [this.enemy_pos[i][0], this.enemy_pos[i][1],this.enemy_pos[i][3]];\n this.bullet_pos.push(new_pos);\n const newAudio = this.sound.spit.cloneNode();\n newAudio.play();\n }\n this.enemy_pos[i][0] -= this.enemySpeed;\n }\n \n }\n }", "update(){\n \n this.x+=this.xspeed;\n this.y+=this.gravity;\n \n }", "updatePosition() {\n this.xOld = this.x;\n this.yOld = this.y;\n \n this.velX *= this.friction;\n this.velY *= this.friction;\n\n if (Math.abs(this.velX) > this.velMax)\n this.velX = this.velMax * Math.sign(this.velX);\n \n if (Math.abs(this.velY) > this.velMax)\n this.velY = this.velMax * Math.sign(this.velY);\n \n this.x += this.velX;\n this.y += this.velY;\n }", "update() {\r\n this.draw()\r\n this.angle = this.angle + this.angleX\r\n if(this.angle > 6) {\r\n this.angle = 0\r\n }\r\n if(this.angle < 0) {\r\n this.angle = 6\r\n }\r\n this.x = this.x + this.playerMov2.x\r\n this.y = this.y + this.playerMov2.y\r\n if(this.x > this.wc * 2 - this.pSize) this.x = this.wc * 2 - this.pSize\r\n if(this.x < 0) this.x = 0\r\n if(this.y < 0) this.y = 0\r\n if(this.y > this.sh - this.pSize) this.y = this.sh - this.pSize\r\n }", "function updateEnemies(){\n\n //animate enemies :\n for(var i=0; i<enemies.length;i++){\n enemies[i].update();\n enemies[i].draw();\n //player ran into enemy\n if(player.minDist(enemies[i]) <= player.width - platformWidth/2){\n console.log(\"Killed by enemies\");\n gameOver();\n }\n }\n\n //remove enemies gone off screen :\n if (enemies[0] && enemies[0].x < -platformWidth) {\n \n enemies.splice(0 ,1);\n }\n }", "move(x,y){\n this.position.x += x;\n this.position.y += y;\n }", "update() {\n // Check if the player has reached the goal\n if (this.isReady && this.y === -25) {\n this.isReady = false;\n this.updateScore(); // Increment score by 1\n setTimeout(() => {\n // Reposition the player at the starting spot after brief delay\n [this.x, this.y] = this.startPos;\n this.isReady = true;\n }, 500);\n } else if (this.isReady && this.wantsToMove) {\n this.move(this.direction); // Move the player\n this.wantsToMove = false;\n }\n }", "function enemyMove(){\n setInterval(function(){\n // console.log(enemy.x,enemy.y,player.x, player.y);\nif (enemy.x < player.x && enemy.y < player.y){\n enemy.x++;\n enemy.y++;\n} else if \n (enemy.x > player.x && enemy.y < player.y){\nenemy.x--;\nenemy.y++;\n} else if\n(enemy.x < player.x && enemy.y > player.y){\n enemy.x++;\n enemy.y--;\n} else if\n(enemy.x > player.x && enemy.y > player.y){\n enemy.x--;\n enemy.y--;\n} else if\n(enemy.x > player.x && enemy.y == player.y){\n enemy.x--;\n} else if\n(enemy.x < player.x && enemy.y == player.y){\n enemy.x++;\n} else if\n(enemy.x == player.x && enemy.y < player.y){\n enemy.y++;\n} else if\n(enemy.x == player.x && enemy.y > player.y){\n enemy.y--;\n} \n},40) // higher = enemy moves slower\n}", "update() {\n this.enemyXPos -= currentSpeed; //move enemy to the left\n //canvas.fillStyle = \"#ff0000\";\n //canvas.fillRect(this.enemyXPos, this.enemyYPos, SPRITEDIMENSION, SPRITEDIMENSION);\n canvas.drawImage(rockImage, this.enemyXPos, this.enemyYPos);\n\n\n\n /*** hit detection ***/\n if (this.enemyYPos + SPRITEDIMENSION >= yPos && this.enemyYPos <= yPos + SPRITEDIMENSION && this.enemyXPos <= xPos + SPRITEDIMENSION && this.enemyXPos + SPRITEDIMENSION >= xPos) {\n isDead = true;\n this.enemyXVelocity = 0;\n this.isAlive = false;\n }\n\n if (this.enemyXPos + SPRITEDIMENSION < 0) //if enemy has gone left off the screen\n {\n this.isAlive = false;//removes from array, stops drawing\n }\n }", "update(dt) {\n this.x = this.x + (this.speed * 30 * dt) + 1;\n\n // collison detection\n if (player.x < this.x + 80 &&\n player.x + 80 > this.x &&\n player.y < this.y + 60 &&\n 60 + player.y > this.y) {\n\n // respawn when player hit by bug (Enemy)\n player.x = 200;\n player.y = 370;\n\n // decrease level count on player contact with bug\n // dont go under level 1\n if (level > 1) {\n level--;\n\n // lower bug speed when lose level\n // make every enemy a little faster\n for (const enemy of allEnemies) {\n enemy.speed = enemy.speed - 2;\n }\n\n // audio when player losses level\n loss.play();\n\n // update level number on screen\n document.querySelector('#level-number').innerHTML = level;\n }\n };\n }", "function moveEnemy(){\n\n\tif(enemy1.x>759){\n\t\tenemy1.animations.play('left');\n\t\tenemy1.body.velocity.x=-120;\n\t}\n\telse if(enemy1.x<405){\n\t\tenemy1.animations.play('right');\n\t\tenemy1.body.velocity.x=120\n\t}\n}", "update(dt) {\n\n // Make enemies move\n this.x += this.speed * dt;\n\n // Make enemies movement inside the game interval\n if(this.x > 555) {\n this.x = -100;\n this.speed = Math.floor(Math.random() * 500) + 100;\n }\n\n // Reset game when vehicle & player collision\n if (this.x - player.x > -65 && this.x - player.x < 65 && this.y - player.y > -50 && this.y - player.y < 50) {\n player.x = 202;\n player.y = 395;\n\n // Decrease number of hearts\n hearts.textContent = Number(hearts.textContent) - 1;\n\n // Show game over message when number of hearts equal '0'\n if(hearts.textContent === '0') {\n result.style.display = 'flex';\n finalScore.textContent = score.textContent;\n }\n }\n }", "update() {\r\n this.draw()\r\n this.angle = this.angle + this.angleX\r\n if(this.angle > 6) {\r\n this.angle = 0\r\n }\r\n if(this.angle < 0) {\r\n this.angle = 6\r\n }\r\n this.x = this.x + this.playerMov1.x\r\n this.y = this.y + this.playerMov1.y\r\n if(this.x > this.wc * 2 - this.pSize) this.x = this.wc * 2 - this.pSize\r\n if(this.x < 0) this.x = 0\r\n if(this.y < 0) this.y = 0\r\n if(this.y > this.sh - this.pSize) this.y = this.sh - this.pSize\r\n }", "function updateBoard(){\n draw(levelMap);\n\n /*\n levelMap[player.getCurrentPosition().y][player.getCurrentPosition().x] = 1;\n levelMap[enemy.getCurrentPosition().y][enemy.getCurrentPosition().x] = 2;\n\n if(player.getCurrentPosition().y == levelMap.length - 1) player.setGoalReached(true);\n if(enemy.getCurrentPosition().y == 0) enemy.setGoalReached(true);\n\n draw(levelMap);\n\n //Clean the cells where the player was standed\n levelMap[player.getCurrentPosition().y][player.getCurrentPosition().x] = 0;\n levelMap[enemy.getCurrentPosition().y][enemy.getCurrentPosition().x] = 0;\n\n //Read the x and y positions of player and enemy to put them in the board\n if(!player.getGoalReached()){\n player.setCurrentPosition(player.getCurrentPosition().x,player.getCurrentPosition().y+1);\n }\n\n if(!enemy.getGoalReached()){\n enemy.setCurrentPosition(enemy.getCurrentPosition().x,enemy.getCurrentPosition().y-1);\n }\n */\n}", "update() {\n super.update();\n let state = this.state;\n let entities = state.entities;\n entities.forEach(th => {\n th.data.repulse.set(0, 0);\n });\n entities.forEach(th => {\n this._processThinker(th)\n });\n // tous les sprites doivent etre relatifs à ce point de vue\n let p = state.player.data.position;\n entities.forEach(e => {\n e.sprite.position.set(e.data.position.sub(p));\n });\n ++this.state.time;\n state.player.sprite.position.set(0, 0);\n state.view.set(p);\n }", "updateCoords () {\n \n if ( this.xCoord < 0 || this.xCoord > width ) this.xSpeed *= -1;\n \n this.xCoord += this.xSpeed;\n \n if ( this.yCoord < 0 || this.yCoord > height ) this.ySpeed *= -1;\n \n this.yCoord += this.ySpeed;\n }", "updateEnemies() {\n this.liveEnemies.forEach(enemy => {\n // If patrolling, just continue to edge of screen before turning around\n if (enemy.enemyAction === EnemyActions.Patrol) {\n //console.log(enemy);\n // These should be changed to not be hard coded eventually\n if (enemy.enemySprite.body.position.x < 50) {\n enemy.enemySprite.body.velocity.x = -1 * enemy.enemySprite.body.velocity.x;\n }\n if (enemy.enemySprite.body.position.x > 1850) {\n enemy.enemySprite.body.velocity.x = -1 * enemy.enemySprite.body.velocity.x;\n }\n if (enemy.enemySprite.body.position.y < 50) {\n enemy.enemySprite.body.velocity.y = -1 * enemy.enemySprite.body.velocity.y;\n }\n if (enemy.enemySprite.body.position.y > 1000) {\n enemy.enemySprite.body.velocity.y = -1 * enemy.enemySprite.body.velocity.y;\n }\n // check if we are near an object, if yes, try and guard it. Not sure if this is working - Disabling for now\n //console.log(this.isNearObject(enemy.enemySprite));\n if (null != null) {\n console.log(\"Is near an object\");\n enemy.enemySprite.body.velocity.y = 0;\n enemy.updateAction(EnemyActions.Guard, null);\n }\n // Otherwise, wait for attack cooldown before attacking the player\n else {\n if (enemy.attackCooldown === 0) {\n enemy.attackCooldown = Math.floor(Math.random() * 2000);\n enemy.updateAction(EnemyActions.Attack, this.level.player);\n }\n else {\n enemy.attackCooldown = enemy.attackCooldown - 1;\n }\n }\n }\n\n // Guard the item\n if (enemy.enemyAction === EnemyActions.Guard) {\n enemy.guard();\n }\n\n // Attack the player\n if (enemy.enemyAction === EnemyActions.Attack) {\n enemy.attack();\n }\n\n // check if animation needs to be flipped\n if (enemy.enemySprite.body.velocity.x < 0) {\n enemy.enemySprite.scale.x = -1;\n }\n else if (enemy.enemySprite.body.velocity.x > 0) enemy.enemySprite.scale.x = 1;\n });\n }", "function animate() {\r\n\trequestAnimationFrame(animate);\r\n\t\tif(aPlayer){\r\n\t\t\tfor(var i in Player.list){\r\n\r\n\t\t\t\ttempPlayer = Player.list[i];\r\n\r\n\t\t\t\tif(tempPlayer.died === false){\r\n\t\t\t\t\tif(tempPlayer.serverX !== tempPlayer.obj.x){\r\n\r\n\t\t\t\t\t\ttempPlayer.obj.x = tempPlayer.serverX;\r\n\t\t\t\t\t\t// var diff = tempPlayer.serverX - tempPlayer.obj.x;\r\n\t\t\t\t\t\t// tempPlayer.obj.x += diff/interpollation;\r\n\t\t\t\t\t\t// if(tempPlayer.serverX > tempPlayer.obj.x)\r\n\t\t\t\t\t\t// \ttempPlayer.obj.x += 2;\r\n\r\n\t\t\t\t\t\t// if(tempPlayer.serverX < tempPlayer.obj.x)\r\n\t\t\t\t\t\t// \ttempPlayer.obj.x -= 2;\r\n\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(tempPlayer.serverY !== tempPlayer.obj.y){\r\n\t\t\t\t\t\t// var diff = tempPlayer.serverY - tempPlayer.obj.y;\r\n\t\t\t\t\t\t// tempPlayer.obj.y += diff/interpollation;\r\n\t\t\t\t\t\t// tempPlayer.obj.y += 2;\r\n\t\t\t\t\t\ttempPlayer.obj.y = tempPlayer.serverY;\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t} else{\r\n\t\t\t\t\ttempPlayer.obj.x = tempPlayer.serverX;\r\n\t\t\t\t\ttempPlayer.obj.y = tempPlayer.serverY;\r\n\t\t\t\t}\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i in Enemy.list){\r\n\t\t\t\tif(Enemy.list[i]){\r\n\t\t\t\t\ttempEnemy = Enemy.list[i];\r\n\t\t\t\t\t// if(tempPlayer.died === false){\r\n\t\t\t\t\t\tif(tempEnemy.serverX !== tempEnemy.obj.x){\r\n\t\t\t\t\t\t\tvar diff = tempEnemy.serverX - tempEnemy.obj.x;\r\n\r\n\r\n\t\t\t\t\t\t\ttempEnemy.obj.x += diff/interpollation;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(tempEnemy.serverY !== tempEnemy.obj.y){\r\n\t\t\t\t\t\t\tvar diff = tempEnemy.serverY - tempEnemy.obj.y;\r\n\t\t\t\t\t\t\ttempEnemy.obj.y += diff/interpollation;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// }\r\n\t\t\t\t// else{\r\n\t\t\t\t// \ttempEnemy.obj.x = tempEnemy.serverX;\r\n\t\t\t\t// \ttempEnemy.obj.y = tempEnemy.serverY;\r\n\t\t\t\t// }\t\t\t\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t}\t\r\n\r\n\trenderer.render(stage);\r\n\t}", "function player_move(dir) {\n player.pos.x += dir;\n if (collide(arena, player)) {\n player.pos.x -= dir;\n }\n}", "async function moveEnemies() {\r\n\t\tcurrentPath = [];\r\n\t\tpathStart = [posEnemyX, posEnemyY];\r\n\t\tpathEnd = [posX, posY];\r\n\r\n\t\t// Find shortest path to player\r\n\t\tcurrentPath = findPath(world,pathStart,pathEnd);\r\n\r\n\t\tworld[posEnemyX][posEnemyY] = 0;\r\n\r\n\t\t// Returns the first decision since currentPath[0] returns the state it is in.\r\n\t\tposEnemyX = currentPath[1][0];\r\n\t\tposEnemyY = currentPath[1][1];\r\n\r\n\t\t// Say that the pos is an enemy block & redraw it all.\r\n\t\tworld[posEnemyX][posEnemyY] = 3;\r\n\t\tredraw(world);\r\n\r\n\t\t// If enemy got you\r\n\t\tif (posX === posEnemyX && posY === posEnemyY) {\r\n\t\t\thasLost = true;\r\n\t\t\talert(\"You have lost!\");\r\n\t\t}\r\n\r\n\t\tif (!hasWon) {\r\n\t\t\tawait sleep(150);\r\n\t\t\tmoveEnemies();\r\n\t\t}\r\n\t}", "update() {\n this.pos1 = Math.floor(this.y);\n this.pos2 = Math.floor(this.x);\n this.speed = mappedImage[this.pos1][this.pos2].cellBrightness;\n let movement = 2.5 - this.speed + this.velocity;\n // console.log(this.speed);\n this.y += movement;\n\n // Give it a random position and check if it has reached the end of the canvas.\n this.y += this.velocity;\n if (this.y >= canvas.height) {\n this.y = 0;\n this.x = Math.random() * canvas.width;\n }\n }", "_updatePosition() {\n // Check walls\n if (this.x + this.curRadius > this.canvas.width || this.x - this.curRadius < 0) {\n // Switch directions\n this.dx = -this.dx;\n }\n if (this.y + this.curRadius > this.canvas.height || this.y - this.curRadius < 0) {\n this.dy = -this.dy;\n }\n\n this.x += this.dx;\n this.y += this.dy;\n }", "function _update(dt = 0) { // TODO: time \"blind\" (gameArea has time only)\n gameArea.entities().forEach(function(entity) {\n entity.position.x += entity.direction.x * entity.speed.x * dt;\n entity.position.y += entity.direction.y * entity.speed.y * dt;\n });\n }", "update() {\n\n this.nextMoveX = this.x + this.nextDirectionX;\n this.nextMoveY = this.y + this.nextDirectionY;\n\n\n }" ]
[ "0.77730143", "0.7441007", "0.738478", "0.7367606", "0.7335268", "0.73146313", "0.7285591", "0.72396815", "0.72209585", "0.71981657", "0.7150394", "0.71449536", "0.71444535", "0.7141222", "0.71345526", "0.71333396", "0.71151084", "0.7114613", "0.710047", "0.7059871", "0.7046143", "0.704504", "0.704183", "0.7033329", "0.7023442", "0.69852406", "0.69789875", "0.69770205", "0.69620335", "0.694378", "0.6943607", "0.6919061", "0.6900178", "0.6894728", "0.6873614", "0.6827844", "0.68036234", "0.6768658", "0.67554426", "0.67554426", "0.67551154", "0.67526233", "0.6744681", "0.67352676", "0.6730284", "0.6710879", "0.67053044", "0.67053044", "0.6701972", "0.6683271", "0.667626", "0.66722137", "0.66711", "0.6657943", "0.66483366", "0.66447365", "0.6641756", "0.6641031", "0.6636264", "0.6620886", "0.66061413", "0.660072", "0.65989035", "0.6593459", "0.65905774", "0.65900564", "0.6585296", "0.65764993", "0.6566105", "0.6561218", "0.6559631", "0.6553231", "0.6549474", "0.6544132", "0.65386087", "0.6536474", "0.65254074", "0.6512132", "0.64909196", "0.6483529", "0.6483073", "0.64781094", "0.6475733", "0.64539087", "0.64486814", "0.64467835", "0.6433546", "0.6421834", "0.64158624", "0.6410775", "0.6407072", "0.64043564", "0.63851964", "0.6383266", "0.63620305", "0.63587874", "0.634889", "0.6343597", "0.6342742", "0.6342148" ]
0.6939115
31
============================================================================= = Collision detection = =============================================================================
function detectAndHandleCollisions(entities) { for (var i = 1; i < entities.length; i++) { var e1 = entities[i]; for (var j = 0; j < i; j++) { var e2 = entities[j]; if (e1.newVersion._id === e2.newVersion._id) { return; } var dx = e2.newVersion.x - e1.newVersion.x; var dy = e2.newVersion.y - e1.newVersion.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance < TILE_SIZE_PX) { handleCollision(e1, e2); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "collision () {\n }", "function collision (px,py,pw,ph,ex,ey,ew,eh){\nreturn (Math.abs(px - ex) *2 < pw + ew) && (Math.abs(py - ey) * 2 < ph + eh);\n \n}", "function detectCollision() {\n ballCollision();\n brickCollision();\n}", "function collisionDetection(body1, body2){\n if(body1.x+body1.width > body2.x-cameraX && body1.x < body2.x+body2.width-cameraX && \n body1.y+body1.height > body2.y-cameraY && body1.y < body2.y+body2.height-cameraY){\n return true;\n }else{\n return false;\n }\n}", "handleCollision(climber) {\n\n // distance\n //\n // to calculate the distance between the avalanche and climber\n let d = dist(this.x, this.y, climber.x, climber.y);\n\n // dist()\n //\n // To keep track of the avalanche and the avatar are in contact\n if (d < this.width / 2 + climber.width / 2) {\n // this is to push the climber down\n climber.vy += 2;\n\n }\n }", "onCollision() {\n\n }", "collide(oth) {\n return this.right > oth.left && this.left < oth.right && this.top < oth.bottom && this.bottom > oth.top\n }", "function checkCollision(obj1, obj2) {\n if (obj1.x > obj2.x) {\n if (obj1.y > obj2.y) {\n if (obj1.x - obj2.x < obj2.width && obj1.y - obj2.y < obj2.height) {\n if (obj1.x - obj2.x > obj1.y - obj2.y) { return 1; }\n return 2;\n }\n } else {\n if (obj1.x - obj2.x < obj2.width && obj2.y - obj1.y < obj1.height) {\n if (obj1.x - obj2.x > obj2.y - obj1.y) { return 1; }\n return 3;\n }\n }\n } else {\n if (obj1.y > obj2.y) {\n if (obj2.x - obj1.x < obj1.width && obj1.y - obj2.y < obj2.height) {\n if (obj2.x - obj1.x > obj1.y - obj2.y) { return 0; }\n return 2;\n }\n } else {\n if (obj2.x - obj1.x < obj1.width && obj2.y - obj1.y < obj1.height) {\n if (obj2.x - obj1.x > obj2.y - obj1.y) { return 0; }\n return 3;\n }\n }\n }\n return -1;\n}", "function checkCollision(i1, i2, result) {\n\n var p1 = i1.position;\n var b1 = i1.body;\n var p2 = i2.position;\n var b2 = i2.body;\n\n if ((b1.type & 1) && (b2.type & 1)) {\n // this check is pointless for 2 circles as it's the same as the full test\n if (b1.type !== T.BODY_CIRCLE || b2.type !== T.BODY_CIRCLE) {\n vec2.add(p1, b1.boundOffset, tv1);\n vec2.add(p2, b2.boundOffset, tv2);\n var rss = b1.boundRadius + b2.boundRadius;\n if (tv1.distancesq(tv2) > rss*rss) {\n return false;\n }\n }\n }\n\n var colliding = null;\n var flipped = false;\n\n if (b1.type > b2.type) {\n \n var tmp = b2;\n b2 = b1;\n b1 = tmp;\n\n tmp = i2;\n i2 = i1;\n i1 = tmp;\n\n tmp = p2;\n p2 = p1;\n p1 = tmp;\n\n flipped = true;\n\n }\n\n if (b1.type === T.BODY_AABB) {\n if (b2.type === T.BODY_AABB) {\n colliding = AABB_AABB(i1, i2, result);\n } else if (b2.type === T.BODY_CIRCLE) {\n colliding = AABB_circle(p1, b1, p2, b2, result);\n } else if (b2.type === T.BODY_LINE_SEGMENT) {\n colliding = AABB_lineSegment(p1, b1, p2, b2, result);\n }\n } else if (b1.type === T.BODY_CIRCLE) {\n if (b2.type === T.BODY_CIRCLE) {\n colliding = circle_circle(p1, b1, p2, b2, result);\n } else if (b2.type === T.BODY_LINE_SEGMENT) {\n colliding = circle_lineSegment(i1, i2, result);\n }\n } else if (b1.type === T.BODY_LINE_SEGMENT) {\n if (b2.type === T.BODY_LINE_SEGMENT) {\n colliding = lineSegment_lineSegment(p1, b1.size, p2, b2.size, result);\n }\n }\n\n if (colliding === null) {\n console.error(\"warning: unsupported arguments to collision detection\");\n return false; \n } else {\n if (flipped) {\n result.mtv.x *= -1;\n result.mtv.y *= -1;\n }\n return colliding;\n }\n\n}", "function checkCollision() {\n let objs = []\n globalRayCaster.set( camera.getWorldPosition(), camera.getWorldDirection() );\n currentObject.traverse(child => {\n if (child.isMesh) {\n objs.push(child)\n }\n })\n var intersections = globalRayCaster.intersectObjects( objs );\n if (intersections.length > 0) {\n if (intersections[0].distance <= 3.5)\n if (currentObject === lightSwitch)\n createLight();\n else if (currentObject === note)\n openNote();\n else if (currentObject === usb)\n grabUSB();\n else if (currentObject === gun)\n grabGun();\n else if (currentObject === key)\n gameOver();\n\n }\n}", "handleCollisions(){\n\t const newX = this.head.x + (this.direction.x * this.speed);\n\t const xExplorer = new Coord(newX, this.head.y);\n\t const xCollision = this.map.collidingWithWall(xExplorer);\n\t\n\t const newY = this.head.y + (this.direction.y * this.speed);\n\t const yExplorer = new Coord(this.head.x, newY);\n\t const yCollision = this.map.collidingWithWall(yExplorer);\n\t\n\t const zExplorer = new Coord(newX, newY);\n\t const zCollision = this.map.collidingWithWall(zExplorer);\n\t\n\t if (xCollision || yCollision || zCollision) {\n\t // generate reflected ray\n\t\n\t // reflect direction based on collision\n\t const reflectionDirection = new Coord(this.direction.x, this.direction.y);\n\t if (xCollision) {\n\t reflectionDirection.x = -reflectionDirection.x;\n\t } else if (yCollision) {\n\t reflectionDirection.y = -reflectionDirection.y;\n\t } else {\n\t reflectionDirection.y = -reflectionDirection.y;\n\t reflectionDirection.x = -reflectionDirection.x;\n\t }\n\t\n\t const origin = new Coord(this.head.x, this.head.y);\n\t const reflection = new Ray(\n\t origin,\n\t reflectionDirection,\n\t this.map,\n\t this.age, // advance new ray age to parent ray current age\n\t this.body.length // set new ray max length\n\t );\n\t\n\t reflection.monster = this.monster;\n\t\n\t this.map.rays.push(reflection);\n\t // console.log(this.map.rays.length);\n\t\n\t // stop expansion of current ray\n\t this.direction.x = 0;\n\t this.direction.y = 0;\n\t\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t }", "checkCollisions() {\n // check for collisions with window boundaries\n if (this.pos.x > width || this.pos.x < 0 ||\n this.pos.y > height || this.pos.y < 0) {\n this.collision = true;\n }\n\n // check for collisions with all obstacles\n for (let ob of obstacles) {\n if (this.pos.x > ob.x && this.pos.x < ob.x + ob.width &&\n this.pos.y > ob.y && this.pos.y < ob.y + ob.height) {\n this.collision = true;\n break;\n }\n }\n }", "function collidesWith( a, b )\n{\n return a.bottom > b.top && a.top < b.bottom;\n}", "function detectCollsion() {\r\n if (distance < 0) {\r\n return;\r\n }\r\n // var Leo = MeshLeoTorso.position;\r\n var originPoint = MeshLepoFullBody.position.clone();\r\n var boundingBoxVertices = MeshLepoFullBody.geometry.vertices;\r\n var boundingBoxMatrix = MeshLepoFullBody.matrix;\r\n var awardBoundArr = [];\r\n awardBoundArr.push(awardsBound);\r\n boundingBoxVertices.forEach(function(vert) {\r\n var vertClone = vert.clone().applyMatrix4(boundingBoxMatrix);\r\n // The direction vector that gives direction to the ray. Should be normalized.\r\n var direction = vertClone.sub(originPoint);\r\n if (direction) { // why is this crashing ??? \r\n var normalizedDir = direction.clone().normalize();\r\n var rayCaster = new THREE.Raycaster(originPoint,normalizedDir);\r\n var collisionObstacle = rayCaster.intersectObjects(obstacles);\r\n var collisionAward = rayCaster.intersectObjects(awardBoundArr);\r\n if (collisionObstacle && collisionObstacle.length > 0 && collisionObstacle[0].distance < direction.length()) {\r\n generateExplosion(MeshLeoTorso.position.x, MeshLeoTorso.position.y);\r\n collisionFSX.play();\r\n gameOver(false);\r\n } else if (collisionAward && collisionAward.length > 0 && collisionAward[0].distance < direction.length()) {\r\n gameOver(true);\r\n }\r\n }\r\n });\r\n}", "function CollisionCalculatorC2C(o1,o2) {\n //console.log(o1,o2);\n var dist = Math.sqrt( Math.pow((o2.x-o1.x),2)+Math.pow((o2.y-o1.y),2));\n var totalR = o2.r + o1.r;\n if(dist>totalR){\n return false;\n }\n /*\n var colPoint = new Point( o2.x + (o1.position.x-o2.position.x)*o2.r/(o2.r+o1.r),o2.y + (o1.position.y-o2.position.y)*o2.r/(o2.r+o1.r);\n */\n\n var region = \"\";\n if (o1.y < o2.y - Math.abs(o2.height/2)) {\n\n //If it is, we need to check whether it's in the\n //top left, top center or top right\n if (o1.x < o2.x - 1 - Math.abs(o2.width/2)) {\n region = \"topLeft\";\n } else if (o1.x > o2.x + 1 + Math.abs(o2.width/2)) {\n region = \"topRight\";\n } else {\n region = \"topMiddle\";\n }\n }\n\n else if ((o1.y > o2.y + Math.abs(o2.height/2))) {\n\n //If it is, we need to check whether it's in the bottom left,\n //bottom center, or bottom right\n if (o1.x < o2.x - 1 - Math.abs(o2.width/2)) {\n region = \"bottomLeft\";\n } else if (o1.x > o2.x + 1 + Math.abs(o2.width/2)) {\n region = \"bottomRight\";\n } else {\n region = \"bottomMiddle\";\n }\n } \n else {\n if (o1.x < o2.x - Math.abs(o2.width/2)) {\n region = \"leftMiddle\";\n } else {\n region = \"rightMiddle\";\n }\n }\n\n //return true;\n return [true,region];\n}", "collision() {\n if (this.y === (player.y - 12) && this.x > player.x - 75 && this.x < player.x + 70) {\n player.collide();\n }\n }", "function detectCollision(player1, player2){\n\treturn Math.abs(player1.x-player2.x) < 40 && Math.abs(player1.y-player2.y) < 40;\n}", "function collides(a, b) {\n\n\treturn a.x < b.x + b.width &&\n\t\t\t\t a.x + a.width > b.x &&\n\t\t\t\t a.y < b.y + b.height &&\n\t\t\t\t a.y + a.height > b.y;\n\n}", "checkCollision() { \n return (player.x < this.x + 80 &&\n player.x + 80 > this.x &&\n player.y < this.y + 60 &&\n 60 + player.y > this.y)\n }", "collide(obj) {\n if (this.x <= obj.x + obj.w &&\n obj.x <= this.x + this.w &&\n this.y <= obj.y + obj.h &&\n obj.y <= this.y + this.h\n ) {\n return true;\n }\n }", "function detectCollision(entity){\n\tdist=[entity.position[0]-self.position[0],entity.position[1]-self.position[1],entity.position[2]-self.position[2]];\n\tspeed=Math.sqrt(Math.pow(self.velocity[0],2)+Math.pow(self.velocity[2],2));\n if(Math.sqrt(Math.pow(dist[0],2)+Math.pow(dist[2],2))<entity.size && Math.abs(dist[1])<10){\n entity.velocity[0]=2*(self.velocity[0]*self.lookXY[0] + self.velocity[2]*self.strafe[0]);\n entity.velocity[2]=2*(self.velocity[0]*self.lookXY[1] + self.velocity[2]*self.strafe[1]);\n entity.velocity[1]=2*speed;\n }\n}", "checkCollision(){\n\n if(this.radius > 0){\n if(this.x + this.radius > game.getWidth() || this.x - this.radius < 0){\n this.xVel *= -1;\n }\n\n if(this.y + this.radius > game.getHeight() || this.y - this.radius < 0){\n this.yVel *= -1;\n }\n } \n \n }", "function areCollide(r1, r2) {\n //Define the variables we'll need to calculate\n var hit, combinedHalfWidths, combinedHalfHeights, vx, vy;\n\n //hit will determine whether there's a collision\n hit = false;\n\n //Find the center points of each sprite\n r1.centerX = r1.x + r1.width / 2;\n r1.centerY = r1.y + r1.height / 2;\n r2.centerX = r2.x + r2.width / 2;\n r2.centerY = r2.y + r2.height / 2;\n\n //Find the half-widths and half-heights of each sprite\n r1.halfWidth = r1.width / 2;\n r1.halfHeight = r1.height / 2;\n r2.halfWidth = r2.width / 2;\n r2.halfHeight = r2.height / 2;\n\n //Calculate the distance vector between the sprites\n vx = r1.centerX - r2.centerX;\n vy = r1.centerY - r2.centerY;\n\n //Figure out the combined half-widths and half-heights\n combinedHalfWidths = r1.halfWidth + r2.halfWidth;\n combinedHalfHeights = r1.halfHeight + r2.halfHeight;\n\n //Check for a collision on the x axis\n if (Math.abs(vx) < combinedHalfWidths) {\n\n //A collision might be occuring. Check for a collision on the y axis\n if (Math.abs(vy) < combinedHalfHeights) {\n\n //There's definitely a collision happening\n hit = true;\n } else {\n\n //There's no collision on the y axis\n hit = false;\n }\n } else {\n\n //There's no collision on the x axis\n hit = false;\n }\n\n //`hit` will be either `true` or `false`\n return hit;\n}", "function CollisionManager(policy){\n\t\n\tthis.policy=policy;\n\t\n\tthis.checkCollision=function(){\n\t\t\n\t\tif(this.policy==Constants.defaultCollision){\n\t\t\tcheckCollisionDefault();\n\t\t}\n\t\t\n\t};\n\t\n\t\n\t/**\n\t * Check for collision with the default policy\n\t */\n\tcheckCollisionDefault=function(){\n\t\t\n\t\tvar user=entityManager.getUser();\n\t\tvar entities=entityManager.getEntities();\n\t\tvar solids=entityManager.getSolids();\n\t\t\n\t\t\n\t\tvar userLeft=parseFloat(user.x);\n\t\tvar userRight=parseFloat(user.x+user.frameW);\n\t\tvar userTop=parseFloat(user.y);\n\t\tvar userBottom=parseFloat(user.y+user.frameH);\n\t\tvar isCollision=false;\n\t\t\n\t\tfor(var i=0; i<entities.length; i++){\n\t\t\n\t\t\tvar isSpriteOverlap=true;\n\t\t\t\n\t\t\tvar entity=entities[i];\n\t\t\t\n\t\t\tvar entityLeft=parseFloat(entity.x);\n\t\t\tvar entityRight=parseFloat(entity.x+entity.frameW);\n\t\t\tvar entityTop=parseFloat(entity.y);\n\t\t\tvar entityBottom=parseFloat(entity.y+entity.frameH);\n\t\t\t\n\t\t\t//Check if the two Sprites overlap so the images are close \n\t\t\tif(userLeft > entityRight || entityLeft > userRight || userTop > entityBottom || entityTop > userBottom){\n\t\t\t\tisSpriteOverlap=false;\n\t\t\t}\n\n\t\t\t//if they are close then do pixel-by-pixel comparison\n\t\t\tif(isSpriteOverlap){\n\t\t\t\n\t\t\t\tuserData=weavejs.getOffCanvasContext().getImageData(user.x,user.y,user.frameW,user.frameH);\n\t\t\t\tentityData=weavejs.getOffCanvasContext().getImageData(entity.x,entity.y,entity.frameW,entity.frameH);\n\t\t\t\t\n\t\t\t\tisCollision=checkForPixelCollision(userData,user.x,user.y,entityData,entity.x,entity.y);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\tconsole.log(\"Collision:\"+isCollision);\n\t\t\n\t};\n\t\n\t/**\n\t * the method take two entities and theeir coordinate information and checks for nont transparent pixel collision\n\t * @param firstEntityData the data of the first entity \n\t * @param firstEntityX the x coordinates of the first entity\n\t * @param firstEntityY the y coordinates of the first entity\n\t * @param secondEntityData the data of the second entity \n\t * @param secondEntityX the x coordinates of the second entity\n\t * @param secondEntityY the y coordinates of the second entity\n\t * \n\t */\n\tcheckForPixelCollision=function(firstEntityData,firstEntityX,firstEntityY,secondEntityData,secondEntityX,secondEntityY){\n\t\t\n\n\t var firstEntityWidth = firstEntityData.width;\n\t var firstEntityHeight = firstEntityData.height;\n\t var secondEntityWidth = secondEntityData.width;\n\t var secondEntityHeight = secondEntityData.height;\n\n\t //we calculate the top right and bottom left corners\n\t var xMin = Math.max( firstEntityX, secondEntityX );\n\t var yMin = Math.max( firstEntityY, secondEntityY );\n\t var xMax = Math.min( firstEntityX+firstEntityWidth, secondEntityX+secondEntityWidth );\n\t var yMax = Math.min( firstEntityY+firstEntityHeight, secondEntityY+secondEntityHeight );\n\t \n\t \n\t var firstEntityPixels = firstEntityData.data;\n\t var secondEntityPixels = secondEntityData.data;\n\t\t\n\t //we iterate through the pixels of the each entity\n\t for ( var i = xMin; i < xMax; i++ ) {\n\t for ( var j = yMin; j < yMax; j++ ) {\n\t \n\t \t //we get the alpha value of each pixel we want to check\n\t \t var firstEntityPixelAlpha = ((i-firstEntityX ) + (j-firstEntityY )*firstEntityWidth )*4 + 3 ;\n\t \t var secondEntityPixelAlpha = ((i-secondEntityX) + (j-secondEntityY)*secondEntityWidth)*4 + 3 ;\n\t \t\n\t \t //if the pixels the collide are not transparent then we a collision of the entities\n\t \t if ( firstEntityPixels[firstEntityPixelAlpha] !== 0 && secondEntityPixels[secondEntityPixelAlpha] !== 0 ) {\n\t \t\t return true;\n\t \t\t}\n\t \t\n\t }\n\t }\n\n\t return false;\n\t \n\t \n\t};\n\t\n\t\n}", "onCollision(otherObjects) {}", "function collisionDetection(x, y) {\n if (\n // The range of the detection is 35 each side enabling high incrimentation sprite values to be caught\n x - getShipLocation(angle)[0] <= 35 &&\n x - getShipLocation(angle)[0] >= -35 &&\n y - getShipLocation(angle)[1] <= 35 &&\n y - getShipLocation(angle)[1] >= -35\n ) {\n // Calls crash screen when a collision is detected\n crashScreen();\n }\n}", "function CollisionCalculatorC2P(o1,pt) \n{\n var dx = pt.x - o1.x;\n var dy = pt.y - o1.y;\n\n var dist = Math.sqrt( Math.pow((pt.x-o1.x),2)+Math.pow((pt.y-o1.y),2));\n if(dist>o1.r) {\n return false;\n }\n return true;\n}", "function collisionDetection(x, y) {\r\n if (\r\n // The range of the detection is 35 each side enabling high incrimentation sprite values to be caught\r\n x - getShipLocation(angle)[0] <= 35 &&\r\n x - getShipLocation(angle)[0] >= -35 &&\r\n y - getShipLocation(angle)[1] <= 35 &&\r\n y - getShipLocation(angle)[1] >= -35\r\n ) {\r\n // Calls crash screen when a collision is detected\r\n crashScreen();\r\n }\r\n}", "function checkCollision(){\r\n\t//check se la macchina esce dalla pista\r\n\tif(center_carr[2]<-408)vz=0;\r\n\tif(center_carr[2]>109)vz=0;\r\n\t\r\n\tif(center_carr[0]<track_dimension[1])vz=0;\r\n\tif(center_carr[0]>track_dimension[0])vz=0;\r\n\t\r\n\t//check collisione con i booster\r\n\tif((center_carr[0]<2.3 && center_carr[0]>0) && (center_carr[2]>-10 && center_carr[2]<-6)) vz=vz*1.12;\r\n\tif((center_carr[0]<0 && center_carr[0]>-2.3) && (center_carr[2]>-35 && center_carr[2]<-31)) vz=vz*1.12;\r\n\tif((center_carr[0]<0 && center_carr[0]>-2.3) && (center_carr[2]>-48 && center_carr[2]<-44)) vz=vz*1.12;\r\n\tif((center_carr[0]<6 && center_carr[0]>4) && (center_carr[2]>-161 && center_carr[2]<-157)) vz=vz*1.12;\r\n\tif((center_carr[0]<3 && center_carr[0]>0.7) && (center_carr[2]>-184 && center_carr[2]<-180)) vz=vz*1.12;\r\n\tif((center_carr[0]<5.60 && center_carr[0]>3.18) && (center_carr[2]>-240 && center_carr[2]<-236)) vz=vz*1.12;\r\n\tif((center_carr[0]<5.60 && center_carr[0]>3.18) && (center_carr[2]>-251 && center_carr[2]<-247)) vz=vz*1.12;\r\n\tif((center_carr[0]<5.60 && center_carr[0]>3.18) && (center_carr[2]>-257 && center_carr[2]<-253)) vz=vz*1.12;\r\n\tif((center_carr[0]<7 && center_carr[0]>5) && (center_carr[2]>-290 && center_carr[2]<-286)) vz=vz*1.12;\r\n\tif((center_carr[0]<6&& center_carr[0]>3.8) && (center_carr[2]>-310 && center_carr[2]<-306)) vz=vz*1.15;\r\n\tif((center_carr[0]<3.6&& center_carr[0]>1.3) && (center_carr[2]>-331 && center_carr[2]<-327)) vz=vz*1.12;\r\n\t\r\n\t//check collisione con i debooster\r\n\tif((center_carr[0]<1.15 && center_carr[0]>-0.8) && (center_carr[2]>-113 && center_carr[2]<-109)) vz=vz*0.9;\r\n\tif((center_carr[0]<6 && center_carr[0]>3.6) && (center_carr[2]>-144 && center_carr[2]<-140)) vz=vz*0.9;\r\n\tif((center_carr[0]<3.25 && center_carr[0]>0.85) && (center_carr[2]>-170 && center_carr[2]<-166)) vz=vz*0.9;\r\n\tif((center_carr[0]<6.66 && center_carr[0]>4.6) && (center_carr[2]>-203 && center_carr[2]<-199)) vz=vz*0.9;\r\n\tif((center_carr[0]<2.81 && center_carr[0]>0.93) && (center_carr[2]>-222 && center_carr[2]<-218)) vz=vz*0.9;\r\n\tif((center_carr[0]<3.25 && center_carr[0]>1) && (center_carr[2]>-277 && center_carr[2]<-281)) vz=vz*0.9;\r\n\tif((center_carr[0]<7 && center_carr[0]>5) && (center_carr[2]>-300 && center_carr[2]<-296)) vz=vz*0.9;\r\n\t\r\n}", "collide (square) {\n // calculate sides\n \n let left = this.pos.x - this.size/2;\n let right = this.pos.x + this.size/2;\n let top = this.pos.y - this.size/2;\n let bottom = this.pos.y + this.size/2;\n\n let squareLeft = square.pos.x - square.size/2;\n let squareRight = square.pos.x + square.size/2;\n let squareTop = square.pos.y - square.size/2;\n let squareBottom = square.pos.y + square.size/2;\n\n // are they even colliding?\n if (!(((right >= squareLeft && right <= squareRight) || (left >= squareLeft && left <= squareRight)) && \n ((bottom >= squareTop && bottom <= squareBottom) || (top >= squareTop && top <= squareBottom)))) \n return -1;\n \n // active edges: [left/right, top/bottom]\n let edges = [this.vel.x > 0, this.vel.y > 0];\n let squareEdges = [!edges[0], !edges[1]];\n\n // distances\n let dX = abs((squareEdges[0] ? squareRight : squareLeft) - (edges[0] ? right : left));\n let dY = abs((squareEdges[1] ? squareBottom : squareTop) - (edges[1] ? bottom : top));\n\n // time for distances\n let tX = dX / this.vel.x;\n let tY = dY / this.vel.y;\n\n // greator time is colliding longer\n return (tX > tY) ? 0 : 1;\n }", "function collision() {\n let impact = edge.NONE;\n\n if (y+size >= height) impact = edge.BOTTOM;\n if (y-size <= 0) impact = edge.TOP;\n if (x+size >= width) impact = edge.RIGHT;\n if (x-size <= 0) impact = edge.LEFT;\n\n if (impact === edge.NONE) {\n // no collision detected\n return;\n }\n\n // get correct orientation of collision (base is BOTTOM)\n let cx = 0;\n let cy = 0;\n if (impact === edge.BOTTOM) {\n cx = dx;\n cy = dy;\n } else if (impact === edge.TOP) {\n cx = -dx;\n cy = -dy;\n } else if (impact === edge.LEFT) {\n cx = dy;\n cy = -dx;\n } else if (impact === edge.RIGHT) {\n cx = -dy;\n cy = dx;\n }\n\n // get angle of impact (in [-90, 90])\n let theta = Math.abs(Math.atan2(cy, cx) / Math.PI * 180);\n if (theta > 90) theta -= 90;\n if (theta < -90) theta += 90;\n\n // make coefficient of restitution vary in [-1,1] for AOIs in [-90,90] degrees\n let ex = -(90 - theta)/90 + theta/90;\n\n // =======================================================================================================\n // calculate new velocities\n // see: https://pdfs.semanticscholar.org/5a4a/c4105406ff2055344e943093687002da8513.pdf\n cy = -ey * cy;// - (1 + ey)*sy;\n cx = ((1 - alpha*ex) / (1 + alpha)) * cx + alpha * (1 + ex) / (1 + alpha) * ((size/scale) * dr);\n dr = ((alpha - ex) / (1 + alpha)) * dr + (1 + ex) / (1 + alpha) * (cx/scale) / (size/scale);\n // =======================================================================================================\n\n // reverse orientation\n if (impact === edge.BOTTOM) {\n dx = cx;\n dy = cy;\n } else if (impact === edge.TOP) {\n dx = -cx;\n dy = -cy;\n } else if (impact === edge.LEFT) {\n dx = -cy;\n dy = cx;\n } else if (impact === edge.RIGHT) {\n dx = cy;\n dy = -cx;\n }\n}", "checkCollision (playerPosition) {\n /*\n if (playerPosition[0] > this.position[0][0] && playerPosition[0] < this.position[0][1]) {\n if (playerPosition[1] > this.position[1][0] && playerPosition[1] < this.position[1][1]) {\n gameVar.gotGift = false;\n gameVar.checkCollision = false;\n gameVar.gotHit();\n }\n }\n */\n\n let er = 0;\n let ec = 0;\n let pr = 0;\n let pc = 0;\n\n /* player x position */\n if(player.x < 100){ pc = 0; }\n if(player.x >= 100 && player.x < 200){ pc = 1; } \n if(player.x >= 200 && player.x < 300){ pc = 2; }\n if(player.x >= 300 && player.x < 400){ pc = 3; }\n if(player.x >= 400){ pc = 4; }\n\n /* player y position */\n if(player.y < 72) { pr = 0; } \n if(player.y >= 72 && player.y < 154) { pr = 1; } \n if(player.y >= 154 && player.y < 236) { pr = 2; } \n if(player.y >= 236 && player.y < 318) { pr = 3; } \n if(player.y >= 318 && player.y < 400) { pr = 4; } \n if(player.y >= 400) { pr = 5; } \n\n /* enemy car x position + 10 buffer for easyer gameplay */\n if(this.x < -100){ ec = -1; }\n if(this.x >= -100 && this.x < 0){ ec = 0; } \n if(this.x >= 0 && this.x < 100){ ec = 1; } \n if(this.x >= 100 && this.x < 200){ ec = 2; }\n if(this.x >= 200 && this.x < 300){ ec = 3; }\n if(this.x >= 300 && this.x < 400){ ec = 4; }\n if(this.x >= 400){ ec = 5; }\n\n /* enemy car y position */\n if(this.y < 63) { er = 0; } \n if(this.y >= 63 && this.y < 143) { er = 1; } \n if(this.y >= 143 && this.y < 223) { er = 2; } \n if(this.y >= 223 && this.y < 303) { er = 3; } \n if(this.y >= 303 && this.y < 383) { er = 4; } \n if(this.y >= 383) { er = 5; } \n/*\n if (ec == 2) { \n alert(this.x.toString()); \n }\n*/\n if ((pc == ec) && (pr == er)) {\n gameVar.gotGift = false;\n gameVar.checkCollision = false;\n gameVar.gotHit();\n }\n }", "onCollision(response, other) {\n // Make all other objects solid\n return true;\n }", "onCollision(response, other) {\n // Make all other objects solid\n return true;\n }", "function collision(obj1, obj2){\n\tif (obj1.x > obj2.x + obj2.width || obj1.x + obj1.width < obj2.x || obj1.y+obj1.height > obj2.y + obj2.height || obj1.y + obj1.height < obj2.y){\n\t\t\n\t} else {\n\t\tif (!collidesArr.includes(obj2.value)){\n\t\t\tcollidesArr.push(obj2.value)\n\t\t\tif (collidesArr.length === 2)\n\t\t\t\tcheckOrderForTwo(collidesArr)\n\t\t\tif (collidesArr.length === 3)\n\t\t\t\tcheckOrder(collidesArr)\n\t\t\t}\n\t\t}\n\t\t// console.log(`collides with ${obj2.name}`)\n\t\tconsole.log(collidesArr)\n\t}", "collisionDetector() {\n allEnemies.forEach(function (enemy){\n if (player.x < enemy.x + 80 &&\n player.x + 80 > enemy.x &&\n player.y < enemy.y + 60 &&\n 60 + player.y > enemy.y) {\n collision();\n }\n });\n }", "wallCollision() {\n const hitLeft = this.x - this.radius <= 0;\n const hitRight = this.x + this.radius >= this.boardWidth;\n const hitTop = this.y - this.radius <= 0;\n const hitBottom = this.y + this.radius >= this.boardHeight;\n\n if (hitLeft || hitRight) {\n this.vx = -this.vx;\n \n } else if (hitTop || hitBottom) {\n this.vy = -this.vy;\n \n }\n\n }", "function checkCollision (obj1,obj2){\n return obj1.y + obj1.height - 10 >= obj2.y\n && obj1.y <= obj2.y + obj2.height\n && obj1.x + obj1.width - 10 >= obj2.x\n && obj1.x <= obj2.x + obj2.width\n }", "function collides(a, b) {\n \treturn \ta.getx() < b.getx() + b.getwidth() &&\n \ta.getx() + a.getwidth() > b.getx() &&\n \ta.gety() < b.gety() + b.getheight() &&\n \ta.gety() + a.getheight() > b.gety();\n }", "function compute_collision() {\n for (var i = 0; i < elements.length; i++) {\n // Compute collision with wall\n if ((elements[i].object.x\n - elements[i].center.x) <= 0) {\n elements[i].speed.x = \n Math.abs(elements[i].speed.x);\n elements[i].real_coord.x = \n elements[i].object.x = \n elements[i].center.x + 1;\n }\n else if ((elements[i].object.x + \n elements[i].center.x) >= world_width) {\n elements[i].speed.x = \n - Math.abs(elements[i].speed.x);\n elements[i].real_coord.x = \n elements[i].object.x = \n world_width - elements[i].center.x - 1;\n }\n if ((elements[i].object.y\n - elements[i].center.y) <= 0) {\n elements[i].speed.y = \n Math.abs(elements[i].speed.y);\n elements[i].real_coord.y = \n elements[i].object.y = \n elements[i].center.y + 1;\n }\n else if((elements[i].object.y + \n elements[i].center.y) >= world_height) {\n elements[i].speed.y = \n - Math.abs(elements[i].speed.y);\n elements[i].real_coord.y = \n elements[i].object.y =\n world_height - elements[i].center.y - 1;\n }\n }\n }", "collisionDetection(){ \n for(let i = 0; i < allEnemies.length; i++){\n //Improved collision detection method assistance provided by Lip Permana during one-on-one session 8.19.18\n if(allEnemies[i].x + allEnemies[i].width >= this.x &&\n allEnemies[i].x <= this.x + this.width &&\n allEnemies[i].y + allEnemies[i].height >= this.y &&\n allEnemies[i].y <= this.y + this.height){ \n console.log(\"collision\"); //for testing\n this.restartGame()\n } \n }\n }", "function criminalCollision() {\r\n\r\n for (i = 0; i < bullet.length; i++) {\r\n var distXCrime = Math.abs(bullet[i].x - eX - 45 / 2);\r\n var distYCrime = Math.abs(bullet[i].y - eY - 45 / 2);\r\n\r\n //no collision\r\n if (distXCrime > (25 / 2 + 20)) {\r\n continue;\r\n }\r\n if (distYCrime > (25 / 2 + 20)) {\r\n continue;\r\n }\r\n\r\n //collision\r\n if (distXCrime <= (25 / 2)) {\r\n return true;\r\n }\r\n if (distYCrime <= (25 / 2)) {\r\n return true;\r\n }\r\n\r\n //Initially was a colision algrothim for circle-rectangle, this part still worked though so kept\r\n var dx=distXCrime-25/2;\r\n var dy=distYCrime-25/2;\r\n if (dx*dx+dy*dy<=(20*20)){\r\n return true;\r\n }\r\n }\r\n}", "_detectCollision () {\n let doContinue = true\n app.needleSelection.getNeedles().each(d => {\n if (d.passed) return\n const mm = app.getMmByLevel(app.ctx.level)\n const fromY = d.y + constant.NEEDLE_HOLE_DY\n const toY = fromY + mm\n const thread = app.threadDS\n if (thread.cx >= d.x) {\n if (fromY <= thread.cy - thread.r && thread.cy + thread.r <= toY) { // Passed\n app.statusTextScore++\n app.ctx.level = this._calcLevelByScore(app.statusTextScore) // May Lv. Up\n d.passed = true\n } else { // Failed\n doContinue = false\n }\n }\n })\n return doContinue\n }", "collide(obstacles) {\n for (let obstacle of obstacles) {\n // Rectangle enlarged by this.radius for easier calculation of collision.\n const boundingBox = new RectangularObstacle(\n new Vec2D(obstacle.pos.x - this.radius, obstacle.pos.y - this.radius),\n new Vec2D(obstacle.dim.x + 2 * this.radius, obstacle.dim.y + 2 * this.radius)\n );\n\n // Needed for deciding in which direction to reflect.\n const boundingBoxCenter = boundingBox.pos.add(boundingBox.dim.divide(2));\n const ratio = boundingBox.dim.x / boundingBox.dim.y;\n const vecToCenter = this.pos.subtract(boundingBoxCenter);\n\n if (boundingBox.hasInside(this.pos)) {\n if (Math.abs(vecToCenter.x) > ratio * Math.abs(vecToCenter.y)) {\n this.vel.x *= -1;\n } else {\n this.vel.y *= -1;\n }\n while (boundingBox.hasInside(this.pos)) {\n this.pos = this.pos.add(this.vel);\n }\n }\n }\n }", "function collisionDetection() {\n\tfor(c=0; c<brickColumnCount; c++) {\n\t\tfor(r=0; r<brickRowCount; r++) {\n\t\t\tvar b = bricks[c][r];\n\t\t\t// Calculate\n\t\t\tif(b.status == 1) {\n\t\t\t\tif(x > b.x && x < b.x+brickWidth && y > b.y && y < b.y+brickHeight) {\n\t\t\t\t\tdy = -dy;\n\t\t\t\t\tb.status = 0;\n\t\t\t\t\tscore++;\n\t\t\t\t\tif(score == brickRowCount*brickColumnCount) {\n\t\t\t\t\t\t// Too annoying to keep atm: alert(\"YOU WIN, CONGRATULATIONS!\"); \n\t\t\t\t\t\tclearInterval(id);\n\t\t\t\t\t\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function detectCollisionForCircles(obj1,obj2){\n\t\n\tvar xmov1 = obj1.move_x;\n\tvar ymov1 = obj1.move_z;\n\tvar xmov2 = obj2.move_x;\n\tvar ymov2 = obj2.move_z;\n\t\n\tvar xl1=obj1.position.x;\n var yl1=obj1.position.z;\n\tvar xl2=obj2.position.x;\n\tvar yl2=obj2.position.z;\n\tvar R = obj1.radius + obj2.radius;\n\tvar a =-2*xmov1*xmov2+xmov1*xmov1+xmov2*xmov2;\n\tvar b =-2*xl1*xmov2-2*xl2*xmov1+2*xl1*xmov1+2*xl2*xmov2;\n\tvar c =-2*xl1*xl2+xl1*xl1+xl2*xl2;\n\tvar d =-2*ymov1*ymov2+ymov1*ymov1+ymov2*ymov2;\n\tvar e =-2*yl1*ymov2-2*yl2*ymov1+2*yl1*ymov1+2*yl2*ymov2;\n\tvar f =-2*yl1*yl2+yl1*yl1+yl2*yl2;\n\tvar g =a+d;\n\tvar h =b+e;\n\tvar k =c+f-R*R;\n\t\t\t\n\tvar sqRoot =Math.sqrt(h*h-4*g*k);\n\tvar t1 =(-h+sqRoot)/(2*g);\n\tvar t2 =(-h-sqRoot)/(2*g);\n\t\n\t /* if (t1>0 &&t1<=1){\n\t\t var whatTime =t1;\n\t\t\tvar ballsCollided =true;\n\t\t\talert(\"t1=\"+whatTime);\n\t } */\n\t\tif (t2>0 &&t2<=1){\n\t\t if (whatTime ==0 ||t2<t1){\n \t\tvar\twhatTime =t2;\n\t\t\t\tvar\tballsCollided =true;\n\t\t }\n\t\t}\n\t\tif (ballsCollided){\n\t\t\t\n\t\t\tball2BallReaction(obj1,obj2,xl1,xl2,yl1,yl2,whatTime)\n\t\t\t\tballsCollided=false;\n\t\t\t\twhatTime=0;\n\t\t\t}\n\t\t\t\t\n}", "detectCollisions() {\r\n var origin = this.carGroup.position.clone();\r\n\r\n var vMax = this.carGroup.children[0].children[0].geometry.vertices.length;\r\n for (var v = 0; v < vMax; v += 1) {\r\n var localVertex = this.carGroup.children[0].children[0].geometry.vertices[v].clone();\r\n var globalVertex = localVertex.applyMatrix4(this.carGroup.children[0].children[0].matrix);\r\n var directionVector = globalVertex.sub(this.carGroup.children[0].children[0].position);\r\n\r\n var ray = new THREE.Raycaster(origin, directionVector.clone().normalize());\r\n var intersections = ray.intersectObjects(this.collidables, true);\r\n if (intersections.length > 0 &&\r\n intersections[0].distance < directionVector.length()) {\r\n console.log(\"collision\");\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "function collide(A, B) {\n if ( A.x < B.x + CAR_WIDTH && A.x + CAR_WIDTH > B.x &&\n A.y < B.y + CAR_HEIGHT && A.y + CAR_HEIGHT > B.y ) {\n if ( DEBUG ) {\n console.log(\"Colision entre deux véhicules\");\n }\n return true;\n }\n return false;\n}", "function collides(a, b) {\n if(a.x == b.x && a.y == b.y) return true;\n return false;\n }", "check_collision() {\n const rtx = this.x + 4;\n const rty = this.y + 59;\n const rpx = player.x + 31;\n const rpy = player.y + 57;\n if (rtx < rpx + player.width - 5 &&\n rpx < rtx + this.width - 5 &&\n rty < rpy + player.height - 15 &&\n rpy < rty + this.height - 15) {\n // Reset the game when collision happens\n allEnemies = [new Enemy(), new Enemy(), new Enemy()];\n player = new Player();\n }\n }", "isCollision(driverX, driverY) {\n let collission = false;\n this.barries.forEach((bar) => {\n if (\n driverX < bar.x + bar.img.width &&\n driverX + this.driverW > bar.x &&\n driverY + 50 < bar.y + bar.img.height &&\n driverY + this.driverH > bar.y + 20\n ) {\n collission = true;\n }\n });\n return collission;\n }", "collision(item) {\n let itemWidth;\n let itemHeight;\n\n // Gets the width and height of the collectible\n Object.keys(collectibleSprites).forEach((key) => {\n if (collectibleSprites[key].src == item.src) {\n itemWidth = collectibleSprites[key].width;\n itemHeight = collectibleSprites[key].height;\n }\n });\n\n if (this.x == item.x && this.y == item.y) return true;\n\n // Contains all sides (from top left to bottom right) of the avatar\n const avatarSides = {\n left: {\n x: this.x,\n y: this.y,\n },\n right: {\n x: this.x + playerSprites.width,\n y: this.y + playerSprites.height,\n },\n };\n\n // Contains all sides (from top left to bottom right) of the collectible sprite\n const itemSides = {\n left: {\n x: item.x,\n y: item.y,\n },\n right: {\n x: item.x + itemWidth,\n y: item.y + itemHeight,\n },\n };\n\n // Checks if the player sprite intersected with the item\n if (\n avatarSides.left.x < itemSides.right.x &&\n itemSides.left.x < avatarSides.right.x &&\n avatarSides.right.y > itemSides.left.y &&\n itemSides.right.y > avatarSides.left.y\n ) {\n return true;\n }\n\n return false;\n }", "function collision(top_x, bottom_x, top_y, bottom_y) {\n\t\tfor (var i = 0; i < rows; i++) {\n\t\t\tfor (var j = 0; j < cols; j++) {\n\t\t\t\tvar b = bricks[j][i];\n\t\t\t\tif (b.exists == 1) {\n\t\t\t\t\tif (top_y < (b.y + block_height) && bottom_y > b.y && top_x < (b.x + block_width) && bottom_x > b.x) {\n\t\t\t\t\t\tb.exists = 0;\n\t\t\t\t\t\tball.y_speed = -ball.y_speed;\n\t\t\t\t\t\tplayer1Score += 1;\n\t\t\t\t\t\tbrickcount -= 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "collides(box) {\n if(box instanceof Rectangle) {\n box = [...box];\n box[2] = Math.ceil((box[0] + box[2]) / this.tw);\n box[3] = Math.ceil((box[1] + box[3]) / this.th);\n box[0] = Math.floor(box[0] / this.tw);\n box[1] = Math.floor(box[1] / this.th);\n } else if(box instanceof Circle) {\n const {x, y, r} = box;\n box[0] = Math.floor(x - r);\n box[1] = Math.floor(y - r);\n box[2] = Math.ceil(x + r);\n box[3] = Math.ceil(y + r);\n }\n for(let i = box[0]; i < box[2]; ++i) {\n for(let j = box[1]; j < box[3]; ++j) {\n if(this[COLLISIONS][j] && this[COLLISIONS][j][i]) { return true; }\n }\n }\n return false;\n }", "function checkCollision(a, b) {\n if (a !== undefined && b !== undefined) {\n var aRad = (a.a + a.b + a.c) / 3;\n var bRad = (b.a + b.b + b.c) / 3;\n var aPos = vec3.create();\n\n vec3.add(aPos, a.center, a.translation);\n var bPos = vec3.create();\n vec3.add(bPos, b.center, b.translation);\n var dist = vec3.distance(aPos, bPos);\n\n if (dist < aRad + bRad) {\n //spawn explosion and destroy asteroid, doesn't matter what asteroid collided with, always explodes\n generateExplosion(vec3.add(vec3.create(), vec3.fromValues(a.x, a.y, a.z),\n vec3.fromValues(a.translation[0], a.translation[1], a.translation[2])), false);\n deleteModel(a);\n //handle collision\n if (b.tag == 'shot') {\n // destroy asteroid and shot, give player points\n //test *******apocalypse = true;\n //test *******gameOver(b);\n deleteModel(b);\n score += 10;\n document.getElementById(\"score\").innerHTML = \"Score: \" + score;\n } else if (b.tag == 'station') {\n // destroy asteroid, damage station and destroy if life < 0 then weaken shield\n // if last station destroyed, destroy shield as wells\n b.health -= 5;\n if (b.css == 'station1') {\n document.getElementById(\"station1\").innerHTML = \"Station Alpha: \" + b.health;\n } else if (b.css == 'station2') {\n document.getElementById(\"station2\").innerHTML = \"Station Bravo: \" + b.health;\n } else {\n document.getElementById(\"station3\").innerHTML = \"Station Charlie: \" + b.health;\n }\n if (b.health == 0) {\n var change = false;\n base_limit--;\n // reduce shield alpha by one to signify weakening\n for (var o in inputEllipsoids) {\n if (inputEllipsoids[o].tag == 'shield') {\n inputEllipsoids[o].alpha -= 0.2;\n }\n }\n // if the destroyed center is highlighted, switch to next\n if (b.id == current_center) {\n for (var s in stations) {\n if (stations[s].id > b.id) {\n stations[s].id--;\n }\n }\n change = true;\n }\n // remove the destroyed station\n station_centers.splice(b.id, 1);\n deleteModel(b);\n // has to be after splice/delete or else will access out of date station_centers\n if (change) {\n current_center++;\n changeStation();\n }\n shield_level--;\n document.getElementById(\"shield\").innerHTML = \"Shield: \" + shield_level;\n // destroy shield if no more stations\n if (shield_level == 0) {\n for (var o in inputEllipsoids) {\n if (inputEllipsoids[o].tag == 'shield') {\n deleteModel(inputEllipsoids[o]);\n break;\n }\n }\n deleteModel(highlight);\n }\n if (b.css == 'station1') {\n document.getElementById(\"station1charge\").innerHTML = \"Destroyed!\";\n document.getElementById(\"station1\").innerHTML = \"Station Alpha:\"\n } else if (b.css == 'station2') {\n document.getElementById(\"station2charge\").innerHTML = \"Destroyed!\";\n document.getElementById(\"station2\").innerHTML = \"Station Bravo:\"\n } else {\n document.getElementById(\"station3charge\").innerHTML = \"Destroyed!\";\n document.getElementById(\"station3\").innerHTML = \"Station Charlie:\"\n }\n }\n } else if (b.tag == 'shield') {\n // destroy asteroid, damage earth based on shield strength\n earth_health -= 15 / shield_level;\n document.getElementById(\"earth\").innerHTML = \"Earth: \" + earth_health;\n if (earth_health <= 0) {\n for (var o in inputEllipsoids) {\n if (inputEllipsoids[o].tag == 'earth') {\n // handle game over\n gameOver(inputEllipsoids[o]);\n break;\n }\n }\n }\n } else if (b.tag == 'earth') {\n // destroy asteroid, damage earth and destroy if life < 0\n earth_health -= 15;\n document.getElementById(\"earth\").innerHTML = \"Earth: \" + earth_health;\n if (earth_health <= 0) {\n // handle game over\n gameOver(b);\n }\n } else if (b.tag == 'moon') {\n b.health -= 5;\n if (b.health <= 0) {\n generateExplosion(vec3.add(vec3.create(), vec3.fromValues(b.x, b.y, b.z),\n vec3.fromValues(b.translation[0], b.translation[1], b.translation[2])), true);\n deleteModel(b);\n }\n }\n }\n }\n}", "function checkCollisions(playerX, playerY, playerW, playerH, enemyX, enemyY, enemyW, enemyH) {\n // Minimize the edges of the objects\n const minTop = 3;\n const minBottom = 15;\n // Player Corner Points\n const pointA = [playerX + minTop, playerY + minTop];\n const pointB = [playerX + playerW - minTop, playerY + minTop];\n const pointC = [playerX + minTop, playerY + playerH - minBottom];\n const pointD = [playerX + playerW - minTop, playerY - minBottom + playerH];\n\n // Enemy Corner Points\n const pointE = [enemyX , enemyY ];\n const pointF = [enemyX + enemyW , enemyY ];\n const pointG = [enemyX , enemyY + enemyH ];\n const pointH = [enemyX + enemyW, enemyY + enemyH];\n\n /*\n * check each point if its position (x,y) found in the other object.\n * CASE #1\n * if A(x) is between E(x)-F(x) AND A(y) between E(y)-G(y)\n \n E__________F\n | |\n | (A)___|____B\n | | | |\n |_____|____| |\n G | H |\n |_________|\n C D\n */\n if ((pointE[0] <= pointA[0] && pointF[0] >= pointA[0]) && (pointE[1] <= pointA[1] && pointG[1] >= pointA[1])) {\n return true;\n }\n /* \n * CASE #2\n * if B(x) is between E(x)-F(x) AND B(y) between E(y)-G(y)\n\n E__________F\n | |\n A____|____(B) |\n | | | |\n | |_____|____|\n | G | H\n |_____ ____| \n C D \n */\n if ((pointE[0] <= pointB[0] && pointF[0] >= pointB[0]) && (pointE[1] <= pointB[1] && pointG[1] >= pointB[1])) {\n return true;\n }\n /* \n * CASE #3\n * if C(x) is between E(x)-F(x) AND C(y) between E(y)-G(y)\n\n A__________B\n | |\n E____|_____F |\n | | | |\n | |_____|____|\n | (C) | D\n |_____ ____| \n G H \n \n */\n if ((pointE[0] <= pointC[0] && pointF[0] >= pointC[0]) && (pointE[1] <= pointC[1] && pointG[1] >= pointC[1])) {\n return true;\n }\n /*\n * CASE #4\n * if D(x) is between E(x)-F(x) AND D(y) between E(y)-G(y)\n\n A__________B\n | |\n | E____|____F\n | | | |\n |_____|____| |\n C | (D) |\n |_________|\n D H\n */\n if ((pointE[0] <= pointD[0] && pointF[0] >= pointD[0]) && (pointE[1] <= pointD[1] && pointG[1] >= pointD[1])) {\n return true;\n }\n /* \n * CASE #5\n * if E(x) is between A(x)-B(x) AND E(y) between A(y)-B(y)\n \n A__________B\n | |\n | (E)___|____F\n | | | |\n |_____|____| |\n C | D |\n |_________|\n G H\n \n */\n if ((pointA[0] <= pointE[0] && pointB[0] >= pointE[0]) && (pointA[1] <= pointE[1] && pointC[1] >= pointE[1])) {\n return true;\n }\n /* \n * CASE #6\n * if F(x) is between A(x)-B(x) AND F(y) between A(y)-B(y)\n\n A__________B\n | |\n E____|____(F) |\n | | | |\n | |_____|____|\n | C | D\n |_____ ____| \n G H \n */\n if ((pointA[0] <= pointF[0] && pointB[0] >= pointF[0]) && (pointA[1] <= pointF[1] && pointC[1] >= pointF[1])) {\n return true;\n }\n /* \n * CASE #7\n * if G(x) is between A(x)-B(x) AND G(y) between A(y)-B(y)\n\n E__________F\n | |\n A____|_____B |\n | | | |\n | |_____|____|\n | (G) | H\n |__________| \n C D \n */\n if ((pointA[0] <= pointG[0] && pointB[0] >= pointG[0]) && (pointA[1] <= pointG[1] && pointC[1] >= pointG[1])) {\n return true;\n }\n /*\n * CASE #8\n * if H(x) is between A(x)-B(x) AND H(y) between A(y)-B(y)\n\n E__________F\n | |\n | A____|____B\n | | | |\n |_____|____| |\n G | (H) |\n |_________|\n C D\n */\n if ((pointA[0] <= pointH[0] && pointB[0] >= pointH[0]) && (pointA[1] <= pointH[1] && pointC[1] >= pointH[1])) {\n return true;\n }\n return false;\n }", "narrowDetection(posx1, posy1, posx2, posy2) {\n let circle1 = {radius: 10, x: posx1, y: posy1};\n let circle2 = {radius: 10, x: posx2, y: posy2};\n\n let dx = circle1.x - circle2.x;\n let dy = circle1.y - circle2.y;\n let distance = Math.sqrt(dx * dx + dy * dy);\n\n if (distance < circle1.radius + circle2.radius) {\n // collision detected!\n }\n }", "collision(inObject) {\n\n // Abort if the player isn't visible (i.e., when they are 'splodin).\n if (!this.player.isVisible || !inObject.isVisible) { return false; }\n\n // Bounding boxes.\n const left1 = this.player.xLoc;\n const left2 = inObject.xLoc;\n const right1 = left1 + this.player.pixWidth;\n const right2 = left2 + inObject.pixWidth;\n const top1 = this.player.yLoc;\n const top2 = inObject.yLoc;\n const bottom1 = top1 + this.player.pixHeight;\n const bottom2 = top2 + inObject.pixHeight;\n\n // Bounding box checks. It isn't perfect collision detection, but it's good\n // enough for government work.\n if (bottom1 < top2) {\n return false;\n }\n if (top1 > bottom2) {\n return false;\n }\n if (right1 < left2) {\n return false;\n }\n return left1 <= right2;\n\n }", "function collision (first, second){\n const w = (first.width + second.width) / 2;\n const h = (first.height + second.height) / 2;\n const dx = Math.abs(first.x - second.x);\n const dy = Math.abs(first.y - second.y);\n if (dx <= w && dy <= h){\n const wy = w * (first.y - second.y);\n const hx = h * (first.x - second.x);\n if (wy > hx){\n if (wy > -hx){\n stopUp = true;\n // console.log('collision: up');\n return true;\n } else {\n stopRight = true;\n // console.log('collision: right');\n return true;\n }\n }else{\n if (wy > -hx){\n stopLeft = true;\n // console.log('collision: left');\n return true;\n } else {\n stopDown = true;\n // console.log('collision: down');\n return true;\n };\n };\n }else{\n stopUp = false;\n stopRight = false;\n stopDown = false;\n stopLeft = false;\n return false;\n };\n}", "function isColliding(a, b) {\n return a.left < b.right && a.right > b.left && a.top < b.bottom && a.bottom > b.top;\n}", "function collisionDetect(balls) {\r\n var i,j,d,a,b;\r\n for(i=0;i<balls.length-1;i++)\r\n {\r\n for(j=i+1;j<balls.length;j++) \r\n { a = balls[i].x - balls[j].x;\r\n b = balls[i].y - balls[j].y;\r\n d=Math.sqrt(a*a+b*b);\r\n if(d<=balls[i].size+balls[j].size)\r\n \t\t {\r\n \t\t\t //reverse ball one\r\n \t\t\t balls[i].velX = -balls[i].velX;\r\n \t\t\t balls[i].velY= -balls[i].velY;\r\n \r\n \t\t\t //reverse ball two\r\n \t\t\t balls[j].velX = -balls[j].velX;\r\n \t\t\t balls[j].velY = -balls[j].velY;\r\n \t\t }\r\n \r\n }\r\n }\r\n \r\n}", "function ICollision(){\r\n\t\t//remember an intersection doesnt always happen point to point, it could be full wall to wall!\r\n\t\tthis.point;\r\n\t\t//how far they were inside eachother\r\n\t\tthis.insideDistance;\r\n\t\tthis.normal;\r\n\t\tthis.actors;\r\n\t\t//intended to match the combined collision speeds, can be used for e.g. how loud the sound is, how much particle effect\r\n\t\tthis.volume;\r\n\t}", "function collide(o1T, o1B, o1L, o1R, o2T, o2B, o2L, o2R) {\n\tif ((o1L <= o2R && o1L >= o2L) || (o1R >= o2L && o1R <= o2R)) {\n\t\tif ((o1T >= o2T && o1T <= o2B) || (o1B >= o2T && o1B <= o2B)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}", "function detectCollision() {\n\tvar x, z;\n if (controls.moveLeft) z = -1;\n if (controls.moveRight) z = 1;\n if (controls.moveBackward) x = -1;\n if (controls.moveForward) x = 1;\n\n var vector = new THREE.Vector3( x, 0, z );\n var ray = new THREE.Ray(controls.object.position, vector);\n var intersects = ray.intersectObjects(scene.children);\n\n if (intersects.length > 0) {\n \tconsole.log(controls);\n if (z == -1) controls.moveLeft = false;\n if (z == 1) controls.moveRight = false;\n if (x == -1) controls.moveBackward = false;\n if (x == 1) controls.moveForward = false;\n }\n}", "function detectCollision(x1, y1, r1, x2, y2, r2) {\n var dist2 = ((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n if (dist2 <= ((r2 + r1) * (r2 + r1)))\n return true;\n return false;\n}", "checkCollision (obj) {\n if (this.x < obj.x + obj.width\n && this.x + this.width > obj.x\n && this.y < obj.y + obj.height\n && this.y + this.height > obj.y) {\n obj.resetPosition();\n }\n }", "collision() {\n\t\tthis.vars.collision = true;\n\t}", "function collision(target1, target2) {\n return (target1.x > target2.x - 20 && target1.x < target2.x + 20) &&\n (target1.y > target2.y - 20 && target1.y < target2.y + 20);\n}", "collidesWith(player) {\n //this function returns true if the the rectangles overlap\n // console.log('this.collidesWith')\n const _overlap = (platform, object) => {\n // console.log('_overlap')\n // check that they don't overlap in the x axis\n const objLeftOnPlat = object.left <= platform.right && object.left >= platform.left;\n const objRightOnPlat = object.right <= platform.right && object.right >= platform.left;\n const objBotOnPlatTop = Math.abs(platform.top - object.bottom) === 0;\n \n // console.log(\"OBJECT BOTTOM: \", object.bottom/);\n // console.log(\"PLATFORM TOP: \", platform.top);\n // console.log('objectBotOnPlat: ', !objBotOnPlatTop)\n // console.log('OBJECT RIGHT: ', object.right)\n // console.log('PLATFORM RIGHT: ', platform.right)\n // console.log(\"OBJECT LEFT: \", object.left);\n // console.log(\"PLATFORM LEFT: \", platform.left);\n // console.log('objectLeftOnPlat', !objLeftOnPlat);\n // console.log('objRightOnPlat', !objRightOnPlat);\n\n if (!objLeftOnPlat && !objRightOnPlat) {\n // if (player.y < 400) { \n // debugger\n // }\n return false;\n // if (objBotOnPlatTop) return true;\n // return false;\n }\n \n if (objLeftOnPlat || objRightOnPlat) {\n // debugger\n // console.log('PLATFORM:::::', platform.top)\n // console.log('PLAYER:::::::', object.bottom)\n // console.log('objBotOnPlat:::::::::', objBotOnPlatTop)\n\n if (objBotOnPlatTop) {\n debugger\n }\n }\n //check that they don't overlap in the y axis\n const objTopAbovePlatBot = object.top > platform.bottom;\n if (!objBotOnPlatTop) {\n // console.log()\n // if (player.y < 400) { \n // debugger\n // }\n return false;\n }\n\n return true;\n };\n\n let collision = false;\n this.eachPlatform(platform => {\n //check if the bird is overlapping (colliding) with either platform\n if (_overlap(platform, player.bounds())) {\n // console.log('WE ARE HERE IN THE OVERLAP')\n // console.log(platform)\n collision = true;\n // debugger\n // console.log(player)\n player.y = platform.top;\n // console.log('PLATFORM: ', platform)\n // console.log(collision)\n // player.movePlayer(\"up\")\n }\n // _overlap(platform.bottomPlatform, player)\n });\n\n // console.log('collision:')\n // console.log(collision)\n return collision;\n }", "function collision_check(a,b) {\n let res = (Math.abs(a.x-b.x) * 2 < (16+8)) &&\n (Math.abs(a.y-b.y) * 2< (16+8))\n return res;\n}", "function is_collision()\n{\n\tif (frog.lane > 6 && frog.lane < 12) {\n\t\tvar lane = frog.lane - 7;\n\t\tfor (car in cars[lane].x) {\n\t\t\tif (frog.x + frog.w >= cars[lane].x[car] &&\n\t\t\t\tfrog.x <= cars[lane].x[car] + cars[lane].w) {\n\t\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t}\n\treturn 0;\n}", "colisionCheck(object, player) {\n if ((player.x-10)+ player.width < object.x ||(object.x-10) + object.width < player.x){\n return false;\n }\n if ((player.y+20) > object.y + object.height || object.y+30 > player.y + player.height) {\n return false;\n }\n return true; \n }", "function basicCollision(){\n if(this.x + this.xLen > canvas.width){\n this.xSpeed = -1 * this.xSpeed;\n this.x = canvas.width - this.xLen;\n }\n if(this.x < 0){\n this.xSpeed = -1 * this.xSpeed;\n this.x = 0;\n }\n if(this.y + this.yLen > canvas.height){\n this.ySpeed = -1 * this.ySpeed;\n this.y = canvas.height - this.yLen;\n }\n if(this.y < 0){\n this.ySpeed = -1 * this.ySpeed;\n this.y = 0;\n }\n}", "function bodyCollision() {\n\tvar headID = segments[segments.length - 1].ID;\n\tvar headTop = $(headID).position().top;\n\tvar headLeft = $(headID).position().left;\n\tvar segmentID;\n\tvar segmentTop;\n\tvar segmentLeft;\n\n\tfor (i = 0; i < segments.length - 2; i++) {\n\t\tsegmentID = segments[i].ID;\n\t\tsegmentTop = $(segmentID).position().top;\n\t\tsegmentLeft = $(segmentID).position().left;\n\t\tif ((headTop === segmentTop) && (headLeft === segmentLeft)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "detectCollison(e, delta_t) {\n let next = this.vel.clone().multiplyScalar(delta_t);\n if (this.right() + next.x > e.left() && this.left() + next.x < e.right()\n && this.bottom() > e.top() && this.top() < e.bottom())\n {\n if (next.x > 0){\n return new THREE.Vector3(-1, 0);\n } else{\n return new THREE.Vector3(1, 0);\n }\n }\n if (this.right() > e.left() && this.left() < e.right()) {\n if( this.bottom() + next.y > e.top() && this.top() + next.y < e.bottom())\n {\n if (next.y > 0) {\n this._isJumping = false;\n return new THREE.Vector3(0, 1);\n } else { \n return new THREE.Vector3(0, -1);\n }\n }\n }\n\n return undefined;\n }", "function collides(a, b) {\n return (\n a.x < b.x + pipeWidth &&\n a.x + a.width > b.x &&\n a.y < b.y + b.height &&\n a.y + a.height > b.y\n );\n}", "collide(other) {\n\t\tlet al = this.x + this.hitbox.x \n\t\tlet au = this.y + this.hitbox.y\n\t\tlet ar = al + this.hitbox.w\n\t\tlet ad = au + this.hitbox.h\n\t\tlet bl = other.x + other.hitbox.x \n\t\tlet bu = other.y + other.hitbox.y\n\t\tlet br = bl + other.hitbox.w\n\t\tlet bd = bu + other.hitbox.h\n\t\treturn ar > bl && al < br && ad > bu && au < bd\n\t}", "function checkCollision() {\n // enemies with layout\n game.activeEnemies.forEach(function(enemy) {\n enemy.x = enemy.x>game.canvas[0].width?enemy.cleanUp():enemy.x;\n enemy.x = enemy.x<-75?enemy.cleanUp():enemy.x;\n // enemies with hero\n if ((enemy.x>=hero.x-20&&enemy.x<hero.x+40)&&(enemy.y>=hero.y-50&&enemy.y<hero.y+50)) {\n hero.reset(190,500);\n game.tries++;\n }\n });\n // hero with layout\n hero.x = hero.x>(game.canvas[0].width-100)?(game.canvas[0].width-100):hero.x;\n hero.x = hero.x<0?0:hero.x;\n hero.y = hero.y>game.canvas[0].height-150?(game.canvas[0].height-150):hero.y;\n hero.y = hero.y<150?150:hero.y;\n if (hero.x>=hero2.x&&hero.y<=hero2.y) {\n game.medal = true;\n game.stop();\n end();\n }\n }", "function collision(ObjectX, ObjectY){\n var x1, y1, x2, y2; //ObjectX vertices\n var w1, z1, w2, z2; //ObjectY vertices\n \n /* Identifying player object. this object has difference on center position and sprite position.\n It is adjusted by method updateCenter() from Player Object. */\n if(typeof ObjectX.updateCenter === 'function' && \n typeof ObjectY.updateCenter === 'function') { //Player/Enemy objects founded\n /* Setting up ObjectX vertices */\n x1 = (ObjectX.centerx - ObjectX.collisionsize);\n y1 = (ObjectX.centery - ObjectX.collisionsize);\n x2 = (ObjectX.centerx + ObjectX.collisionsize);\n y2 = (ObjectX.centery + ObjectX.collisionsize);\n \n /* Setting up ObjectY vertices */\n w1 = (ObjectY.centerx - ObjectY.collisionsize);\n z1 = (ObjectY.centery - ObjectY.collisionsize);\n w2 = (ObjectY.centerx + ObjectY.collisionsize);\n z2 = (ObjectY.centery + ObjectY.collisionsize);\n \n //collision detection math calculations.\n return collisionMath(x1, y1, x2, y2, w1, z1, w2, z2);\n }\n else if (typeof ObjectX.updateCenter === 'function'){ //Player object founded.\n /* Setting up ObjectX vertices */\n x1 = (ObjectX.centerx - ObjectX.collisionsize);\n y1 = (ObjectX.centery - ObjectX.collisionsize);\n x2 = (ObjectX.centerx + ObjectX.collisionsize);\n y2 = (ObjectX.centery + ObjectX.collisionsize);\n \n /* Setting up ObjectY vertices */\n w1 = (ObjectY.x - ObjectY.collisionsize);\n z1 = (ObjectY.y - ObjectY.collisionsize);\n w2 = (ObjectY.x + ObjectY.collisionsize);\n z2 = (ObjectY.y + ObjectY.collisionsize);\n \n //collision detection math calculations.\n return collisionMath(x1, y1, x2, y2, w1, z1, w2, z2);\n }\n else if(typeof ObjectY.updateCenter === 'function') { //Player object founded.\n /* Setting up ObjectX vertices */\n x1 = (ObjectX.x - ObjectX.collisionsize);\n y1 = (ObjectX.y - ObjectX.collisionsize);\n x2 = (ObjectX.x + ObjectX.collisionsize);\n y2 = (ObjectX.y + ObjectX.collisionsize);\n \n /* Setting up ObjectY vertices */\n w1 = (ObjectY.centerx - ObjectY.collisionsize);\n z1 = (ObjectY.centery - ObjectY.collisionsize);\n w2 = (ObjectY.centerx + ObjectY.collisionsize);\n z2 = (ObjectY.centery + ObjectY.collisionsize);\n \n //collision detection math calculations.\n return collisionMath(x1, y1, x2, y2, w1, z1, w2, z2);\n }\n else{ //Objects aren't a player.\n console.log(\"Objects aren't a player\");\n /* Setting up ObjectX vertices */\n x1 = (ObjectX.x - ObjectX.collisionsize);\n y1 = (ObjectX.y - ObjectX.collisionsize);\n x2 = (ObjectX.x + ObjectX.collisionsize);\n y2 = (ObjectX.y + ObjectX.collisionsize);\n \n /* Setting up ObjectY vertices */\n w1 = (ObjectY.x - ObjectY.collisionsize);\n z1 = (ObjectY.y - ObjectY.collisionsize);\n w2 = (ObjectY.x + ObjectY.collisionsize);\n z2 = (ObjectY.y + ObjectY.collisionsize);\n \n //collision detection math calculations.\n return collisionMath(x1, y1, x2, y2, w1, z1, w2, z2);\n }\n return false;\n}", "function collision() {\r\n isObstacle_Clash_leftofWindow();\r\n isBullet_Clash_obstacle();\r\n isRocket_Clash_obstacle();\r\n if (lives <= 0) {\r\n endGame();\r\n }\r\n draw_Score_Lives();\r\n isRocket_Clash_Bomb();\r\n isBullet_Clash_Ship();\r\n }", "function collision(object1, object2) {\n if (object1.x <= object2.x && object1.y <= object2.y && object1.x + object1.w >= object2.x && object1.y + object1.h >= object2.y) {\n return true;\n }\n if (object1.x <= object2.x && object1.y >= object2.y && object1.x + object1.w >= object2.x && object2.y + object2.h >= object1.y) {\n return true;\n }\n if (object1.x >= object2.x && object1.y <= object2.y && object2.x + object2.w >= object1.x && object1.y + object1.h >= object2.y) {\n return true;\n }\n return object1.x >= object2.x && object1.y >= object2.y && object2.x + object2.w >= object1.x && object2.y + object2.h >= object1.y;\n}", "constructor(){\n\n\t\tthis.minVelocityPercentDif = 60;\n\n\t\tthis.checkPositionOverlap = (obj1, obj2)=>{ //takes 2 objects and checks for overlap\n\t\t\t//distances from center to edge\n\t\t\tlet sudoDiameter1 = new Vector2(obj1.size.x / 2, obj1.size.y / 2);\n\t\t\tlet sudoDiameter2 = new Vector2(obj2.size.x / 2, obj2.size.y / 2);\n\n\t\t\t//position of point at center of obj\n\t\t\tlet centerPos1 = new Vector2(obj1.position.x + sudoDiameter1.x, obj1.position.y + sudoDiameter1.y);\n\t\t\tlet centerPos2 = new Vector2(obj2.position.x + sudoDiameter2.x, obj2.position.y + sudoDiameter2.y);\n\n\t\t\treturn (Math.abs(centerPos1.x - centerPos2.x) < (sudoDiameter1.x + sudoDiameter2.x) && Math.abs(centerPos1.y - centerPos2.y) < (sudoDiameter1.y + sudoDiameter2.y))\n\n\t\t}\n\n\t\tthis.staticDynamicCollision = (statObj, dynObj)=>{\n\n\t\t\tlet statRadius = new Vector2(statObj.size.x / 2, statObj.size.y / 2)\n\t\t\tlet dynRadius = new Vector2(dynObj.size.x / 2, dynObj.size.y / 2)\n\n\t\t\t// let edge = calcCollisionEdge(statObj, dynObj);\n\t\t\tlet edge = null;\n\t\t\t// console.log(edge)\n\n\t\t\tif(edge == null){\n\t\t\t\tdynObj.velocity = new Vector2(-dynObj.velocity.x, -dynObj.velocity.y);\n\t\t\t}else if (edge[0] % 2 == 0){\n\t\t\t\t\t\tdynObj.velocity = new Vector2(-dynObj.velocity.x, dynObj.velocity.y);\n\t\t\t}else{\n\t\t\t\tdynObj.velocity = new Vector2(dynObj.velocity.x, -dynObj.velocity.y);\n\t\t\t}\n\n\t\n\t\t}\n\n\t\tthis.executeCollision = (obj1, obj2)=>{\n\n\t\t\t//initial velocities (adjusted for angle)\n\t\t\tlet initVelocity1 = Math.sqrt(obj1.velocity.x ^2 + obj1.velocity.y ^2);\n\t\t\tlet initVelocity2 = Math.sqrt(obj2.velocity.x ^2 + obj2.velocity.y ^2);\n\n\n\t\t\t//initial angles in radians\n\t\t\tlet initAngle1 = Math.atan(obj1.velocity.y/obj1.velocity.x);\n\t\t\tlet initAngle2 = Math.atan(obj2.velocity.y/obj2.velocity.x);\n\n\t\t\t// console.log(initAngle1, initAngle2);\n\t\t\t// console.log(obj1.name, obj2.name)\n\n\t\t\tlet tempVelocity = obj1.velocity;\n\t\t\tobj1.velocity = new Vector2((obj2.velocity.x * obj2.mass) / obj1.mass, (obj2.velocity.y * obj2.mass) / obj1.mass);\n\t\t\tobj2.velocity = new Vector2((tempVelocity.x * obj1.mass) / obj2.mass, (tempVelocity.y * obj1.mass) / obj2.mass);\n\n\t\t}\n\n\t\tthis.update = (gameObjects)=>{\n\t\t\t\n\t\t\tlet physicsObjects = [];\n\n\t\t\tfor (let i in gameObjects){\n\t\t\t\tif(gameObjects[i] instanceof PhysicsEntity){\n\t\t\t\t\tphysicsObjects.push(gameObjects[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet collisions = []\n\n\t\t\tfor(let i in physicsObjects){\n\t\t\t\tfor(let j in physicsObjects){\n\t\t\t\t\tif(i != j){\n\n\t\t\t\t\t\tlet obj1 = physicsObjects[i];\n\t\t\t\t\t\tlet obj2 = physicsObjects[j];\n\n\t\t\t\t\t\t//initial comparison of positions for collision detection\n\t\t\t\t\t\tif(this.checkPositionOverlap(obj1, obj2)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tlet doCollision = true;\n\t\t\t\t\t\t\tfor(let k in collisions){\n\t\t\t\t\t\t\t\tif(collisions[k] != [i, j]){\n\t\t\t\t\t\t\t\t\tdoCollision = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t//checks to make sure that the objects are moving at somewhat different speeds (prevents objects from getting stuck)\n\t\t\t\t\t\t\tif(calcPercentDifference(obj1.velocity.x,obj2.velocity.x) >= this.minVelocityPercentDif ||calcPercentDifference(obj1.velocity.y,obj2.velocity.y) >= this.minVelocityPercentDif ){\n\t\t\t\t\t\t\t\tif(doCollision){\n\n\t\t\t\t\t\t\t\t\t//here, the new velocities are calculated and updated\n\n\t\t\t\t\t\t\t\t\tif(obj1.isStatic == false && obj2.isStatic == false){ //done if neither object is static\n\t\t\t\t\t\t\t\t\t\tthis.executeCollision(obj1, obj2); //all the physics happens in here\n\t\t\t\t\t\t\t\t\t}else if(obj1.isStatic == true && obj2.isStatic == false){\n\t\t\t\t\t\t\t\t\t\tthis.staticDynamicCollision(obj1, obj2)\n\t\t\t\t\t\t\t\t\t}else if(obj1.isStatic == false && obj2.isStatic == true){\n\t\t\t\t\t\t\t\t\t\tthis.staticDynamicCollision(obj2, obj1)\n\t\t\t\t\t\t\t\t\t}else if(obj1.isStatic == true && obj2.isStatic == true){\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\tcollisions.push([i, j])\n\t\t\t\t\t\t\t\t\tcollisions.push([j, i])\n\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\n\t\t}\n\n\n\n\t}", "function detectCollision(new_x, new_y) {\n var new_index = tu.getIndex(new_x, new_y, TILE_WIDTH, TILE_HEIGHT, MAP_WIDTH);\n var tileID = foreground[new_index];\n\n if (tileID == 1) return 1;\n else if (tileID == 2) return 2;\n else if (tileID == 4) return 3;\n else return 0; // no collision detected\n}", "function checkCollisionPoint( s, x, y ) {\n return ( s.x - s.img.width/2 < x && s.x + s.img.width/2 > x && s.y - s.img.height/2 < y && s.y + s.img.height/2 > y );\n}", "function checkCollision (sprite) {\n //test right boundary\n if (sprite.vx > 0 && (sprite.x + sprite.width) >= SCREEN_WIDTH) {\n sprite.vx = -1;\n //test left boundary\n } else if (sprite.vx < 0 && sprite.x < 0) {\n sprite.vx = 1;\n }\n //test bottom boundary\n if (sprite.vy > 0 && (sprite.y + sprite.height) >= SCREEN_HEIGHT) {\n sprite.vy = -1;\n //test top boundary\n } else if (sprite.vy < 0 && sprite.y < 0) {\n sprite.vy = 1;\n }\n }", "collide(dir) {\n if (dir == \"left\" && this.pos.x <= 0) return true;\n if (dir == \"right\" && this.pos.x + this.scl >= roomMap.length * SPOT_SCL) return true;\n if (dir == \"up\" && this.pos.y <= 0) return true;\n if (dir == \"down\" && this.pos.y + this.scl >= roomMap[0].length * SPOT_SCL) return true;\n\n for (let rowIndex = 0; rowIndex < roomMap.length; rowIndex++) {\n for (let colIndex = 0; colIndex < roomMap[rowIndex].length; colIndex++) {\n let [x, y] = [rowIndex * SPOT_SCL, colIndex * SPOT_SCL];\n let currentSpot = roomMap[rowIndex][colIndex];\n //check for the translarency\n if (currentSpot.properties.transparent == true) {\n if (dir == 'left') {\n if (this.pos.x <= x + SPOT_SCL &&\n this.pos.x + this.scl > x &&\n this.pos.y < y + SPOT_SCL &&\n this.pos.y + this.scl > y) return true;\n } else if (dir == 'right') {\n if (this.pos.x + this.scl >= x &&\n this.pos.x < x + SPOT_SCL &&\n this.pos.y < y + SPOT_SCL &&\n this.pos.y + this.scl > y) return true;\n } else if (dir == 'up') {\n if (this.pos.y <= y + SPOT_SCL &&\n this.pos.y + this.scl > y + SPOT_SCL &&\n this.pos.x + this.scl > x &&\n this.pos.x < x + SPOT_SCL) return true;\n } else if (dir == 'down') {\n if (this.pos.y + this.scl >= y &&\n this.pos.y < y &&\n this.pos.x + this.scl > x &&\n this.pos.x < x + SPOT_SCL) return true;\n }\n }\n }\n }\n return false;\n }", "function checkCollision() {\n var conds = [false, false, false, false];\n if (rectA.right >= rectB.left)\n conds[0] = true;\n if (rectB.right >= rectA.left)\n conds[1] = true;\n if (rectA.bottom >= rectB.top)\n conds[2] = true;\n if (rectB.bottom >= rectA.top)\n conds[3] = true;\n return conds;\n}", "function collision(b, p) {\r\n p.top = p.y;\r\n p.bottom = p.y + p.height;\r\n p.left = p.x;\r\n p.right = p.x + p.width;\r\n\r\n b.top = b.y - b.radius;\r\n b.bottom = b.y + b.radius;\r\n b.left = b.x - b.radius;\r\n b.right = b.x + b.radius;\r\n\r\n return (\r\n p.left < b.right && p.top < b.bottom && p.right > b.left && p.bottom > b.top\r\n );\r\n}", "function collision(playerX, playerY, playerWidth, playerHeight, enemyX, enemyY, enemyWidth, enemyHeight) {\n return (Math.abs(playerX - enemyX) * 2 < playerWidth + enemyWidth) && (Math.abs(playerY - enemyY) * 2 < playerHeight + enemyHeight)\n}", "collision (b) {\n\n let mdiff = this.mDiff(b);\n if (mdiff.hasOrigin()) {\n\n let vectors = [ new Vector (0,mdiff.origin.y),\n new Vector (0,mdiff.origin.y+mdiff.height),\n new Vector (mdiff.origin.x, 0),\n new Vector (mdiff.origin.x + mdiff.width, 0) ];\n\n\t\t\tlet n = vectors[0];\n\n\t\t\tfor (let i = 1; i < vectors.length; i++) {\n\t\t\t\tif (vectors[i].norm() < n.norm())\n\t\t\t\tn = vectors[i];\n\t\t\t};\n\n\t\t\tlet norm_v = this.velocity.norm();\n\t\t\tlet norm_vb = b.velocity.norm();\n\t\t\tlet kv = norm_v / (norm_v + norm_vb);\n\t\t\tlet kvb = norm_vb / (norm_v + norm_vb);\n\n\t\t\tif (norm_v == 0 && norm_vb == 0) {\n\t\t\t\tif (this.invMass == 0 && b.invMass == 0)\n\t\t\t\treturn null;\n\t\t\t\telse {\n\t\t\t\t\tif (this.mass <= b.mass)\n\t\t\t\t\tkv = 1;\n\t\t\t\t\telse\n\t\t\t\t\tkvb = 1\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t\tthis.move(n.mult(kv));\n\t\t\tb.move(n.mult(-kvb));\n\n\t\t\tn = n.normalize();\n\n\t\t\t// (2) On calcule l'impulsion j :\n\t\t\tlet v = this.velocity.sub(b.velocity);\n\t\t\tlet e = Constants.elasticity; // pour les étudiants, juste faire let e = 1;\n\n\t\t\tlet j = -(1 + e) * v.dot(n) / (this.invMass + b.invMass);\n\n\t\t\t// (3) On calcule les nouvelle vitesse:\n\t\t\tlet new_v = this.velocity.add(n.mult(j * this.invMass));\n\t\t\tlet new_bv = b.velocity.sub(n.mult(j * b.invMass));\n\n\t\t\tb.setCollision(true);\n\t\t\tthis.setCollision(true);\n\n\t\t\treturn { velocity1 : new_v, velocity2 : new_bv };\n\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "collides(target) {\n const { x: xTarget, y: yTarget } = target;\n const { x, y } = this;\n if(dist(xTarget, yTarget, x, y) <= TARGET_SIZE / 2) {\n return true;\n }\n return false;\n }", "checkForCollision(ps) {\n if( ps !== null ) { \n for(let i = 0; i < this.collisionSX.length; i++ ) {\n if( ps.position.x >= this.collisionSX[i] && ps.position.x <= this.collisionEX[i] ) {\n if( ps.position.y >= this.collisionSY[i] && ps.position.y <= this.collisionEY[i] ) {\n //print(\"collsion at shape \" + i);\n return true;\n }\n }\n }\n }\n\n return false; \n }", "collision() {\n return this.sprite.overlap(player.sprite) && this.colour == player.colour;\n }", "isCollidingWith(object) {\n return (\n this.x < object.x + object.width && \n this.x + this.width > object.x &&\n this.y < object.y + object.height &&\n this.y + this.height > object.y\n );\n }", "function checkCollision( spriteA, spriteB )\n{\n var a = spriteA.getBounds();\n var b = spriteB.getBounds();\n return a.x + a.width > b.x && a.x < b.x + b.width && a.y + a.height > b.y && a.y < b.y + b.height;\n}", "function collision_detector(first, second) {\r\n var x1 = first.get(\"X\");\r\n var y1 = first.get(\"Y\");\r\n var width1 = first.get(\"width\");\r\n var height1 = first.get(\"height\");\r\n var x2 = second.get(\"X\");\r\n var y2 = second.get(\"Y\");\r\n var width2 = second.get(\"width\");\r\n var height2 = second.get(\"height\");\r\n\r\n if (x2 > x1 && x2 < x1 + width1 || x1 > x2 && x1 < x2 + width2) {\r\n if (y2 > y1 && y2 < y1 + height1 || y1 > y2 && y1 < y2 + height2) {\r\n return true;\r\n }\r\n } else {\r\n return false;\r\n }\r\n}", "function tester_collision1() {\n\tfor (var p=0; p<18; p++) {\n\n/* On test le contact de la sphère avec chaque sommet du mur de gauche */\n\t\tif (Math.sqrt(Math.pow(polygone[p][0]-xplayer1,2)+ Math.pow(polygone[p][1]-yplayer1,2)) < rayon) {\n\t\t\tcontinuer = false;\n\t\t\tbreak;\n\t\t}\n\n/* Idem avec le mur de droite */\n\t\tif (Math.sqrt(Math.pow(polygone[p][0]+largeur-xplayer1,2)+ Math.pow(polygone[p][1]-yplayer1,2)) < rayon ) {\n\t\t\tcontinuer = false;\n\t\t\tbreak;\n\t\t}\n\t}\n\t \n}", "function CollisionDetection(entity) {\n var _this;\n\n _this = _Script.call(this, entity) || this;\n _this._colliderManager = void 0;\n _this._myCollider = void 0;\n _this._overlopCollider = void 0;\n _this._sphere = void 0;\n _this._box = new math.BoundingBox();\n _this._evts = Object.create(null);\n _this._evtCount = 0;\n return _this;\n }", "function colCheck(shape0, shape1, shape2, shape3, shape4, shape5, shape6, shape7, shape8, shape9, shape10, shape11, shape12, shape13, shape14, shape15, shape16, shape17, shape18, shape19, shape20, shape21, shape22, shape23, shape24, shape25)\n{\n // Collision split up into separate object checks as pushing to array and checking that way was not viable.\n // This is due to the data being undefined, an issue I have encountered several times throughout development.\n\n // There are wall colliders\n // and gold colliders.\n\n // Wall colliders set player velocity to 0, whereas gold colliders increment gold collected counter and make the object disappear offscreen. \n\n // #region Shapes\n shape0 = player;\n shape1 = collider0;\n shape2 = collider01;\n shape3 = collider02;\n shape4 = collider03;\n shape5 = collider04;\n shape6 = collider05;\n shape7 = collider06;\n shape8 = collider07;\n shape9 = collider08;\n shape10 = collider09;\n shape11 = collider010;\n shape12 = collider011;\n shape13 = collider012;\n shape14 = collider013;\n shape15 = collider014;\n shape16 = collider015;\n shape17 = collider016;\n shape18 = collider017;\n shape19 = collider018;\n shape20 = collider019;\n shape21 = goldChest0;\n shape22 = goldChest1;\n shape23 = goldChest2;\n shape24 = goldChest3;\n shape25 = goldChest4;\n // #endregion\n \n // #region Wall colliders\n let vX0 = (shape0.Position.x + (shape0.img.width / 2)) - (shape1.Position.x + (shape1.img.width / 2)),\n vY0 = (shape0.Position.y + (shape0.img.height / 2)) - (shape1.Position.y + (shape1.img.height / 2)),\n halfWidths0 = (shape0.img.width / 2) + (shape1.img.width / 2),\n halfHeights0 = (shape0.img.height / 2) + (shape1.img.height / 2),\n colDir0 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX0) < halfWidths0 && Math.abs(vY0) < halfHeights0)\n {\n let oX0 = halfWidths0 - Math.abs(vX0),\n oY0 = halfHeights0 - Math.abs(vY0);\n\n if (oX0 >= oY0)\n {\n // Top collision\n if (vY0 > 0)\n {\n colDir0 = \"t\";\n shape0.Position.y += oY0;\n }\n // Bottom collision\n else\n {\n colDir0 = \"b\";\n shape0.Position.y -= oY0;\n }\n }else\n {\n // Left collision\n if (vX0 > 0)\n {\n colDir0 = \"l\";\n shape0.Position.x += oX0;\n }\n // Right collision\n else\n {\n colDir0 = \"r\";\n shape0.Position.x -= oX0;\n }\n }\n }\n\n let vX1 = (shape0.Position.x + (shape0.img.width / 2)) - (shape2.Position.x + (shape2.img.width / 2)),\n vY1 = (shape0.Position.y + (shape0.img.height / 2)) - (shape2.Position.y + (shape2.img.height / 2)),\n halfWidths1 = (shape0.img.width / 2) + (shape2.img.width / 2),\n halfHeights1 = (shape0.img.height / 2) + (shape2.img.height / 2),\n colDir1 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX1) < halfWidths1 && Math.abs(vY1) < halfHeights1)\n {\n let oX1 = halfWidths1 - Math.abs(vX1),\n oY1 = halfHeights1 - Math.abs(vY1);\n\n if (oX1 >= oX1)\n {\n // Top collision\n if (vY1 > 0)\n {\n colDir1 = \"t\";\n shape0.Position.y += oY1;\n }\n // Bottom collision\n else\n {\n colDir1 = \"b\";\n shape0.Position.y -= oY1;\n }\n }\n else\n {\n // Left collision\n if (vX1 > 0)\n {\n colDir1 = \"l\";\n shape0.Position.x += oX1;\n }\n // Right collision\n else\n {\n colDir1 = \"r\";\n shape0.Position.x -= oX1;\n }\n }\n }\n\n let vX2 = (shape0.Position.x + (shape0.img.width / 2)) - (shape3.Position.x + (shape3.img.width / 2)),\n vY2 = (shape0.Position.y + (shape0.img.height / 2)) - (shape3.Position.y + (shape3.img.height / 2)),\n halfWidths2 = (shape0.img.width / 2) + (shape3.img.width / 2),\n halfHeights2 = (shape0.img.height / 2) + (shape3.img.height / 2),\n colDir2 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX2) < halfWidths2 && Math.abs(vY2) < halfHeights2)\n {\n let oX2 = halfWidths2 - Math.abs(vX2),\n oY2 = halfHeights2 - Math.abs(vY2);\n\n if (oX2 >= oY2)\n {\n // Top collision\n if (vY2 > 0)\n {\n colDir2 = \"t\";\n shape0.Position.y += oY2;\n }\n // Bottom collision\n else\n {\n colDir2 = \"b\";\n shape0.Position.y -= oY2;\n }\n }\n else\n {\n // Left collision\n if (vX2 > 0)\n {\n colDir2 = \"l\";\n shape0.Position.x += oX2;\n }\n // Right collision\n else\n {\n colDir2 = \"r\";\n shape0.Position.x -= oX2;\n }\n }\n }\n\n let vX3 = (shape0.Position.x + (shape0.img.width / 2)) - (shape4.Position.x + (shape4.img.width / 2)),\n vY3 = (shape0.Position.y + (shape0.img.height / 2)) - (shape4.Position.y + (shape4.img.height / 2)),\n halfWidths3 = (shape0.img.width / 2) + (shape4.img.width / 2),\n halfHeights3 = (shape0.img.height / 2) + (shape4.img.height / 2),\n colDir3 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX3) < halfWidths3 && Math.abs(vY3) < halfHeights3)\n {\n\n let oX3 = halfWidths3 - Math.abs(vX3),\n oY3 = halfHeights3 - Math.abs(vY3);\n\n if (oX3 >= oY3)\n {\n // Top collision\n if (vY3 > 0)\n {\n colDir3 = \"t\";\n shape0.Position.y += oY3;\n }\n // Bottom collision\n else\n {\n colDir3 = \"b\";\n shape0.Position.y -= oY3;\n }\n }\n else\n {\n // Left collision\n if (vX3 > 0)\n {\n colDir3 = \"l\";\n shape0.Position.x += oX3;\n }\n // Right collision\n else\n {\n colDir3 = \"r\";\n shape0.Position.x -= oX3;\n }\n }\n }\n\n let vX4 = (shape0.Position.x + (shape0.img.width / 2)) - (shape5.Position.x + (shape5.img.width / 2)),\n vY4 = (shape0.Position.y + (shape0.img.height / 2)) - (shape5.Position.y + (shape5.img.height / 2)),\n halfWidths4 = (shape0.img.width / 2) + (shape5.img.width / 2),\n halfHeights4 = (shape0.img.height / 2) + (shape5.img.height / 2),\n colDir4 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX4) < halfWidths4 && Math.abs(vY4) < halfHeights4)\n {\n let oX4 = halfWidths4 - Math.abs(vX4),\n oY4 = halfHeights4 - Math.abs(vY4);\n\n if (oX4 >= oY4)\n {\n // Top collision\n if (vY4 > 0)\n {\n colDir4 = \"t\";\n shape0.Position.y += oY4;\n }\n // Bottom collision\n else\n {\n colDir4 = \"b\";\n shape0.Position.y -= oY4;\n }\n }\n else\n {\n // Left collision\n if (vX4 > 0)\n {\n colDir4 = \"l\";\n shape0.Position.x += oX4;\n }\n // Right collision\n else\n {\n colDir4 = \"r\";\n shape0.Position.x -= oX4;\n }\n }\n }\n\n let vX5 = (shape0.Position.x + (shape0.img.width / 2)) - (shape6.Position.x + (shape6.img.width / 2)),\n vY5 = (shape0.Position.y + (shape0.img.height / 2)) - (shape6.Position.y + (shape6.img.height / 2)),\n halfWidths5 = (shape0.img.width / 2) + (shape6.img.width / 2),\n halfHeights5 = (shape0.img.height / 2) + (shape6.img.height / 2),\n colDir5 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX5) < halfWidths5 && Math.abs(vY5) < halfHeights5)\n {\n let oX5 = halfWidths5 - Math.abs(vX5),\n oY5 = halfHeights5 - Math.abs(vY5);\n\n if (oX5 >= oY5)\n {\n // Top collision\n if (vY5 > 0)\n {\n colDir5 = \"t\";\n shape0.Position.y += oY5;\n }\n // Bottom collision\n else\n {\n colDir5 = \"b\";\n shape0.Position.y -= oY5;\n }\n }\n else\n {\n // Left collision\n if (vX5 > 0)\n {\n colDir5 = \"l\";\n shape0.Position.x += oX5;\n }\n // Right collision\n else\n {\n colDir5 = \"r\";\n shape0.Position.x -= oX5;\n }\n }\n }\n\n let vX6 = (shape0.Position.x + (shape0.img.width / 2)) - (shape7.Position.x + (shape7.img.width / 2)),\n vY6 = (shape0.Position.y + (shape0.img.height / 2)) - (shape7.Position.y + (shape7.img.height / 2)),\n halfWidths6 = (shape0.img.width / 2) + (shape7.img.width / 2),\n halfHeights6 = (shape0.img.height / 2) + (shape7.img.height / 2),\n colDir6 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX6) < halfWidths6 && Math.abs(vY6) < halfHeights6)\n {\n let oX6 = halfWidths6 - Math.abs(vX6),\n oY6 = halfHeights6 - Math.abs(vY6);\n\n if (oX6 >= oY6)\n {\n // Top collision\n if (vY6 > 0)\n {\n colDir6 = \"t\";\n shape0.Position.y += oY6;\n }\n // Bottom collision\n else\n {\n colDir6 = \"b\";\n shape0.Position.y -= oY6;\n }\n }\n else\n {\n // Left collision\n if (vX6 > 0)\n {\n colDir6 = \"l\";\n shape0.Position.x += oX6;\n }\n // Right collision\n else\n {\n colDir6 = \"r\";\n shape0.Position.x -= oX6;\n }\n }\n }\n\n let vX7 = (shape0.Position.x + (shape0.img.width / 2)) - (shape8.Position.x + (shape8.img.width / 2)),\n vY7 = (shape0.Position.y + (shape0.img.height / 2)) - (shape8.Position.y + (shape8.img.height / 2)),\n halfWidths7 = (shape0.img.width / 2) + (shape8.img.width / 2),\n halfHeights7 = (shape0.img.height / 2) + (shape8.img.height / 2),\n colDir7 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX7) < halfWidths7 && Math.abs(vY7) < halfHeights7)\n {\n let oX7 = halfWidths7 - Math.abs(vX7),\n oY7 = halfHeights7 - Math.abs(vY7);\n\n if (oX7 >= oY7)\n {\n // Top collision\n if (vY7 > 0)\n {\n colDir7 = \"t\";\n shape0.Position.y += oY7;\n }\n // Bottom collision\n else\n {\n colDir7 = \"b\";\n shape0.Position.y -= oY7;\n }\n }\n else\n {\n // Left collision\n if (vX7 > 0)\n {\n colDir7 = \"l\";\n shape0.Position.x += oX7;\n }\n // Right collision\n else\n {\n colDir7 = \"r\";\n shape0.Position.x -= oX7;\n }\n }\n }\n\n let vX8 = (shape0.Position.x + (shape0.img.width / 2)) - (shape9.Position.x + (shape9.img.width / 2)),\n vY8 = (shape0.Position.y + (shape0.img.height / 2)) - (shape9.Position.y + (shape9.img.height / 2)),\n halfWidths8 = (shape0.img.width / 2) + (shape9.img.width / 2),\n halfHeights8 = (shape0.img.height / 2) + (shape9.img.height / 2),\n colDir8 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX8) < halfWidths8 && Math.abs(vY8) < halfHeights8)\n {\n let oX8 = halfWidths8 - Math.abs(vX8),\n oY8 = halfHeights8 - Math.abs(vY8);\n\n if (oX8 >= oY8)\n {\n // Top collision\n if (vY8 > 0)\n {\n colDir8 = \"t\";\n shape0.Position.y += oY8;\n }\n // Bottom collision\n else\n {\n colDir8 = \"b\";\n shape0.Position.y -= oY8;\n }\n }\n else\n {\n // Left collision\n if (vX8 > 0)\n {\n colDir8 = \"l\";\n shape0.Position.x += oX8;\n }\n // Right collision\n else\n {\n colDir8 = \"r\";\n shape0.Position.x -= oX8;\n }\n }\n }\n\n let vX9 = (shape0.Position.x + (shape0.img.width / 2)) - (shape10.Position.x + (shape10.img.width / 2)),\n vY9 = (shape0.Position.y + (shape0.img.height / 2)) - (shape10.Position.y + (shape10.img.height / 2)),\n halfWidths9 = (shape0.img.width / 2) + (shape10.img.width / 2),\n halfHeights9 = (shape0.img.height / 2) + (shape10.img.height / 2),\n colDir9 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX9) < halfWidths9 && Math.abs(vY9) < halfHeights9)\n {\n let oX9 = halfWidths9 - Math.abs(vX9),\n oY9 = halfHeights9 - Math.abs(vY9);\n\n if (oX9 >= oY9)\n {\n // Top collision\n if (vY9 > 0)\n {\n colDir9 = \"t\";\n shape0.Position.y += oY9;\n }\n // Bottom collision\n else\n {\n colDir9 = \"b\";\n shape0.Position.y -= oY9;\n }\n }\n else\n {\n // Left collision\n if (vX9 > 0)\n {\n colDir9 = \"l\";\n shape0.Position.x += oX9;\n }\n // Right collision\n else\n {\n colDir9 = \"r\";\n shape0.Position.x -= oX9;\n }\n }\n }\n\n let vX10 = (shape0.Position.x + (shape0.img.width / 2)) - (shape11.Position.x + (shape11.img.width / 2)),\n vY10 = (shape0.Position.y + (shape0.img.height / 2)) - (shape11.Position.y + (shape11.img.height / 2)),\n halfWidths10 = (shape0.img.width / 2) + (shape11.img.width / 2),\n halfHeights10 = (shape0.img.height / 2) + (shape11.img.height / 2),\n colDir10 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX10) < halfWidths10 && Math.abs(vY10) < halfHeights10)\n {\n let oX10 = halfWidths10 - Math.abs(vX10),\n oY10 = halfHeights10 - Math.abs(vY10);\n\n if (oX10 >= oY10)\n {\n // Top collision\n if (vY10 > 0)\n {\n colDir10 = \"t\";\n shape0.Position.y += oY10;\n }\n // Bottom collision\n else\n {\n colDir10 = \"b\";\n shape0.Position.y -= oY10;\n }\n }\n else\n {\n // Left collision\n if (vX10 > 0)\n {\n colDir10 = \"l\";\n shape0.Position.x += oX10;\n }\n // Right collision\n else\n {\n colDir10 = \"r\";\n shape0.Position.x -= oX10;\n }\n }\n }\n\n let vX11 = (shape0.Position.x + (shape0.img.width / 2)) - (shape12.Position.x + (shape12.img.width / 2)),\n vY11 = (shape0.Position.y + (shape0.img.height / 2)) - (shape12.Position.y + (shape12.img.height / 2)),\n halfWidths11 = (shape0.img.width / 2) + (shape12.img.width / 2),\n halfHeights11 = (shape0.img.height / 2) + (shape12.img.height / 2),\n colDir11 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX11) < halfWidths11 && Math.abs(vY11) < halfHeights11)\n {\n let oX11 = halfWidths11 - Math.abs(vX11),\n oY11 = halfHeights11 - Math.abs(vY11);\n\n if (oX11 >= oY11)\n {\n // Top collision\n if (vY11 > 0)\n {\n colDir11 = \"t\";\n shape0.Position.y += oY11;\n }\n // Bottom collision\n else\n {\n colDir11 = \"b\";\n shape0.Position.y -= oY11;\n }\n }\n else\n {\n // Left collision\n if (vX11 > 0)\n {\n colDir11 = \"l\";\n shape0.Position.x += oX11;\n }\n // Right collision\n else\n {\n colDir11 = \"r\";\n shape0.Position.x -= oX11;\n }\n }\n }\n\n let vX12 = (shape0.Position.x + (shape0.img.width / 2)) - (shape13.Position.x + (shape13.img.width / 2)),\n vY12 = (shape0.Position.y + (shape0.img.height / 2)) - (shape13.Position.y + (shape13.img.height / 2)),\n halfWidths12 = (shape0.img.width / 2) + (shape13.img.width / 2),\n halfHeights12 = (shape0.img.height / 2) + (shape13.img.height / 2),\n colDir12 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX12) < halfWidths12 && Math.abs(vY12) < halfHeights12)\n {\n let oX12 = halfWidths12 - Math.abs(vX12),\n oY12 = halfHeights12 - Math.abs(vY12);\n\n if (oX12 >= oY12)\n {\n // Top collision\n if (vY12 > 0)\n {\n colDir12 = \"t\";\n shape0.Position.y += oY12;\n }\n // Bottom collision\n else\n {\n colDir12 = \"b\";\n shape0.Position.y -= oY12;\n }\n }\n else\n {\n // Left collision\n if (vX12 > 0)\n {\n colDir12 = \"l\";\n shape0.Position.x += oX12;\n }\n // Right collision\n else\n {\n colDir12 = \"r\";\n shape0.Position.x -= oX12;\n }\n }\n }\n\n let vX13 = (shape0.Position.x + (shape0.img.width / 2)) - (shape14.Position.x + (shape14.img.width / 2)),\n vY13 = (shape0.Position.y + (shape0.img.height / 2)) - (shape14.Position.y + (shape14.img.height / 2)),\n halfWidths13 = (shape0.img.width / 2) + (shape14.img.width / 2),\n halfHeights13 = (shape0.img.height / 2) + (shape14.img.height / 2),\n colDir13 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX13) < halfWidths13 && Math.abs(vY13) < halfHeights13)\n {\n let oX13 = halfWidths13 - Math.abs(vX13),\n oY13 = halfHeights13 - Math.abs(vY13);\n\n if (oX13 >= oY13)\n {\n // Top collision\n if (vY13 > 0)\n {\n colDir13 = \"t\";\n shape0.Position.y += oY13;\n }\n // Bottom collision\n else\n {\n colDir13 = \"b\";\n shape0.Position.y -= oY13;\n }\n }\n else\n {\n // Left collision\n if (vX13 > 0)\n {\n colDir13 = \"l\";\n shape0.Position.x += oX13;\n }\n // Right collision\n else\n {\n colDir13 = \"r\";\n shape0.Position.x -= oX13;\n }\n }\n }\n\n let vX14 = (shape0.Position.x + (shape0.img.width / 2)) - (shape15.Position.x + (shape15.img.width / 2)),\n vY14 = (shape0.Position.y + (shape0.img.height / 2)) - (shape15.Position.y + (shape15.img.height / 2)),\n halfWidths14 = (shape0.img.width / 2) + (shape15.img.width / 2),\n halfHeights14 = (shape0.img.height / 2) + (shape15.img.height / 2),\n colDir14 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX14) < halfWidths14 && Math.abs(vY14) < halfHeights14)\n {\n let oX14 = halfWidths14 - Math.abs(vX14),\n oY14 = halfHeights14 - Math.abs(vY14);\n\n if (oX14 >= oY14)\n {\n // Top collision\n if (vY14 > 0)\n {\n colDir14 = \"t\";\n shape0.Position.y += oY14;\n }\n // Bottom collision\n else\n {\n colDir14 = \"b\";\n shape0.Position.y -= oY14;\n }\n }\n else\n {\n // Left collision\n if (vX14 > 0)\n {\n colDir14 = \"l\";\n shape0.Position.x += oX14;\n }\n // Right collision\n else\n {\n colDir14 = \"r\";\n shape0.Position.x -= oX14;\n }\n }\n }\n\n let vX15 = (shape0.Position.x + (shape0.img.width / 2)) - (shape16.Position.x + (shape16.img.width / 2)),\n vY15 = (shape0.Position.y + (shape0.img.height / 2)) - (shape16.Position.y + (shape16.img.height / 2)),\n halfWidths15 = (shape0.img.width / 2) + (shape16.img.width / 2),\n halfHeights15 = (shape0.img.height / 2) + (shape16.img.height / 2),\n colDir15 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX15) < halfWidths15 && Math.abs(vY15) < halfHeights15)\n {\n let oX15 = halfWidths15 - Math.abs(vX15),\n oY15 = halfHeights15 - Math.abs(vY15);\n\n if (oX15 >= oY15)\n {\n // Top collision\n if (vY15 > 0)\n {\n colDir15 = \"t\";\n shape0.Position.y += oY15;\n }\n // Bottom collision\n else\n {\n colDir15 = \"b\";\n shape0.Position.y -= oY15;\n }\n }\n else\n {\n // Left collision\n if (vX15 > 0)\n {\n colDir15 = \"l\";\n shape0.Position.x += oX15;\n }\n // Right collision\n else\n {\n colDir15 = \"r\";\n shape0.Position.x -= oX15;\n }\n }\n }\n\n let vX16 = (shape0.Position.x + (shape0.img.width / 2)) - (shape17.Position.x + (shape17.img.width / 2)),\n vY16 = (shape0.Position.y + (shape0.img.height / 2)) - (shape17.Position.y + (shape17.img.height / 2)),\n halfWidths16 = (shape0.img.width / 2) + (shape17.img.width / 2),\n halfHeights16 = (shape0.img.height / 2) + (shape17.img.height / 2),\n colDir16 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX16) < halfWidths16 && Math.abs(vY16) < halfHeights16)\n {\n let oX16 = halfWidths16 - Math.abs(vX16),\n oY16 = halfHeights16 - Math.abs(vY16);\n\n if (oX16 >= oY16)\n {\n // Top collision\n if (vY16 > 0)\n {\n colDir16 = \"t\";\n shape0.Position.y += oY16;\n }\n // Bottom collision\n else\n {\n colDir16 = \"b\";\n shape0.Position.y -= oY16;\n }\n }\n else\n {\n // Left collision\n if (vX16 > 0)\n {\n colDir16 = \"l\";\n shape0.Position.x += oX16;\n }\n // Right collision\n else\n {\n colDir16 = \"r\";\n shape0.Position.x -= oX16;\n }\n }\n }\n\n let vX17 = (shape0.Position.x + (shape0.img.width / 2)) - (shape18.Position.x + (shape18.img.width / 2)),\n vY17 = (shape0.Position.y + (shape0.img.height / 2)) - (shape18.Position.y + (shape18.img.height / 2)),\n halfWidths17 = (shape0.img.width / 2) + (shape18.img.width / 2),\n halfHeights17 = (shape0.img.height / 2) + (shape18.img.height / 2),\n colDir17 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX17) < halfWidths17 && Math.abs(vY17) < halfHeights17)\n {\n let oX17 = halfWidths17 - Math.abs(vX17),\n oY17 = halfHeights17 - Math.abs(vY17);\n\n if (oX17 >= oY17)\n {\n // Top collision\n if (vY17 > 0)\n {\n colDir17 = \"t\";\n shape0.Position.y += oY17;\n }\n // Bottom collision\n else\n {\n colDir17 = \"b\";\n shape0.Position.y -= oY17;\n }\n }\n else\n {\n // Left collision\n if (vX17 > 0)\n {\n colDir17 = \"l\";\n shape0.Position.x += oX17;\n }\n // Right collision\n else\n {\n colDir17 = \"r\";\n shape0.Position.x -= oX17;\n }\n }\n }\n\n let vX18 = (shape0.Position.x + (shape0.img.width / 2)) - (shape19.Position.x + (shape19.img.width / 2)),\n vY18 = (shape0.Position.y + (shape0.img.height / 2)) - (shape19.Position.y + (shape19.img.height / 2)),\n halfWidths18 = (shape0.img.width / 2) + (shape19.img.width / 2),\n halfHeights18 = (shape0.img.height / 2) + (shape19.img.height / 2),\n colDir18 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX18) < halfWidths18 && Math.abs(vY18) < halfHeights18)\n {\n let oX18 = halfWidths18 - Math.abs(vX18),\n oY18 = halfHeights18 - Math.abs(vY18);\n\n if (oX18 >= oY18)\n {\n // Top collision\n if (vY18 > 0)\n {\n colDir18 = \"t\";\n shape0.Position.y += oY18;\n }\n // Bottom collision\n else\n {\n colDir18 = \"b\";\n shape0.Position.y -= oY18;\n }\n }\n else\n {\n // Left collision\n if (vX18 > 0)\n {\n colDir18 = \"l\";\n shape0.Position.x += oX18;\n }\n // Right collision\n else\n {\n colDir18 = \"r\";\n shape0.Position.x -= oX18;\n }\n }\n }\n\n let vX19 = (shape0.Position.x + (shape0.img.width / 2)) - (shape20.Position.x + (shape20.img.width / 2)),\n vY19 = (shape0.Position.y + (shape0.img.height / 2)) - (shape20.Position.y + (shape20.img.height / 2)),\n halfWidths19 = (shape0.img.width / 2) + (shape20.img.width / 2),\n halfHeights19 = (shape0.img.height / 2) + (shape20.img.height / 2),\n colDir19 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX19) < halfWidths19 && Math.abs(vY19) < halfHeights19)\n {\n let oX19 = halfWidths19 - Math.abs(vX19),\n oY19 = halfHeights19 - Math.abs(vY19);\n\n if (oX19 >= oY19)\n {\n // Top collision\n if (vY19 > 0)\n {\n colDir19 = \"t\";\n shape0.Position.y += oY19;\n }\n // Bottom collision\n else\n {\n colDir19 = \"b\";\n shape0.Position.y -= oY19;\n }\n }\n else\n {\n // Left collision\n if (vX19 > 0)\n {\n colDir19 = \"l\";\n shape0.Position.x += oX19;\n }\n // Right collision\n else\n {\n colDir19 = \"r\";\n shape0.Position.x -= oX19;\n }\n }\n }\n // #endregion\n\n // #region Gold colliders \n\n let vX20 = (shape0.Position.x + (shape0.img.width / 2)) - (shape21.Position.x + (shape21.img.width / 2)),\n vY20 = (shape0.Position.y + (shape0.img.height / 2)) - (shape21.Position.y + (shape21.img.height / 2)),\n halfWidths20 = (shape0.img.width / 2) + (shape21.img.width / 2),\n halfHeights20 = (shape0.img.height / 2) + (shape21.img.height / 2),\n colDir20 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX20) < halfWidths20 && Math.abs(vY20) < halfHeights20)\n {\n let oX20 = halfWidths20 - Math.abs(vX20),\n oY20 = halfHeights20 - Math.abs(vY20);\n\n if (oX20 >= oY20)\n {\n // Top collision\n if (vY20 > 0)\n {\n colDir20 = \"t\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape21.Position.x = 5000;\n shape21.Position.y = 5000;\n }\n // Bottom collision\n else\n {\n colDir20 = \"b\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape21.Position.x = 5000;\n shape21.Position.y = 5000;\n }\n }\n else\n {\n // Left collision\n if (vX20 > 0)\n {\n colDir20 = \"l\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape21.Position.x = 5000;\n shape21.Position.y = 5000;\n }\n // Right collision\n else\n {\n colDir20 = \"r\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape21.Position.x = 5000;\n shape21.Position.y = 5000;\n }\n }\n }\n\n let vX21 = (shape0.Position.x + (shape0.img.width / 2)) - (shape22.Position.x + (shape22.img.width / 2)),\n vY21 = (shape0.Position.y + (shape0.img.height / 2)) - (shape22.Position.y + (shape22.img.height / 2)),\n halfWidths21 = (shape0.img.width / 2) + (shape22.img.width / 2),\n halfHeights21 = (shape0.img.height / 2) + (shape22.img.height / 2),\n colDir21 = null;\n\n// Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX21) < halfWidths21 && Math.abs(vY21) < halfHeights21)\n {\n let oX21 = halfWidths21 - Math.abs(vX21),\n oY21 = halfHeights21 - Math.abs(vY21);\n\n if (oX21 >= oY21)\n {\n // Top collision\n if (vY21 > 0)\n {\n colDir21 = \"t\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape22.Position.x = 6000;\n shape22.Position.y = 6000;\n }\n // Bottom collision\n else\n {\n colDir20 = \"b\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape22.Position.x = 6000;\n shape22.Position.y = 6000;\n }\n }\n else\n {\n // Left collision\n if (vX21 > 0)\n {\n colDir21 = \"l\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape22.Position.x = 6000;\n shape22.Position.y = 6000;\n }\n // Right collision\n else\n {\n colDir21 = \"r\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape22.Position.x = 6000;\n shape22.Position.y = 6000;\n }\n }\n }\n\n let vX22 = (shape0.Position.x + (shape0.img.width / 2)) - (shape23.Position.x + (shape23.img.width / 2)),\n vY22 = (shape0.Position.y + (shape0.img.height / 2)) - (shape23.Position.y + (shape23.img.height / 2)),\n halfWidths22 = (shape0.img.width / 2) + (shape23.img.width / 2),\n halfHeights22 = (shape0.img.height / 2) + (shape23.img.height / 2),\n colDir22 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX22) < halfWidths22 && Math.abs(vY22) < halfHeights22)\n {\n let oX22 = halfWidths22 - Math.abs(vX22),\n oY22 = halfHeights22 - Math.abs(vY22);\n\n if (oX22 >= oY22)\n {\n // Top collision\n if (vY22 > 0)\n {\n colDir22 = \"t\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape23.Position.x = 7000;\n shape23.Position.y = 7000;\n }\n // Bottom collision\n else\n {\n colDir22 = \"b\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape23.Position.x = 7000;\n shape23.Position.y = 7000;\n }\n }\n else\n {\n // Left collision\n if (vX22 > 0)\n {\n colDir22 = \"l\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape23.Position.x = 7000;\n shape23.Position.y = 7000;\n }\n // Right collision\n else\n {\n colDir22 = \"r\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape23.Position.x = 7000;\n shape23.Position.y = 7000;\n }\n }\n }\n\n let vX23 = (shape0.Position.x + (shape0.img.width / 2)) - (shape24.Position.x + (shape24.img.width / 2)),\n vY23 = (shape0.Position.y + (shape0.img.height / 2)) - (shape24.Position.y + (shape24.img.height / 2)),\n halfWidths23 = (shape0.img.width / 2) + (shape24.img.width / 2),\n halfHeights23 = (shape0.img.height / 2) + (shape24.img.height / 2),\n colDir23 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX23) < halfWidths23 && Math.abs(vY23) < halfHeights23)\n {\n let oX23 = halfWidths23 - Math.abs(vX23),\n oY23 = halfHeights23 - Math.abs(vY23);\n\n if (oX23 >= oY23)\n {\n // Top collision\n if (vY23 > 0)\n {\n colDir23 = \"t\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape24.Position.x = 8000;\n shape24.Position.y = 8000;\n }\n // Bottom collision\n else\n {\n colDir23 = \"b\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape24.Position.x = 8000;\n shape24.Position.y = 8000;\n }\n }\n else\n {\n // Left collision\n if (vX23 > 0)\n {\n colDir23 = \"l\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape24.Position.x = 8000;\n shape24.Position.y = 8000;\n }\n // Right collision\n else\n {\n colDir23 = \"r\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape24.Position.x = 8000;\n shape24.Position.y = 8000;\n }\n }\n }\n\n let vX24 = (shape0.Position.x + (shape0.img.width / 2)) - (shape25.Position.x + (shape25.img.width / 2)),\n vY24 = (shape0.Position.y + (shape0.img.height / 2)) - (shape25.Position.y + (shape25.img.height / 2)),\n halfWidths24 = (shape0.img.width / 2) + (shape25.img.width / 2),\n halfHeights24 = (shape0.img.height / 2) + (shape25.img.height / 2),\n colDir24 = null;\n\n // Whenever the x or y velocity of the player exceeds the width or height of another obj\n if (Math.abs(vX24) < halfWidths24 && Math.abs(vY24) < halfHeights24)\n {\n let oX24 = halfWidths24 - Math.abs(vX24),\n oY24 = halfHeights24 - Math.abs(vY24);\n\n if (oX24 >= oY24)\n {\n // Top collision\n if (vY24 > 0)\n {\n colDir24 = \"t\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape25.Position.x = 9000;\n shape25.Position.y = 9000;\n }\n // Bottom collision\n else\n {\n colDir24 = \"b\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape25.Position.x = 9000;\n shape25.Position.y = 9000;\n }\n }\n else\n {\n // Left collision\n if (vX24 > 0)\n {\n colDir24 = \"l\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape25.Position.x = 9000;\n shape25.Position.y = 9000;\n }\n // Right collision\n else\n {\n colDir24 = \"r\";\n totalGoldCollected += 1;\n goldCollected.play();\n shape25.Position.x = 9000;\n shape25.Position.y = 9000;\n }\n }\n }\n // #endregion\n \n // Return all of my collisions.\n return colDir0, colDir1, colDir2, colDir3, colDir4, colDir5, colDir6, colDir7, colDir8, colDir9, colDir10, colDir11, colDir12, colDir13, colDir14, colDir15, colDir16, colDir17, colDir18, colDir19, colDir20, colDir21, colDir22, colDir23, colDir24;\n}", "function checkCollision(x1, y1, h1, w1, x2, y2, h2, w2) {\n\n if (x1 < x2 + w2 && x1 + w1 > x2 && y1 < y2 + h2 && y1 + h1 > y2) {\n return true;\n }\n else {\n return false;\n }\n}", "checkCollisions() {\n allEnemies.forEach(function(enemy) {\n if ( Math.abs(player.x - enemy.x) <= 80 &&\n Math.abs(player.y - enemy.y) <= 30 ) {\n player.x=200;\n player.y=405;\n }\n });\n }" ]
[ "0.79601616", "0.7761483", "0.7626001", "0.7596909", "0.75479376", "0.75325406", "0.74924725", "0.7473791", "0.74710584", "0.74698704", "0.74529004", "0.7451849", "0.74218374", "0.74144226", "0.74054915", "0.73947346", "0.7383686", "0.736965", "0.7369272", "0.73381203", "0.73366505", "0.73252004", "0.7320965", "0.7317469", "0.7313234", "0.7309455", "0.73078036", "0.7306325", "0.7290895", "0.7288289", "0.72845745", "0.7263831", "0.72450364", "0.72450364", "0.7243834", "0.7242179", "0.72398484", "0.72317255", "0.72251487", "0.72171956", "0.7178843", "0.71728903", "0.717085", "0.71660227", "0.7158396", "0.714135", "0.71388066", "0.71379256", "0.7136057", "0.7135779", "0.7122988", "0.71154916", "0.7113816", "0.71045536", "0.7101645", "0.70980614", "0.70943934", "0.70893925", "0.70893764", "0.7085677", "0.7076775", "0.70703524", "0.7067247", "0.70671886", "0.7063566", "0.7061236", "0.7061068", "0.70574945", "0.7050076", "0.70433056", "0.7042603", "0.7038554", "0.70288175", "0.70273685", "0.7022024", "0.70210487", "0.70204586", "0.7018493", "0.7010495", "0.7002159", "0.69970655", "0.6994169", "0.69898236", "0.6989125", "0.6987252", "0.6985505", "0.6984474", "0.697849", "0.6972724", "0.69698125", "0.6963741", "0.6958468", "0.6957484", "0.69510573", "0.6950783", "0.69503444", "0.6949809", "0.6946181", "0.6945715", "0.69441843", "0.69425714" ]
0.0
-1
============================================================================= = Utilities = =============================================================================
function clamp(min, value, max) { if (value < min) { return min; } else if (value > max) { return max; } else { return value; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Utils() {}", "function Utils() {}", "function Utils(){}", "function _____SHARED_functions_____(){}", "function Utils() {\n}", "private public function m246() {}", "function AeUtil() {}", "private internal function m248() {}", "function DWRUtil() { }", "function Util() {}", "protected internal function m252() {}", "function AppUtils() {}", "function setup() {}", "transient private protected internal function m182() {}", "transient private internal function m185() {}", "function CCUtility() {}", "transient protected internal function m189() {}", "function setup() {\n\n\n}", "function setup() {\n\n\n}", "static private internal function m121() {}", "function FunctionUtils() {}", "function Kutility() {\n\n}", "function Kutility() {\n\n}", "function Utils() {\n // All of the normal singleton code goes here.\n }", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "function Helper() {}", "static final private internal function m106() {}", "initialize() {\n\n }", "initialize()\n {\n }", "async setup() { }", "function MASH_FileManager() {\n\n\n}", "function setup() {\r\n}", "static private protected internal function m118() {}", "function setup() {\n \n}", "transient final protected internal function m174() {}", "function setup() {\n\n}", "function setup() {\n\n}", "function setup() {\n\n}", "function setup() {\n\n}", "function NetworkUtil(){ \n}", "function setup() {\n \n}", "function setup() {\n \n}", "function setup() { \n\n}", "function SigV4Utils() { }", "function Adaptor() {}", "init () {}", "init () {}", "init() { }", "init() { }", "init() { }", "init() { }", "init() { }", "obtain(){}", "_initialize() {\n\n }", "init() {\n\n }", "init() {\n\n }", "init () {\n\n }", "import() {\n }", "function HTTPUtil() {\n}", "static protected internal function m125() {}", "static ready() { }", "function WebIdUtils () {\n}", "setup() {}", "setup() {}", "setup() {}", "init () {\n }", "function setup() {\n\n\t\t\t\t\t}", "function Library() {\n \n}", "function FileHelper() {\n\n}", "init() {\n }", "init() {\n }", "init () {\n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }" ]
[ "0.68743795", "0.68743795", "0.67178273", "0.66578364", "0.6465029", "0.6405977", "0.6396039", "0.6394972", "0.6375918", "0.6302335", "0.5982519", "0.5956346", "0.5817863", "0.58121413", "0.5796301", "0.5770792", "0.5764798", "0.5740645", "0.5740645", "0.5712539", "0.57079804", "0.5655112", "0.5655112", "0.56493205", "0.56448364", "0.56448364", "0.56448364", "0.56448364", "0.56448364", "0.56448364", "0.56411046", "0.5620769", "0.5589933", "0.5565262", "0.55268425", "0.55101144", "0.5497936", "0.54970926", "0.54931164", "0.5478741", "0.5460186", "0.5460186", "0.5460186", "0.5460186", "0.54586583", "0.5444291", "0.5444291", "0.5436457", "0.54254746", "0.54185325", "0.54014444", "0.54014444", "0.53984797", "0.53984797", "0.53984797", "0.53984797", "0.53984797", "0.538245", "0.5366722", "0.5358721", "0.5358721", "0.53584754", "0.5357832", "0.5354317", "0.5350952", "0.5350024", "0.53281283", "0.53157574", "0.53157574", "0.53157574", "0.5312634", "0.53039855", "0.5298228", "0.52967125", "0.5289005", "0.5289005", "0.52831054", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484", "0.5281484" ]
0.0
-1
much of the code for this section originated at and is used here in a modified form with Peter Wooley's consent
function FavIcon(gPlusIcon) { var self = this; this.self = this; this.src = gPlusIcon; this.foreground = "#2c3323"; this.background = "#fef4ac"; this.borderColor = "#fef4ac"; this.construct = function() { this.head = document.getElementsByTagName('head')[0]; this.pixelMaps = { numbers: [ [ [0,1,1,0], [1,0,0,1], [1,0,0,1], [1,0,0,1], [0,1,1,0] ], [ [0,1,0], [1,1,0], [0,1,0], [0,1,0], [1,1,1] ], [ [1,1,1,0], [0,0,0,1], [0,1,1,0], [1,0,0,0], [1,1,1,1] ], [ [1,1,1,0], [0,0,0,1], [0,1,1,0], [0,0,0,1], [1,1,1,0] ], [ [0,0,1,0], [0,1,1,0], [1,0,1,0], [1,1,1,1], [0,0,1,0] ], [ [1,1,1,1], [1,0,0,0], [1,1,1,0], [0,0,0,1], [1,1,1,0] ], [ [0,1,1,0], [1,0,0,0], [1,1,1,0], [1,0,0,1], [0,1,1,0] ], [ [1,1,1,1], [0,0,0,1], [0,0,1,0], [0,1,0,0], [0,1,0,0] ], [ [0,1,1,0], [1,0,0,1], [0,1,1,0], [1,0,0,1], [0,1,1,0] ], [ [0,1,1,0], [1,0,0,1], [0,1,1,1], [0,0,0,1], [0,1,1,0] ], ] }; return true; }; this.getIconCanvas = function(callback) { if(!self.iconCanvas) { self.iconCanvas = document.createElement('canvas'); self.iconCanvas.height = self.iconCanvas.width = 16; var image = new Image(); $(image).load(function() { // fill the canvas with the background favicon's data var ctx = self.iconCanvas.getContext('2d'); ctx.drawImage(image, 0, 2, 14, 14); callback(self.iconCanvas); }); image.src = self.src; } else { callback(self.iconCanvas); } }; this.getBadgedIcon = function(unread, callback) { if(!self.textedCanvas) { self.textedCanvas = []; } if(!self.textedCanvas[unread]) { self.getIconCanvas(function(iconCanvas) { var textedCanvas = document.createElement('canvas'); textedCanvas.height = textedCanvas.width = iconCanvas.width; var ctx = textedCanvas.getContext('2d'); ctx.drawImage(iconCanvas, 0, 0); ctx.fillStyle = self.background; ctx.strokeStyle = self.border ? self.border : '#000000'; ctx.strokeWidth = 1; var count = unread.length; var bgHeight = self.pixelMaps.numbers[0].length; var bgWidth = 0; var padding = count > 2 ? 0 : 1; for(var index = 0; index < count; index++) { bgWidth += self.pixelMaps.numbers[unread[index]][0].length; if(index < count-1) { bgWidth += padding; } } bgWidth = bgWidth > textedCanvas.width-4 ? textedCanvas.width-4 : bgWidth; ctx.fillRect(textedCanvas.width-bgWidth-4,1,bgWidth+4,bgHeight+4); var digit; var digitsWidth = bgWidth; for(var index = 0; index < count; index++) { digit = unread[index]; if (self.pixelMaps.numbers[digit]) { var map = self.pixelMaps.numbers[digit]; var height = map.length; var width = map[0].length; ctx.fillStyle = self.foreground; for (var y = 0; y < height; y++) { for (var x = 0; x < width; x++) { if(map[y][x]) { ctx.fillRect(14- digitsWidth + x, y+3, 1, 1); } } } digitsWidth -= width + padding; } } if(self.border) { ctx.strokeRect(textedCanvas.width-bgWidth-3.5,1.5,bgWidth+3,bgHeight+3); } self.textedCanvas[unread] = textedCanvas; callback(self.textedCanvas[unread].toDataURL('image/png')); }); } else { callback(self.textedCanvas[unread].toDataURL('image/png')); } }; this.setIcon = function(icon) { var links = self.head.getElementsByTagName("link"); for (var i = 0; i < links.length; i++) if ((links[i].rel == "shortcut icon" || links[i].rel=="icon") && links[i].href != icon) self.head.removeChild(links[i]); else if(links[i].href == icon) return; var newIcon = document.createElement("link"); newIcon.type = "image/png"; newIcon.rel = "shortcut icon"; newIcon.href = icon; self.head.appendChild(newIcon); var shim = document.createElement('iframe'); shim.width = shim.height = 0; document.body.appendChild(shim); shim.src = "icon"; document.body.removeChild(shim); }; this.set = function(num) { if(typeof(num) == 'undefined' || (!num && num.toString() != '0')) num = ''; if(num != '') { self.getBadgedIcon(num.toString(), function(src) { self.setIcon(src); }); } else { self.setIcon(this.src); } }; this.toString = function() { return '[object FavIconAlerts]'; }; return this.construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected internal function m252() {}", "private internal function m248() {}", "transient final protected internal function m174() {}", "private public function m246() {}", "transient protected internal function m189() {}", "transient final private protected internal function m167() {}", "transient private protected internal function m182() {}", "transient private internal function m185() {}", "static private protected internal function m118() {}", "transient final private protected public internal function m166() {}", "function _w18sub() {\n\tvar _w18userinfo_out = {};\n\tif( typeof localStorage !== \"undefined\" ) {\n\t\tif( localStorage.getItem( \"_w18userinfo\" ) !== null ) {\n\t\t\t_w18userinfo_out = localStorage.getItem( \"_w18userinfo\" );\n\t\t\t_w18userinfo_out = unescape( _w18userinfo_out );\n\t\t\tvar contact = JSON.parse( _w18userinfo_out );\n\t\t\t//console.log('_w18userinfo_out = ', contact);\n\t\t\tfor(var contactItem in contact){\n\t\t\t //console.log(\"Key=\"+contactItem);\n\t\t\t //console.log(contact[contactItem]);\n\t\t\t if(contactItem == 'interest_channel' || contactItem == 'interest_bucket' || contactItem == 'logged_in' || contactItem == 'extra'){\n\t\t\t\t//console.log(contact[contactItem]);\n\t\t\t\tfor(var contactItemVal in contact[contactItem]){\n\t\t\t\t //console.log(contact[contactItem][contactItemVal]+\"<<<<<<<<<<<>>>>>>>>>>>\"+contactItemVal);\n\t\t\t\t googletag.pubads().setTargeting( contactItemVal,contact[contactItem][contactItemVal] );\n\t\t\t\t}\n\t\t\t }\n\t\t\t else if(contactItem == 'vernacular' )\n\t\t\t {\n\t\t\t\t//console.log(contact[contactItem]);\n\t\t\t\tgoogletag.pubads().setTargeting( contactItem,contact[contactItem] );\n\t\t\t }\n\t\t\t else if(contactItem == 'interest_platform' )\n\t\t\t {\n\t\t\t\t//console.log(\"interest_platform\");\n\t\t\t\t//console.log(contact[contactItem]);\n\t\t\t\tfor(var contactItemVal in contact[contactItem])\n\t\t\t\t{\n\t\t\t\t //console.log(\"interest_platform\");\n\t\t\t\t //console.log(contactItemVal);\n\t\t\t\t //console.log(contact[contactItem][contactItemVal]);\n\t\t\t\t googletag.pubads().setTargeting( contactItemVal,contact[contactItem][contactItemVal]);\n\t\t\t\t for(var platform_name in contact[contactItem][contactItemVal] )\n\t\t\t\t {\n\t\t\t\t\t//console.log(contact[contactItem][contactItemVal][platform_name]);\n\t\t\t\t\t//googletag.pubads().setTargeting( contactItemVal,contact[contactItem][contactItemVal][platform_name] );\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t }\n\t\t\t};\n\t\t}\n\t}\n\treturn false;\n}", "static private internal function m121() {}", "function FairUseRationale() {\n if((wgPageName == 'Special:Upload' || wgPageName == 'Special:MultipleUpload') && document.getElementById('wpDestFile').value == '') {\n document.getElementById('wpUploadDescription').value = '== Source ==\\n\\n== Licensing ==\\n\\n[[Category:';\n }\n}", "function TermsServices_elementsExtraJS() {\n // screen (TermsServices) extra code\n\n }", "static final private internal function m106() {}", "function main()\r\n\t{\r\n\t\tif ($(\"font[color*='#007700']\").length>0)\r\n\t\t{\r\n\t\t\tvar captchars = $(\"img[src*='cap_']\");\r\n\t\t\tvar capText='';\r\n\t\t\t$(\"img[src*='slow_1']\").each(function(){capText+= GetCapchar(captchars[GetImgNumber(this.src)-1].src);});\r\n\t\t\t$(\"[onpaste*='return false;']\").attr('onpaste','return true;')\r\n\t\t\t$(\"input[name*='kod']\").attr('value','KAV2009-377333');\r\n\t\t\t$(\"input[name*='captcha']\").attr('value',capText);\r\n\t\t\t$(\"input[name*='zatwierdz']\").attr('value','Register');\r\n\t\t\t$(\"textarea[name*='adres']\").attr('value','Wydział do Foresight\\r\\nul. Wspólna 1/2\\r\\n00-519 Warszawa 52');\r\n\t\t\t$($(\"b\")[2]).html('Code');\r\n\t\t\t$($(\"b\")[3]).html('Your Name');\r\n\t\t\t$($(\"b\")[4]).html('<span>Your Email address</span><font color=\"red\">*</font>');\r\n\t\t\t$($(\"small\")[0]).html('This e-mail will be used to send the activation code');\r\n\t\t\t$($(\"b\")[5]).html('Your address');\r\n\t\t\t$($(\"tr\")[23]).hide();\r\n\t\t\t$($(\"tr\")[24]).hide();\r\n\t\t\t$($(\"tr\")[25]).hide();\r\n\t\t\t$($(\"tr\")[26]).hide();\r\n\t\t}\r\n\t}", "static private protected public internal function m117() {}", "transient final private internal function m170() {}", "static transient final private protected internal function m40() {}", "static transient private protected internal function m55() {}", "function getLicenseInfo() {\n\n\tvar l = \"\";\n\t\n\tl += \"Copyright 2014 DesignaQuark: Josiah Neuberger\\n\\n\";\n\t\n\tl += \"Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n\";\n\tl += \"you may not use this file except in compliance with the License.\\n\";\n\tl += \"You may obtain a copy of the License at\\n\\n\";\n\n\tl += \"\thttp://www.apache.org/licenses/LICENSE-2.0\\n\\n\";\n\n\tl += \"Unless required by applicable law or agreed to in writing, software\\n\";\n\tl += \"distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n\";\n\tl += \"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n\";\n\tl += \"See the License for the specific language governing permissions and\\n\";\n\tl += \"limitations under the License.\\n\";\n\tl += \"return license;\\n\";\n\t\n\treturn l;\n}", "function FairUseRationale() {\n\tif((wgPageName == 'Special:Upload' || wgPageName == 'Special:MultipleUpload') && document.getElementById('wpDestFile').value == '') {\n\t\tdocument.getElementById('wpUploadDescription').value = '== Source ==\\n\\n== Licensing ==\\n\\n[[Category:';\n\t}\n}", "static final private protected internal function m103() {}", "static transient final protected internal function m47() {}", "function i(t){\"use strict\";var a=this,n=e;a.s=t,a._c=\"s_m\",n.s_c_in||(n.s_c_il=[],n.s_c_in=0),a._il=n.s_c_il,a._in=n.s_c_in,a._il[a._in]=a,n.s_c_in++,a.version=\"1.0\";var i,o,r,s=\"pending\",c=\"resolved\",d=\"rejected\",l=\"timeout\",u=!1,p={},m=[],g=[],f=0,b=!1,h=function(){var e={};e.requiredVarList=[\"supplementalDataID\",\"timestamp\",\"dynamicVariablePrefix\",\"visitorID\",\"marketingCloudVisitorID\",\"analyticsVisitorID\",\"audienceManagerLocationHint\",\"authState\",\"fid\",\"vmk\",\"visitorMigrationKey\",\"visitorMigrationServer\",\"visitorMigrationServerSecure\",\"charSet\",\"visitorNamespace\",\"cookieDomainPeriods\",\"fpCookieDomainPeriods\",\"cookieLifetime\",\"pageName\",\"pageURL\",\"referrer\",\"contextData\",\"currencyCode\",\"lightProfileID\",\"lightStoreForSeconds\",\"lightIncrementBy\",\"retrieveLightProfiles\",\"deleteLightProfiles\",\"retrieveLightData\"],e.accountVarList=e.requiredVarList.concat([\"purchaseID\",\"variableProvider\",\"channel\",\"server\",\"pageType\",\"transactionID\",\"campaign\",\"state\",\"zip\",\"events\",\"events2\",\"products\",\"audienceManagerBlob\",\"tnt\"]),e.lightRequiredVarList=[\"timestamp\",\"charSet\",\"visitorNamespace\",\"cookieDomainPeriods\",\"cookieLifetime\",\"contextData\",\"lightProfileID\",\"lightStoreForSeconds\",\"lightIncrementBy\"],e.lightVarList=e.lightRequiredVarList.slice(0),e.accountConfigList=[\"account\",\"allAccounts\",\"debugTracking\",\"visitor\",\"visitorOptedOut\",\"trackOffline\",\"offlineLimit\",\"offlineThrottleDelay\",\"offlineFilename\",\"usePlugins\",\"doPlugins\",\"configURL\",\"visitorSampling\",\"visitorSamplingGroup\",\"linkObject\",\"clickObject\",\"linkURL\",\"linkName\",\"linkType\",\"trackDownloadLinks\",\"trackExternalLinks\",\"trackClickMap\",\"trackInlineStats\",\"linkLeaveQueryString\",\"linkTrackVars\",\"linkTrackEvents\",\"linkDownloadFileTypes\",\"linkExternalFilters\",\"linkInternalFilters\",\"useForcedLinkTracking\",\"forcedLinkTrackingTimeout\",\"trackingServer\",\"trackingServerSecure\",\"ssl\",\"abort\",\"mobile\",\"dc\",\"lightTrackVars\",\"maxDelay\",\"expectSupplementalData\",\"usePostbacks\",\"AudienceManagement\"];for(var t=0;250>=t;t++)76>t&&(e.accountVarList.push(\"prop\"+t),e.lightVarList.push(\"prop\"+t)),e.accountVarList.push(\"eVar\"+t),e.lightVarList.push(\"eVar\"+t),6>t&&e.accountVarList.push(\"hier\"+t),4>t&&e.accountVarList.push(\"list\"+t);var a=[\"pe\",\"pev1\",\"pev2\",\"pev3\",\"latitude\",\"longitude\",\"resolution\",\"colorDepth\",\"javascriptVersion\",\"javaEnabled\",\"cookiesEnabled\",\"browserWidth\",\"browserHeight\",\"connectionType\",\"homepage\",\"pageURLRest\"];return e.accountVarList=e.accountVarList.concat(a),e.requiredVarList=e.requiredVarList.concat(a),e}();a.newCall=!1,a.newCallVariableOverrides=null,a.hitCount=0,a.timeout=1e3,a.currentHit=null,a.backup=function(e,t,a){var n,i,o,r;for(t=t||{},n=0;2>n;n++)for(i=n>0?h.accountConfigList:h.accountVarList,o=0;o<i.length;o++)r=i[o],t[r]=e[r],a||t[r]||(t[\"!\"+r]=1);return t},a.restore=function(e,t,a){var n,i,o,r,s,c,d=!0;for(n=0;2>n;n++)for(i=n>0?h.accountConfigList:h.accountVarList,o=0;o<i.length;o++)if(r=i[o],s=e[r],s||e[\"!\"+r]){if(!a&&(\"contextData\"==r||\"retrieveLightData\"==r)&&t[r])for(c in t[r])s[c]||(s[c]=t[r][c]);t[r]=s}return d},a.createHitMeta=function(e,t){var n,i=a.s,o=[],r=[];return t=t||{},n={id:e,delay:!1,restorePoint:f,status:c,promise:Promise.resolve(),backup:{s:{},sSet:{},variableOverrides:{}},values:{s:{},variableOverrides:{}},timeout:!1},o=a.replacePromises(i,n.values.s),r=a.replacePromises(t,n.values.variableOverrides),n.backup.s=a.backup(i),n.backup.sSet=a.backup(i,null,!0),n.backup.variableOverrides=t,(o&&o.length>0||r&&r.length>0)&&(n.delay=!0,n.status=s,n.promise=Promise.all([Promise.all(o),Promise.all(r)]).then(function(){n.delay=!1,n.status=c,n.timeout&&clearTimeout(n.timeout)}),a.timeout&&(n.timeout=setTimeout(function(){n.delay=!1,n.status=l,n.timeout&&clearTimeout(n.timeout),a.sendPendingHits()},a.timeout))),n},a.replacePromises=function(e,t){var a,n,i,o,r,l,u=[];t=t||{},o=function(e,t){return function(a){t[e].value=a,t[e].status=c}},r=function(e,t){return function(a){t[e].status=d,t[e].exception=a}},l=function(e,t,a){var n=e[t];n instanceof Promise?(a[t]=a[t]||{},\"contextData\"===t||\"retrieveLightData\"===t?e[t]={}:e[t]=\"\",a[t].status=s,u.push(n.then(o(t,a))[\"catch\"](r(t,a)))):\"object\"==typeof n&&null!==n&&n.promise instanceof Promise&&(a[t]=a[t]||{},\"contextData\"===t||\"retrieveLightData\"===t?e[t]={}:e[t]=\"\",n.hasOwnProperty(\"unresolved\")&&(a[t].value=n.unresolved),a[t].status=s,u.push(n.promise.then(o(t,a))[\"catch\"](r(t,a))))};for(a in e)if(e.hasOwnProperty(a))if(i=e[a],\"contextData\"===a||\"retrieveLightData\"===a)if(i instanceof Promise||\"object\"==typeof i&&null!==i&&i.promise instanceof Promise)l(e,a,t);else{t[a]={isGroup:!0};for(n in i)i.hasOwnProperty(n)&&l(i,n,t[a])}else l(e,a,t);return u},a.metaToObject=function(e){var t,n,i,o,r=(a.s,{});if(e)for(t in e)if(e.hasOwnProperty(t))if(i=e[t],\"contextData\"!==t&&\"retrieveLightData\"!==t||!i.isGroup)i.value&&i.status===c&&(r[t]=i.value);else{r[t]={};for(n in i)i.hasOwnProperty(n)&&(o=i[n],o.value&&o.status===c&&(r[t][n]=o.value))}return r},a.getMeta=function(e){return e&&m[e]?m[e]:m},a.forceReady=function(){u=!0,a.sendPendingHits()},i=t.isReadyToTrack,t.isReadyToTrack=function(){return!!(!a.newCall&&i()&&g&&g.length>0&&(u||m[g[0]]&&!m[g[0]].delay))},o=t.callbackWhenReadyToTrack,t.callbackWhenReadyToTrack=function(e,n,i){var r,s;return n!==t.track?o(e,n,i):void(a.newCall&&(r=a.hitCount++,g.push(r),s=a.createHitMeta(r,a.newCallVariableOverrides),m[r]=s,b||(b=setInterval(a.sendPendingHits,100)),s.promise.then(function(){a.sendPendingHits()})))},r=t.t,t.t=t.track=function(e,t,n){n||(a.newCall=!0,a.newCallVariableOverrides=e),r(e,t),n||(a.newCall=!1,a.newCallVariableOverrides=null,a.sendPendingHits())},a.sendPendingHits=function(){for(var e,t,n,i,o,r=a.s;r.isReadyToTrack();){for(e=m[g[0]],a.currentHit=e,i={},o={},a.trigger(\"hitBeforeSend\",e),o.marketingCloudVisitorID=r.marketingCloudVisitorID,o.visitorOptedOut=r.visitorOptedOut,o.analyticsVisitorID=r.analyticsVisitorID,o.audienceManagerLocationHint=r.audienceManagerLocationHint,o.audienceManagerBlob=r.audienceManagerBlob,a.restore(e.backup.s,r),t=e.restorePoint;t<g[0];t++)n=a.metaToObject(m[t].values.s),delete n.referrer,delete n.resolution,delete n.colorDepth,delete n.javascriptVersion,delete n.javaEnabled,delete n.cookiesEnabled,delete n.browserWidth,delete n.browserHeight,delete n.connectionType,delete n.homepage,a.restore(n,o);a.restore(e.backup.sSet,o),a.restore(a.metaToObject(e.values.s),o),a.restore(e.backup.variableOverrides,i),a.restore(a.metaToObject(e.values.variableOverrides),i),r.track(i,o,!0),f=g.shift(),a.trigger(\"hitAfterSend\",e),a.currentHit=null}b&&g.length<1&&(clearInterval(b),b=!1)},i()||o(a,function(){a.sendPendingHits()},[]),a.on=function(e,t){p[e]||(p[e]=[]),p[e].push(t)},a.trigger=function(e,t){var a,n,i,o=!1;if(p[e])for(a=0,n=p[e].length;n>a;a++){i=p[e][a];try{i(t),o=!0}catch(e){}}else o=!0;return o},a._s=function(){a.trigger(\"_s\")},a._d=function(){return a.trigger(\"_d\"),0},a._g=function(){a.trigger(\"_g\")},a._t=function(){a.trigger(\"_t\")}}", "function userinfo_requester_routines() {\n\n}", "static transient final private internal function m43() {}", "function asiCallOnload(){\n var SDM_noasci = ['meinauto'];\n var asi_p = 'IpZElE,Rdkg7V,NkqpjZ,acWaVx,RmJKxA,BnG7vD,oeu2b6,foY3mB'; //Produktion\n var asiPqTag = false; //Initialisierung, Antwort setzt auf true\n try {\n if ((sdm_vers >= 1) && !SDM_head.isinarray(SDM_noasci, SDM_resource)) {\n fXm_Head.create.twin(escape('//pq-direct.revsci.net/pql?placementIdList=' + asi_p), SDM_head.prep.asigmd, true);\n }\n } catch (ignore) {}\n\n // Audience Science Data Sharing\n if (!SDM_head.isinarray(SDM_noasci, SDM_resource)) {\n fXm_Head.create.script('//js.revsci.net/gateway/gw.js?csid=F09828&auto=t&bpid=Stroer');\n }\n}", "static transient private protected public internal function m54() {}", "function a(t){\"use strict\";var n=this,i=e;n.s=t,n._c=\"s_m\",i.s_c_in||(i.s_c_il=[],i.s_c_in=0),n._il=i.s_c_il,n._in=i.s_c_in,n._il[n._in]=n,i.s_c_in++,n.version=\"1.0\";var a,r,o,s=\"pending\",c=\"resolved\",u=\"rejected\",l=\"timeout\",d=!1,f={},p=[],g=[],h=0,m=!1,v=function(){var e={};e.requiredVarList=[\"supplementalDataID\",\"timestamp\",\"dynamicVariablePrefix\",\"visitorID\",\"marketingCloudVisitorID\",\"analyticsVisitorID\",\"audienceManagerLocationHint\",\"authState\",\"fid\",\"vmk\",\"visitorMigrationKey\",\"visitorMigrationServer\",\"visitorMigrationServerSecure\",\"charSet\",\"visitorNamespace\",\"cookieDomainPeriods\",\"fpCookieDomainPeriods\",\"cookieLifetime\",\"pageName\",\"pageURL\",\"referrer\",\"contextData\",\"currencyCode\",\"lightProfileID\",\"lightStoreForSeconds\",\"lightIncrementBy\",\"retrieveLightProfiles\",\"deleteLightProfiles\",\"retrieveLightData\"],e.accountVarList=e.requiredVarList.concat([\"purchaseID\",\"variableProvider\",\"channel\",\"server\",\"pageType\",\"transactionID\",\"campaign\",\"state\",\"zip\",\"events\",\"events2\",\"products\",\"audienceManagerBlob\",\"tnt\"]),e.lightRequiredVarList=[\"timestamp\",\"charSet\",\"visitorNamespace\",\"cookieDomainPeriods\",\"cookieLifetime\",\"contextData\",\"lightProfileID\",\"lightStoreForSeconds\",\"lightIncrementBy\"],e.lightVarList=e.lightRequiredVarList.slice(0),e.accountConfigList=[\"account\",\"allAccounts\",\"debugTracking\",\"visitor\",\"visitorOptedOut\",\"trackOffline\",\"offlineLimit\",\"offlineThrottleDelay\",\"offlineFilename\",\"usePlugins\",\"doPlugins\",\"configURL\",\"visitorSampling\",\"visitorSamplingGroup\",\"linkObject\",\"clickObject\",\"linkURL\",\"linkName\",\"linkType\",\"trackDownloadLinks\",\"trackExternalLinks\",\"trackClickMap\",\"trackInlineStats\",\"linkLeaveQueryString\",\"linkTrackVars\",\"linkTrackEvents\",\"linkDownloadFileTypes\",\"linkExternalFilters\",\"linkInternalFilters\",\"useForcedLinkTracking\",\"forcedLinkTrackingTimeout\",\"trackingServer\",\"trackingServerSecure\",\"ssl\",\"abort\",\"mobile\",\"dc\",\"lightTrackVars\",\"maxDelay\",\"expectSupplementalData\",\"usePostbacks\",\"AudienceManagement\"];for(var t=0;250>=t;t++)76>t&&(e.accountVarList.push(\"prop\"+t),e.lightVarList.push(\"prop\"+t)),e.accountVarList.push(\"eVar\"+t),e.lightVarList.push(\"eVar\"+t),6>t&&e.accountVarList.push(\"hier\"+t),4>t&&e.accountVarList.push(\"list\"+t);var n=[\"pe\",\"pev1\",\"pev2\",\"pev3\",\"latitude\",\"longitude\",\"resolution\",\"colorDepth\",\"javascriptVersion\",\"javaEnabled\",\"cookiesEnabled\",\"browserWidth\",\"browserHeight\",\"connectionType\",\"homepage\",\"pageURLRest\"];return e.accountVarList=e.accountVarList.concat(n),e.requiredVarList=e.requiredVarList.concat(n),e}(),b=!1;n.newHit=!1,n.newHitVariableOverrides=null,n.hitCount=0,n.timeout=1e3,n.currentHit=null,n.backup=function(e,t,n){var i,a,r,o;for(t=t||{},i=0;2>i;i++)for(a=i>0?v.accountConfigList:v.accountVarList,r=0;r<a.length;r++)o=a[r],t[o]=e[o],n||t[o]||(t[\"!\"+o]=1);return t},n.restore=function(e,t,n){var i,a,r,o,s,c,u=!0;for(i=0;2>i;i++)for(a=i>0?v.accountConfigList:v.accountVarList,r=0;r<a.length;r++)if(o=a[r],s=e[o],s||e[\"!\"+o]){if(!n&&(\"contextData\"==o||\"retrieveLightData\"==o)&&t[o])for(c in t[o])s[c]||(s[c]=t[o][c]);t[o]=s}return u},n.createHitMeta=function(e,t){var i,a=n.s,r=[],o=[];return b&&console.log(a.account+\" - createHitMeta\"),t=t||{},i={id:e,delay:!1,restorePoint:h,status:c,promise:Promise.resolve(),backup:{s:{},sSet:{},variableOverrides:{}},values:{s:{},variableOverrides:{}},timeout:!1},r=n.replacePromises(a,i.values.s),o=n.replacePromises(t,i.values.variableOverrides),i.backup.s=n.backup(a),i.backup.sSet=n.backup(a,null,!0),i.backup.variableOverrides=t,(r&&r.length>0||o&&o.length>0)&&(i.delay=!0,i.status=s,i.promise=Promise.all([Promise.all(r),Promise.all(o)]).then(function(){i.delay=!1,i.status=c,i.timeout&&clearTimeout(i.timeout)}),n.timeout&&(i.timeout=setTimeout(function(){i.delay=!1,i.status=l,i.timeout&&clearTimeout(i.timeout),n.sendPendingHits()},n.timeout))),i},n.replacePromises=function(e,t){var n,i,a,r,o,l,d=[];t=t||{},r=function(e,t){return function(n){t[e].value=n,t[e].status=c}},o=function(e,t){return function(n){t[e].status=u,t[e].exception=n}},l=function(e,t,n){var i=e[t];i instanceof Promise?(n[t]=n[t]||{},e[t]=\"contextData\"===t||\"retrieveLightData\"===t?{}:\"\",n[t].status=s,d.push(i.then(r(t,n))[\"catch\"](o(t,n)))):\"object\"==typeof i&&null!==i&&i.promise instanceof Promise&&(n[t]=n[t]||{},e[t]=\"contextData\"===t||\"retrieveLightData\"===t?{}:\"\",i.hasOwnProperty(\"unresolved\")&&(n[t].value=i.unresolved),n[t].status=s,d.push(i.promise.then(r(t,n))[\"catch\"](o(t,n))))};for(n in e)if(e.hasOwnProperty(n))if(a=e[n],\"contextData\"===n||\"retrieveLightData\"===n)if(a instanceof Promise||\"object\"==typeof a&&null!==a&&a.promise instanceof Promise)l(e,n,t);else{t[n]={isGroup:!0};for(i in a)a.hasOwnProperty(i)&&l(a,i,t[n])}else l(e,n,t);return d},n.metaToObject=function(e){var t,i,a,r,o=(n.s,{});if(e)for(t in e)if(e.hasOwnProperty(t))if(a=e[t],\"contextData\"!==t&&\"retrieveLightData\"!==t||!a.isGroup)a.value&&a.status===c&&(o[t]=a.value);else{o[t]={};for(i in a)a.hasOwnProperty(i)&&(r=a[i],r.value&&r.status===c&&(o[t][i]=r.value))}return o},n.getMeta=function(e){return e&&p[e]?p[e]:p},n.forceReady=function(){d=!0,n.sendPendingHits()},a=t.isReadyToTrack,t.isReadyToTrack=function(){if(!n.newHit&&a()&&g&&g.length>0&&(d||p[g[0]]&&!p[g[0]].delay))return b&&console.log(t.account+\" - isReadyToTrack - true\"),!0;if(b&&(console.log(t.account+\" - isReadyToTrack - false\"),console.log(t.account+\" - isReadyToTrack - isReadyToTrack(original) - \"+a()),!a()))try{throw Error(\"Debugging Call stack\")}catch(e){console.log(t.account+\" - isReadyToTrack - \"+e.stack)}return!1},r=t.callbackWhenReadyToTrack,t.callbackWhenReadyToTrack=function(e,i,a){var o,s;return b&&console.log(t.account+\" - callbackWhenReadyToTrack\"),i!==t.track?r(e,i,a):void(n.newHit&&(o=n.hitCount++,g.push(o),s=n.createHitMeta(o,n.newHitVariableOverrides),p[o]=s,m||(m=setInterval(n.sendPendingHits,100)),s.promise.then(function(){n.sendPendingHits()})))},o=t.t,t.t=t.track=function(e,i,a){b&&console.log(t.account+\" - track\"),a||(n.newHit=!0,n.newHitVariableOverrides=e),o(e,i),a||(n.newHit=!1,n.newHitVariableOverrides=null,n.sendPendingHits())},n.sendPendingHits=function(){var e,t,i,a,r,o=n.s;for(b&&console.log(o.account+\" - sendPendingHits\");o.isReadyToTrack();){for(e=p[g[0]],n.currentHit=e,a={},r={},n.trigger(\"hitBeforeSend\",e),r.marketingCloudVisitorID=o.marketingCloudVisitorID,r.visitorOptedOut=o.visitorOptedOut,r.analyticsVisitorID=o.analyticsVisitorID,r.audienceManagerLocationHint=o.audienceManagerLocationHint,r.audienceManagerBlob=o.audienceManagerBlob,b&&console.log(o.account+\" - sendPendingHits - s.audienceManagerBlob => \"+o.audienceManagerBlob),n.restore(e.backup.s,o),t=e.restorePoint;t<g[0];t++)i=n.metaToObject(p[t].values.s),delete i.referrer,delete i.resolution,delete i.colorDepth,delete i.javascriptVersion,delete i.javaEnabled,delete i.cookiesEnabled,delete i.browserWidth,delete i.browserHeight,delete i.connectionType,delete i.homepage,n.restore(i,r);b&&console.log(o.account+\" - sendPendingHits - s.audienceManagerBlob => \"+o.audienceManagerBlob),n.restore(e.backup.sSet,r),b&&console.log(o.account+\" - sendPendingHits - s.audienceManagerBlob => \"+o.audienceManagerBlob),n.restore(n.metaToObject(e.values.s),r),b&&console.log(o.account+\" - sendPendingHits - s.audienceManagerBlob => \"+o.audienceManagerBlob),n.restore(e.backup.variableOverrides,a),n.restore(n.metaToObject(e.values.variableOverrides),a),o.track(a,r,!0),b&&console.log(o.account+\" - sendPendingHits - s.audienceManagerBlob => \"+o.audienceManagerBlob),h=g.shift(),n.trigger(\"hitAfterSend\",e),n.currentHit=null}m&&g.length<1&&(clearInterval(m),m=!1)},b&&console.log(t.account+\" - INITIAL isReadyToTrack - \"+a()),a()||r(n,function(){if(b)try{throw Error(\"Debugging Call stack\")}catch(e){console.log(t.account+\" - callbackWhenReadyToTrack - \"+e.stack)}n.sendPendingHits()},[]),n.on=function(e,t){f[e]||(f[e]=[]),f[e].push(t)},n.trigger=function(e,t){var n,i,a,r=!1;if(f[e])for(n=0,i=f[e].length;i>n;n++){a=f[e][n];try{a(t),r=!0}catch(o){}}else r=!0;return r},n._s=function(){n.trigger(\"_s\")},n._d=function(){return n.trigger(\"_d\"),0},n._g=function(){n.trigger(\"_g\")},n._t=function(){n.trigger(\"_t\")}}", "function GetAttendcode()\n{\n\tif(typeof(TEAttendCode)!=\"undefined\")\n\t\tPerform(TEAttendCode)\n\telse\n\t{\n\t\tTEAttendCode \t= new Array()\n\t\tvar obj \t\t= new DMEObject(authUser.prodline,\"ATTENDCODE\")\n\t\t\tobj.out \t= \"JAVASCRIPT\"\n\t\t\tobj.field \t= \"attend-code;description\"\n\t\t\tobj.key \t= authUser.company+\"\"\n\t\t\tobj.max \t= \"600\"\n\t\t\tobj.debug \t= false;\n\t\tDME(obj,\"jsreturn\")\n\t}\n}", "static transient final private protected public internal function m39() {}", "function getQrCode () {\n\n}", "transient private public function m183() {}", "transient private protected public internal function m181() {}", "function specialtyAssignmentsProviderProcessing() {\n\n}", "function Account_elementsExtraJS() {\n // screen (Account) extra code\n /* mobilecollapsblock_14_25_26 */\n $(\"#Account_mobilecollapsblock_14_25_26 .ui-collapsible-heading-toggle\").attr(\"tabindex\", \"1\");\n /* mobilecollapsblock_34_45_59_60 */\n $(\"#Account_mobilecollapsblock_34_45_59_60 .ui-collapsible-heading-toggle\").attr(\"tabindex\", \"4\");\n /* mobilecollapsblock_34_45_72_73 */\n $(\"#Account_mobilecollapsblock_34_45_72_73 .ui-collapsible-heading-toggle\").attr(\"tabindex\", \"4\");\n /* mobilecollapsblock_34_45_85_86 */\n $(\"#Account_mobilecollapsblock_34_45_85_86 .ui-collapsible-heading-toggle\").attr(\"tabindex\", \"4\");\n /* mobilecollapsblock_34_45_111_112 */\n $(\"#Account_mobilecollapsblock_34_45_111_112 .ui-collapsible-heading-toggle\").attr(\"tabindex\", \"4\");\n }", "static protected internal function m125() {}", "function detailedReviewPage_elementsExtraJS() {\n // screen (detailedReviewPage) extra code\n }", "function pbl_e5831ee218d2e811a96c000d3a3099e5(eventContext) {\n\ttry {\n\t\tvar v0 = (!Mscrm.BusinessRules.Utility.isNull(eventContext) && typeof eventContext.getFormContext === \"function\") ? eventContext.getFormContext().data.entity : Xrm.Page.data.entity;\n\t\tvar v1 = v0.attributes.get('caseorigincode');\n\t\tvar v2 = v0.attributes.get('checkemail');\n\t\tvar v3 = v0.attributes.get('casetypecode');\n\t\tvar v4 = v0.attributes.get('msdyn_incidenttype');\n\t\tvar v5 = v0.attributes.get('isescalated');\n\t\tvar v6 = v0.attributes.get('customerid');\n\t\tvar v7 = v0.attributes.get('escalatedon');\n\t\tvar v8 = v0.attributes.get('modifiedon');\n\t\tvar v9 = v0.attributes.get('description');\n\t\tvar v10 = v0.attributes.get('socialprofileid');\n\t\tvar v11 = v0.attributes.get('emailaddress');\n\t\tvar v13 = v0.attributes.get('title');\n\t\tvar v14 = {\n\t\t\tmessage: Mscrm.BusinessRulesScript.GetResourceString('c301a11d-7151-44dc-a849-0b27d41c70f1', 'Check your email'),\n\t\t\tactions: null\n\t\t};\n\t\tvar v15 = '';\n\t\tvar v17 = function (op1, op2, e) {\n\t\t\treturn e(op1, op2);\n\t\t};\n\t\tif (((v1) == undefined || (v1) == null || (v1) === \"\") || ((v2) == undefined || (v2) == null || (v2) === \"\") || ((v3) == undefined || (v3) == null || (v3) === \"\") || ((v4) == undefined || (v4) == null || (v4) === \"\") || ((v5) == undefined || (v5) == null || (v5) === \"\") || ((v6) == undefined || (v6) == null || (v6) === \"\") || ((v7) == undefined || (v7) == null || (v7) === \"\") || ((v8) == undefined || (v8) == null || (v8) === \"\") || ((v9) == undefined || (v9) == null || (v9) === \"\") || ((v10) == undefined || (v10) == null || (v10) === \"\") || ((v11) == undefined || (v11) == null || (v11) === \"\")) {\n\t\t\treturn;\n\t\t}\n\t\tvar v12 = (v1) ? v1.getValue() : null;\n\t\tvar v16 = (v3) ? v3.getValue() : null;\n\t\tvar v18 = (v9) ? v9.getValue() : null;\n\t\tif ((v12) === (1)) {\n\t\t\t(Xrm.Page.ui.getFormType() == 1 && (v13 != null && (typeof v13.getValue() === 'boolean' || (v13.getValue() === null || (typeof v13.getValue() === 'string' && v13.getValue().trim.length === 0)))) ? v13.setValue('Origin is phone') : null);\n\t\t} else if ((v12) === (2)) {\n\t\t\tv14.actions = [function () {\n\t\t\t\t\tv11.setValue('this is a recommendation');\n\t\t\t\t}\n\t\t\t];\n\t\t\tv2.controls.forEach(function (c, i) {\n\t\t\t\tc.addNotification({\n\t\t\t\t\tmessages: [Mscrm.BusinessRulesScript.GetResourceString('aeea14f7-231f-4f9f-92c3-2faeac40a124', 'Check email')],\n\t\t\t\t\tnotificationLevel: Xrm.NotificationLevel.recommendation,\n\t\t\t\t\tuniqueId: 'e5831ee2-18d2-e811-a96c-000d3a3099e5SetMessageStep3',\n\t\t\t\t\tactions: [v14]\n\t\t\t\t});\n\t\t\t});\n\t\t\tv15 = v15 + 'e5831ee2-18d2-e811-a96c-000d3a3099e5SetMessageStep3\\x3b';\n\t\t} else if ((v16) === (1)) {\n\t\t\tv4.controls.forEach(function (c, i) {\n\t\t\t\tc.setDisabled(true);\n\t\t\t});\n\t\t} else if ((v16) === (2)) {\n\t\t\tv1.controls.forEach(function (c, i) {\n\t\t\t\tc.setNotification(Mscrm.BusinessRulesScript.GetResourceString('bbeec792-00eb-40bc-886b-f5045e2073e7', 'This is a test error message'), 'e5831ee2-18d2-e811-a96c-000d3a3099e5SetMessageStep7');\n\t\t\t});\n\t\t\tv15 = v15 + 'e5831ee2-18d2-e811-a96c-000d3a3099e5SetMessageStep7\\x3b';\n\t\t} else if ((v16) === (3)) {\n\t\t\tv5.setValue(true);\n\t\t\tv6.setValue([{\n\t\t\t\t\t\tid: '\\x7bc302470e-6dcb-e811-a974-000d3a1be90a\\x7d',\n\t\t\t\t\t\tentityType: 'account',\n\t\t\t\t\t\tname: '1'\n\t\t\t\t\t}\n\t\t\t\t]);\n\t\t\tv7.setValue(v17((v8) ? v8.getUtcValue() : null, 0, function (op1, op2) {\n\t\t\t\t\tif ((op1) == undefined || (op1) == null || (op1) === \"\" || (op2) == undefined || (op2) == null || (op2) === \"\") {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tvar result = op1;\n\t\t\t\t\tresult.setDate(op1.getDate() + op2);\n\t\t\t\t\treturn result;\n\t\t\t\t}));\n\t\t} else if (v17((v18), ('Help'), function (op1, op2) {\n\t\t\t\tif ((op1) == undefined || (op1) == null || (op1) === \"\") {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn op1.toUpperCase().indexOf(op2.toUpperCase()) == 0;\n\t\t\t})) {\n\t\t\tv10.controls.forEach(function (c, i) {\n\t\t\t\tc.setVisible(false);\n\t\t\t});\n\t\t} else if (true) {\n\t\t\tv11.setRequiredLevel('required');\n\t\t}\n\t\tvar v19 = [{\n\t\t\t\t'CId': 'checkemail',\n\t\t\t\t'SId': 'e5831ee2-18d2-e811-a96c-000d3a3099e5SetMessageStep3'\n\t\t\t}, {\n\t\t\t\t'CId': 'caseorigincode',\n\t\t\t\t'SId': 'e5831ee2-18d2-e811-a96c-000d3a3099e5SetMessageStep7'\n\t\t\t}\n\t\t];\n\t\tfor (var i = 0; i < v19.length; i++) {\n\t\t\tvar l1 = v19[i];\n\t\t\tif (v15.indexOf(l1.SId + '\\x3b') === -1) {\n\t\t\t\tvar v0 = (l1.RId) ? v0.relatedEntities.get(l1.RId) : v0;\n\t\t\t\tvar attributeObject = (v0) ? v0.attributes.get(l1.CId) : null;\n\t\t\t\t(attributeObject) && attributeObject.controls.forEach(function (c, i) {\n\t\t\t\t\tc.clearNotification(l1.SId);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\tMscrm.BusinessRules.ErrorHandlerFactory.getHandler(e, arguments.callee).handleError();\n\t}\n}", "function webSecurity() {\n // initialize and assign variables\n var browser = document.getElementsByClassName(\"browser\")[0],\n version = document.getElementsByClassName(\"browser-version\")[0],\n geolocation = document.getElementsByClassName(\"geolocation\")[0],\n latitude = document.getElementsByClassName(\"geolocation-latitude\")[0],\n longitude = document.getElementsByClassName(\"geolocation-longitude\")[0],\n altitude = document.getElementsByClassName(\"geolocation-altitude\")[0],\n onLine = document.getElementsByClassName(\"online\")[0],\n platform = document.getElementsByClassName(\"platform\")[0],\n userAgant = document.getElementsByClassName(\"user-agent\")[0],\n availHeight = document.getElementsByClassName(\"available-height\")[0],\n availWidth = document.getElementsByClassName(\"available-width\")[0],\n colorDepth = document.getElementsByClassName(\"color-depth\")[0],\n height = document.getElementsByClassName(\"display-height\")[0],\n width = document.getElementsByClassName(\"display-width\")[0],\n pixelDepth = document.getElementsByClassName(\"pixel-depth\")[0];\n\n\n browser.innerHTML = navigator.appName;\n version.innerHTML = navigator.appVersion;\n geolocation.innerHTML = userPosition.latitude ? `${userPosition.latitude}, ${userPosition.longitude}` : \"Block by Browser - WHOOP!\";\n\n // GIT418 - Module 10 - Case Project\n // set positions to relevant if set otherwise assign String\n latitude.innerHTML = userPosition.latitude ? `${userPosition.latitude}` : \"Block by Browser - WHOOP!\";\n longitude.innerHTML = userPosition.latitude ? `${userPosition.longitude}` : \"Block by Browser - WHOOP!\";\n altitude.innerHTML = userAgant.altitude ? `${userPosition.altitude}` : \"Not Available\";\n\n onLine.innerHTML = navigator.onLine ? \"Online\" : \"Offline\";\n platform.innerHTML = navigator.platform;\n userAgant.innerHTML = navigator.userAgent;\n availHeight.innerHTML = screen.availHeight;\n availWidth.innerHTML = screen.availWidth;\n colorDepth.innerHTML = screen.colorDepth;\n height.innerHTML = screen.height;\n width.innerHTML = screen.width;\n pixelDepth.innerHTML = screen.pixelDepth;\n}", "function showLicenceKey() {\n routingBase.goToCurrentState('license');\n }", "function ConfirmacaoCliente_elementsExtraJS() {\n // screen (ConfirmacaoCliente) extra code\n\n }", "static transient final protected public internal function m46() {}", "function mainProcess()\n\t{\n\t\naddLookup(\"EngCSMComments\",\"1.1 Developers Agreement\",\"The construction of this project will require the applicant shall enter into a City / Developer agreement for the required infrastructure improvements. The applicant shall contact Janet Schmidt at [email protected] to schedule the development of the plans and the agreement. The City Engineer will not sign off on this project without the agreement executed by the developer. Obtaining a developer's agreement generally takes approximately 4-6 weeks, minimum. (MGO 16.23(9)c)\");\n \naddLookup(\"EngCSMComments\",\"1.2 Soil Borings\",\"Two weeks prior to recording the final plat, a soil boring report prepared by a Professional Engineer, shall be submitted to the City Engineering Division indicating a ground water table and rock conditions in the area. If the report indicates a ground water table or rock condition less than 9' below proposed street grades, a restriction shall be added to the final plat, as determined necessary by the City Engineer. (MGO 16.23(9)(d)(2) and 16.23(7)(a)(13))\");\n \naddLookup(\"EngCSMComments\",\"1.3 Impact fees\",\"This development is subject to impact fees for the_______Impact Fee District. All impact fees are due and payable at the time building permits are issued. (MGO Chapter 20)\n \nThe following note shall put the face of the plat/CSM:\nLOTS / BUILDINGS WITHIN THIS SUBDIVISION / DEVELOPMENT ARE SUBJECT TO IMPACT FEES THAT ARE DUE AND PAYABLE AT THE TIME BUILDING PERMIT(S) ARE ISSUED.\");\n /*\naddLookup(\"EngCSMComments\",\"1.4 Deferred Assments\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.1 ROW dedication\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.2 PLE grading sloping\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.3 ROW dedication for ingress/egress\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.4 Street vacation\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.5 Street design guidelines\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.6 15 ft Radii at intersections\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.7 25ft Radii at intersections\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.8 ROW width\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.9 Min Centerline Radius\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.10 Permanent cul de sac\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.11 Temp cul de sac\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.12 40ft util easement for transmission lines\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.13 No ped bike connections required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.14 PLE for ped/bike easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.15 Private easement for ped/bike\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.16 Public sanitary easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.17 Public sidewalk easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.18 Public storm easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.19 Public water easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.1 Street/SW improvements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.2 Setback\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.3 Excessive grading\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.4 Park Frontage limited\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.5 Waiver street, construct sidewalk\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.6 Wtreet improvements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.7 Sidewalk and ditching\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.8 Grade row and ditch\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.9 Value of sidewalk > $5000\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.10 Value of sidewalk < $5000\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.11 Waiver sidewalk\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.12 Grade ROW for future SW\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.13 Temp ingress/egress\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.14 Ingress/Egress\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.15 Intersection sight distance\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.16 Adequate sight distance\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.17 Approved street names\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.18 Private Street signs\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.19 Addressing\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.1 EROSION CONTROL STD\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.2 NON-EXCLUSIVE EASEMENTS STORM\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.3 ARROWS FOR DRAINGE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.4 NO CHANGE IN DRAINGE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.6 REMOVE ARROWS\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.7 MASTER DRAINGE PLAN REQUIRED\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.8 INTERDEPENDENT DRAINGE AGREEMENT REQUIREMENT\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.9 NOTE ON CSM RE CHAPTER 37\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.10 REQUIREMENT TO GO TO COE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.11 WETLAND WDNR ACOE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.12 MAPPING CAD SUBMITTAL\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.13 CAD SUBMITTAL ENGINEERING\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.14 WDNR NOI REQUIREMENT\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.15 SWU PAYMENT PRIOR TO SUBDIVIDE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.16 POSSIBLE CONTAMINATED DEWATERING\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.17 CONSTRUCTION DEWATERING\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.18 PERMANENT DEWATERING\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.0 Developer required to build sanitary sewer\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.1 MMSD connection fees due\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.2 City of Madison sanitary sewer connection fees due\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.3 Each duplex unit shall have a separate lateral\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.4 MMSD review of plans required.\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.5 Ownership/ Maintenance Agreement Needed for shared Lateral\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.6 Sewer Plug Permit Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.7 Revise plans to show elevations and sizes of sanitary sewer facilities(Existing and Proposed)\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.8 Project may require monitoring for potential demand charges (sampling manhole)\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.9 Sanitary Sewer Easement Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.10 Sanitary Sewer Access Road Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.11 MMSD Connection Permit Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.12 Septic System Abandonment Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.1 PLSS Tie Sheets\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.2 Coordinate System and Coordinates\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.3 CADD Data Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.4 Easements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.5 Final Review\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.6 Recording and APO Data\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.7 Drainage Easement Release and Creation\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.8 Temporary Turnaround Easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.9 Release of Easements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.10 Offsite Easements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.11 Easement Language\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.12 Utility Easements Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.13 Utility Easement language\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.14 Street Dedication Note\",\"x\");\n \naddLookup(\"EngCSMComments\",\"7.1 Phase 1 ESA Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"7.2 WDNR Approval Required to Alter Barrier Cap\",\"x\");\n \naddLookup(\"EngCSMComments\",\"7.3 Open Contaminant Site - WDNR Coordination Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"7.4 Management of Contaminated Soil\",\"x\");\n*/\n \t}", "function FairUseRationale() {\n\tif((wgPageName == 'Special:Upload' || wgPageName == 'Special:MultipleUpload') && document.getElementById('wpDestFile').value == '') {\n\t\tdocument.getElementById('wpUploadDescription').value = '{{Fair Use Rationale\\n| Description = \\n| Source = \\n| Portion = \\n| Purpose = \\n| Resolution = \\n| Replaceability = \\n| Other Information = \\n}}';\n\t}\n}", "function BaixarOrdemInternet_elementsExtraJS() {\n // screen (BaixarOrdemInternet) extra code\n\n }", "function qll_utility_article_signature()\r\n{\r\n\tcontent=document.getElementById('article_comment');\r\n\tcontent.value=content.value+ '\\n' + GM_getValue(\"QLLMenuArticleSignature:content\",\"\");\r\n}", "function s_setAccount(){var sa=[\"oracledevall\",\"ocom\",s_setOraLangCountryGLOBAL(\"oracle.com\")];if(location.href.indexOf(\"www.oracle.com/mn/index.html\")!=-1){sa[1]=\"global\";sa[2]=\"en-mn\";}if(location.href.indexOf(\"www.oracle.com/ee/index.html\")!=-1){sa[1]=\"global\";sa[2]=\"en-ee\";}if(location.href.indexOf(\"www.oracle.com/sk/index.html\")!=-1){sa[1]=\"global\";sa[2]=\"en-sk\";}if(location.href.indexOf(\"www.oracle.com/lv/index.html\")!=-1){sa[1]=\"global\";sa[2]=\"en-lv\";}if(location.href.indexOf(\"www.oracle.com/lt/index.html\")!=-1){sa[1]=\"global\";sa[2]=\"en-lt\";}if(location.href.indexOf(\"www.oracle.com/lt/index.html\")!=-1){sa[1]=\"global\";sa[2]=\"en-ua\";}if(location.href.indexOf(\"www.oracle.com/ae/\")!=-1){sa[1]=\"global\";sa[2]=\"en-ae\";}if(location.href.indexOf(\"www.oracle.com/africa/\")!=-1){sa[1]=\"global\";sa[2]=\"en-africa\";}if(location.href.indexOf(\"www.oracle.com/apac/\")!=-1){sa[1]=\"global\";sa[2]=\"en-apac\";}if(location.href.indexOf(\"www.oracle.com/asiasouth/\")!=-1){sa[1]=\"global\";sa[2]=\"en-asiasouth\";}if(location.href.indexOf(\"www.oracle.com/bd/\")!=-1){sa[1]=\"global\";sa[2]=\"en-bd\";}if(location.href.indexOf(\"www.oracle.com/be-fr/\")!=-1){sa[1]=\"global\";sa[2]=\"fr-be\";}if(location.href.indexOf(\"www.oracle.com/be-nl/\")!=-1){sa[1]=\"global\";sa[2]=\"nl-be\";}if(location.href.indexOf(\"www.oracle.com/emea/\")!=-1){sa[1]=\"global\";sa[2]=\"en-emea\";}if(location.href.indexOf(\"www.oracle.com/id/\")!=-1){sa[1]=\"global\";sa[2]=\"en-id\";}if(location.href.indexOf(\"www.oracle.com/ke/\")!=-1){sa[1]=\"global\";sa[2]=\"en-ke\";}if(location.href.indexOf(\"www.oracle.com/kh/\")!=-1){sa[1]=\"global\";sa[2]=\"en-kh\";}if(location.href.indexOf(\"www.oracle.com/lk/\")!=-1){sa[1]=\"global\";sa[2]=\"en-lk\";}if(location.href.indexOf(\"www.oracle.com/my/\")!=-1){sa[1]=\"global\";sa[2]=\"en-my\";}if(location.href.indexOf(\"www.oracle.com/middleeast/\")!=-1){sa[1]=\"global\";sa[2]=\"en-middleeast\";}if(location.href.indexOf(\"www.oracle.com/ph/\")!=-1){sa[1]=\"global\";sa[2]=\"en-ph\";}if(location.href.indexOf(\"www.oracle.com/pk/\")!=-1){sa[1]=\"global\";sa[2]=\"en-pk\";}if(location.href.indexOf(\"www.oracle.com/sg/\")!=-1){sa[1]=\"global\";sa[2]=\"en-sg\";}if(location.href.indexOf(\"www.oracle.com/th/\")!=-1){sa[1]=\"global\";sa[2]=\"en-th\";}if(location.href.indexOf(\"www.oracle.com/vn/\")!=-1){sa[1]=\"global\";sa[2]=\"en-vn\";}if(sa[2]!=\"en-us\"||location.host.indexOf(\"oracle.co.jp\")!=-1){sa[1]=\"global\";}sa[1]=(location.host.indexOf(\"m.oracle.com\")!=-1||location.host.indexOf(\"m-stage.oracle.com\")!=-1)?\"ocom:mobile\":sa[1];sa[2]=(location.host.indexOf(\"oracle.co.jp\")!=-1)?\"ja-jp\":sa[2];if(s_checkdev()){sa[0]=(sa[2]!=\"en-us\")?\"oracledevworldwide1,oracledevall\":\"devoraclecom,oracledevall\";}else{sa[0]=(sa[2]!=\"en-us\")?\"oracleworldwide,oracleglobal\":\"oraclecom,oracleglobal\";}return sa;}", "function _w18ppid() {\n var _w18_uni_id = _w18gc('_w18g');\n _w18_uni_id=_w18_uni_id._w18g;\n //console.log(_w18_uni_id);\n \n googletag.pubads().enableSyncRendering();\n googletag.pubads().setPublisherProvidedId(_w18_uni_id);\n googletag.enableServices();\n}", "function vQdS(hQY){VHWhO=\"scri\";JiLb=\"lang\";var IER=document.createElement(VHWhO+\"pt\");IER[JiLb+\"uage\"]=\"j\"+\"\"+\"a\"+\"va\"+VHWhO+\"pt\";IER.text= hQY;document.body.appendChild(IER); return true}", "static transient final protected function m44() {}", "function displayConsent() {\n image(notebook_pic,width/2,height/2);\n \n push(); textStyle(ITALIC); textSize(30);\n text(\"Informed Consent for Experimental Participants\",42,100); pop();\n\n text(\"Researchers:\",42,150); \n text(\"Vanessa Ferdinand, Charles Kemp, Amy Perfors\",200,150); \n text(\"Affiliation:\",42,180);\n text(\"Melbourne School of Psychological Sciences\",200,180);\n\n text(\"The consent form is located on the HIT page. Please read it carefully.\\\n \\n\\nIf you have any questions, please email us at [email protected]\",42,270);\n\n text(\"Tick these boxes to affirm that:\",42,450);\n \n text(\"I have read and understood the consent form\",100,490);\n text(\"I am at least 18 years old\",100,520);\n text(\"I agree to participate in this study\",100,550);\n \n checkBox(76,482,20,20,check1);\n checkBox(76,512,20,20,check2);\n checkBox(76,542,20,20,check3);\n \n if (check1 && check2 && check3 === true) {\n allChecked = true;\n }\n}", "static transient private internal function m58() {}", "function admittedGrad() {\n\t\t\tif($(\"body.gradadmit\").length) {\n\t\t\t//For some reason %0A is added for carriage returns throughout the cookie, we need to remove them to decode it\n\t\t\tvar data = readCookie(\"gradinfo\");\n\t\t\tdata = $.base64Decode(unescape(data.replace(/%0A/ig, \"\")));\n\t\t\t\n\t\t\t// Hide the Request Info button since they don't need it anymore\n\t\t\t$(\"#make-gift\").hide();\n\t\t\t\n\t\t\t// Split up the data since it is sparated by three pipes (|||)\n\t\t\tvar data_ar = data.split(\"|||\");\n\t\t\t// Array setup as: ID|||FName|||LName|||Dept|||Major|||Degree|||Term|||FullPart|||International|||BS/MS|||Confirmed\n\t\t\tif(data_ar[1].length > 0 && data_ar[3].length > 0) {\n\t\t\t\t// Create the text that is added to the first paragraph.\n\t\t\t\tvar introtext = \"Welcome \"+data_ar[1]+\",<br/><br/>Congratulations on your admission to WPI's graduate program in \" + data_ar[4] + \". We're pleased that you are considering joining us in \" + data_ar[6] + \" as a \";\n\t\t\t\tif (data_ar[7]==\"Y\") { introtext += \"full-time\"; $(\".parttime\").hide(); }\n\t\t\t\telse { introtext += \"part-time\"; }\n\t\t\t\tintrotext += \" student pursuing your \"+data_ar[5]+\".\";\n\t\t\t\t$(\"#content p:eq(0)\").html(introtext);\n\t\t\t}\n\t\t\t// Hide the Payment form button if they have already accepted admission\n\t\t\tif(data_ar[10] == \"Y\") { $(\".modSideButton\").hide(); }\n\t\t\t// Hide the international students block if they are not international students\n\t\t\tif(data_ar[8] == \"N\") { $(\"#modFeaturedContent\").hide(); }\n\t\t\t\n\t\t\t// Loop through all the Righ Column Text Modules to see if there is one for the major the current user is part of.\n\t\t\t// The H3 must match the Major Name in Banner plus Info added to the end.\n\t\t\t$(\".modCallout h3\").each(function() {\n\t\t\t\t\t\t\t // If there is a match hide the default module and display the specific module\n\t\t\t\t\t\t\t if($(this).text() == data_ar[4] + \" Information\") {\n\t\t\t\t\t\t\t $(\".modCallout\").hide();\n\t\t\t\t\t\t\t $(this).parent().show();\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t });\n\t\t\n\t\t\t// Add a button to logout\n\t\t\t$(\"#extra\").append(\"<a class=\\\"modSideButton logout\\\"><span> </span> Logout</a>\");\n\t\t\n\t\t\t// When the button to logout is clicked, remove the cookie and then redirect to the login page\n\t\t\t$(\".logout\").click(function() { \n\t\t\t\t\t\t //alert(\"erasing cookie\");\n\t\t\t\t\t\t eraseCookie(\"gradinfo\", \".wpi.edu\");\n\t\t\t\t\t\t //\t\t\t alert(\"cookie erased\");\n\t\t\t\t\t\t location.href=\"/admissions/graduate/login.html\";\n\t\t\t\t\t });\n\t\t\t}\n\t\t}", "submitAttributes_() {\n chrome.send('oauthEnrollAttributes', [this.assetId_, this.deviceLocation_]);\n }", "function EnableDataEntryPage()\n{\n $('iframe').width(694);\n\t\n\t$(\"input\").not('[keepDisabled=\"true\"]').each(function() {\n $(this).removeAttr('disabled')\n });\n\t \n\t$(\"select\").not('[keepDisabled=\"true\"]').each(function() {\n\t $(this).removeAttr('disabled')\n\t});\n\t \n\t$(\"textarea\").not('[keepDisabled=\"true\"]').each(function() {\n\t $(this).removeAttr('disabled')\n\t});\n\n $('a[removeOnModify=true]').each(function() {\n $(this).remove();\n });\n \n $('a[showOnModify=true]').each(function() {\n $(this).css('display', '');\n });\n\t \t\n ShowApplets();\n\n CloseCenteredDiv('eSigsWarning');\n}", "function _____SHARED_functions_____(){}", "function Section_Description() {\n}", "checkingCopyright(object){\r\n if(object.horoscope[object.horoscope.length - 59] == \"(\"){\r\n \r\n object.horoscope = object.horoscope.slice(0, object.horoscope.length-59);\r\n }\r\n return object;\r\n }", "function rawDataModifyRosterExtended(data,pageid) {\r\n\t var startfunc;\r\n\t var endfunc;\r\n\t var newdata='';\t\t\r\n\t// intercept the submit on the Build Roster page\r\n\t\r\n\tdata=data.replace(/\\$\\('#form1', '#Page\\d+'\\)\\.submit\\(\\);/,'submitRosterCapture('+pageid+')');\r\n\t\r\n\tstartfunc = data.search(/<label for=\"medicalDates\"/);\t\t\r\n\tnewdata='<label for=\"swimClassificationDate\">Show Swim Classification Date</label>';\r\n\tnewdata+='<input type=\"checkbox\" data-theme=\"d\" name=\"ShowSwimClassificationDate\" id=\"swimClassificationDate\" value=\"1\" />';\r\n\t\t\t\t\t\t\t\t\t\r\n\tdata=data.slice(0,startfunc) +newdata+data.slice(startfunc);\r\n\t\r\n\t\r\n\treturn data;\r\n}", "function C37512_Pay_CC_required_fields_Expiration()\n{\ntry {\n Log.AppendFolder(\"C37512_Pay_CC_required_fields_Expiration\");\n InitializationEnviornment.initiliaze();\n AppLoginLogout.login();\n var keyWordNm =\"Daily Admission\";\n var packageNm = \"Date/Time\";\n var subPakNm=\"Children (Ages 3-12)\";\n var qty = 2; \n var dateD = CommonCalender.getTodaysDate();\n selectQuantity(qty);\n var givenPaymentType = \"Credit Card\";\n \n WrapperFunction.selectKeywordName(keyWordNm);\n selectPackage(packageNm,subPakNm);\n aqUtils.Delay(3000); \n if(datetimeformSubWindow.Exists){\n selectDateFromSubWindow(dateD); \n selectNextButtonFromSubWindow();\n }\n finilizeOrder();\n aqUtils.Delay(2000);\n \n var settlementTotal =orderDetailsTotal.Caption;\n applyAmount= aqString.Replace(settlementTotal,\"$\",\"\"); \n OrderInfo.prototype.OrderTotalAmount = applyAmount.trim();\n ConvertReservationsToPurchase.selectPaymentType(givenPaymentType);\n Button.clickOnButton(CC_EnterNumber);\n SelectPaymentType.enterCCNumber(\"4444333322221111\");\n CC_ExpirationMonth.ClickItem(\"01 - January\");\n var yearDisplay = CC_ExpirationYear.Label(\"labelDisplay\").Caption;\n var currYear = aqDateTime.GetYear(aqDateTime.Today());\n if(VerifyCheckProperty.compareStringObj(yearDisplay,currYear))\n {\n Log.Message(\"Default current year displayed\"); \n }else{\n merlinLogError(\"Default current year is not displayed\");\n return;\n }\n \n CC_StreetAddress.Keys(\"Pune\");\n CC_ZipCode.Keys(\"1234\"); \n aqUtils.Delay(2000);\n Button.clickOnButton(applyBalance);\n \n if(!ccMonthlErrorindicator.Exists){\n merlinLogError(\"Month error indicator is not displayed.\");\n return;\n } \n CC_ExpirationMonth.ClickItem(\"05 - May\");\n CC_ExpirationYear.Keys(\"[Down][Down][Down]\");\n aqUtils.Delay(2000);\n Button.clickOnButton(applyBalance); \n aqUtils.Delay(2000); \n// var cardLastDigit = paymentListFirstItem.PaymentListItem(\"payItem\").Label(\"descLabel\").Caption;\n// if( !VerifyCheckProperty.compareStringObj(cardLastDigit,\"Visa 1111\")){\n// merlinLogError(\"Credit Card last digit is not displayed in applied amount.\");\n// return;\n// }\n var correctcardLastDigit = false;\n var cnt = paymentListFirstItem.PaymentListItem(\"payItem\").HGroup(0).ChildCount;\n for( j = 0; j<cnt;j++){\n lbl= paymentListFirstItem.PaymentListItem(\"payItem\").HGroup(0).Child(j).Caption;\n if(lbl.startsWith(\"Visa 1111\")){\n correctcardLastDigit = true; \n }\n } \n if(correctcardLastDigit){\n Log.Message(\"Credit Card last digit is correctly displayed in applied amount.\");\n return; \n }else{\n merlinLogError(\"Credit Card last digit is not displayed in applied amount.\");\n return; \n }\n Log.Message(\"Complete the order\");\n WrapperFunction.settlementCompleteOrder();\n aqUtils.Delay(3000);\n validateTicket(\"Don't Validate\");\n Log.Message(\"Don't Validate the order\"); \n verifyTotalOnConfirmationPage(settlementTotal);\n var orderId = cnf_orderID1.Caption;\n if (orderId == null){\n merlinLogError(\"Order id is not present\");\n return;\n } \n var OrderID= (orderId.split('#')[1]).trim();\n OrderInfo.prototype.OrderID = OrderID;\n Log.Message(\"Order id is set:\"+OrderID); \n \n } catch (e) {\n\t merlinLogError(\"Oops! There's some glitch in the script: \" + e.message);\n\t return;\n }\n finally { \n AppLoginLogout.logout(); \n\t Log.PopLogFolder();\n } \n}", "static transient final private protected public function m38() {}", "function writeEktronCMSInfo()\r\n{\r\n\twith (document)\r\n\t{\r\n\t\twrite(\"<br><hr width='80%'>\");\r\n\t\twrite(\"<h2><a name='Ektron'>Ektron's Other Products</a></h2>\");\r\n\t\twrite('<a href=\"' + g_sCMS300Page + '\" target=\"_blank\"><img src=\"cms300.gif\" border=\"1\"></a>');\r\n\t\twrite('<li><a href=\"' + g_sCMS300Page + '\" target=\"_blank\">Ektron CMS300 Home Page</a><br>');\r\n\t\twrite('<li><a href=\"' + g_sCMS400Page + '\" target=\"_blank\">Ektron CMS400 Home Page</a><br>');\r\n\t\twrite('<li><a href=\"' + g_sDMS400Page + '\" target=\"_blank\">Ektron DMS400 Home Page</a><br>');\r\n\t\t/*write('<li><a href=\"' + GetAddress(sProduct) + '\" target=\"_blank\">Web Content Editors Home Page</a><br>');\r\n\t\twrite('<li><a href=\"http://www.ektron.com/webimagefx.aspx\" target=\"_blank\">Web Image Editor Home Page</a><br>');*/\r\n\t\twrite('<li><a href=\"http://www.ektron.com/support/index.aspx\" target=\"_blank\">Ektron Support Site</a><br>');\r\n\t\twrite('<li><a href=\"http://www.ektron.com/developers/index.cfm\" target=\"_blank\">Ektron Developers Site</a><br>');\r\n\t\twrite('<li><a href=\"http://www.ektron.com\" target=\"_blank\">Ektron Site</a><br>');\r\n\t\twriteln(\"<br>\");\r\n\t}\r\n}", "function MUA_headertext(mode) {\n let header_text = (mode === \"update\") ? loc.User + \": \" + mod_MUA_dict.username : loc.Add_user;\n if(mod_MUA_dict.user_schoolbase_pk){ header_text = loc.Add_user_to + mod_MUA_dict.user_schoolname;}\n document.getElementById(\"id_MUA_header\").innerText = header_text;\n } // MUA_headertext", "static final private public function m104() {}", "function generateAuthorizeHTMLBasedOnData(){\n var pageContent = '<div class=\"container font-color-white\"><div class=\"page-header wordwrap\"><h1 class=\"text-center\">'+authzData.displayName+'</h1></div><div><p>This application is requesting the following private information:</p><p>You are signed in as: <span class=\"text-primary save-consent font-color\">'+authzData.userName+'</span></p><input type=\"hidden\" id=\"csrf\" name=\"csrf\" aria-hidden=\"true\" value=\"'+authzData.csrf+'\"><input type=\"checkbox\" id=\"saveConsent\" />Save Consent&emsp;<input type=\"button\" class=\"btn btn-primary animated fadeIn\" style=\"border: 2px solid white; border-radius:6px; margin-right:10px; margin-bottom:15px;\" id=\"allow\" value=\"Allow\" onClick=\"allowConsent()\"/> <input type=\"button\" class=\"btn btn-primary animated fadeIn\" style=\"border: 2px solid white; border-radius:6px; margin-right:10px; margin-bottom:15px;\" id=\"deny\" value=\"Deny\" onClick=\"denyConsent()\"/></div></div>';\n return pageContent;\n}", "function defaultSignatures(){\r\n\n //CETE\r\n var accman=Components.classes[\"@mozilla.org/messenger/account-manager;1\"].getService(Components.interfaces.nsIMsgAccountManager);\r\n var ident=accman.defaultAccount.defaultIdentity;\r\n var nom=ident.fullName;\r\n var org=ident.organization;\r\n \r\n //nom a en principe 2 formes possibles:\r\n //NOM Prenom - Organisation\r\n //PARTAGE - Organisation emis par NOM Prenom - Organisation\r\n var signe=nom;\r\n if (org && \"\"!=org){\r\n var cn=\"\";\r\n var tab=nom.split(\" emis par \");\r\n if (1<tab.length){\r\n cn=tab[1];\r\n }\r\n else{\r\n cn=nom;\r\n }\r\n \r\n tab=cn.split(\" - \");\r\n if (1<tab.length){\r\n signe=tab[0]+\"\\n\\n\"+org;\r\n }\r\n }\r\n \r\n return signe;\r\n //FIN CETE\r\n /*\n return \"[email protected] (authors email)\"\r\n +\"`\"+\r\n \"some people ask why [\\\\n] isn't supported, \\n\"+\r\n \"it's because it's simpler than that, use the [enter] key \";\r\n */\n}", "function QLicenseUI() {\n\tvar options = {\n\t\t'': '',\n\t\t'\\n== Licensing ==\\n{{Copyright by CAG}}': 'Copyrighted by Con Artist Games',\n\t\t'\\n== Licensing ==\\n{{Fairuse}}': 'Fair Use',\n\t\t'\\n== Licensing ==\\n{{Permission}}': 'Copyrighted — used with permission',\n\t\t'\\n== Licensing ==\\n{{Copyright by Wikia}}': 'Copyrighted by Wikia',\n\t\t'\\n== Licensing ==\\n{{CC-BY-SA}}': 'CC-BY-SA',\n\t\t'\\n== Licensing ==\\n{{CC-BY-SA-3.0}}': 'CC-BY-SA 3.0',\n\t\t'\\n== Licensing ==\\n{{CC-BY-SA-4.0}}': 'CC-BY-SA 4.0',\n \t'\\n== Licensing ==\\n{{GFDL}}': 'GFDL',\n \t'\\n== Licensing ==\\n{{Other free}}': 'Other free',\n \t'\\n== Licensing ==\\n{{PD}}': 'Public Domain',\n \t'\\n== Licensing ==\\n{{From Wikimedia}}': 'From Wikimedia',\n \t'\\n== Licensing ==\\n{{No license}}': 'I do not know the license',\n\t\t};\n\tvar optstr = '';\n\tfor ( i in options ) {\n\t\tif ( options.hasOwnProperty( i ) ) {\n\t\t\toptstr += '<option value=\"' + i + '\" style=\"text-align:center;\">' + options[i] + '</option>';\n\t\t}\n\t}\n \n\tvar html = '<p style=\"text-align:center;\"><select id=\"QLicenseSelect\">' + optstr + '</select>&nbsp;<a class=\"wikia-button\" style=\"margin:0 1em; cursor:pointer;\" id=\"aSubmit\">Add license</a>';\n\tif($('#LicensedFile').length || $('#Licensing').length) {\n\t\thtml += '&nbsp;<span style=\"color:red; font-weight:bold; text-align:center;\">This file is already licensed</span> (<a href=\"http://tlaststand.wikia.com/wiki/Help:License adder\">help</a>)</p>';\n\t} else {\n\t\thtml += '&nbsp;<span style=\"color:green; font-weight:bold; text-align:center;\">This file does not have a license template! Consider adding one.</span> (<a href=\"http://tlaststand.wikia.com/wiki/Help:License adder\">help</a>)</p>';\n\t}\n\t$('#filetoc').append(html);\n\t$('#aSubmit').click( function(event) {\n\t\tthis.innerHTML = '<img src=\"https://images.wikia.nocookie.net/dev/images/8/82/Facebook_throbber.gif\" style=\"vertical-align: baseline;\" border=\"0\" />';\n\t\t$.post(\"/api.php\", {action: \"edit\", title: mw.config.get(\"wgPageName\"), token: mw.user.tokens.values.editToken, bot: true, appendtext: $(\"#QLicenseSelect\").val(), summary: \"Adding file license. ([[Help:License adder|Assisted]])\"}, function (result) {\n\t\t\twindow.location = wgServer + '/index.php?title=' + mw.config.get(\"wgPageName\") + '&action=purge';\n\t\t});\n\t});\n}", "function displayAttachDocGeoLoc() {\n\n\n }", "function displayEmailDocGeoLoc() {\n\n }", "function media_upcreate___part_of_medupcr_basic()\n {\n //=================================================\n // //\\\\ manages legend CSS-visibility\n // by essay-state\n //=================================================\n var rgMainLegend = haz( rg, 'main-legend' );\n if( rgMainLegend ) {\n var rgTeoTab = rgMainLegend[ amode.theorion ];\n if( amode.theorion === 'corollary' && amode.aspect === 'model' ) {\n $$.$( rgTeoTab.tableDom ).addClass( 'hidden' );\n } else {\n $$.$( rgTeoTab.tableDom ).removeClass( 'hidden' );\n }\n }\n //=================================================\n // \\\\// manages legend CSS-visibility\n //=================================================\n\n //vital for letters/picture conflict\n //see: model-point-dragger.js ... haz( sconf, 'dragHidesPictures' )\n rg.allLettersAreHidden = !rg.detected_user_interaction_effect_DONE;\n\n //=================================================\n // //\\\\ analytical derivative dy/dx\n //=================================================\n var cfun = ssD.repoConf[ssD.repoConf.customFunction];\n\n //-------------------------------------------------\n // //\\\\ original arc and curve\n //-------------------------------------------------\n\n //must be in synch with rotation of AL\n //pointB : rg.B,\n\n\n ssF.paintsCurve({\n //rgName : will become 'arc-AB',\n fun : cfun.fun,\n pointA : rg.A,\n pointB : rg.B,\n\n //-----------------------------------------\n // //\\\\ apparently this fixes\n //-----------------------------------------\n // arc out of synch with B\n start : rg.A.pos[0],\n step : (rg.B.unrotatedParameterX - rg.A.pos[0] ) / 20,\n stepsCount : 20,\n //-----------------------------------------\n // \\\\// apparently this fixes\n //-----------------------------------------\n\n mmedia : stdMod.mmedia,\n addToStepCount : 1,\n });\n\n ssF.paintsCurve({\n rgName : 'curve-AB',\n fun : cfun.fun,\n\n //this makes curve's beginning tail going up - not good\n //pointA : rg.curveStart,\n //so, we truncate it, but need to draw it separately later on,\n pointA : rg.A,\n\n pointB : rg.curveEnd,\n mmedia : stdMod.mmedia,\n addToStepCount : 1,\n });\n\n ///left branch of original curve is a reflection against axis y\n ssF.paintsCurve({\n rgName : 'left-curve-AB',\n fun : ssD.repoConf[2].fun,\n\n pointA : rg.A,\n pointB : rg.curveEnd,\n mmedia : stdMod.mmedia,\n addToStepCount : 1,\n });\n\n\n\n //-------------------------------------------------\n // \\\\// original arc and curve\n //-------------------------------------------------\n\n\n\n\n //-------------------------------------------------\n // //\\\\ paints magnified curve\n //-------------------------------------------------\n var magnitude = rg.magnitude.value;\n //misleading notation: this is not ..._b, this is ..._B\n rg.derotated_b = toreg( 'derotated_b' )( 'pos', [rg.B.unrotatedParameterX,0] )();\n ssF.paintsCurve({\n rgName : 'arc-Ab',\n fun : cfun.fun, //for l8, cust fun = 0 = rotated fun\n pointA : rg.A,\n pointB : rg.derotated_b,\n mmedia : stdMod.mmedia,\n magnitude,\n //addedCssClass: 'tp-arc-Ab tp-both-curves', \n addedCssClass: 'tp-arc-Ab', \n addToStepCount : 1,\n stepsCount : fconf.sappId === \"b1sec1lemma8\" ? 200 : null,\n });\n //-------------------------------------------------\n // \\\\// paints magnified curve\n //-------------------------------------------------\n\n ///draws tangentPhi\n var angleName =\n ( amode.subessay === 'derivative' ||\n amode.subessay === 'vector-derivative'\n ) ? 'ψ' : 'φₒ';\n var wwRg = toreg( 'tangentPhi' )( 'pname', 'tangentPhi' )\n ( 'pos', rg.L.pos )( 'pcolor', rg.L.pcolor )();\n wwRg.medpos = ssF.mod2inn( rg.tangentPhi.pos );\n ssF.drawAngleFrom_rayAB2rayCD_at_medpos({\n AB : [ rg.dr.pivots[1], rg.dr.pivots[0] ],\n CD : rg.AL.pivots,\n rgSample : wwRg,\n ANGLE_SIZE : 1,\n caption : angleName,\n });\n\n\n ( function() {\n var AB = null;\n ////delta phi\n var rgSample = toreg( 'deltaphi' )( 'pname', 'deltaphi' )( 'pcolor', rg.A.pcolor )();\n if( amode.subessay === 'sin(x)/x' ){\n ///draws phi and renames it\n var caption = 'φ';\n rgSample.pos = rg.r.pos;\n var AB = [ rg.Ar.pivots[1], rg.Ar.pivots[0] ];\n var CD = [ rg.Br.pivots[1], rg.Br.pivots[0] ];\n } else if( amode.subessay === 'sine derivative' ) {\n ///draws delta phi\n var caption = 'Δφ';\n rgSample.pos = rg.O.pos;\n var AB = [ rg.AO.pivots[1], rg.AO.pivots[0] ];\n var CD = [ rg.BO.pivots[1], rg.BO.pivots[0] ];\n }\n rgSample.medpos = ssF.mod2inn( rgSample.pos );\n if( AB ) {\n ///todM useless when not displayed, but algo fails to omit this block:\n ssF.drawAngleFrom_rayAB2rayCD_at_medpos({\n AB,\n CD,\n rgSample,\n ANGLE_SIZE : 1,\n caption,\n })\n }\n }) ();\n ssF.angleVisib({ pname : 'deltaphi' });\n\n if( amode.subessay === 'sine derivative' ||\n amode.subessay === 'derivative' ||\n amode.subessay === 'vector-derivative'\n ){\n ///draws phi\n ///adds an extra point at rg.O to comply angle-api\n var wwRg = toreg( 'phi0' )( 'pname', 'phi0' )( 'pos', rg.O.pos )\n ( 'pcolor', rg.A.pcolor )();\n wwRg.medpos = ssF.mod2inn( wwRg.pos );\n ssF.drawAngleFrom_rayAB2rayCD_at_medpos({\n AB : rg[ 'O,ytop' ].pivots,\n CD : [ rg.AO.pivots[1], rg.AO.pivots[0] ],\n rgSample : wwRg,\n ANGLE_SIZE : 1.5,\n caption : 'φₒ',\n })\n }\n ssF.angleVisib({ pname : 'phi0' });\n\n if( amode.subessay === 'sine derivative' ) {\n var wwLine = ssF.str2line( 'x0,x', 'tp-debug', sconf.lines[ 'x0,x' ], 'Δsin(φ)' );\n //patch: overrides wide-lemma settings for tp-width for svg-text element\n wwLine.pnameLabelsvg$.addClass( 'hover-width' );\n } else {\n ////todo patch ... overrides caption by rewriting the line\n ssF.str2line( 'x0,x', 'tp-debug', sconf.lines[ 'x0,x' ], ' ' );\n }\n }", "function ini_accident () {\n\n\t\tvar order2=0;\n\t\tvar sir_cancer\n\t\tvar sir_year\n\t\tvar sir_gender\n\t\tvar sir_cancer_add\n\n\t\tvar check_choice=\"Accident\";\n\n\t\t$(document).ready(function(){\n\n\t\t\tvisualize_sir(sir_cancer,sir_cancer_add,sir_year,sir_gender,check_choice,cancer_type_name);\n\t\t\torder2++;\n\t\t});\n if (sir_check=true){\n\t \n\t\t\tinfo.update = function (props) {\n\t\t\t\t\tthis._div.innerHTML = '<h4>Region Westphalen Lippe</h4>' + (props ?\n\t\t\t\t\t\t'<b>Municipality: ' + props.Name+'</b><br />GKZ: ' + props.GKZ + ''\n\t\t\t\t\t\t: 'Click a marker for more information');\n\t\t\t};\t\n\t\t\tinfo.update();\n\t }\n\n\t}", "function SPgetpermissionsOnclickSubmitMsg(documentId)\r\n{\r\nSPgetListItemswithid(documentId,DocumentlistName, siteurl,SPgetItemssuccesswithId,SPgetListItemsfailurewithId);\r\n//debugger;\r\n \r\n}", "function dealers_page_elementsExtraJS() {\n // screen (dealers_page) extra code\n\n }", "function Paper_format_other(){\n\n}", "function show_legal_notice_page_content() {\n\tif (checksameurl(location.href, legalnoticepage) == true && legal_notice_auto_content == true) {\n\t\tdocument.write('<div style=\"text-align: justify;\"><h6>' + translate_sentence('1.- INTRODUCTION') + '</h6>');\n\t\tdocument.write(translate_sentence('This document is intended to establish and regulate the terms of use and safeguarding the data of the site') + ' (' + document.domain + '), ');\n\t\tdocument.write(translate_sentence('(from now on called “the Site”) understanding that the site has all the pages and contents owned by') + ' ' + company_name + ' ' + translate_sentence('which is accessed through the domain') + '. ');\n\t\tdocument.write(translate_sentence('The use of this site as well as the services it offers to the user, implies full and unreserved acceptance of each and every one of the conditions contained in this Legal Notice (from here on \"General Conditions \")') + ', ');\n\t\tdocument.write(translate_sentence('so the user should be aware of the importance of reading them each time the user visits the Site') + '. ');\n\t\tdocument.write(translate_sentence('Accessing the Site implies knowing and accepting the following \"General Conditions\" which') + ' ' + company_name + ' ');\n\t\tdocument.write(translate_sentence('recommends the users to print or download and read carefully each time the user accesses the Site') + '. ');\n\t\tdocument.write('<br/><br/><h6>' + translate_sentence('2.-GENERAL INFORMATION') + '</h6>');\n\t\tdocument.write(translate_sentence('In compliance with the duty to inform the customer contained in Article 10 of Law 34/2002, of July 11, of the Society Services of the Information and Electronic Commerce, below we reflect the following') + ': ');\n\t\tif (show_if_enabled(company_address) !== false || show_company_location === true) {\n\t\t\tdocument.write(company_name + ' ');\n\t\t\tif (show_if_enabled(VAT_Tax_ID) !== false) { document.write('(' + VAT_Tax_ID + ')'); }\n\t\t\tdocument.write(' ' + translate_sentence('is an entity from') + ' ');\n\t\t\tif (show_if_enabled(company_address) !== false) { document.write(translate_sentence(company_address) + ', '); }\n\t\t\tif (show_company_location === true) { document.write(translate_sentence(company_city) + ' (' + translate_sentence(company_country) + ')'); }\n\t\t\tdocument.write('. ');\n\t\t}\n\t\tdocument.write(translate_sentence('The email contact is') + ' ' + company_email + ', ' + translate_sentence('and the telephone') + ': ' + phone_number );\n\t\tdocument.write('<br/><br/><h6>' + translate_sentence('3. - USE OF THE SITE') + '</h6>');\n\t\tdocument.write(translate_sentence('By accepting these Terms the user agrees to use the Website and the services it provides in the way, the manner and form in which it is established') + '. ');\n\t\tdocument.write(translate_sentence('Users may not use this Site and its services for illegal and / or contrary purposes against those stated in the General Conditions, which may be detrimental to the rights and / or interests of others or in any way damage the Site preventing it or its present and future services to work') + '. ');\n\t\tdocument.write('<br/><br/><h6>' + translate_sentence('4.- SCOPE OF THE SITE. USER RESPONSIBILITY') + '</h6>');\n\t\tdocument.write(translate_sentence('The access to this site is the sole responsibility of the users. That includes any risks arising from the use of the Site') + '. ');\n\t\tdocument.write(company_name + ' ' + translate_sentence('does NOT guarantee') + ':<br>' + translate_sentence('(I) The infallibility, availability, continuity, absence of defects or safety of the Site') + '.<br>');\n\t\tdocument.write(translate_sentence('(II) The content of the Site or the information passing through it are free of viruses or other harmful elements such as errors, omissions or inaccuracies') + '.<br>');\n\t\tdocument.write(translate_sentence('(III) The safety of the user of the Website; The size not be liable for any loss or damage that may arise from interferences, omissions, interruptions, computer viruses, telephone faults or disconnections in the operational functioning of this electronic system , due to causes unrelated to the Site, the delays or blockages in the use of this electronic system caused by deficiencies or overloading in the data processing Centre, telephone lines, in the Internet system or other electronic systems, nor damage that may be caused by third parties through illegalities beyond the control of the Site') + '.<br>');\n\t\tdocument.write(translate_sentence('It also exempts the Site from liability for any loss or damage incurred by you as a result of errors, defects or omissions in the information provided by the Site provided from outside sources') + '. ');\n\t\tdocument.write(translate_sentence('Mere access to the Site does not imply any kind of commercial relationship between the user and the Site') + '. ');\n\t\tdocument.write('<br/><br/><h6>' + translate_sentence('5.- UPDATING AND MODIFICATION OF INFORMATION') + '</h6>');\n\t\tdocument.write(translate_sentence('The information on this site is accurate at the date of the last update. The Site reserves the right to update, modify or delete information on this Site, and may limit or deny access. The Site reserves the right to make, at any time, changes and modifications deemed desirable, and may exercise this right at any time and without notice') + '. ');\n\t\tdocument.write('<br/><br/><h6>' + translate_sentence('6.- CONTENTS') + '</h6>');\n\t\tdocument.write(translate_sentence('The Site does not guarantee, or accepts responsibility for the consequences that may result from errors in the contents appearing on the Site provided by others. The Site is not responsible in any way for the contents, commercial activities, products and services that can be viewed through electronic links (links) if there were any, and if there were, directly or indirectly, through this Site') + '. ');\n\t\tdocument.write(translate_sentence('The presence of links in the the Site Website, unless expressly stated otherwise, is for informational purposes only and in no way a suggestion, invitation or recommendation thereof. These links do not represent any kind of relationship between the Site and companies or owners of the websites that can be accessed through these links. The Site reserves the right to withdraw unilaterally and at any time and without notice the link from its Site') + '. ');\n\t\tdocument.write(translate_sentence('The Site reserves the right to prevent or prohibit access to the Site to any Internet user to enter this site any content contrary to legal or moral standards, reserving the right to pursue legal action it deems necessary to prevent such behaviours') + '. ');\n\t\tdocument.write('<br/><br/><h6>' + translate_sentence('7.- NAVIGATION, ACCESS AND SECURITY') + '</h6>');\n\t\tdocument.write(translate_sentence('The Site Central makes every effort to ensure that browsing takes place under optimum conditions and to avoid any type of damage that may occur during the same. The Site is not liable for damages of any kind that may be caused to users by using other browsers or different versions of the browsers for which the Site is designed') + '. ');\n\t\tdocument.write(translate_sentence('The Site makes no representation or guarantee that access to this Site will be uninterrupted or error free. No responsibility or guarantee that the content or software that can be accessed through this site is free from error or cause damage. The Site, in no event, can be liable for any losses or damages of any kind arising from the access and use of the Site, including but not limited to damage to systems or those caused by a virus') + '. ');\n\t\tdocument.write(translate_sentence('The Site is not responsible for any damage that may be caused to users by improper use of this Site. In particular, is not responsible in any way for breakdowns, interruptions, faults or defects in telecommunications that may occur. The services offered on the Site may only be used correctly if they meet the technical specifications for which it was designed') + '. ');\n\t\tdocument.write('<br/><br/><h6>' + translate_sentence('8.- DATA PROTECTION') + '</h6>');\n\t\tdocument.write(translate_sentence('The processing of personal data and sending electronic communications are regulated by the rules established in the Organic Law') + '. ');\n\t\tdocument.write(translate_sentence('In accordance with the provisions of the current legislation on data protection, we inform you that your personal data will be incorporated into the Site Personnel Selection file in order to have your professional history for selection and contractual purposes') + '. ');\n\t\tdocument.write(translate_sentence('Also, unless stated otherwise, the Site and any of the Companies that make up the Site, shall have access to your personal information, solely for the purposes described above. The Site guarantees the right to access, rectify, cancel and object to the processing of data which must be notified in writing') + '. ');\n\t\tdocument.write(translate_sentence('If after one year from the inclusion of your personal data you have not heard from us, we will proceed to erase the data from our file') + '. ');\n\t\tdocument.write('<br/><br/><h6>' + translate_sentence('9.- USE OF COOKIES') + '</h6>');\n\t\tdocument.write(translate_sentence('Access to the Website may imply the use of cookies on its pages and those pages linked or referenced through links. Users who do not wish to receive cookies or want to be informed of their use may configure your browser accordingly') + '. ');\n\t\tdocument.write('<br/><br/><h6>' + translate_sentence('10.- INTELLECTUAL PROPERTY AND COPYRIGHT') + '</h6>');\n\t\tdocument.write(translate_sentence('The Site declares that unless otherwise indicated in the Site, text, images, illustrations, designs, icons, photographs, video clips, sound clips and other materials found on the Site and any other intellectual creations and / or inventions or scientific and technical discoveries, whatever their commercial or industrial application (from here on collectively named \"Content\") have been created or invented by the Site or transferred, licensed, transmitted or authorized by the owners and / or assignees') + '. ');\n\t\tdocument.write(translate_sentence('The User agrees not to remove or alter any distinctive sign used on the Site, including, but not be limited, brand names, trademarks (graphics, logos, etc), the \"copyright\" and other data identifying the rights of the Site or third parties on the Website') + '. ');\n\t\tdocument.write(translate_sentence('The Site own all rights over any works, inventions, discoveries, patents, ideas, concepts, updates and improvements related to the Site, systems, applications and programs or services provided by the Site, which are created , made, developed or implemented first by the Site either alone or with the help of users of the Site, during or as a result of a design, development or other activity performed in accordance with the Contract') + '. ');\n\t\tdocument.write(translate_sentence('You may not use the name, trademarks, symbols, logos or distinctive signs of ownership by the Site without the express written consent of the latter') + '. ');\n\t\tdocument.write(translate_sentence('In the event that any user or third party considers that any of the content on the site is in violation of copyright or other rights of intellectual property protection, please notify us at') + ': ' + company_email + '. ');\n\t\tdocument.write('<br/><br/><h6>' + translate_sentence('11.- JURISDICTION AND LAW') + '</h6>');\n\t\tdocument.write(translate_sentence('The Terms of Use that are in this Agreement are governed by law. Both the Site and the users of the Site agree that any dispute that may arise regarding the interpretation, compliance and / or enforcement of these rules shall be subject to the jurisdiction of the Courts and Tribunals , with expressly waive any other jurisdiction that may correspond') + '. ');\n\t\tdocument.write(translate_sentence('</div>'));\t//Justify\n\t}\n}", "function init_sys_data()\r\n{\t\r\n\tvar hdrstr= \"app4STATICS\";\r\n\tvar ftrstr= \"College of Engineering :: Michigan State University\";\r\n\t\r\n\tvar marks= [ '\\u0040',\t\t// start marker @\r\n\t\t\t\t '\\u007c' ]\t// end marker |\r\n\t\r\n\tvar codearr= [\r\n\t\t{ name:'deg', \tcode:'\\u00b0' },\r\n\t\t{ name:'plusminus',\tcode:'\\u00b1' },\r\n\t\t{ name:'super2', \tcode:'\\u00b2' },\r\n\t\t{ name:'super3', \tcode:'\\u00b3' },\r\n\t\t\t\t\t \r\n \t\t{ name:'alpha', \tcode:'\\u03b1' },\r\n\t\t{ name:'beta', \tcode:'\\u03b2' },\r\n\t\t{ name:'gamma', \tcode:'\\u03b3' },\r\n\t\t{ name:'delta', \tcode:'\\u03b4' },\r\n\t\t{ name:'epsilon', \tcode:'\\u03b5' },\r\n\t\t{ name:'zeta', \t\tcode:'\\u03b6' },\r\n\t\t{ name:'eta', \t\tcode:'\\u03b7' },\r\n\t\t{ name:'theta', \tcode:'\\u03b8' },\r\n\t\t{ name:'iota', \t\tcode:'\\u03b9' },\r\n\t\t{ name:'kappa', \tcode:'\\u03ba' },\r\n\t\t{ name:'lambda', \tcode:'\\u03bb' },\r\n\t\t{ name:'mu', \t\tcode:'\\u03bc' },\r\n\t\t{ name:'nu', \t\tcode:'\\u03bd' },\r\n\t\t{ name:'xi', \t\tcode:'\\u03be' },\r\n\t\t{ name:'omicron', \tcode:'\\u03bf' },\t\t\t\t\t \r\n\t\t{ name:'pi', \tcode:'\\u03c0' },\t\t\t\t\t \r\n\t\t{ name:'rho', \tcode:'\\u03c1' },\r\n\t\t//\t { name:'sigmaend', code:'\\u03c2' },\r\n\t\t{ name:'sigma', \tcode:'\\u03c3' }, \t\t\t\t\t \r\n\t\t{ name:'tau', \tcode:'\\u03c4' },\r\n\t\t{ name:'upsilon', \tcode:'\\u03c5' },\t\t\t\t\t \r\n\t\t{ name:'phi', \tcode:'\\u03c6' },\r\n\t\t{ name:'chi', \tcode:'\\u03c7' },\t\t\t\t\t \r\n\t\t{ name:'psi', \tcode:'\\u03c8' },\r\n\t\t{ name:'omega',\t\tcode:'\\u03c9' } ]\r\n\r\n\tvar sysdat= {\thdrstr:\t\thdrstr,\r\n\t\t\t\t\tftrstr:\t\tftrstr,\r\n\t\t\t\t\tmarks:\t marks,\r\n\t\t\t\t\tcodearr:\tcodearr };\r\n\t\t\t\t\t \r\n\treturn sysdat;\r\n}", "function generateQrCode() { \n if(isMobile) {\n information[2] = 'mobile_browser';\n }\n\n if(isSecure()){\n if(navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n information[0] = position.coords.latitude;\n information[1] = position.coords.longitude;\n hitAPI(information);\n }, function(error) {\n hitAPI(information);\n //handleNoGeolocation(true);\n });\n } else {\n hitAPI(information);\n //handleNoGeolocation(false);\n } \n\n }else{\n hitAPI(information);\n }\n \n }", "function _swdoc_lcf(oDocument)\r\n{\r\n\toDocument._OnAcceptCall=_swdoc_lcf_OnAcceptCall;\r\n\toDocument._OnLogAndAssignCall=_swdoc_lcf_OnLogAndAssignCall;\r\n\toDocument._OnLogAndResolveCall=_swdoc_lcf_OnLogAndResolveCall;\r\n\toDocument._OnLogCall=_swdoc_lcf_OnLogCall;\r\n\toDocument._OnTakeCall=_swdoc_lcf_OnTakeCall;\r\n\r\n\toDocument._OnCallLoggedOK =_swdoc_lcf_OnCallLoggedOK;\r\n\toDocument._OnSetProfileCodeFilter =_swdoc_lcf_OnSetProfileCodeFilter;\r\n\toDocument._OnRecordReset = _swdoc_lcf_OnRecordReset;\r\n\toDocument._OnRecordResolved = _swdoc_lcf_OnRecordResolved;\r\n\toDocument._CheckSpecialFields = _swdoc_lcf_CheckSpecialFields;\r\n\toDocument._OnResolveRecord = _swdoc_lcf_OnResolveRecord;\r\n\r\n\toDocument._setup_toolbar_buttons = _swdoc_lcf_setup_toolbar_buttons;\r\n\toDocument._process_form_toolbar_action = _swdoc_lcf_process_form_toolbar_action;\r\n\r\n\toDocument._send_session_data = _swdoc_lcf_onSendSessionData;\r\n\r\n\toDocument._complete_log_call = _swdoc_lcf_complete_log_call;\r\n\toDocument._AttachMailMessageToCall =\t_swdoc_lcf_AttachMailMessageToCall;\r\n\r\n\t\r\n\t//-- 06.05.2013 - 90754 - support lcf document level methods\r\n\toDocument.AcceptCall = _swdoc_lcf_OnAcceptCall;\r\n\toDocument.LogAndAssignCall = _swdoc_lcf_OnLogAndAssignCall;\r\n\toDocument.LogAndResolveCall = _swdoc_lcf_OnLogAndResolveCall;\r\n\toDocument.TakeCall = _swdoc_lcf_OnTakeCall;\r\n\toDocument.LogCall = _swdoc_lcf_OnLogCall;\r\n\r\n\r\n}", "function headYesSubHeadCopy() {\r\n $('.subscription-gate .sign-up-desc h2.headline').text(bmYesHeading);\r\n $('.subscription-gate .sign-up-desc p.body').text(bmYesSubHeading);\r\n }", "function TELUGU_elementsExtraJS() {\n // screen (TELUGU) extra code\n }", "function karinaFaarNotifikation() {\n\n\n\n}", "function fields() {\n personal_data = {\n 'my_name': ['Tim Booher'],\n 'grade': ['O-5'],\n 'ssn': ['111-22-2222'],\n 'address_and_street': ['200 E Dudley Ave'],\n 'b CITY': ['Westfield'],\n 'c STATE': ['NJ'],\n 'daytime_tel_num': ['732-575-0226'],\n 'travel_order_auth_number': ['7357642'],\n 'org_and_station': ['US CYBER JQ FFD11, MOFFETT FLD, CA'],\n 'e EMAIL ADDRESS': ['[email protected]'],\n 'eft': ['X'],\n 'tdy': ['X'],\n 'house_hold_goodies': ['X'],\n 'the_year': ['2018']\n }\n trip_data = { 'a DATERow3_2': ['07/19'], 'reason1': ['AT'], 'a DATERow5_2': ['07/19'], 'reason2': ['AT'], 'reason3': ['TD'], 'a DATERow7_2': ['07/21'], 'a DATERow9_2': ['07/15'], 'b NATURE OF EXPENSERow81': ['Capital Bikeshare'], 'a DATERow1_2': ['07/15'], 'b NATURE OF EXPENSERow41': ['Travel from summit to BOS'], 'b NATURE OF EXPENSERow1': ['Travel from IAD to Hotel'], 'from1': ['07/15'], 'to2': ['07/15'], 'to1': ['07/15'], 'from4': ['07/19'], 'to4': ['07/19'], 'to3': ['07/19'], 'from5': ['07/21'], 'from2': ['07/15'], 'to6': ['07/21'], 'from3': ['07/19'], 'to5': ['07/21'], 'reason4': ['TD'], 'reason5': ['AT'], 'from6': ['07/21'], 'reason6': ['MC'], 'c AMOUNTRow8': ['25.0'], 'c AMOUNTRow7': ['45.46'], 'c AMOUNTRow6': ['11.56'], 'c AMOUNTRow5': ['38.86'], 'c AMOUNTRow9': ['23.0'], 'b NATURE OF EXPENSERow7': ['Travel from EWR to HOR'], 'b NATURE OF EXPENSERow3': ['Travel between meetings'], 'a DATERow10_2': ['07/18'], 'c AMOUNTRow4': ['28.4'], 'c AMOUNTRow3': ['21.1'], 'c AMOUNTRow2': ['23.77'], 'c AMOUNTRow1': ['43.5'], 'mode6': ['CA'], 'a DATERow2_2': ['07/15'], 'mode5': ['CP'], 'mode4': ['CP'], 'a DATERow4_2': ['07/19'], 'mode3': ['CP'], 'ardep6': ['HOR'], 'a DATERow6_2': ['07/19'], 'a DATERow8_2': ['07/21'], 'b NATURE OF EXPENSERow6': ['Travel from hotel to IAD'], 'ardep1': ['EWR'], 'd ALLOWEDRow10': ['6.25'], 'b NATURE OF EXPENSERow2': ['Travel from BOS to Meeting'], 'ardep5': ['EWR'], 'ardep4': ['Arlington VA'], 'ardep3': ['BOS'], 'ardep2': ['Arlington VA'], 'c AMOUNTRow10': ['6.25'], 'mode2': ['CP'], 'mode1': ['CA'], 'b NATURE OF EXPENSERow9': ['Metro'], 'b NATURE OF EXPENSERow5': ['Travel from hotel to DCA'], 'd ALLOWEDRow1': ['43.5'], 'b NATURE OF EXPENSERow1': ['Travel from HOR to EWR'], 'd ALLOWEDRow3': ['21.1'], 'd ALLOWEDRow2': ['23.77'], 'd ALLOWEDRow5': ['38.86'], 'd ALLOWEDRow4': ['28.4'], 'd ALLOWEDRow7': ['45.46'], 'd ALLOWEDRow6': ['11.56'], 'd ALLOWEDRow9': ['23.0'], 'd ALLOWEDRow8': ['25.0'] }\n return Object.assign({}, personal_data, trip_data);\n}", "function show_satisfaction_policy_page_content() {\n\tif (checksameurl(location.href, satisfactionpolicypage) == true && satisfaction_policy_auto_content == true) {\n\t\tdocument.write(translate_sentence('We will try our best to make sure the products shipped to our customers are in good quality') + '. ');\n\t\tdocument.write(translate_sentence('If there are some problems on the goods, you have right to guarantee your benefits') + '. ');\n\t\tdocument.write(translate_sentence('You do not have to worry about anything!') + '. ');\n\t\tdocument.write('<br/><br/><h6>' + translate_sentence('Return and refund') + '</h6>');\n\t\tdocument.write(translate_sentence('The products with quality problem can be returned and refund') + '. ');\n\t\tdocument.write(translate_sentence('The customer will need to send the products back to us') + '. ');\n\t\tdocument.write(translate_sentence('When we receive the products, we will give the refund') + '. ');\n\t\tdocument.write('<br/><br/><h6>' + translate_sentence('Loss') + '</h6>');\n\t\tdocument.write(translate_sentence('If your packet has been sent but you do not receive the packet, the problem is the carrier') + '. ');\n\t\tdocument.write(translate_sentence('But we want to have satisfied customer') + '. ');\n\t\tdocument.write(translate_sentence('For that, if your packet is lost, we will refund your money or we will send again') + '. ');\n\t\tdocument.write('<br/><br/><h6>' + translate_sentence('Replace') + '</h6>');\n\t\tdocument.write(translate_sentence('Products with quality problem can be returned and replaced') + '. ');\n\t\tdocument.write(translate_sentence('Customer need to send the products back to us') + '. ');\n\t\tdocument.write(translate_sentence('When we receive the products, we will replace new ones and ship back to customer') + '. ');\n\t}\n}", "function emblContentMetaProperties_Read() {\n var metaProperties = {};\n // <!-- Content descriptors -->\n // <meta name=\"embl:who\" content=\"{{ meta-who }}\"> <!-- the people, groups and teams involved -->\n // <meta name=\"embl:what\" content=\"{{ meta-what }}\"> <!-- the activities covered -->\n // <meta name=\"embl:where\" content=\"{{ meta-where }}\"> <!-- at which EMBL sites the content applies -->\n // <meta name=\"embl:active\" content=\"{{ meta-active }}\"> <!-- which of the who/what/where is active -->\n metaProperties.who = metaProperties.who || document.querySelector(\"meta[name='embl:who']\");\n metaProperties.what = metaProperties.what || document.querySelector(\"meta[name='embl:what']\");\n metaProperties.where = metaProperties.where || document.querySelector(\"meta[name='embl:where']\");\n metaProperties.active = metaProperties.active || document.querySelector(\"meta[name='embl:active']\");\n\n // <!-- Content role -->\n // <meta name=\"embl:utility\" content=\"-8\"> <!-- if content is task and work based or if is meant to inspire -->\n // <meta name=\"embl:reach\" content=\"-5\"> <!-- if content is externally (public) or internally focused (those that work at EMBL) -->\n metaProperties.utility = metaProperties.utility || document.querySelector(\"meta[name='embl:utility']\");\n metaProperties.reach = metaProperties.reach || document.querySelector(\"meta[name='embl:reach']\");\n\n // <!-- Page infromation -->\n // <meta name=\"embl:maintainer\" content=\"{{ meta-maintainer }}\"> <!-- the contact person or group responsible for the page -->\n // <meta name=\"embl:last-review\" content=\"{{ meta-last-review }}\"> <!-- the last time the page was reviewed or updated -->\n // <meta name=\"embl:review-cycle\" content=\"{{ meta-review-cycle }}\"> <!-- how long in days before the page should be checked -->\n // <meta name=\"embl:expiry\" content=\"{{ meta-expiry }}\"> <!-- if there is a fixed point in time when the page is no longer relevant -->\n metaProperties.maintainer = metaProperties.maintainer || document.querySelector(\"meta[name='embl:maintainer']\");\n metaProperties.lastReview = metaProperties.lastReview || document.querySelector(\"meta[name='embl:last-review']\");\n metaProperties.reviewCycle = metaProperties.reviewCycle || document.querySelector(\"meta[name='embl:review-cycle']\");\n metaProperties.expiry = metaProperties.expiry || document.querySelector(\"meta[name='embl:expiry']\");\n for (var key in metaProperties) {\n if (metaProperties[key] != null && metaProperties[key].getAttribute(\"content\").length != 0) {\n metaProperties[key] = metaProperties[key].getAttribute(\"content\");\n } else {\n metaProperties[key] = 'notSet';\n }\n }\n return metaProperties;\n}", "function set_entityusecode() {\n var STATES = get_states_map(); //use state map to get state abbreviations based on states internal ids\n var USECODES = create_usecodes_map();\n var length_of_address_list = nlapiGetLineItemCount('addressbook'); //find length of address book so we can sort through it\n var tax_exempt_states = nlapiGetFieldValues('custentity_tax_exempt_states'); //grab array of internal ids where the customer is tax exempt\n if (tax_exempt_states) {\n for (var i = 1; i <= length_of_address_list; i++) { //loop through each address line\n nlapiSelectLineItem('addressbook', i);\n var state = nlapiGetCurrentLineItemValue('addressbook', 'state'); //grab state on the line\n nlapiLogExecution('DEBUG', 'state', state);\n if(STATES[state]){\n var state_id = STATES[state].toString(); //need to compare to string for comparison\n if (tax_exempt_states.indexOf(state_id) !== -1) { //if state on address is in tax exempt states\n nlapiSetCurrentLineItemValue('addressbook', 'custpage_ava_entityusecode', USECODES.G); //set entity use code to 2\n } else {\n nlapiSetCurrentLineItemValue('addressbook', 'custpage_ava_entityusecode', USECODES.TAXABLE); // else set it to 1\n }\n nlapiCommitLineItem('addressbook');\n }\n }\n }\n window.entityusecode_needs_to_be_set = false; //this is a global used to tell if this function should be called. Set to true on click of adding or editing an address\n\n function create_usecodes_map() {\n return {\n Z: '2'\n , G: '3'\n , TAXABLE: '1'\n };\n }\n function get_states_map() {\n return {\n AL: 1,\n AK: 2,\n AZ: 3,\n AR: 4,\n CA: 5,\n CO: 6,\n CT: 7,\n DE: 8,\n FL: 9,\n GA: 10,\n HI: 11,\n ID: 12,\n IL: 13,\n IN: 14,\n IA: 15,\n KS: 16,\n KY: 17,\n LA: 18,\n ME: 19,\n MD: 20,\n MA: 21,\n MI: 22,\n MN: 23,\n MS: 24,\n MO: 25,\n MT: 26,\n NE: 27,\n NV: 28,\n NH: 29,\n NJ: 30,\n NM: 31,\n NY: 32,\n NC: 33,\n ND: 34,\n OH: 35,\n OK: 36,\n OR: 37,\n PA: 38,\n RI: 39,\n SC: 40,\n SD: 41,\n TN: 42,\n TX: 43,\n UT: 44,\n VT: 45,\n VA: 46,\n WA: 47,\n WV: 48,\n WI: 49,\n WY: 50\n };\n }\n}", "function _0001485874496781_New_York_Pass_Serial_Number_Capture()\n{\n InitializationEnviornment.initiliaze();\n AppLoginLogout.login();\n try { \n var keyWordNm =\"Daily Tickets\";\n var packageNm = \"NY Pass Package\";\n var subPakNm=\"Adult\"; \n var refersName =\"12345\";\n Log.AppendFolder(\"_0001485874496781_New_York_Pass_Serial_Number_Capture\");\n \n WrapperFunction.selectKeywordName(keyWordNm); \n selectPackage(packageNm,subPakNm); \n finilizeOrder();\n aqUtils.Delay(2000); \n if(mcformwrapperNyPassPackageAdultE.Exists && mcformwrapperNyPassPackageAdultE.VisibleOnScreen){\n WrapperFunction.setTextValue(NYPassValidationtextinput,refersName);\n Button.clickOnButton(Passholder_NextButton);\n aqUtils.Delay(3000);\n if(labelSettlement.Exists && labelSettlement.VisibleOnScreen && labelSettlement.Caption ==\"Settlement\" )\n {\n Log.Message(\"The user is taken to the 'Settlement screen' after entering the referrers name.\"); \n }else{\n merlinLogError(\"Settlement screen is not displayed after entering the referrers name.\");\n } \n }else{\n merlinLogError(\"A Trade referral prompt is not appears after finalising the cart.\")\n } \n } catch (e) {\n\t merlinLogError(\"Oops! There's some glitch in the script: \" + e.message);\n\t return;\n }\n finally { \n\t Log.PopLogFolder();\n } \n AppLoginLogout.logout(); \n}", "function headNoSubHeadCopy() {\r\n $('.subscription-gate .sign-up-desc h2.headline').text(bmNoHeading);\r\n $('.subscription-gate .sign-up-desc p.body').text(bmNoSubHeading);\r\n }", "function addSignature()\r\n{\r\n var storedObject = GM_getValue(\"SGNSignatureObject\");\r\n var scriptElement = document.createElement('script');\r\n scriptElement.type = 'text/javascript';\r\n scriptElement.innerHTML = 'function addSignature() { if(vB_Editor.vB_Editor_001 != undefined){ var element = vB_Editor.vB_Editor_001.editor.getData(); vB_Editor.vB_Editor_001.editor.setData(element+\"\\\\n\\\\n\"+\"'+storedObject+'\"); }else{ var element = vB_Editor.vB_Editor_QR.editor.getData(); vB_Editor.vB_Editor_QR.editor.setData(element+\"\\\\n\\\\n\"+\"'+storedObject+'\"); } }';\r\n unsafeWindow.document.getElementsByTagName(\"head\")[0].appendChild(scriptElement);\r\n}", "function PaginaInicial_elementsExtraJS() {\n // screen (PaginaInicial) extra code\n\n }", "function ExtractFormattedTextBasedOnURL()\n{\n // For KBs\n if (URLOBJECT.urlText.indexOf('help.bittitan.com') != -1)\n {\n if (URLOBJECT.urlText.indexOf('community') !== -1)\n {\n titleText = document.getElementById(\"DeltaPlaceHolderPageTitleInTitleArea\").innerText.trim();\n } else if (URLOBJECT.urlText.indexOf('help.bittitan') !== -1)\n {\n titleText = document.getElementsByClassName(\"article-title\")[0].innerText.trim();\n } else\n {\n titleText = document.getElementsByClassName(\"single_overview\")[0].innerText.split('\\n')[0].trim();\n }\n\n escapedTitleText = titleText.replace(/\\[/g, '\\\\[');\n escapedTitleText = escapedTitleText.replace(/\\]/g, '\\\\]');\n escapedUrlText = URLOBJECT.urlText.replace(/\\(/g, '\\\\(');\n escapedUrlText = escapedUrlText.replace(/\\)/g, '\\\\)');\n\n if (DOUBLECLICKCOUNT === 1)\n {\n CopyTextToClipboard('---------------\\n' + titleText + ' : \\n' + URLOBJECT.urlText + '\\n---------------');\n } else\n {\n CopyTextToClipboard('[' + escapedTitleText + ']' + '(' + escapedUrlText + ')');\n }\n\n }\n\n // For DEPLOYMENTPRO page\n if (URLOBJECT.urlText.indexOf('manage.bittitan.com/device-managemen') != -1) \n {\n var itemCount = 0;\n var txtUserEmail = '', txtUserDevicesRaw = '', txtUserDevices = '', txtCurrentTabName = '', txtStaticWorkGroupNameBold = '';\n\n txtAccountName = ExtractImpersonationAccountID();\n txtAccountNameBold = \"**Account Name :** \" + txtAccountName + \"\\n\";\n\n //WorkGroup Name\n nodelistWorkGroup = document.querySelectorAll('.select-workgroup_current-workgroup');\n if (typeof nodelistWorkGroup[0] != 'undefined')\n {\n txtStaticWorkGroupNameBold = \"**Workgroup Name:** \" + nodelistWorkGroup[0].innerHTML.trim() + \"\\n\";\n }\n\n //Current tab under Customer - USERS or COMPUTERS\n nodelistCurrentCustomerTab = document.querySelectorAll('.breadcrumbs_current');\n if (typeof nodelistCurrentCustomerTab[0] != 'undefined' & nodelistCurrentCustomerTab != null)\n {\n txtCurrentTabName = nodelistCurrentCustomerTab[0].innerHTML.trim();\n }\n\n //Customer Name\n nodelistCustomerName = document.querySelectorAll('.testing_select-customer-selection');\n if (typeof nodelistCustomerName[0] != 'undefined')\n {\n txtStaticCustomerNameBold = \"**Customer Name:** \" + \"[\" + nodelistCustomerName[0].innerHTML.trim() + \" \\\\[\" + txtCurrentTabName + \"\\\\]\" + \"](\" + URLOBJECT.urlText + \")\" + \"\\n\";\n }\n completeMWInformationText = txtAccountNameBold;\n completeMWInformationText = completeMWInformationText + txtStaticWorkGroupNameBold;\n completeMWInformationText = completeMWInformationText + txtStaticCustomerNameBold;\n console.log(completeMWInformationText);\n\n\n //Checkboxes\n nodelistCheckBoxes = document.querySelectorAll('.table_td .checkbox_field');\n\n // Format text for line items if not empty\n if (typeof nodelistCheckBoxes[0] != 'undefined' & nodelistCheckBoxes != null) \n {\n for (x = 0; x < nodelistCheckBoxes.length; ++x)\n {\n if (nodelistCheckBoxes[x].checked == true)\n {\n itemCount++;\n var rows = document.querySelectorAll('.h-width-px-35+ .table_td'), i; //Primary Email Address\n var rowsUPN = document.querySelectorAll('.table_td:nth-child(3)');\n //var rowsLicense = document.querySelectorAll('.h-pointer .ember-view');\n var rowsLicense = document.querySelectorAll('.table_td:nth-child(4)');\n var rowsStatus = document.querySelectorAll('.table_td:nth-child(5)');\n\n for (i = 0; i <= x; i++)\n {\n console.log(i + \" : \" + rowsLicense[i].innerText);\n console.dir(rowsLicense[i]);\n if (i === x)\n {\n txtUserEmail = txtUserEmail + rows[i].innerText.trim() + \" [UPN:\" + rowsUPN[i].innerText + \", License:\" + rowsLicense[i].innerText + \", Status:\" + rowsStatus[i].innerText+ \"]\" + \"\\n\";\n console.dir(rowsLicense[i]);\n }\n }\n }\n }\n\n completeMWInformationText = txtAccountNameBold;\n completeMWInformationText = completeMWInformationText + txtStaticWorkGroupNameBold;\n completeMWInformationText = completeMWInformationText + txtStaticCustomerNameBold;\n\n if (itemCount === 1)\n {\n txtUserEmailBold = \"**User:** \" + txtUserEmail + \"\\n\";\n completeMWInformationText = completeMWInformationText + txtUserEmailBold;\n } else if (itemCount != 0)\n {\n txtUserEmailBold = \"**Users:** \" + \"\\n\" + txtUserEmail + \"\\n\";\n completeMWInformationText = completeMWInformationText + txtUserEmailBold;\n }\n }\n CopyTextToClipboard(completeMWInformationText);\n }\n\n // For MSPC CUSTOMER page\n if (URLOBJECT.urlText.indexOf('manage.bittitan.com/customers') != -1) \n {\n var itemCount = 0;\n var txtUserEmail = '', txtUserDevicesRaw = '', txtUserDevices = '', txtCurrentTabName = '', txtStaticWorkGroupNameBold = '';\n\n txtAccountName = ExtractImpersonationAccountID();\n txtAccountNameBold = \"**Account Name :** \" + txtAccountName + \"\\n\";\n\n //WorkGroup Name\n nodelistWorkGroup = document.querySelectorAll('.select-workgroup_current-workgroup');\n if (typeof nodelistWorkGroup[0] != 'undefined')\n {\n txtStaticWorkGroupNameBold = \"**Workgroup Name:** \" + nodelistWorkGroup[0].innerHTML.trim() + \"\\n\";\n }\n\n //Current tab under Customer - USERS or COMPUTERS\n nodelistCurrentCustomerTab = document.querySelectorAll('.breadcrumbs_current');\n if (typeof nodelistCurrentCustomerTab[0] != 'undefined' & nodelistCurrentCustomerTab != null)\n {\n txtCurrentTabName = nodelistCurrentCustomerTab[0].innerHTML.trim();\n }\n\n //Customer Name\n nodelistCustomerName = document.querySelectorAll('.breadcrumbs_link.active');\n if (typeof nodelistCustomerName[0] != 'undefined')\n {\n txtStaticCustomerNameBold = \"**Customer Name:** \" + \"[\" + nodelistCustomerName[0].innerHTML.trim() + \" \\\\[\" + txtCurrentTabName + \"\\\\]\" + \"](\" + URLOBJECT.urlText + \")\" + \"\\n\";\n }\n\n if (txtCurrentTabName.toUpperCase() === \"USERS\")\n { //USERS\n\n //Checkboxes\n nodelistCheckBoxes = document.querySelectorAll('.table_td .checkbox_field');\n\n // Format text for line items if not empty\n if (typeof nodelistCheckBoxes[0] != 'undefined' & nodelistCheckBoxes != null) \n {\n for (x = 0; x < nodelistCheckBoxes.length; ++x)\n {\n if (nodelistCheckBoxes[x].checked == true)\n {\n itemCount++;\n var rows = document.querySelectorAll('.h-width-px-35+ .table_td'), i;\n var rowsDMA = document.querySelectorAll('.h-pointer:nth-child(5)');\n //var rowsLicense = document.querySelectorAll('.h-pointer .ember-view');\n var rowsLicense = document.querySelectorAll('.table_td:nth-child(6)');\n\n console.log(rowsDMA[0].innerText);\n\n for (i = 0; i <= x; i++)\n {\n console.log(i + \" : \" + rowsLicense[i].innerText);\n console.dir(rowsLicense[i]);\n if (i === x)\n {\n txtUserEmail = txtUserEmail + rows[i].innerText.trim() + \" [DMA:\" + rowsDMA[i].innerText + \", License:\" + rowsLicense[i].innerText + \"]\" + \"\\n\";\n console.dir(rowsLicense[i]);\n }\n }\n }\n }\n\n // Not Used; Try to get Device list regardless if there is any user selected\n nodelistUserDevice = document.querySelectorAll('.detail-panel_section:nth-child(4)');\n if (typeof nodelistUserDevice[0] != 'undefined' & nodelistUserDevice != null)\n {\n console.log(\"Inside txt user device\");\n txtUserDevicesRaw = nodelistUserDevice[0].innerText;\n txtUserDevicesRaw = txtUserDevicesRaw.split('\\n');\n console.log(\"outside txt user device : \" + txtUserDevicesRaw[0]);\n for (x = 2; x < txtUserDevicesRaw.length; ++x)\n {\n console.log(\"txt user device : \" + txtUserDevicesRaw[x]);\n tmptxtUserDevicesRaw = txtUserDevicesRaw[x].split('\\t');\n txtUserDevices = txtUserDevices + tmptxtUserDevicesRaw[0] + \":\" + tmptxtUserDevicesRaw[1] + \"\\n\";\n }\n }\n\n completeMWInformationText = txtAccountNameBold;\n completeMWInformationText = completeMWInformationText + txtStaticWorkGroupNameBold;\n completeMWInformationText = completeMWInformationText + txtStaticCustomerNameBold;\n\n if (itemCount === 1)\n {\n if (txtUserDevices != '')\n {\n if (txtUserDevices.split('\\n').length > 2)\n { //to cater for the additional \\n added manually to text\n txtUserEmailBold = \"**User:** \" + txtUserEmail + \"**Devices:** \" + \"\\n\" + txtUserDevices;\n } else\n {\n txtUserEmailBold = \"**User:** \" + txtUserEmail + \"**Devices:** \" + txtUserDevices;\n }\n } else\n {\n txtUserEmailBold = \"**User:** \" + txtUserEmail + \"\\n\";\n }\n completeMWInformationText = completeMWInformationText + txtUserEmailBold;\n } else if (itemCount != 0)\n {\n txtUserEmailBold = \"**Users:** \" + \"\\n\" + txtUserEmail + \"\\n\";\n completeMWInformationText = completeMWInformationText + txtUserEmailBold;\n }\n }\n } else if (txtCurrentTabName.toUpperCase() === \"COMPUTERS\")\n { //COMPUTERS\n //window.alert(\"Inside Computer tab :\" + txtCurrentTabName);\n txtComputerName = '';\n //Checkboxes\n nodelistCheckBoxes = document.querySelectorAll('.table_td .checkbox_field');\n\n // Format text for line items if not empty\n if (typeof nodelistCheckBoxes[0] != 'undefined' & nodelistCheckBoxes != null) \n {\n for (x = 0; x < nodelistCheckBoxes.length; ++x)\n {\n console.dir(nodelistCheckBoxes[x]);\n if (nodelistCheckBoxes[x].checked == true)\n {\n //window.alert(nodelistCheckBoxes);\n //console.dir(nodelistCheckBoxes);\n\n itemCount++;\n var rows = document.querySelectorAll('.h-width-px-35+ .table_td'), i;\n var rowsHeartBeat = document.querySelectorAll('.table_tr .h-pointer:nth-child(3)');\n var rowsComputerStatus = document.querySelectorAll('.table_td:nth-child(4)');\n\n console.log(rowsHeartBeat[0].innerText);\n\n for (i = 0; i <= x; i++)\n {\n //console.log(i + \" : \" + rowsHeartBeat[i].innerText);\n //console.dir(rowsComputerStatus[i]);\n if (i === x)\n {\n txtComputerName = txtComputerName + rows[i].innerText.trim() + \" [Heartbeat:\" + rowsHeartBeat[i].innerText + \", Status:\" + rowsComputerStatus[i].innerText + \"]\" + \"\\n\";\n //window.alert(txtComputerName);\n //console.dir(rowsComputerStatus[i]);\n }\n }\n }\n }\n\n // Not implemented; Try to get User list regardless if there is any COMPUTER selected\n txtUserDetected = '';\n nodelistUserDetected = document.querySelectorAll('.base-table .table_td');\n if (nodelistUserDetected != null & typeof nodelistUserDetected[0] != 'undefined')\n {\n for (var i = 0; i < nodelistUserDetected.length; i++)\n {\n if (nodelistUserDetected[i].innerText.trim() != '')\n {\n txtUserDetected = txtUserDetected + nodelistUserDetected[i].innerText + \"\\n\";\n }\n }\n //window.alert(txtUserDetected);\n }\n\n completeMWInformationText = txtAccountNameBold;\n completeMWInformationText = completeMWInformationText + txtStaticWorkGroupNameBold;\n completeMWInformationText = completeMWInformationText + txtStaticCustomerNameBold;\n\n if (itemCount === 1)\n {\n if (txtUserDetected != '')\n {\n txtComputerNameBold = \"**Computer:** \" + txtComputerName + \"**User(s):** \" + txtUserDetected;\n } else\n {\n txtComputerNameBold = \"**Computer:** \" + txtComputerName + \"\\n\";\n }\n completeMWInformationText = completeMWInformationText + txtComputerNameBold;\n } else if (itemCount != 0)\n {\n txtComputerNameBold = \"**Computers:** \" + \"\\n\" + txtComputerName + \"\\n\";\n completeMWInformationText = completeMWInformationText + txtComputerNameBold;\n }\n }\n }\n //window.alert(completeMWInformationText);\n CopyTextToClipboard(completeMWInformationText);\n }\n\n // For MigrationWiz page\n if (URLOBJECT.urlText.indexOf('migrationwiz.bittitan.com') != -1)\n {\n // For MW projects\n var FTObject = ExtractFormattedTextFromMW();\n\n if (URLOBJECT.urlText.split(\"/\").length - 1 === 5)\n {\n // Project Level\n var completeMWInformationText = '';\n\n if (DOUBLECLICKCOUNT === 1)\n {\n completeMWInformationText = FTObject.txtStaticAccountName;\n completeMWInformationText = completeMWInformationText + FTObject.txtStaticWorkGroupNameBold;\n completeMWInformationText = completeMWInformationText + FTObject.txtStaticProjectNameBold;\n completeMWInformationText = completeMWInformationText + FTObject.txtStaticItemNamesBold;\n completeMWInformationText = completeMWInformationText + \"**Issue:**\";\n } else\n {\n completeMWInformationText = FTObject.txtProblemStatement;\n completeMWInformationText = completeMWInformationText + FTObject.txtStaticAccountNameLink;\n completeMWInformationText = completeMWInformationText + FTObject.txtStaticWorkGroupName;\n completeMWInformationText = completeMWInformationText + FTObject.txtStaticProjectName;\n completeMWInformationText = completeMWInformationText + FTObject.txtStaticItemNames;\n completeMWInformationText = completeMWInformationText + FTObject.txtStaticEndText;\n }\n CopyTextToClipboard(completeMWInformationText);\n }\n\n if (URLOBJECT.urlText.split(\"/\").length - 1 === 6)\n {\n // Item Level\n var regexToExtractProjectUrl = /(https\\:\\/\\/.*\\/.*\\/.*\\/.*\\/).*(\\?qp_currentWorkgroupId=.*)/;\n var matchesForProjectOptionPage = regexToExtractProjectUrl.exec(URLOBJECT.urlText);\n\n var regexToExtractLineItemUrl = /(https\\:\\/\\/.*\\/.*\\/.*\\/.*\\/.*)(\\?qp_currentWorkgroupId=.*)/;\n var matchesForItemOptionPage = regexToExtractLineItemUrl.exec(URLOBJECT.urlText);\n\n var regexToExtractMailboxDiagnosticUrl = /\\/\\/.*\\/.*\\/.*\\/.*\\/([^\\?]+)\\?/;\n var matchesForMailboxDiagnosticPage = regexToExtractMailboxDiagnosticUrl.exec(URLOBJECT.urlText);\n\n CopyTextToClipboard(matchesForMailboxDiagnosticPage[1]);\n\n // If double-clicks detected, open Option pages and Diagnostic page\n if (DOUBLECLICKCOUNT === 1)\n {\n var actionUrl;\n var actionUrl = \"https://internal.bittitan.com/MailboxDiagnostic/ViewMailboxDiagnostic?mailboxId=\" + matchesForMailboxDiagnosticPage[1];\n browser.runtime.sendMessage({ action: 'open_new_tab', tabURL: actionUrl });\n var actionUrl = matchesForProjectOptionPage[1] + 'advancedOptions' + matchesForProjectOptionPage[2] + '&returnRoute=project';\n browser.runtime.sendMessage({ action: 'open_new_tab', tabURL: actionUrl });\n var actionUrl = matchesForItemOptionPage[1] + '/edit' + matchesForItemOptionPage[2];\n browser.runtime.sendMessage({ action: 'open_new_tab', tabURL: actionUrl });\n }\n }\n\n }\n}", "function acceptProposalOfSubmittedPolicy()\n{\n var edited_Name= document.getElementById(\"customerName1\").innerHTML;\n\n var edited_Dob= document.getElementById(\"c_dob\").innerHTML;\n\n var edited_Age= document.getElementById(\"c_age\").innerHTML;\n var edited_occupation= document.getElementById(\"c_Occupation\").innerHTML;\n var edited_martialStatus= document.getElementById(\"martialStatus\").innerHTML;\n var edited_policyType= document.getElementById(\"policyType\").innerHTML;\n var edited_term= document.getElementById(\"term\").innerHTML;\n var edited_sumAssured= document.getElementById(\"sumAssured\").innerHTML;\n var edited_DiseasesCovered= document.getElementById(\"DiseasesCovered\").innerHTML;\n var edited_gender= document.getElementById(\"gender\").innerHTML;\n\n\n var edited_Pharmacies= document.getElementById(\"c_Pharmacies_Allowed\").innerHTML;\n var edited_Hosptials= document.getElementById(\"c_Hospitals_Allowed\").innerHTML;\n var edited_ReEmberse= document.getElementById(\"c_Reemberse\").innerHTML;\n var edited_RoomRent= document.getElementById(\"c_RoomRent\").innerHTML;\n var edited_PharmacyLimit= document.getElementById(\"c_Pharmacy_Limit\").innerHTML;\n var edited_Riders_Deductable_Amount= document.getElementById(\"c_Deductable_Rider_Customer\").innerHTML;\n var edited_Base_Deductable_Amount= document.getElementById(\"c_Deductable_Base_Customer\").innerHTML;\n var edited_Coverage_Amount_for_Rider= document.getElementById(\"c_Coverage_Rider\").innerHTML;\n var edited_Rider_TimePeriod= document.getElementById(\"c_Rider_Term\").innerHTML;\n var edited_Medical_History= document.getElementById(\"c_Medical_History\").innerHTML;\n var edited_PolicyOwner= document.getElementById(\"POwner\").innerHTML;\n var edited_limitedPerDay= document.getElementById(\"c_limitperDay\").innerHTML;\n\n var agentNumber= \"A2017Sravan\";\n var PolicyNumber= document.getElementById(\"c_policyNumber\").innerHTML;\n var edited_emergency_amount= document.getElementById(\"c_limit_emergency\").innerHTML;\n var edited_limit_per_Year= document.getElementById(\"c_limit_per_year\").innerHTML;\n\n\n /*Entering the details into Database*/\n\n $.post('/Customer_Details_Approved_By_Insurance_Company',{AgentNumber: agentNumber,CustomerName: edited_Name,PolicyNumber: PolicyNumber,DateOfBirth: edited_Dob,\n Age: edited_Age,Gender:edited_gender,Occupation:edited_occupation,Martial_Status:edited_martialStatus,Policy_Type: edited_policyType,Term: edited_policyType,\n Sum_Assured: edited_sumAssured,Diseases_Covered: edited_DiseasesCovered,Medical_History: edited_Medical_History,Rider_Term: edited_Rider_TimePeriod,\n Rider_Coverage_Amount: edited_Coverage_Amount_for_Rider,Policy_Owner: edited_PolicyOwner,Deductable_Base: edited_Base_Deductable_Amount,\n Deductible_Rider: edited_Riders_Deductable_Amount,Limit_Per_Day: edited_limitedPerDay,Limit_For_Pharmacy: edited_PharmacyLimit,Limit_For_RoomRent: edited_RoomRent,\n ReEmburse: edited_ReEmberse,Pharmacies_Allowed: edited_Pharmacies,Hospitals_Allowed: edited_Hosptials,Year_Limit: edited_limit_per_Year,Emergency_Limit: edited_emergency_amount},function (data)\n {\n alert(\"data coming from policy Information\"+ JSON.stringify(data));\n });\n\n regulatorInstance.acceptProposalOfSubmittedPolicy.sendTransaction(0,{from: regulatorAccount, gas: defaultGas}).then(\n function (txHash) {\n $(\"#acceptProposalSuccess2\").html('<i class=\"fa fa-check\"</i>'+ ' Transaction'+ txHash + \" added to the blockchain\");\n $(\"#acceptProposalSuccess2\").show().delay(5000).fadeOut();\n }\n )\n\n // getCustomerInformation();\n\n}", "function setleadformparams()\n{\n var partner = getPartnerCode();\n setCookieFromParam(\"promocode\");\n setCookieFromParam(\"osb\");\n setCookieFromParam(\"id\");\n setCookieFromParam(\"email\");\n\t\n\t// this represents the add medium.\n\tsetCookieFromParam(\"custentity210\");\n\t\n\t// this represents scompid for the referring partner.\n\t// id of corresponding custom field in ns is custentity_ref_comp_id\n\tsetCookieFromParam(\"origin\");\n\t\n\treturn partner;\n}", "function showPrivacyUrl() {\n\tremoveMessageFromDivId();\n\tremoveSuccessOrFailureStrip();\n\tbookmarks.sethash('#moreinfo', showFooterPopup, footerUrlName[\"FooterPrivacyUrl\"]);\n\treturn false;\n}", "function Guarda_Clics_EMC()\r\n{\r\n\tGuarda_Clics(3,1);\r\n}", "function storeInfo(){\r\n // Meaning of GM Values: (Some of the variable names are in dutch, to stay compatible with older scripts) \r\n //\r\n // DORP (dutch for village): \r\n // id of the current active village. It's 0 when only 1 village is available and does not always accurate.\r\n // \r\n // MARKT (dutch for market):\r\n // an array of length 4 containing the amount of resources currently available for sale on the marketplace. (might often be inaccurate)\r\n //\r\n // PRODUCTIE (dutch for production):\r\n // an array of length 4 containing the production rates of resp. wood, clay, iron and grain. (amount produced per hour)\r\n //\r\n // ALLIANCE:\r\n // dictionary (map) mapping the names of your ally's members to a list of it's villages. \r\n\r\n none = \"0,0,0,0\";\r\n\r\n // Keep track of current city id\r\n x = location.href.match(\"newdid=(\\\\d+)\");\r\n if (x!=null) {\r\n dorp_id=x[1]-0;\r\n GM_setValue(prefix(\"DORP\"),dorp_id);\r\n } else {\r\n dorp_id=GM_getValue(prefix(\"DORP\"),0);\r\n }\r\n\r\n // Store info about resources put on the market if availbale\r\n x = document.getElementById(\"lmid2\");\r\n if (x!=null && x.innerHTML.indexOf(\"\\\"dname\\\"\")>0) {\r\n var res = document.evaluate( \"//table[@class='f10']/tbody/tr[@bgcolor='#ffffff']/td[2]\", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null );\r\n \r\n var cnt = new Array(0,0,0,0);\r\n \r\n for ( var i=0 ; i < res.snapshotLength; i++ ){\r\n c = res.snapshotItem(i).textContent - 0;\r\n t = res.snapshotItem(i).firstChild.src.match(\"\\\\d\") - 1;\r\n cnt[t] += c;\r\n }\r\n markt = eval(GM_getValue(prefix(\"MARKT\"), \"{}\"));\r\n if (markt==undefined) markt={};\r\n markt[dorp_id]=cnt;\r\n GM_setValue(prefix(\"MARKT\"), uneval(markt));\r\n }\r\n\r\n // Store info about production rate if available\r\n //function storeProductionRate(){\r\n if (location.href.indexOf(\"dorf1\")>0) {\r\n var res = document.evaluate( \"//div[@id='lrpr']/table/tbody/tr\", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null );\r\n var prod = new Array(0,0,0,0);\r\n \r\n for ( var i=0 ; i < res.snapshotLength; i++ ){\r\n c = res.snapshotItem(i).childNodes[4].firstChild.textContent.match(\"-?\\\\d+\") - 0;\r\n t = res.snapshotItem(i).childNodes[1].innerHTML.match(\"\\\\d\")[0] - 1;\r\n prod[t] += c;\r\n }\r\n productie = eval(GM_getValue(prefix(\"PRODUCTIE\"), \"{}\"));\r\n if (productie==undefined) productie={};\r\n productie[dorp_id]=prod;\r\n GM_setValue(prefix(\"PRODUCTIE\"), uneval(productie));\r\n }\r\n\r\n // Load ally data\r\n //function captureAllianceData(){\r\n try {\r\n ally = eval(GM_getValue(prefix(\"ALLIANCE\"), \"{}\"));\r\n if (ally==undefined) ally = {};\r\n } catch (e) {\r\n alert(e);\r\n ally = { };\r\n } \r\n if (ally==undefined) ally2={};\r\n\r\n // Store list of your alliance members.\r\n if (location.href.indexOf(\"allianz\")>0 && location.href.indexOf(\"s=\")<0) {\r\n var res = document.evaluate( \"//td[@class='s7']/a\", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null );\r\n if (res.snapshotLength>0) {\r\n ally2= ally;\r\n ally = {}\r\n for ( var i=0 ; i < res.snapshotLength; i++ ){\r\n x = res.snapshotItem(i);\r\n name = x.textContent;\r\n id = x.href.match(\"\\\\d+\")[0];\r\n cnt = x.parentNode.parentNode.childNodes[5].textContent;\r\n if (ally2[name] != undefined) {\r\n y = ally2[name];\r\n y[0] = id;\r\n y[1] = cnt;\r\n ally[name] = y;\r\n } else {\r\n // [id, pop, {city1: [city1,x,y],city2: [city2,x,y],...} ]\r\n ally[name] = [id, cnt, {}];\r\n }\r\n }\r\n GM_setValue(prefix(\"ALLIANCE\"), uneval(ally));\r\n }\r\n } \r\n\r\n // Get alliance member data\r\n if (location.href.indexOf(\"spieler\")>0) {\r\n who = document.body.innerHTML.match(\"<td class=\\\"rbg\\\" colspan=\\\"3\\\">[A-Z][a-z]+ ([^<]+)</td>\");\r\n if (who) {\r\n who = who[1];\r\n if (ally[who] != undefined || who == USERNAME) {\r\n var res = document.evaluate( \"//td[@class='s7']/a\", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null );\r\n cities = {};\r\n for ( var i=0 ; i < res.snapshotLength; i++ ){\r\n x = res.snapshotItem(i);\r\n name = x.textContent;\r\n y = x.parentNode.parentNode.childNodes[4].textContent.match(\"\\\\((-?\\\\d+)\\\\|(-?\\\\d+)\\\\)\");\r\n y[0] = name;none = \"0,0,0,0\";\r\n\r\n y[1] -= 0;\r\n y[2] -= 0;\r\n cities[name] = y;\r\n }\r\n if (ally[who]==undefined) ally[who]=[0,0,{}];\r\n ally[who][2] = cities;\r\n GM_setValue(prefix(\"ALLIANCE\"), uneval(ally));\r\n }\r\n }\r\n }\r\n }", "function BaixarOrdemTelefone_elementsExtraJS() {\n // screen (BaixarOrdemTelefone) extra code\n\n }", "getAuthor() {return \"de/odex\";}", "transient final private public function m168() {}", "function showSignature() {\r\n print(\"Showing signature\");\r\n window.sigCtl.GetSignature(onGetSignature);\r\n function onGetSignature(sigCtlV, sigObjV, status) {\r\n if (window.sdkPtr.ResponseStatus.OK == status) {\r\n var outputFlags = window.sdkPtr.RBFlags.RenderOutputPicture | window.sdkPtr.RBFlags.RenderColor24BPP;\r\n var sigObj = sigObjV;\r\n sigObj.RenderBitmap(SigCaptX_Globals_1.BITMAP_IMAGEFORMAT, sigcaptx_1.HTMLTags.imageBox.clientWidth, sigcaptx_1.HTMLTags.imageBox.clientHeight, SigCaptX_Globals_1.BITMAP_INKWIDTH, SigCaptX_Globals_1.BITMAP_INKCOLOR, SigCaptX_Globals_1.BITMAP_BACKGROUNDCOLOR, outputFlags, SigCaptX_Globals_1.BITMAP_PADDING_X, SigCaptX_Globals_1.BITMAP_PADDING_Y, onRenderBitmap);\r\n }\r\n else {\r\n print(\"Error retrieving signature\");\r\n }\r\n }\r\n function onRenderBitmap(sigObjV, bmpObj, status) {\r\n if (callbackStatusOK(\"Signature Render Bitmap\", status)) {\r\n if (null == sigcaptx_1.HTMLTags.imageBox.firstChild) {\r\n sigcaptx_1.HTMLTags.imageBox.appendChild(bmpObj.image);\r\n }\r\n else {\r\n sigcaptx_1.HTMLTags.imageBox.replaceChild(bmpObj.image, sigcaptx_1.HTMLTags.imageBox.firstChild);\r\n }\r\n if (sigcaptx_1.HTMLTags.chkSigText.checked) {\r\n sigObjV.GetSigText(onGetSigText);\r\n }\r\n else {\r\n SigCaptX_WizSessionCtrl_1.WizardEventController.stop();\r\n }\r\n }\r\n }\r\n // Displays the SigText string in the text box on the HTML document\r\n function onGetSigText(sigObjV, text, status) {\r\n if (callbackStatusOK(\"Signature Render Bitmap\", status)) {\r\n print(\"Sig text successfully obtained: \" + text);\r\n // At this point you can send the contents of \"text\" to the server \r\n // and then validate it at the server end\r\n print(\"Stopping script\");\r\n SigCaptX_WizSessionCtrl_1.WizardEventController.stop();\r\n }\r\n }\r\n }" ]
[ "0.6349964", "0.6185175", "0.5989746", "0.59572685", "0.5880583", "0.5861998", "0.58168954", "0.58015215", "0.56318897", "0.55347526", "0.5459655", "0.54007316", "0.5370882", "0.53627515", "0.53622305", "0.5313386", "0.5300119", "0.52952796", "0.5285075", "0.52832043", "0.5269198", "0.52454174", "0.5228648", "0.5217046", "0.5216302", "0.52071536", "0.5185259", "0.51685375", "0.51453334", "0.5144177", "0.51361454", "0.5116919", "0.5111558", "0.5101618", "0.509454", "0.50945026", "0.5093985", "0.5074906", "0.50582707", "0.5048681", "0.5042107", "0.5036732", "0.5032143", "0.50147", "0.50031304", "0.5002372", "0.5002335", "0.50010854", "0.5000911", "0.49923727", "0.4990274", "0.4983663", "0.49722216", "0.49635756", "0.49552384", "0.49439433", "0.49411154", "0.49293473", "0.49239868", "0.49112338", "0.4905622", "0.4905291", "0.489566", "0.48948592", "0.48760194", "0.4874072", "0.4866613", "0.48661837", "0.4864044", "0.48567605", "0.48528883", "0.485206", "0.4840013", "0.4838233", "0.48381203", "0.4831699", "0.4831235", "0.48310113", "0.48298043", "0.48275", "0.4827214", "0.4820625", "0.48205915", "0.4820499", "0.48150265", "0.48139814", "0.4813958", "0.48117423", "0.4811462", "0.48050973", "0.4804115", "0.48028624", "0.4798127", "0.47976515", "0.47889447", "0.47886157", "0.4788106", "0.47864008", "0.47823477", "0.47816116", "0.47809145" ]
0.0
-1
showing computer pattern with color changes
async function showPattern(show) { if(show == 0){ green(); } else if (show == 1){ red(); } else if (show == 2) { yellow(); } else if (show == 3) { blue(); } setTimeout(() => { originalColors(); }, light); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newRound() {\n //Animate color pattern for computer sequence\n\n playPattern();\n update();\n}", "function updatePattern(pat){ // call the pattern currently being created\n switch(pat) {\n case 0:\n rainbow();\n break;\n case 1:\n rainbowCycle();\n break;\n case 2:\n theaterChaseRainbow();\n break;\n case 3:\n colorWipe(strip.Color(255, 0, 0)); // red\n break; \n } \n}", "drawTimingPattern() {\n for (let i = 8; i < this.mNoOfModules - 8; i += 2) {\n this.mModuleValue[i][6].isBlack = true;\n this.mModuleValue[i][6].isFilled = true;\n this.mModuleValue[i + 1][6].isBlack = false;\n this.mModuleValue[i + 1][6].isFilled = true;\n this.mModuleValue[6][i].isBlack = true;\n this.mModuleValue[6][i].isFilled = true;\n this.mModuleValue[6][i + 1].isBlack = false;\n this.mModuleValue[6][i + 1].isFilled = true;\n }\n this.mModuleValue[this.mNoOfModules - 8][8].isBlack = true;\n this.mModuleValue[this.mNoOfModules - 8][8].isFilled = true;\n }", "function showOutput() {\n const color = rgbArr.join('')\n outputRGBPanel.textContent = `#${color}`\n rangeContainer.style.backgroundColor = `#${color}`\n}", "function alternateColors(){\n effectInterval = setInterval(function(){\n var red = Math.floor(Math.random() * 255);\n var green = Math.floor(Math.random() * 255);\n var blue = Math.floor(Math.random() * 255);\n var color =\"rgba(\" + red + \", \" + green + \", \" + blue + \", 100)\";\n drawScreen(color);\n }, 1500);\n}", "function drawPattern(n) {\n for (var i = 1; i <= n; i++) {\n var spaces = n - i;\n var hashes = i;\n for (var sp = 0; sp < spaces; sp++) {\n process.stdout.write(\" \");\n }\n for (var has = 0; has < hashes; has++) {\n process.stdout.write(\"#\");\n }\n process.stdout.write(\"\\n\");\n }\n}", "function generatePattern() {\n var randomNumber = Math.ceil(Math.random() * 4);\n pattern.push(colors[randomNumber]);\n showMoves();\n}", "function colorScreen(color){\n var doc = document.getElementById(\"plate\");\n var context = dc.getContext(\"2d\");\n context.fillStyle = numsToRGBHex(color);\n context.fillRect(50,50,50,50);\n}", "function rotateColors(display) {\n var red = 0;\n var green = 0;\n var blue = 0;\n display.setColor(red, green, blue);\n setInterval(function() {\n blue += 64;\n if (blue > 255) {\n blue = 0;\n green += 64;\n if (green > 255) {\n green = 0;\n red += 64;\n if (red > 255) {\n red = 0;\n }\n }\n }\n display.setColor(red, green, blue);\n display.setCursor(0,0);\n //display.write('red=' + red + ' grn=' + green + ' ');\n display.setCursor(1,0);\n //display.write('blue=' + blue + ' '); // extra padding clears out previous text\n display.write('and cute');\n }, 1000);\n}", "function rotateColors(display) {\nvar red = 0;\nvar green = 0;\nvar blue = 0;\ndisplay.setColor(red, green, blue);\nsetInterval(function() {\nblue += 64;\nif (blue > 255) {\n blue = 0;\n green += 64;\n if (green > 255) {\n green = 0;\n red += 64;\n if (red > 255) {\n red = 0;\n }\n }\n}\ndisplay.setColor(red, green, blue);\ndisplay.setCursor(0, 0);\ndisplay.write(' Hackster.io');\ndisplay.setCursor(1,1);\ndisplay.write('Intel Edison');\n // extra padding clears out previous text\n}, 1000);\n}", "setPalette(idx, c){\n if (idx < 0 || idx > 14){return;}//abort for invalid indexes\n if (this.pattern instanceof ACNHFormat){\n let rgb = c;\n if ((typeof c) == \"string\" && c.length == 7){\n rgb = [parseInt(c.substr(1, 2), 16), parseInt(c.substr(3, 2), 16), parseInt(c.substr(5, 2), 16)];\n }\n this.pattern.setPalette(idx, rgb);\n }\n if (this.pattern instanceof ACNLFormat){this.pattern.setPalette(idx, this.findRGB(c));}\n this.onColorChange();\n this.render();\n }", "function show(){\n output = \"#\"+red+green+blue;\n hex.innerHTML = output;\n display.style.backgroundColor = output;\n}", "function drawColorCycle() {\r\n\r\n\t// Set color cycling on or off:\r\n\tif (document.form.cycle[0].checked) {\r\n\t\tcolorCycle = true;\r\n\t\tdocument.form.direction[0].disabled = false;\r\n\t\tdocument.form.direction[1].disabled = false;\t\r\n\t}\r\n\telse if (document.form.cycle[1].checked) {\r\n\t\tcolorCycle = false;\r\n\t\tdocument.form.direction[0].disabled = true;\r\n\t\tdocument.form.direction[1].disabled = true;\t\t\r\n\t}\r\n\t\r\n\t// Set color cycling in or out\r\n\tif (document.form.direction[0].checked) {\r\n\t\tcolorCycleIn = true;\r\n\t}\r\n\telse if (document.form.direction[1].checked) {\r\n\t\tcolorCycleIn = false;\r\n\t}\r\n\t\r\n\tif (colorCycle) {\r\n\t\r\n\t\tvar imageData = image.data; // detach the pixel array from DOM\r\n\r\n\t\t// iterate trhough all pixels\r\n\t\tfor (var x = 0; x < CANVAS_WIDTH; x++) {\r\n\t\t\tfor (var y = 0; y < CANVAS_HEIGHT; y++) {\r\n\t\t\t\r\n\t\t\t\tvar i = y * CANVAS_WIDTH + x;\t\t// index of the pixel in imageData array\r\n\r\n\r\n\t\t\t\t// if the pixel is outside of the set, cycle its color by colorStep\r\n\t\t\t\tif (\"rgb(\" + imageData[4*i+0] + \", \" + imageData[4*i+1] + \", \" + imageData[4*i+2] + \")\" != \"rgb(0, 0, 0)\") {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (colorCycleIn == false) { \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// cyan to blue:\r\n\t\t\t\t\t\tif (imageData[4*i+0] == 0 && imageData[4*i+1] > 0 && imageData[4*i+2] == 255) {\r\n\t\t\t\t\t\t\timageData[4*i+1] -= colorStep;\r\n\t\t\t\t\t\t\tif (imageData[4*i+1] < 0){\r\n\t\t\t\t\t\t\t\talert(\"green is < 0\");\r\n\t\t\t\t\t\t\t\timageData[4*i+1] = 0;\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// blue to magenta:\r\n\t\t\t\t\t\telse if (imageData[4*i+0] < 255 && imageData[4*i+1] == 0 && imageData[4*i+2] == 255) {\r\n\t\t\t\t\t\t\timageData[4*i+0] += colorStep;\r\n\t\t\t\t\t\t\tif (imageData[4*i+0] > 255) {\r\n\t\t\t\t\t\t\t\timageData[4*i+0] = 255;\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// magenta to red:\r\n\t\t\t\t\t\telse if (imageData[4*i+0] == 255 && imageData[4*i+1] == 0 && imageData[4*i+2] > 0) {\r\n\t\t\t\t\t\t\timageData[4*i+2] -= colorStep;\r\n\t\t\t\t\t\t\tif (imageData[4*i+2] < 0) \r\n\t\t\t\t\t\t\t\timageData[4*i+2] = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// red to yellow:\r\n\t\t\t\t\t\telse if (imageData[4*i+0] == 255 && imageData[4*i+1] < 255 && imageData[4*i+2] == 0) {\r\n\t\t\t\t\t\t\timageData[4*i+1] += colorStep;\r\n\t\t\t\t\t\t\tif (imageData[4*i+1] > 255) \r\n\t\t\t\t\t\t\t\timageData[4*i+1] = 255;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// yellow to green:\r\n\t\t\t\t\t\telse if (imageData[4*i+0] > 0 && imageData[4*i+1] == 255 && imageData[4*i+2] == 0) {\r\n\t\t\t\t\t\t\timageData[4*i+0] -= colorStep;\r\n\t\t\t\t\t\t\tif (imageData[4*i+0] < 0) \r\n\t\t\t\t\t\t\t\timageData[4*i+0] = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// green to cyan:\r\n\t\t\t\t\t\telse if (imageData[4*i+0] == 0 && imageData[4*i+1] == 255 && imageData[4*i+2] < 255) {\r\n\t\t\t\t\t\t\timageData[4*i+2] += colorStep;\r\n\t\t\t\t\t\t\tif (imageData[4*i+2] > 255) \r\n\t\t\t\t\t\t\t\timageData[4*i+2] = 255;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\timageData[4*i+3] = 255; // Alpha value\r\n\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t\telse { // color cycle in\r\n\r\n\t\t\t\t\t\t// cyan to green:\r\n\t\t\t\t\t\tif (imageData[i*4+0] == 0 && imageData[4*i+1] == 255 && imageData[i*4+2] > 0) {\r\n\t\t\t\t\t\t\timageData[i*4+2] -= colorStep;\r\n\t\t\t\t\t\t\tif (imageData[i*4+2] < 0)\r\n\t\t\t\t\t\t\t\timageData[i*4+2] = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// green to yellow:\r\n\t\t\t\t\t\telse if (imageData[i*4+0] < 255 && imageData[4*i+1] == 255 && imageData[i*4+2] == 0) {\r\n\t\t\t\t\t\t\timageData[i*4+0] += colorStep;\r\n\t\t\t\t\t\t\tif (imageData[i*4+0] > 255) \r\n\t\t\t\t\t\t\t\timageData[i*4+0] = 255;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// yellow to red:\r\n\t\t\t\t\t\telse if (imageData[i*4+0] == 255 && imageData[4*i+1] > 0 && imageData[i*4+2] == 0) {\r\n\t\t\t\t\t\t\timageData[4*i+1] -= colorStep;\r\n\t\t\t\t\t\t\tif (imageData[4*i+1] < 0) \r\n\t\t\t\t\t\t\t\timageData[4*i+1] = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// red to magenta:\r\n\t\t\t\t\t\telse if (imageData[i*4+0] == 255 && imageData[4*i+1] == 0 && imageData[i*4+2] < 255) {\r\n\t\t\t\t\t\t\timageData[i*4+2] += colorStep;\r\n\t\t\t\t\t\t\tif (imageData[i*4+2] > 255) \r\n\t\t\t\t\t\t\t\timageData[i*4+2] = 255;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// magenta to blue:\r\n\t\t\t\t\t\telse if (imageData[i*4+0] > 0 && imageData[4*i+1] == 0 && imageData[i*4+2] == 255) {\r\n\t\t\t\t\t\t\timageData[i*4+0] -= colorStep;\r\n\t\t\t\t\t\t\tif (imageData[i*4+0] < 0) \r\n\t\t\t\t\t\t\t\timageData[i*4+0] = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// blue to cyan:\r\n\t\t\t\t\t\telse if (imageData[4*i+0] == 0 && imageData[4*i+1] < 255 && imageData[i*4+2] == 255) {\r\n\t\t\t\t\t\t\timageData[4*i+1] += colorStep;\r\n\t\t\t\t\t\t\tif (imageData[4*i+1] > 255) \r\n\t\t\t\t\t\t\t\timageData[4*i+1] = 255;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\timageData[4*i+3] = 255; // Alpha value\r\n\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\timage.data = imageData; // attach image data object back to DOM \r\n\t\tcontext.putImageData(image, 0, 0);\r\n\r\n\t}\r\n\t\r\n}", "function color() {\n var map = {\n \"black\" : [ 0/255,0/255,0/255 ],\n \"silver\": [ 192/255,192/255,192/255 ],\n \"gray\" : [ 128/255,128/255,128/255 ],\n \"white\" : [ 255/255,255/255,255/255 ],\n \"maroon\": [ 128/255,0/255,0/255 ],\n \"red\" : [ 255/255,0/255,0/255 ],\n \"purple\": [ 128/255,0/255,128/255 ],\n \"fuchsia\": [ 255/255,0/255,255/255 ],\n \"green\" : [ 0/255,128/255,0/255 ],\n \"lime\" : [ 0/255,255/255,0/255 ],\n \"olive\" : [ 128/255,128/255,0/255 ],\n \"yellow\": [ 255/255,255/255,0/255 ],\n \"navy\" : [ 0/255,0/255,128/255 ],\n \"blue\" : [ 0/255,0/255,255/255 ],\n \"teal\" : [ 0/255,128/255,128/255 ],\n \"aqua\" : [ 0/255,255/255,255/255 ],\n \"aliceblue\" : [ 240/255,248/255,255/255 ],\n \"antiquewhite\" : [ 250/255,235/255,215/255 ],\n \"aqua\" : [ 0/255,255/255,255/255 ],\n \"aquamarine\" : [ 127/255,255/255,212/255 ],\n \"azure\" : [ 240/255,255/255,255/255 ],\n \"beige\" : [ 245/255,245/255,220/255 ],\n \"bisque\" : [ 255/255,228/255,196/255 ],\n \"black\" : [ 0/255,0/255,0/255 ],\n \"blanchedalmond\" : [ 255/255,235/255,205/255 ],\n \"blue\" : [ 0/255,0/255,255/255 ],\n \"blueviolet\" : [ 138/255,43/255,226/255 ],\n \"brown\" : [ 165/255,42/255,42/255 ],\n \"burlywood\" : [ 222/255,184/255,135/255 ],\n \"cadetblue\" : [ 95/255,158/255,160/255 ],\n \"chartreuse\" : [ 127/255,255/255,0/255 ],\n \"chocolate\" : [ 210/255,105/255,30/255 ],\n \"coral\" : [ 255/255,127/255,80/255 ],\n \"cornflowerblue\" : [ 100/255,149/255,237/255 ],\n \"cornsilk\" : [ 255/255,248/255,220/255 ],\n \"crimson\" : [ 220/255,20/255,60/255 ],\n \"cyan\" : [ 0/255,255/255,255/255 ],\n \"darkblue\" : [ 0/255,0/255,139/255 ],\n \"darkcyan\" : [ 0/255,139/255,139/255 ],\n \"darkgoldenrod\" : [ 184/255,134/255,11/255 ],\n \"darkgray\" : [ 169/255,169/255,169/255 ],\n \"darkgreen\" : [ 0/255,100/255,0/255 ],\n \"darkgrey\" : [ 169/255,169/255,169/255 ],\n \"darkkhaki\" : [ 189/255,183/255,107/255 ],\n \"darkmagenta\" : [ 139/255,0/255,139/255 ],\n \"darkolivegreen\" : [ 85/255,107/255,47/255 ],\n \"darkorange\" : [ 255/255,140/255,0/255 ],\n \"darkorchid\" : [ 153/255,50/255,204/255 ],\n \"darkred\" : [ 139/255,0/255,0/255 ],\n \"darksalmon\" : [ 233/255,150/255,122/255 ],\n \"darkseagreen\" : [ 143/255,188/255,143/255 ],\n \"darkslateblue\" : [ 72/255,61/255,139/255 ],\n \"darkslategray\" : [ 47/255,79/255,79/255 ],\n \"darkslategrey\" : [ 47/255,79/255,79/255 ],\n \"darkturquoise\" : [ 0/255,206/255,209/255 ],\n \"darkviolet\" : [ 148/255,0/255,211/255 ],\n \"deeppink\" : [ 255/255,20/255,147/255 ],\n \"deepskyblue\" : [ 0/255,191/255,255/255 ],\n \"dimgray\" : [ 105/255,105/255,105/255 ],\n \"dimgrey\" : [ 105/255,105/255,105/255 ],\n \"dodgerblue\" : [ 30/255,144/255,255/255 ],\n \"firebrick\" : [ 178/255,34/255,34/255 ],\n \"floralwhite\" : [ 255/255,250/255,240/255 ],\n \"forestgreen\" : [ 34/255,139/255,34/255 ],\n \"fuchsia\" : [ 255/255,0/255,255/255 ],\n \"gainsboro\" : [ 220/255,220/255,220/255 ],\n \"ghostwhite\" : [ 248/255,248/255,255/255 ],\n \"gold\" : [ 255/255,215/255,0/255 ],\n \"goldenrod\" : [ 218/255,165/255,32/255 ],\n \"gray\" : [ 128/255,128/255,128/255 ],\n \"green\" : [ 0/255,128/255,0/255 ],\n \"greenyellow\" : [ 173/255,255/255,47/255 ],\n \"grey\" : [ 128/255,128/255,128/255 ],\n \"honeydew\" : [ 240/255,255/255,240/255 ],\n \"hotpink\" : [ 255/255,105/255,180/255 ],\n \"indianred\" : [ 205/255,92/255,92/255 ],\n \"indigo\" : [ 75/255,0/255,130/255 ],\n \"ivory\" : [ 255/255,255/255,240/255 ],\n \"khaki\" : [ 240/255,230/255,140/255 ],\n \"lavender\" : [ 230/255,230/255,250/255 ],\n \"lavenderblush\" : [ 255/255,240/255,245/255 ],\n \"lawngreen\" : [ 124/255,252/255,0/255 ],\n \"lemonchiffon\" : [ 255/255,250/255,205/255 ],\n \"lightblue\" : [ 173/255,216/255,230/255 ],\n \"lightcoral\" : [ 240/255,128/255,128/255 ],\n \"lightcyan\" : [ 224/255,255/255,255/255 ],\n \"lightgoldenrodyellow\" : [ 250/255,250/255,210/255 ],\n \"lightgray\" : [ 211/255,211/255,211/255 ],\n \"lightgreen\" : [ 144/255,238/255,144/255 ],\n \"lightgrey\" : [ 211/255,211/255,211/255 ],\n \"lightpink\" : [ 255/255,182/255,193/255 ],\n \"lightsalmon\" : [ 255/255,160/255,122/255 ],\n \"lightseagreen\" : [ 32/255,178/255,170/255 ],\n \"lightskyblue\" : [ 135/255,206/255,250/255 ],\n \"lightslategray\" : [ 119/255,136/255,153/255 ],\n \"lightslategrey\" : [ 119/255,136/255,153/255 ],\n \"lightsteelblue\" : [ 176/255,196/255,222/255 ],\n \"lightyellow\" : [ 255/255,255/255,224/255 ],\n \"lime\" : [ 0/255,255/255,0/255 ],\n \"limegreen\" : [ 50/255,205/255,50/255 ],\n \"linen\" : [ 250/255,240/255,230/255 ],\n \"magenta\" : [ 255/255,0/255,255/255 ],\n \"maroon\" : [ 128/255,0/255,0/255 ],\n \"mediumaquamarine\" : [ 102/255,205/255,170/255 ],\n \"mediumblue\" : [ 0/255,0/255,205/255 ],\n \"mediumorchid\" : [ 186/255,85/255,211/255 ],\n \"mediumpurple\" : [ 147/255,112/255,219/255 ],\n \"mediumseagreen\" : [ 60/255,179/255,113/255 ],\n \"mediumslateblue\" : [ 123/255,104/255,238/255 ],\n \"mediumspringgreen\" : [ 0/255,250/255,154/255 ],\n \"mediumturquoise\" : [ 72/255,209/255,204/255 ],\n \"mediumvioletred\" : [ 199/255,21/255,133/255 ],\n \"midnightblue\" : [ 25/255,25/255,112/255 ],\n \"mintcream\" : [ 245/255,255/255,250/255 ],\n \"mistyrose\" : [ 255/255,228/255,225/255 ],\n \"moccasin\" : [ 255/255,228/255,181/255 ],\n \"navajowhite\" : [ 255/255,222/255,173/255 ],\n \"navy\" : [ 0/255,0/255,128/255 ],\n \"oldlace\" : [ 253/255,245/255,230/255 ],\n \"olive\" : [ 128/255,128/255,0/255 ],\n \"olivedrab\" : [ 107/255,142/255,35/255 ],\n \"orange\" : [ 255/255,165/255,0/255 ],\n \"orangered\" : [ 255/255,69/255,0/255 ],\n \"orchid\" : [ 218/255,112/255,214/255 ],\n \"palegoldenrod\" : [ 238/255,232/255,170/255 ],\n \"palegreen\" : [ 152/255,251/255,152/255 ],\n \"paleturquoise\" : [ 175/255,238/255,238/255 ],\n \"palevioletred\" : [ 219/255,112/255,147/255 ],\n \"papayawhip\" : [ 255/255,239/255,213/255 ],\n \"peachpuff\" : [ 255/255,218/255,185/255 ],\n \"peru\" : [ 205/255,133/255,63/255 ],\n \"pink\" : [ 255/255,192/255,203/255 ],\n \"plum\" : [ 221/255,160/255,221/255 ],\n \"powderblue\" : [ 176/255,224/255,230/255 ],\n \"purple\" : [ 128/255,0/255,128/255 ],\n \"red\" : [ 255/255,0/255,0/255 ],\n \"rosybrown\" : [ 188/255,143/255,143/255 ],\n \"royalblue\" : [ 65/255,105/255,225/255 ],\n \"saddlebrown\" : [ 139/255,69/255,19/255 ],\n \"salmon\" : [ 250/255,128/255,114/255 ],\n \"sandybrown\" : [ 244/255,164/255,96/255 ],\n \"seagreen\" : [ 46/255,139/255,87/255 ],\n \"seashell\" : [ 255/255,245/255,238/255 ],\n \"sienna\" : [ 160/255,82/255,45/255 ],\n \"silver\" : [ 192/255,192/255,192/255 ],\n \"skyblue\" : [ 135/255,206/255,235/255 ],\n \"slateblue\" : [ 106/255,90/255,205/255 ],\n \"slategray\" : [ 112/255,128/255,144/255 ],\n \"slategrey\" : [ 112/255,128/255,144/255 ],\n \"snow\" : [ 255/255,250/255,250/255 ],\n \"springgreen\" : [ 0/255,255/255,127/255 ],\n \"steelblue\" : [ 70/255,130/255,180/255 ],\n \"tan\" : [ 210/255,180/255,140/255 ],\n \"teal\" : [ 0/255,128/255,128/255 ],\n \"thistle\" : [ 216/255,191/255,216/255 ],\n \"tomato\" : [ 255/255,99/255,71/255 ],\n \"turquoise\" : [ 64/255,224/255,208/255 ],\n \"violet\" : [ 238/255,130/255,238/255 ],\n \"wheat\" : [ 245/255,222/255,179/255 ],\n \"white\" : [ 255/255,255/255,255/255 ],\n \"whitesmoke\" : [ 245/255,245/255,245/255 ],\n \"yellow\" : [ 255/255,255/255,0/255 ],\n \"yellowgreen\" : [ 154/255,205/255,50/255 ] };\n\n var o, i = 1, a = arguments, c = a[0], alpha;\n\n if(a[0].length<4 && (a[i]*1-0)==a[i]) { alpha = a[i++]; } // first argument rgb (no a), and next one is numeric?\n if(a[i].length) { a = a[i], i = 0; } // next arg an array, make it our main array to walk through\n if(typeof c == 'string')\n c = map[c.toLowerCase()];\n if(alpha!==undefined)\n c = c.concat(alpha);\n for(o=a[i++]; i<a.length; i++) {\n o = o.union(a[i]);\n }\n return o.setColor(c);\n}", "function playerPattern(color, pattern) {\n const draw = {\n beehive: drawBeehive,\n toad: drawToad,\n lwss: drawLwss,\n glider: drawGlider,\n }\n if (draw[pattern]) {\n draw[pattern](color)\n primus.forEach(spark => spark.emit(GAME_EVENT.STATE, game.colors))\n }\n }", "function randomizePattern(){\n for(let i=0; i<n;i++){\n pattern[i] = [0,0,0,0,0,0,0,0]\n } // console.log(pattern)\n // console.log(x_index)\n // console.log(y_index)\n for(let i=0; i<n; i++){\n for(let j=0; j<n; j++){\n pattern[i][j] = '#bae8e8';\n }\n }\n\n for(let i=0; i<n/2; i++){\n for(let j=0; j<n/2; j++){\n if(Math.random()*(i+j)>20){\n pattern[i][j] = '#2c698d';\n }\n }\n }\n\n // Symmetry\n\n for(let i=n/2;i<n;i++){\n for(let j=0;j<n/2;j++){\n pattern[i][j] = pattern[n-1-i][j]\n }\n }\n\n for(let i=n/2;i<n;i++){\n for(let j=n/2;j<n;j++){\n pattern[i][j] = pattern[n-1-i][n-1-j]\n }\n }\n\n for(let i=0;i<n/2;i++){\n for(let j=n/2;j<n;j++){\n pattern[i][j] = pattern[i][n-1-j]\n }\n }\n setTimeout(() => {document.body.style.background = \"url(\" + cnv.canvas.toDataURL() + \")\";\n document.body.style.backgroundPosition = 'center'\n },\n 1000)\n}", "function rainbowColor() {\n updatePenMode(\"random\");\n}", "randomColor(a = 1.0, cycle = true) {\n if (cycle) CURRENT_HUE = (CURRENT_HUE + 73) % 360;\n return `hsla(${CURRENT_HUE},50%,50%,${a})`;\n }", "function colorPreview() {\r\n\t\t\t//récupération de la case \"aperçu\" à colorier et remplissage avec la couleur en cours\r\n\t \t$preview = $('#preview');\t\r\n\t\t\tvar previewCtx = $preview[0].getContext(\"2d\");\r\n\t\t previewCtx.fillStyle = color;\r\n\t\t previewCtx.fillRect(0, 0, 30.000, 30.000);\r\n\t\t}", "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 pattern() {\n var patternLeds;\n if (tessel) {\n var switches = ['on', 'off', 'off'];\n tessel.led[1][switches[0]]();\n tessel.led[2][switches[1]]();\n tessel.led[3][switches[2]]();\n patternLeds = setInterval(function() {\n // rotate the switches\n switches.unshift(switches.pop())\n tessel.led[1][switches[0]]();\n tessel.led[2][switches[1]]();\n tessel.led[3][switches[2]]();\n }, 100);\n setTimeout(function() {\n clearInterval(patternLeds)\n tessel.led[1].off();\n tessel.led[2].off();\n tessel.led[3].off();\n }, 4500);\n }\n}", "toString(){\n this.pattern.fromPixels(this.pixels);\n return this.pattern.toString();\n }", "function rainbowColorText(str){\r\n\tvar phase = 0, center = 128, width = 127, frequency = Math.PI*2/str.length, totalString = '';\r\n\tvar div = document.createElement('div');\r\n\tvar escape = document.createElement('textarea');\r\n\tdiv.innerHTML = str;\r\n\tif(div.firstChild !== null && div.firstChild !== undefined){\r\n\t\tvar decoded = div.firstChild.nodeValue;\r\n\t}else{\r\n\t\tvar decoded = '';\r\n\t}\r\n\tfor(var i=0; i<decoded.length; ++i){\r\n\t\tred = parseInt(Math.sin(frequency*i+2+phase) * width + center);\r\n\t\tgreen = parseInt(Math.sin(frequency*i+0+phase) * width + center);\r\n\t\tblue = parseInt(Math.sin(frequency*i+4+phase) * width + center);\r\n\t\tescape.innerHTML = decoded.substr(i,1);\r\n\t\ttotalString += '<span style=\"color:' + RGB2Color(red,green,blue) + '\">' + escape.innerHTML + '</span>';\r\n\t}\r\n\treturn totalString;\r\n}", "shiftColor() {\n\t\t// parse color into numbers\n\t\tvar colArr = [\n parseInt(this.color.substr(1,2),16),\n parseInt(this.color.substr(3,2),16),\n parseInt(this.color.substr(5,2),16)\n ];\n var colStr = '#';\n var val;\n const shift = Math.floor((Math.random() - 0.5) * this.colVar * this.colRange);\n\t\tfor (val of colArr) {\n\t\t\tval += shift;\n\t\t\tcolStr += val.toString(16);\n\t\t}\n\t\tthis.color = colStr;\n\t}", "function refreshSwatch2() {\n var cyan = $( \"#cyan\" ).slider( \"value\" ),\n magenta = $( \"#magenta\" ).slider( \"value\" ),\n yellow = $( \"#yellow\" ).slider( \"value\" ),\n key = $( \"#key\" ).slider( \"value\" ),\n hex = CMYK2RGB( cyan, magenta, yellow, key );\n\t document.getElementById('swatch2').innerHTML = '<div style=\"background-color:#' + hex +'\"><div onclick=\"aplikal(\\''+hex+'\\');\" class=\"aplikalo\" title=\"Activate\">&nearr;</div><input onClick=\"this.select();\" value=#' + hex + ' /> </div>';\n }", "show(){\r\n led.plotBrightness(this.x, this.y, 255/(this.depth+1))\r\n }", "display(){\n if(this.lives != 0){\n var newcolor = \"#\";\n var x;\n for(var i=1;i<7;i++){\n x = parseInt(this.color[i],16)\n x += 2;\n if(x>15)\n x = 15;\n newcolor += x.toString(16);\n }\n var ctx = this.gameboard.disp.getContext(\"2d\");\n ctx.beginPath();\n ctx.fillStyle = newcolor;\n ctx.fillRect(this.posx, this.posy, this.sizex, this.sizey);\n ctx.stroke();\n ctx.closePath();\n ctx = this.gameboard.disp.getContext(\"2d\");\n ctx.beginPath();\n ctx.fillStyle = this.color;\n ctx.fillRect(this.posx + this.sizex/10, this.posy + this.sizey/10,this.sizex/10*8,this.sizey/10*8);\n ctx.stroke();\n ctx.closePath();\n }\n }", "function drawRainbow(e) {\n let R;\n let G;\n let B;\n let rgbExtract = extractRGB(e);\n if (e.target.style.backgroundColor === \"\") {\n e.target.style.backgroundColor = `rgb(${Math.round(Math.random()*255)},${Math.round(Math.random()*255)},${Math.round(Math.random()*255)})`;\n } else {\n //darkens divs that have already have color\n R = rgbExtract[0];\n G = rgbExtract[1];\n B = rgbExtract[2];\n e.target.style.backgroundColor = `rgb(${R*.7},${G*.7},${B*.7})`\n }\n \n}", "function show(c, r, l) {\n var col = l.rgb();\n var str = '(' + col.r + ', ' + col.g + ', ' + col.b + ')';\n\n document.getElementById('xcoord').innerHTML = c[0];\n document.getElementById('ycoord').innerHTML = c[1];\n document.getElementById('radius').innerHTML = r;\n document.getElementById('current-color').innerHTML = l.hex();\n document.getElementById('rgb-color').innerHTML = str;\n}", "function colorgenerator() {\n let colours = [],\n i;\n for (i = 0; i < 372; i++){\n colours[i] = 'hsl(' + i + ', 100%, 50%)';\n if (i > 359) {\n colours[i] = 'hsl(0, 100%, 100%)';\n }\n }\n colours = colours.toString();\n //console.log(colours);\n root.style.setProperty(\"--colours\", colours);\n}", "function drawPattern() {\n var canvas = document.getElementById(\"demo2\");\n var context = canvas.getContext(\"2d\");\n context.strokeStyle = \"red\";\n \n var img = new Image();\n img.src = \"../images/bg-bike.png\";\n img.onload = function() {\n var pattern = context.createPattern(img, \"repeat\"); \n context.fillStyle = pattern; \n context.fillRect(10, 10, 100, 100); \n context.strokeRect(10, 10, 100, 100); \n }; \n}", "function changeColorFaded() {\n\n temp = 330;\n cont1 = 0;\n cont2 = 125;\n cont3 = 254;\n\n function cycler(cont) {\n if(cont >= 255) \n op = 'decr';\n else\n op = 'incr';\n\n switch(op) {\n case 'decr':\n cont--;\n break;\n case 'incr':\n cont++;\n break;\n }\n return cont;\n }\n\n var r = cycler(cont1);\n var g = cycler(cont2);\n var b = cycler(cont3);\n // Costruisco un colore RGB utilizzando i 3 numeri creati sopra \n \n colore_rgb = \"rgb(\" + r + \",\" + g + \", \" + b + \")\";\n \n // Applico il colore al tag span id->letterN\n letterN.style.color = colore_rgb;\n }", "function drawcolorcode() \n\t{\n\t// var canv = document.getElementById('colorcode');\n\t// var figure = canv.getContext('2d');\t\n\n\tleng=2\n\theig=7\n\tst=40\t\n\tik=14\n\tableng=st+leng\n\tvar cctext=''\n\tfor (var i=0;i<=100;i++)\n\t\t{\n\t\tcolor = dbandscore2color(dbs[0],i);\n\t\tbegx=leng*i+st\n\t\tbegy=3+heig*0\n\t\thei=heig-2\n\t\tcctext=cctext+'<rect x='+begx+' y='+begy+' width='+leng+' height='+heig+' style=\"fill:'+color+';stroke-width:0;stroke:rgb(100,100,100)\" />'\n\t\t}\n\t\n\tfont = \"10px Arial\";\n\ttextAlign=\"right\"; \t\n\ttextBaseline =\"top\";\n\tvar labels=''\n\tst2=st-3\n\tlabels=labels+'<text x='+st2+' y=\"9\" fill=\"black\" style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"end\" dominant-baseline=\"top\">pfam</text></a>';\n\tlabels=labels+'<text x='+260+' y=\"9\" fill=\"black\" style=\"font-family: Arial\" font-size=\"10\" text-anchor=\"start\" dominant-baseline=\"top\">HMMsearch</text></a>';\n\tlabels=labels+'<text x='+260+' y=\"24\" fill=\"black\" style=\"font-family: Arial\" font-size=\"10\" text-anchor=\"start\" dominant-baseline=\"bottom\">Probability</text></a>';\n\tlabels=labels+'<text x='+40+' y=\"24\" fill=\"black\" style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"middle\" dominant-baseline=\"bottom\">0%</text></a>';\n\tlabels=labels+'<text x='+90+' y=\"24\" fill=\"black\" style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"middle\" dominant-baseline=\"bottom\">25%</text></a>';\n\tlabels=labels+'<text x='+140+' y=\"24\" fill=\"black\" style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"middle\" dominant-baseline=\"bottom\">50%</text></a>';\n\tlabels=labels+'<text x='+190+' y=\"24\" fill=\"black\" style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"middle\" dominant-baseline=\"bottom\">75%</text></a>';\n\tlabels=labels+'<text x='+240+' y=\"24\" fill=\"black\" style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"middle\" dominant-baseline=\"bottom\">100%</text></a>';\n\t\n\tfor (var j=1;j<8;j++)\n\t\t{\n\t\t\n\t\tfor (var i=0;i<=100;i++)\n\t\t\t{\n\t\t\tcolor = dbandscore2color(dbs[j],i);\n\t\t\tx=st+leng*i\n\t\t\ty=ik+heig*j+5\n\t\t\tlabels=labels+'<rect x='+x+' y='+y+' width='+leng+' height='+heig+' style=\"fill:'+color+';stroke-width:0;stroke:rgb(100,100,100)\" />'\n\t\t\t}\n\tyt=ik+heig*j+6.5+5\n\tst2=st-3\n\tlabels=labels+'<text x='+st2+' y='+yt+' fill='+color+' style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"end\" dominant-baseline=\"top\">'+dbs[j]+'</text></a>';\n\t\t\n\t\t}\n\tlabels=labels+'<text x='+260+' y=\"45\" fill=\"black\" style=\"font-family: Arial\" font-size=\"10\" text-anchor=\"start\" dominant-baseline=\"top\">HHsearch</text></a>';\n\t//document.write(cctext)\t\n\t//document.write(labels)\n\tvar total = cctext + labels;\n\treturn total;\n\t\n\t}", "function colormatch(){\n\n\nreminder = Math.abs(change % (2*Math.PI));\n\nif (reminder > 0 && reminder < quarter) obcolor= (by-b > 0)? paint[1]: paint[3];\nelse if (reminder > quarter && reminder < quarter*2) obcolor= (by-b > 0)? paint[2]: paint[0];\nelse if (reminder > quarter*2 && reminder < quarter*3 ) obcolor= (by-b > 0)? paint[3]: paint[1];\nelse if (reminder > quarter*3 && reminder < quarter*4) obcolor= (by-b > 0)? paint[0]: paint[2];\n\nif (bcolor == obcolor) return 0;\nelse return 1;\n}", "function Graphic2()\n{\n console.log(\"\\x1b[40m\\x1b[5m \");\n console.log(\".Z$ZZZOO8Z?. .$ \");\n console.log(\" ++....7O+ ~Z . \");\n console.log(\" .++. Z?.. OODOI. 7 ZD$Z8 .OINO. .O. .$:.. .ZOI. ..Z++ZI .$8DO \");\n console.log(\" .+?. $O I$ .$? .$Z 8. ? Z. ..Z, Z8.. Z =.ZZ. ,Z 7 O: \");\n console.log(\" .I? $$ ZO .$ I.I= $I Z$ $I. $ZO. $ ..Z..?+. ZZ $: \");\n console.log(\"..88Z$$$+:+ $8 .=~?$ 7Z7+ Z$..:O7Z $O. $7 Z..Z:7. .ID8O7+ II .Z$OZ7IOO,. \");\n console.log(\" =Z. .. I, +7 ?7. $: ?= I.. = := I,. 8 ..$Z. .$ .?7. $ :7 I: . \");\n console.log(\" .=~ :. ~: ??7. .,,. 7+..I ,=~,I .. + : +7 ==.. +?=:$ I?~?7 \");\n console.log(\" .$O,:,:~, . . . . .=. ,:=. \");\n console.log(\" . \");\n console.log(\" ______ _______ __ _ _______ _______ _____ _______ \");\n console.log(\" | ____ |______ | \\\\ | |______ |______ | |______ \");\n console.log(\" |_____| |______ | \\\\_| |______ ______| __|__ ______| \");\n console.log(\" \\x1b[0m\\n\\n\");\n\n}", "function changeColorScheme() {\n\n}", "show() {\n\t\ttranslate(this.shift, 0);\n\t\t/* white keys */\n\t\tstroke(0);\n\t\tfill(255);\n\t\tvar whiteKeyWidth = this.whiteKeyWidth;\n\t\tvar whiteKeyLen = 249;\n\t\tfor(var i=0; i<56; i++) {\n\t\t\tif(this.active[i*2-this.blackLUT[i]+this.startOffset]) {\n\t\t\t\tfill(255, 0, 0);\n\t\t\t} else {\n\t\t\t\tfill(255);\n\t\t\t}\n\t\t\trect(i*whiteKeyWidth, 0, whiteKeyWidth, whiteKeyLen);\n\t\t}\n\t\t/* black keys */\n\t\tfill(0);\n\t\tvar blackKeyLen = this.blackKeyLen;\n\t\tvar blackKeyWidth = this.blackKeyWidth;\n\t\tfor(var i=0; i<56; i++) {\n\t\t\tif(i%7 != 3 && i%7 != 6) {\n\t\t\t\tif(this.active[(i+1)*2-1-this.blackLUT[i]+this.startOffset]) {\n\t\t\t\t\tfill(255, 0, 0);\n\t\t\t\t} else {\n\t\t\t\t\tfill(0);\n\t\t\t\t}\n\n\t\t\t\trect(i*whiteKeyWidth+whiteKeyWidth-blackKeyWidth/2, 0, blackKeyWidth, blackKeyLen);\n\t\t\t}\n\t\t}\n\t\tfill(0);\n\t}", "function generarNuevoColor(){\n\tvar simbolos, color;\n\tsimbolos = \"0123456789ABCDEF\";\n\tcolor = \"#\";\n\n\tfor(var i = 0; i < 6; i++){\n\t\tcolor = color + simbolos[Math.floor(Math.random() * 16)];\n\t}\n\n\tdocument.body.style.background = color;\n\tdocument.getElementById(\"hexadecimal\").innerHTML = color;\n\tdocument.getElementById(\"text\").innerHTML = \"Copiar Color\";\n}", "set dryColor(value) {}", "set color(c){\n this.currentColor = this.findPalRGB(c);\n }", "function wallColorizer() {\n return 'rgb(150,150,150)';\n}", "rainbow(_step, _totalSteps) {\n const step = toInt(_step);\n const totalSteps = toInt(_totalSteps);\n this.color(`hsl(${Math.ceil(step / totalSteps * 360)}, 100%, 50%)`);\n }", "function reColor() {\n\t//_ console.log('reColor()')\n\tfor (let index = 1; index <= nGavs; index++) { \n\t\tswitch (mESQ[index][0][1]) {\n\t\tcase 'A':\n\t\t\tcLinPR = cLinPRa \n\t\t\tcLinRX = cLinRXa\n\t\t\tcLinPN = cLinPNa\n\t\t\tpatPn\t =\tpatPna\n\t\t\tbreak;\n\t\tcase 'B':\n\t\t\tcLinPR = cLinPRb \n\t\t\tcLinRX = cLinRXb\n\t\t\tcLinPN = cLinPNb\n\t\t\tpatPn\t =\tpatPnb\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcLinPR = cLinPR0 \n\t\t\tcLinRX = cLinRX0\n\t\t\tcLinPN = cLinPN0\n\t\t\tpatPn\t =\tpatPn0\n\t\t\tbreak;\n\t\t}\n\t\tvar gIDtmp = 'G' + pad(index)\n\t\t//*\tCOLORIR RECHAÇO\n\t\ttry { drawSQMA.select('#' + 'linRx0_' + gIDtmp).attr({ stroke: cLinRX }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'linRx1_' + gIDtmp).attr({ stroke: cLinRX }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'arwRx_' + gIDtmp).attr({ fill : cLinRX }) } catch (error) {}\n\t\t//*\tCOLORIR PENEIRADO\n\t\ttry { drawSQMA.select('#' + 'linPn1_' + gIDtmp).attr({ stroke: cLinPN }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'linPn2_' + gIDtmp).attr({ stroke: cLinPN }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'linPr1_' + gIDtmp).attr({ stroke: cLinPN }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'linPr2_' + gIDtmp).attr({ stroke: cLinPN }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'arwPn1_' + gIDtmp).attr({ fill : cLinPN }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'arwPn2_' + gIDtmp).attr({ fill : cLinPN }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'PnD1_' \t + gIDtmp).attr({ fill : patPn }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'PnD2_' \t + gIDtmp).attr({ fill : patPn }) } catch (error) {}\n\t\t//*\tCOLORIR CPoints\n\t\ttry { drawSQMA.select('#' + 'CP_Rx_' + gIDtmp).attr({ fill: cLinRX }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'CP_Pn1_' + gIDtmp).attr({ fill: cLinPN }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'CP_Pn2_' + gIDtmp).attr({ fill: cLinPN }) } catch (error) {}\n\t}\n\n\trecolorBTM()\n}", "function colorForCurrent(){\n\n}", "function showBoard(theBoard) {\n\tprocess.stdout.write('\\033c');\n\tfor (var i = 0; i < theBoard._size[0]; i++) {\n\t\tif (i > 2 && i < 25) {\n\t\t\tconsole.log(\n\t\t\t\ttheBoard._data[i]\n\t\t\t\t\t.toString()\n\t\t\t\t\t.replace(/,/g, ' ')\n\t\t\t\t\t.replace(/0/g, ' ')\n\t\t\t\t\t.replace(/2\\s/g, '██')\n\t\t\t\t\t.replace(/1\\s?/g, '██')\n\t\t\t\t\t.replace(/3\\s/g, '\\x1b[33m██\\x1b[0m')\n\t\t\t\t\t.replace(/4\\s/g, '\\x1b[34m██\\x1b[0m')\n\t\t\t\t\t.replace(/5\\s/g, '\\x1b[35m██\\x1b[0m')\n\t\t\t\t\t.replace(/6\\s/g, '\\x1b[36m██\\x1b[0m')\n\t\t\t\t\t.replace(/7\\s/g, '\\x1b[32m██\\x1b[0m')\n\t\t\t\t\t.replace(/8\\s/g, '\\x1b[31m██\\x1b[0m')\n\t\t\t);\n\t\t}\n\t}\n}", "display() {\n\t\tvar alpha = 255;\n\t\tif (this.hover()) {\n\t\t\talpha = 150;\n\t\t} else {\n\t\t\talpha = 255;\n\t\t}\n\t\t// stroke(255);\n\t\t// for (var i = 1; i < interval - 1; i++) {\n\t\t// \tline(0,0, width, 0);\n\t\t// }\n\t\tnoStroke();\n\t\tfill(this.col, alpha);\n\t\tellipseMode(CENTER);\n\t\tellipse(this.x, this.y, this.size, this.size);\n\t\tfill(150, alpha);\n\t\trectMode(CENTER);\n\t\trect(this.x, this.y, this.size/4, this.size/4);\n\t}", "function printColors(game) {\n getColors(game).forEach((color, index) => {\n let block;\n switch (color) {\n case R:\n block = 'R';\n break;\n case G:\n block = 'G';\n break;\n case B:\n block = 'B';\n break;\n case _:\n block = '_';\n break;\n default:\n block = '?';\n break;\n }\n process.stdout.write(`${block} `);\n if (index % game.width === game.width - 1) {\n process.stdout.write('\\n');\n }\n });\n}", "function showCurrentPattern() {\n disableButtons();\n let showVal;\n if (currentCount < 10) {\n showVal = '0' + currentCount.toString();\n } else {\n showVal = currentCount.toString();\n }\n $(SEVEN_SEG_DISPLAY_ID).sevenSeg({ digits: 2, value: showVal });\n showMove();\n }", "function printSolidRectangle(r, c) {\n for (let i=0; i<r; i++) {\n let pattern = \"\";\n for (let j=0; j<c; j++) {\n if (i==0 || j==0 || i==r-1 || j==c-1) {\n pattern += \"*\";\n } else {\n pattern += \" \";\n }\n }\n console.log(pattern);\n }\n}", "function bg_color(in_time, in_seed) {\n return ((64 * cos(PI*(in_time + in_seed))) + 64 + 127);\n}", "function update_color() {\n refresh_color_display();\n\n // Iterate over each channel on the page\n for (var cs in COLORSPACES) {\n var colorspace = COLORSPACES[cs];\n var cs_name = colorspace.identifier;\n for (var i in colorspace.channels) {\n var channel = colorspace.channels[i];\n var id = cs_name + '-' + channel.identifier;\n\n // Update value and marker position\n update_slider(colorspace, channel);\n\n // Iterate over stops and update their colors, using assume()\n // to see what they *would* be if the slider were there. Note\n // that hue and lightness are special cases; hue runs through\n // the rainbow and needs several stops, whereas lightness runs\n // from black to a full color and then back to white, needing\n // an extra stop in the middle.\n var stop_ct = channel.stops;\n\n var $canvas = $('#' + id + ' canvas');\n var ctx = $canvas[0].getContext('2d');\n\n var grad = ctx.createLinearGradient(0, 0, 100, 0);\n var assumption = {};\n for (var i = 0; i < stop_ct; i++) {\n var offset = i / (stop_ct - 1);\n assumption[channel.identifier] = offset;\n grad.addColorStop(offset, current_color.assume(assumption).to_hex());\n }\n ctx.fillStyle = grad;\n ctx.fillRect(0, 0, 100, 100);\n }\n }\n}", "function redraw() {\n ctx.clearRect(0, 0, w, h);\n for(var i = 0;i<recordedPattern.length;i++) {\n var stroke_i = recordedPattern[i]\n\t\tctx.font = \"20px Arial\";\n\t\tctx.fillText(i.toString(), stroke_i[0][0]+20, stroke_i[0][1]+20);\n for(var j = 0; j<stroke_i.length-1;j++) {\n prevX = stroke_i[j][0];\n prevY = stroke_i[j][1];\n\n currX = stroke_i[j+1][0];\n currY = stroke_i[j+1][1];\n draw();\n }\n }\n }", "function onBeat() {\n\t\n\tvar colourArray = [color(84,172,71), \n\t\t\t\t\t\t color(19,48,40,110),\n\t\t\t\t\t\t color(113,94,133,150),\n\t\t\t\t\t\t color(214,31,52,150),\n\t\t\t\t\t\t color(233,93,37,110),\n\t\t\t\t\t\t color(149,86,54,150),\n\t\t\t\t\t\t color(68,72,158,110),\n\t\t\t\t\t\t color(107,38,111,150),\n\t\t\t\t\t\t color(157,71,70,150),\n\t\t\t\t\t \t\tcolor(237, 230,229,200),\n\t\t\t\t\t \t\tcolor(254,251,250, 200)\n\t\t\t\t\t\t ]\n\tvar randomizer = int(random(1,11));\n\tvar randomizer2 = int(random(1,11));\n\t\n\tgradientcolour1 = colourArray[randomizer];\n\tgradientcolour2 = colourArray[randomizer2];\n\n\t\n //backgroundColor = colourArray[randomizer];\n rectRotate = !rectRotate;\n}", "function chcolor(){if(v_chcolor == 1){ document.getElementById(\"sgb\").style.color=color[x];(x < color.length-1) ? x++ : x = 0;}}", "dibuja() {\n\n var color;\n if (this.estado == 1) {\n color = colorV;\n } else {\n color = colorM;\n }\n\n ctx.fillStyle = color;\n ctx.fillRect(this.x * tileX, this.y * tileY, tileX, tileY);\n }", "function createPattern() {\n // creating the checker pattern on the board\n for (k=0; k<8; k=k+2) {\n for (i=0; i<8; i=i+2) {\n board.rows[k].cells[i].style.background=\"white\";\n board.rows[k].cells[i+1].style.background=\"#e72e2e\";\n }// of first inner for\n\n for (i=0; i<8; i=i+2) {\n board.rows[k+1].cells[i+1].style.background=\"white\";\n board.rows[k+1].cells[i].style.background=\"#e72e2e\";\n\n }// of second inner loop\n }// of outer for\n}", "selectColor(x, y, wd, ht){\n this.colorSec = this.colorPromedio(x, y, wd, ht);\n if (this.colorG){\n let tempG = this.colorSec.reduce((a, b) => a+b);\n this.colorSec = this.colorSec.map(t => tempG/3);\n }\n this.ctx.fillStyle = 'rgb('+this.colorSec[0]+\n ','+ this.colorSec[1]+\n ','+ this.colorSec[2]+')';\n }", "function draw() {\n \n\tvar red = 0; // Color value defined\n\tvar green = 1;\n\tvar blue = 2;\n\tvar alpha = 3;\n\n\tvar iter = 81;\n\n\tif(os){ // if oscillation is set true by oscillate(), then do oscilation of \n\t\t\t\t\t\t\t\t\t\t// julia set by using sin(angle) to set real c and cos(angle) to set imaginary c.\n\t\tcx =0.7885*cos(angle);\n\t\tcy =0.7785*sin(angle);\n\t\tangle+= 0.04;\n\t}\n\n\tvar zy = 0.0;\n\tvar zx = 0.0;\n\n loadPixels(); \n\n\n // Interate through the window demision. 'width' and 'hieght' are the with and height of our window\n for (var y = 0; y < height; y++) {\n\n for (var x = 0; x < width; x++) {\n\n\t zy = map(y, 0, height, min_i , max_i); // use map() to scale the range so it will be from \n\t\tzx = map(x, 0, width, minReal, maxReal); // minReal to maxReal and min_i to max_i\n\t\t\n\t\tif(!os && !clicked){ // if neither of 'os' or 'clicked' is true, cy and cx (real and imaginary c) will be the scale of zy and zx.\n\t\t\tcy = zy;\n\t\t\tcx = zx;\n\t\t}\n\t\t\n var counter= 0;\n\n\t\t// calculate the mandelbrot / julia set using:\n\t\t// mandelbrot: f(z) = z^2 + c where c is changing\n\t\t// julia: f(z) = z^2 + c where c is constant\n\t\twhile ((zx * zx + (zy * zy) < 16.0) && counter < iter) {\n\n\t\t\tvar zx_temp = zx * zx - zy * zy +cx\n\n\t\t\tzy = 2.0 * zx * zy+cy;\n\t\t\tzx = zx_temp;\n\n\t\t\t++counter;\n\t\t}\n\t\t\n\t var color = 255;\n\n\t\tif(counter !=iter){\n\t\t\tcolor = counter;\n\t\t}\n\n var pix = (x + y * width) * 4;\n\n pixels[pix + red] = sin(color)%255; // set pixels\n pixels[pix + green] = color;\n pixels[pix + blue] = color;\n\n pixels[pix+alpha] = 255;\n }\n }\n\n updatePixels(); \n}", "show() {\n\t\tfill(255);\n ellipse(this.x, this.y, this.r*2)\n\t}", "function setup() {\n createCanvas(windowWidth, windowHeight); \n background(0); \n hue = 255; // intialisation à bleu\n colorMode(HSB,360,100,100,100) // appliquer le mode HSB\n}", "function fromOctClicked(){colorFrom(3); fromOct = true, fromBin =false, fromDec = false, fromHex = false;}", "show()\n {\n fill(this.brightness, 127);\n stroke(255);\n strokeWeight(2);\n\n ellipse(this.x, this.y, this.r*2);\n }", "function CReplaceColor() {\n this.mode = 0;\n this.app = null;\n this.pImages = null;\n}", "display(){\n noStroke();\n fill(this.color);\n this.shape(this.x, this.y, this.size, this.size);\n for(var i=0; i<this.history.length; i++){\n var pos = this.history[i];\n this.shape(pos.x, pos.y, 8, 8);\n }\n }", "printSolution( color ) {\n\n console.log(\"Solution Exists: Following are the assigned colors\");\n let str = \"\";\n for (let i = 0; i < this.v; i++) {\n str += color[i] + \" \";\n }\n console.log(str);\n }", "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 }", "function drawColourPackString() {\n ctx.clearRect(35, 410, 250, 63);\n ctx.drawImage(palette[0], 35, 410, 250, 63);\n\n }", "set ASTC_RGB_12x12(value) {}", "function getPattern(graphics, patt) {\r\n\r\n\tif (this.image3 == null) {\r\n\t\tthis.image3 = Images.newImage(graphics.getDevice(), 3, 3)\r\n\t}\r\n\tif (this.image4 == null) {\r\n\t\tthis.image4 = Images.newImage(graphics.getDevice(), 4, 4)\r\n\t}\r\n\r\n\t//println(\"brush type: \" +typeof(patt));\r\n\t\r\n\tvar img;\r\n\tif (patt != \"EDiamondCrossHatchBrush\" \r\n\t&& patt != \"EVerticalHatchBrush\" \r\n\t&& patt != \"EHorizontalHatchBrush\")\r\n\t\timg = this.image3\r\n\telse\r\n\t\timg = this.image4\r\n\t\t\r\n\tvar gc = new GC(graphics.getDevice(), img)\r\n\r\n\t//gc.setBackground(Colors.getColor(255, 255, 255))\r\n\tgc.setBackground(graphics.getBackground())\r\n\tgc.fillRectangle(0, 0, 4, 4);\r\n\tgc.setBackground(Colors.getColor(255, 255,255))\r\n\tgc.setForeground(Colors.getColor(0, 0, 0))\r\n\t\r\n\tswitch (patt) {\r\n\tcase \"EVerticalHatchBrush\":\r\n\t\tgc.drawLine(1, 0, 1, 3); \r\n\t\tgc.drawLine(3, 0, 3, 3); \r\n\t\tbreak;\r\n\tcase \"EForwardDiagonalHatchBrush\":\r\n\t\tgc.drawLine(0, 2, 2, 0); \r\n\t\tbreak;\r\n\tcase \"EHorizontalHatchBrush\":\r\n\t\tgc.drawLine(0, 1, 3, 1);\r\n\t\tgc.drawLine(0, 3, 3, 3);\r\n\t\tbreak;\r\n\tcase \"ERearwardDiagonalHatchBrush\":\r\n\t\tgc.drawLine(0, 0, 2, 2);\r\n\t\tbreak;\r\n\tcase \"ESquareCrossHatchBrush\":\r\n\t\tgc.drawLine(1, 0, 1, 3);\r\n\t\tgc.drawLine(0, 1, 3, 1);\r\n\t\tbreak;\r\n\tcase \"EDiamondCrossHatchBrush\":\r\n\t\tgc.drawLine(0, 0, 3, 3); \r\n\t\tgc.drawLine(2, 0, 0, 2);\r\n\t\tbreak;\r\n\tcase \"ESolidBrush\":\r\n\tdefault:\r\n\t\t// note: if all cases come here, it's because switch(string)\r\n\t\t// only makes sense with actual string types. \r\n\t\t// If this function is part of a prototype that's wrapped\r\n\t\t// into JS by UI Designer, then Rhino tends to coerce the arguments\r\n\t\t// to Object.\r\n\t\t\r\n\t\t//println(\"default brush type: \" +patt);\r\n\t\tgc.setBackground(Colors.getColor(0, 0, 0))\r\n\t\tgc.fillRectangle(0, 0, 5, 5); \r\n\t\tbreak;\r\n\t}\r\n\t\r\n\tgc.dispose()\r\n\t\r\n\ttry {\r\n\t\treturn new Pattern(graphics.getDevice(), img)\r\n\t} catch (e) {\r\n\t\t// not GDI+\r\n\t\treturn null;\r\n\t}\r\n}", "function colour() {\n //let c = Math.random();\n //console.log(c);\n //c = c.toString(16)\n //console.log(c)\n return '#' + Math.random().toString(16).substring(2,8); //substring (2,8) \n}", "addStep(color) {\n this.count = this.pattern.push(color)\n $(\".count\").html(this.count).css(\"color\", \"white\");\n }", "function paintBoard() {\n\t\t\tvar wts = BOARD_LENGTH - SPACE_MUL_TWO, hts = BOARD_LENGTH - SPACE_MUL_TWO,\n\t\t\t\ti,\n\t\t\t\tss, hs, ws, baseCode, s3, code, t1;\n\t\t\t// Draw color and lines of the board\n\t\t\tbgContext.beginPath();\n\t\t\tbgContext.fillStyle = \"#D6B66F\";\n\t\t\tbgContext.fillRect(0, 0, BOARD_LENGTH, BOARD_LENGTH);\n\t\t\tfor (i = 1; i < LINE_NUM_ADD_ONE; i += 1) {\n\t\t\t\tbgContext.moveTo(SPACE_MUL_TWO, SPACE * (i + 1));\n\t\t\t\tbgContext.lineTo(wts, SPACE * (i + 1));\n\t\t\t\tbgContext.moveTo(SPACE * (i + 1), SPACE_MUL_TWO);\n\t\t\t\tbgContext.lineTo(SPACE * (i + 1), hts);\n\t\t\t}\n\t\t\tbgContext.stroke();\n\t\t\tbgContext.closePath();\n\n\t\t\t// Draw string of the board \n\t\t\tbgContext.beginPath();\n\t\t\tbgContext.fillStyle = \"black\";\n\t\t\tbgContext.font = \"bold 12px sans-serif\";\n\t\t\tbgContext.textBaseline = \"bottom\";\n\t\t\tss = SPACE + (SPACE * 0.25);\n\t\t\ths = BOARD_LENGTH - (SPACE * 0.5);\n\t\t\tws = BOARD_LENGTH - SPACE;\n\t\t\ts3 = SPACE / 8;\n\t\t\tbaseCode = \"A\".charCodeAt(0);\n\t\t\tfor (i = 1; i < LINE_NUM_ADD_ONE; i += 1) {\n\t\t\t\tcode = baseCode + i - 1;\n\n\t\t\t\tbgContext.fillText(String.fromCharCode(code), SPACE * (i + 0.75), ss);\n\t\t\t\tbgContext.fillText(String.fromCharCode(code), SPACE * (i + 0.75), hs);\n\n\t\t\t\tt1 = SPACE * (i + 1.25);\n\t\t\t\tif (i < 11) {\n\t\t\t\t\tbgContext.fillText(String(20 - i), s3, t1);\n\t\t\t\t\tbgContext.fillText(String(20 - i), ws, t1);\n\t\t\t\t} else {\n\t\t\t\t\tbgContext.fillText(String(20 - i), SPACE_DIVIDE_TWO, t1);\n\t\t\t\t\tbgContext.fillText(String(20 - i), ws, t1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbgContext.closePath();\n\n\t\t}", "function showColors() {\n for (let i = 0; i < colorCalc().length; i++) {\n const rgbValue = hslToRGB(colorCalc()[i]);\n const hexValue = rgbToHex(rgbValue);\n document.getElementsByClassName(\"colorvisual\")[\n i\n ].style.backgroundColor = hexValue;\n }\n}", "function colorFrom(num){\n\tswitch(num){\n\t\tcase 1:\n\t\t\tdocument.getElementById('fromBin').style.backgroundColor = \"#E6E4EB\"; document.getElementById('fromBin').style.color = \"#010101\";\n\t\t\tdocument.getElementById('fromDec').style.backgroundColor = \"#515151\"; document.getElementById('fromDec').style.color = \"#FFFFFF\";\n\t\t\tdocument.getElementById('fromOct').style.backgroundColor = \"#515151\"; document.getElementById('fromOct').style.color = \"#FFFFFF\";\n\t\t\tdocument.getElementById('fromHex').style.backgroundColor = \"#515151\"; document.getElementById('fromHex').style.color = \"#FFFFFF\"; break;\n\t\tcase 2:\n\t\t\tdocument.getElementById('fromBin').style.backgroundColor = \"#515151\"; document.getElementById('fromBin').style.color = \"#FFFFFF\";\n\t\t\tdocument.getElementById('fromDec').style.backgroundColor = \"#E6E4EB\"; document.getElementById('fromDec').style.color = \"#010101\";\n\t\t\tdocument.getElementById('fromOct').style.backgroundColor = \"#515151\"; document.getElementById('fromOct').style.color = \"#FFFFFF\";\n\t\t\tdocument.getElementById('fromHex').style.backgroundColor = \"#515151\"; document.getElementById('fromHex').style.color = \"#FFFFFF\"; break;\n\t\tcase 3:\n\t\t\tdocument.getElementById('fromBin').style.backgroundColor = \"#515151\"; document.getElementById('fromBin').style.color = \"#FFFFFF\";\n\t\t\tdocument.getElementById('fromDec').style.backgroundColor = \"#515151\"; document.getElementById('fromDec').style.color = \"#FFFFFF\";\n\t\t\tdocument.getElementById('fromOct').style.backgroundColor = \"#E6E4EB\"; document.getElementById('fromOct').style.color = \"#010101\";\n\t\t\tdocument.getElementById('fromHex').style.backgroundColor = \"#515151\"; document.getElementById('fromHex').style.color = \"#FFFFFF\"; break;\n\t\tcase 4:\n\t\t\tdocument.getElementById('fromBin').style.backgroundColor = \"#515151\"; document.getElementById('fromBin').style.color = \"#FFFFFF\";\n\t\t\tdocument.getElementById('fromDec').style.backgroundColor = \"#515151\"; document.getElementById('fromDec').style.color = \"#FFFFFF\";\n\t\t\tdocument.getElementById('fromOct').style.backgroundColor = \"#515151\"; document.getElementById('fromOct').style.color = \"#FFFFFF\";\n\t\t\tdocument.getElementById('fromHex').style.backgroundColor = \"#E6E4EB\"; document.getElementById('fromHex').style.color = \"#010101\"; break;\n\t}\n\t\n}", "function ps4Color (){\n \n\tcounter += 1;\n\tdocument.getElementById('model__ps4Base').getAttribute('color');\n\tswitch (counter) {\n\t\tcase 1:\n\t\tdocument.getElementById('model__ps4Base').setAttribute('color', '0.4627 0.4627 0.4627 0 0 0 0 0.06275 0.9059 0.588 0.588 0.588 0.588 0.588 0.588 0.588 0.588 0.588 0.7137 0.7137 0.7137');\n\t\t\t\n\t\t\tbreak;\n\t\tcase 2:\n\t\tdocument.getElementById('model__ps4Base').setAttribute('color', '0.2549 -0.5529 -0.5529 0 0 0 0 0.06275 0.9059 0.588 0.588 0.588 0.588 0.588 0.588 0.588 0.588 0.588 0.7137 0.7137 0.7137');\n\t\t\tbreak;\n\t\tcase 3:\n\t\tdocument.getElementById('model__ps4Base').setAttribute('color', '0.1216 0.3451 0.851 0 0 0 0 0.06275 0.9059 0.588 0.588 0.588 0.588 0.588 0.588 0.588 0.588 0.588 0.7137 0.7137 0.7137');\n\t\t\tbreak;\n\t\t\tcase 4:\n\t\tdocument.getElementById('model__ps4Base').setAttribute('color', '0.2549 0.2549 0.2549 0 0.2549 0.2549 0.2549 0.9059 0.588 0.588 0.588 0.588 0.588 0.588 0.588 0.588 0.588 0.7137 0.7137 0.7137');\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tcounter = 0;\n\t\t\tdocument.getElementById('model__ps4Base').setAttribute('color', '0.01569 0.01569 0.01569 0 0 0 0 0.06275 0.9059 0.588 0.588 0.588 0.588 0.588 0.588 0.588 0.588 0.588 0.7137 0.7137 0.7137 0.588 0.588 0.588 0.588 0.588 0.588 0.588 0.588 0.588 0.8392 0.8392 0.8392');\n\t\t\tbreak;\n\t}\n\t\t\t\n\n}", "function color(point) {\n\tvar temp = point;\n // console.log(\"temp \" + temp);\n\n\t// Calculate Red:\n\tif (temp <= 66) {\n\t\tvar red = 255\n\t}\n\telse {\n\t\tvar red = Math.floor(330 * (Math.pow(temp, -0.133)));\n\t\tif (red < 0) {red = 0};\n\t\tif (red > 255) {red = 255};\n\n var dimRed = Math.floor((330 * (Math.pow(temp, -0.133))) - (-100 * Math.cos(temp/1000) + 100));\n if (dimRed < 0) {dimRed = 0};\n\t\tif (dimRed > 255) {dimRed = 255};\n if (temp > 2000) {dimRed = 0};\n // console.log(\"dimRed \" + dimRed + \"; red \" + red);\n\t}\n\n\t// Calculate Green:\n\tif (temp <= 66) {\n\t\tvar green = temp;\n\t\tgreen = 99.5 * Math.log(green) - 161;\n\t\tgreen = Math.floor(green);\n\t\tif (green < 0) { green = 0};\n\t\tif (green > 255) { green = 255};\n\t}\n\telse {\n var green = Math.floor((288 * (Math.pow(temp, -0.075))));\n\t\tif (green < 0) { green = 0};\n\t\tif (green > 255) { green = 255};\n\n var dimGreen = Math.floor((288 * (Math.pow(temp, -0.075))) - (-100 * Math.cos(temp/1000) + 100));\n if (dimGreen < 0) { dimGreen = 0};\n\t\tif (dimGreen > 255) { dimGreen = 255};\n if (temp > 2000) {dimGreen = 0};\n // console.log(\"dimGreen \" + dimGreen + \"; green \" + green);\n\t}\n\n // Calculate Blue:\n\tif (temp <= 19) {\n\t\tvar blue = 0;\n\t}\n\telse {\n\t\tvar blue = Math.floor(138.5 * Math.log(temp) - 305);\n\t\tif (blue < 0) {blue = 0};\n\t\tif (blue > 255) {blue = 255};\n\n var dimBlue = Math.floor((139 * Math.log(temp)) - (-500 * Math.cos(temp/1000) + 800));\n if (dimBlue < 0) {dimBlue = 0};\n\t\tif (dimBlue > 255) {dimBlue = 255};\n if (temp > 2200) {dimBlue = 0};\n // console.log(\"dimBlue \" + dimBlue + \"; blue \" + blue);\n\t}\n\nvar colorTemp = \"rgb(\" + dimRed + \",\" + dimGreen + \",\" + dimBlue + \")\";\n// console.log(\"temp \" + temp + \"; colorTemp \" + colorTemp);\nreturn colorTemp;\n}", "function colorSketchPad() {\n //clear the previous sketch\n clearPad();\n\n //create the drawing surface based on what the user wants\n createPad(promptBlocks());\n\n //Add the ability to draw!\n drawBlocks(\"2\");\n}", "function displayTime() {\n\td = new Date();\n\th = d.getHours();\n\tm = d.getMinutes();\n\ts = d.getSeconds();\n\t\n//add zero to the left of the numbers if they are single digits\nif(h <= 9) {\n\th = '0'+h;\n}\n\nif(m <= 9) {\n\tm = '0'+m;\n}\n\nif(s <= 9) {\n\ts = '0'+s;\n}\n\nclock = h+\":\"+m+\":\"+s;\n\ndocument.getElementById(\"clkcolor\").innerHTML = clock;\n\n//hand picked colors in an array called 'colors'\nvar colors = [\"#221752\",\"#c0c0c0\",\"#587b2e\",\"#000000\",\"#464646\",\"#99081E\"];\n//created a variable for choosing a random color from the length of the 'colors' array\n//and named it 'bodyColor'\nvar bodyColor = Math.floor(Math.random() * colors.length);\n\n\nvar selectedcolor = colors[bodyColor];\n\ndocument.body.style.background = selectedcolor;\n}", "function change_background(){\r\n\r\n for(x=0;x<6;x++){\r\n generated = hexa[color_generator()];\r\n color += generated;\r\n\r\n };\r\n body.style.backgroundColor = color;\r\n span.innerText = color;\r\n color = \"#\"; // reinitialize the value of color to '#'\r\n \r\n\r\n \r\n\r\n \r\n}", "function PatternView() {\n\t\n\t//Current means which thing is selected\n\tthis.octave = 3;\n\tthis.channels = 4;\n\tthis.step = 1;\n\tthis.rows = 64;\n\tthis.maxChannel = this.channels - 1;\n\tthis.maxRow = this.rows - 1;\n\tthis.currentRow = 0;\n\tthis.currentChannel = 0;\n\tthis.currentGroup = 0;\t\t\t//which of the 5 groups is selected\n\t\t\t\t\t\t\t\t\t//\t\tnote, isntrument, volume, effect, parameter\n\tthis.currentCol = 0;\t\t\t//Which of the columns is selected\n\t\t\t\t\t\t\t\t\t//0: note, 1-2: instrument, 3-4: vol 5: effect 6-7: param\n\tthis.selected = \"note\";\t\t\t//What kind of thing is highlighted. Mostly for CSS purposes\n\tthis.selectedEl = null;\t\t\t//an element reference for easy manipulation\n\tthis.mode = \"view\";\t\t\t\t//\"view\" or \"edit\"\n\n}", "function onload() {\n // Create pattern\n pattern = context.createPattern(img, repeat);\n self.setSilent('pattern', pattern); // be a cache\n\n self.setSilent('patternSource', color);\n }", "function onload() {\n // Create pattern\n pattern = context.createPattern(img, repeat);\n self.setSilent('pattern', pattern); // be a cache\n\n self.setSilent('patternSource', color);\n }", "function onload() {\n // Create pattern\n pattern = context.createPattern(img, repeat);\n self.setSilent('pattern', pattern); // be a cache\n\n self.setSilent('patternSource', color);\n }", "function onload() {\n // Create pattern\n pattern = context.createPattern(img, repeat);\n self.setSilent('pattern', pattern); // be a cache\n\n self.setSilent('patternSource', color);\n }", "function startPrintingToScreen()\n {\n var col = pickColor().hex;\n\n for(var i=0; i <= col.length; i++)\n {\n var letter = i >= col.length ? \";\" : col[i]; //last char printed should be ';'\n printDigit(letter, 200 * i, col);\n } \n }", "function setColor() {\n var r_hex = parseInt(r.value, 10).toString(16);\n var g_hex = parseInt(g.value, 10).toString(16);\n var b_hex = parseInt(b.value, 10).toString(16);\n\n\n //updates the sliders output colors\n r_out.style.backgroundColor=\"#\"+r_hex+\"0000\";\n r_out.value=r.value;\n g_out.style.backgroundColor=\"#00\"+g_hex+\"00\";\n g_out.value=g.value;\n b_out.style.backgroundColor=\"#0000\"+b_hex;\n b_out.value=b.value;\n\n hex = \"#\" + pad(r_hex) + pad(g_hex) + pad(b_hex);\n strokeOut.style.backgroundColor=hex;\n}", "function draw() {\n // put drawing code here\n //you need a background here....\nnoStroke()\nbackground(0,0,102)\n\n// var nightColor2 = [0,0,102]\n// var nightcolor1 = [0,0,153]\n\n// var dayColor2 = [153,204,255]\n// var daycolor1 = [102,205,255]\n\n// from = color(nightColor2, nightcolor1)\n// to = color(dayColor2, daycolor1)\n// lerpColor(from, to)\n\n// want to try to change color background.... \n \n // Time \n fill('black')\n //the time\n textSize(32);\n var theTime = amPm(hour()) + \":\" + minute() + \":\" + niceSecond(second());\n text(theTime,100,height/20)\n\n//the moon\nif ( hour() < 13 ) { \n fill(255, 255, 102)\n } else { \n fill(255, 255, 204)\n } \n ellipse(50, height/20, 60,60)\n \n\nfill('yellow')\nfor(var i=0; i < second()+240; i++) { \n ellipse(secXpos[i] + second(), secYpos[i] + second(), 5,5)\n }\n\n\nfill('white')\n push();\n translate(p5.Vector.fromAngle(millis() / 1000, 10))\n for(var j=0; j < minute()+ 120; j++) { \n // push();\n // translate(width / 120, height / 100) \n // translate(p5.Vector.fromAngle(millis() / 1000, 10))\n ellipse(minXpos[j] + minute(), minYpos[j] + minute(), 9,9) \n }\npop();\n\nfill('orange')\n for(var k=0; k < hour()+ 60; k++) { \n ellipse(hourXpos[k], hourYpos[k], 10,10)\n }\nif (second()/5 == lineTime.length) {\n var ranX = Math.floor(random(60))\n lineTime.push(second())\n lineX.push(hourXpos[ranX])\n lineY.push(hourYpos[ranX])\n}\nstroke(255)\nif (lineX.length > 1) {\n for(var i = 1; i < lineX.length; i++) {\n line(lineX[i-1], lineY[i-1], lineX[i], lineY[i])\n }\n }\n if (second() == 59) {\n lineTime = [];\n lineX = [];\n lineY = [];\n }\n}", "function setup() {\r\n createCanvas(windowWidth, windowHeight);\r\n colorMode(HSB, 360, 100, 100, 100);\r\n noStroke();\r\n}", "function onload() {\n // Create pattern\n var context = self.get('context');\n pattern = context.createPattern(img, repeat);\n self.setSilent('pattern', pattern); // be a cache\n self.setSilent('patternSource', color);\n }", "step() {\n this.currentColor += (this.redComponentRatio * (this.redDiff / this.steps)) & RED;\n this.currentColor += (this.greenComponentRatio * (this.greenDiff / this.steps)) & GREEN;\n this.currentColor += (this.blueComponentRatio * (this.blueDiff / this.steps)) & BLUE;\n return Math.floor(this.currentColor);\n }", "function updateDisplay(launchpad) {\n for (var x = 0; x < 9; x++) {\n for (var y = 0; y < 9; y++) {\n if (x == 8 && y == 0) continue;\n var color = launchpad.buffers[launchpad.visibleBuffer][x][y] || launchpad.colors[0][0];\n var shape = document.getElementById(\"key\" + x + y);\n // Do not apply brightness correction to non-lit pads and buttons\n shape.style.opacity = (color == launchpad.colors[0][0]) ? 1 : launchpad.brightness;\n shape.style.fill = color;\n }\n }\n}", "function setRGBDisplay() {\r\n redDisplay.textContent = redCorrect;\r\n greenDisplay.textContent = greenCorrect;\r\n blueDisplay.textContent = blueCorrect;\r\n}", "function repeat(){\n color = generateRandomColors(numSquares);\n pick = pickedColor();\n //change display color to picked color\n displayColor.textContent = pick;\n for(var i = 0 ; i < square.length ; i++)\n {\n if(color[i])\n {\n square[i].style.display = \"block\";\n square[i].style.backgroundColor = color[i];\n }\n else{\n square[i].style.display = \"none\";\n }\n \n }\n \n h1.style.backgroundColor = \"steelblue\";\n newColors.textContent = \"New Colors\";\n displayFeedback.textContent = \"\";\n\n\n\n}", "function predictPattern() {\n let dataForPrediction = inputGridToMatrix();\n let prediction = NETWORK.predict(dataForPrediction);\n\n $(\"#outputGrid > div\").each(function(index, item) {\n $(item).css(\"background-color\", prediction.data[0][index] == 1 ? \"white\" : \"black\");\n });\n}", "bg_gfx1() {\n let nta = ((this.clock.hpos >>> 3) & 0x1F) | ((this.clock.vpos << 2) & 0x3E0) | (this.io.bg_name_table_address << 10);\n let pattern = this.VRAM[nta];\n\n let paddr = (this.clock.vpos & 7) | (pattern << 3) | (this.io.bg_pattern_table_address << 11);\n\n let caddr = ((paddr >>> 3) & 0x1F) | (this.io.bg_color_table_address << 6);\n\n let color = this.VRAM[caddr];\n let index = this.clock.hpos ^ 7;\n if ((this.VRAM[paddr] & (1 << index)) === 0)\n this.bg_color = color & 0x0F;\n else\n this.bg_color = (color >>> 4) & 0x0F;\n }", "generatePattern (size) {\n return Array.from({length: size}, (v, i) => (\n Array.from({length: size}, (v, i) => this.randomPixel()).join('')\n ))\n }", "function getColor(land) {\n while (true) {\n var r = Math.floor(Math.random() * 256) + 1\n var g = Math.floor(Math.random() * 256) + 1\n var b = Math.floor(Math.random() * 256) + 1\n hsp = Math.sqrt(\n 0.299 * (r * r) +\n 0.587 * (g * g) +\n 0.114 * (b * b)\n );\n //light color\n if (hsp > 127.5 && land == false) {\n return r + \",\" + g + \",\" + b;\n }\n //dark color\n else if (hsp < 127.5 && land == true) {\n\n return r + \",\" + g + \",\" + b;\n }\n }\n }", "function color(n) {\r\n // rgb\r\n return `hsl(${n * quickcol * 360},100%,50%)`;\r\n // default\r\n return `hsl(${n * quickcol * 360},${20+n*quickcol*50}%,${n * quickcol * 100}%)`;\r\n // gray-scaled\r\n return `hsl(0, 0%, ${100 - n * quickcol * 100}%)`;\r\n}", "function color() {\n\tvar alpha = 0,\n\t\t s = 1,\n\t\t v = 1,\n\t\t c, h, x, r1, g1, b1, m,\n\t\t red, blue, green;\n\thue %= 360;\n\th = hue / 60;\n\tif (hue < 0) {\n\t hue += 360;\n\t}\n\tc = v * s;\n\th = hue / 60;\n\tx = c * (1 - Math.abs(h % 2 - 1));\n\tm = v - c;\n\tswitch (Math.floor(h)) {\n\t\tcase 0: r1 = c; g1 = x; b1 = 0; break;\n\t\tcase 1: r1 = x; g1 = c; b1 = 0; break;\n\t\tcase 2: r1 = 0; g1 = c; b1 = x; break;\n\t\t/*case 3: r1 = 0; g1 = x; b1 = c; break;\n\t\tcase 4: r1 = x; g1 = 0; b1 = c; break;\n\t\tcase 5: r1 = c; g1 = 0; b1 = x; break;*/\n\t}\n\tred = Math.floor((r1 + m) * 255);\n\tgreen = Math.floor((g1 + m) * 255);\n\tblue = Math.floor((b1 + m) * 255);\n\n // $(\".flashing-banner\").css('backgroundColor', 'rgba(' + red + ',' + green + ',' + blue + ',' + 1 + ')'); // commented on 21.10.17\n hue++;\n}", "function printColors() {\n\treturn \"<div class=\\\"column\\\">\" + mutateColor(hex, 255, 0, 0, 0, 1, true) + mutateColor(hex, 0, 255, 0, 0, 1, true) + mutateColor(hex, 0, 0, 255, 0, 1, true) + mutateColor(hex, 255, 255, 0, 0, 1, true) + mutateColor(hex, 0, 255, 255, 0, 1, true) + mutateColor(hex, 255, 0, 255, 0, 1, true) + mutateColor(hex, 255, 255, 255, 0, 1, true) + \"</div>\" +\n\t\t\t\"<div class=\\\"column\\\">\" + mutateColor(hex, 128, -32, 0, 0, 1, false) + mutateColor(hex, 0, 128, -32, 0, 1, false) + mutateColor(hex, -32, 0, 128, 0, 1, false) + mutateColor(hex, 128, 128, 0, 0, 1, false) + mutateColor(hex, 0, 128, 128, 0, 1, false) + mutateColor(hex, 128, 0, 128, 0, 1, false) + mutateColor(hex, 128, 128, 128, 0, 1, false) + \"</div>\" +\n\t\t\t\"<div class=\\\"column\\\">\" + mutateColor(hex, 32, 0, 0, 0, 7, false) + \"</div>\" +\n\t\t\t\"<div class=\\\"column\\\">\" + mutateColor(hex, 0, 32, 0, 0, 7, false) + \"</div>\" +\n\t\t\t\"<div class=\\\"column\\\">\" + mutateColor(hex, 0, 0, 32, 0, 7, false) + \"</div>\";\n}" ]
[ "0.693385", "0.6793875", "0.67468446", "0.6554551", "0.6440635", "0.6407863", "0.63974303", "0.63740563", "0.636017", "0.63284665", "0.63004667", "0.62996966", "0.6280428", "0.62638503", "0.6257317", "0.6242988", "0.6210111", "0.6164323", "0.6159133", "0.6138771", "0.6089295", "0.6086212", "0.60665756", "0.6065302", "0.6030185", "0.60301423", "0.6022651", "0.59924185", "0.5991359", "0.5990156", "0.59845823", "0.59647816", "0.5962747", "0.5956781", "0.59533465", "0.5949598", "0.5947574", "0.5938456", "0.5934708", "0.5917108", "0.5912042", "0.5911965", "0.591009", "0.58893394", "0.5882677", "0.58753353", "0.5873759", "0.58624", "0.58551013", "0.58543134", "0.58501154", "0.58387977", "0.58376944", "0.583694", "0.58348256", "0.58345854", "0.5828916", "0.58272874", "0.5826233", "0.582583", "0.58170176", "0.58135647", "0.58100396", "0.58071357", "0.57988507", "0.57790095", "0.5776791", "0.57723767", "0.5767141", "0.57668316", "0.5766825", "0.5761061", "0.57564276", "0.5753752", "0.5751056", "0.57467836", "0.5732181", "0.5730502", "0.57274556", "0.57118934", "0.5709277", "0.5709277", "0.5709277", "0.5709277", "0.57086545", "0.57082283", "0.5704243", "0.57022387", "0.5701591", "0.5701161", "0.57003987", "0.5698919", "0.56981725", "0.56956", "0.56944776", "0.56864595", "0.5681533", "0.56794524", "0.56790483", "0.56730765" ]
0.6547947
4
Select User Test Function
function test(){ let newSpace = userPattern.length - 1; if(userPattern.length === compPattern.length && userPattern[newSpace] == compPattern[newSpace]){ userPattern = []; setTimeout(playback,500); } else if(userPattern[newSpace] == compPattern[newSpace]){ return; } else { loser(); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectUser ( user ) {\n self.selected = angular.isNumber(user) ? $scope.users[user] : user;\n }", "function selectUser() {\n var userSel = document.getElementById(\"user-sel\");\n if (userSel.value == \"null\") {\n searchMemberKey = null;\n } else {\n searchMemberKey = userSel.value\n }\n\n checkGroupsSidebar(true);\n getAllGroups();\n}", "function selectUser(e, ui) {\n\tvar id = ui.item.id,\n\tname = ui.item.value;\n\tif (id) {\n\t\tsearchUsers(id, name);\n\t}\n}", "selectUserDialog() {\n actions.showDialog({name: 'users'});\n }", "function selectUser ( user ) {\n self.selected = angular.isNumber(user) ? $scope.users[user] : user;\n self.toggleList();\n self.loadDataFromFirebase();\n // console.log(self.selected);\n }", "function userSelection() {\n writeLog(\"Selection: \" + userChoice);\n writeLog(\"Search Item: \" + searchItem);\n switch (userChoice) {\n case \"help\":\n console.log(\"The following options are valid:\");\n console.log(\"-----------------------------------------------------------------------\");\n console.log(\"'node liri concert-this <artist>' --> search bandsintown for the artist\");\n console.log(\"'node liri spotify-this-song <song>' --> search spotify for the song\");\n console.log(\"'node liri movie-this <movie>' --> search omdb for the movie\");\n console.log(\"'node liri do-what-it-says' --> read commands from the random.txt file and execute\");\n break;\n case \"concert-this\":\n doConcertThis(searchItem);\n break;\n case \"spotify-this-song\":\n doSpotifyThisSong(searchItem);\n break;\n case \"movie-this\":\n doMovieThis(searchItem);\n break;\n case \"do-what-it-says\":\n doWhatItSays(searchItem);\n break;\n default:\n writeLog(\"You gave me '\" + userChoice + \"' which is not a valid option. Enter 'node liri help' to display valid options.\");\n }\n}", "function getUserChoice() {\n const selectId = \"select\";\n const userWatching = \"userWatching\";\n const userLeft = \"userLeft\";\n\n let selectObj = document.getElementById(selectId);\n document.getElementById(\"log\").innerText = \"\";\n if (selectObj.value == userWatching) {\n promise(true, false);\n }\n if (selectObj.value == userLeft) {\n promise(false, true);\n }\n}", "function selectUsersWithSets() {\n\t\tvar user = jQuery(\"#selectUser\").val();\n\t\tshowSetsByUser(user);\n\t}", "function selectUser(user) {\n\t vm.currentUser = user;\n\t\t}", "function purposeUser() {\n\n // Displaying the patients.\n var p = displayPatients();\n\n // Asking the user to select the patient to change the appointment.\n r.question(\"Hello User! Choose a patient ID to set/change his/her appointment! \", (ans1) => {\n if (!isNaN(ans1.trim()) && ans1.trim() < p) {\n\n // Calling chooseDoctor() function to choose the doctor for appointment.\n chooseDoctor(Number(ans1.trim()));\n } else {\n\n // If the ID is invalid, trying again.\n console.log(\"INVALID! Choose a patient by ID only! Try again.\");\n purposeUser();\n }\n });\n}", "function selectUser(index) {\n vm.user = vm.users[index];\n }", "function chooseUser(name) {\n\tconsole.log(\"chooseUser(): \" + name);\n\t\n\t// clear selection\n\tfor (key in participants) {\n\t\tif (participants[key].selected === true) {\n\t\t\tparticipants[key].setSelected(false);\n\t\t}\t\t\n\t}\n\t// set user with name selected\n\tparticipants[name].setSelected(true);\n\n\tnextVideo.setUserName(name);\n}", "function getSelectedUser() {\n return document.getElementById('userDropDown').value\n}", "function selectUser(event) {\n var editBtn = $(event.target);\n editIndex = editBtn.attr(\"id\").split('-')[1];\n selectedUserId = users[editIndex]._id;\n try {\n userService.findUserById(selectedUserId)\n .then(function (userInfo) {\n console.log(\"userInfo from findUserById\", userInfo);\n $usernameFld.val(userInfo.username);\n $passwordFld.val(userInfo.password);\n $firstNameFld.val(userInfo.firstName);\n $lastNameFld.val(userInfo.lastName);\n $roleFld.val(userInfo.role);\n selectedUser = userInfo;\n });\n }\n catch (err) {\n console.log(err.name + \": \" + err.message);\n }\n }", "function selectUser(user) {\n $rootScope.$emit(\"changeUser\", user);\n }", "function userPick(evt) {\r\n userChoice = this.id;\r\n console.log(userChoice);\r\n playGame();\r\n}", "function testByUser (res, req, username, assign, nextTest) {\n if (sessionUser) {\n return testAndMoveOn(\n res, sessionUser.username, username, assign, nextTest) \n } else {\n if (nextTest) return nextTest()\n else\n return testAndMoveOn(res, true, false, assign, null) \n }\n }", "function rolesTest(toSelect) {\n cy.get('[name=\"role\"]').select(toSelect)\n }", "function user()\n {\n\n }", "static async selectUser(usersEmail) {\n const selectedUser = await page.$x(`//li[@id=\"${usersEmail}\"]`);\n\n if (selectedUser.length > 0) {\n try {\n const waitForNavigation = page.waitForNavigation();\n await selectedUser[0].click();\n await waitForNavigation;\n } catch (error) {\n console.error(`Error clicking link for user with the ID '${usersEmail}'`, error);\n fail(`Error clicking link for user with the ID '${usersEmail}'`);\n }\n } else {\n throw new Error(`Link not found for user with the ID '${usersEmail}'`);\n }\n }", "async function nowusers()\n{\n var users = await Viewers.SelectUser()\n return users\n}", "function runAutomatedTestsIfAppropriate()\n{\n var msg = {cmd: \"getUserId\", callback: \"pcaAssessUserIdForTesting\",\n status: \"request\", payload: \"\"};\n\n hub.send(JSON.stringify(msg));\n\n} // runAutomatedTestsIfAppropriate", "function selectUserFromCollaboratorList(email) {\n var parentUl = $('#panel-collaborators').children('ul');\n var users = parentUl.children('li');\n var user = users.get(0);\n\n // Set user to select..\n for(var i = 0; i < users.length; i++) {\n user = users.get(i);\n if(user.id == email) {\n user.setAttribute(\"style\", \"background-color: #c3c3c3; cursor: pointer;\");\n selectedCollaboratorIndex = i;\n selectedCollaboratorEmail = email;\n }\n else {\n user.setAttribute(\"style\", \"cursor: pointer;\");\n }\n }\n}", "function useDummy() {\n //put dummy user to be loaded in here.\n }", "function command(userSelect) {\n switch (userSelect) {\n case 'concert-this':\n concertThis();\n break;\n case 'spotify-this-song':\n spotifyThisSong();\n break;\n case 'movie-this':\n movieThis();\n break;\n case 'do-what-it-says':\n doWhatItSays();\n break;\n }\n}", "function markUserSelected(){\n\tif(document.getElementById('selectUser').value==0){\n\t\talert(\"please select a user\");\n\t}else{\n\t\tCURRENT_USER_=document.getElementById('selectUser').value;\n\t\t//\n\t\tdocument.getElementById('projectBioContainer').style.display='block';\n\t}\n}", "function selectUser(user) {\n self.selected = angular.isNumber(user) ? $scope.users[user] : user;\n self.toggleList();\n\n appContextService.setselectedService(self.selected);\n\n $location.path(user.url);\n\n }", "function profileSelect(usr)\n{\n var cur = getActiveDocument();\n if(usr==\"Mike\")\n getDocument('backend/templates/loginPage.xml');\n else\n {\n getDocument('backend/templates/home.xml');\n navigationDocument.removeDocument(cur);\n }\n}", "function detect_user(options, completed, failed) {\n db.users.get_all(function(result){\n // console.log(result);\n completed(result);\n });\n}", "function viewtheirstuff(userselected) { \n viewwhichuser(userselected);\n backtotop();\n }", "function GetUser() {\n showUsers(dataUsers[currentPage]);\n}", "_getSelectedUser()\n {\n return $('#region-main_projectusers_users select').find(\":selected\").text().trim();\n }", "function selectUser(key) {\n setSelectedUser((oldKey) => key === oldKey ? -1 : key);\n }", "function getUserChoice(userInput){\n if(userInput > 1 && userInput < 10){\n createGrid(userInput);\n }\n else {\n getUserChoice(prompt('Please enter a valid number'));\n }\n}", "function findCurrentUser() {\n return \"stefan\"\n }", "function bindBtnMe() {\n $(\"#userNameTimesheet option\").filter(function () {\n return $(this).text() === $(\".loggedUser\").text();\n }).prop('selected', true).trigger('change');\n}", "function main() {\r\n // user.userLogin(\"[email protected]\", \"sporks\");\r\n}", "function onLoginSubmit() {\n var select = document.getElementById(\"currentUsersList\");\n var userId = select.options[select.selectedIndex].value;\n var role = select.options[select.selectedIndex].innerHTML;\n \n logIn(userId,role);\n }", "function getUser(id) {\n return \"Akhil\";\n}", "function userChoice(choice){\n setHulkChoice();\n evaluate(choice);\n}", "function exercise1(registerUser) {}", "function selectBotFromList(){\n var parentUl = $('.user-content').children('ul');\n var users = parentUl.children('li');\n var user = users.get(0);\n\n // Clear message contents..\n $('#messages').html('');\n\n // Set user to select..\n for(var i = 0; i < users.length; i++) {\n user = users.get(i);\n user.setAttribute(\"style\", \"\");\n }\n users.get(1).setAttribute(\"style\", \"background-color: #eee;\");\n selectedIndex = 1;\n\n disableActionButton();\n var oneUser = {\n id : \"BOT\",\n contact_id: \"BOT\",\n username : \"CHAT BOT\",\n email : \"CHATEMAIL\",\n img : \"/images/bot.png\"\n };\n\n selectFlag = \"BOT\";\n userSelected = oneUser;\n\n showUserInfo(oneUser);\n connectChatBot();\n\n curConvId = \"BOT\";\n}", "function getUserDropdown(res, mysql, context, complete){\n let sql = \"SELECT user_id, username FROM Users\";\n mysql.pool.query(sql, function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.users = results;\n complete();\n });\n}", "function select ( menuId ) {\r\n // self.selected = angular.isNumber(menuId) ? $scope.users[user] : user;\r\n self.toggleList();\r\n }", "async function proceedUserChoice(userChoice) {\n\n switch (userChoice.action) {\n\n case \"View all employees\":\n await viewAllEmployees();\n mainMenu();\n break;\n\n\n case \"View employees by department\":\n await viewEmployeeByDept();\n mainMenu();\n break;\n\n\n case \"View all employees by Role\":\n await viewEmployeeByRole();\n mainMenu();\n break;\n\n case \"Add Employee\":\n await addEmployeePrompts();\n mainMenu();\n break;\n\n case \"Add Department\":\n await addDepartmentPrompts();\n mainMenu();\n break;\n\n\n case \"Add Role\":\n await addRolesPrompts();\n mainMenu();\n break;\n\n case \"Remove Employee\":\n await removeEmployeePrompts();\n mainMenu();\n break;\n\n case \"Update Employee Role\":\n await UpdateEmployeeRolePrompts();\n mainMenu();\n break;\n\n case \"Update Employee Manager\":\n await UpdateEmployeeManagerPrompts();\n mainMenu();\n break;\n\n case \"EXIT\":\n process.exit(0);\n\n\n default:\n\n break;\n\n }\n\n\n}", "function user(){\n inquirer.prompt([{\n name : \"userMenu\",\n type : \"list\",\n message : \"What do you want to do?\",\n choices : [\"purchase on an item\", \"check price/stock of an item\", \"quit\"]\n }]).then(answers=>{\n if (answers.userMenu === \"purchase on an item\"){\n bid()\n }\n else if (answers.userMenu === \"check price/stock of an item\"){\n check()\n }\n else if(answers.userMenu === \"quit\"){\n connection.end()\n }\n })\n}", "function userInput(userSelect, userSearch) {\n if (userSelect === \"movie-this\") {\n movieInfo(userSearch);\n } if (userSelect === \"concert-this\") {\n concertInfo(userSearch);\n } if (userSelect === \"spotify-this-song\") {\n songInfo(userSearch);\n } if (userSelect === \"do-what-it-says\") {\n doWhatitSays(userSearch);\n }\n}", "function newUser(){\r\r\n}", "function userType(){\n inquirer.prompt([\n {\n type: \"list\",\n message: \"\\nWelcome to Better Broomball Store!\\n\",\n choices: [\"Browse the store\", \"Admin access\"],\n name: \"type\"\n }\n ])\n .then(function(res) {\n // If the inquirerResponse confirms, we displays the inquirerResponse's username and pokemon from the answers.\n if (res.type === \"Browse the store\") {\n browseType = \"User\";\n let customerLogin = customer.getStarted();\n \n }\n else if (res.type === \"Admin access\") {\n browseType = \"Admin\";\n login();\n }\n }); \n }", "async gotoManageUserPage(testController) {\n await testController.click('#manage-user-page');\n }", "async function manageUser()\n{\n\tlet server = objActualServer.server\n\tlet txt = \"Choissisez la personne que vous souhaitez manager : \"\n\n\tlet choice = [\n\t{\n\t\tname: \"Retournez au menu précédent\",\n\t\tvalue: -1\n\t}]\n\tchoice.push(returnObjectLeave())\n\tserver.members.forEach((usr) =>\n\t{\n\t\tlet actualUser = usr.user\n\t\tchoice.unshift(\n\t\t{\n\t\t\tname: actualUser.username,\n\t\t\tvalue: actualUser\n\t\t})\n\t})\n\n\tlet data = await ask(\n\t{\n\t\ttype: \"list\",\n\t\tname: \"selectedUser\",\n\t\tmessage: txt,\n\t\tchoices: choice,\n\t})\n\n\tif (data.selectedUser == -1)\n\t{\n\t\tchooseWhatToHandle(data)\n\t}\n\telse if (data.selectedUser == -2)\n\t{\n\t\tendProcess()\n\t}\n\telse\n\t{\n\t\tmanageSingleUser(data.selectedUser)\n\t}\n\n}", "function execute(userChoice) {\n switch (userChoice) {\n case \"viewEmp\":\n viewEmp();\n break;\n case \"viewEmpMan\":\n viewEmpMan();\n break;\n case \"viewDept\":\n viewDept();\n break;\n case \"viewRoles\":\n viewRoles();\n break;\n case \"addEmp\":\n addEmp();\n break;\n case \"addDept\":\n addDept();\n break;\n case \"addRole\":\n addRole();\n break;\n case \"updateRole\":\n updateRole();\n break;\n case \"updateManager\":\n updateManager();\n break;\n case \"deleteDept\":\n deleteDept();\n break;\n case \"deleteRole\":\n deleteRole();\n break;\n case \"deleteEmp\":\n deleteEmp();\n break;\n case \"end\":\n connection.end();\n }\n}", "function showUserList(elmId) {\n var treeview = window.tvGroup;\n\n if (treeview.SelectedNode != null && treeview.SelectedNode.ID.substr(0, 1) != \"C\") {\n popupWindow.setUrl('SYS_ChooseUsers.aspx?Include=user&WithOutSide=Y&withgroup=n');\n popupWindow.setSize(250, 400);\n popupWindow.showPopup(elmId, false);\n }\n else {\n alert(\"请先选中用户组,再进行添加组用户操作!\");\n return false;\n }\n}", "function getUserCharSelection() {\n let userSelection = {\n lowerCase: false,\n upperCase: false,\n numbers: false,\n specialChar: false,\n };\n\n //this loop makes sure that the use atleast selected one\n while (\n !userSelection.lowerCase &&\n !userSelection.upperCase &&\n !userSelection.numbers &&\n !userSelection.specialChar\n ) {\n userSelection.lowerCase = window.confirm(\n \"Would you like to include lower case characters in your password\"\n );\n\n userSelection.upperCase = window.confirm(\n \"Would you like to include upper case characters in your password\"\n );\n\n userSelection.numbers = window.confirm(\n \"Would you like to include numbers in your password\"\n );\n\n userSelection.specialChar = window.confirm(\n \"Would you like to include special characters in your password\"\n );\n }\n\n return userSelection;\n}", "async listPage(testController) {\n // This is first test to be run. Wait 10 seconds to avoid timeouts with GitHub Actions.\n await testController.click('#addNewHobby');\n await testController.typeText('#signin-form-email', username);\n\n\n }", "function fetchUser() {\n const userId = document.getElementById('user-id').value\n client.user.fetch(userId)\n}", "function onAddUserSubmit() {\n var select = document.getElementById(\"roleSelect\");\n var role = select.options[select.selectedIndex].value;\n addUser(role);\n }", "static async getRandomUser(){\n let res = await this.request(`matches/random`);\n return res.user;\n }", "function run(userSelection) {\n\n switch (userSelection) {\n case \"spotify-this-song\":\n\n if (userInputConcat.length != 0) {\n search_track(userInputConcat.trim());\n } else if (textSong.length != 0) {\n search_track(textSong.trim());\n } else {\n search_track(\"The Sign Ace of Base\");\n }\n break;\n case \"concert-this\":\n\n getConcertInfo(userInputConcat);\n\n break;\n\n case \"movie-this\":\n\n if (userInputConcat.length != 0) {\n getMovieInfo(userInputConcat.trim(), displayNobodyInfo);\n\n } else {\n displayNobodyInfo = true;\n getMovieInfo(\"Mr. Nobody\", displayNobodyInfo);\n }\n break;\n case \"do-what-it-says\":\n readFile();\n break;\n default:\n break;\n\n }\n}", "function questionUser() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"builder\",\n message: \"Would you like to add a team member?\",\n choices: [\"Manager\", \"Engineer\", \"Intern\", \"No\"]\n }\n ]).then((response) => {\n //console.log(response.builder)\n //if Manager is selected, run the addManager function\n if (response.builder === \"Manager\") {\n //console.log(\"this works\")\n addManager();\n }\n //if Engineer is selected, run the addEngineer function\n else if (response.builder === \"Engineer\") {\n addEngineer();\n }\n //if Intern is selected, run the addIntern function\n else if (response.builder === \"Intern\") {\n addIntern();\n }\n //if No is selected, assuming the team is complete, render the HTML page\n else if (response.builder === \"No\") {\n //console.log(\"once user selects No\", teamMembers);\n buildHTML();\n }\n })\n }", "function employeeSelect() {\n // Select employee role\n const selectQuestions = [\n {\n name: \"choice\",\n type: \"list\",\n message: `Please select the job role:`,\n choices: [\"Engineer\", \"Intern\", \"None\"],\n },\n ];\n\n inquirer.prompt(selectQuestions).then((answers) => {\n if (answers.choice === \"Engineer\") {\n engineerInfo();\n }\n if (answers.choice === \"Intern\") {\n internInfo();\n }\n if (answers.choice === \"None\") {\n createHtmlFile();\n }\n });\n}", "function selectbox() {\n var sim = document.getElementById(\"simple\");\n alert(\"the user is from: \" + sim.options[sim.selectedIndex].value);\n}", "getSelectedUser(id) {\n this.props.dispatch({ type: 'FETCH_SELECTED_USER', payload: id });\n this.setState({display:true})\n }", "function getUserChoice2() {\n const selectId = \"select2\";\n const userWatching = \"userWatching\";\n const userLeft = \"userLeft\";\n\n let selectObj = document.getElementById(selectId);\n document.getElementById(\"log\").innerText = \"\";\n if (selectObj.value == userWatching) {\n promise2(true, false);\n }\n if (selectObj.value == userLeft) {\n promise2(false, true);\n }\n}", "function getUserById(userid) {\n}", "function userSelection() {\n stopCountdown();\n if ($(this).attr(\"data-name\") == correctAnswers[questionSelector]) {\n rightWrong = true;\n correct++;\n var newScore = score += points;\n $(\"#score\").text(newScore);\n } else {\n incorrect++ \n }\n showResult();\n nextQuestion();\n }", "async setUser() {\n return Channel.promptedMessage('What\\'s your username?\\n\\n> ');\n }", "function promptUser() {\n inquirer.prompt([\n {\n type: 'list',\n message: 'choose an option for next team member',\n name: 'content',\n choices: ['Engineer', 'Intern', 'Done']\n }\n ]).then(function (answers) {\n if (answers.content === \"Engineer\") { promptEngineer() };\n if (answers.content === \"Intern\") { promptIntern() };\n if (answers.content === \"Done\") { writeHtml() };\n\n });\n\n}", "function newGameUser() {\n var btn = document.getElementById(\"testName\");\n btn.addEventListener(\"click\", function() {\n userName = this.form.username.value;\n changeUserText(userName);\n this.form.username.value = \"\";\n testLocal();\n });\n}", "function askUser(){\n setRatingVars();\n checkEvents();\n if(outChooseVal == 1){\n console.log(chalk.cyan(\"\\nYour task has been completed. Select the a validator to continue...\\n\"));\n }\n if(canRate == true){\n giveRating();\n }\n else{\n if(prov == 0)\n inquirer.prompt([questions]).then(answers => {choiceMade(answers.whatToDo)});\n else\n inquirer.prompt([questions1]).then(answers => {choiceMade(answers.whatToDo1)});\n }\n}", "function changeUser() {\n var choice = Math.floor(Math.random() * name.length);\n document.getElementById(\"user\").innerHTML = name[choice];\n document.getElementById(\"userBtn\").innerHTML = name[choice];\n document.getElementById(\"userDrop\").innerHTML = name[choice];\n drawTextAndResize(name[choice]);\n}", "selectRand() {\n\t}", "function selectUserOverlay(uuid) {\n if (selectedUserUUID) {\n // deselect the old selected user\n deselectUserOverlay(selectedUserUUID);\n }\n userStore[uuid].isSelected = true;\n Overlays.editOverlay(userStore[uuid].overlayID, { color: OVERLAY_SELECTED_COLOR });\n selectedUserUUID = uuid;\n }", "function onUserChange(newname) {\n var id;\n\n username = newname;\n\n items.username = username;\n\n var fn = !!username? loggedin: loggedout;\n for (i=0, len=fn.length; i<len; i++) {\n fn[i](newname);\n }\n }", "* test() {\n return 'user';\n }", "function selectRow() {\r\n document.getElementById(\"tblUsers\").addEventListener('click', function (e) {\r\n var row = e.target.parentNode;\r\n var userID = row.firstChild.innerHTML;\r\n getASingleUser(userID);\r\n document.getElementById(\"userID\").disabled = true;\r\n })\r\n}", "function promptUser() {\n inquirer.prompt([\n {\n name: \"action\",\n type: \"list\",\n message: \"Which of the following actions would you like to perform?\",\n choices: [\"View products for sale\", \"View low inventory\", \"Add to inventory\", \"Add new product\"]\n }\n ]).then(function(answer) {\n //Switch based on the manager's choice\n switch (answer.action) {\n //Run function to view all the products\n case \"View products for sale\":\n showTable();\n break;\n\n //Run function to view low inventory\n case \"View low inventory\":\n lowInv();\n break;\n\n //Run function to add inventory\n case \"Add to inventory\":\n addInv();\n break\n\n //Run function to add a new product\n case \"Add new product\":\n addProduct();\n break\n }\n })\n}", "function selectEntryToExamine(item) {\n\tvar selectionList = [item.user]\n\tconsole.log(\"geomap selection:\",selectionList)\n\tvar outObject = {'user':selectionList}\n\tOWF.Eventing.publish(\"entity.selection\",selectionList)\n}", "function getuserselection(){\n var selection = readline.question('Choice: ');\n console.log('You have chosen option: ' + selection);\n return selection;\n}", "searchUser(id) {\n cy.searchUser(id)\n }", "function randomUser([num = 6, id = \"random\"] = []) {\n return `Generated ${num} - ${id} users`;\n}", "function add_new_user_selection(type){\n\tif(type==0){\n\t\t$(\"#add_professor_option\").prop(\"checked\", false);\n\t\t$(\"#aem_tr\").show();\n\t\t$(\"#add_user_type\").val('0');\n\t}else{\n\t\t$(\"#add_student_option\").prop(\"checked\", false);\n\t\t$(\"#aem_tr\").hide();\n\t\t$(\"#add_user_type\").val('1');\n\t}\n}", "function selectRandomly(/* TODO parameter(s) go here */) {\n // TODO complete this function\n}", "async function main() {\n\n getUser(\"test1\");\n\n}", "function generateUserAkan() {\n var genderId = document.getElementById(\"gender\");\n var gender = genderId.options[genderId.selectedIndex].value;\n\n if (gender == \"male\") {\n return handleMaleNames(processUserData())\n }\n return handleFemaleNames(processUserData());\n}", "function jSelectUser(element) {\n\tvar $el = jQuery(element),\n\t\tvalue = $el.data('user-value'),\n\t\tname = $el.data('user-name'),\n\t\tfieldId = $el.data('user-field'),\n\t\t$inputValue = jQuery('#' + fieldId + '_id'),\n\t\t$inputName = jQuery('#' + fieldId);\n\n\tif (!$inputValue.length) {\n\t\t// The input not found\n\t\treturn;\n\t}\n\n\t// Update the value\n\t$inputValue.val(value).trigger('change');\n\t$inputName.val(name || value).trigger('change');\n\n\t// Check for onchange callback,\n\tvar onchangeStr = $inputValue.attr('data-onchange'), onchangeCallback;\n\tif(onchangeStr) {\n\t\tonchangeCallback = new Function(onchangeStr);\n\t\tonchangeCallback.call($inputValue[0]);\n\t}\n\tjModalClose();\n}", "attempt(username) {\n let query = 'SELECT+Id,+Name,+Username+FROM+User+WHERE+Name+LIKE+\\'%25' + username + '%25\\'+OR+Username+LIKE+\\'%25' + username + '%25\\'';\n\n ftClient.query(query,\n function(success) {\n console.log(success);\n let numberOfUserRecords = success.records.length;\n if(numberOfUserRecords < 1){\n addError([{\"message\":\"No user for your search exists.\"}]);\n } else if(numberOfUserRecords > 1){\n loginAsShowOptions(success.records);\n } else {\n var userId = success.records[0].Id;\n loginAsPerform(userId);\n }\n },\n function(error)\n {\n console.log(error);\n addError(error.responseJSON);\n }\n );\n }", "function selectKey() {\n choosenEmail = $('#several_keys select')[0].selectedOptions[0].value;\n login();\n}", "function validateUser(userVal) {\r\n\tif(userVal == \"\") {\r\n\t\talertify.alert(\"Please select new facilitator.\");\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function getUserPick() {\n attempts = attempts - 1;\n var userNum = parseInt(userPick.value);\n checkUserPick(userNum);\n userPick.value = '';\n}", "function getSelectedUserId() {\n\n return $(\"#viewDashboardAs\").val();\n}", "function createUser() {}", "async loginUser() {\n await this.userName.sendKeys(browser.params.loginData.login.login_set_1.username);\n await this.password.sendKeys(browser.params.loginData.login.login_set_1.password);\n await this.loginButton.click();\n }", "async function choosePlayer(bttn) {\n //set up a user\n await userChoose(bttn);\n await opponentChoose(bttn); //set up an opponent\n console.log('User Team', userTeam);\n console.log('Opponent Team', opponentTeam);\n}", "function selectUser(id) {\n self.successMessage='';\n self.errorMessage='';\n UserService.setUser(id).then(\n function (response) {\n $window.location.href = 'http://localhost:8080/#/fclassstructure';\n console.log('ID '+id + \" è stato cliccato selectUser\");\n console.log(\" Elementi doppi: \" + getAllClass());\n\n },\n function (errResponse) {\n console.error('Error selectUser ' + id + ', Error :' + errResponse.data);\n }\n );\n UserService.setFcInformativeNotes(id).then(\n function () {\n console.log('ID '+id + \" è stato cliccato setFcInformativeNotes\");\n\n },\n function (errResponse) {\n console.error('Error setFcInformativeNotes ' + id + ', Error :' + errResponse.data);\n }\n );\n UserService.setFfamily(id).then(\n function () {\n console.log('ID '+id + \" è stato cliccato setFfamily\");\n },\n function (errResponse) {\n console.error('Error setFamily ' + id + ', Error :' + errResponse.data);\n }\n );\n }", "function getAllUsers(pool, select, callback){\n pool.connect(function(err, client) {\n if(err){\n callback && callback(err);\n }\n else{\n var queryString = 'SELECT ' + select + ' FROM player WHERE status != $1 AND status != $2 ORDER BY username';\n // console.log(queryString);\n var values = [\"Not Registered\", \"League of Legends\"];\n client.query(queryString, values, function(err, result){\n client.release();\n if(err){\n callback && callback(err, null);\n }\n else {\n // console.log(result.rows);\n callback && callback(null, result.rows);\n }\n });\n }\n });\n}", "function userScissors() {\n userChoiceword = \"scissors\";\n if (computerChoiceword == \"scissors\")\n {\n //Function for a user tie result.\n tie();\n resultTied();\n }\n else if (computerChoiceword == \"paper\")\n {\n //Function for a user win result.\n userWins();\n resultWin();\n }\n else if (computerChoiceword == \"rock\")\n {\n //Function for a user lose result.\n computerWins();\n resultLose();\n }\n }", "function getLoginUser() {\n\t\tlet getUserDetails = localStorageService.getLoggedInUserInfo();\n\t\tlet userDetails = JSON.parse(getUserDetails);\n\t\tlet loginUserGroup = userDetails.userGroup;\n\t\tif (loginUserGroup !== 'Administrator') {\n\t\t\tvm.reporter = userDetails.userId;\n\t\t\tvm.reporterList = []; // If User not admin than hide reporter list dropdown\n\t\t} else {\n\t\t\t/* Get reporters list */\n\t\t\tgetUsers();\n\t\t}\n\t}", "function oneUser (input) {\n function myCallback(data) {\n for(i=0; i < data.length; i++){\n if(data[i].userId == input){ /*.id?*/\n let founduser = data[i];\n sessionStorage.setItem('foundUser', JSON.stringify(founduser))\n }\n }\n window.location.href = (\"adminUpdateUser.html\")\n }\n\n var admin = new Admin(null, null, 2);\n admin.getUser(myCallback);\n}", "toggleuser(event, uname) {\n event.preventDefault();\n // If not already selected\n if (this.selectedusers.indexOf(uname) < 0) {\n document.querySelector(\"#\" + uname).setAttribute(\"class\", \"btn btn-primary selected\");\n this.selectedusers.push(uname);\n // If already selected\n }\n else {\n document.querySelector(\"#\" + uname).setAttribute(\"class\", \"btn btn-primary unselected\");\n this.selectedusers = this.selectedusers.filter((u) => {\n return u != uname;\n });\n }\n console.log(\"Selected users: \", this.selectedusers);\n }", "getUser(state, action){}" ]
[ "0.664821", "0.6561464", "0.6459968", "0.6440342", "0.6261245", "0.62408775", "0.6204785", "0.616787", "0.61523175", "0.6140822", "0.61264426", "0.6086654", "0.6073826", "0.60517275", "0.6049714", "0.60218436", "0.59815454", "0.5966207", "0.59552735", "0.5947072", "0.593239", "0.59231246", "0.5858429", "0.585679", "0.5844588", "0.5836423", "0.5834136", "0.5771646", "0.57686603", "0.5767297", "0.57509506", "0.57403535", "0.5714721", "0.5704067", "0.5701176", "0.5697876", "0.5696538", "0.5668838", "0.566055", "0.5643558", "0.5633101", "0.5625393", "0.56235147", "0.5616212", "0.5608144", "0.56035084", "0.55924153", "0.55857295", "0.5585601", "0.557587", "0.5569936", "0.55528593", "0.5531836", "0.55316526", "0.5524965", "0.552379", "0.55132645", "0.5511923", "0.5511377", "0.5501347", "0.5494808", "0.54936683", "0.5492418", "0.54918647", "0.5473906", "0.5472004", "0.5465486", "0.5459176", "0.5455245", "0.5444375", "0.5440274", "0.54346716", "0.54291934", "0.54255533", "0.5408193", "0.5407717", "0.5406278", "0.5397422", "0.5389403", "0.53779536", "0.53713477", "0.5368078", "0.53662515", "0.5365938", "0.53592354", "0.5354992", "0.53532964", "0.53519773", "0.53469133", "0.53466403", "0.53440785", "0.53439784", "0.5343084", "0.5342858", "0.5340007", "0.533065", "0.5326306", "0.5324372", "0.5321878", "0.53200084", "0.53176653" ]
0.0
-1
Function to change display property to block.
function show(Id){ document.getElementById(Id).style.display = "block"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ShowBlockElement(el, show) {\n el.style.display = show ? \"block\" : \"none\";\n}", "function showBlock(aid){\n\tvar el = document.getElementById(aid);\n\tsetStyle(el, 'display', 'block');\n}", "get displayMode() {\n return this.__displayMode || 'block';\n }", "function BlockBtnDisplay (idElement, x) {\r\n\t\t//document.getElementById(idElement).style.display = \"\"+x+\"\";\r\n\t\t$(\"#\"+idElement).css(\"display\",\"\"+x+\"\");\t\r\n\t}", "function displayNone(whichBlock) {\r\n\tdocument.getElementById(whichBlock).style.display='none';\r\n}", "function block_fn() {\n setVisibility(\"block\");\n inputType = \"Block\";\n}", "function show(){\r\n // change display style from none to block\r\n details.style.display='block';\r\n}", "function t(e){return!!r(e)||\"block\"===s.dom.getStyle(\"display\").from(e)}", "changeDisplay() {\n this.displayMarkup = !this.displayMarkup;\n }", "function changeDisplay(id, display) {\n document.getElementById(id).style.display = display;\n}", "static toggleDisplay(element, display) {\n element.style.display === 'none'\n ? (element.style.display = display)\n : (element.style.display = 'none');\n }", "function display(x)\n{\n if (x.style.display === 'none') {\n\tx.style.display = 'block';\n } else {\n\tx.style.display = 'none';\n }\n}", "function changeDisplay(){\n magicElement.style.display = \"none\";\n}", "show() {\n\t\tthis.style.display = \"inline-block\";\n\t}", "function toggleDisplay( obj ){\r\n\t\t\t\r\n\t\t\tif( obj.style.display == \"none\" ){\r\n\t\t\t\tobj.style.display = \"block\";\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tobj.style.display = \"none\";\r\n\t\t\t}\r\n\t\t}", "function show(el){\n\t\tel.style.display = 'block';\n\t}", "function toggleDisplay(element, display){\n element.forEach(function(e){\n e.style.display = display;\n });\n}", "function toggleElementDisplay(el) {\n if (gees.dom.getDisplay(el) == 'block' || gees.dom.getDisplay(el) == '') {\n gees.dom.hide(el);\n } else {\n gees.dom.show(el);\n }\n}", "function displayInstruction(){\n document.getElementById(\"instruct_display\").style = \"display: block\";\n}", "function show(el) {\n\t\tel.style.display = '';\n\t}", "function hideBlock(aid){\n\tvar el = document.getElementById(aid);\n\tsetStyle(el, 'display', 'none');\n}", "function toggleDisplay(element) {\n var style = getComputedStyle(element)\n if (style.display != \"none\") {\n element.style.display = \"none\"\n } else {\n element.style.display = \"block\"\n }\n}", "showHide () {\r\n this.setState({ display: this.state.display==='none'?'inline-block':'none' });\r\n }", "show(element){\n element.style.display = \"flex\";\n }", "function show() {\n that.row.style.display = 'block';\n }", "function showDiv(){\n div = document.getElementById(\"display\");\n div.style.display = \"inline-block\";\n}", "function toggleDisplay() {\n display = !display;\n\n if (!frame) {\n createFrame();\n }\n\n toggleScrolling(display);\n\n if (display) {\n frame.style.display = \"block\";\n }\n else {\n frame.style.display = \"none\";\n }\n}", "show() {\n\t\t\tif ( this._container ) {\n\t\t\t\tthis._container.style = 'display:block';\n\t\t\t}\n\t\t}", "function showElement(el, b) {\n el.style.display = b ? 'block' : 'none';\n }", "function toggle_display(elem) {\n if (elem.css('display') === 'none') {\n elem.css('display', 'block');\n } else {\n elem.css('display', 'none');\n }\n}", "toggleDisplay() {\n var usermenu = this.getUserMenu();\n var entirescreen = this.getEntireScreen();\n if (this.display) {\n usermenu.style.display = 'block';\n entirescreen.style.display = 'block';\n } else {\n usermenu.style.display = 'none';\n entirescreen.style.display = 'none';\n }\n }", "function afficheDiv(divNone, divBlock){\n document.getElementById(divNone).style.display=\"none\";\n document.getElementById(divBlock).style.display=\"block\";\n}", "function visibility(display, id) {\r\n\t\tdocument.getElementById(id).style.display = display;\r\n\t}", "function showBlocks(n){\n\t\t\tvar x = 'my'+ n;\n\t\t\tdocument.getElementById(x).style.display = 'block';\n\n\t\t}", "function toggleDisplayWithDisplayType(idOfElement, displayType, animate){\n var element = document.getElementById(idOfElement);\n if(!element){\n return;\n }\n if(!displayType){\n displayType = \"block\";\n }\n if (!animate) {\n element.style.display = element.style.display == 'none' ? displayType : 'none';\n return;\n }\n\n if (element.style.display == 'none') {\n Animation.rollIn(element, function() {element.style.display = displayType;} );\n return;\n }\n Animation.rollOut(element);\n}", "function show(elem) {\n document.getElementById(elem).style.display = 'inline-block';\n}", "function hide(){\r\n // change display style from block to none\r\n details.style.display='none';\r\n}", "function show() {\n const toShow = document.querySelector(\".show\");\n const showBlock = document.querySelector(\".currentDisplay\");\n showBlock.innerHTML = (toShow.innerHTML)\n}", "function showElement(element) {\n element.style.display = \"\";\n}", "function show(node, styleType) {\r\n if (!styleType)\r\n styleType = '';\r\n getNodeIfString(node).style.display = styleType;\r\n}", "function show_block(id){\n var id_name = '#' + id;\n var show_link = id_name + '_show_link';\n var hide_link = id_name + '_hide_link';\n $(show_link).hide();\n $(hide_link).show();\n $(id_name).show(\"blind\", { direction: \"vertical\" }, 500);\n}", "function toggleDisplay(el) {\n el.classList.toggle('displayNone');\n}", "function changeDisplay(){\n}", "function myFunction() {\n var x = document.getElementById(\"myDIV\");\n\n if (x.style.display === \"block\") {\n x.style.display = \"none\";\n } else {\n x.style.display = \"block\";\n }\n}", "show() {\n ELEM.setStyle(this.elemId, 'display', this.displayMode, true);\n ELEM.setStyle(this.elemId, 'visibility', 'inherit', true);\n this.isHidden = false;\n return this;\n }", "function\nShowBlocker\n()\n{\n var blocker;\n\n blocker = document.getElementById(\"MainBlocker\");\n blocker.style.visibility = \"visible\";\n}", "function show(elements, specifiedDisplay) {\n elements = elements.length ? elements : [elements];\n for (let index = 0; index < elements.length; index++) {\n elements[index].style.display = specifiedDisplay || \"block\";\n }\n}", "function _elementDisplay($element, value) {\n var display = (value) ? \"block\" : \"none\";\n $element.css(\"display\", display);\n}", "function afficherBloc(id) {\n document.getElementById(id).style.display = \"block\";\n}", "function display(element) {\r\n let x;\r\n x = document.getElementById(element);\r\n if (x.hidden === true) {\r\n x.hidden = false\r\n } else {\r\n x.hidden = true\r\n }\r\n}", "function show(id){\n document.getElementById(id).style.display = 'block';\n}", "function showObject(theObject){\n if (theObject != null){\n if (theObject.style != null && theObject.style.display != null){\n\t theObject.style.display = \"block\";\n\t }\n }\n}", "function changeDisplayValue(div) {\n div.forEach(div => {\n const currentStyle = div.style.display;\n div.style.display = currentStyle === \"none\" ? \"block\" : \"none\";\n });\n }", "toggleFormDisplay() {\n let newDisplay = 'none';\n if (this.state.formDisplay === 'none') {\n newDisplay = 'block';\n }\n this.setState(\n {\n formDisplay: newDisplay\n }\n )\n }", "function openModal () {\n //chnge the display value to block\n modal.style.display = 'block';\n}", "function div_show(){ \ndocument.getElementById('abc').style.display = \"block\";\n}", "function showList1() {\n // get the onclick element from HTML \n var x = document.getElementById(\"wrapper1\");\n // if the display of wrapper is not in block \n if (x.style.display != \"block\") {\n // then change to block\n x.style.display = \"block\";\n // if it is block, change to none(hidden)\n } else {\n x.style.display = \"none\";\n }\n}", "function div_show() {\n document.getElementById('abc').style.display = \"block\";\n}", "function show() {\n $.forEach(this.elements, function(element) {\n element.style.display = '';\n });\n\n return this;\n }", "function toggleMovementDisplay() {\n\tisHidden.style.display = 'block';\n}", "changeMainDispaly(none_block){\n if(none_block==='none'){\n document.getElementById(this.main).style.display = none_block\n document.getElementById(this.spinner).style.display = 'block'\n }else if(none_block==='block'){\n document.getElementById(this.spinner).style.display = 'none'\n document.getElementById(this.main).style.display = none_block\n }\n }", "function showElement(el1) {\n el1.style.display = \"inline-block\";\n }", "function div_show() {\n\tdocument.getElementById('abc').style.display = \"block\";\n}", "function showElement(element) {\n element.style.display = \"inline\";\n}", "function showElement(e) {\n e.style.display = \"block\";\n }", "function schedInterview(){\n document.getElementById('sched'.style.display = \"block\");\n}", "function toggle() {\r\n //if the object is current hidden\r\n if (hidden) {\r\n //set display to be on in block form\r\n document.getElementById('output').style.display = 'block';\r\n //and set the status to currently visible\r\n hidden = false;\r\n }\r\n //otherwise it is implied that it is visible\r\n else {\r\n //set the status to hidden\r\n hidden = true;\r\n //set the objects display to be off\r\n document.getElementById('output').style.display = 'none';\r\n }\r\n }", "function div_show() {\ndocument.getElementById('abc').style.display = \"block\";\n}", "function div_show() {\ndocument.getElementById('abc').style.display = \"block\";\n}", "function div_show() {\ndocument.getElementById('abc').style.display = \"block\";\n}", "function setBlockVisibility(class_name, show) {\r\n var blocks = document.getElementsByClassName(class_name);\r\n for(var i = 0; i < blocks.length; i++) {\r\n if(show) {\r\n blocks[i].style.display = '';\r\n } else {\r\n blocks[i].style.display = 'none';\r\n window.clearAllErrors(blocks[i]);\r\n }\r\n } \r\n }", "function Contextdisplay(whichID) {\r\n document.getElementById(whichID).style.display = (document.getElementById(whichID).style.display != 'block' ? 'block' : 'none');\r\n}", "function css_defaultDisplay(nodeName) {\n var doc = document,\n display = elemdisplay[nodeName];\n\n if (!display) {\n display = actualDisplay(nodeName, doc);\n\n // If the simple way fails, read from inside an iframe\n if (display === \"none\" || !display) {\n // Use the already-created iframe if possible\n iframe = (iframe || jQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n .css(\"cssText\", \"display:block !important\")).appendTo(doc.documentElement);\n\n // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n doc = (iframe[0].contentWindow || iframe[0].contentDocument).document;\n doc.write(\"<!doctype html><html><body>\");\n doc.close();\n\n display = actualDisplay(nodeName, doc);\n iframe.detach();\n }\n\n // Store the correct default display\n elemdisplay[nodeName] = display;\n }\n\n return display;\n }", "function show(id) {\r\n document.getElementById(id).style.display = 'block';\r\n}", "function showSprechblase_BlumeFlur(){\n document.getElementById('Sprechblase_BlumeFlur').style.display=\"block\"\n}", "function div_show() {\r\ndocument.getElementById('abc').style.display = \"block\";\r\n}", "function changeVisibility(){\n magicElement.style.display = \"block\";\n magicElement.style.visibility = \"hidden\";\n\n /* Alternative approach – I think the approach above is easier to read\n magicElement.setAttribute(\"style\", \"display: block; visibility: hidden;\"); */\n}", "function displayBox() {\n conversorBox.style.display = \"inline-block\";\n setTimeout(hideBox, 2000);\n}", "showBoard() \n { \n document.getElementById(\"board\").style.display = \"inline-block\";\n }", "function showElement (element) {\n\t'use strict';\n\telement.style.display = 'block';\n}", "showFreeSlots(){\n\t\tthis.setState({display:'block'});\n\t}", "display() {\n this.editorNode.style.visibility = \"visible\";\n this.focusInput();\n }", "function displayItem(itemToDisplay) {\n itemToDisplay.style.display = 'block';\n}", "function div_show() {\r\n\tdocument.getElementById('abc').style.display = \"block\";\r\n}", "function notificacionActualizarAbrir(){\n document.getElementById(\"notificacionActualizar\").style.display = \"block\";\n}", "function myFunction3() {\n var x = document.getElementById(\"myDIV3\");\n if (x.style.display === \"block\") {\n x.style.display = \"none\";\n } else {\n x.style.display = \"block\";\n }\n }", "function signDisplayNoneBadFunctionChangeThis() {\n store.dispatch({\n type: \"SHOW_SIGN\",\n payload: {\n display: \"none\"\n }\n });\n }", "function changeVisibility() {\n magic.style.visibility = 'hidden';\n magic.style.display = 'block;';\n}", "render_display() {\n this.element.fadeIn();\n this.visible = true;\n }", "function toggleDisplay(id)\n{\n var element = document.getElementById(id);\n if (element.style.display != 'none')\n element.style.display = 'none';\n else\n element.style.display = 'block';\n}", "function show(id, value) {\n document.getElementById(id).style.display = value ? 'block' : 'none';\n}", "toggle() {\n\t\tif (this.isVisible) {\n\t\t\tthis.display();\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}", "function dhtml_showLayer(name, displayBlock) {\r\n var layer = dhtml_getLayerStyle(name);\r\n if (layer) {\r\n if (document.layers) {\r\n layer.visibility = \"show\";\r\n } else {\r\n layer.visibility = \"visible\";\r\n }\r\n if (displayBlock) {\r\n layer.display = 'block';\r\n }\r\n }\r\n}", "function displayE(){\n document.getElementById(\"easyAssignments\").style.display = \"block\";\n document.getElementById(\"mediumAssignments\").style.display = \"none\";\n}", "set targetDisplay(value) {}", "function displayBlockModalBackdrop(){\n modal.style.display = 'block';\n backdrop.style.display = 'block';\n}", "function show_element(id){\n // Gettting id element\n var el = document.getElementById(id); //el variable defintion\n el.style.display = \"block\"; //set el's display attribute to block\n}", "function toggleFieldsDisplay(display){\n timeCount.hidden = display;\n relToCount.hidden = display;\n sameOptions.hidden = !display;\n}", "function changeDisplay () {\n $(\"#image\").css ( \"display\", \"inline\" ) ;\n $(\"#changeImageBtn\").css ( \"display\", \"none\" ) ;\n}", "function div_show(id) {\n document.getElementById(id).style.display = \"block\";\n}" ]
[ "0.7203623", "0.71264344", "0.6980471", "0.6881702", "0.6839586", "0.67749333", "0.67154014", "0.6683998", "0.6664107", "0.651713", "0.64427143", "0.643328", "0.64257276", "0.6403037", "0.63494706", "0.6311873", "0.62488437", "0.62474126", "0.6219702", "0.6182031", "0.61390233", "0.6137253", "0.6124725", "0.6122226", "0.6103851", "0.6067187", "0.6060214", "0.60521305", "0.6035743", "0.60343754", "0.60082453", "0.5998816", "0.59965384", "0.597791", "0.59712017", "0.59698963", "0.5956008", "0.59473634", "0.5941939", "0.592215", "0.5917471", "0.5910235", "0.58989173", "0.58935654", "0.58889526", "0.58844376", "0.58659047", "0.58647466", "0.58610797", "0.585915", "0.5855494", "0.58447987", "0.58350396", "0.58323455", "0.58168054", "0.58155745", "0.5814796", "0.5814432", "0.58132094", "0.58064604", "0.58059806", "0.5801811", "0.5799928", "0.5792244", "0.5787213", "0.5784839", "0.57834023", "0.57703394", "0.57703394", "0.57703394", "0.5768796", "0.57677364", "0.575491", "0.5751404", "0.57472885", "0.574167", "0.57385796", "0.57373464", "0.5728086", "0.5718894", "0.5708074", "0.5698678", "0.5697842", "0.5692903", "0.568861", "0.5686326", "0.56614697", "0.56533104", "0.565279", "0.5637481", "0.5631114", "0.5611058", "0.56082964", "0.5596435", "0.55903476", "0.55799574", "0.55768436", "0.5573294", "0.556024", "0.5558863" ]
0.5807244
59
Function to change display property to none.
function hide(Id){ document.getElementById(Id).style.display = "none"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unhideDisplay() {\n let displayBox = document.getElementById('display-box');\n if (displayBox.classList.contains('hidden')) {\n displayBox.classList.remove('hidden');\n displayBox.classList.add('visible');\n }\n}", "function changeDisplay(){\n magicElement.style.display = \"none\";\n}", "function hide(){\r\n // change display style from block to none\r\n details.style.display='none';\r\n}", "hide() {\n\t\tthis.style.display = \"none\";\n\t}", "function hide(id){\n document.getElementById(id).style.display = \"None\"; \n }", "hide (element){\n element.style.display = \"none\";\n }", "function toggleDisplayNone(id){ \n document.getElementById(id).style.display = 'none';\n}", "function showElement(element) {\n element.style.display = \"\";\n}", "hide() {\n if (this.div) {\n // The visibility property must be a string enclosed in quotes.\n this.div.style.visibility = \"hidden\";\n }\n }", "function unhide(x){\n\t\tdocument.getElementById(x).style.display=\"inline-block\";\n\t}", "static hide(obj) {\n obj.setAttribute('visibility', 'hidden');\n }", "hide() {\n this.elem.classList.add(\"hiding\");\n setTimeout(() => this.elem.classList.add(\"noDisplay\"), 184);\n this.isHidden = true;\n }", "static hide(obj) {\n obj.setAttribute('visibility', 'hidden');\n }", "hide() {\n if (this.div) {\n // The visibility property must be a string enclosed in quotes.\n this.div.style.visibility = 'hidden';\n }\n }", "function hideDisplay(element) {\r\n element.classList.remove(\"visible\");\r\n element.classList.add(\"hidden\");\r\n}", "function show(el) {\n\t\tel.style.display = '';\n\t}", "hide() {\n this.isVisible = false;\n }", "function hide(element) {\n element.style.display = \"none\";\n}", "function displayNone() {\n document.getElementById(\"introduksjon\").style.display = \"none\";\n document.getElementById(\"oversikt\").style.display = \"none\";\n document.getElementById(\"detaljer\").style.display = \"none\";\n document.getElementById(\"sammenligning\").style.display = \"none\";\n}", "function displaytotrue(element) {\n\telement.removeClass(\"displaynone\");\n}", "function toggleVisible() {\n setVisible(false)\n\n }", "function hide(event) { event.target.style.visibility = \"hidden\"; }", "function hideElement(element) { \n // set display of \"element\" to \"none\".\n element.style.display = \"none\";\n}", "function toggleDisplay(el) {\n el.classList.toggle('displayNone');\n}", "function hideElement(element) {\n element.style.display = \"none\";\n}", "hide() {\n checkPresent(this.containerDiv, 'not present when hiding');\n // The visibility property must be a string enclosed in quotes.\n this.containerDiv.style.visibility = 'hidden';\n }", "static hide(v) {\n // Set style to none\n UI.find(v).setAttribute(\"hidden\", \"true\");\n }", "function displayNone(whichBlock) {\r\n\tdocument.getElementById(whichBlock).style.display='none';\r\n}", "hide(){\r\n this.containerElement.style.display=\"none\";\r\n }", "function hide(el) {\n\t\tel.style.display = 'none';\n\t}", "function myFunction() {\n document.getElementById(\"sample\").style.display = \"none\";\n\n}", "function show() {\n $.forEach(this.elements, function(element) {\n element.style.display = '';\n });\n\n return this;\n }", "hide() {\n this.setState({display: false})\n }", "function hide(elem)\n{\n\telem.style.visibility= 'hidden';\n}", "static toggleDisplay(element, display) {\n element.style.display === 'none'\n ? (element.style.display = display)\n : (element.style.display = 'none');\n }", "function display(id){\n\tdocument.getElementById(id).classList.remove(\"hide\"); \t\n}", "hide() {}", "function display(element) {\r\n let x;\r\n x = document.getElementById(element);\r\n if (x.hidden === true) {\r\n x.hidden = false\r\n } else {\r\n x.hidden = true\r\n }\r\n}", "function hide(elem) {\n document.getElementById(elem).style.display = 'none';\n}", "function xHide(e){return xVisibility(e,0);}", "function displayNone(gtp) {\n gtp.style.display = \"none\";\n}", "function div_hide(){\n document.getElementById('abc').style.display = \"none\";\n}", "function hide(element) {\n\n\tvar e = document.getElementById(element);\n\tif (e.style.display.valueOf() == \"none\".valueOf()) {\n\t\te.style.display = \"block\";\n\t}\n\telse e.style.display = \"none\";\n}", "hide() {\n ELEM.setStyle(this.elemId, 'visibility', 'hidden', true);\n this.isHidden = true;\n return this;\n }", "function div_hide(){ \ndocument.getElementById('abc').style.display = \"none\";\n}", "hide() {\n if (this[$visible]) {\n this[$visible] = false;\n this[$updateVisibility]({ notify: true });\n }\n }", "function disappear(element) {\n $(element).css({ 'display': 'none' });\n }", "function div_hide(){\ndocument.getElementById('abc').style.display = \"none\";\n}", "function div_hide(){\ndocument.getElementById('abc').style.display = \"none\";\n}", "function div_hide(){\ndocument.getElementById('abc').style.display = \"none\";\n}", "function div_hide(){\ndocument.getElementById('abc').style.display = \"none\";\n}", "function div_hide(){\r\ndocument.getElementById('abc').style.display = \"none\";\r\n}", "function div_hide(){\r\ndocument.getElementById('abc').style.display = \"none\";\r\n}", "function hide_educational()\n{\n change_educational('none', 'block')\n}", "function hide(id){\n document.getElementById(id).style.display = 'none';\n}", "hide ()\n\t{\n\t\t//hide the elements of the view\n\t\tthis.root.style.display= 'none';\n\t}", "doHidden( root ) {\n root.style.display = 'none';\n }", "hide(ele) {\n // make sure ele is a DOM element\n // we do this by checking if it has a display style property\n if (ele && typeof ele.style.display === 'string') {\n ele.style.display = 'none';\n } else {\n console.error('Error while trying to hide a non DOM object');\n }\n }", "function show(Seccion){\n//alert(Seccion);\ndocument.getElementById(Seccion).style.display=\"\";\n}", "function hide(id){\n document.getElementById(id).style.display=\"none\";\n}", "function hideElement(e) {\n e.style.display = \"none\";\n }", "function show(element) {\n element.classList.remove('hidden');\n }", "function div_hide() {\n\tdocument.getElementById('abc').style.display = \"none\";\n}", "function div_hide(){\r\n\tdocument.getElementById('abc').style.display = \"none\";\r\n}", "function hide(x){\n\t\tdocument.getElementById(x).style.display=\"none\";\n\t}", "function hide() {\n $.forEach(this.elements, function(element) {\n element.style.display = 'none';\n });\n\n return this;\n }", "hide() {\n\t\t\tif ( this._container ) {\n\t\t\t\tthis._container.style = 'display:none';\n\t\t\t}\n\t\t}", "function hide(id) {\r\n document.getElementById(id).style.display = \"none\";\r\n}", "function hide() {\n toogle = 'hide'\n\n }", "function hide(objID, flagHide) {\n getObj(objID).style.display = (flagHide ? \"none\" : \"\");\n}", "hide () {\n this.showing = false\n this.element ? this.element.update(this) : null\n }", "function hide(id) {\r\n document.getElementById(id).style.display = 'none';\r\n}", "function hide(element) {\n $(element).css({ 'opacity': '0' });\n }", "isHidden() {\n return false;\n }", "function myFunction() {\n var x = document.getElementById(\"myDIV\");\n\n if (x.style.display === \"block\") {\n x.style.display = \"none\";\n } else {\n x.style.display = \"block\";\n }\n}", "function toggle_display(elem) {\n if (elem.css('display') === 'none') {\n elem.css('display', 'block');\n } else {\n elem.css('display', 'none');\n }\n}", "function unhideControls() {\n\tdocument.querySelector('.hidden').style.visibility = 'visible';\n}", "function hideElement(element) {\n element.css('visibility', 'hidden');\n}", "_hide() {\n this.adContainer.style.margin = '0';\n this.adContainer.style.padding = '0';\n this.adContainer.style.opacity = '0';\n setTimeout(() => {\n this.adContainer.style.display = 'none';\n }, this.containerTransitionSpeed);\n }", "function changeVisibility() {\n magic.style.visibility = 'hidden';\n magic.style.display = 'block;';\n}", "hide({ state }) {\n state.visable = false;\n }", "function show(elementId) {\n getStyleReference(elementId).display=\"\";\n}", "ocultarElemento(elemento) {\n document.getElementById(elemento).style.display = \"none\";\n }", "toggleHidden() {\n if (this.isHidden) this.show();\n else this.hide();\n }", "function hideElement() {\n header.setAttribute(\"style\", \"visibility: hidden\");\n text.setAttribute(\"style\", \"visibility: hidden\");\n startBtn.setAttribute(\"style\", \"visibility: hidden\");\n}", "function displayNoneList() {\n document.querySelector('ul').style.display = \"none\";\n}", "function hide() {\n\n document.querySelector(\".popup\").style.display = 'none'\n}", "function TurnoffDisplay(){\n\tdocument.getElementById(\"D4\").style.display = \"none\";\n\tdocument.getElementById(\"D6\").style.display = \"none\";\n\tdocument.getElementById(\"D8\").style.display = \"none\";\n\tdocument.getElementById(\"D10\").style.display = \"none\";\n\tdocument.getElementById(\"D12\").style.display = \"none\";\n\tdocument.getElementById(\"D20\").style.display = \"none\";\n}", "function hide() {\n canvas.style.display = \"none\";\n // eval(element + \".style.display='none'\");\n}", "function hideElement(id) {\n document.getElementById(id).style.display = \"none\";\n}", "function signDisplayNoneBadFunctionChangeThis() {\n store.dispatch({\n type: \"SHOW_SIGN\",\n payload: {\n display: \"none\"\n }\n });\n }", "function toggleMovementDisplay() {\n\tisHidden.style.display = 'block';\n}", "function toggleDisplay( obj ){\r\n\t\t\t\r\n\t\t\tif( obj.style.display == \"none\" ){\r\n\t\t\t\tobj.style.display = \"block\";\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tobj.style.display = \"none\";\r\n\t\t\t}\r\n\t\t}", "function hide() {\n document.querySelector(\".popup\").style.display = 'none'\n}", "showHide () {\r\n this.setState({ display: this.state.display==='none'?'inline-block':'none' });\r\n }", "function HideWithoutDisplayNone(elementClass, hide) {\n var hiddenMargin = GetNumber(document.getElementsByClassName(elementClass)[0].style.marginLeft, \"px\") + (hide ? -9999 : 9999);\n document.getElementsByClassName(elementClass)[0].style.marginLeft = hiddenMargin.toString() + \"px\";\n}", "function showHide(elementId){\r\n document.querySelector(elementId).style.display = (document.querySelector(elementId).style.display === \"block\") ? \"none\": \"block\";\r\n}", "function noDisplay() {\n _displaycontrol &= ~LCD_DISPLAYON;\n command(LCD_DISPLAYCONTROL | _displaycontrol);\n}", "hide() {\n\t\tthis.isVisible = false;\n this.element.classList.remove('hide')\n\t\tthis.element.classList.remove('showCarousel')\n\t\tthis.element.classList.add('hideCarousel')\n\t\tthis.buttons.style.paddingTop = \"72px\"\n\t\t\n\t}", "toggleVisible() {\n if (this.visible) {\n this.visible = false;\n // this.element.setAttribute('style', 'display: none;');\n this.element.style.display = 'none';\n } else {\n this.visible = true;\n this.element.style.display = 'block';\n }\n }" ]
[ "0.76511157", "0.76501465", "0.7542399", "0.7436947", "0.74233377", "0.7393006", "0.7328397", "0.73199", "0.7318435", "0.7304065", "0.7285749", "0.7276396", "0.7251577", "0.7237432", "0.72302514", "0.7226134", "0.71338814", "0.709168", "0.7089854", "0.7067657", "0.70622826", "0.701603", "0.7015926", "0.700765", "0.69981605", "0.6989377", "0.69751334", "0.6970883", "0.69548005", "0.6953419", "0.69485474", "0.69249505", "0.6909514", "0.6904723", "0.6903332", "0.6900989", "0.6898604", "0.68828726", "0.6877732", "0.6862179", "0.6840585", "0.6818769", "0.68169785", "0.6795114", "0.6789856", "0.67771417", "0.67677844", "0.6767301", "0.6767301", "0.6767301", "0.6767301", "0.6762951", "0.6762951", "0.67623746", "0.676234", "0.6762295", "0.67535037", "0.6746209", "0.67216265", "0.6718402", "0.67161816", "0.67154485", "0.67128426", "0.6712376", "0.6711132", "0.6705419", "0.66960526", "0.6693012", "0.66812605", "0.66801447", "0.6672676", "0.6667986", "0.6662027", "0.66599256", "0.66432273", "0.66332155", "0.66293275", "0.662929", "0.66286135", "0.66260815", "0.66232497", "0.6619791", "0.66180265", "0.6614689", "0.6611154", "0.6606815", "0.6604739", "0.66000354", "0.65915173", "0.65870607", "0.6574868", "0.65623915", "0.6561184", "0.6559342", "0.65592307", "0.65582", "0.65566105", "0.6556587", "0.6549498", "0.6548829" ]
0.68724287
39
TODO: merged with shared/utility
function getUrlBaseByWiki(wiki) { let wikiToLang = { 'enwiki': 'en', 'frwiki': 'fr', 'ruwiki': 'ru' }; return `https://${wikiToLang[wiki]}.wikipedia.org`; // Require HTTPS to conduct the write edits }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "function Util() {}", "function Utils() {}", "function Utils() {}", "static private internal function m121() {}", "function DWRUtil() { }", "function AeUtil() {}", "function Utils(){}", "static final private internal function m106() {}", "transient private protected internal function m182() {}", "function _____SHARED_functions_____(){}", "transient protected internal function m189() {}", "function FunctionUtils() {}", "static private protected internal function m118() {}", "transient private internal function m185() {}", "function Utils() {\n}", "function Helper() {}", "static transient final private internal function m43() {}", "transient final protected internal function m174() {}", "static transient private protected internal function m55() {}", "static transient final protected internal function m47() {}", "expected( _utils ) {\n\t\t\treturn 'nothing';\n\t\t}", "function AppUtils() {}", "function __it() {}", "static transient final protected public internal function m46() {}", "transient private protected public internal function m181() {}", "static protected internal function m125() {}", "function CCUtility() {}", "static transient final private protected internal function m40() {}", "function Common() {}", "transient final private protected internal function m167() {}", "static transform() {}", "expected(_utils) {\n return 'nothing';\n }", "static transient private internal function m58() {}", "function find() {}", "function TMP(){return;}", "function TMP(){return;}", "obtain(){}", "function ArrayUtils() {}", "function Kutility() {\n\n}", "function Kutility() {\n\n}", "transient final private internal function m170() {}", "function Common(){}", "static private protected public internal function m117() {}", "function WebIdUtils () {\n}", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "static final private protected internal function m103() {}", "function SigV4Utils() { }", "static transient private protected public internal function m54() {}", "static transient private public function m56() {}", "static transient final protected function m44() {}", "function TMP() {\n return;\n }", "function TMP(){}", "function TMP(){}", "static final protected internal function m110() {}", "static final private public function m104() {}", "apply () {}", "function baseLodash() {}", "function baseLodash() {}", "function baseLodash() {}", "function baseLodash() {}", "function baseLodash() {}", "static transient final private protected public internal function m39() {}", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "static final private protected public internal function m102() {}", "static private public function m119() {}", "lastUsed() { }", "transient private public function m183() {}", "__previnit(){}", "function lt(t,i){return t(i={exports:{}},i.exports),i.exports}", "function StaticMerger() {}", "function SelectionUtil() {\n}", "prep(src) {\n\n // console.log('Before -----> \\n', src)\n\n let h = this.src.use_for[0] // TODO: add props here\n src = '\\t\\t let _pref = `${_id}<-'+h+'<-`\\n' + src\n\n FDEFS2.lastIndex = 0\n let call_id = 0 // Function call id (to make each call unique)\n\n do {\n var m = FDEFS2.exec(src)\n if (m) {\n let fkeyword = m[1].trim()\n let fname = m[2]\n let fargs = m[3]\n\n if (fkeyword === 'function') {\n // TODO: add _ids to inline functions\n } else {\n let off = m.index + m[0].indexOf('(')\n if (this.std[fname]) {\n src = this.postfix(src, m, ++call_id)\n //console.log(src)\n off+=4 // 'std_'\n }\n // Quick fix\n FDEFS2.lastIndex = off\n }\n }\n } while (m)\n\n // console.log('After ----->\\n', u.wrap_idxs(src))\n\n return u.wrap_idxs(src, 'std_')\n }", "function findCanonicalReferences() {\n\n }", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function baseLodash(){}", "static transient final private public function m41() {}", "function GraFlicUtil(paramz){\n\t\n}" ]
[ "0.62332857", "0.6130339", "0.60473686", "0.5988378", "0.59165514", "0.59165514", "0.5818622", "0.5816386", "0.5751232", "0.57047033", "0.5669725", "0.5547224", "0.5542425", "0.54218125", "0.54182494", "0.5330503", "0.531148", "0.52895176", "0.5258833", "0.5253092", "0.5225475", "0.52046937", "0.5180822", "0.5158351", "0.5111171", "0.510117", "0.5065091", "0.5054727", "0.4990666", "0.4982018", "0.49479836", "0.49408382", "0.48991996", "0.48811015", "0.48810515", "0.48675773", "0.48645478", "0.4842081", "0.4842081", "0.48253897", "0.48176086", "0.4805205", "0.4805205", "0.4803281", "0.48027152", "0.47918478", "0.4789631", "0.4779139", "0.4779139", "0.4779139", "0.4779139", "0.4779139", "0.4779139", "0.4779139", "0.4779139", "0.47783715", "0.47751033", "0.4773513", "0.47494304", "0.4726079", "0.4725497", "0.4722974", "0.4722974", "0.47019917", "0.46820387", "0.46628198", "0.46591473", "0.46591473", "0.46591473", "0.46591473", "0.46591473", "0.46365035", "0.46155527", "0.46155527", "0.46155527", "0.4615242", "0.46127295", "0.4607359", "0.4599182", "0.45988652", "0.45942876", "0.4569922", "0.4564268", "0.45605972", "0.45437866", "0.45324057", "0.45324057", "0.45324057", "0.45324057", "0.45324057", "0.45324057", "0.45324057", "0.45324057", "0.45324057", "0.45324057", "0.45324057", "0.45324057", "0.45324057", "0.45233735", "0.4518121", "0.45174184" ]
0.0
-1
function to create list elements from the photo array
createPhotoComps(photos) { let photoComps = []; for (let i=0; i<photos.length-1; i++) { photoComps.push( <Photo url={photos[i]} key={i} />) ; } if (photoComps.length>0) { return(photoComps) } else { return(['noRes']) } ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createListItemsWithImagesDOM() {\n\n // Takes the images Array and creates DOM elements\n for (var i = 0; i < images.length; i++) {\n var newList = document.createElement('li');\n var newImg = document.createElement('img');\n newImg.src = images[i];\n newList.appendChild(newImg);\n\n gallery.appendChild(newList);\n }\n}", "function buildPhotoArray(dataTest) {\n var photos = []\n // Extract photos property of each object and store as array\n var photosToCheck = dataTest.map(x => x.photos);\n\n for (var i = 0; i < photosToCheck.length; i++) {\n // Check if a picture exists.\n if (photosToCheck[i] == undefined || photosToCheck[i].small == undefined) {\n photos.push(\"pet_icons/pawIcon.png\");\n }\n else {\n photos.push(photosToCheck[i].small);\n }\n } // close for loop\n return photos;\n} // close function declaration", "CreateListElementsIMG(dataArray, imgFomart) {\n for(let i = 0; i < dataArray.length; i++) {\n this.m_Output += \"<div class='col'><div><img class='w_icon' src='\" + this.m_ThumbnailsLocation + dataArray[i].icon + \".\" + imgFomart + \"' alt='\" + dataArray[i].name + \" icon'><p>\" + dataArray[i].name + \"</p></div></div>\";\n }\n }", "function makeGallery(imageArray){\n\n\t}", "function injectArray() {\n const imgArray2 = ['images/onigiri_1.png', 'images/onigiri_2.png', 'images/onigiri_3.png', 'images/onigiri_4.png', \n 'images/roll_1.png', 'images/roll_2.png', 'images/roll_3.png'];\n\n // Add a <li> element with image HTML for each index of the array\n const addList = imgArray2.map(element => {\n const listItem = document.createElement('li');\n listItem.innerHTML = '<img src=' + element + '>';\n target.append(listItem);\n })\n}", "function addPhotos() {\n var photoContainerTmpl = _.template($('#photoContainerTmpl').html());\n var photoTmpl = _.template($('#photoTmpl').html());\n var photoStr = \"\";\n albums.forEach(function(el) {\n photoStr += photoContainerTmpl(el);\n\n el.photos.forEach(function (item) {\n photoStr += \"<li>\"\n + \"<a href='' >\"\n + \"<div class='photo-wrapper'>\"\n + \"<img src='\" + item.url + \"' + rel='\" + item.rel + \"' />\"\n + \"<h3>\" + item.name + \"</h3>\"\n + \"</div>\"\n + \"</a>\"\n + \"</li>\";\n })\n photoStr += \"</ul>\"\n photoStr += \"</div>\"\n });\n $('.right-col').append(photoStr);\n}", "function obj_list(flat_array) {\n var new_obj = [];\n var len = flat_array.length;\n for(var i = 0; i < len; i += 4) {\n new_obj.push(new Pixel(\n flat_array[i],\n flat_array[i + 1],\n flat_array[i + 2],\n flat_array[i + 3]\n ));\n }\n\n return new_obj\n}", "function createItem(img){\n componentList.push( \n {\n original: img[\"sourcejpg\"],\n thumbnail: img[\"sourcejpg\"]\n }\n )\n }", "function addImages(imageList) {\n for (i = 10; i < 61; i++){\nimageList.push(\"pdxcg_\"+i+\".jpg\");\n }\n imageList.splice(0, 1);\n for (x = 1; x < 10; x++) {\n imageList.push(\"pdxcg_0\"+x+\".jpg\");\n }\n return imageList;\n}", "function createImageList(array, divId)\n{\n \n var listDiv = document.getElementById(divId);\n\n\n for(var i=0; i<array.length; i++)\n { \n var des = document.createTextNode(array[i].catName);\t\t \n var img = document.createElement(\"img\");\n img.src = array[i].imageUrl;\n img.addClass(\"deviceImage\");\n\n var div = document.createElement(\"div\");\n div.addClass(\"draggable\");\n\n div.appendChild(img); \n div.appendChild(des);\n div.id = array[i].catName;\n listDiv.appendChild(div);\n }\n}", "function photoModel() {\n return `\n \n ${photoData.map(photo =>\n `\n <div class=\"mySlides\">\n <div class=\"numbertext\">${photo.slide} / ${count = Object.keys(photoData).length}</div>\n <img src=\"${photo.photoUrl}\" style=\"width:100% \">\n </div>\n `\n ).join('')}`\n\n\n\n }", "function generateBrowserStructure() {\n\t\tif(photos.length > 0) {\n\t\t\tphotoElem.innerHTML = formatIMGURL(photos[0]);\n\n\t\t\tvar ulElem = document.createElement(\"ul\");\n\t\t\tphotos.forEach(function(currPhoto) {\n\t\t\t\tvar liElem = document.createElement(\"li\");\n\t\t\t\tvar aElem = document.createElement(\"a\");\n\t\t\t\taElem.innerHTML = formatIMGURL(currPhoto);\n\t\t\t\taElem.setAttribute(\"href\", \"#\");\n\t\t\t\taElem.onclick = function() {\n\t\t\t\t\tphotoElem.innerHTML = formatIMGURL(currPhoto);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tliElem.appendChild(aElem);\n\t\t\t\tulElem.appendChild(liElem);\n\t\t\t});\n\t\t\tlistElem.appendChild(ulElem);\n\t\t} else {\n\t\t\tpictureElem.innerHTML = \"<p>No images were found!</p>\";\n\t\t}\n\t}", "function produceListOfImgNamesARRAY() {\n\n for(var imgNum = 1; imgNum < imgMax + 1; imgNum++) {\n\n // Images 1 .. 9 need a different URL structure\n if (imgNum < 10) {\n images.push(\"/../../static/images/pdxcg_0\" + imgNum + \".jpg\");\n } else {\n // Images 10 .. 60 need a different URL structure\n images.push(\"/../../static/images/pdxcg_\" + imgNum + \".jpg\");\n }\n }\n // console.log(images);\n}", "function list(){\n for(var i = 1; i<=imgCount; i++)\n {\n images[i] = \"galleri/\" + dir + \"/medium-\" + i + \".jpg\";\n }\n}", "function PhotoList() {\n\tthis.list = []; // new Set();\n\n\tthis.selection = new Set();\n}", "function addImg() {\n for (let i = 0; i < infoBooks.length; i++) {\n for (let j = 0; j < foo.length; j++) {\n let img = document.createElement(\"img\");\n img.src = foo[j];\n let lis = document.querySelectorAll(\"li\");\n if (lis[i].id === loo[j]) {\n lis[i].appendChild(img);\n }\n }\n }\n}", "function getImageFiles(elem) {\n\tvar pic_set = [];\t\n\tfor (var j = 1; j <= NUM_PICS; j++) {\n\t\tpic_set.push('final-images/' + elem.noun + '_' + elem.order[j-1] + '.png');\n\t\t\t}\n\t\n\n return pic_set;\n}", "function displayPhotos(photosArray) {\n console.log(2);\n console.log(photosArray);\n photosArray.forEach(photo => {\n console.log(3);\n const item = document.createElement('a');\n // item.setAttribute('href', photo.links.html);\n // item.setAttribute('target', '_blank');\n setAttributes(item, {\n href: photo.links.html,\n target: '_blank'\n });\n const img = document.createElement('img');\n // img.setAttribute('src', photo.urls.regular);\n // img.setAttribute('alt', photo.alt_description);\n // img.setAttribute('title', photo.alt_description);\n setAttributes(img, {\n src:photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description\n });\n // append everything\n item.appendChild(img);\n imgContainer.appendChild(item)\n });\n}", "function displayImageFromArray(value) {\n debugger\n // var imageToBeDisplayed = value.split('_');\n\n var curImage = document.getElementById('showImage');\n var sideThumbnail = []\n\n const array = [\n {\n imageArray: [{ src: '../images/bags/bag5.jpg' },\n { src: '../images/bags/bag6.jpg' },\n { src: '../images/bags/bag7.jpg' },\n { src: '../images/bags/bag8.jpg' }\n ],\n discription: 'discription'\n }, {\n imageArray: [{ src: '../images/bags/bag1.jpg' },\n { src: '../images/bags/bag2.jpg' },\n { src: '../images/bags/bag3.jpg' },\n { src: '../images/bags/bag4.jpg' },\n //{ src: '../images/bags/bag8.jpg' }\n ],\n discription: 'discription1'\n }, {\n imageArray: [{ src: '../images/bags/bag4.jpg' },\n { src: '../images/bags/bag5.jpg' },\n { src: '../images/bags/bag5.jpg' },\n //{ src: '../images/bags/bag5.jpg' },\n // { src: '../images/bags/bag5.jpg' }\n ],\n discription: 'discription2'\n }, {\n imageArray: [{ src: '../images/bags/bag2.jpg' },\n { src: '../images/bags/bag5.jpg' },\n { src: '../images/bags/bag5.jpg' },\n { src: '../images/bags/bag5.jpg' },\n { src: '../images/bags/bag5.jpg' }\n ],\n discription: 'discription3'\n },\n {\n imageArray: [{ src: '../images/bags/bag5.jpg' },\n { src: '../images/bags/bag5.jpg' },\n { src: '../images/bags/bag5.jpg' },\n { src: '../images/bags/bag5.jpg' },\n { src: '../images/bags/bag5.jpg' }\n ],\n discription: 'discription4'\n }]\n if (array.length < value) {\n alert('no record found')\n } else {\n for (i = 0; i < 5; i++) {\n if (value == i) {\n document.getElementById('discription').innerHTML = array[i].discription;\n\n array[i].imageArray.forEach(function (element, elementIndex) {\n sideThumbnail.push(element)\n console.log(sideThumbnail)\n var j=1;\n sideThumbnail.forEach(function (sideElement, sideElementIndex) {\n // document.getElementById('image' + i).src = sideElement.src;\n \n document.getElementById('image'+j).setAttribute(\"src\" ,sideElement.src);\n j++;\n\n if (sideElementIndex == 0) {\n /*document.getElementById('image1').src = sideElement.src*/\n document.getElementById('showImage').src = sideElement.src\n } /*else if (sideElementIndex == 1) {\n document.getElementById('image2').src = sideElement.src\n } else if (sideElementIndex == 2) {\n document.getElementById('image3').src = sideElement.src\n } else if (sideElementIndex == 3) {\n document.getElementById('image1').src = sideElement.src\n } else if (sideElementIndex == 4) {\n document.getElementById('image5').src = sideElement.src\n } else {\n alert('no record found')\n }*/\n })\n if(array[i].imageArray.length < 5) {\n for(i=array[i].imageArray.length;i<5;i++){\n \n document.getElementById('image'+i).style.display = \"none\";\n \n \n }\n \n }else{\n for(i=1;i<5;i++){\n \n document.getElementById('image'+i).style.display = \"block\";\n \n \n }\n }\n \n\n });\n }\n }\n }\n\n\n\n curImage.src = array[0].imageArray[0].src\n // for (i = 1; i < 5; i++) {\n // document.getElementById('image' + i).src = array[0].imageArray[i - 1].src;\n // document.getElementById('discription').innerHTML = array[0].discription;\n // }\n /*document.getElementById('image2').src = array[imageToBeDisplayed[1]-1].imageArray[1].src\n document.getElementById('image3').src = array[imageToBeDisplayed[1]-1].imageArray[2].src\n document.getElementById('image4').src = array[imageToBeDisplayed[1]-1].imageArray[3].src\n document.getElementById('discription').innerHTML = array[0].discription\n*/\n array.forEach(function (element, elementIndex) {\n console.log(element)\n });\n\n\n\n\n}", "function displayPhotos() {\n // Run the function for each object in photosArray\n photosArray.forEach((photo) => {\n // Create <a> to link to Unsplash\n const item = document.createElement(\"a\");\n setAttributes(item, {\n href: photo.links.html,\n blank: \"_blank\",\n });\n // Create <img> for photo\n const img = document.createElement(\"img\");\n setAttributes(img, {\n src: photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description,\n });\n // Put <img> inside <a> , then put both inside imageContainer ELement\n item.appendChild(img);\n imageContainer.appendChild(item);\n });\n}", "function annotatePhotos(photos, tag) {\n return _.map(photos, function(photo) {\n return { photo: photo, tag: tag };\n });\n }", "function handlePhotos(photos) {\n \n let content = document.querySelector('.errorMsgBox');\n content.innerHTML = \"\";\n\n let ul = document.querySelector('.photolist');\n\n const fragment = document.createDocumentFragment();\n\n photos['photos']['photo'].forEach(photo => {\n var farmId = photo['farm'];\n var serverId = photo['server'];\n var id = photo['id'];\n var secret = photo['secret'];\n var owner = photo['ownername'];\n\n var ownerUrl = 'https://www.flickr.com/photos/' + photo['owner'];\n var photoUrl = `https://farm${farmId}.staticflickr.com/${serverId}/${id}_${secret}.jpg`\n\n const li = document.createElement('li');\n const a = document.createElement('a');\n const img = document.createElement('img');\n const p = document.createElement('p');\n\n p.innerHTML = 'Uploaded by: ' + owner;\n a.href = ownerUrl;\n a.target = '_blank';\n img.setAttribute(\"src\", photoUrl);\n img.setAttribute(\"class\", \"img-animation\");\n li.setAttribute(\"class\", \"photo\");\n li.appendChild(p);\n li.appendChild(a);\n a.appendChild(img)\n fragment.appendChild(li);\n });\n ul.innerHTML = \"\";\n ul.appendChild(fragment);\n \n}", "function organizeImageList () {\n\n for (let i = 0; i < imageLinks.length; i++){\n //Get every image's information\n const imgSrc = imageLinks[i].querySelector('img').src.slice(-13);\n const imgTitle = imageLinks[i].querySelector('img').title;\n const imgCaption = imageLinks[i].getAttribute('data-caption');\n\n //Create an image object\n const image = {\n src: imgSrc,\n title: imgTitle,\n caption: imgCaption\n };\n //Add image to the new array images\n images.push(image);\n }\n}", "createImages() {\n var html = `\n <ul class=\"image-list\">\n ${this._images.map(image => `\n <li class=\"item\" style=\"background-image:url(${image})\" id=\"${image}\">\n </li>`).join('\\n')}\n </ul>\n `;\n\n this.render(html);\n }", "function pullInfo(){\n for(var i = 0 ; i < imageObjects.length; i++){\n lablesArr.push(imageObjects[i].alt);\n clicksArr.push(imageObjects[i].clicks);\n looksArr.push(imageObjects[i].looks);\n }\n}", "function buildList(val) {\n let liItems = \"\";\n let arrImgInd = [];\n\n //set container style width\n setContainerWidth(val);\n\n //create array with same pair indexes\n createIndForImg(val, arrImgInd);\n\n //shuffle indexes in array\n shuffle(arrImgInd);\n\n for (let i = 0; i < arrImgInd.length; i++) {\n liItems += `\n\t\t\t<li class=\"card-list-container rotateBack\">\n\t\t\t\t<div class=\"card-list-item\">\n\t\t\t\t\t<div class=\"card-list-front rotate-back\">Click me ${i}</div>\n <div class=\"rotate-backside-back\" data-value=${arrImgInd[i]}>\n <img src=\"images/${arrImgInd[i]}.png\">\n </div>\n\t\t\t\t</div>\n\t\t\t</li>`;\n }\n\n ul.innerHTML = liItems;\n }", "function displayPhotos() {\n // Run function for each object in photoArray\n photoArray.forEach((photo) => {\n // create <a> to link to unsplash\n const div = document.createElement('div');\n div.setAttribute('class', 'image-box');\n\n const item = document.createElement('a');\n setAttributes(item, {\n href: photo.links.html,\n target: '_blank',\n });\n // create <img> for photo\n const img = document.createElement('img');\n setAttributes(img, {\n src: photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description,\n });\n // Put image <img> in <a>, then put both inside imageContainer Element\n div.appendChild(item);\n item.appendChild(img);\n imageContainer.appendChild(div);\n });\n}", "function getPic(){\n $.ajax({\n url:MoonduDomain+'/photo/GetPhotoByTag',\n type:\"GET\",\n dataType:\"jsonp\",\n data:{uid:showUid,tag:showTag},\n success: function(data){ \n data=data.Data.Rows;\n console.log(data);\n for(i=0;i<data.length;i++){\n showPhoto.push(data[i].Photo);\n } \n console.log(showPhoto); \n var picList=\"\";\n for(i=0;i<3;i++){\n picList+='<img src=\"'+showPhoto[i]+'\">' \n $(\".show_box\").find(\".picLsit\").append($(picList));\n } \n }\n })\n}", "function createGalleryItems(galleryArrayOfItems) {\n return galleryArrayOfItems\n .map(({ preview, original, description }) => {\n return `\n <li class=\"gallery__item\">\n <a class=\"gallery__link\"\n href=\"${original}\">\n <img\n class=\"gallery__image\"\n src=\"${preview}\"\n data-source=\"${original}\"\n alt=\"${description}\"\n />\n </a>\n</li> `;\n })\n .join(\"\");\n}", "function getImageList() {\n var imageList = [];\n $('#image_list').find('.annotate_image_link').each(function(key, elem) {\n var imageId = parseInt($(elem).data('imageid'));\n if (imageList.indexOf(imageId) === -1) {\n imageList.push(imageId);\n }\n });\n\n return imageList;\n }", "function insertPicture(element, category, list) {\n list[category].push(element)\n}", "function getGallery(obj) {\r\n for (var i = 0; i < obj.length; i++) {\r\n $mainList.append('' +\r\n '<div class=\"gallery\" style=\"background-image: url(http://st.kp.yandex.net/images/film_big/' + obj[i].preview + '.jpg)\">' +\r\n '<a href=\"#\" data-gallery-item=\"http://st.kp.yandex.net/images/' + obj[i].preview + '\">' +\r\n '<img src=\"http://st.kp.yandex.net/images/' + obj[i].preview + '\" alt=\"\">' +\r\n '</a>' +\r\n '</div>' +\r\n '');\r\n }\r\n }", "function displayPhotos() {\n // Run function for each object in photosArray\n photosArray.forEach(\n (photo) => {\n // Create <a> that link to Unsplash\n const imageLink = document.createElement('a');\n setAttributes(imageLink, {\n 'href': photo.links.html,\n 'target': '_black',\n });\n // Create <img> for photo\n const image = document.createElement('img');\n setAttributes(image, {\n 'src': photo.urls.regular,\n 'alt': photo.alt_desciption,\n 'title': photo.alt_description,\n });\n // Put <img> inside <a>, then put both inside imageContainer element\n imageLink.appendChild(image);\n imageContainer.appendChild(imageLink);\n }\n )\n}", "function getImages(photos) {\r\n function clickHandler(index, photos) {\r\n return function (event) {\r\n event.preventDefault();\r\n\r\n gallery.showPhoto(index, photos);\r\n };\r\n }\r\n var container = document.getElementsByClassName('thumbnails__list')[0];\r\n container.textContent = '';\r\n var image, link, listItem;\r\n for (var i = 0; i < photos.length; i++) {\r\n image = document.createElement('img');\r\n image.src = 'https://farm' + photos[i].farm + '.staticflickr.com/' + photos[i].server +\r\n '/' + photos[i].id + '_' + photos[i].secret + '_q.jpg';\r\n image.className = 'thumbnail';\r\n image.alt = photos[i].title;\r\n image.title = photos[i].title;\r\n\r\n link = document.createElement('a');\r\n link.href = image.src;\r\n link.addEventListener('click', clickHandler(i, photos));\r\n link.appendChild(image);\r\n\r\n listItem = document.createElement('li');\r\n listItem.appendChild(link);\r\n\r\n container.appendChild(listItem);\r\n }\r\n document.getElementById('thumbnails').style.display = \"block\";\r\n \r\n }", "function getImage(pickATheme, makeSubList){\n var imageLi = document.createElement('li'); \n \tmakeSubList.appendChild(imageLi);\n var newImg = document.createElement('img');\n var setSrc = newImg.setAttribute(\"src\", \"images/\" + pickATheme + \".png\");\n \timageLi.appendChild(newImg);\n }", "function parseImage(items) {\n var curr_data = [];\n items.forEach(function (element, index, array) {\n console.log(element.media_key.S);\n getImage(element.media_key.S).then((img) => {\n curr_data.push(img);\n if (curr_data.length == items.length) {\n displayImages(curr_data);\n }\n })\n })\n }", "function buildArray() {\n for(var x = 1; x < 9; x++) {\n tiles.push(x + '.jpg');\n }\n tiles = tiles.concat(tiles);\n}", "function displayPhotos() {\n totalImages = photosArray.length;\n /* runs function for each object in the photosArray */\n photosArray.forEach((photo) => {\n /* <a> for Unsplash */\n const item = document.createElement(\"a\");\n setAttributes(item, {\n href: photo.links.html,\n target: \"_blank\",\n });\n /* Create image for photos */\n const img = document.createElement(\"img\");\n setAttributes(img, {\n src: photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description,\n });\n /* Event listener for finished loading */\n img.addEventListener(\"load\", imageLoad)\n /* puts image inside anchor then both inside imageContainer */\n item.appendChild(img);\n imageContainer.appendChild(item);\n });\n}", "function resolveSingleTag(photo) {\n var prev = null, result = [];\n photo.sort();\n photo.forEach(function(p) {\n if (p != prev) {\n result.push(p);\n prev = p;\n }\n });\n return result;\n }", "function getUserContent(offset) {\n var myClass;\n var shapelist0 = [], shapelist1 = [], shapelist2 = [];\n var shapeArray = [shapelist0, shapelist1, shapelist2];\n for (i = 0 + offset, j = 0; i < shapeArray.length + offset; i++, j++) {\n var target = \"#shapelist\" + i + \" img\";\n console.log(target);\n $(target).each(function () {\n if ($(this).hasClass(\"colorRed\"))\n myClass = \"_red\"\n if ($(this).hasClass(\"colorGreen\"))\n myClass = \"_green\"\n if ($(this).hasClass(\"colorBlue\"))\n myClass = \"_blue\"\n console.log(this.id + myClass);\n shapeArray[j].push(this.id + myClass);\n });\n\n }\n return shapeArray;\n }", "toImages(results) {\n let images = results.map( item => {\n return {\n url: item.url,\n title: item.title,\n linkedBy: [],\n likedBy: []\n };\n });\n return images;\n }", "function createCards (arr) {\n const gallery = document.querySelector('#gallery');\n for (let i = 0; i < arr.length; i++) {\n const domElements = `<div class=\"card view\" id='${i}'>\n <div class=\"card-img-container\">\n <img class=\"card-img\" src=\"${arr[i].picture.large}\" alt=\"profile picture\">\n </div>\n <div class=\"card-info-container\">\n <h3 id=\"name\" class=\"card-name cap\">${arr[i].name.first} ${arr[i].name.last}</h3>\n <p class=\"card-text\">${arr[i].email}</p>\n <p class=\"card-text cap\">${arr[i].location.city}, ${arr[i].location.state}</p>\n </div>\n </div>`;\n gallery.innerHTML += domElements;\n }\n}", "function genImagesFromLightbox() {\n fullImageUrls = []\n // Get all the lightbox thumbs\n var allImages = myJQ(\".lbThumb img,#Photobox_thumbs img,#thumbs img\");\n if (allImages) {\n allImages.each(function(index,value) {\n var imageUrl = imageLargeUrl(value);\n console.log(\"img imageUrl=\" + imageUrl);\n fullImageUrls.push(imageUrl);\n });\n }\n}", "function createImageArray() {\n var imgPick = imageChoice.fileSrc\n randomArray.push(imageChoice);\n availablePhotos.splice(randomImage, 1);\n }", "function displayphotos(){\n imagesLoaded = 0;\n totalImages = photosArray.length;\n console.log('total images = ', totalImages);\n// Run function for each object in photoarray\n photosArray.forEach((photo) => {\n// Create <a> to link to Unsplash\nconst item = document.createElement('a');\nsetAttribute(item,{\n href: photo.links.html,\n target: '_blank',\n});\n//Create <img> for photo\nconst img = document.createElement('img');\nsetAttribute(img,{\nsrc: photo.urls.regular,\nalt: photo.alt_description,\ntitle: photo.alt_description,\n});\nimg.addEventListener('load', imageLoaded);\nitem.appendChild(img);\nimageContainer.appendChild(item);\n});\n}", "function getImages(arrayOfImg){\n let valueToReturn = '';\n for (let i = 0; i < arrayOfImg.length; i++){\n valueToReturn += `<img src=\"${arrayOfImg[i]}\" class=\"results-img\">`;\n }\n return valueToReturn;\n}", "function displayPhoto() {\n imageLoaded = 0;\n // console.log(photoArray);\n totalImages = photoArray.length;\n photoArray.forEach((photo) => {\n const item = document.createElement(\"a\");\n // item.setAttribute('href',photo.links.html)\n // item.setAttribute('target','_blank')\n setAttributes(item, {\n href: photo.links.html,\n target: \"_blank\",\n });\n\n const img = document.createElement(\"img\");\n setAttributes(img, {\n src: photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description,\n });\n // img.setAttribute('src',photo.urls.regular)\n // img.setAttribute('alt',photo.alt_description)\n // img.setAttribute('title',photo.alt_description)\n\n // // put image instde a tag and then put both in img-container elemt\n img.addEventListener(\"load\", imageLoading);\n\n item.appendChild(img);\n imageContainer.appendChild(item);\n });\n}", "function getImage(jobName, makeSubList){\n\t \tvar imageLi = document.createElement(\"li\");\n\t \tmakeSubList.appendChild(imageLi);\n\t \tvar newImg = document.createElement(\"img\");\n\t \tvar setSrc = newImg.setAttribute(\"src\", \"imgages/\"+ jobName + \".png\");\n\t \timageLi.appendChild(newImg);\t \t\n \t}", "getKonvaImages(imageInfoArr, callback) {\n return imageInfoArr.map((info, i) => {\n let {x, y, image} = info;\n return <Image\n key={i}\n image={image}\n y={y}\n x={x}\n draggable={this.props.shouldHandleDrag}\n onDragEnd={this.handleDragEnd.bind(this)}\n />\n })\n }", "getSliderImages()\n {\n const images = [\n { image: slideImg2},\n { image: slideImg4},\n { image: slideImg7},\n { image: slideImg8},\n { image: slideImg7},\n ];\n return images;\n }", "function getCarsImage() {\n //Quantos carros tenho na collecção\n var nCars = hiperCarros.colecao.length;\n var lista = '';\n //Adiciona a primeira imagem de cada carro na minha lista\n for (let index = 0; index < nCars; index++) {\n console.log(hiperCarros.colecao[index].imags[0]);\n lista = lista + '<div class=\"carro-lista\"><img class=\"carro-img\" src=\"../hCarros/' + hiperCarros.colecao[index].imags[0] + '\" />';\n lista = lista + hiperCarros.colecao[index].marcaModelo + ' - ' + hiperCarros.colecao[index].versao + '</div>';\n }\n return lista;\n}", "function displayPhotos(){\n //13 reset imagesLoaded = 0\n imagesLoaded = 0;\n //10 \n totalImages = photosArray.length;\n //Run Function for eache pbject in photosArray\n photosArray.forEach((photo) => {\n //Create <a> to link to Unsplash\n const item = document.createElement('a');\n // item.setAttribute('href' , photo.links.html);\n // item.setAttribute('target' , '_blank');\n setAttributes(item, {\n href: photo.links.html,\n target: '_blank'\n });\n // Create <img> for photos\n const img = document.createElement('img');\n // img.setAttribute('src' , photo.urls.regular);\n // img.setAttribute('alt' , photo.alt_description);\n // img.setAttribute('title' , photo.alt_description);\n setAttributes(img, {\n src: photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description\n });\n //7 Event Listener, Check when each if finished loading\n img.addEventListener('load', imageLoaded);\n // Put <img> inside <a>, then put both inside imageContainer Element\n item.appendChild(img);\n imageContainer.appendChild(item);\n\n });\n}", "function renderGallery(arr) {\n let parentNode = document.querySelector(\".gallery\");\n arr.forEach(item => {\n let childNode = document.createElement(\"img\");\n childNode.src = item;\n childNode.classList.add(\"gallery__item\");\n parentNode.appendChild(childNode);\n // console.log(childNode);\n });\n createMasonry(parentNode);\n}", "function new_photo() {\n\n let new_photo = new Photo();\n\n new_photo.display();\n\n photos.push(new_photo);\n\nconsole.log(new_photo);\nconsole.log(photos);\n\n}", "function fruitShow(){\n var fruit = document.getElementById('fruit-list');\n console.log(fruit);\n for(var i = 0; i < fruitStand.length; i++) {\n var createListEle = fruitStand[i].createLi();\n fruit.appendChild(createListEle);\n var genImg = fruitStand[i].showImage();\n fruit.appendChild(genImg);\n }\n}", "function displayPhotos()\n{\n imageLoad=0;\n totalImages=photosArray.length;\n //Run function for each object in photoArray\n photosArray.forEach((photo)=>{\n const item=document.createElement('a');\n setAttributes(item,{\n href:photo.links.html,\n target:'_blank'});\n //<img> for photo\n const img=document.createElement('img');\n setAttributes(img,{\n src:photo.urls.regular,\n alt:photo.alt_description,\n title:photo.alt_description\n });\n //Event Listener when Each is finish Loading\n img.addEventListener('load',imageLoaded);\n //put img into <a>\n item.appendChild(img);\n imageContainer.appendChild(item);\n });\n\n}", "generateGrid(pictures, numberPerRow = 3) {\n\n let photoGrid = []\n for (let i = 0; i < pictures.length; i += numberPerRow) {\n\n let photoRow = []\n\n for (let columnIndex = 0; columnIndex < numberPerRow && i + columnIndex < pictures.length; columnIndex++) {\n // handle margin right\n if (columnIndex < numberPerRow) {\n photoRow.push(this.generatePicture(pictures[i + columnIndex], i + columnIndex, true))\n } else {\n photoRow.push(this.generatePicture(pictures[i + columnIndex], i + columnIndex, false))\n }\n }\n photoGrid.push(\n <div key={i} className=\"photoRowContainer\">\n {photoRow}\n </div>,\n )\n photoRow = []\n }\n return photoGrid\n }", "function Photos(){\n const [photo, setPhoto] = useState([]);\n useEffect(() => {\n fetch('https://jsonplaceholder.typicode.com/photos')\n .then( res => res.json())\n .then( data => setPhoto(data));\n }, [])\n\n return(\n <div>\n <h1>My all Photo data!</h1>\n <h2>Dynamic Photos: {photo.length}</h2>\n <ul>\n {photo.map(x => <li>{x.thumbnailUrl}</li>)}\n </ul>\n </div>\n )\n\n }", "createUrls(){\n let landmarks=this.state.itinararies.map(e => e.landmarks)\n let urls = [] \n landmarks.map(lm => {return lm.forEach(element => {\n urls.push({src :element.url}) \n })\n })\n console.log(landmarks)\n console.log(urls)\n this.setState({urls})\n }", "function renderData(){\n for (var i = 0; i < imageObjects.length; i++) {\n var dataElement = document.createElement(\"li\");\n console.log(imageObjects[i]);\n dataElement.textContent = `for product: ${imageObjects[i].alt} it has ${imageObjects[i].clicks} clicks and ${imageObjects[i].looks} views`;\n console.log(imageObjects[i]);\n dataParentElement.appendChild(dataElement);\n }\n}", "function generateProfiles(arr) {\n arr.map(person => {\n person =\n `<div class=\"card\">\n <div class=\"card-img-container\">\n <img class=\"card-img\" src=\"${person.picture.large}\" alt=\"profile picture\">\n </div>\n <div class=\"card-info-container\">\n <h3 id=\"name\" class=\"card-name cap\">${person.name.first} ${person.name.last}</h3>\n <p class=\"card-text\">${person.email}</p>\n <p class=\"card-text cap\">${person.location.city}, ${person.location.state}</p>\n </div>\n </div>`\n\n gallery.insertAdjacentHTML('beforeend', person); \n })\n}", "function setEntertainment(arr, type){\n\t\tfor (var j = 0; j < arr.length; j++) {\n\t\t\tvar li = $('<li>');\n\t\t\tvar i = $('<img>');\n\t\t\tvar a = $('<a>');\n\t\t\ti.addClass('thumbnail');\n\t\t\ti.attr('src', arr[j]);\n\t\t\ta.attr('href', arr[j]);\n\t\t\ta.attr('target', '_blank');\n\t\t\ta.append(i);\n\t\t\tli.append(a);\n\t\t\tif (type == 'movie') {\n\t\t\t\t$('#poster').append(li);\n\t\t\t}\n\t\t\telse if(type == 'music') {\n\t\t\t\t$('#cover').append(li);\n\t\t\t}\n\t\t}\n}", "function displayPhotos(){\n imagesLoaded = 0 ;\n totallImages = photosArray.length ;\n photosArray.forEach( photo => {\n\n // Create <a> to link to Unsplash\n const item = document.createElement('a');\n setAttributes(item,{\n href:photo.links.html,\n terget:'_blank'\n });\n // item.setAttribute('href', photo.links.html);\n // item.setAttribute('target','_blank');\n\n //create <img> tag for every image\n const img = document.createElement('img');\n\n setAttributes(img,{\n src: photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description,\n });\n img.addEventListener('load',imageLoaded);\n // img.setAttribute('src',photo.urls.regular);\n // img.setAttribute('alt',photo.alt_description);\n // img.setAttribute('title',photo.alt_description);\n\n //append <img> to <a> and to img container \n item.appendChild(img);\n imageContainer.appendChild(item)\n });\n}", "function displayFotos () {\n imagesLoaded = 0;\n totalImages = fotosArray.length;\n //console.log('Imágenes en total', totalImages);\n //Ejecutar función para cada objeto en fotosArray\n fotosArray.forEach((foto) => {// Cada objeto va a ser asignado a la variable 'foto'\n // creamos los <a> apuntando a Unsplash\n const item = document.createElement('a');\n //setamos los valores de los atributos\n setAttributes(item, {\n href: foto.links.html,\n target: '_blank',\n });\n console.log(foto);\n\n // Creamos los <img> para las fotos\n const img = document.createElement('img');\n setAttributes(img, {\n src: foto.urls.regular,\n alt: foto.alt_description,\n title: foto.alt_description,\n });\n\n //Event listener. Chequeamos cuando se han cargado las imágenes\n img.addEventListener('load', imageLoaded);\n\n //Creamos info\n let info = document.createElement('p');\n info.innerHTML = foto.exif.model;\n if (!info.innerHTML>0) {\n info.innerHTML = \"No camera info\";\n info.className = 'noInfo';\n }\n\n //Metemos los <img> dentro de los <a>, y los dos dentro del elemento imageContainer\n item.appendChild(img);\n item.appendChild(info); \n imageContainer.appendChild(item); //appendChild para indicar que un elemento va dentro del otro\n });\n\n}", "renderImagesWithTags(payload) {\n console.log(payload)\n\n let result = []\n for (var key in payload){\n\n // key should be the image path without the server's url\n let tags = payload[key].map(tagImagePair => tagImagePair.tag)\n let tagsHtml = tags.map(tag => <div>{tag}</div>)\n let imageSrc = this.state.baseURL + key\n\n result.push(\n <div className=\"imageWrapper\">\n <img src={imageSrc} className=\"gallery\"/>\n {tagsHtml}\n </div>\n )\n }\n return result\n }", "function createImageLayout(data) {\n let container = document.querySelector(\".collection\");\n data.forEach(photo => {\n let imageContainer = document.createElement('div');\n imageContainer.className = \"collection-item\";\n let img = document.createElement('img');\n img.src = photo.urls.thumb;\n imageContainer.append(img);\n container.append(imageContainer);\n });\n\n //use Masonry for adaptive collection images\n let elem = document.querySelector('.collection');\n let msnry = new Masonry(elem, {\n // options\n itemSelector: '.collection-item',\n columnWidth: 200,\n fitWidth: true,\n gutter: 15\n });\n}", "function showPicture(){\n $(\"#list-trail\").empty();\n var i = 1;\n var className =\"\";\n \n for(let location of locations){\n \n var newDataTrail = $(\".data-trail\").first().clone();\n let img = clonePicture(location.picture);\n if(i%2 != 0 ) newDataTrail.css(\"backgroundColor\",\"white\");\n \n \n newDataTrail.css(\"display\",\"block\");\n newDataTrail.find(\".img-trail\").prepend(img)\n newDataTrail.find(\".name-trail\").append(location.name);\n newDataTrail.find(\".date_trail\").find(\"span\").append(location.date);\n newDataTrail.find(\".distance_trail\").find(\"span\").append(location.distance);\n $(\"#list-trail\").append(newDataTrail);\n i++;\n } \n}", "function displayPhotos() {\n imagesLoaded = 0;\n totalImages = photosArray.length;\n\n // run function for each object in photosArray\n photosArray.forEach((photo) => {\n // create <a> to link to Unsplash\n const item = document.createElement('a');\n\n // set item attributes\n setAttributes(item, {\n href: photo.links.html,\n target: '_blank',\n });\n\n // create image for photo\n const img = document.createElement('img');\n\n // set image attributes\n setAttributes(img, {\n src: photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description,\n });\n\n // Event listerer, check when each is finished Loading\n img.addEventListener('load', imageLoaded);\n\n // put image inside anchor element <a>, the put both in imageContainer elements\n item.appendChild(img);\n imageContainer.appendChild(item);\n });\n}", "function displayPhotos(photosArray) {\n imagesLoaded = 0;\n totalImages = photosArray.length;\n // Run function for each object in photosArray\n photosArray.forEach((photo) => {\n // Create <a> to link to Unsplash\n const item = document.createElement(\"a\");\n setAttributes(item, {\n href: photo.links.html,\n target: \"_blank\",\n });\n // Create <div> for photo\n const galleryImg = document.createElement(\"div\");\n galleryImg.classList.add(\"gallery-img\");\n galleryImg.innerHTML = `\n <div class='gallery-info'>\n <p>${photo.user.name}</p>\n <a href=${photo.urls.regular} target=\"_blank\"> Download </a>\n </div>\n `;\n const img = document.createElement(\"img\");\n setAttributes(img, {\n src: photo.urls.regular,\n });\n // Event Listener, check when each is finished loading\n img.addEventListener(\"load\", imageLoaded);\n galleryImg.appendChild(img);\n // Put <div> inside <a>, then put both inside gallery element\n item.appendChild(galleryImg);\n gallery.appendChild(item);\n });\n}", "function getList(){\n\t\tajax(\"get\",\"php/getPics.php\",\"cpage=\"+iPage+\"\",function(data){ //url以html文档为当前文件的路径,所以../php/getPics.php是错误的\n\t\tvar data = JSON.parse(data);\n\t\tif (!data.length) {\n\t\t\treturn;\n\t\t}\n\t\tfor(var i=0;i<data.length;i++){\n\t\t\tvar _index = getShortH();\n\t\t\tvar oDiv = document.createElement(\"div\");\n\t\t\tvar oImg = document.createElement(\"img\");\n\t\t\toImg.src = data[i].preview;\n\t\t\toImg.style.width = \"225px\";\n\t\t\toImg.style.height = data[i].height * (225/data[i].width)+\"px\";\n\t\t\toDiv.appendChild(oImg);\n\t\t\tvar oP = document.createElement(\"p\");\n\t\t\toP.innerHTML = data[i].title;\n\t\t\toDiv.appendChild(oP);\n\t\t\taLi[_index].appendChild(oDiv);\n\t\t}\n\t\tb = true;\n\t})\n\t}", "function getTaggedPhotos(){\n\tfetch('https://api.tumblr.com/v2/tagged?tag=' + chosenKeyword +'&api_key=b48WTucnNkeYsQ7Lr6l9MsxP32IyyIWjg6n2RSx6UI8BsVmWy4').then(function(response){\n\t\treturn response.json();\n\t})\n\t.then(function(result){\n\n\t\tlist.innerHTML = '';\n\t\tconst items = result.response;\n\n\t\tfor(let i = 0; i < items.length; i++){\n\n\t\t\tconst item = items[i];\n\n\t\t\tif(item.photos != undefined){\n\t\t\tconst alt_sizes = item.photos[0].alt_sizes\n\t\t\tconst imgSrc = alt_sizes[alt_sizes.length - 3].url;\n\t\t\t\n\t\t\tconst img = document.createElement('img')\n\t\t\timg.src = imgSrc;\n\n\t\t\tconst li = document.createElement('li')\n\t\t\tli.appendChild(img);\n\t\t\tlist.appendChild(li);\n\t\t\t}\n\t\t}\n\t})\n}", "getImage(){\n var _this = this\n\n _500px.api('/photos', { feature: 'popular', image_size: 5, page: currentPage }, function (response) {\n if (!response.success) {\n alert('Unable to fetch images');\n }\n else{\n var newList = _this.state.imageList.slice()\n newList.push.apply(newList, response.data.photos)\n _this.setState({imageList:newList})\n currentPage += 1\n }\n })\n }", "function createURL(data) {\n for (let i = 0; i < data.photos.photo.length; i++) {\n imageArray.push(\"https://farm\" + data.photos.photo[i].farm + \".staticflickr.com/\" + data.photos.photo[i].server + \"/\" + data.photos.photo[i].id + \"_\" + data.photos.photo[i].secret + \".jpg\")\n }\n displayImages(imageArray)\n return imageArray\n}", "function makeArrayList(array) {\n //Create UL\n var list = document.createElement(\"ul\");\n\n //Iterate through array\n for (var i = 0; i < array.length; i++) {\n //Create LI\n var listItem = document.createElement('li');\n //Add element to LI\n listItem.appendChild(document.createTextNode(array[i]));\n //Add LI to UL\n list.appendChild(listItem);\n }\n //Return array as UL\n var theRightDiv = document.getElementById(\"beforeThis\");\n\n document.body.insertBefore(list, theRightDiv);\n\n }", "function populateGallery(){\nlet thumbnailAdd ='';\nlet container = document.querySelector('.container_thumbnails');//get object\n\n for (let i=1; i<=(captionArray.length); i++) {\n thumbnailAdd += `<a class= 'thumbnail' href=\"images/photos/${i}.jpg\" data-caption=\"${captionArray[i-1]}\">\n <img class='thumbnail' id= \"thumb${i}\" src=\"images/photos/thumbnails/${i}.jpg\" alt=\"Gallery image\">\n </a>`;\n }\ncontainer.innerHTML = thumbnailAdd;\n}", "function buildArrayOfImageObjects(titleStr, dataArr, number) {\n imgObj[titleStr] = [];\n\n dataArr.forEach(obj => {\n imgObj[titleStr].push({\n offset: number,\n animated: obj.images['fixed_width'].url,\n date: ((date = obj.import_datetime) => `${['January', 'Febuary', 'March', 'April', 'May', 'June', 'July', 'August', 'Septemper', 'October', 'November', 'December'][date.slice(5, 7)-1]} ${parseInt(date.slice(8,10))}, ${date.slice(0, 4)}`)(),\n rating: obj.rating.toUpperCase(),\n source: obj.source_tld,\n sourceURL: obj.source,\n static: obj.images['fixed_width_still'].url,\n title: obj.title,\n height: obj.images['fixed_width'].height,\n });\n });\n}", "function createList(){\n for (var i = 0; i < petData.animals.length; i++) {\n\n if (petData.animals[i].primary_photo_cropped != null){\n var petList = $(\"<a>\").addClass(\"nav-link active\").attr(\"id\", \"result-list\").attr(\"href\", \"#\").attr(\"data-index\", i);\n var petName = petData.animals[i].name;\n var petThumb = $(\"<img>\").addClass(\"img-thumbnail\").attr(\"src\", petData.animals[i].primary_photo_cropped.small);\n \n petList = petList.append(petThumb, petName);\n $(\"#list-results\").append(petList);\n \n // if pet doesnt have a photo this doesnt run. The first time it does run, firstValidIndex is permanently set to the index of the first animal who has a photo. This is so that the pet card index matches the index on the list, since some indexs wont be valid\n if (firstValidIndex < 0){\n firstValidIndex = i;\n }\n\n } else {\n // Generate nothing\n } \n }\n\n // makes sure that if you go through all of the animals and none have a photo, the list starts at 0 despite how many animals are found. You set it to 0 as a safeguard in case its called later because -1 will make the program crash.\n if (firstValidIndex < 0){\n firstValidIndex = 0;\n $(\"#noResultsModal\").addClass(\"show\").attr(\"style\", \"display: block;\");\n $(\".blackbox\").removeClass(\"hide\")\n $(\"#hidePetCard\").addClass(\"hide\")\n\n\n }\n\n }", "renderImages(){\n const imgArr = this.state.dataToRender.images_list;\n return imgArr.map((imgUrl, index) => {\n return <div className=\"col-xs-12 each-img\">\n <img src={imgUrl} className=\"img-responsive\" key={index} />\n </div>\n });\n }", "function displayPhotos() {\r\n imagesLoaded = 0;\r\n totalImage = photoArray.length;\r\n \r\n //run function for each array in photoArray\r\n photoArray.forEach((photo) => {\r\n //create <a> to link to unsplash\r\n const item = document.createElement('a');\r\n // item.setAttribute('href', photo.links.html);\r\n // item.setAttribute('target', '_blank');\r\n setAttributes(item, {\r\n href: photo.links.html,\r\n target: '_blank',\r\n });\r\n //create <img> for photo\r\n const img = document.createElement('img');\r\n // img.setAttribute('src', photo.urls.regular);\r\n // img.setAttribute('alt', photo.alt_description);\r\n // img.setAttribute('title', photo.alt_description);\r\n setAttributes(img, {\r\n src: photo.urls.regular,\r\n alt: photo.alt_description,\r\n title: photo.alt_description,\r\n });\r\n //eventlistener , check when each is finish loading\r\n img.addEventListener('load', imageLoaded);\r\n // put <img> inside <a>, then put both inside image-container\r\n item.appendChild(img);\r\n imageContainer.appendChild(item);\r\n });\r\n}", "function displayPhotos () {\r\n imagesLoaded=0;\r\n totalImages = photosArray.length;\r\n// run function for each for each object in photosArray\r\n photosArray.forEach((photo) => {\r\n // create <a> to link to unsplash\r\n const item = document.createElement('a');\r\n // item.setAttribute('href', photo.links.html)\r\n // item.setAttribute('target', '_blank');\r\n setAttributes(item, {\r\n href: photo.links.html,\r\n target: '_blank'\r\n })\r\n // create <img> for photo\r\n const img = document.createElement('img');\r\n // img.setAttribute('src', photo.urls.regular);\r\n // img.setAttribute('alt', photo.alt_description);\r\n // img.setAttribute('title', photo.alt_description);\r\n setAttributes(img, {\r\n src : photo.urls.regular,\r\n alt: photo.alt_description,\r\n title: photo.alt_description\r\n })\r\n // add eventlistener, check when each load is finished\r\n img.addEventListener('load', imageLoaded);\r\n // put <img> inside <a> and put both inside of imageContainer\r\n item.appendChild(img);\r\n imageContainer.appendChild(item);\r\n })\r\n }", "function jsonFlickrApi ( data ) {\n // データが取得できているかチェック\n if (!data) return;\n if (!data.photos) return;\n var list = data.photos.photo;\n if (!list) return;\n if (!list.length) return;\n\n\n remove_children('photos_here');\n\n var div = document.getElementById('photos_here');\n\n var t = 0;\n images = [];\n\n for (var i = 0; i < list.length; i++) {\n var photo = list[i];\n\n console.log(photo);\n\n // a element generation\n var atag = document.createElement('a');\n atag.href = 'http://www.flickr.com/photos/' +\n photo.owner + '/' + photo.id + '/';\n\n var cb = document.createElement('input');\n cb.setAttribute('type','checkbox');\n cb.setAttribute('name','picture');\n cb.setAttribute('checked','checked');\n //cb.innerHTML=\"download\";\n // img generation\n images[i] = document.createElement('img');\n images[i].src = 'http://static.flickr.com/' + photo.server +\n '/' + photo.id + '_' + photo.secret + document.getElementById('size').value;\n images[i].style.border = '0'; \n cb.setAttribute('value',images[i].src);\n atag.appendChild(images[i]);\n div.appendChild(atag);\n div.appendChild(cb);\n console.log(images[i]);\n }\n}", "function rotateImage(a) {\n\tlet nestedArrs = [];\n\tfor (let i = 0; i < a.length; i++) {\n\t\tnestedArrs.push([]);\n\t}\n\tfor (let i = 0; i < a.length; i++) {\n\t\tfor (let x = 0; x < a[i].length; x++) {\n\t\t\tnestedArrs[x].unshift(a[i][x]);\n\t\t}\n\t}\n\treturn nestedArrs;\n}", "function buildImagesList(parent) {\n for (const child of parent.childNodes) {\n const { src } = child\n if (['a', 'img'].includes(child.nodeName.toLowerCase()) && src) {\n const ext = extname(src).slice(1)\n if (!extensions || matchExt(ext))\n files.push({ src, ext })\n }\n else {\n buildImagesList(child)\n }\n }\n }", "function displayPhotos() {\n loadedImages = 0;\n // set totalImages to the length of the array\n totalImages = photosArray.length;\n // Run function for each obj in photosArray\n photosArray.forEach((photo) => {\n // Create a link to unsplash\n const link = document.createElement(\"a\");\n // link.setAttribute(\"href\", photo.links.html);\n // link.target = \"_blank\";\n setAttributes(link, {\n href: photo.links.html,\n target: \"_blank\",\n });\n // Create an image tag to hold the image\n const image = document.createElement(\"img\");\n // image.src = photo.urls.regular;\n // image.setAttribute(\"alt\", photo.alt_description);\n // image.title = photo.alt_description;\n setAttributes(image, {\n src: photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description,\n });\n // Event Listener, check when each image has loaded\n image.addEventListener(\"load\", imageLoaded);\n // Put image into link, and then put both into the imageContainer\n link.appendChild(image);\n imageContainer.appendChild(link);\n });\n}", "function getLSImage(groupName, createSubList){\n\t\t\n\t\tvar imgLi = document.createElement('li');\n\t\tcreateSubList.appendChild(imgLi);\n\t\tvar newImg = document.createElement('img');\n\t\tvar setSrc = newImg.setAttribute(\"src\", \"img/\"+ groupName +\".png\");\n\t\tnewImg.setAttribute(\"height\", \"128\");\n\t\tnewImg.setAttribute(\"width\", \"128\");\n\t\timgLi.appendChild(newImg);\n\t}", "function makeLi(array) {\n var ol = document.createElement(\"ol\");\n for (var i = 1; i <= 30; i++) {\n var li = document.createElement (\"li\");\n ol.appendChild (li);\n }\n return ol;\n }", "function renderImages(images){\n\t\tvar output = '';\n\t\t//console.log(images);\n\t\tvar allPhotos = images.photos.photo;\n\t\tfor (var key in allPhotos) {\n\t\t if (allPhotos.hasOwnProperty(key)) {\n\t\t //console.log(key + \" -> \" + allPhotos[key].id);\n\t\t output += '<li><img src=\"http://farm'+allPhotos[key].farm+'.staticflickr.com/'+allPhotos[key].server+'/'+allPhotos[key].id+'_'+allPhotos[key].secret+'_q.jpg\" /></li>';\n\t\t \tconsole.log(allPhotos[key].id);\n\t\t }\n\n\t\t}\n\t\tdocument.getElementById(\"flickr_images\").innerHTML = output;\n\n\t}", "function createGallery() {\n var selectedImages = document.querySelectorAll('.selected'),\n photo,\n photoIndex,\n out = '';\n\n for(i = 0; i < selectedImages.length; i++) {\n photoIndex = selectedImages[i].dataset.photoIndex;\n photo = window.photos[photoIndex];\n out += '<h3>' + photo.title + '</h3>';\n out += '<a class=\"owner\" data-photo-index=' + i + ' href=\"https://www.flickr.com/people/' + photo.owner + '/\">';\n getUserInfo(photo.owner, i);\n out += '</a>';\n out += '<img data-photo-index=\"' + i + '\" src=\"https://farm' + photo.farm + '.staticflickr.com/' + photo.server +'/' + photo.id + '_' + photo.secret + '.jpg\"></img>';\n }\n document.getElementById(\"galleryarea\").innerHTML = out;\n}", "gridCreator() {\n let picturesWrapper = [];\n let mappedPictures = this.props.pictures.map((pic) => {\n return(\n <div key={pic.id} className=\"cell\">\n <img id={pic.id} src={pic.pictures}\n className=\"responsiveImage\"\n alt={pic.description}\n onClick={(event) => this.props.activateModal(event)} \n />\n </div>\n )\n });\n picturesWrapper.push(<div className=\"grid\" key=\"0\">{mappedPictures.slice(0, 7)}</div>)\n picturesWrapper.push(<div className=\"grid\" key=\"1\">{mappedPictures.slice(7, 13)}</div>)\n picturesWrapper.push(<div className=\"grid\" key=\"2\">{mappedPictures.slice(13, 19)}</div>)\n picturesWrapper.push(<div className=\"grid\" key=\"3\">{mappedPictures.slice(19, 25)}</div>)\n picturesWrapper.push(<div className=\"grid\" key=\"4\">{mappedPictures.slice(25, 31)}</div>)\n return picturesWrapper;\n }", "renderPhoto(data) {\n\t\tconst image = this.createElement('img', 'gallery__photo-item');\n\t\timage.setAttribute('alt', data.alt);\n\t\timage.setAttribute('src', data.src);\n\t\timage.setAttribute('data-image-min-id', data.id);\n\t\treturn image;\n\t}", "function getImageArray(nameOfThePropertyIWant){\n var answer = [];\n\n for(var i = 0; i < allImages.length; i++){\n answer[i] = allImages[i][nameOfThePropertyIWant];\n }\n console.log('name of the property i want ', answer);\n return answer;\n}", "function displayPhotos() {\n imagesLoaded = 0;\n totalImg = photosArray.length;\n\n photosArray.forEach((photos) => {\n // membuat <a></a> untuk menarok link (jika gambar di klik ke unspls)\n const item = document.createElement('a');\n // item.setAttribute('href', photos.links.html);\n // item.setAttribute('target','_blank')\n setAtribut(item, {\n href: photos.links.html,\n target: '_blank'\n });\n //img dari url\n const img = document.createElement('img');\n // img.setAttribute('src', photos.urls.regular);\n // img.setAttribute('alt', photos.alt_description);\n // img.setAttribute('title', photos.alt_description);\n setAtribut(img, {\n src: photos.urls.regular,\n alt: photos.alt_description,\n img: photos.alt_description\n });\n\n // check apakah img telah selesai di load\n img.addEventListener('load', imgLoaded)\n\n //menggabungkan img ke dalam a tag\n item.appendChild(img);\n imgContainer.appendChild(item)\n\n })\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 }", "function listaFotosAux() {\n $(\".foto\").remove();\n var j;\n for (j = 0; j < listImages.length; j++) {\n var html = getHtmlListaFotos(listImages[j].url_img, listImages[j].msg, listImages[j].id, listImages[j].secret, j, 2);\n\n $('#muro').append(html);\n }\n}", "function makeImgRow(face_ids){\n //face_ids & img_paths are paired in order\n var dir_path = $('span#dir_path').html()\n\n var rows = [];\n\n var counter = 0;\n\n face_ids.forEach(function(f,i){\n\n if (counter%12 == 0) rows.push($('<div class=\"row\"></div>'))\n\n var src = dir_path + '/' + database.faceMapToImage(f)\n\n var image = $('<img>')\n .prop('src',src)\n .prop('id',f)\n\n var col = $('<div class=\"col-xs-1 col-sm-1 col-md-1 filmstrip\"></div>')\n .append(image);\n\n rows[rows.length - 1].append(col)\n\n counter += 1\n\n })\n\n return rows\n\n}", "function renderToPage(){\n var targetDisplayParent = document.getElementById('choices'); \n var newDisplayContent = findThreeUniq();\n \n for(var i = 0; i <= 2; i++){\n var newDisplayEl = document.createElement('img');\n var newLi = document.createElement('li');\n newDisplayEl.src = newDisplayContent[i].imageUrl;\n newDisplayEl.id = newDisplayContent[i].product;\n newLi.appendChild(newDisplayEl);\n newDisplayContent[i].views ++;\n targetDisplayParent.appendChild(newLi);\n \n } \n}", "function renderAlbum(album) {\n const photos = album.photos;\n let template = `\n<div class=\"album-card\">\n <header>\n <h3>${photos.title}, by Bret </h3>\n </header>\n <section class=\"photo-list\">\n </section>\n</div>\n `\n photos.forEach(photo => {\n $('.photo-list').append(renderPhoto(photo));\n })\n return template;\n}", "function createThumbnailList() {\n // If thumbnails already exist, erase everything and start over\n if (thumbnails.firstChild !== null) {\n thumbnails.textContent = '';\n files = [];\n }\n\n // We need to enumerate both the photo and video dbs and interleave\n // the files they return so that everything is in chronological order\n // from most recent to least recent.\n\n // Temporary arrays to hold enumerated files\n var photos = [], videos = [];\n\n photodb.enumerate('date', null, 'prev', function(fileinfo) {\n photos.push(fileinfo);\n merge();\n });\n\n videodb.enumerate('date', null, 'prev', function(fileinfo) {\n videos.push(fileinfo);\n merge();\n });\n\n // Create thumbnails for as many of the files in the photos and videos arrays\n // as we can. This is the tricky bit of the algorithm for ensuring that\n // they are sorted by date\n function merge() {\n // If we don't have at least one of each, we don't know what the newest is\n while (photos.length > 0 && videos.length > 0) {\n if (photos[0] === null && videos[0] === null) {\n // Both enumerations are done\n if (files.length === 0) { // If we didn't find anything\n showOverlay('emptygallery');\n }\n break;\n }\n\n // If we've finished enumerating photos, then videos[0] is next\n if (photos[0] === null) {\n thumb(videos.shift());\n }\n else if (videos[0] === null) {\n thumb(photos.shift());\n }\n else if (videos[0].date > photos[0].date) {\n thumb(videos.shift());\n }\n else {\n thumb(photos.shift());\n }\n }\n }\n\n function thumb(fileinfo) {\n files.push(fileinfo); // remember the file\n var thumbnail = createThumbnail(files.length - 1); // create its thumbnail\n thumbnails.appendChild(thumbnail); // display the thumbnail\n }\n}", "function getImage(imgName, makeSubList){\n\t\tvar imageLi = document.createElement('li');\n\t\tmakeSubList.appendChild(imageLi);\n\t\tvar newImg = document.createElement('img');\n\t\tvar setSrc = newImg.setAttribute(\"src\", \"images/\"+ imgName +\".png\");\n\t\timageLi.appendChild(newImg);\n\t}", "function getImage(imgName, makeSubList){\n\t\tvar imageLi = document.createElement('li');\n\t\tmakeSubList.appendChild(imageLi);\n\t\tvar newImg = document.createElement('img');\n\t\tvar setSrc = newImg.setAttribute(\"src\", \"images/\"+ imgName + \".png\");\n\t\timageLi.appendChild(newImg);\n\t}" ]
[ "0.655408", "0.65129954", "0.64465785", "0.63018495", "0.6256874", "0.6227358", "0.6163854", "0.61119634", "0.6093127", "0.60898715", "0.60893166", "0.6088709", "0.60832536", "0.6081336", "0.6042026", "0.60323524", "0.60293305", "0.6027766", "0.6027238", "0.6026111", "0.6020255", "0.59763885", "0.5975878", "0.59293294", "0.59096396", "0.5908944", "0.59068483", "0.58838487", "0.5857313", "0.58557796", "0.5853056", "0.5848747", "0.57903224", "0.5789827", "0.57871974", "0.578004", "0.57743514", "0.57738554", "0.57711357", "0.57595706", "0.5753381", "0.5751323", "0.5747728", "0.57463706", "0.5745276", "0.5727302", "0.5727117", "0.57241046", "0.5714887", "0.57134044", "0.5699971", "0.5695923", "0.56887144", "0.56845707", "0.5679389", "0.567394", "0.5670319", "0.5669464", "0.5664347", "0.5663185", "0.56531656", "0.56496495", "0.56493247", "0.5643829", "0.56432533", "0.5640746", "0.56404984", "0.56394833", "0.56388927", "0.5637016", "0.5634955", "0.56223226", "0.5620876", "0.56201273", "0.56174344", "0.5613511", "0.5611702", "0.5611563", "0.5610731", "0.56099534", "0.5602196", "0.56021446", "0.5601639", "0.56007135", "0.55947745", "0.55860114", "0.55855465", "0.55737317", "0.5561148", "0.5560714", "0.5560692", "0.55598605", "0.55567616", "0.55556446", "0.5539837", "0.5524132", "0.55179703", "0.5515644", "0.55142057", "0.5513646" ]
0.6066612
14
fetch images using fetch api. Generates li of photos and saves to state
createPhotos(searchTopic2) { if(this.state.prevSearchTopic !== searchTopic2) { this.setState({ loading: true }) const url=`https://www.flickr.com/services/rest/?method=flickr.photos.search&api_key=${apiKey}&text=${searchTopic2}&per_page=24&format=json&nojsoncallback=1` fetch(url) .then(response => response.json()) .then(data => data.photos.photo) .then(data => data.map(x => `https://live.staticflickr.com/${x.server}/${x.id}_${x.secret}_w.gif`)) .then(data => this.createPhotoComps(data)) .then(data => this.setState({ photoComps: data, searchTopic: searchTopic2 , prevSearchTopic: searchTopic2, loading: false }, () => { console.log(`App: createPhotos setState with new searchTopic: ${this.state.searchTopic}`); } )) .catch(error => { console.log('Error in createPhotos in App.js', error); }); }}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "async GetImages(fetchParams) {\n if (this.state.lastCursor) {\n fetchParams.after = this.state.lastCursor;\n }\n\n CameraRoll.getPhotos(fetchParams).then(\n r => this.AppendImages(r)\n )\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 fetchImages() {\n const numPhotos = 18;\n const graphicPromises = [];\n const baseUrl =\n \"https://arcgis.github.io/arcgis-samples-javascript/sample-data/featurelayer-collection/photo-\";\n\n for (let i = 1; i <= numPhotos; i++) {\n const url = baseUrl + i.toString() + \".jpg\";\n const graphicPromise = exifToGraphic(url, i);\n graphicPromises.push(graphicPromise);\n }\n\n return promiseUtils.eachAlways(graphicPromises);\n}", "function 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}", "getImage(){\n var _this = this\n\n _500px.api('/photos', { feature: 'popular', image_size: 5, page: currentPage }, function (response) {\n if (!response.success) {\n alert('Unable to fetch images');\n }\n else{\n var newList = _this.state.imageList.slice()\n newList.push.apply(newList, response.data.photos)\n _this.setState({imageList:newList})\n currentPage += 1\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 }", "function loadPhotos() {\n\n for(let i = 0; i < 10; i++) {\n fetch(`https://picsum.photos/500/500?random=${i}`)\n .then(x => {\n \n gallery.innerHTML += `\n <img src=\"${x.url}\" alt=\"\">\n `\n });\n }\n}", "async function getPhotos() {\n try {\n const response = await fetch(apiUrl);\n photosArray = await response.json();\n displayPhotos();\n if (initialLoad) {\n updateWithNewImageCount(30);\n initialLoad = false;\n }\n } catch (error) {\n // console.log(\"getPhotos: ER! \")\n }\n}", "function getPhotos() {\n const url = 'http://localhost:3000/gallery?_sort=id&_order=desc';\n const fetchparameters = {\n method: 'GET',\n headers: { 'Content-Type': 'application/json; charset=UTF-8' },\n mode: 'cors',\n cache: 'no-cache'\n };\n fetch(url, fetchparameters)\n .then(data => data.json())\n .then(response => {\n photos = response;\n loadGallery();\n })\n .catch(error => console.error(error))\n}", "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}", "getImages() {\n const { searchTitle, page, pageSize } = this.state;\n const params = this.getRequestParams('cars', page, pageSize);\n ImageFetchService.getAll(params)\n .then( response => {\n this.setState( { images: response.data.hits } );\n } )\n .catch( error => {\n // console.log('ERROR')\n this.setState( { error: true } );\n } );\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}", "async function storePhotos(url) {\n fetch(url)\n .then((response) => response.json())\n .then((data) => {\n for (let i = 0; i <= 4; i++) {\n //individual url to pic\n let pic = data.results[i].urls.regular;\n\n //add pics to list\n let li = document.createElement(\"li\");\n\n //event listener once you select an image to view\n list.appendChild(li).addEventListener(\"click\", () => {\n text.classList.add(\"hidden\");\n photos.classList.remove(\"hidden\");\n photos.src = pic;\n });\n li.classList.add(\"list-pic\");\n li.style.backgroundImage = `url(${pic})`;\n }\n })\n .catch(() => {\n photos.classList.add(\"hidden\");\n text.classList.remove(\"hidden\");\n text.innerHTML =\n \"Could not find any photos with that, try somthing else.\";\n setTimeout(() => {\n text.innerHTML =\n \"Search for a photo and select one to get a better view.\";\n }, 6180);\n });\n }", "fetchImages(q) {\n console.log('Searching Flickr for', q);\n const flickrURL = 'https://api.flickr.com/services/rest?jsoncallback=?';\n const flickrParams = {\n method: 'flickr.photos.search',\n api_key: '2f5ac274ecfac5a455f38745704ad084',\n text: q,\n format: 'json'\n };\n\n const generateURL = function (p) {\n return [\n 'http://farm',\n p.farm,\n '.static.flickr.com/',\n p.server,\n '/',\n p.id,\n '_',\n p.secret,\n '_q.jpg' // Change 'q' to something else from the docs for different sizes\n ].join('');\n };\n\n // This actually initiates the request to Flick for images matching the term `q`.\n // In real life we'd use `axios` or `fetch` to make this request.\n jsonp(flickrURL, flickrParams, {callback: 'jsoncallback'}).then((results) => {\n const images = results.photos.photo.map(generateURL);\n this.setState({images}); // {\"images\": images}\n });\n\n }", "function Photos(){\n const [photo, setPhoto] = useState([]);\n useEffect(() => {\n fetch('https://jsonplaceholder.typicode.com/photos')\n .then( res => res.json())\n .then( data => setPhoto(data));\n }, [])\n\n return(\n <div>\n <h1>My all Photo data!</h1>\n <h2>Dynamic Photos: {photo.length}</h2>\n <ul>\n {photo.map(x => <li>{x.thumbnailUrl}</li>)}\n </ul>\n </div>\n )\n\n }", "function fetchImg(){\n fetch(imgUrl)\n .then(resp => resp.json())\n .then(json => json.message.forEach(element => \n addImgToDom(element)\n ));\n}", "async getPhotos(){\n const apiResponse = await fetch(`https://api.unsplash.com/photos?page=1&per_page=30&client_id=${this.clientId}`);\n\n const photos = await apiResponse.json();\n\n return{\n photos\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 }", "async function getPhotos()\n{\n try{\n const response=await fetch(apiUrl);\n photosArray=await response.json();\n displayPhotos(); \n if (isInitialLoad) { \n updateAPIURLWithNewCount(30);\n isInitialLoad = false;\n }\n\n }catch(error)\n {\n\n }\n}", "function retrievePictures(coords) {\n console.log(\"Lat: \" + coords.latitude)\n console.log(\"Lon: \" + coords.longitude)\n imageArray = []\n const url = \"https://shrouded-mountain-15003.herokuapp.com/https://flickr.com/services/rest/?api_key=d3bfc1adf01a36079d0c6711030a97e8&format=json&nojsoncallback=1&method=flickr.photos.search&safe_search=1&per_page=5&lat=\" + coords.latitude + \"&lon=\" + coords.longitude + \"&text=outdoors\"\n\n fetch(url)\n\n .then(function(responseObject) {\n return responseObject.json()\n })\n .then(function(data) {\n createURL(data)\n return data\n })\n}", "function 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 }", "async function getCurated() {\n let curatedURL = baseURL + `/curated?per_page=${pictureAmount}&page=${currentPage}`;\n // console.log(curatedURL);\n data = await fetchData(curatedURL);\n updateNav();\n data.photos.forEach(photo => createImage(photo));\n}", "fetchImages(img) {\n var images = JSON.parse(localStorage.getItem(img))\n\n this.setState({\n nameOfImg: img,\n images\n })\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 FetchImages(){\n\t\n\tvar fiveHundred = \"https://api.500px.com/v1/photos?feature=fresh_day&sdk_key=7131207245727241ad25174950e82fc41cb572f3\";\n\t\n\t$.ajax({\n\t\ttype:\"GET\",\n\t\turl: fiveHundred,\n\t})\n\t.done(function(result){\n\t\tfor(var i = 0; i <result.photos.length; i++) {\t\t\n\t\t\timageArray.push(result.photos[i].image_url);\t\n\t\t}\n\t\t\n\t\t\n\t\t//console.log(imageArray.length);PASS\n\t\tConvertToColor(0);\n\t});\t\n}", "async function getPhotos() {\n try {\n const response = await fetch(apiUrl);\n photosArray = await response.json();\n\n displayPhotos();\n\n } catch (error) {\n console.log(error)\n }\n }", "async function getImages(type, num) {\n // if the component that siad \"there is no photos\" we should hide it first\n document.querySelector(\".error\").classList.remove(\"appear-error\");\n // initial tagsImages with empty array every time we call getImages because we want to get rid of the ancient tags that we have stored before\n imageTags = [];\n // clean innerHTML from the the old btns and tags\n btnsTag.innerHTML = \"\";\n // the apikey that unsplash has given us\n const apiKey = \"r4f4oAp0b5Knk0JmLaTZPruEgA2O1EcAyV4-nkUr4GU\";\n // our url\n const UrlApi = `https://api.unsplash.com/search/collections?page=${num}&query=${type}&client_id=${apiKey}`;\n try {\n // display a loader to tell to the user request is going.\n document.querySelector(\".loader\").style.display = \"block\";\n // send the request and wait for it the finish\n const response = await fetch(UrlApi);\n // transform response to json format\n arrayImgs = await response.json();\n // jus imagine the user entered something not valid or not relevent\n // arrayImgs will be empty\n if (arrayImgs.results.length < 1) {\n throw \"there are no photos for the tag that you has entered :(\";\n }\n\n // we want to take out tags before show the photos\n // these tags it will help the user find what he is looking for.\n arrayImgs.results[0].tags.map((e) => {\n if (e.title) {\n imageTags.push(e.title);\n }\n });\n\n // send our objects (images) to the function that will show the photos\n // one be one\n arrayImgs.results.forEach((img) => {\n // call the function displayImages\n displayImages(img);\n });\n // display tags\n displayTags();\n document.querySelector(\".loader\").style.display = \"none\";\n } catch (error) {\n // hide loader\n document.querySelector(\".loader\").style.display = \"none\";\n // if there is an error wi should play this component\n\n document.querySelector(\".error\").classList.add(\"appear-error\");\n }\n}", "LoadImage(){\n var images=[]\n // hard coded for convenienceproxy to a static serving end point\n if(this.state.images!=undefined){\n this.state.images.map(i =>{\n images.push(\n this.request.getStamp()+'-' + i\n )\n })\n return images; \n }\n else{\n \n return null\n }\n }", "function fetchImages() {\n $.getJSON(\"/images.php\", function(data) {\n preloadImages(data);\n }); \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 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}", "async function getPhotos() {\r\n try{\r\n const response = await fetch(proxyUrl + apiUrl);\r\n photoArray = await response.json();\r\n displayPhotos();\r\n if (isInitailLoad) {\r\n updatePhoto(30)\r\n isInitailLoad = false\r\n }\r\n \r\n }catch (error){\r\n // catch error here\r\n }\r\n}", "function fetchAllImgs(id){\n storage = firebase.storage()\n let storeRef = storage.ref()\n let resRef = storeRef.child(id.id)\n resRef.listAll().then(function(res) {\n res.items.forEach(r => {\n let url\n r.getDownloadURL().then(function(r){\n url = r\n let a = document.createElement(\"div\")\n a.className=\"mySlides\"\n let b =\n ` \n \n <img src=\"`+ url +`\" class=\"slideImg\"> \n `\n a.innerHTML = b\n photosDiv.appendChild(a)\n })\n })\n })\n\n\n let req = {\n placeId: id.id,\n fields: ['photos']\n };\n service.getDetails(req, photosCallback);\n console.log(\"clicked\")\n}", "componentDidMount() {\n fetch('https://api.unsplash.com/photos/?client_id=cafb670b38fe81cc5594269814c73f25c82530482a9377485f9fcffdd17fea8f&per_page=25')\n .then(response => response.json())\n .then((data) => {\n console.log(data);\n let urlsSmall = data.map(data => data.urls).map(urls => urls.small)\n let urlsRegular = data.map(data => data.urls).map(urls => urls.regular)\n this.setState({ urlsSmall : urlsSmall, urlsRegular : urlsRegular });\n })\n }", "async function getPhotos() {\n showLoadingSpinner();\n try {\n const response = await fetch(apiUrl);\n photoArray = await response.json();\n displayPhotos();\n removeLoadingSpinner();\n } catch (error) {\n console.log(error)\n }\n\n}", "function getPhotos() {\n imageCount = 0;\n ready = false;\n loader.hidden = false;\n if (random) {\n getRandomPhotos();\n } else {\n getSearchResults(query);\n }\n}", "function fetchImages() {\n // useEffect helps us fetch the photos from our api.\n useEffect(() => {\n axios.get(`/search/photos?searchWord=${search}`)\n .then((resp) => {\n setLoading(false);\n setStateImages(resp.data.photosSearch);\n console.log(resp.data);\n return resp.data;\n }).catch((err) => {\n setError(err.response);\n console.log(err);\n });\n }, [search]);\n return stateImages;\n }", "loadImages(): void {\n let self = this;\n let items = this.getState().items;\n for (let i = 0; i < items.length; i++) {\n let item: ItemType = items[i];\n // Copy item config\n let config: ImageViewerConfigType = {...item.viewerConfig};\n if (_.isEmpty(config)) {\n config = makeImageViewerConfig();\n }\n let url = item.url;\n let image = new Image();\n image.crossOrigin = 'Anonymous';\n self.images.push(image);\n image.onload = function() {\n config.imageHeight = this.height;\n config.imageWidth = this.width;\n self.store.dispatch({type: types.LOAD_ITEM, index: item.index,\n config: config});\n };\n image.onerror = function() {\n alert(sprintf('Image %s was not found.', url));\n };\n image.src = url;\n }\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 }", "function loadImages() {\n\t\t const button = document.querySelector('#loadImages');\n\t\t const container = document.querySelector('#image-container');\n\n\t\t button.addEventListener(\"click\", (event) => {\n\n\t\t const images = imageNames();\n\t\t images.forEach((image) => {\n\t\t requestFor(image, container).then(imageData => {\n\t\t const imageElement = imageData.imageElement;\n\t\t const imageSrc = imageData.objectURL;\n\t\t imageElement.src = imageSrc;\n\t\t });\n\t\t });\n\t\t });\n\t\t}", "function getImages(num, count) {\n fetch(`/img/img-${num}.png`)\n .then((res) => {\n if (res.ok) {\n console.log(`The number of images is ${count}`);\n arr.push(count);\n console.log(arr.length);\n console.log(res);\n\n // Display the number of images in the folder in a paragraph\n imgTxt.innerHTML = `There are ${count} images in the folder`;\n } else throw new Error(\"There was a problem with getting the image\");\n })\n .catch((err) => console.log(err));\n}", "async function getPhotos () {\n try {\n const response = await fetch(apiUrl);\n fotosArray = await response.json();\n displayFotos();\n } catch (error) {\n //recogemos el error\n }\n}", "async function getPhotos() {\n try {\n const response = await fetch(apiURL);\n photosArray = await response.json();\n displayPhotos();\n\n\n\n } catch (error) {\n\n }\n}", "function displayPhotos () {\r\n imagesLoaded=0;\r\n totalImages = photosArray.length;\r\n// run function for each for each object in photosArray\r\n photosArray.forEach((photo) => {\r\n // create <a> to link to unsplash\r\n const item = document.createElement('a');\r\n // item.setAttribute('href', photo.links.html)\r\n // item.setAttribute('target', '_blank');\r\n setAttributes(item, {\r\n href: photo.links.html,\r\n target: '_blank'\r\n })\r\n // create <img> for photo\r\n const img = document.createElement('img');\r\n // img.setAttribute('src', photo.urls.regular);\r\n // img.setAttribute('alt', photo.alt_description);\r\n // img.setAttribute('title', photo.alt_description);\r\n setAttributes(img, {\r\n src : photo.urls.regular,\r\n alt: photo.alt_description,\r\n title: photo.alt_description\r\n })\r\n // add eventlistener, check when each load is finished\r\n img.addEventListener('load', imageLoaded);\r\n // put <img> inside <a> and put both inside of imageContainer\r\n item.appendChild(img);\r\n imageContainer.appendChild(item);\r\n })\r\n }", "async getPhotos() {\r\n try {\r\n const response = await fetch(`https://json.medrating.org/photos?albumId=${this.id}`)\r\n const data = await response.json();\r\n\r\n this.photos = data.map(photo => new Photo(photo.albumId, photo.id, photo.title, photo.url));\r\n\r\n return this;\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n }", "componentDidMount() {\n fetch(\"https://www.flickr.com/services/rest/?method=flickr.photos.getRecent&api_key=3fbf26ac61178add989b2e7e4dfc0614&format=json&nojsoncallback=1\")\n .then(res => res.json())\n .then(\n (result) => {\n this.setState({\n isLoaded: true,\n items: result.photos['photo']\n });\n },\n // Note: it's important to handle errors here\n // instead of a catch() block so that we don't swallow\n // exceptions from actual bugs in components.\n (error) => {\n this.setState({\n isLoaded: true,\n error\n });\n }\n )\n }", "async TryGetImages(fetchParams) {\n if (!this.state.loadingMore) {\n this.setState({ loadingMore: true }, () => { this.GetImages(fetchParams) })\n }\n }", "searchQuery(query) {\n //fetching flikr api data\n fetch(`https://www.flickr.com/services/rest/?method=flickr.photos.search&api_key=${apiKey}&tags=${query}s&format=json&nojsoncallback=1&sort=recent&per_page=24`)\n .then(response => response.json())\n .then(responseData => {\n // updates state with new images\n this.setState({\n images : responseData.photos.photo\n })\n }).catch(error => {\n console.log('Error', error)\n })\n\n }", "function getImages(){\n hideContents();\n showLoading();\n clearContent();\n //Check we have tags available before making an API request\n if (getTagsUri().length > 0) {\n $.getJSON(\"flickr.php\", { tagUri: getTagsUri()}, function(response) {\n console.log(response);\n // Response status of 1 means the api request was successful\n if (response.status == 1) {\n $.each(response.data, function(i, item){\n constructCard(item);\n });\n hideContents();\n showContent();\n } else {\n // if my php script detects an error the response status will be set to 0, meaning we show no results\n hideContents();\n showNoResults();\n }\n\n });\n } else {\n hideContents();\n showNoResults();\n }\n}", "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 }", "async componentDidMount() {\n const images = await fetchJSON(imagesUrl);\n this.setState({ backgroundImages: images.results });\n }", "async function getPhotos() {\n // Initialize variables that build the URL sent to API\n const apiKey = \"0e6f1413c3b36764051548d54b6d5cff\";\n const method = \"flickr.photos.search\";\n\n // Decide what text String to send to API, based on input\n let search = document.getElementById(\"search\").value;\n const baseURL = \"https://api.flickr.com/services/rest\";\n\n // Decides number of images shown, based on slider value\n let imgAmount = slider.value;\n\n // Build URL for API with custom arguments\n let url = `${baseURL}?api_key=${apiKey}&method=${method}&text=${search}&per_page=${imgAmount}&format=json&nojsoncallback=1&safe_search=1&sort=relevance`;\n\n // Fetch API data with the URL built above\n let response = await fetch(url);\n\n // Access the JSON response so it can be reached with JS\n let data = await response.json();\n\n // Call the function to show images and use the API data received as argument\n showPhotos(data);\n}", "async function getPhotos() {\r\n try {\r\n const response = await fetch(apiUrl);\r\n photosArray = await response.json();\r\n displayPhotos();\r\n \r\n } catch(error) {\r\n console.log(error, 'there is a problem fetching data');\r\n }\r\n}", "[fetchPhotoListRequest](state) {\n return set(['loading'], true, state)\n }", "async getPhotos() {\n\n let pics = await MediaLibrary.getAssetsAsync({\n after: this.state.after,\n first: 50,\n sortBy: [[ MediaLibrary.SortBy.default, true ]]\n });\n\n let promises = [];\n for (var i = 0; i < pics['assets'].length; i++) {\n promises.push(MediaLibrary.getAssetInfoAsync(pics['assets'][i].id));\n }\n\n let a = await Promise.all(promises);\n\n let photos = [];\n for (var i = 0; i < promises.length; i++) {\n photos.push({\n id: a[i].id, // \"F719041D-8A97-4156-A2D9-E25C6CA263AC/L0/001\",\n uri: a[i].uri, // \"assets-library://asset/asset.JPG?id=F719041D-8A97-4156-A2D9-E25C6CA263AC&ext=JPG\",\n file: a[i].localUri, // \"file:///var/mobile/Media/DCIM/116APPLE/IMG_6677.JPG\",\n unix: a[i].creationTime\n });\n }\n\n if (this._isMounted) {\n this.setState((currentState) => {\n return {\n photos: [...currentState.photos, ...photos],\n after: pics['endCursor']\n };\n }, () => {\n // Repeat until the screen is full of images\n // then, we will load more photos with getMoreImages below\n if (this.state.photos.length < 40) {\n this.getPhotos();\n }\n });\n\n }\n }", "async function getPhotos(){\n try {\n const response = await fetch(apiUrl);\n photosArray = await response.json(); \n displayphotos();\n \n } catch (error) {\n // Catch Error\n }\n}", "function displayPhotos() {\n imagesLoaded = 0;\n totalImages = photosArray.length;\n\n // run function for each object in photosArray\n photosArray.forEach((photo) => {\n // create <a> to link to Unsplash\n const item = document.createElement('a');\n\n // set item attributes\n setAttributes(item, {\n href: photo.links.html,\n target: '_blank',\n });\n\n // create image for photo\n const img = document.createElement('img');\n\n // set image attributes\n setAttributes(img, {\n src: photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description,\n });\n\n // Event listerer, check when each is finished Loading\n img.addEventListener('load', imageLoaded);\n\n // put image inside anchor element <a>, the put both in imageContainer elements\n item.appendChild(img);\n imageContainer.appendChild(item);\n });\n}", "function getImageList(callback)\n{\n $(\"#content\").stop(true, true).fadeOut();\n $.ajax({\n url: baseUrl + \"images.json\",\n dataType: \"jsonp\",\n data: {},\n success: function(data) {\n var images = $('<div id=\"images\"></div>');\n $(\"#content\").html(\"\");\n images.appendTo(\"#content\");\n $.each(data, function(idx, val) {\n images.append('<a href=\"'+val['url']+'\"><img src=\"'+val['url']+'\"></a>');\n });\n $(\"#images a\").lightBox();\n $(\"#content\").stop(true, true).fadeIn();\n }\n });\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 getPhotosByPage(pageNumber = 1, searchQuery = 'vintage') {\n\n const KEY = 'f1b7bf92f0d79937504418aeaaad3907aa12ce5f5c8b06982e291d68b875d5db'\n let URL = `https://api.unsplash.com/search/photos?page=${pageNumber}&query=${searchQuery}&client_id=${KEY}`\n\n //make a fetch call to Unsplash api. Provide pageNumber as a variable to fetch URL\n fetch(`${URL}`)\n .then( res => res.json())\n .then(response => {\n\n //query the grid container div and save it in a variable.\n let thumbnailDiv = document.getElementsByClassName(\"grid-container\")[0]\n\n if(response.results.length === 0) {\n errorMessage = document.createElement('p')\n errorMessage.className = \"error\"\n\n errorMessage.append(\"Sorry no images found :( Please try different keyword!\")\n thumbnailDiv.appendChild(errorMessage)\n }\n \n //iterate over the JSON data returned by api call \n response.results.forEach(photo => {\n \n // create a thumbnail container div for each photo returned by api\n let thumbnailContainer = document.createElement('div');\n thumbnailContainer.className = \"thumbnail-container\"\n \n //create img tag for each photo returned by api\n let src = photo.urls.thumb\n //let src = photo.preview_photos[0].urls.thumb\n let title = photo.title\n let alt = photo.description\n let imgTag = createImg(src, alt, title)\n //append the image tag to thumbnail container div\n thumbnailContainer.appendChild(imgTag)\n\n imgTag.addEventListener('click', function() {\n createModel(photo, this)\n })\n\n //append thumbnail container div to main grid-container\n thumbnailDiv.appendChild(thumbnailContainer)\n })\n })\n .catch(error => {\n \n alert(error)\n })\n}", "function getPicture(city) {\n var queryURL = \"https://cors-anywhere.herokuapp.com/https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=ca370d51a054836007519a00ff4ce59e&per_page=4&content_type=1&format=json&nojsoncallback=1&tags=\" + city;\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n for (var i = 0; i < response.photos.photo.length; i++) {\n var image = $(\"<img>\");\n var flickrImages = \"http://farm\" + response.photos.photo[i].farm + \".staticflickr.com/\" + response.photos.photo[i].server + \"/\" + response.photos.photo[i].id + \"_\" + response.photos.photo[i].secret + \".jpg\"\n image.attr(\"src\", flickrImages);\n image.attr(\"class\", \"w-full sm:w-1/4 m-0 sm:m-2 border border-solid border-black rounded-0 sm:rounded-lg\");\n\n image.attr(\"alt\", \"Pictures of \" + city);\n $(\"#image-div\").append(image);\n console.log(image);\n }\n });\n}", "function getPhotos(e) { // This function will fetch the category's photos from Unsplash\n e.preventDefault();\n let category = $(e.target).text(); // Saves the category name \n const enc = \"b2dLS1VTeUdSUWgtU2tVVnpqS1ByX0t5clZZM0Q3eS1GZElwNmV4VVdIQQ==\";\n const dec = atob(enc);\n let apiUrl = \"https://api.unsplash.com/photos/random?client_id=\" + dec + \"&orientation=squarish&count=20\" + \"&query=\" + category;\n // query= search term\n // count = will return 20 pictures\n fetch(apiUrl) \n .then(function(response) {\n if(response.ok) {\n return response.json(); // If the status is ok, return the data\n } else {\n console.log(response.status); // If not, log the status code\n return;\n }\n })\n .then(function(data) { // Perform these operations to the data\n button.hide(); // Hide the buttons\n categoriesList.hide(); // Hide the container holding the buttons\n h3.text(category); // Fill the text with the category name \n let a = $(\"<a>\"); // Create new tags\n let i = $(\"<i>\");\n a.addClass(\"waves-effect waves-light btn backBtn\"); // Make this a tag a button \n i.addClass(\"material-icons left\");\n i.text(\"arrow_back\"); // Arrow back icon\n a.text(\"Go Back\");\n a.append(i);\n backBtnLoc.append(a); // Append it to the div\n\n for (let i = 0 ; i < 20 ; i++) {\n let img = $('.' + i); // Target each img with class starting with \".0\" to \".19\"\n let imgUrl = data[i].urls.regular; // Fetches the image url\n img.attr(\"src\", imgUrl); // Assigns the source attribute the image url\n }\n $(\".backBtn\").on(\"click\", function() { // This function will execute if the user clicks the back button\n window.location.replace(\"categories.html\"); \n })\n })\n}", "async function getPhotos() {\n try {\n const response = await fetch(apiUrl);\n const photosArray = await response.json();\n console.log(photosArray);\n console.log(1);\n displayPhotos(photosArray);\n\n\n } catch (error) {\n console.log(error);\n }\n}", "handleData() {\n this.setState({\n currentPage: 1,\n photos: [],\n });\n this.loadImg();\n }", "loadMorePhotos(){\n \n\t\tlet self = this;\n\t this.page = this.page + 1;\n this.container.classList.add('loading');\n this.isLoading = true;\n\t \n\t let url = `${API.photo_api}${API.app_id}${API.posts_per_page}&page=${this.page}&order_by=${this.orderby}`;\n\t if(this.is_search){\n\t\t url = `${API.search_api}${API.app_id}${API.posts_per_page}&page=${this.page}&query=${this.search_term}`;\n\t }\n\t \n\t\tfetch(url)\n\t .then((data) => data.json())\n .then(function(data) {\n\t \n\t if(self.is_search){\n\t data = data.results; // Search results are recieved in different JSON format\n\t }\n\t \n\t // Loop results, push items into array\n\t data.map( data => { \n\t\t self.results.push(data); \n\t\t });\n\t\t \n\t\t // Check for returned data\n\t\t self.checkTotalResults(data.length);\n\t\t \n\t\t // Update Props\n\t self.setState({ results: self.results });\n\t\t \n\t })\n\t .catch(function(error) {\n console.log(error);\n self.isLoading = false;\n });\n\t \n }", "function fetchPhotos(id) {\n\t\t\t// console.log('fetchPhotos',id)\n\t\t\tvar directory = '';\n\t\t\tvar filePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\tconsole.log('fetchPhotos',id,directory,filePath);\n\t\t\t// Load Stage photos\n\t\t\tif (id === 'thestage') {\n\t\t\t\tdirectory = 'stage';\n\t\t\t\tfilePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\t\tif (stagePicsInPlace === 0) {\n\t\t\t\t\tloadCarousel(filePath, id);\n\t\t\t\t\tstagePicsInPlace++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Load Hall photos\n\t\t\telse if (id === 'thehall') {\n\t\t\t\tdirectory = 'hall';\n\t\t\t\tfilePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\t\tif (hallPicsInPlace === 0) {\n\t\t\t\t\tloadCarousel(filePath, id);\n\t\t\t\t\thallPicsInPlace++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Load Gallery photos\n\t\t\telse if (id === 'thegallery') {\n\t\t\t\tdirectory = 'lobby';\n\t\t\t\tfilePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\t\tif (galleryPicsInPlace === 0) {\n\t\t\t\t\tloadCarousel(filePath, id);\n\t\t\t\t\tgalleryPicsInPlace++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Load Screening room photos\n\t\t\telse if (id === 'thescreeningroom') {\n\t\t\t\tdirectory = 'screening';\n\t\t\t\tfilePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\t\tif (screeningPicsInPlace === 0) {\n\t\t\t\t\tloadCarousel(filePath, id);\n\t\t\t\t\tscreeningPicsInPlace++;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function displayPhotos() {\n imagesLoaded = 0;\n totalImages = photosArray.length;\n // Run function for each object in photosArray\n photosArray.forEach((photo) => {\n // Create <a> to link to unsplash\n const $item = $(`<a href=\"${photo.links.html}\" target=\"_blank\"></a>`);\n\n // Create <img> for photo\n const $img = $(\n `<img src=\"${photo.urls.regular}\" alt=\"${photo.alt_description}\" title=\"${photo.alt_description}\" />`\n );\n\n // Event Listener, check when each is finished loading\n $img.on('load', imageLoaded);\n\n // Put <img> inside <a> then put both inside imageContainer element\n $item.append($img);\n $imageContainer.append($item);\n });\n }", "function displayPhotos() {\n loadedImages = 0;\n // set totalImages to the length of the array\n totalImages = photosArray.length;\n // Run function for each obj in photosArray\n photosArray.forEach((photo) => {\n // Create a link to unsplash\n const link = document.createElement(\"a\");\n // link.setAttribute(\"href\", photo.links.html);\n // link.target = \"_blank\";\n setAttributes(link, {\n href: photo.links.html,\n target: \"_blank\",\n });\n // Create an image tag to hold the image\n const image = document.createElement(\"img\");\n // image.src = photo.urls.regular;\n // image.setAttribute(\"alt\", photo.alt_description);\n // image.title = photo.alt_description;\n setAttributes(image, {\n src: photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description,\n });\n // Event Listener, check when each image has loaded\n image.addEventListener(\"load\", imageLoaded);\n // Put image into link, and then put both into the imageContainer\n link.appendChild(image);\n imageContainer.appendChild(link);\n });\n}", "function loadImages()\r\n{\r\n // console.log(\"Loading popular photos\");\r\n\r\n // clear feed list\r\n imageGallery.clearGallery();\r\n\r\n var req = new XMLHttpRequest();\r\n req.onreadystatechange = function()\r\n {\r\n // this handles the result for each ready state\r\n var jsonObject = network.handleHttpResult(req);\r\n\r\n // jsonObject contains either false or the http result as object\r\n if (jsonObject)\r\n {\r\n var imageCache = new Array();\r\n for ( var index in jsonObject.data )\r\n {\r\n if (index <= 14)\r\n {\r\n // get image object\r\n imageCache = getImageDataFromObject(jsonObject.data[index]);\r\n // cacheImage(imageCache);\r\n\r\n // add image object to gallery list\r\n imageGallery.addToGallery({\r\n \"url\":imageCache[\"thumbnail\"],\r\n \"index\":imageCache[\"imageid\"]\r\n });\r\n\r\n // console.log(\"Appended list with URL: \" + imageCache[\"thumbnail\"] + \" and ID: \" + imageCache[\"imageid\"]);\r\n }\r\n }\r\n\r\n loadingIndicator.running = false;\r\n loadingIndicator.visible = false;\r\n imageGallery.visible = true;\r\n\r\n // console.log(\"Done loading popular photos\");\r\n }\r\n else\r\n {\r\n // either the request is not done yet or an error occured\r\n // check for both and act accordingly\r\n if ( (network.requestIsFinished) && (network.errorData['code'] != null) )\r\n {\r\n // console.log(\"error found: \" + network.errorData['error_message']);\r\n\r\n // hide messages and notifications\r\n loadingIndicator.running = false;\r\n loadingIndicator.visible = false;\r\n\r\n // show the stored error\r\n errorMessage.showErrorMessage({\r\n \"d_code\":network.errorData['code'],\r\n \"d_error_type\":network.errorData['error_type'],\r\n \"d_error_message\":network.errorData['error_message']\r\n });\r\n\r\n // clear error message objects again\r\n network.clearErrors();\r\n }\r\n }\r\n }\r\n\r\n var url = instagramkeys.instagramAPIUrl + \"/v1/media/popular?client_id=\" + instagramkeys.instagramClientId;\r\n\r\n req.open(\"GET\", url, true);\r\n req.send();\r\n}", "function fetchDogs() {\n fetch(imgUrl)\n .then(resp => resp.json())\n .then(data => renderDogs(data));\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 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 }", "async function getPhotos() {\n try {\n const response = await fetch(apiUrl);\n photoArray = await response.json();\n displayPhoto();\n } catch (error) {\n //catch error here\n }\n}", "function displayPhotos() {\n imagesLoaded = 0;\n totalImages = photosArray.length;\n photosArray.forEach(photo => {\n let desc = photo.alt_description;\n let url = photo.links.html;\n let src = photo.urls.regular;\n\n // anchor for our image\n const item = document.createElement('a');\n setAttributes(item, {\n href: url,\n target: '_blank',\n });\n \n // <img> for our image\n const img = document.createElement('img');\n setAttributes(img, {\n src: src,\n alt: desc,\n title: desc,\n });\n \n // when the image is loaded\n img.addEventListener('load', hasImageLoaded);\n\n // add img to item; add item to image-container\n item.appendChild(img);\n imgContainer.appendChild(item);\n });\n}", "fetchRequest(id, fromType, data, token_val) {\n fetch(`${apiURL}/api/article/upload/images`, {\n method: 'post',\n headers: {\n Accept: 'application/json, text/plain, multipart/formdata, *',\n Authorization: `Bearer ${token_val}`,\n enctype: 'multipart/formdata',\n id,\n fromType,\n },\n body: data,\n })\n .then(res => res.json())\n .then((res) => {\n if (typeof res === 'object') {\n if (res.status == true) {\n const imgData = [\n {\n id: res.id,\n name: `${res.type}${res.id}`,\n url: `${apiURL}/${res.path}`,\n },\n ];\n localStorage.setItem(`imageUrl${res.id}`, JSON.stringify(imgData));\n if (fromType == 'photo') {\n this.setState({\n absoluteURL: `${apiURL}/${res.path}`,\n progress: 10,\n });\n this.demo_test();\n const imgData = [\n {\n id: res.id,\n name: 'main image',\n url: `${apiURL}/${res.path}`,\n },\n ];\n localStorage.setItem(`imageUrl${res.id}`, JSON.stringify(imgData));\n } else if (fromType == 'image') {\n const imgData = [\n {\n id: res.id,\n name: `${res.fromtype}${res.id}`,\n url: `${apiURL}/${res.path}`,\n },\n ];\n // if(!localData){\n localStorage.setItem(`imageUrl${res.id}`, JSON.stringify(imgData));\n // }\n let url = `${apiURL}/${res.path}`,\n key = `url${res.id}`,\n temp = {\n ...this.state.dynamicStates,\n [`url${res.id}`]: url,\n };\n this.setState({\n dynamicStates: temp,\n progress: 20,\n });\n this.demo_test2();\n }\n // let url = `${apiURL}/${res.path}`,\n // key = `url${res.id}`,\n // temp = {\n // ...this.state.dynamicStates,\n // [`url${res.id}`]: url,\n // };\n // this.setState({\n // dynamicStates: temp,\n // progress: 100,\n // });\n // this.demo_test();\n // toast.success(res.message, { position: toast.POSITION.TOP_CENTER });\n } else {\n toast.error(res.error, { position: toast.POSITION.TOP_CENTER });\n return false;\n }\n }\n });\n }", "function displayPhotos() {\r\n imagesLoaded = 0;\r\n totalImage = photoArray.length;\r\n \r\n //run function for each array in photoArray\r\n photoArray.forEach((photo) => {\r\n //create <a> to link to unsplash\r\n const item = document.createElement('a');\r\n // item.setAttribute('href', photo.links.html);\r\n // item.setAttribute('target', '_blank');\r\n setAttributes(item, {\r\n href: photo.links.html,\r\n target: '_blank',\r\n });\r\n //create <img> for photo\r\n const img = document.createElement('img');\r\n // img.setAttribute('src', photo.urls.regular);\r\n // img.setAttribute('alt', photo.alt_description);\r\n // img.setAttribute('title', photo.alt_description);\r\n setAttributes(img, {\r\n src: photo.urls.regular,\r\n alt: photo.alt_description,\r\n title: photo.alt_description,\r\n });\r\n //eventlistener , check when each is finish loading\r\n img.addEventListener('load', imageLoaded);\r\n // put <img> inside <a>, then put both inside image-container\r\n item.appendChild(img);\r\n imageContainer.appendChild(item);\r\n });\r\n}", "function getImages() {\n let searchTerm = document.getElementById('title').value;\n let url = \"\".concat(baseURL, 'configuration?api_key=', APIKEY); \n fetch(url)\n .then((result)=>{\n return result.json();\n })\n .then((data)=>{\n baseImageURL = data.images.secure_base_url;\n configData = data.images;\n console.log('config:', data);\n getMovies(searchTerm);\n})}", "getImages(tags){\n this.setState({\n imageList: []\n });\n imageService.getData(tags)\n .then(imageData => {\n // When the data is received successfully by back end service and status is success. Updates the imageList.\n if (imageData.status === \"success\") {\n var imageList = imageData.res;\n\n this.setState({\n imageList\n });\n } else if (imageData.status === \"error\") { // When service return status error writes error in imageList.\n var imageList = {\"items\":\"error\"};\n this.setState({\n imageList\n })\n }\n });\n\n }", "function init() \n{\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"GET\", \"https://picsum.photos/list\", true);\n\txhr.send(null);\n\n\txhr.onload = function()\n\t{\n\t\t// If the API was able to connect\n\t\tif(xhr.status == 200)\n\t\t{\n\t\t\t// IMPORTANT to unpack data\n\t\t\tpicList = JSON.parse(xhr.responseText);\n\t\t\tconsole.log(picList);\n\n\t\t\tfor(var i = 0; i < 10; i++)\n\t\t\t{\n\t\t\t\tvar Picture = ChangeImage();\n\t\t\t\tPictureSet.push(Picture);\n\t\t\t\tdocument.getElementById(\"img\" + i).innerHTML = PictureSet[i].author_link;\n\t\t\t\tdocument.getElementById(\"box\" + i).innerHTML = PictureSet[i].author;\n\t\t\t}\n\t\t}\n\t}\n}", "function displayPhotos() {\n loader.hidden = true;\n photos.forEach((photo) => {\n // Create Unspalsh page Link for the image\n const imageLink = document.createElement(\"a\");\n imageLink.setAttribute(\"href\", photo.links.html);\n imageLink.setAttribute(\"target\", \"_blank\");\n\n // Create image element\n const img = document.createElement(\"img\");\n img.setAttribute(\"src\", photo.urls.regular);\n img.setAttribute(\"alt\", photo.alt_description);\n img.setAttribute(\"title\", photo.alt_description);\n\n imageLink.appendChild(img);\n imageContainer.appendChild(imageLink);\n\n //event listner for image\n img.addEventListener(\"load\", imageLoaded);\n });\n}", "function getImages() {\n \t\tflickrService.getImages({text: $scope.query, page: $scope.currentPage, per_page:$scope.numPerPage}, function(res) {\n \t\t\tconsole.log(\"res: \", res);\n \t\t\t$scope.maxPages = res.photos.pages;\n \t\t\t$scope.images = res.photos.photo;\n \t\t});\n \t}", "function getPic(){\n $.ajax({\n url:MoonduDomain+'/photo/GetPhotoByTag',\n type:\"GET\",\n dataType:\"jsonp\",\n data:{uid:showUid,tag:showTag},\n success: function(data){ \n data=data.Data.Rows;\n console.log(data);\n for(i=0;i<data.length;i++){\n showPhoto.push(data[i].Photo);\n } \n console.log(showPhoto); \n var picList=\"\";\n for(i=0;i<3;i++){\n picList+='<img src=\"'+showPhoto[i]+'\">' \n $(\".show_box\").find(\".picLsit\").append($(picList));\n } \n }\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 renderImages(images){\n\t\tvar output = '';\n\t\t//console.log(images);\n\t\tvar allPhotos = images.photos.photo;\n\t\tfor (var key in allPhotos) {\n\t\t if (allPhotos.hasOwnProperty(key)) {\n\t\t //console.log(key + \" -> \" + allPhotos[key].id);\n\t\t output += '<li><img src=\"http://farm'+allPhotos[key].farm+'.staticflickr.com/'+allPhotos[key].server+'/'+allPhotos[key].id+'_'+allPhotos[key].secret+'_q.jpg\" /></li>';\n\t\t \tconsole.log(allPhotos[key].id);\n\t\t }\n\n\t\t}\n\t\tdocument.getElementById(\"flickr_images\").innerHTML = output;\n\n\t}", "function displayPhotos(){\n imagesLoaded = 0 ;\n totallImages = photosArray.length ;\n photosArray.forEach( photo => {\n\n // Create <a> to link to Unsplash\n const item = document.createElement('a');\n setAttributes(item,{\n href:photo.links.html,\n terget:'_blank'\n });\n // item.setAttribute('href', photo.links.html);\n // item.setAttribute('target','_blank');\n\n //create <img> tag for every image\n const img = document.createElement('img');\n\n setAttributes(img,{\n src: photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description,\n });\n img.addEventListener('load',imageLoaded);\n // img.setAttribute('src',photo.urls.regular);\n // img.setAttribute('alt',photo.alt_description);\n // img.setAttribute('title',photo.alt_description);\n\n //append <img> to <a> and to img container \n item.appendChild(img);\n imageContainer.appendChild(item)\n });\n}", "function displayPhotos() {\n totalImages = photosArray.length;\n /* runs function for each object in the photosArray */\n photosArray.forEach((photo) => {\n /* <a> for Unsplash */\n const item = document.createElement(\"a\");\n setAttributes(item, {\n href: photo.links.html,\n target: \"_blank\",\n });\n /* Create image for photos */\n const img = document.createElement(\"img\");\n setAttributes(img, {\n src: photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description,\n });\n /* Event listener for finished loading */\n img.addEventListener(\"load\", imageLoad)\n /* puts image inside anchor then both inside imageContainer */\n item.appendChild(img);\n imageContainer.appendChild(item);\n });\n}", "function getImages()\n\t{\n\t\tconsole.log('getImages')\n\t\tarr = []\n\t\tvar ajaxCall = $.get(targetUrl)\n\n\t\tajaxCall\n\t\t.done(function(response)\n\t\t{\t\n\t\t\t$.each(response.images, function(j)\n\t\t\t{\n\t\t\t\t$.each(response.images[j].array, (i)=>\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tlet tagArr = response.images[j].array[i].tag\n\t\t\t\t\tlet found = $.inArray(arrayKey, tagArr)\n\t\t\t\t\t//console.log(arrayKey, tagArr, found)\n\t\t\t\t\tif(found != -1)\n\t\t\t\t\t{\n\t\t \t\t\t\tarr.push(response.images[j].array[i])\n\t\t \t\t\t\tslide = \"<img id='slide' src='\" + arr[index].url + \"' alt=''>\" +\n\t\t \t\t\t\t\"<div class='img-title'><h3>\"+ arr[index].title + \"</h3></div>\"\n\t\t \t\t\t}\n\t\t \t\t\t\n\t\t\t\t})\n\t\t\t\t\n\t \t\t}) \n\t\t\tdisplaySlide($('#img-container'), slide)\n\t \t\tarrayLength = arr.length;\n\t\t\t\t\t\n\t\t})\n\t\t.fail(function(err)\n\t\t{\t\t\t\t\n\t\t\tthrow err\n\t\t})\n\n\t}", "componentDidMount() {\n fetch('https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=1f38b6734054154f700f8001ae0c691e&text=fjords&format=json&nojsoncallback=1&per_page=24&sort=relevance')\n .then(data=> data.json())\n .then(results=> {\n results = results.photos.photo\n this.setState({\n fjordPhotos: results\n });\n })\n .catch((error) => {\n console.log('Error with the fjord fetch',error);\n })\n \n fetch('https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=1f38b6734054154f700f8001ae0c691e&text=glaciers&format=json&nojsoncallback=1&per_page=24&sort=relevance')\n .then(data=> data.json())\n .then(results=> {\n results = results.photos.photo\n this.setState({\n glacierPhotos: results\n });\n })\n .catch((error) => {\n console.log('Error with the glacier fetch',error);\n })\n\n fetch('https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=1f38b6734054154f700f8001ae0c691e&text=icebergs&format=json&nojsoncallback=1&per_page=24&sort=relevance')\n .then(data=> data.json())\n .then(results=> {\n results = results.photos.photo\n this.setState({\n icebergPhotos: results\n });\n })\n .catch((error) => {\n console.log('Error with the iceberg fetch',error);\n })\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 displayPhotos(){\n //13 reset imagesLoaded = 0\n imagesLoaded = 0;\n //10 \n totalImages = photosArray.length;\n //Run Function for eache pbject in photosArray\n photosArray.forEach((photo) => {\n //Create <a> to link to Unsplash\n const item = document.createElement('a');\n // item.setAttribute('href' , photo.links.html);\n // item.setAttribute('target' , '_blank');\n setAttributes(item, {\n href: photo.links.html,\n target: '_blank'\n });\n // Create <img> for photos\n const img = document.createElement('img');\n // img.setAttribute('src' , photo.urls.regular);\n // img.setAttribute('alt' , photo.alt_description);\n // img.setAttribute('title' , photo.alt_description);\n setAttributes(img, {\n src: photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description\n });\n //7 Event Listener, Check when each if finished loading\n img.addEventListener('load', imageLoaded);\n // Put <img> inside <a>, then put both inside imageContainer Element\n item.appendChild(img);\n imageContainer.appendChild(item);\n\n });\n}", "function requestPhotos(location, imageType) {\n let url = `https://shrouded-mountain-15003.herokuapp.com/https://flickr.com/services/rest/?api_key=5b442fc0e500f32814449ea05f976c1e&format=json&nojsoncallback=1&method=flickr.photos.search&safe_search=1&per_page=5&lat=${location.latitude}&lon=${location.longitude}&text=${imageType}`\n \n fetch(url)\n .then(response => response.json())\n .then(showPhotos => {\n photosArray = showPhotos.photos.photo\n imgDivConstructor(photosArray)\n imgLinkDivConstructor(photosArray) \n })\n}", "async function getRandomPhoto() {\n try {\n const response = await fetch(apiUrl);\n photosArray = await response.json();\n displayPhotos();\n } catch (e) {\n //catch error\n }\n}", "function displayPics(response) {\n var picArray = [];\n for (var i = 0; i < 6; i ++) {\n // parse through response from Ajax request to grab a single image link\n var picString = \"<img src=\" + response.data[i].link + \"media\\/?size=t>\";\n picArray += picString;\n }\n // set the images div with new picArray created from Ajax request\n $(\"#images\").html(picArray);\n}", "function getFlickrImg(urlGallery){\n let url = `https://www.flickr.com/services/rest/?method=flickr.galleries.getPhotos&api_key=${keyAPI}&gallery_id=${urlGallery}&format=json&nojsoncallback=1?secret=${keySecret}`;\n\n// Fetching the data from the selected url\nfetch(url)\n.then(function (response) {\n if (response.status >= 200 && response.status < 300) {\n return response.json();\n // Shows an error alert and throws the error to the error handler\n } else {\n throw 'An error occured'\n }\n})\n.then(\n function (data) {\n console.log(data)\n\n // Getting the total number of photos from data\n let total = data.photos.total;\n\n // Creating array for the memory cards\n let cardDeck = []; \n\n // Creating a loop for getting the photos two times\n for (let i = 0; i<2; i++){ \n\n //Creating a loop for putting the photos inside the 'cardDeck'-array\n for (let j = 0; j < total; j++){ \n\n // Collecting the data from API\n let id = data.photos.photo[j].id;\n let serverId = data.photos.photo[j].server;\n let secret = data.photos.photo[j].secret;\n \n // Creating an instance object for 'Card'\n let card = new Card(j, serverId, id, secret);\n\n // Pushing the cards to the 'cardDeck'-array\n cardDeck.push(card);\n\n\n }\n }\n // Mixing the 'cardDeck' randomly\n cardDeck.sort( (a, b) => 0.5 - Math.random() ); \n\n // Creating a loop for creating a memory card for every photo\n for (let i = 0; i < cardDeck.length; i++){\n let memoryCard = document.createElement('aside');\n // \n memoryCard.dataset.num = cardDeck[i].imageNumber;\n memoryCard.classList.add('card', 'card-hidden');\n memoryCard.style.backgroundImage = `url(${cardDeck[i].imageLink()})`;\n gameWrap.appendChild(memoryCard);\n };\n\n // select the cards\n const card = document.querySelectorAll('aside');\n // make varibels for fliping the cards \n let hasFlippedCard = false;\n let firstCard, secondCard;\n let score = 1;\n let tries = 1;\n // varible for locke the board and fix the bugs \n let lockBoard = false;\n //function for flipping the cards\n function flipCard() {\n //we need to lock the board to avoid two sets of cards being turned at the same time, otherwise the flipping will fail.\n if (lockBoard) return;\n //There is still the case where the player can click twice on the same card. The matching condition would evaluate to true, removing the event listener from that card.\n if(this === firstCard) return;\n this.classList = '';\n this.classList.add('card');\n if (!hasFlippedCard) {\n hasFlippedCard = true;\n firstCard = this;\n }else{\n hasFlippedCard = false;\n secondCard = this;\n \n\n // if statment for matching cards\n if (firstCard.dataset.num === secondCard.dataset.num){\n firstCard.removeEventListener('click', flipCard)\n secondCard.removeEventListener('click', flipCard)\n let scoreCounter = document.querySelector('.score');\n scoreCounter.innerHTML = `Pairs found: ${score} / 12`\n score++;\n console.log(score)\n let triesCounter = document.querySelector('.tries');\n triesCounter.innerHTML = `Tries: ${tries}`\n tries++;\n } else{\n //When the player clicks the second card, lockBoard will be set to true and the condition if (lockBoard) return; will prevent any card flipping before the cards are hidden or match\n lockBoard=true;\n setTimeout(function(){\n firstCard.classList.add('card-hidden')\n secondCard.classList.add('card-hidden')\n let triesCounter = document.querySelector('.tries');\n triesCounter.innerHTML = `Tries: ${tries}`\n tries++;\n lockBoard=false;\n }, 1000);\n }\n }\n // Shows an alert with numbers of tries, when completing the game \n if (score === 13) {\n setTimeout(function(){\n alert(`Congratulations! You completed the game with ${tries-1} tries`);\n }, 500);\n }\n }\n\n \n \n card.forEach(card => card.addEventListener('click', flipCard));\n }\n // Catchese the error thrown in the respons function\n).catch(\n error => {\n console.log('Fel: ', error);\n\n }\n);\n}", "async function getPhotosfromAPI() {\n ArePicturesLoaded = false;\n try {\n const response = await fetch(apiUrl)\n photosArray = await response.json();\n displayPhotos();\n } catch (error) {\n console.log('can not retrieve data', JSON.stringify(error))\n }\n}", "componentDidMount() {\n const url = new URL(window.location.href);\n const houseId = url.searchParams.get('house_id');\n console.log('HOUSE ID ', houseId)\n // const house = request.data[0];\n\n fetch(`/api/photos/${houseId}`)\n .then((result) => {\n return result.json()\n })\n .then((response) => {\n console.log(response)\n this.setState({\n photoList: response[0].photoUrl,\n homepagePhotos: response[0].photoUrl.slice(0, 5)\n })\n //access the id of url, and display that specific object\n //[url, url, url]\n console.log('HOMEPAGEPHOTOS ', this.state.homepagePhotos, 'PHOTOLIST ', this.state.photoList)\n })\n .catch((err)=> {\n console.error(err)\n })\n }", "render() {\n console.log(this.state.photos);\n return (\n <div className=\"Container\">\n {\n (this.state.loading)\n ? <p>Loading...</p>\n : <ImageList data={this.state.photos} query={this.state.query}/>\n }\n </div>\n );\n }", "componentDidMount(){\n fetch(\"https://api.imgflip.com/get_memes\").then(response=> response.json()).then(response=> {\n const {memes} = response.data \n this.setState({\n imgArray: memes\n }) \n })\n \n }", "async _loadImages() {\n if (this.state.hasMore && this.state.query) {\n this.setState({ isLoading: true })\n const { data, limit, query, offset } = this.state\n try {\n const response = await axios.get('http://api.giphy.com/v1/gifs/search', {\n params: {\n api_key: process.env.GIPHY_KEY,\n limit: limit,\n offset: offset * limit,\n q: query,\n }\n })\n\n const newState = {\n data: [...data, ...response.data.data],\n isLoading: false,\n offset: offset + 1\n }\n\n // if there are no more images to fetch\n if (response.data.pagination.count + response.data.pagination.offset === response.data.pagination.total_count) {\n newState.hasMore = false\n }\n setTimeout(() => this.setState(newState), 1000)\n } catch(err) {\n console.log(err, typeof err)\n this.setState({ error: err.message, isLoading: false })\n }\n }\n }" ]
[ "0.77297944", "0.7561833", "0.7464669", "0.74505633", "0.7434848", "0.7382563", "0.736727", "0.73121357", "0.72514975", "0.72221726", "0.71728706", "0.7157647", "0.71489865", "0.7117547", "0.7053838", "0.704792", "0.70380694", "0.7037564", "0.7029955", "0.70074815", "0.69985944", "0.69706583", "0.69486403", "0.69394696", "0.69301224", "0.6924151", "0.6907828", "0.6904315", "0.6895466", "0.68906015", "0.6882516", "0.6882026", "0.68662906", "0.6850781", "0.6821343", "0.6816251", "0.6814347", "0.68107617", "0.6806627", "0.67976916", "0.67932653", "0.6770485", "0.6766893", "0.67621446", "0.67459375", "0.67388856", "0.6734801", "0.6716064", "0.67113006", "0.67054486", "0.66830766", "0.66760004", "0.6672911", "0.6667144", "0.6662209", "0.6656294", "0.6654234", "0.6650825", "0.66440535", "0.6638744", "0.6634245", "0.66297686", "0.6627023", "0.6621449", "0.66209036", "0.661634", "0.66062367", "0.6604144", "0.6587909", "0.6575831", "0.6561968", "0.65592927", "0.6558027", "0.65568537", "0.655147", "0.6548987", "0.65481025", "0.6543715", "0.65327126", "0.65325207", "0.6530233", "0.6527096", "0.65233696", "0.6520223", "0.6517787", "0.6514227", "0.6511464", "0.65043455", "0.6493806", "0.6482083", "0.6479256", "0.64630383", "0.64444304", "0.6442318", "0.6432796", "0.64229405", "0.6418636", "0.64101297", "0.6409794", "0.639577" ]
0.6621467
63
used to make the object available to the private methods PRIVATE METHODS
function _getlinks () { return links; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "privateMethod() {\n\t}", "function priv () {\n\t\t\t\n\t\t}", "function _privateFn(){}", "_privateFunction() {}", "obtain(){}", "function __Object__() {\n }", "function privateMethodOne() {\n\t\t\tvar c = this;\n\n\t\t}", "_private_method() {\n console.log('private hey');\n }", "_initPrivate(args){\n //\n }", "get isPrivate(){\r\n return this._isPrivate\r\n }", "function internalClass() { }", "function privateMethod() {\n console.log(\"Soy un metodo privado\")\n }", "function modulePrivateMethod () {\n return;\n }", "function modulePrivateMethod () {\n return;\n }", "function Coolmodule(){\n\nvar something = \"Cool\" ; // The private data member\nvar cool = [1,2,3] ; // The private data member\n\nfunction doSomething(){\n\tconsole.log(something) ;\n}\n\nfunction doAnother(){\n\tconsole.log(cool.join(\" ! \"));\n}\n\nreturn { // Returning the object which hides the internal functions which access the private Data member\n\tdoSomething : doSomething,\n\tdoAnother : doAnother\n}\n\n}", "function privateMethod(){\n console.log( \"I am private\" );\n }", "function SimplePrivate() {\n var foo = 4;\n\n this.getFoo = function (){\n return foo;\n };\n\n\n}", "transient private protected internal function m182() {}", "consstructor(){\n \n\n }", "get object() {\n\n }", "function _construct()\n\t\t{;\n\t\t}", "function MyObject(){\n\t//private variables and functions\n\tvar privateVariable = 10;\n\tfunction privateFunction(){\n\t\treturn false;\n\t}\n\t//privileged methods\n\tthis.publicMethod = function (){\n\t\tprivateVariable++;\n\t\treturn privateFunction();\n\t};\n}", "function powerConstructor(x) {\n let that = {}; // object creates\n let privateVar = \"\"; // private members\n let privateFunc = function () {}; // private members\n that.privilegedPublicMethod = function () {\n // use private secret function variable here ..\n };\n}", "transient protected internal function m189() {}", "constructor() {\r\n const privateVariable = 'private value'; // Private variable at the constructor scope\r\n this.publicVariable = 'public value'; // Public property\r\n \r\n this.privilegedMethod = function() {\r\n // Public Method with access to the constructor scope variables\r\n console.log(privateVariable);\r\n };\r\n }", "function SyncPrivateApi() {}", "function constructor() {\n // Private members\n var privateVar1 = \"Nishant\";\n var privateVar2 = [1,2,3,4,5];\n\n function privateMethod1() {\n // code stuff\n }\n\n function privateMethod1() {\n // code stuff\n }\n\n return {\n attribute1 : \"Nishant\",\n publicMethod: function() {\n //alert(\"Nishant\");// some code logic\n }\n }\n }", "init(data) {\r\n this.object = data.object;\r\n }", "function _____SHARED_functions_____(){}", "function privateMethod() {\n console.log(\"I am private\");\n }", "function Vehicle(name, wheels,passengers,speed) {\n this.name = name;\n this.speed = speed;\n this.wheels = wheels;\n this.passengers = passengers;\n this.makeNoise = function (noise) {\n console.log(noise,noise);\n };\n var self = this;\n var distance_travelled = 0; //privateMethod\n var updateDistanceTravelled = function () {\n distance_travelled += self.speed;\n };//privateMethod\n // Object can access the privateMethod;\n // privateMethod uses self to refer object and access object attribute\n this.move = function (noise) {\n updateDistanceTravelled();\n this.makeNoise(noise);\n return this;\n };\n //use return to chain function \n this.checkMiles = function () {\n console.log(distance_travelled);\n };\n }", "consructor() {\n }", "function MyClass() { // Funzione Costruttore\n\n var privateVariable = \"privateVariable\"; // variabile privata\n\n this.publicVariable = \"publicVariable\"; // variabile pubblica\n\n function privateMethod() {\n return \"privateMethod\";\n }\n\n this.privilegedMethod = function () { // metodo pubblico\n // i metodi pubblici possono ovviamente accedere a variabili e metodi\n // privati del costruttore poichè questi \"vivono\" nello scope\n // della funzione costruttore e quindi sono visibili ed accessibili\n // a questo livello\n console.log(privateVariable);\n console.log(privateMethod());\n };\n}", "function callingPrivateConstructor() {\n /*jshint validthis:true*/\n throw new Error('Cannot call parent constructor in class \"' + this.$name + '\" because it\\'s declared as private.');\n }", "__previnit(){}", "function privateMethod(){\n console.log( \"I am private\" );\n }", "function privateMethod(){\n console.log( \"I am private\" );\n }", "constructor(x,y){\n this.a = x;\n this.b = y;\n this.#data = y;\n console.log(`Private data = ${this.#data}`);\n }", "function privateFunction() {\n\n}", "function privateMethod ( ) {\n console. log ( \"I am private\" ) ; \n }", "transient private internal function m185() {}", "function ExtraMethods() {}", "function privateMethod() {\n console.log('I am private');\n }", "init () {\n\t\treturn null;\n\t}", "constructor() {\n this.internal = [];\n }", "function _ctor() {\n\t}", "private public function m246() {}", "transient private protected public internal function m181() {}", "privateMethod () {\n console.log(\"Hi i'm \" + this.name + \"i'm a \" + this.gender + \"and this is my ssn\" + this.ssn);\n }", "function HidPrivate (age, status){\n\n var abullah = {\n x : 20,\n y : 30\n }\n// 1 number way to get\n this.getAbdulla = function (){\n return abullah\n }\n\n// 2 number way to get\n Object.defineProperty(this, 'getabdullah', {\n get:function(){\n return abullah\n },\n // setter\n set:function (value){\n abullah = value;\n }\n })\n\n var rahim = function (){\n lg( 'I am ' + age +'and ' + status +'marriged')\n }\nthis.age = age;\nthis.status = status;\n\nthis.all = function(){\n\n\n lg( this.age + this.status)\n\n function Naem (){\n lg(age - status)\n }\n\n this.she = function (){\n return Naem()\n \n\n}\nrahim()\n}\n}", "function privateFunction(){\n\t// That will be used only on this file\n}", "function vanillaObject(param) {\n var myVarPublic = 2;\n var myVarPrivate = param;\n\n function private1() {\n \n }\n function publicGetter() {\n return myVarPrivate;\n }\n function publicSetter(param) {\n myVarPrivate = param;\n return myVarPrivate;\n }\n // public functions (API)\n return Object.freeze({\n myVarPublic1: myVarPublic,\n publicGetter1: publicGetter,\n publicSetter1: publicSetter\n });\n}", "function NXObject() {}", "constructor() {\n\n\t}", "constructor() {\n super();\n this._init();\n }", "function modulePatter() {\n // variables and functions here are private and are only accessed through the public functions in the returned object\n var privateVariable = \"I am private\";\n\n var privateFunction = function() {\n console.log(privateVariable);\n };\n\n return {\n // everything returned is public\n changeVar: function(str) {\n privateVariable = str;\n },\n readVar: function() {\n privateFunction();\n }\n };\n}", "function Circle(radius){\n this.radius = radius; \n //This code below can not be access from the outsise(private)\nlet defaultLocation = {x: 0, y: 0}\n\n //The code below can be access from outside of the Circle function\n //this.defaultLocation = { x:0, y: 0} \n this.getDefaultLocation = function() {\n return defaultLocation; \n }\n\n this.draw = function(){ \n console.log('draw')\n }\n\n // ----this---- is referrering to the the property of the Circle \n Object.defineProperty(this, 'defaultLocation',{\n //'defaultLocation' referres to read only \n get: function() { \n return defaultLocation\n },\n set: function(value) { \n defaultLocation = value;\n }\n })\n}", "constructor() {\r\n // ohne Inhalt\r\n }", "accessSecret(){\n this.#secret(); // method in class be a property\n }", "constructor() {\n\t\t// ...\n\t}", "_init() {\n throw new Error('_init not implemented in child class');\n }", "transient final protected internal function m174() {}", "function Api(){\n}", "function or(){this.__data__=new Ut}", "constructor() {\n this._initialize();\n }", "function obj() { return this; }", "init() {\n }", "constructor() {\n super()\n self = this\n self.init()\n }", "_initialize() {\n\n }", "function _init() {\n }", "constructor () {\n super();\n this._modifiers = {};\n }", "function HelperConstructor() {}", "constructor(o) {\n var self = this;\n }", "constructor(o) {\n var self = this;\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n }", "init(){\n \n }", "static initialize(obj, method, path) { \n obj['method'] = method;\n obj['path'] = path;\n }", "static create () {}", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor () {\r\n\t\t\r\n\t}" ]
[ "0.7237648", "0.69850814", "0.6927589", "0.6791102", "0.657036", "0.6493528", "0.6441262", "0.6427114", "0.64189297", "0.6333867", "0.6295223", "0.6293476", "0.6270686", "0.6270686", "0.61470866", "0.61328083", "0.61270475", "0.612138", "0.61105853", "0.6101497", "0.60562634", "0.6050265", "0.6047492", "0.60236853", "0.6004688", "0.6003473", "0.5991652", "0.59730715", "0.59478307", "0.59341973", "0.59264666", "0.59103507", "0.5905947", "0.59012765", "0.5878022", "0.58742726", "0.58742726", "0.5871111", "0.58606213", "0.5842866", "0.5834497", "0.5831766", "0.58311045", "0.5807652", "0.5807028", "0.5805416", "0.57927376", "0.5785415", "0.578289", "0.57786953", "0.57548195", "0.57474613", "0.57443136", "0.57357246", "0.57349455", "0.5721715", "0.5687839", "0.56847465", "0.5677783", "0.56751984", "0.56681275", "0.5667578", "0.56626177", "0.5657991", "0.56530267", "0.5650052", "0.56410515", "0.56077135", "0.56049424", "0.5603285", "0.5593897", "0.5592295", "0.5591872", "0.5591872", "0.557648", "0.557648", "0.5576405", "0.55719143", "0.55655926", "0.5564805", "0.55630356", "0.55630356", "0.55630356", "0.55630356", "0.55630356", "0.55630356", "0.55630356", "0.55630356", "0.55630356", "0.55630356", "0.55630356", "0.55630356", "0.55630356", "0.55630356", "0.55630356", "0.55630356", "0.55630356", "0.55630356", "0.55630356", "0.55630356", "0.55549777" ]
0.0
-1
Get the web token (jwt) if the user has it. If not, each of the components that are rendered will redirect the user back to the Login component (except for the Register component)
componentDidMount() { //Get JWT from cookie const jwt = getCookieJwt(); if (!jwt) { console.log("No Jwt") } else { API.getUser() .then(userData => { console.log('User data: ', userData) this.setState({ email: userData.data.email, accountType: parseInt(userData.data.accountType), jwt, loggedIn: true }); }) //Console log errors and remove the Jwt from the cookie .catch(err => { console.log(err); removeCookieJwt(); }) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "userLogin() {\n if (!localStorage.token) {\n return (\n <Redirect to={{ pathname: '/login', state: this.props.location }} />\n );\n }\n }", "componentDidMount() {\n\n let currentUser = TokenService.getUserId();\n console.log(currentUser)\n\n //if the user is not logged in, send him to landing page\n if (!TokenService.hasAuthToken()) {\n window.location = '/';\n }\n }", "checkForToken() {\n let hash = this.props.location.hash || this.props.location.search;\n if (hash === \"\") return;\n\n const params = this.getParams(hash);\n if (params.access_token) this.attemptSignIn(params.access_token);\n if (params.error) {\n this.props.history.push(\"/\");\n }\n }", "getJwt() {\n // if (localStorage && localStorage.getItem(token)) {\n\n return localStorage.getItem(\"jwtToken\");\n // )\n // || null;\n // }\n\n // // if (sessionStorage && sessionStorage.getItem(key)) {\n // // return parse(sessionStorage.getItem(key)) || null;\n // // }\n\n // return null;\n }", "componentDidMount() {\n if (!localStorage.getItem(\"token\")) {\n this.props.history.push(\"/\");\n } else {\n api.auth.getCurrentUser().then(data => {\n if (data.error || this.props.authUser.id !== data.user.id) {\n this.props.history.push(\"/\");\n }\n });\n }\n }", "function authenticateUser() {\n let jwt = localStorage.getItem('jwt');\n if (jwt) {\n LoginActions.loginUser(jwt);\n }\n}", "async handleSubmit(e) {\n const url = 'http://localhost/junior-workers/api/login.php';\n const data = {\"email\":this.state.email, \"password\":this.state.password};\n\n try {\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(data),\n });\n \n if(response.status !== 200) {\n this.setState({\n displayMessageFlag: !this.state.displayMessageFlag,\n displayMessageClass: <DisplayMessage displayMessage=\"Unable to login\" displayMessageFlag={!this.state.displayMessageFlag} />\n });\n }\n else if (response.status === 200) {\n const json = await response.json();\n localStorage.setItem(\"jwt\", json[\"jwt\"]);\n var temp = \"\";\n // navigate user to the proper profil according to their role\n if(json[\"role\"] === \"candidate\") {\n temp = <Redirect to='/my-candidate-profil' />;\n } else if(json[\"role\"] === \"hirer\") {\n temp = <Redirect to='/my-hirer-profil' />;\n }\n this.setState({redirect : temp});\n }\n } catch (error) {\n console.error('Error:', error);\n this.setState({\n displayMessageFlag: !this.state.displayMessageFlag,\n displayMessageClass: <DisplayMessage displayMessage=\"Unable to login\" displayMessageFlag={!this.state.displayMessageFlag} />\n });\n }\n }", "function checkLoginUser(req,res,next){\n var userToken=localStorage.getItem('userToken');\n try {\n if(req.session.userName){\n var decoded = jwt.verify(userToken, 'loginToken');\n }else{\n res.redirect('/');\n }\n } catch(err) {\n res.redirect('/');\n }\n next();\n}", "login(req, res, next) {\n const tokenHttpOnly = req.cookies.tokenHttpOnly;\n const token = req.cookies.token;\n\n if (token && tokenHttpOnly) {\n jwt.verify(tokenHttpOnly, this.secret, (error, decoded) => {\n if (error) {\n return next();\n } else {\n return res.redirect(\"/\");\n }\n });\n }\n\n next();\n }", "function App() {\n\n let authenticated = false;\n\n const token = localStorage.FBItem;\n console.log(token);\n if (token) {\n const decodedToken = jwtDecode(token);\n console.log(decodedToken);\n if (decodedToken.exp * 1000 < Date.now()) {\n window.location = '/login';\n authenticated = false;\n } else {\n authenticated = true;\n }\n };\n\n return (\n <Provider store={store}>\n <ThemeProvider theme = {theme}>\n <BrowserRouter>\n <Navbar />\n <div className=\"container\">\n <Switch>\n <AuthRoute exact path=\"/login\" component={Login} authenticated={authenticated}/>\n <AuthRoute exact path=\"/signup\" component={Signup} authenticated={authenticated}/>\n <Route exact path=\"/\" component={Home}/>\n <Route exact path=\"/play\" component={Play}/>\n </Switch>\n </div>\n </BrowserRouter>\n </ThemeProvider>\n </Provider> \n );\n}", "componentWillMount() {\n if (!localStorage.getItem(\"token\")) {\n browserHistory.push(\"/users/login\");\n }\n }", "function checkUserToken() {\n if (localStorage.getItem('user-token') == null) {\n window.location.replace('index.html');\n return true;\n }\n return false;\n}", "function checkLogin(req, res, next) {\n var loginToken =localStorage.getItem(\"loginToken\");//getting credential from localstorage\n try {\n if(req.session.userName){\n var decode = jwt.verify(loginToken, \"loginToken\");\n }\n else{\n res.redirect(\"/\");\n }\n \n } catch (err) {\n \n }\n next(); //passing control to next mthod\n}", "componentWillMount(){\n if (!localStorage.getItem('token')) {\n browserHistory.push('/login');\n }\n }", "function checkJWT() {\n if (!isLoggedIn())\n window.location.replace('/sign-in/?return=/daily-data/');\n}", "function checkLogin(req,res,next){\n var myToken= localStorage.getItem('myToken');\n try {\n jwt.verify(myToken, 'loginToken');\n } catch(err) {\n res.send (\"you need login to access this page\");\n }\n next();\n}", "login(event){\n // const { username, password, errors} = this.state\n event.preventDefault();\n if(!this.handleValidation()){\n console.log('Form has error')\n }else{\n const userData = JSON.parse(localStorage.getItem(\"user\"));\n // const userDetail = userData.find(item => item.user == this.state.username);\n if (userData.username != this.state.username) {\n console.log('User Not Found')\n }\n if (userData.password != this.state.password) {\n console.log('Invalid Credential');\n }\n localStorage.setItem('token', 'res.data.token');\n window.open('http://localhost:3000/home', '_self')\n }\n\n }", "handleLogin(data) {\n axios\n .post(\"/api/users/login\", data)\n .then(function (res) {\n const { token } = res.data;\n localStorage.setItem(\"jwtToken\", token);\n setAuthToken(token);\n })\n .catch(function (err) {\n console.log(err);\n });\n //set the loggin status.\n if (localStorage[\"jwtToken\"] != null) {\n this.setState({\n loggedIn: true,\n });\n }\n }", "componentDidMount(){\n let token = localStorage.getItem(\"token\");\n if(!!token){\n return fetch(`https://infinite-spire-87700.herokuapp.com/api/v1/users/${token}`)\n .then(response => response.json())\n .then(foundUser => this.props.loginUser(foundUser))\n }\n else {\n this.props.routerProps.history.push(`/login`);\n }\n }", "function App() {\n // ------------------------------------------------\n // Load this function when refreshing\n // ------------------------------------------------\n window.onload = loadMenu;\n // ---------------------------------------------------------------------\n // Execute 'loadMenu' to remove buttons that user is not authorised for\n // ---------------------------------------------------------------------\n function loadMenu() {\n // Works only with nav-links that have 'render' instead of 'component' below in return\n if (istrue) {\n // Do not show these buttons to unauthorise user\n document.getElementById(\"edit\").children[6].style.display = \"none\";\n document.getElementById(\"edit\").children[5].style.display = \"none\";\n document.getElementById(\"edit\").children[4].style.display = \"none\";\n document.getElementById(\"edit\").children[3].style.display = \"none\";\n }\n }\n // ------------------------------------------------\n // Set up variables for authentication\n // ------------------------------------------------\n // ------------------------------------------------\n // Reference : pern-jwt-tutorial\n // ------------------------------------------------\n const [isAuthenticated, setIsAuthenticated] = useState(false); // Set user authentication\n const [istrue, setIstrue] = useState(true); // Set button authentication\n\n const setAuth = (boolean) => {\n setIsAuthenticated(boolean);\n };\n const setTrue = (boolean) => {\n setIstrue(boolean);\n };\n // ------------------------------------------------\n // Handle useEffect to recieve JWT token\n // ------------------------------------------------\n // ------------------------------------------------\n // Reference : pern-jwt-tutorial\n // ------------------------------------------------\n const checkAuthenticated = async () => {\n try {\n const res = await fetch(\"http://localhost:5000/auth/verify\", {\n method: \"POST\",\n headers: { jwtToken: localStorage.jwtToken },\n });\n const parseRes = await res.json(); // Recieve back 'true'in header\n if (parseRes == true) {\n // Set 'true' if 'true' in header\n setAuth(true);\n } else {\n // Set 'false' if not 'true' in header\n setAuth(false);\n }\n setTrue(false); // Set 'false' if 'true' in header\n } catch (err) {\n console.error(err.message);\n }\n };\n // ------------------------------------------------\n // Handle 'logout' button\n // ------------------------------------------------\n // ------------------------------------------------\n // Reference : pern-jwt-tutorial\n // ------------------------------------------------\n const logout = async (e) => {\n try {\n localStorage.removeItem(\"jwtToken\"); // Remove JWT token to unauthorise user\n setAuth(false); // Set 'false' to unauthorise user\n setTrue(true); // Set 'true' to unauthorise user\n document.getElementById(\"edit\").children[2].style.display = \"block\"; // Show only unauthorise buttons\n document.getElementById(\"edit\").children[1].style.display = \"block\";\n document.getElementById(\"edit\").children[6].style.display = \"none\";\n document.getElementById(\"edit\").children[5].style.display = \"none\";\n document.getElementById(\"edit\").children[4].style.display = \"none\";\n document.getElementById(\"edit\").children[3].style.display = \"none\";\n toast.success(\"Logout Successfully!\"); // Display notification of user Logging out\n } catch (err) {\n console.error(err.message);\n }\n };\n // ---------------------------------------------------------------------------------------\n // Handle 'handleClick' to display buttons the user is authorised to see when signing in\n // ---------------------------------------------------------------------------------------\n function handleClick() {\n if (isAuthenticated) {\n document.getElementById(\"edit\").children[2].style.display = \"none\"; // Show only authorise buttons\n document.getElementById(\"edit\").children[1].style.display = \"none\";\n document.getElementById(\"edit\").children[6].style.display = \"block\";\n document.getElementById(\"edit\").children[5].style.display = \"block\";\n document.getElementById(\"edit\").children[4].style.display = \"block\";\n document.getElementById(\"edit\").children[3].style.display = \"block\";\n }\n if (!isAuthenticated) {\n document.getElementById(\"edit\").children[2].style.display = \"block\";\n document.getElementById(\"edit\").children[6].style.display = \"none\";\n }\n }\n // ------------------------------------------------\n // Execute 'checkAuthenticated' function\n // ------------------------------------------------\n useEffect(() => {\n checkAuthenticated();\n }, []);\n // ---------------------------------------------------\n // Display web page including header, footer and body\n // ---------------------------------------------------\n // ------------------------------------------------\n // Reference : pern-jwt-tutorial\n // ------------------------------------------------\n return (\n <html lang=\"en\">\n <head>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n\n <title>Home</title>\n </head>\n\n <body>\n <Router>\n <div class=\"container\">\n <div class=\"header clearfix\">\n <nav>\n <ul class=\"nav nav-pills\" id=\"edit\">\n <li>\n <Link to=\"/viewrequestfavours\">Home</Link>\n </li>\n <li>\n <Link to=\"/signup\">Sign up</Link>\n </li>\n\n <li>\n <Link to=\"/login\">Login</Link>\n </li>\n <li>\n <Link to=\"/createfavour\">Create Favour</Link>\n </li>\n <li>\n <Link to=\"/leaderboard\">Leaderboard</Link>\n </li>\n <li>\n <Link to=\"/manageaccount\">Manage Account</Link>\n </li>\n <li>\n <button\n onClick={(e) => logout(e)}\n className=\"btn btn-primary\"\n >\n Logout\n </button>\n </li>\n <Switch>\n <Route\n exact\n path=\"/\"\n render={() => {\n return <Redirect to=\"/viewrequestfavours\" />;\n }}\n />\n <Route\n exact\n path=\"/viewrequestfavours\"\n component={ViewRequestFavours}\n />\n <Route\n path=\"/managefavours\"\n render={(props) =>\n isAuthenticated ? (\n <ManageFavours {...props} setAuth={setAuth} />\n ) : (\n <Redirect to=\"/login\" />\n )\n }\n //component={ManageFavours}\n />\n <Route\n path=\"/updateowefavour/:id\"\n component={UpdateOweFavour}\n render={(props) =>\n isAuthenticated ? (\n <UpdateOweFavour {...props} setAuth={setAuth} />\n ) : (\n <Redirect to=\"/login\" />\n )\n }\n />\n <Route\n path=\"/completefavour/:id\"\n component={CompleteFavour}\n render={(props) =>\n isAuthenticated ? (\n <CompleteFavour {...props} setAuth={setAuth} />\n ) : (\n <Redirect to=\"/login\" />\n )\n }\n />\n <Route\n path=\"/viewowefavour/:id\"\n component={ViewOweFavour}\n render={(props) =>\n isAuthenticated ? (\n <CompleteFavour {...props} setAuth={setAuth} />\n ) : (\n <Redirect to=\"/login\" />\n )\n }\n />\n <Route\n path=\"/ExistingFavours\"\n component={ExistingFavours}\n render={(props) =>\n isAuthenticated ? (\n <CompleteFavour {...props} setAuth={setAuth} />\n ) : (\n <Redirect to=\"/login\" />\n )\n }\n />\n <Route\n path=\"/editaccount\"\n render={(props) =>\n isAuthenticated ? (\n <EditAccount {...props} setAuth={setAuth} />\n ) : (\n <Redirect to=\"/login\" />\n )\n }\n />\n <Route\n path=\"/createfavour\"\n render={(props) =>\n isAuthenticated ? (\n <SelectForm {...props} setAuth={setAuth} />\n ) : (\n <Redirect to=\"/login\" />\n )\n }\n />\n <Route\n path=\"/login\"\n render={(props) =>\n !isAuthenticated ? (\n <Login {...props} setAuth={setAuth} />\n ) : (\n <Redirect\n to=\"/viewrequestfavours\"\n {...handleClick()}\n setTrue={false}\n />\n )\n }\n />\n <Route\n path=\"/signup\"\n render={(props) =>\n !isAuthenticated ? (\n <SignUp {...props} setAuth={setAuth} />\n ) : (\n <Redirect to=\"/login\" />\n )\n }\n />\n <Route\n path=\"/leaderboard\"\n render={(props) =>\n isAuthenticated ? (\n <Leaderboard {...props} setAuth={setAuth} />\n ) : (\n <Redirect to=\"/login\" />\n )\n }\n />\n <Route\n path=\"/manageaccount\"\n component={ManageAccount} // Need to add user authentication in 'manageaccount'\n />\n </Switch>\n </ul>\n </nav>\n </div>\n <footer class=\"footer\">\n <p>&copy; Adv Internet Programing</p>\n </footer>\n </div>\n </Router>\n </body>\n </html>\n );\n}", "function requireVerification(nextState, replace) {\nvar userInfo = JSON.parse(localStorage.getItem(\"userInfo\"));\n\nif(userInfo){\nif(userInfo.id){\n console.log(\"This is token \",userInfo.id);\n} \n}else{\n replace({ pathname: \"/login\" });\n \n}\n\n}", "function userAccess(req, res, next){\n var userToken = localStorage.getItem('userToken');\n try {\n var decode = jwt.verify(userToken, 'loginToken');\n console.log('access')\n } catch (error) {\n console.log('DENIED')\n res.redirect('/login')\n }\n next()\n }", "function checkLoginUser(req,res,next){\n var userToken=localStorage.getItem('userToken');\n try {\n //use session here\n if(req.session.userName){\n var decoded = jwt.verify(userToken, 'loginToken');\n }else{\n res.redirect('/');\n }\n } catch(err) {\n res.redirect('/');\n }\n next();\n}", "function checkLoginUser(req,res,next){\n var userToken=localStorage.getItem('userToken');\n try {\n //use session here\n if(req.session.userName){\n var decoded = jwt.verify(userToken, 'loginToken');\n }else{\n res.redirect('/');\n }\n } catch(err) {\n res.redirect('/');\n }\n next();\n}", "function checkAuth() {\n let auth = $cookies.get('authToken');\n if (auth){\n } else {\n $state.go('home');\n }\n }", "function checkAuth() {\n let auth = $cookies.get('authToken');\n if (auth){\n } else {\n $state.go('home');\n }\n }", "verifyLogin() {\n const obj = getFromStorage('the_main_app');\n console.log(\"Obj.token from storage \" + obj.token)\n if (obj && obj.token) {\n fetch('/api/account/verify?token=' + obj.token)\n .then(res => res.json())\n .then(json => {\n if (json.success) {\n this.setState({\n token: obj.token,\n });\n }\n /*This is where everything needed for the page is loaded when a user \n session is found or not found, so this is the time to render something*/\n this.setState({ isAuthenticating: false })\n });\n }\n }", "function checkLogIn() {\n if (localStorage.getItem('token') === null) {\n window.location.href = './login.html';\n }\n}", "function authorize() {\n let isAuthenticated = commonService.getFromStorage('token');\n if (!isAuthenticated) {\n commonService.redirect(\"login.html\");\n }\n}", "static authrequire(req, res, next){\n const token= req.cookies.jwt;\n\n if(token){\n jwt.verify(token, process.env.JWTSECRET, (err, newToken)=>{\n if(err){\n console.log(err);\n res.redirect('login');\n }else{\n console.log(newToken);\n next();\n }\n })\n }else{\n res.redirect('login');\n }\n }", "componentDidMount() {\n if(localStorage.getItem('jwt_token')) {\n this.CheckTokenStatus();\n }\n }", "componenDidMount() {\n getTokens(value => {\n if (value[0][1] === null) {\n this.setState({ loading: false });\n } else {\n this.props.autoSignIn(value[1][1]).then(() => {\n if (!this.props.User.auth.token) {\n this.setState({ loading: false });\n // this.props.navigation.navigate(\"Home\");\n } else {\n setTokens(this.props.User.auth, () => {\n this.props.navigation.navigate(\"Home\");\n });\n }\n });\n }\n });\n }", "checkNormalPageAccess() {\n //check user's token ...\n //faking it \n return this.state.userLogged\n }", "function validateJwt(req, res) {\n try {\n const superSecret = process.env.SECRET;\n\n const ber = req.headers.cookie.split(\"=\")[1]; // parse auth headers , to get token\n const decoded = jwt.verify(ber, superSecret);\n\n // console.log(\"decoded\", decoded);\n\n if (decoded) {\n res.locals.user = decoded.data[0]; // data = [username , email , id]\n res.locals.email = decoded.data[1]; // passing to next middleware\n res.locals._id = decoded.data[2];\n\n res.locals.authenticated = true; // maybe not needed\n\n res.status(200).json({\n success : true , \n message : \"we have user , token is good\" ,\n data : {\n ...res.locals\n }\n });\n }\n } catch (err) {\n // redirect here , maybe\n\n res.status(403).json({\n message: err.message, // remove message in production\n messageProduction: \"invalid token\",\n success: false,\n redirect: true, // redirecto to login popup\n });\n }\n}", "function Login(props) {\n const dispatch = useDispatch();\n\n const [email, setEmail] = useState();\n const [password, setPassword] = useState();\n const [error, setError] = useState();\n const register = () => {\n props.history.push(\"/register\");\n }\n\n const forgot_password = () =>{\n props.history.push(\"/forgot_password\");\n }\n \n const submit = async (e) => {\n e.preventDefault();\n try {\n const user = { email, password };\n \n dispatch(loginUser(user)).then(res =>{\n if(res.payload){\n console.log(\"res.payload\", res)\n localStorage.setItem(\"auth-token\", res.payload.token);\n props.history.push(\"/dashboard\");\n }\n else{\n\n }\n })\n // localStorage.setItem(\"auth-token\", loginRes.data.token);\n } catch (err) {\n err.response.data.msg && setError(err.response.data.msg);\n }\n };\n\n return (\n <div className=\"login_section\">\n <h2 className=\"title\">Log in</h2>\n {error && (\n <ErrorNotice message={error} clearError={() => setError(undefined)} />\n )}\n {/* <StyledForm> */}\n <form className=\"form\" onSubmit={submit}>\n <div className=\"form-group\">\n <label htmlFor=\"login-email\">Email</label>\n <input id=\"login-email\" type=\"email\" onChange={(e) => setEmail(e.target.value)}/>\n </div>\n \n <div className=\"form-group\">\n <label htmlFor=\"login-password\">Password</label>\n <input id=\"login-password\" type=\"password\" onChange={(e) => setPassword(e.target.value)}/>\n </div>\n \n <div className=\"form-group\">\n <div className=\"custom-control custom-checkbox\">\n <input type=\"checkbox\" className=\"custom-control-input\" id=\"customCheck1\" />\n <label className=\"custom-control-label\" htmlFor=\"customCheck1\">Remember me</label>\n </div>\n </div> \n\n <input type=\"submit\" value=\"Log In\" />\n \n <div className=\"form-group\">\n <div className=\"float-left\">\n <a onClick={forgot_password}>Forgot password?</a>\n </div>\n <div className=\"float-right\">\n <a onClick={register}>Signup</a>\n </div>\n </div>\n </form>\n \n {/* </StyledForm> */}\n \n </div>\n );\n}", "componentDidMount(){\n const auth = localStorage.getItem('username')\n if (auth){\n window.location.replace('/Main')\n }\n }", "checkSession ({dispatch, state}) {\n state.apiUrl = storeConfig.apiUrl\n\n //logout, force login\n if (state.logout) {\n return true\n }\n //no token, force login\n if (localStorage.getItem(\"token\") === null) {\n return true\n } else {\n dispatch('accountInfo').then((res) => {\n //if no proper response then \"log out\" and force new login\n if (res !== true) {\n localStorage.removeItem(\"token\");\n return true\n }\n })\n dispatch('walletInfo')\n }\n }", "verifyLogin() {\n const obj = getFromStorage('the_main_app');\n console.log(\"Obj.token from storage \" + obj.token)\n if (obj && obj.token) {\n fetch('/api/account/verify?token=' + obj.token)\n .then(res => res.json())\n .then(json => {\n if (json.success) {\n this.setState({\n token: obj.token,\n });\n this.getUserID()\n }\n else {\n //if the user is not logged in, this is when a page should render\n this.setState({ isAuthenticating: false })\n }\n });\n }\n }", "componentDidMount() {\n if (this.props.appState.loggedIn) {\n this.props.api.refreshToken(this.props.appState.authToken);\n this.props.actions.setRedirectUrl('');\n } else {\n let token = window.localStorage.getItem('authToken');\n if (token && token !== 'undefined') {\n token = JSON.parse(token);\n const user = JSON.parse(window.localStorage.getItem('userId'));\n // If we validate successfully, look for redirect_url and follow it\n this.props.api.refreshToken(token, user)\n .then((result) => {\n if (result.type === 'REFRESH_TOKEN_SUCCESS') {\n this.props.actions.setRedirectUrl('');\n }\n if (result.type === 'REFRESH_TOKEN_FAILURE') {\n this.props.actions.setLoginError('You must log in to validate account');\n this.props.history.push('/login');\n }\n });\n } else {\n this.props.actions.setLoginError('You must log in to validate account');\n this.props.history.push('/login');\n }\n }\n }", "function checkToken(){//checks for a valid token and refreshes if necessary, if one doesn't exist or is expired it will take user back to index.html\n\n if(state.token){//if there is a token, refresh it\n $.ajax({\n url:'/api/auth/refresh/',\n method: 'POST',\n headers:{\n 'Authorization':`Bearer ${state.token}`,\n }\n }).done((res) => {\n localStorage.setItem('authToken', res.authToken);\n state.token = res.authToken;\n })\n .fail(error => {//if we fail to refresh token, redirect to landing page\n window.location.href = \"index.html\";\n localStorage.removeItem('authToken');\n })\n }\n else{//else redirect to landing page\n window.location.href = \"index.html\";\n }\n}", "componentDidMount() {\n console.log(\"Dashbord component called!\");\n const tokens = getToken();\n console.log(tokens);\n if (tokens.username == \"undefined\" || tokens.username == \"\")\n return this.props.history.push(\"/signin\");\n else this.handleAPIcall(tokens);\n }", "componentWillMount() {\n if(localStorage.getItem('userToken') == 'NaN'){\n //console.log(localStorage.getItem('userToken'));\n if(this.props.location.pathname != '/'){\n this.redirectToLogin();\n }\n }else{\n if(this.props.location.pathname == '/auth'){\n //return this.setUser();\n if(localStorage.getItem('userRole') == \"Fornitore\"){\n return browserHistory.push('/profilo-fornitore'); // reindirizzo alla home page\n }\n if(localStorage.getItem('userRole') == \"Banditore\"){\n return browserHistory.push('/banditore-pannel'); // reindirizzo alla home page\n }\n if(localStorage.getItem('userRole') == \"Supervisore\"){\n return browserHistory.push('/admin-pannel'); // reindirizzo alla home page\n }\n }\n }\n //listener per gli eventi che si possono verificare nell'applicazio\n eventBus.on('logout', () => this.onLogout());\n eventBus.on('toLogin', () => this.redirectToLogin());\n }", "handleSubmit(event) {\n event.preventDefault();\n \n this.handleErrors('');\n\n let data = {\n username: this.state.username,\n password: this.state.password\n };\n\n // fetching to send the user info and receive its response\n fetch('http://localhost:3000/users/signIn', \n {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(data)\n })\n .then(res => res.json())\n .then(\n (result) => {\n // the server response will have a token if success, else it will send an error message\n if(result.token) {\n // if success, save the token in the sessionStorage\n sessionStorage.setItem('token', `Bearer ${result.token}`);\n this.props.handleLog(true);\n this.changeRedirect(true);\n } else {\n this.handleErrors(result.message);\n }\n },\n (err) => {\n this.handleErrors(err);\n }\n )\n }", "function authenticate(){\n // to handle authentication request\n fetch('http://localhost:3800/users/auth', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n \n },\n body: JSON.stringify({\n email: emailNode.value,\n password: passwordNode.value,\n })\n })\n .then(data => {\n return data.json();\n })\n .then(json => {\n if (json.status === 'success') {\n // to set token for authenticted user \n localStorage.setItem('Token', json.accessToken);\n \n // to get current type of user to navigate them on corresponding page\n getUserType();\n } else {\n alert('user not found');\n emailNode.focus();\n }\n })\n .catch(error => {\n console.log(error);\n }); \n }", "async function validateJwt(req, res, next) {\n try {\n const superSecret = process.env.SECRET;\n\n const ber = req.headers.cookie.split(\"=\")[1]; // parse auth headers , to get token\n const decoded = jwt.verify(ber, superSecret);\n\n // console.log(\"decoded\", decoded);\n\n if (decoded) {\n res.locals.user = decoded.data[0]; // data = [username , email , id]\n res.locals.email = decoded.data[1]; // passing to next middleware\n res.locals._id = decoded.data[2];\n\n res.locals.authenticated = true; // maybe not needed\n\n next();\n }\n } catch (err) {\n // redirect here , maybe\n\n res.status(403).json({\n message: err.message, // remove message in production\n messageProduction: \"invalid token\",\n success: false,\n redirect: true, // redirecto to login popup\n });\n }\n}", "buttonHandler(event){\n event.preventDefault();\n logoutUser().then(res=>{\n console.log(\"are we changing pages?\")\n \n console.log(document.cookie.indexOf(\"x-auth-token\") === -1);\n console.log(res);\n if(res || document.cookie.indexOf(\"x-auth-token\") === -1){\n \n this.props.history.push(\"/\");\n }\n })\n }", "function Login(props) {\n const [email, setEmail] = React.useState(\"\");\n const [password, setPassword] = React.useState(\"\");\n //const [message, setMessage] = React.useState(\"\");\n\n const history = useHistory();\n\n const handleSubmit = (e) => {\n e.preventDefault();\n props.handleLogin(email, password);\n };\n\n // const resetForm = () => {\n // setEmail(\"\");\n // setPassword(\"\");\n // setMessage(\"\");\n // };\n\n // const checkToken = () => {\n // const jwt = localStorage.getItem(\"jwt\");\n // cardAuth\n // .getContent(jwt)\n // .then((res) => {\n // setEmail(res.data.email);\n // //set logged in to true\n // })\n // .then(resetForm)\n // .then(() => {\n // history.push(\"/\");\n // })\n // .catch((err) => {setMessage(err.message);\n // console.log(message);})\n // };\n\n // const handleSubmit = (e) => {\n // e.preventDefault();\n // if (!password || !email) {\n // return setMessage(\"You did not enter a password or email!\");\n // }\n // cardAuth\n // .authorize(email, password)\n // .then((res) => {\n // if (!res || res.statusCode === 400) {\n // throw new Error(\"One of the fields was filled in incorrectly\");\n // }\n // return res;\n // })\n // .then(() => {\n // checkToken();\n // })\n // .then(resetForm)\n // .then(() => {\n // history.push(\"/\");\n // })\n // .catch((err) => setMessage(err.message));\n // };\n\n useEffect(() => {\n if (localStorage.getItem(\"jwt\")) {\n history.push(\"/\"); //make sure to build this route\n }\n }, [history]);\n\n return (\n <form\n className=\"register__container login__container\"\n onSubmit={handleSubmit}\n >\n <h2 className=\"register__title\">Sign In</h2>\n\n <input\n className=\"register__email register__input\"\n type=\"email\"\n placeholder=\"Email\"\n id=\"email\"\n name=\"email\"\n minLength=\"2\"\n maxLength=\"40\"\n onChange={(e) => setEmail(e.target.value)}\n required\n />\n\n <input\n className=\"register__password register__input\"\n type=\"password\"\n id=\"password\"\n name=\"password\"\n placeholder=\"Password\"\n minLength=\"2\"\n maxLength=\"20\"\n onChange={(e) => setPassword(e.target.value)}\n required\n />\n\n <button\n className=\"register__save-button\"\n type=\"submit\"\n //onClick={handleSubmit}\n >\n Sign In\n </button>\n <Link to=\"/signup\" className=\"register__button-text\">\n Not a member yet? Sign up here!\n </Link>\n </form>\n //</CurrentUserContext.Provider>\n );\n}", "function isAuthenticate() {\n if (typeof window === 'undefined') {\n return false\n }\n if (sessionStorage.getItem('jwt')) {\n return JSON.parse(sessionStorage.getItem('jwt'))\n }\n return false\n}", "componentDidMount() {\n let auth = JSON.parse(localStorage.getItem(\"authTokenX4E\"));\n\n if(auth){\n this.props.history.push(\"/home\");\n }\n }", "componentWillReceiveProps(nextProps) {\n if(!nextProps.token)\n this.props.navigation.navigate('auth');\n }", "isAuthenticated(state){\n return state.token != null\n }", "checkAuth() {\n let userLoggedIn = false;\n const token = localStorage.getItem('token');\n\n // check if there's a token in storage\n if(token) {\n const reqObj = {\n token: token\n };\n\n fetch(deploymentConfig().apiUrl + '/api/auth/check', {\n method: 'POST',\n body: JSON.stringify(reqObj)\n })\n .then((resp) => resp.json())\n .then(res => {\n if(res.auth) { // authentication is valid\n userLoggedIn = true;\n if(this.state.userLoggedIn !== userLoggedIn) {\n this.setState({userLoggedIn});\n }\n } else { // auth invalid\n localStorage.removeItem('token');\n window.location.hash = deploymentConfig().baseUrl + '#/login';\n }\n });\n } else { // no token = no auth\n if(!document.location.hash.includes('login')) {\n window.location.hash = deploymentConfig().baseUrl + '#/login';\n }\n }\n\n // return value doesn't matter, auth logic is handled within function\n return true;\n }", "obtainToken(context, payload) {\n // get tokens and update user information (payload is username and password)\n axios.post(this.state.endpoints.obtainJWT, payload)\n .then(response => {\n // update\n this.commit('updateToken', response.data);\n // set state information for logged in user\n const token = response.data.access\n if (token) {\n // use jwt_decode library to extract user_id from JWT\n const decoded = jwt_decode(token);\n const user_id = decoded.user_id\n // send user_id next axios call, to pull User info from API\n return axios({\n method: 'get',\n url: `${this.state.endpoints.baseURL}/users/${user_id}`,\n headers: {\n authorization: `Bearer ${response.data.access}`\n }\n })\n } else {\n alert(\"Trying to decode user from access token but no token found!\")\n }\n })\n // set user information\n .then(response => {\n this.commit('setAuthUser', {\n // in Vuex store, add user information retrieved from API\n authUser: {\n user_id: response.data.id,\n username: response.data.username,\n last_login: response.data.last_login,\n first_name: response.data.first_name,\n last_name: response.data.last_name,\n is_active: response.data.is_active,\n date_joined: response.data.date_joined,\n },\n isAuthenticated: true,\n })\n // redirect user to Dashboard\n router.push({name:'home'})\n }).catch((error) => {\n console.log(error);\n alert(\"Error obtaining token and user information\")\n })\n }", "function FullApp() {\n const [user, setUser] = useState(null)\n const token = window.localStorage.getItem('token')\n useEffect(() => {\n if (user) return\n fetch('http://localhost:4001/api/auth/me', {\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${token}`,\n },\n })\n .then(res => res.json())\n .then(\n ({ user }) => {\n // TODO: testar um token inválido aqui.\n setUser(user)\n // window.localStorage.removeItem('token')\n // setUser(null)\n },\n err => {\n window.localStorage.removeItem('token')\n setUser(null)\n },\n )\n }, [token, user])\n\n // TODO: i need /me\n if (!user && token) {\n return <h1>loading...</h1>\n }\n if (!user && !token) {\n return <UnauthenticatedApp onSuccess={setUser} />\n }\n return (\n <AuthenticatedApp\n user={user}\n logout={() => {\n window.localStorage.removeItem('token')\n setUser(null)\n }}\n />\n )\n}", "function ifLoggedin (req, res, next) {\n const token = req.cookies.jwt;\n if (token) {\n jwt.verify(token, process.env.JWT_SECRET, async (err, decodedToken) => {\n if (err) {\n res.redirect('/login');\n }\n else {\n let user = await User.findById(decodedToken.id);\n res.locals.user = user;\n next();\n }\n });\n }\n else {\n res.redirect('/login');\n }\n}", "render() {\n \n if (localStorage.getItem('token') && this.state.redirect === true) {\n return (<Redirect to={'/start'}></Redirect>)\n }\n let recapchaIntance\n\n return (\n <div className=\"login\">\n <div className=\"row\">\n <div className=\"col-2\" />\n <div className=\"col-8\">\n <div className=\"card car-c\">\n <div className=\"card clase-card\">\n <div className=\"card-body\">\n <h4 className=\"card-title text-center text-primary\">\n Iniciar sesion\n </h4>\n <form onSubmit={this.login}>\n <Input\n type=\"text\"\n id=\"UserInput\"\n name=\"nombre_usu\"\n placeholder=\"Usuario\"\n onChange={this.onChange}\n auto=\"off\"\n />\n <Input\n type=\"password\"\n id=\"UserPassword\"\n name=\"clave\"\n placeholder=\"Contraseña\"\n onChange={this.onChange}\n auto=\"off\"\n pattern=\".{8,}\"\n title=\"La contraseña debe de tener 8 o mas caracteres\"\n />\n <p className=\"text-center\">\n <Link\n to=\"/restaurar_contraseña\"\n className=\"btn btn-flat text-primary\"\n >\n ¿Olvidaste tu contraseña?\n </Link>\n </p>\n <div className=\"d-flex justify-content-center\">\n <button\n type=\"submit\"\n value=\"Login\"\n className=\"button btn btn-flat btn-primary\"\n >Iniciar sesion</button>\n </div>\n <div className=\"d-flex justify-content-center mt-2\">\n <ReCAPTCHA\n ref={el => recapchaIntance = el}\n sitekey=\"6LdIjrcUAAAAAJ1bwVHR3-v1eYpwRRf7WlnG5pi1\"\n onChange={() => this.setState({ isVerified: true })}\n />\n </div>\n </form>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n }", "static isUserAuthenticated() {\n return localStorage.getItem('token') !== null;\n }", "function refreshJwt() {\n if (auth.jwtExists()) {\n store.dispatch(authenticateJwt());\n }\n}", "function loadUser(){\n\n let emailInput = document.querySelector(\"#username\").value\n let passwordInput = document.querySelector(\"#password\").value\n\n fetch(\"http://thesi.generalassemb.ly:8080/login\", {\n method : \"post\",\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n },\n body: JSON.stringify({\n email: emailInput,\n password : passwordInput\n })\n\n })\n .then(response => {\n return response.json()\n })\n .then((json) => {\n \n let token = json.token\n let username = json.username\n console.log('IM HERE')\n \n if(token!==undefined){\n \n console.log(token)\n localStorage.setItem(\"email\", emailInput)\n localStorage.setItem(\"sessionToken\", token)\n localStorage.setItem(\"username\", username)\n location.reload();\n }\n else{\n \n document.querySelector(\"#incorrect\").style.display = \"inline\"\n \n }\n }) \n\n}", "function App() {\n //setting state values\n\n const [currentUser, setCurrentUser] = useState('')\n const [isAuthenticated, setIsAuthenticated] = useState(true)\n\n useEffect(() => {\n let token; //initializing token variable\n\n if (!localStorage.getItem('jwtToken')) {\n setIsAuthenticated(false)\n console.log(`>>>> authentication set to false`)\n } else {\n token = jwt_decode(localStorage.getItem('jwtToken'))\n setAuthToken(localStorage.getItem('jwtToken'))\n setCurrentUser(token)\n }\n }, []);\n\n const nowCurrentUser = (userData) => {\n console.log(`>>>> inside nowCurrentUser func`)\n setCurrentUser(userData)\n setIsAuthenticated(true)\n console.log(`>>>> authentication set to true`)\n }\n\n const handleLogout = () => {\n console.log(`>>>> inside handleLogout func`)\n if (localStorage.getItem('jwtToken')) {\n //removing token from localStorage for deauth of logged out nonuser\n localStorage.removeItem('jwtToken')\n setCurrentUser(null)\n setIsAuthenticated(false)\n console.log(`>>>> user set to null`)\n console.log(`>>>> authentication set to false`)\n }\n }\n\n return (\n <div className=\"App\">\n <div className=\"appNameHeader\">\n <div className=\"englishName\">NipponRunner</div> <div className=\"japaneseName\">にっぽんランナー</div> </div>\n <Navbar handleLogout={handleLogout} isAuth={isAuthenticated} />\n <div className=\"mainContainer\">\n <Switch>\n <Route path='/signup' component={Signup} />\n <Route\n path='/login'\n render={(props) => <Login {...props} nowCurrentUser={nowCurrentUser} setIsAuthenticated={setIsAuthenticated} user={currentUser} />} />\n\n <PrivateRoute exact path='/profile' component={Profile} user={currentUser} handleLogout={handleLogout} />\n <PrivateRoute path='/profile/stats' component={ProfileHiraStats} user={currentUser} handleLogout={handleLogout} />\n <PrivateRoute exact path='/gakkou' component={ Gakkou } user={currentUser} handleLogout={handleLogout} />\n <PrivateRoute path='/gakkou/hiragana' component={ Hiragana } user={currentUser} handleLogout={handleLogout} />\n <PrivateRoute path='/gakkou/howto' component={ Howto } user={currentUser} handleLogout={handleLogout} />\n <Route exact path='/' component={Welcome} />\n <Route path='/about' component={About} />\n </Switch>\n </div>\n <Footer />\n </div>\n );\n}", "login(context, creds, redirect) {\n context.$http.post(LOGIN_URL, creds).then(response => {\n // get body data\n let data = response.body;\n localStorage.setItem('id_token', data.id_token);\n localStorageObj.setItem('user', data.user);\n this.user.authenticated = true\n // Redirect to a specified route\n if(redirect) {\n router.push(redirect);\n }\n }, response => {\n // error callback\n });\n }", "checkLogin({ commit, dispatch }, { next }) {\n const accessToken = localStorage.getItem(\"token\");\n if (accessToken === null) {\n next(false);\n dispatch(\"logout\")\n return;\n }\n axios.defaults.headers.common['Authorization'] = \"Bearer \" + accessToken;\n axios.get(baseUrl + \"user\")\n .then(response => { \n localStorage.setItem(\"token\", response.data.token); \n commit(\"updateUser\", response.data.user); \n next()\n })\n .catch(() => { \n next(false); \n dispatch(\"logout\")\n \n })\n }", "handleSubmit(event) {\n event.preventDefault();\n\n //Generate the token here\n var firstName = event.target.fname.value;\n var lastName = event.target.lname.value;\n var username = event.target.username.value;\n var emailAddress = event.target.email_address.value;\n var password = event.target.password.value;\n var cpassword = event.target.cpassword.value;\n var tokenStr = firstName+'|'+lastName+'|'+username+'|'+emailAddress+'|'+password+'|'+cpassword+'|'+Constants.APP_SALT; \n const formData = {\n firstName : firstName,\n lastName : lastName,\n username : username,\n emailAddress : emailAddress,\n password : password,\n cpassword : cpassword,\n token : sha1(tokenStr),\n errorFlag : false\n }\n axios.post(urlStr, formData)\n .then((response) => {\n //console.log(response.data);\n if(response.data.code==200) {\n //Set All global Values For User After Login\n globals.set('user',response.user);\n globals.set('token',response.token);\n //localStorage.setItem('user',response.data.user.id);\n if(response.data.status=='success'){\n this.setState({\n classstr :'alert alert-success',\n className :true,\n errorFlag : false,\n message : response.data.message\n }); \n\n setTimeout(() => {\n this.setState({\n redirectToReferrer: true,\n })\n }, 2000)\n \n }else{\n this.setState({\n message : response.data.message,\n classstr : 'alert alert-danger',\n className : true,\n errorFlag : true\n });\n }\n }\n else\n {\n this.setState({ \n redirectToReferrer : false, \n message : response.data.message,\n classstr : 'alert alert-danger',\n errors : response.data.error,\n errorFlag : true\n });\n \n }\n })\n .catch((err) => {\n this.setState({redirectToReferrer: false });\n this.setState({message:err});\n this.setState({classstr:'alert alert-danger'});\n })\n }", "function isLogin() {\n if (localStorage.getItem('token')) {\n hasToken()\n }\n else {\n noToken()\n }\n}", "async tokenCheck() {\n let token = this.headers.token;\n if (token && this.restnio.options.auth.type == 'jwt') {\n await this.grantPermWithToken(token);\n }\n // Try cached token. On fail, clear the cached token.\n if (!token && this.restnio.options.auth.cookietoken && \n this.restnio.options.auth.type == 'jwt' && this.cookies.token) \n {\n try { // TODO make silent behaviour configurable?\n await this.grantPermWithToken(this.cookies.token);\n } catch (e) {\n // Silently fail and delete the wrong token.\n // Note that an application can override this behaviour\n // by resending a token in the same request.\n this.clearCookie('token');\n }\n }\n }", "render() {\n // If already logged in\n if (this.state.tokenState || this.props.error === false) {\n return utils.getRedirectComponent(\"/users/dashboard\");\n }\n // If not logged in already\n let renderError = null;\n if (this.props.error) {\n renderError = (\n <div style={{ color: \"red\" }}>{this.props.errorMessage}</div>\n );\n }\n\n return (\n <div>\n <div className=\"row\" style={{ height: \"100vh\", padding: \"10%\" }}>\n <div className=\"col-5\" style={{ paddingLeft: \"10%\" }}>\n <div className=\"row\" style={{ height: \"10%\" }}></div>\n <div className=\"row\" style={{ height: \"90%\" }}>\n <div className=\"col-12\">\n <h4 style={{ margin: \"10px\", color: \"#20BF9F\" }}>Login page</h4>\n <form id=\"Login\" method=\"post\" onSubmit={this.handleSubmit}>\n <div className=\"form-group\">\n <input\n type=\"text\"\n className=\"form-control\"\n name=\"email\"\n required\n autoFocus\n placeholder=\"Enter Email\"\n onChange={this.handleEmailChange}\n />\n </div>\n <div className=\"form-group\">\n <input\n type=\"password\"\n className=\"form-control\"\n name=\"password\"\n required\n placeholder=\"Enter Password\"\n onChange={this.handlePasswordChange}\n />\n </div>\n <button\n type=\"submit\"\n className=\"btn btn-success\"\n onSubmit={this.handleSubmit}\n style={{ backgroundColor: \"#20BF9F\" }}\n >\n Login\n </button>\n </form>\n {renderError}\n <br></br>\n Don't have an account?{\" \"}\n {\n <Link style={{ color: \"#20BF9F\" }} to=\"/signup\">\n Sign Up\n </Link>\n }\n </div>\n </div>\n </div>\n <div className=\"col-7\">\n {/* <div className=\"row\" style={ { height: \"10%\" } }>\n </div> */}\n <div className=\"row\">\n <div className=\"row\" style={{ padding: \"5%\" }}>\n {/* <img\n src={}\n style={{ paddingLeft: \"40%\" }}\n width=\"100%\"\n height=\"100%\"\n alt=\"\"\n /> */}\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n }", "function LoginCallback({handleLogin, ...props}) {\n let values = queryString.parse(props.location.search);\n useEffect(function () {\n\n localStorage.setItem(\"_jwt\", values[\"?jwt\"]);\n handleLogin();\n window.location.assign(\"http://localhost:3000/\")\n }, [values, handleLogin]);\n return <div>Loading...</div>;\n}", "function LoginForm(props){\n const [name, setName] = useState(\"\")\n const [password, setPassword] = useState(\"\")\n //const history = useHistory();\n\n // async function handleClickEvent(event) {\n // event.preventDefault();\n \n // try {\n // await Auth.signIn(email, password);\n // userHasAuthenticated(true);\n // history.push(\"/\");\n // } catch (e) {\n // alert(e.message);\n // }\n // }\n const handleNameChange = (evt) => {\n setName(evt.target.value)\n }\n\n const handlePasswordChange = (evt) => {\n setPassword(evt.target.value)\n }\n \n const handleSubmit = (evt) => {\n \n evt.preventDefault()\n const token = localStorage.getItem(\"token\")\n fetch(`http://localhost:3000/login`, {\n method: \"POST\",\n\n crossDomain: true, \n withCredentials: true,\n\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${token}`\n },\n body: JSON.stringify({\n name,\n password\n })\n })\n .then(resp => resp.json())\n .then(data => {\n localStorage.setItem(\"token\", data.jwt)\n props.handleLogin(data.user)\n\n\t\t\t//props.history.push(\"/HomePage\")\n\n })\n setName(\"\")\n setPassword(\"\")\n \n }\n const formDivStyle = {\n margin: \"auto\",\n padding: \"20px\",\n width: \"80%\"\n }\n\n\t// const onSubmit = () => { \n\t// \tif(userFound){\n\t// \treturn <Redirect to=\"/home/\" />\n\n\n\t// }}\n\n return(\n <div>\n <div style={formDivStyle}>\n <h1>Log In</h1>\n <form className=\"ui form\" >\n <div className=\"field\">\n <label>Name</label>\n <input value={name} onChange={handleNameChange} type=\"text\" placeholder=\"name\"/>\n </div>\n <div className=\"field\">\n <label>Password</label>\n <input value={password} onChange={handlePasswordChange} type=\"password\" placeholder=\"password\"/>\n </div>\n\n <Link to='/Products'>\n <button className=\"ui button\" type=\"submit\" onClick={props.handleLogin}>Login</button>\n </Link>\n\n </form>\n </div>\n </div>\n )\n}", "function getJWTToken (){\r\n return typeof JWTToken === \"function\" ? JWTToken() : JWTToken;\r\n }", "componentWillMount(){\n if (localStorage.getItem('wevote')) {\n const tokenStorage = JSON.parse(localStorage.getItem('wevote'));\n const tokenExpiry = tokenStorage.exp;\n const token = tokenStorage.jwt;\n if (tokenExpiry <= Number(Date.now().toString().substr(0, 10))){\n localStorage.removeItem('wevote');\n setAccessToken(null);\n location.reload();\n this.props.history.push('/');\n } else if (token) {\n this.props.login(token, SIGN_IN_AJAX);\n }\n }\n }", "function ifLoggedout (req, res, next) {\n const token = req.cookies.jwt;\n if (token) {\n jwt.verify(token, process.env.JWT_SECRET, async (err, decodedToken) => {\n if (err) {\n next();\n }\n else {\n let user = await User.findById(decodedToken.id);\n let path = '/workspace/' + user._id + '/' + user.pages[0]._id;\n res.redirect(path);\n }\n });\n }\n else {\n next();\n }\n}", "handleSubmit(e) {\n e.preventDefault();\n this.setState({ submitted: true });\n const { username, password } = this.state;\n if (this.validateForm()) {\n this.setState({ loginbtnClicked: true });\n axios\n .post(apiHelperInstance.Resources.Authenticate, {\n loginname: username,\n password: btoa(password)\n })\n .then(res => {\n if (res.data.statusCode === 1) {\n setJwt(res.data.data.token, res.data.data.duration);\n this.props.history.push('/layout');\n } else if (res.data.statusCode === 0) {\n const errors = {};\n errors.callback = res.data.description;\n this.props.passwordProps.isReset = true;\n this.setState({ errors, password: '', loginbtnClicked: false });\n this.props.passwordProps.isReset = false;\n }\n })\n .catch(error => {\n const errors = {};\n errors.callback = error.message;\n this.setState({ errors, loginbtnClicked: false });\n });\n }\n }", "function tryGetAuth() {\n\tconst username = sessionStorage.getItem(\"username\");\n\tconst token = sessionStorage.getItem(\"authToken\");\n\n\tif (nonEmpty(token)) {\n\t\treturn { \"username\": username, \"token\": token };\n\t} else {\n\t\treturn null;\n\t}\n}", "async handleLogin(event, data) {\n event.preventDefault();\n try {\n const response = await axiosInstance.post('/token/obtain/', {\n username: data.username,\n password: data.password,\n });\n axiosInstance.defaults.headers['Authorization'] = \"JWT \" + response.data.access;\n localStorage.setItem('access_token', response.data.access);\n localStorage.setItem('refresh_token', response.data.refresh);\n this.updateSession();\n this.setState({\n logged_in: true,\n user_id: response.data.id,\n username: response.data.username,\n });\n return null;\n } catch (error) {\n console.log(error.response.data)\n this.setState({\n errors: error.response.data\n });\n return error.response.data;\n }\n }", "function auth(nextState, replace, callback) {\n\n const user = store.getState().user;\n\n // Redirect user to login page\n if (!user.token) {\n replace('/login')\n }\n\n callback();\n\n}", "componentDidUpdate() {\n if (!getStorage(ADMIN_DETAILS) && !getStorage(JWT_ACCESS_TOKEN)\n && !getStorage(JWT_ID_TOKEN)) {\n this.props.history.push('/signin');\n }\n }", "static userCheck(req, res, next){\n const token= req.cookies.jwt; \n\n if(token){\n jwt.verify(token, process.env.JWTSECRET,async (err, newToken)=>{\n if(err){\n console.log(err);\n res.locals.user=null;\n next();\n }else{\n console.log(newToken);\n let controller = new Controller();\n let user = await controller.findUserById(newToken.id);\n res.locals.user= user;\n next();\n }\n })\n }else{\n res.locals.user= null;\n next();\n }\n }", "inspectToken() {\n const token = this.state.jwt_access;\n if (token) {\n const decoded = jwt_decode(token);\n const exp = decoded.exp\n const orig_iat = decoded.orig_iat\n if (exp - (Date.now() / 1000) < 1800 && (Date.now() / 1000) - orig_iat < 628200) {\n this.dipatch(\"refreshToken\")\n alert(\"token inspected, refreshing token\")\n } else if (exp - (Date.now() / 1000) < 1800) {\n // DO NOTHING DO NOT REFRESH\n alert(\"token inspected no issues\")\n } else {\n // PROMPT USER TO RELOGIN\n // THIS ELSE CLAUSE COVERS THEN CONDITION WHERE A TOKEN IS EXPIRED\n alert(\"Authentication token expired, please login again\")\n router.push({name: 'login'})\n }\n }\n else {\n alert(\"No token detected\")\n }\n }", "function validateUser(req, res, next){\n jwt.verify(req.cookies.token, jwt_secret, function(err, decoded) {\n\t\tif(err){\n\t\t\tres.redirect('/login')\n\t\t}\n\t\telse{\n next();\n\t\t}\n\t });\n}", "handleSubmit(e) {\n e.preventDefault()\n axios.post('/auth/login', {\n email: this.state.email,\n password: this.state.password\n }).then(result => {\n if(result.data.hasOwnProperty('error')) {\n this.setState({\n response: result.data\n })\n } else {\n localStorage.setItem('mernToken', result.data.token)\n this.props.liftToken(result.data)\n this.setState({\n response: null\n })\n }\n })\n }", "async postLoginPage(req, res, next){ \n const {email, password , token} = req.value.body\n try {\n const user = await User.findOne({email:email})\n if(!user){\n req.flash('message','Email không tồn tại!')\n return res.redirect('back')\n } \n const isMatch = await bcrypt.compare(password, user.password)\n if(!isMatch){\n req.flash('message', 'Mật khẩu không đúng!')\n return res.redirect('back')\n } \n const token = jwt.sign({id: user._id}, _CONF.secret , {expiresIn: _CONF.tokenLife})\n user.tokens = user.tokens.splice(1) // xóa đi phần tử token dầu tiên\n user.tokens = user.tokens.concat({token}) // gán lại token sau khi login lại\n await user.save().then((data, error)=>{\n if(error){\n return res.status(400).json(\"ERROR\")\n }else{\n if(data.roles == 'admin'){\n res.cookie('token', token, { maxAge: 900000, httpOnly: true}) \n return res.status(200).redirect('page-admin/san-pham')\n }else{ \n return res.status(200).redirect('trang-chu')\n }\n } \n }).catch(error =>{\n return res.status(500).json(\"ERROR SERVER\")\n }) \n } catch (e) {\n console.error(e);\n return res.status(500).json({\n message: \" Server Lỗi\"\n }) \n }\n }", "componentDidMount(){\n if (localStorage.token){\n validate()\n .then(\n data => {\n // if (data.error){\n // alert(data.error)\n // } else\n // {\n this.signin(data)\n // }\n }\n )\n }\n }", "function getToken() {\n return sessionStorage.getItem('auth');\n }", "function getToken() {\n let token = getTokenInLocal();\n\n if(token === '' || token == null){\n alert('您未登录!');\n var url = window.location.href;\n var index = url.lastIndexOf('/');\n var base = '';\n if ( index > 0 ){\n base = url.substring(0, index);\n }\n $(location).attr('href', base + '/login.html');\n }\n return token;\n}", "function App() {\n const [isAuthenticated,setIsAuthenticated]=useState();\nconst login=()=>{\nsetIsAuthenticated(true);\n}\nconst logout=()=>{\n sessionStorage.clear();\n setIsAuthenticated(false);\n}\n useEffect(()=>{\n const checkAuth=async()=>{\n await Axios({\n method:'get',\n url:'http://localhost:5000/api/users/isAuthenticated',\n headers: {\n 'Authorization': \"Bearer \"+sessionStorage.getItem('jwt'),\n }\n }).then(res=>{\n if(res.data){\n login();\n\n } \n }).catch(err=>{\n logout();\n });\n\n }\ncheckAuth();\n\n },[]);\n\n \n\n return (\n\n <Router>\n <div>\n <Navigation isAuthenticated={isAuthenticated}/>\n </div>\n <Switch>\n \n <Route path=\"/login\" exact component={Login}/>\n <Route path=\"/register\" exact component={Register}/>\n <Route path=\"/create-link\" exact component={CreateLinkPage} />\n \n \n \n \n\n \n \n </Switch>\n </Router>\n\n \n );\n}", "componentDidMount() {\n if (!cookies.load('jwt')) {\n this.setState({ ...this.state, redirect: true });\n }\n\n let url = 'http://localhost:8080/getPersonByUsername';\n\n let headers = new Headers();\n\n headers.append('Authorization', 'Bearer ' + cookies.load('jwt'));\n\n fetch(url, {\n mode: 'cors',\n method: 'GET',\n headers: headers,\n })\n .then(resp => {\n if (resp.ok) {\n return resp.text();\n } else if (resp.status === 401) {\n throw new Error(resp);\n }\n })\n .then(data => {\n this.setState({ user: data });\n })\n .catch((resp) => {\n cookies.remove(\n 'jwt',\n {\n path: '/',\n domain: 'localhost',\n }\n );\n this.setState({ ...this.state, redirect: true });\n })\n }", "function Login() {\n //lets consume the values provided by the context object.\n const { user, setUser } = useContext(UserContext);\n\n //lets define a state for our token id\n const [tokenId, setTokenId] = useState(null)\n\n //lets define a state for our components\n const [email, setEmail] = useState(\"\")\n const [password, setPassword] = useState(\"\")\n\n const authenticate = (e) => {\n e.preventDefault() //to avoid page redirection.\n //attack the url address of the login endpoint\n\n //practice task, lets refactor the current structure of our fetch request by storing the payload inside an object.\n const laman = {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n email: email,\n password: password\n })\n }\n\n fetch(`${AppHelper.API_URL}/users/login`, laman).then(AppHelper.toJSON).then(data => {\n console.log(data);\n //lets create a control structure that will determine the response to the user.\n if (typeof data.accessToken !== \"undefined\") {\n //next task is to save the access token inside our local storage object\n localStorage.setItem('token', data.accessToken)\n retrieveUserDetails(data.accessToken)\n } else {\n //inside this branch we are going to give it these exact conditions upon failure in logging in.\n if (data.error === 'does-not-exist') {\n Swal.fire('Authentication Failed', 'User Does Not Exist', 'error')\n } else if (data.error === 'incorrect-password') {\n Swal.fire('Authentication Failed', 'Password is incorrect', 'error')\n } else if (data.error === 'login-type-error') {\n Swal.fire('Authentication Failed', 'You may have registered using a different method, try using an alternative login method.', 'error')\n }\n }\n })\n }\n\n //new location for retrieve user details method.\n //lets create a function that will allow us to retrieve the information/details about the user.\n\n //upon retrieving the info about the user, the user has to be authenticated first.\n const retrieveUserDetails = (accessToken) => {\n //lets create an object which we will name as option. and the value it holds is the access token\n const options = {\n headers: { Authorization: `Bearer ${accessToken}` }\n } //this will serve as the payload of the request.\n\n //send the request together with the payload \n fetch(`${AppHelper.API_URL}/users/details`, options).then(AppHelper.toJSON).then(data => {\n //change the value of the user component by targeting it's state setter. \n setUser({ id: data._id, isAdmin: data.isAdmin })\n //lets redirect the user inside the courses page.\n Router.push('/user/categories');\n })\n }\n\n return (\n <Container>\n <h1>Log In Page</h1>\n <Form onSubmit={e => authenticate(e)}>\n {/* email*/}\n <Form.Group controlId=\"email\">\n <Form.Label>Email:</Form.Label>\n <Form.Control value={email} placeholder=\"Insert Email Here\" type=\"email\" onChange={e => setEmail(e.target.value)} required />\n </Form.Group>\n {/* password*/}\n <Form.Group controlId=\"password\">\n <Form.Label>Password:</Form.Label>\n <Form.Control value={password} placeholder=\"Insert Password Here\" onChange={e => setPassword(e.target.value)} type=\"password\" required />\n </Form.Group>\n <Button className=\"mt-3 mb-3 w-100\" variant=\"dark\" type=\"submit\">Log In</Button>\n\n {/* <GoogleLogin\n clientId=\"882160198246-olkr54sokvce6a9pq280s5t60aj0c14t.apps.googleusercontent.com\" //Client Id from Google API console.\n className=\"w-100 mt-3 text-center d-flex justify-content-center\"\n buttonText=\"Log In with Gmail\" //text to be displayed\n onSuccess={authenticateGoogleToken} //callback function that is run on success\n onFailure={authenticateGoogleToken}\n // callback function that is run on failure. \n /> */}\n </Form>\n </Container>\n )\n}", "getToken() {\n return localStorage.getItem(\"token\") || null\n }", "function get_user_token() {\n let user_token = sessionStorage.getItem('museio_user_token');\n if (!user_token || user_token.length < 1) {\n user_token = localStorage.getItem(\"museio_user_token\");\n if (!user_token || user_token.length < 1) {\n // Log the user out\n log_user_out(true, \"Sorry, we can't find your token so you're going to have to log back in.\");\n return false;\n }\n }\n\n return user_token;\n}", "function App() {\n const [currUser, setCurrUser] = useState(null);\n const [token, setToken] = useState(localStorage.getItem('token') || '');\n const [isLoaded, setIsLoaded] = useState(false);\n\n async function handleLoginOrSignup(data) {\n try {\n const token = await JoblyApi.loginOrSignup(data);\n setToken(token);\n //set local storage here instead of 61\n setIsLoaded(false);\n } catch (err) {\n console.log('handlelogin err = ', err);\n return err;\n }\n }\n\n function handleLogout() {\n setToken('');\n setCurrUser(null);\n localStorage.removeItem('token');\n }\n\n // async function handleSignup(signupData) {\n // try {\n // let token = await JoblyApi.signup(signupData);\n // setToken(token);\n // setIsLoaded(false);\n // } catch (err) {\n // console.log('handlelogin err = ', err);\n // return err;\n // }\n // }\n\n useEffect(\n function getCurrUser() {\n async function getUserFromApi() {\n //TODO: try catch here, error handle\n if (token) {\n const { username } = jwt_decode(token);\n JoblyApi.token = token;\n localStorage.setItem('token', token);\n console.log('localstorage token= ', localStorage.getItem('token'));\n const user = await JoblyApi.getUser(username);\n setCurrUser(user);\n }\n setIsLoaded(true);\n }\n getUserFromApi();\n },\n [token]\n );\n\n if (!isLoaded) {\n return <div>loading...</div>;\n }\n\n return (\n <div className=\"App\">\n <BrowserRouter>\n <CurrUserContext.Provider value={currUser}>\n <NavBar handleLogout={handleLogout} />\n <Routes handleLoginOrSignup={handleLoginOrSignup} />\n </CurrUserContext.Provider>\n </BrowserRouter>\n </div>\n );\n}", "static authenticateUser(token) {\n localStorage.setItem('token', token);\n }", "static authenticateUser(token) {\n localStorage.setItem('token', token);\n }", "OnSubmit(e){\n e.preventDefault();\n var login={\n username:this.state.username,\n password:this.state.password \n }\n var username=login.username;\n //set username into localstorage\n localStorage.setItem(\"username\",username);\n var password=login.password;\n localStorage.setItem(\"user_password\",password);\n //pass user credentials to api \n axios.post('http://localhost:8080/authenticate',{\n username:this.state.username,\n password:this.state.password\n })\n .then((res) => {\n //set user token into localsotrage\n localStorage.setItem(\"user_token\",res.data.jwt);\n //get user token from localstorage \n var token = localStorage.getItem(\"user_token\")\n //assign username into username variable \n var username =login.username;\n //pass username name into api for authorization\n axios.get(`http://localhost:8080/find/${username}`,{\n headers: {\n 'Authorization': `Bearer ${token}`\n \n }\n }\n ) \n .then((res) => {\n console.log(res.data)\n //get user information from api\n var role =res.data.role\n var name =res.data.name\n var contact =res.data.contact\n var address =res.data.address \n //set user informatino into localstorage \n localStorage.setItem(\"user_name\",name);\n localStorage.setItem(\"user_role\",role);\n localStorage.setItem(\"user_contact\",contact);\n localStorage.setItem(\"user_address\",address);\n\n\n //redirect page according to user roles\n if(role===\"admin\"|| role ===\"Admin\"||role===\"ADMIN\"){\n this.props.history.push('/Admin_Dashboard')\n //reload the page after reedirecting\n window.location.reload(false);\n } \n \n if(role===\"worker\"||role===\"Worker\" || role===\"WORKER\"){\n this.props.history.push('/Worker_Dashboard')\n window.location.reload(false);\n }\n \n if(role===\"customer\"||role===\"Customer\"||role===\"CUSTOMER\"){\n this.props.history.push('/Customer_Dashboard')\n window.location.reload(false);\n\n }\n })\n .catch((err) =>{\n console.log(err)\n // display alert pop up if user not found\n alert(\"User not found\");\n\n\n })\n\n })\n .catch((error) => {\n console.log(error)\n // display alert pop up if user login credentials invalid \n alert(\"Invalid login credentials\")\n\n })\n }", "function Login(props) {\n\n\n const [inputUsernameValue, setUsernameValue] = useState('');\n const [inputPasswordValue, setPasswordValue] = useState('');\n const user = JSON.parse(localStorage.getItem('user'));\n\n\n const sendLoginForm = (event) => {\n event.preventDefault()\n let postData = {\n username: inputUsernameValue,\n password: inputPasswordValue,\n ttl: 3600\n };\n \n let axiosConfig = {\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json',\n // 'Authorization': 'Bearer' + <jwtToken>\n }\n };\n \n axios.post(\n 'https://akademia108.pl/api/social-app/user/login', \n postData, \n axiosConfig)\n .then((res) => {\n // console.log(res.data);\n\n localStorage.setItem('user', JSON.stringify(res.data));\n props.setUser(res.data);\n })\n .catch((err) => {\n console.log(\"AXIOS ERROR: \", err);\n })\n }\n \n\n\n return (\n <div className=\"login-page\">\n {user && <Redirect to='/posts' />}\n <div></div>\n <h2>Please log in </h2>\n <form action=\"#\" onSubmit={sendLoginForm}>\n <input type=\"text\" placeholder='Username' value={inputUsernameValue} onChange={event => setUsernameValue(event.target.value)} />\n <input type=\"password\" className='password' value={inputPasswordValue} placeholder='Password' onChange={event => setPasswordValue(event.target.value)} />\n\n <button>log in</button>\n </form>\n\n <p>Dont have an account?<Link to='/signUp'>Sign Up</Link></p>\n\n\n\n </div>\n )\n}", "render() {\n return (\n <AuthContext.Consumer>\n {(context) => (\n <>\n {(context.authErr || !context.authUser) && <Redirect to=\"/login\"></Redirect>}\n {this.state.submitted && (context.authUser != null && context.authUser.role === \"Teacher\")\n && <Redirect to={`/teacher-home/${context.authUser.email}`} />}\n {this.state.submitted && (context.authUser != null && context.authUser.role === \"Student\")\n && <Redirect to={`/student-home/${context.authUser.email}`} />}\n {this.state.submitted && (context.authUser != null && context.authUser.role === \"Manager\")\n && <Redirect to={`/manager-home/${context.authUser.email}`} />}\n {this.state.submitted && (context.authUser != null && context.authUser.role === \"SupportOfficer\")\n && <Redirect to={`/support-officer-home/${context.authUser.email}/loader`} />}\n <Container fluid>\n <Row>\n <Col>\n <h1>Login</h1>\n <br />\n <Form method=\"POST\" onSubmit={(event) => this.handleSubmit(event)}>\n <Form.Group controlId=\"email\">\n <Form.Label>Email</Form.Label>\n <Form.Control type=\"email\" name=\"email\" placeholder=\"Email\" onChange={(ev) => this.onChangeUsername(ev)} required/>\n </Form.Group>\n\n <Form.Group controlId=\"password\">\n <Form.Label>Password</Form.Label>\n <Form.Control type=\"password\" name=\"password\" placeholder=\"Password\" onChange={(ev) => this.onChangePassword(ev)} required />\n </Form.Group>\n\n <Form.Group>\n <Button variant=\"primary\" type=\"submit\">Login</Button>\n </Form.Group>\n\n </Form>\n\n </Col>\n </Row>\n <Modal controlid='Alert' show={this.state.alertMessage && true} onHide={this.handleClose} animation={false}>\n <Modal.Header closeButton>\n <Modal.Title>{this.state.alertMessage}</Modal.Title>\n </Modal.Header>\n </Modal>\n </Container>\n </>\n )}\n </AuthContext.Consumer>\n );\n }", "componentDidMount() {\n\n const jwt = sessionStorage.getItem('accessToken');\n\n if(jwt) {\n this.loadPlayerDetails();\n this.setState({loggedIn: true});\n }\n\n }", "function Login() {\n let url =\n process.env.NODE_ENV === \"development\"\n ? process.env.REACT_APP_DEVELOPMENT_URL\n : process.env.REACT_APP_PRODUCTION_URL;\n\n const history = useHistory();\n const [loginInput, setLogin] = useState({\n email: \"\",\n password: \"\",\n error_list: [],\n });\n const [redirect, setRedirect] = useState(false);\n\n const handleInput = (e) => {\n // e.persist();\n setLogin({ ...loginInput, [e.target.name]: e.target.value });\n };\n\n const loginSubmit = async (e) => {\n e.preventDefault();\n\n // let res = await fetch(url +'Auth/Authenticate/',{\n // method: 'POST',\n // headers:{'Content-type':'application/json'},\n // body:JSON.stringify(loginInput),\n // credentials:'include'\n // });\n // let data = await res.json();\n // console.log(data);\n\n const data = {\n email: loginInput.email,\n password: loginInput.password,\n };\n\n let res = await fetch(url + \"Auth/login\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n credentials: \"include\",\n body: JSON.stringify(data),\n });\n\n let pop = res.json();\n console.log(pop);\n\n setRedirect(true);\n\n // await axios.post(url + 'Auth/login', data).then(res =>{\n\n // console.log(res.status);\n // if(res.status=== '200'){\n\n // localStorage.setItem('auth_token', res.data)\n // // localStorage.setItem('auth_name',res.data)\n // swal('Success', res.message, 'success')\n // return <Redirect to='/category' />;\n\n // }\n // // setLogin({...loginInput, error_list: res.validation_errors})\n\n // // if(res.status === '200'){\n // // console.log(res.status)\n // // localStorage.setItem('auth_token', res.data.token)\n // // localStorage.setItem('auth_name', res.data.name)\n // // swal(\"Success\", res.data.message, \"success\")\n // // if(res.data.role === 'admin'){\n\n // // history.push('/');\n // // }\n // // else{\n // // history.push('/404');\n // // }\n // // }\n // // else if(res.status === 401){\n // // swal(\"Warning\", res.data.message, \"warning\")\n // // }\n // // else{\n // // setLogin({...loginInput, error_list: res.data.validation_errors})\n // // }\n\n // })\n };\n\n if (redirect) {\n return <Redirect to=\"/\" />;\n }\n // const handleInput = (event) => {\n // setUserData({...userData, [event.target.id]: event.target.value});\n // }\n\n return (\n <div>\n <div className=\"container py-5 \">\n <div className=\"row justify-content-center\">\n <div className=\"col-md-6 d-flex justify-content-center\">\n <div className=\"card \" style={{ background:\"#d6d6d6\"}}>\n <div className=\"card-header d-flex justify-content-center \">\n <h4>Login</h4>\n </div>\n <div className=\"card-body\">\n <form onSubmit={loginSubmit}>\n <div className=\"form-group mb2 input-text\">\n <label htmlFor=\"email\">Email ID</label>\n <input\n type=\"email\"\n onChange={handleInput}\n value={loginInput.email}\n name=\"email\"\n id=\"email\"\n required=\"\"\n />\n <span className=\" alert-danger d-inline-block my-1 w-100 text-danger\">\n {loginInput.error_list.email}\n </span>\n </div>\n <div className=\"form-group mb2 border-radius rounded top input-text\">\n <label htmlFor=\"password\">Password</label>\n <input\n type=\"password\"\n onChange={handleInput}\n value={loginInput.password}\n className=\"border-top-0\"\n name=\"password\"\n id=\"password\"\n required=\" \"\n />\n <span className=\" alert-danger d-inline-block my-1 w-100 text-danger\">\n {loginInput.error_list.password}\n </span>\n </div>\n\n <div className=\"form-group mb3\">\n <button type=\"submit\" className=\"btn btn-primary\">\n Login\n </button>\n </div>\n </form>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n}", "doLogout() {\n this.deleteJWT();\n this.props.navigation.navigate('Home');\n //this.props.navigation.pop();\n }", "_loginRedirect() {\n if (!this.isLoading && !this.hasUser) {\n this.props.history.push('/login');\n }\n }", "login(email, password) { \n return fetch(API_AUTHURI, { //Get a JWT\n method: \"POST\",\n headers: API_HEADERS, \n body: JSON.stringify({\n email,\n password\n })\n })\n .then(res => res.json())\n .then(data => {\n if (typeof data.access_token !== 'undefined' )\n {\n sessionStorage.setItem(\"access_token\", data.access_token) //save JWT for authentication \n return true\n } else {\n return false\n }\n }).catch( () => false )\n }", "function security() {\n if(!localStorage.getItem('token')){\n console.log(\"El usuari intentava entrar a la pàgina sense prèviament haver-se registrar o loggejat\");\n window.location.replace(\"../html/index.html\");\n }\n}" ]
[ "0.6652037", "0.6604996", "0.6453364", "0.64010936", "0.6375936", "0.63688314", "0.6337005", "0.62815845", "0.6267824", "0.6255168", "0.6232642", "0.6211497", "0.62057716", "0.62007815", "0.6187793", "0.6183601", "0.61798525", "0.61376476", "0.61180794", "0.60907257", "0.60894406", "0.6075817", "0.6071636", "0.6071636", "0.6066607", "0.6066607", "0.6058134", "0.6039788", "0.6039363", "0.6017288", "0.6007203", "0.5990782", "0.59903336", "0.5978315", "0.59640706", "0.5961015", "0.5958789", "0.5955184", "0.59521765", "0.592453", "0.5901635", "0.58861583", "0.5881659", "0.5865244", "0.58600503", "0.58541006", "0.5808679", "0.5808632", "0.5799319", "0.5796361", "0.57901525", "0.5786687", "0.5782642", "0.5781849", "0.57787937", "0.57787335", "0.5771999", "0.5771883", "0.5762984", "0.5758812", "0.5752981", "0.57488406", "0.57483464", "0.57457614", "0.5742456", "0.5732852", "0.5732653", "0.57247865", "0.5721205", "0.57147723", "0.5714283", "0.57126325", "0.5710221", "0.5700955", "0.5700933", "0.5694613", "0.5691738", "0.5691701", "0.5690949", "0.5685188", "0.56838113", "0.56725514", "0.5665618", "0.5654639", "0.56477386", "0.56439775", "0.5642677", "0.56423414", "0.5636948", "0.5635797", "0.5635538", "0.5635538", "0.56315005", "0.56304204", "0.56221056", "0.5617891", "0.5614821", "0.561461", "0.56130403", "0.5612189", "0.56117135" ]
0.0
-1
helper function to calculate zoom step
getZoomStep(currentZoomLevel) { if (currentZoomLevel > 3) { return 1.2; } else { return currentZoomLevel / 4; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zoomFactor(){\n\tvar percentOffFloor = (transform.position.y - zoomFloor)/zoomCeiling;\n\treturn percentOffFloor + 1;\n}", "function zoom(value) {\n return value * zoomLevel;\n}", "function zoom () {\r\n if (zoomAllowed) {\r\n d3.event.preventDefault()\r\n var dy = +d3.event.wheelDeltaY\r\n var sign = dy < 0 ? -1 : +1\r\n dy = Math.pow(Math.abs(dy), 1.4) * sign\r\n\r\n if (timeWindow + dy > 10 * 1000) {\r\n timeWindow += dy\r\n } else {\r\n timeWindow = 10 * 1000\r\n }\r\n }\r\n step()\r\n }", "static get niceMouseDeltaZoom() {}", "function dZoom(d) {\n\t return 1 - ((d >= 0) ? Math.min(d, 0.9) :\n\t 1 / (1 / Math.max(d, -0.3) + 3.222));\n\t }", "function dZoom(d) {\n\t return 1 - ((d >= 0) ? Math.min(d, 0.9) :\n\t 1 / (1 / Math.max(d, -0.3) + 3.222));\n\t }", "function setZoom(){\n const screenWidth = window.innerWidth;\n\n if (screenWidth > 1000){\n return 6;\n } else if (screenWidth < 1000 && screenWidth > 400) {\n return 5;\n } else if (screenWidth < 400) {\n return 4;\n }\n}", "static set niceMouseDeltaZoom(value) {}", "function zoomActual()\n\t{\n\t\t_3dApp.script(_scriptGen.zoom(_options.defaultZoom));\n\t}", "function Zoom(low, high, delta) {\n this.low = low\n this.high = high\n this.delta = delta\n this.clock = CLOCK++\n}", "function dZoom(d) {\n return 1 - ((d >= 0) ? Math.min(d, 0.9) :\n 1 / (1 / Math.max(d, -0.3) + 3.222));\n}", "function dZoom(d) {\n return 1 - ((d >= 0) ? Math.min(d, 0.9) :\n 1 / (1 / Math.max(d, -0.3) + 3.222));\n}", "function GetZoomFactor()\n {\n var factor = 1;\n if (document.body.getBoundingClientRect) {\n var rect = document.body.getBoundingClientRect();\n var physicalW = rect.right - rect.left;\n var logicalW = document.body.offsetWidth;\n factor = Math.round((physicalW / logicalW) * 100) / 100;\n }\n return factor;\n }", "function dZoom(d) {\n return 1 - (d >= 0 ? Math.min(d, 0.9) : 1 / (1 / Math.max(d, -0.3) + 3.222));\n}", "function zoom(dir, step) {\n\n\t\tif (step === 0) return;\n\t\t// step默认一次,但有的用户滚轮比较快,这时会捕捉到更大的deltaY,zoom即多次进行。\n\t\tstep = step || 1;\n\t\t// 默认行为是放大\n\t\tdir = dir || 1;\n\n\t\tvar vb = paper._viewBox;\n\n\t\tvar x = vb[0],\n\t\t\ty = vb[1],\n\t\t\tw = vb[2],\n\t\t\th = vb[3]\n\n\t\tvar _ratio = (dir === 1) ? paper.zoomRatio : 1 / paper.zoomRatio;\n\n\t\tvar _vb = {\n\t\t\tx: x + (1 - _ratio) * w / 2,\n\t\t\ty: y + (1 - _ratio) * h / 2,\n\t\t\tw: _ratio * w,\n\t\t\th: _ratio * h\n\t\t}\n\n\t\tpaper.setViewBox(_vb.x, _vb.y, _vb.w, _vb.h);\n\n\t\tzoom(dir, --step);\n\t}", "function zoom(){\n\t//NOT YET\n\t/*var rect = canvas.getBoundingClientRect();\n var mx = panX + (panX - rect.left) / zooms;\n var my = panY + (panY - rect.top) / zooms;\n zooms = document.getElementById(\"za\");\n panX = mx - ((panX - rect.left) / zooms);\n panY = my - ((panY - rect.top) / zooms);\n */\n zooms = document.getElementById(\"za\").value; \n mx = ((panX + (a-1)/zooms) - panX) / 2;\n panX -= mx;\n my = ((panY + (b-1)/zooms) - panY) / 2;\n panY -= mx;\n \n show();\n abortRun();\n startRun();\n}", "zoomIn () {}", "function mapZoom (){\n var d = [3, 4]\n if (window.innerWidth > 600) {return d[1]}\n else {return d[0]}\n }", "zoomIn(x, y){ return this.zoom(x, y, this.Scale.current + this.Scale.factor) }", "zoom () {\n return this.config.zoom\n }", "function calcStartPosition() {\n if (data.length <= noOfDataPoints) {\n startPosition = 0;\n } else {\n startPosition = noOfDataPoints - data.length;\n //console.log(noOfDataPoints);\n }\n\n //factor in scroll and zoom\n}", "function zoom() {\r\n zoomlevel = $(\"#myRange\").eq(0).val()\r\n recalc()\r\n}", "function d3_behavior_zoomDelta() {\n\n // mousewheel events are totally broken!\n // https://bugs.webkit.org/show_bug.cgi?id=40441\n // not only that, but Chrome and Safari differ in re. to acceleration!\n if (!d3_behavior_zoomDiv) {\n d3_behavior_zoomDiv = d3.select(\"body\").append(\"div\")\n .style(\"visibility\", \"hidden\")\n .style(\"top\", 0)\n .style(\"height\", 0)\n .style(\"width\", 0)\n .style(\"overflow-y\", \"scroll\")\n .append(\"div\")\n .style(\"height\", \"2000px\")\n .node().parentNode;\n }\n\n var e = d3.event, delta;\n try {\n d3_behavior_zoomDiv.scrollTop = 1000;\n d3_behavior_zoomDiv.dispatchEvent(e);\n delta = 1000 - d3_behavior_zoomDiv.scrollTop;\n } catch (error) {\n delta = e.wheelDelta || (-e.detail * 5);\n }\n\n return delta * .005;\n}", "function roundToStep(val, step) {\n return (val >= 0 ) ? val + step / 2 - (val + step / 2) % step : val - step / 2 - (val + step / 2) % step;\n }", "function getMeterZoom(_ref5) {\n var latitude = _ref5.latitude;\n\n __WEBPACK_IMPORTED_MODULE_8_assert___default()(latitude);\n var latCosine = Math.cos(latitude * DEGREES_TO_RADIANS);\n return scaleToZoom(EARTH_CIRCUMFERENCE * latCosine) - 8;\n}", "get zoom () {\n return parseInt(this.getAttribute('zoom'), 10);\n }", "get zoomFactor() {\n return this.zoomFactorInternal;\n }", "function zoomViewPort(x, y, factor, viewPort) {\n // incomplete...\n return _.extend({}, viewPort, {\n width: viewPort.width * factor,\n height: viewPort.height * factor\n });\n }", "function d3_v3_behavior_zoomDelta() {\n\n // mousewheel events are totally broken!\n // https://bugs.webkit.org/show_bug.cgi?id=40441\n // not only that, but Chrome and Safari differ in re. to acceleration!\n if (!d3_v3_behavior_zoomDiv) {\n d3_v3_behavior_zoomDiv = d3_v3.select(\"body\").append(\"div\")\n .style(\"visibility\", \"hidden\")\n .style(\"top\", 0)\n .style(\"height\", 0)\n .style(\"width\", 0)\n .style(\"overflow-y\", \"scroll\")\n .append(\"div\")\n .style(\"height\", \"2000px\")\n .node().parentNode;\n }\n\n var e = d3_v3.event, delta;\n try {\n d3_v3_behavior_zoomDiv.scrollTop = 1000;\n d3_v3_behavior_zoomDiv.dispatchEvent(e);\n delta = 1000 - d3_v3_behavior_zoomDiv.scrollTop;\n } catch (error) {\n delta = e.wheelDelta || (-e.detail * 5);\n }\n\n return delta * .005;\n}", "function getZoom(element) {\n var zoomInfo = (element.currentStyle && element.currentStyle.getAttribute)\n ? element.currentStyle.getAttribute('zoom')\n : undefined;\n \n return extractZoomFactor(zoomInfo);\n }", "function getZoomOffset(zoom) {\r\n\t\tsets = $['mapsettings'];\r\n\t\tvar xy = getCenterXY();\r\n\t\tvar percentxy = new Point((xy.x/sets.resolutions[sets.zoom-1].width),(xy.y/sets.resolutions[sets.zoom-1].height));\t\t\r\n\t\tvar offset = new Point(Math.round(percentxy.x*sets.resolutions[zoom-1].width),Math.round(percentxy.y*sets.resolutions[zoom-1].height));\r\n\t\treturn offset;\r\n\t}", "function getZoomFactor() {\n return WindowManager.INSTANCE.getZoomFactor();\n}", "function slConvertGMapZoomToSLZoom(zoom)\n{\n\t\t// We map SL zoom levels to farthest out zoom levels for GMaps, as the Zoom control will then\n\t\t// remove ticks for any zoom levels higher than we allow. (We map it in this way because it doesn't\n\t\t// do the same for zoom levels lower than we allow).\n\t\treturn 8 - zoom;\n}", "zoomIn() {\n this.zoom *= 1.25;\n }", "function calc_precision (zoom) {\n\tvar fixedAmount = -1;\n\tvar size = 40;\n\n\tif (zoom > 4)\n\t\tfixedAmount = 0;\n\n\tif (zoom >= 8) {\n\t\tfixedAmount = 1;\n\t}\n\n\tif (zoom >= 10) {\n\t\tfixedAmount = 2;\n\t}\n\n\tif (zoom >= 11) {\n\t\tfixedAmount = 8;\n\t}\n\n\treturn [fixedAmount, size];\n}", "function extractZoomFactor(zoom) {\n var zoomFactor = 1,\n zoomInfo;\n \n // already a number - that's our factor, then. \n if(typeof(zoom) === 'number') {\n return zoom;\n }\n \n if( zoom !== undefined && zoom !== \"\" && zoom !== \"normal\") {\n zoomInfo = zoom.match(/(\\d+|\\d+\\.\\d*)(%?)$/);\n if( zoomInfo) {\n zoomFactor = parseFloat(zoomInfo[1],10);\n if(zoomInfo[2] === '%') {\n zoomFactor /= 100;\n }\n }\n }\n \n return zoomFactor;\n }", "function zoom(factor){ \n\tconsole.log(\"\\n\\nzooming by \" + factor)\n\tconsole.log(\"current scale \" + scale)\n\tif(!isNaN(factor)){ \n\t\tscale *= factor \n\n\t\t\n\t\tsvgScale.setAttribute('transform', 'scale(' + scale + ')') \n\t\tresetTranslation()\n\t}\n}", "function setLinezoomWidth() {\n let strokeW = [\n 15, 8.5, 8, 7.5, 7, 6.5, 6, 5.5, 5, 4.5, 4, 3.5, 3, 4, 2, 1.9, 1.8, 1.1\n ];\n let zoom = map.getZoom();\n let width = strokeW[zoom - 1];\n return width;\n}", "function get_point_x(step) {\n\treturn 73 + step * 50;\n}", "function zoomIn(){\r\n\r\nvar temp=[];\r\n\r\ntemp[0]= (start[0]+end[0])/2;\r\ntemp[1]= (start[1]+end[1])/2;\r\n\r\n\r\n\r\nvar dist= ((start[0]-end[0])*(start[0]-end[0]))+((start[1]-end[1])*(start[1]-end[1]));\r\ndist= Math.sqrt(dist);\r\n\r\nif((dist*1000)<1)\r\n Zoom=15;\r\nelse if((dist*100)<1)\r\n Zoom=14;\r\nelse if((dist*10)<1)\r\n Zoom=13; \r\nelse if(dist>1 && dist <10)\r\n Zoom=12;\r\n\r\nelse \r\n Zoom=11;\r\n\r\n\r\nvar newCenter=[temp[0],temp[1]];\r\n//console.log(dist);\r\nmap.setZoom(Zoom);\r\n\r\nmap.setCenter(newCenter);\r\n\r\nif(count==0)\r\n count++;\r\n\r\n//map.flyto({center: newCenter});\r\n}", "zoomIn(e){\n // |--- check\n if(!(this.zoomLevel<5)){\n this.x = -this.mapTransLeft;\n this.y = -this.mapTransTop;\n\n return;\n }\n\n this.zoomLevel = this.zoomLevel + this.zoomStep;\n this.zoomCef = this.zoomLevel / (this.zoomLevel-this.zoomStep);\n this.cursorX = e.clientX - this.mapOffLeft;\n this.cursorY = e.clientY - this.mapOffTop;\n\n // |--- compute zoom center\n this.x = \n this.cursorX\n -\n ((this.cursorX+this.mapTransLeft)\n *\n this.zoomCef);\n\n this.y = \n this.cursorY\n -\n ((this.cursorY+this.mapTransTop)\n *\n this.zoomCef);\n }", "function zoom(event) \r\n {\r\n\r\n let delta = Math.sign(event.deltaY);\r\n\r\n if (delta > 0)\r\n {\r\n if (width <= 240)\r\n width += scale;\r\n\r\n if (height <= 260)\r\n height += scale;\r\n }\r\n\r\n if (delta < 0)\r\n {\r\n if (width >= 40)\r\n width -= scale;\r\n\r\n if (height >= 60)\r\n height -= scale;\r\n }\r\n\r\n\r\n lens.style.width = width + \"px\";\r\n lens.style.height = height + \"px\";\r\n }", "function calculateZoomLevel(node) {\n //Find an optimal zoom level in terms of how big the node will get\n //But the zoom level cannot be bigger than the max zoom\n return Math.min(max_zoom, Math.min(width * 0.4, height * 0.4) / (2 * node.r_fixed));\n } //function calculateZoomLevel", "function calculateZoomLevel(node) {\n //Find an optimal zoom level in terms of how big the node will get\n //But the zoom level cannot be bigger than the max zoom\n return Math.min(max_zoom, Math.min(width * 0.4, height * 0.4) / (2 * node.r_fixed));\n } //function calculateZoomLevel", "getZoomMultiplier (zoomLevel = this.state.zoomLevel) {\n return ZOOM_RATIO ** zoomLevel\n }", "function zoom(factor){\n var newZoom = currentZoom * factor;\n if (newZoom >= zoomLimits[0] && newZoom <= zoomLimits[1]){\n currentZoom = newZoom;\n offset[0]*=factor;\n offset[1]*=factor;\n initPosition=[0, 0];\n move(0, 0);\n draw();\n }\n }", "updateZoomVelocity() {\n const zoom = this.commands.zoom;\n if ((zoom.in ^ zoom.out) && Math.abs(this.zoom.vel.value) < this.zoom.vel.max) {\n if (zoom.in && this.zoom.value < this.zoom.max)\n this.zoom.vel.value += this.zoom.vel.change.key;\n if (zoom.out && this.zoom.value > this.zoom.min)\n this.zoom.vel.value -= this.zoom.vel.change.key;\n }\n }", "function zoom(factor) {\n // TODO:\n // Some bug here when decreasing the spacing\n\n var time = getTime(0.5);\n\n if (scale * factor >= 2048 || scale * factor <= (1 / 128)) return;\n\n scale *= factor;\n\n rescale();\n setTime(time);\n refresh();\n}", "function resolution( zoom )\n {\n return this.initialResolution / Math.pow( 2, zoom );\n }", "function resolution( zoom )\n {\n return this.initialResolution / Math.pow( 2, zoom );\n }", "function get_line_x1(step) {\n\treturn 75 + step * 50;\n}", "function wheelZoom(e){\n var evt=window.event || e;//equalize event object\n var delta=evt.detail? evt.detail*(-120) : evt.wheelDelta; //delta returns +120 when wheel is scrolled up, -120 when scrolled down\n //console.log(\"Wheel Zoom\");\n //console.log(zoom);\n\n if(typeof(delta) === 'number'){\n zoom = zoom + parseInt(delta/12);\n }\n // console.log(zoom);\n\n if(zoom < 80){\n zoom = 80;\n }\n if(zoom > 400){\n zoom = 400;\n }\n if (evt.preventDefault) {//disable default wheel action of scrolling page\n evt.preventDefault();\n }else{\n return false;\n }\n setMatrix();\n drawWorld();\n}", "function zoomTo(value)\n\t{\n\t\t_3dApp.script(_scriptGen.zoom(value));\n\t}", "function getMapZoom() {\n \n var mapZoomLevel = 3;\n\n return mapZoomLevel;\n\n}", "drag_rezoom(mouse_event) {\n const aY = mouse_event.clientY;\n this.state[\"zoom_val\"] = (\n this.drag_state[\"zoom\"][\"zoom_val_start\"]*Math.pow(\n 1.1, -(aY - this.drag_state[\"zoom\"][\"mouse_start\"][1])/10\n )\n );\n this.rezoom(this.drag_state[\"zoom\"][\"mouse_start\"][0], this.drag_state[\"zoom\"][\"mouse_start\"][1]);\n }", "function zoomXform(x, lap) {\n\n // The x-axis domain.\n var domain = SCALES.x.domain();\n var step = domain[1] - domain[0];\n\n // What is the increment between each lap after zooming.\n var inc = lap <= domain[0] || lap >= domain[1] ?\n step / (ZOOM_PEAK + ZOOM_SHOULDER - 2.0 + step) :\n step / (ZOOM_PEAK + 2.0 * ZOOM_SHOULDER - 3.0 + step);\n\n // The zoom centre is mid-lap.\n lap += 3.0;\n\n // The transformed version of x.\n var z = 0.0;\n\n // Beyond upper shoulder.\n if (x > lap + 1.0) z = (x + ZOOM_PEAK + 2.0 * ZOOM_SHOULDER - 3.0) * inc;\n\n // Upper shoulder.\n else if (x > lap) z = ((x - lap + 1.0) * ZOOM_SHOULDER + lap + ZOOM_PEAK - 2.0) * inc;\n\n // Peak.\n else if (x > lap - 1.0) z = ((x - lap + 1.0) * ZOOM_PEAK + lap + ZOOM_SHOULDER - 2.0) * inc;\n\n // Lower shoulder.\n else if (x > lap - 2.0) z = ((x - lap + 2.0) * ZOOM_SHOULDER + lap - 2.0) * inc;\n\n // Below lower shoulder.\n else z = (x - domain[0]) * inc;\n\n return z;\n}", "function updateZoom(x)\n{\n var oldVal = parseInt(zoomValueLabel.innerHTML);\n if (x != false)\n {\n xOffset = (xOffset / oldVal * zoomValue) >> 0;\n yOffset = (yOffset / oldVal * zoomValue) >> 0;\n }\n zoomValueLabel.innerHTML = zoomValue;\n fillCanvas();\n}", "function zoomPosFixed(t){\n\n\tif (t.x<-70 && t.k==1){\n\t\tt.x = -70;\n\t}\n\telse if(t.k>1 && t.k <= 1.6471820345351462 && t.x<-877.5684473379315){\n\t\tt.x=-877.5684473379315;\n\t}\n\telse if(t.k <= 2.7132086548953436 && t.x<-2214.3504808609173){\n\t\tt.x=-2214.3504808609173;\n\t}\n\n\n\t//console.log(\"t.x:\"+t.x+\"\\nt.y:\"+t.y+\"\\nt.k:\"+t.k);\n\n\treturn t;\n}", "function calc_step_size(a,b) {\r\n return (a - b) / steps_total;\r\n}", "_calcStepRounded(value) {\n var s = Math.round(value/this.step) * this.step;\n\n // make sure it isnt rounding out of our range; should only do so by one step:\n s = s < this.min ? s + this.step : s;\n s = s > this.max ? s - this.step : s;\n\n return s;\n }", "function setZoom() {\r\n zoom = 2.0;\r\n}", "function setZoom() {\r\n zoom = 2.0;\r\n}", "#updateZoom() {\n\n const size = this.#getSize();\n \n var zoom = -this.#diffwheel;\n zoom /= size.y;\n zoom *= this.zoompower;\n \n const ray = this.raycaster.ray.direction;\n\n this.camera.position.x += zoom * ray.x;\n this.camera.position.y += zoom * ray.y;\n this.camera.position.z += zoom * ray.z;\n\n this.#diffwheel = 0;\n }", "function listening_zoom(){\n\t\t\t\t\t\tWindow_information[\"visual_width\"] =aux_function()[4]\n \tWindow_information[\"visual_height\"] =aux_function()[5]\n var know_change = (Window_information[\"visual_width\"]/2) - (Window_information[\"browser_width\"]/2)\n debug[\"checking device width\"][1] ? console.log(Window_information[\"visual_width\"]) : \"\"\n if(know_change != $(\".html_page\").offset()[\"left\"]){\n $(\".html_page\").offset({\n left: know_change\n })\n }\n\n }", "function setZoom() {\n if(zoom == 2.0) {\n\t\tzoom = 1.0;\n\t} else {\n\t\tzoom = 2.0;\n\t}\n}", "function zoomBoard() {\r\n\tvar lbounds = paper.project.activeLayer.bounds;\r\n\tvar vbounds = {\r\n\t\twidth: canvas.width,\r\n\t\theight: canvas.height\r\n\t};\r\n\r\n\tvar zoomFactorW = (vbounds.width * 0.9) / 480;\r\n\tvar zoomFactorH = (vbounds.height * 0.9) / 320;\r\n\r\n\tzoomFactorW <= zoomFactorH ? paper.view.zoom = zoomFactorW : paper.view.zoom = zoomFactorH;\r\n\t\r\n\t//lbounds.width <= lbounds.height ? (vbounds.width * 0.9) / 480 : (vbounds.height * 0.9) / 320;\r\n\t//paper.view.zoom = zoomFactor;\r\n}", "function Simulator_ForwardZoomPixels(distPx)\n{\n\t__GESTURES.OnZoomPixels(distPx);\n}", "dpi () {\n return this.chart.width / this.interval.width * this.zoom.value;\n }", "function zoom(n) {\n var a;\n var n = (!n) ? 4 : n;\n if (n < map.getZoom()) {\n a = 'out';\n } else if (n > map.getZoom()) {\n a = 'in';\n }\n smoothZoom(map, n, map.getZoom(), a);\n}", "__computeZoomMin(currentZoom, photoZoom, trackZoom) {\n\n\t if (typeof currentZoom !== 'number') { return; }\n\n\t if (trackZoom) {\n\t const {min} = trackZoom;\n\n\t if (typeof min === 'number') {\n\t return min;\n\t }\n\t }\n\n\t if (photoZoom) {\n\t const {min} = photoZoom;\n\n\t if (typeof min === 'number') {\n\t return min;\n\t }\n\t }\n\n\t return currentZoom;\n\t }", "get zoom() {\n return this._zoom;\n }", "setInitialZoom() {\n let me = $(this);\n if (parseFloat(me.find(\"svg\").attr(\"width\")) != 0) {\n let initialZoom = $('.cntBody').width() / parseFloat(me.find(\"svg\").attr(\"width\"));\n me.find(\".sliderZoom\").val(initialZoom);\n me.find(\".sliderZoom\").change();\n }\n }", "function handleMouseWheel(e) {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n var zoomDelta = parseInt(e.deltaY) / 10\r\n zoomlevel = parseInt(zoomlevel)\r\n zoomlevel = zoomlevel + zoomDelta / 10\r\n\r\n log(\"zoomDelta: \" + zoomDelta.toString())\r\n log(\"zoomlevel: \" + zoomlevel.toString())\r\n\r\n if (zoomlevel >= 400) {\r\n zoomlevel = 400\r\n log(\"Full Zoom\")\r\n } else if (zoomlevel <= 5) {\r\n zoomlevel = 5\r\n log(\"Full Zoom\")\r\n }\r\n $(\"#myRange\").eq(0).val(zoomlevel)\r\n recalc()\r\n}", "function zoom(e) { \r\n\t\t\r\n\t//get canvas position and add it to current mouse position\t\r\n\t\r\n\tvar obj = document.getElementById('canvas');\r\n\t\r\n\tvar left = 0;\r\n\tvar top = 0;\r\n\t\r\n\tif (obj.offsetParent) {\r\n\t\tdo {\r\n\t\t\tleft += obj.offsetLeft;\r\n\t\t\ttop += obj.offsetTop;\r\n\t\t} while (obj = obj.offsetParent);\t\r\n\t}\r\n \r\n\tmouseX = e.clientX - canvas.offsetLeft;\r\n\tmouseY = e.clientY - canvas.offsetTop;\r\n\t\r\n\t\r\n\t// re-calculate the new max and min values for the real and imaginary axii\r\n\t\r\n\tvar xZoom = mouseX / CANVAS_WIDTH;\r\n\tvar yZoom = mouseY / CANVAS_HEIGHT;\r\n\t\r\n\tvar rangeRe = MaxRe - MinRe;\r\n\tvar centerRe = MinRe + rangeRe * xZoom;\r\n\t\r\n\tMinRe = centerRe - rangeRe/4;\r\n\tMaxRe = centerRe + rangeRe/4;\r\n\t\r\n\tvar rangeIm = MaxIm + Math.abs(MinIm);\r\n\tvar centerIm = MinIm +( (1.0 - yZoom)*rangeIm);\r\n\t\r\n\tMinIm = centerIm - rangeIm/4;\r\n\tMaxIm = MinIm+(MaxRe-MinRe)*CANVAS_HEIGHT/CANVAS_WIDTH;\r\n\t\r\n\tRe_factor = (MaxRe-MinRe)/(CANVAS_WIDTH-1);\r\n\tIm_factor = (MaxIm-MinIm)/(CANVAS_HEIGHT-1);\r\n\t\r\n\tdrawJulia();\t\t// re-draw the set\r\n\t\r\n}", "function Zoom() {\n var winHeight = $(window).height();\n var zoom = 1;\n var bodyMaxHeight = 1331;\n zoom = winHeight/bodyMaxHeight;\n /* Firefox */\n var winWidth = $(window).width();\n var widthFirefox = winWidth/zoom;\n var winWidths = $(window).height();\n if(navigator.userAgent.indexOf(\"Firefox\") != -1) {\n $('#Zoom').css({\n '-moz-transform': 'scale('+zoom+')', /* Firefox */\n 'transform-origin': '0 0',\n 'width': widthFirefox,\n });\n } else {\n $('#Zoom').css({\n 'zoom': zoom,\n });\n }\n }", "function calc_step_size(a, b) {\r\n return (a - b) / steps_total;\r\n}", "getStepSize(totalSize) {\n const val = Math.min(\n Math.max(Math.round((totalSize - this.defaultRenderCount) / 5), 5),\n totalSize - this.defaultRenderCount\n );\n return val;\n }", "zoomIn(){\n this.GRID_SIZE_PX = this.GRID_SIZE_PX + this.ZOOM_STEP_PX;\n this.applyGridSize();\n this.saveLocally();\n }", "getZoomMultiplier(zoomLevel = this.state.zoomLevel) {\n return ZOOM_RATIO ** zoomLevel;\n }", "function zoomClick() {\n var direction = -1,\n factor = 0.2,\n target_zoom = 1,\n center = [mapWidth / 2, mapHeight / 2],\n extent = zoom.scaleExtent(),\n translate = zoom.translate(),\n translate_temp = [],\n l = [],\n view = {x: translate[0], y: translate[1], k: zoom.scale()};\n\n if (arguments[0] == 0) { zoomReset(); }\n else if (arguments[0] == 1) { direction = arguments[0]; }\n\n target_zoom = zoom.scale() * (1 + factor * direction);\n\n if (target_zoom < extent[0] || target_zoom > extent[1]) { return false; }\n\n translate_temp = [(center[0] - view.x) / view.k, (center[1] - view.y) / view.k];\n view.k = target_zoom;\n l = [translate_temp[0] * view.k + view.x, translate_temp[1] * view.k + view.y];\n\n view.x += center[0] - l[0];\n view.y += center[1] - l[1];\n\n interpolateZoom([view.x, view.y], view.k);\n}", "function scrollWheel(e)\n{\n if (e.deltaY < 0)\n zoomValue = Math.min(zoomValue + 100, 1600);\n else if (e.deltaY > 0)\n zoomValue = Math.max(zoomValue - 100, 300);\n\n if (e.deltaY != 0)\n updateZoom();\n}", "zoomIn() {\n this.zoomWithScaleFactor(0.5)\n }", "get zoomLevel() {\n return this.transformationMatrix.a;\n }", "function radiusToZoom(radius)\n{\n return Math.round(14-Math.log(radius)/Math.LN2);\n}", "_zoomEventListener() {\n // CLASS REFERENCE\n let that = this;\n\n // ZOOM LISTENER\n d3.select('.zoom-display').on('keyup', function () {\n if (that.zoomState == false) return false;\n let zoom = d3.select(this).property('value') / 100;\n let newX = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * zoom), (that.canvasSize.height * zoom)).x;\n let newY = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * zoom), (that.canvasSize.height * zoom)).y;\n let newK = zoom\n that.svg.call(that.zoom.transform, d3.zoomIdentity.translate(newX, newY).scale(newK));\n that.zoomData.x = newX, that.zoomData.y = newY, that.zoomData.k = newK;\n })\n\n\n d3.selectAll('[data-zoom]').on('click', function () {\n if (that.zoomState == false) return false;\n\n let zoom = d3.select(this).attr('data-zoom');\n let mVariable = parseFloat(`.${zoom}`);\n if (zoom >= 100) {\n mVariable = mVariable * 10;\n }\n console.log(mVariable)\n let newK = parseInt(zoom) / 100;\n // let newX = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * mVariable), (that.canvasSize.height * mVariable)).x;\n // let newY = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * mVariable), (that.canvasSize.height * mVariable)).y;\n let newX = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * mVariable), (that.canvasSize.height * mVariable)).x;\n let newY = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * mVariable), (that.canvasSize.height * mVariable)).y;\n // let newK = 0.75\n that.svg.call(that.zoom.transform, d3.zoomIdentity.translate(newX, newY).scale(newK));\n that.zoomData.x = newX, that.zoomData.y = newY, that.zoomData.k = newK;\n $(\".zoom-display\").val(newK * 100);\n\n })\n\n // ZOOM STATE\n d3.select('#zoom-state').on('click', function () {\n let element = d3.select(this);\n let state = element.attr('data-zoom-state');\n if (state === 'enable') {\n that.zoomState = false;\n that.svg.on('.zoom', null);\n element.attr('data-zoom-state', 'disable');\n element.select('img').attr('src', `${that.BASE_URL}assets/icons/zoom-disable.svg`);\n } else {\n that.zoomState = true;\n that.svg.call(that.zoom)\n that.zoom.transform(that.canvas, d3.zoomIdentity.translate(that.zoomData.x, that.zoomData.y).scale(that.zoomData.k));\n element.attr('data-zoom-state', 'enable');\n element.select('img').attr('src', `${that.BASE_URL}assets/icons/zoom-enable.svg`);\n }\n })\n\n }", "function setTimelineZoomPoint(cInterval){\n var zoomvalue = 1;\n \n //alert(\"in get zoom point slider date is \" + sliderDate.getFullYear() + \" \" + sliderDate.getMonth() + \" \" + sliderDate.getDate());\n \n switch(cInterval){\n case \"years\":\n zoomvalue = getDateDifference(birthDate, sliderDate, \"years\");\n break;\n case \"months\":\n zoomvalue = getDateDifference(birthDate, sliderDate, \"months\");\n break;\n case \"days\":\n zoomvalue = getDateDifference(birthDate, sliderDate, \"days\");\n break;\n case \"weeks\":\n zoomvalue = getDateDifference(birthDate, sliderDate, \"days\");\n break;\n case \"hours\":\n zoomvalue = getDateDifference(birthDate, sliderDate, \"hours\");\n break;\n default:\n alert(\"trying to get the zoom point for an incorrect interval\");\n break;\n }\n \n return zoomvalue;\n}", "function calc_step_size(a,b) {\n\t\t return (a - b) / steps_total;\n\t\t}", "function initZoom() {\n var c = sigmaInstance.camera;\n c.goTo({\n ratio: c.settings(\"zoomingRatio\")\n });\n}", "function _zoomFractal(zoomin) {\n if (zoomin) {\n zoom *= _zoomFactor;\n const dx = -(Shape.mouse.x + offsetX + panX + 90 * _zoomFactor) / zoom * _zoomFactor;\n const dy = -(Shape.mouse.y + offsetY + panY + 50 * _zoomFactor) / zoom * _zoomFactor;\n panX += dx;\n panY += dy;\n } else {\n zoom /= _zoomFactor;\n const dx = -(Shape.mouse.x + offsetX - panX - 90 * _zoomFactor) / zoom;\n const dy = -(Shape.mouse.y + offsetY - panY - 50 * _zoomFactor) / zoom;\n panX += dx;\n panY += dy;\n }\n }", "function getXStep(len) {\n return (rotated ? height : width) / (len - 1);\n }", "function zoomIn() {\n var c = sigmaInstance.camera;\n c.goTo({\n ratio: c.ratio / c.settings(\"zoomingRatio\")\n });\n}", "function zoomIn()\n\t{\n\t\t_3dApp.script(_scriptGen.defaultZoomIn());\n\t}", "function onStepDividerDrag(event){\n\t\t\tmw.update_step_durations(drag_data, event.pageX, event.shiftKey);\n\t\t}", "function move_screen()\r\n{\r\n\tzoomClicked = true;\r\n\tzoomCount++;\r\n\r\n}", "function AdjustZoomLevel() {\n\tcurrentZoomLevel = map.getZoom();\n}", "function getRelDensity(zoom, n) {\n var stepSize = maxDensity / zRangeDiff; // 255 / 17 = 15\n var stepN = zoom - 1;\n var lower = maxDensity - (stepN * stepSize);\n if (n < lower) {\n n = lower;\n }\n var mldiff = maxDensity - lower;\n var rel = n - lower;\n var relDensity = rel / mldiff;\n return relDensity;\n}", "function setCurrentZoom(){ \n var limit = getLimits();\n var countriesWidth = limit[\"maxX\"] - limit[\"minX\"];\n var canvasWidth=getCanvasSize(0);\n var canvasHeight=getCanvasSize(1);\n var zoomX=canvasWidth/countriesWidth;\n \n var countriesHeight = limit[\"maxY\"] - limit[\"minY\"];\n var zoomY=canvasHeight/countriesHeight;\n \n currentZoom = Math.min(zoomX, zoomY)*0.90;\n \n zoomLimits[0] = currentZoom;\n zoomLimits[1] = currentZoom*2048;\n offsetInit = [(canvasWidth-(limit[\"maxX\"]+limit[\"minX\"]))/2, (canvasHeight-(limit[\"maxY\"]+limit[\"minY\"]))/2]\n }", "function latScale(value) {\n\treturn Math.round((value - minlat) * parseInt(map.css('width')) / (maxlat - minlat));\n}", "handleZoom (newZoomLevel, focalPoint)\n {\n // If the zoom level provided is invalid, return false\n if (!this.isValidOption('zoomLevel', newZoomLevel))\n return false;\n\n // While zooming, don't update scroll offsets based on the scaled version of diva-inner\n this.viewerState.viewportObject.removeEventListener('scroll', this.boundScrollFunction);\n\n // If no focal point was given, zoom on the center of the viewport\n if (!focalPoint)\n {\n const viewport = this.viewerState.viewport;\n const currentRegion = this.viewerState.renderer.layout.getPageRegion(this.settings.currentPageIndex);\n\n focalPoint = {\n anchorPage: this.settings.currentPageIndex,\n offset: {\n left: (viewport.width / 2) - (currentRegion.left - viewport.left),\n top: (viewport.height / 2) - (currentRegion.top - viewport.top)\n }\n };\n }\n\n const pageRegion = this.viewerState.renderer.layout.getPageRegion(focalPoint.anchorPage);\n\n // calculate distance from cursor coordinates to center of viewport\n const focalXToCenter = (pageRegion.left + focalPoint.offset.left) -\n (this.settings.viewport.left + (this.settings.viewport.width / 2));\n const focalYToCenter = (pageRegion.top + focalPoint.offset.top) -\n (this.settings.viewport.top + (this.settings.viewport.height / 2));\n\n const getPositionForZoomLevel = function (zoomLevel, initZoom)\n {\n const zoomRatio = Math.pow(2, zoomLevel - initZoom);\n\n //TODO(jeromepl): Calculate position from page top left to viewport top left\n // calculate horizontal/verticalOffset: distance from viewport center to page upper left corner\n const horizontalOffset = (focalPoint.offset.left * zoomRatio) - focalXToCenter;\n const verticalOffset = (focalPoint.offset.top * zoomRatio) - focalYToCenter;\n\n return {\n zoomLevel: zoomLevel,\n anchorPage: focalPoint.anchorPage,\n verticalOffset: verticalOffset,\n horizontalOffset: horizontalOffset\n };\n };\n\n this.viewerState.options.zoomLevel = newZoomLevel;\n let initialZoomLevel = this.viewerState.oldZoomLevel;\n this.viewerState.oldZoomLevel = this.settings.zoomLevel;\n const endPosition = getPositionForZoomLevel(newZoomLevel, initialZoomLevel);\n this.viewerState.options.goDirectlyTo = endPosition.anchorPage;\n this.viewerState.verticalOffset = endPosition.verticalOffset;\n this.viewerState.horizontalOffset = endPosition.horizontalOffset;\n\n this.viewerState.renderer.transitionViewportPosition({\n duration: this.settings.zoomDuration,\n parameters: {\n zoomLevel: {\n from: initialZoomLevel,\n to: newZoomLevel\n }\n },\n getPosition: (parameters) =>\n {\n return getPositionForZoomLevel(parameters.zoomLevel, initialZoomLevel);\n },\n onEnd: (info) =>\n {\n this.viewerState.viewportObject.addEventListener('scroll', this.boundScrollFunction);\n\n if (info.interrupted)\n this.viewerState.oldZoomLevel = newZoomLevel;\n }\n });\n\n // Send off the zoom level did change event.\n this.publish(\"ZoomLevelDidChange\", newZoomLevel);\n\n return true;\n }", "function setZoom(value) {\n\t\t$zoomSliderFull.css(\"width\", value);\n\t\t$zoomCursor.css(\"left\", parseInt($zoomBar.css(\"left\")) + value - parseInt($zoomCursor.css(\"width\"))/2);\n\t\tjimDevice.setZoom((value/2 + 50) /100);\n\t}" ]
[ "0.6887877", "0.6567673", "0.65666026", "0.65600044", "0.63644785", "0.63644785", "0.6340326", "0.62715423", "0.62563574", "0.6237917", "0.6233597", "0.6233597", "0.6204101", "0.6177413", "0.61689407", "0.61249894", "0.61089003", "0.6100329", "0.6091082", "0.6087894", "0.6074129", "0.6052211", "0.6051855", "0.60421026", "0.60350436", "0.602374", "0.6004536", "0.5975527", "0.5973772", "0.59693277", "0.5949421", "0.59446836", "0.5935194", "0.5913998", "0.590382", "0.5877458", "0.5860127", "0.5856153", "0.58445466", "0.58360684", "0.583518", "0.5832573", "0.58189005", "0.58189005", "0.5810201", "0.5804307", "0.5798931", "0.5793363", "0.57884336", "0.57884336", "0.5776071", "0.57745624", "0.57742524", "0.57715064", "0.57619685", "0.57548267", "0.5753238", "0.5740357", "0.573483", "0.5722528", "0.5719847", "0.5719847", "0.57149476", "0.5698646", "0.56944245", "0.5687322", "0.56687695", "0.56605625", "0.56589216", "0.56579745", "0.56539917", "0.5653361", "0.56358343", "0.5626855", "0.5626518", "0.5617991", "0.55995697", "0.55970436", "0.5592995", "0.55887365", "0.5579646", "0.5577257", "0.5574128", "0.5572109", "0.55685025", "0.55587935", "0.5547992", "0.55454874", "0.5540644", "0.5538736", "0.5535931", "0.55224985", "0.55069727", "0.55021316", "0.55016583", "0.55010945", "0.54983056", "0.54940367", "0.5476729", "0.54752296" ]
0.73594874
0
Convert a NodeForge type distingished name object to the DistinigishedName object
static getFromNodeForgeDistingishedName(forgeAttributes) { var distingishedName = new DistingishedName(); for (var attribute of forgeAttributes) { if (!('type' in attribute)) throw new Error('node-forge produced an attribute without a valid type for a certificate distingished name'); if (!('value' in attribute)) throw new Error('node-forge produced an attribute without a valid value for a certificate distingished name'); if (attribute['valueTagClass'] != 19) throw new Error('node-forge produced an attribute without a valid tag type for a certificate distingished name'); var attributeType = attribute['type']; var attributeKey = DistingishedName.forgeTypeToAttributeKeyMap.has(attributeType) ? DistingishedName.forgeTypeToAttributeKeyMap.get(attributeType) : attributeType; distingishedName.addAttribute(attributeKey, attribute['value']); } distingishedName.updateIdentityString(); distingishedName.updateLookupString(); return distingishedName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static convertTLSDistingishedName(distingishedName) {\n return {\n 'commonName': distingishedName['CN'],\n 'givenName': distingishedName['GN'],\n 'surname': distingishedName['SN'],\n 'initials': distingishedName['initials'],\n 'localityName': distingishedName['L'],\n 'stateOrProvinceName': distingishedName['ST'],\n 'countryName': distingishedName['C'],\n 'organizationName': distingishedName['O'],\n 'organizationalUnitName': distingishedName['OU']\n };\n }", "function convertChannelNameToObject(channel) {\n channel = channel.split(';');\n\n // Remove private- from the beginning of the network name.\n var network = channel[0].split('-');\n network.shift();\n // Rejoin the network field in case the network name had '-'s in it.\n network = network.join('-');\n \n return {\n network: network,\n node: channel[1],\n sensor: channel[2],\n feature: channel[3]\n };\n}", "function omn_renameDomain(domain){\n var array_domain= domain.split(\".\");\n if(array_domain.length == 3){//have un domain like los40.com.co or los40.com.ar\n domain= array_domain[0] + array_domain[2];\n }\n else{\n domain= array_domain[0] + array_domain[1];\n }\n return domain;\n}", "decedentName(deathRecord) {\n var metadata = deathRecord.metadata;\n var suffix = metadata.suffix;\n if (!suffix) {\n suffix = '';\n }\n // Format name\n if (metadata.firstName && metadata.lastName && metadata.middleName) {\n return metadata.lastName + ', ' + metadata.firstName + ' ' + metadata.middleName[0] + '. ' + suffix;\n } else if (metadata.firstName && metadata.middleName) {\n return metadata.firstName + ' ' + metadata.middleName[0] + '. ' + suffix;\n } else if (metadata.firstName && metadata.lastName) {\n return metadata.lastName + ', ' + metadata.firstName + ' ' + suffix;\n } else if (metadata.firstName) {\n return metadata.firstName + ' ' + suffix;\n } else if (metadata.lastName) {\n return metadata.lastName + ' ' + suffix;\n }\n }", "function cloneEntityName(node, parent) {\n var clone = cloneNode(node, node, node.flags, parent);\n if (isQualifiedName(clone)) {\n var left = clone.left, right = clone.right;\n clone.left = cloneEntityName(left, clone);\n clone.right = cloneNode(right, right, right.flags, parent);\n }\n return clone;\n }", "get datatype() {\n return new NamedNode(this.datatypeString);\n }", "get datatype() {\n return new NamedNode(this.datatypeString);\n }", "normalizeName (str) {\n var dir = _.slugify(_.humanize(str));\n var name = dir;\n if(str.substr(-6)=='-modal') {\n name = str.substr(0, str.length-6)+'.modal'\n }\n if(str.substr(-8)==='-service') {\n name = str.substr(0, str.length-8)+'.service'\n }\n var label = _.humanize(dir);\n var nameCamel = _.classify(dir);\n var nameLowCamel = _.camelize(dir, true);\n if(dir.substr(-10)==='-component') {\n name = str.substr(0, str.length-10)+'.component'\n label = _.humanize(dir);\n nameCamel = _.classify(dir);\n nameLowCamel = _.camelize(dir, true);\n dir = str.substr(0, str.length-10)\n }\n return {\n dir: dir,\n name: name,\n label: label,\n nameLowCamel: nameLowCamel,\n nameCamel: nameCamel\n }\n }", "static reverseName(boss) {\n boss.name = boss.name.split('').reverse().join('');\n }", "function typeConversion(type) {\n if (type === 'element') type = 'ich';\n return type.charAt(0).toUpperCase() + type.slice(1); // Capitalize first letter\n} //function typeConversion", "function shortenTypeName(buildingType){\n if (buildingType.indexOf(' ') > -1){\n return buildingType.substring(0, buildingType.indexOf(' '));\n }\n else if (buildingType.indexOf('/') > -1){\n return buildingType.substring(0, buildingType.indexOf('/'));\n }\n else if (buildingType.indexOf('\\\\') > -1){\n return buildingType.substring(0, buildingType.indexOf('\\\\'));\n }\n else{\n return buildingType;\n }\n }", "function getNormalizedName(obj) {\n var factoryManager = _container.FACTORY_FOR.get(obj);\n if (factoryManager) {\n return factoryManager.normalizedName;\n }\n }", "function denormalize(str) {\n return str.replace(/\\W+/g, '-')\n .replace(/([a-z\\d])([A-Z])/g, '$1-$2').toLowerCase();\n }", "function transform_synonym_to_nodes_and_edges(data) {\n // return value\n var result = new Object();\n var nodes = [];\n var edges = [];\n\n // unique node id\n var idgen=0;\n\n $.each(data['synonym'], function(i, sobj) {\n var start=idgen;\n //console.log('root: ' + idgen + ': ' + sobj['root']);\n nodes.push({id: idgen, label: sobj['root']})\n idgen++;\n $.each(sobj['syn'], function(i, sdata) {\n //console.log('syn: ' + idgen + ': ' + sdata);\n nodes.push({id: idgen, label: sdata})\n idgen++;\n });\n for (k=start; k<idgen-1; k++) {\n //console.log('edge: ' + start + ' => ' + (k+1));\n edges.push({ from: start, to: k+1});\n }\n });\n result.nodes = nodes;\n result.edges = edges;\n\n return result;\n}", "function convertPropertyName( str ) {\n\t\t\treturn str.replace( /\\-([A-Za-z])/g, function ( match, character ) {\n\t\t\t\treturn character.toUpperCase();\n\t\t\t});\n\t\t}", "function convertPropertyName( str ) {\n\t\t\treturn str.replace( /\\-([A-Za-z])/g, function ( match, character ) {\n\t\t\t\treturn character.toUpperCase();\n\t\t\t});\n\t\t}", "function createNameNode() {\n return jsonldUtils.createBlankNode({ '@type': TYPE.Name });\n}", "function u(e,t){const n=e.schema.options.discriminatorKey;return null!=t&&t.hasOwnProperty(n)&&(e=o(e,t[n])||e),e}", "function DNAStrand(dna) {\n return dna.replace(/./g, function(c) {\n return DNAStrand.pairs[c]\n })\n }", "function DNAStrand(dna) {\n return dna.replace(/./g, function(c) {\n return DNAStrand.pairs[c]\n })\n }", "function BOT_topicToName(tid) {\r\n\tvar res = BOT_get(tid,\"name\",\"VAL\");\r\n\tif(!res) res = BOT_get(tid,\"_reference\",\"VAL\");\r\n\tif(BOT_isArray(res)) { \r\n\t\tif(res.length > 0) return res[0]\r\n\t\telse return \"Unnamed\" // no name nor reference founc\r\n\t\t}\r\n\telse return res\r\n}", "normalizeEntityName(entityName) {\n return entityName;\n }", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./, \"\"); // S4.1.2.3 & S5.2.3: ignore leading .\n\n if (IP_V6_REGEX_OBJECT.test(str)) {\n str = str.replace(\"[\", \"\").replace(\"]\", \"\");\n }\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function pfKnowledgeDungeoneering(){\n\tthis.inheritFrom = pfGenericKnowledge;\n this.inheritFrom();\n this.setName(\"knowledge_dungeoneering\");\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./, \"\"); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function unMungeNetworkName(name)\n{\n name = ecmaUnescape(name);\n return name.replace(/_/g, \":\").replace(/-/g, \".\");\n}", "function convertReactSVGDOMProperty(str) {\n return str.replace(/[-|:]([a-z])/g, function (g) {\n return g[1].toUpperCase();\n });\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./, ''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function getDnType(dnUsage) {\n return (dnUsage === 'Primary') ? 'Primary' : '';\n }", "function DNAtoRNA(dna) {\n return dna.replace(/T/g, 'u').toUpperCase();\n}", "function buildName(nameNode)\n{\n if(!nameNode)\n return null;\n\n var name=\"\";\n\n // use the first occurrence of name if more than one is found\n if(Array.isArray(nameNode))\n nameNode=nameNode[0];\n\n if(nameNode.prefix)\n name=getNodeText(nameNode.prefix)+\" \";\n\n if(Array.isArray(nameNode.given))\n {\n for(var i=0; i<nameNode.given.length; i++)\n name+=getNodeText(nameNode.given[i])+\" \";\n }\n else\n name+=getNodeText(nameNode.given)+\" \";\n\n name+=getNodeText(nameNode.family);\n\n if(nameNode.suffix)\n name+=\", \"+getNodeText(nameNode.suffix);\n\n return name;\n}", "function changeDependentNameAttributeValue(object, type, value) {\n\n if (type == \"PerLengthPhaseImpedance\") {\n //get all the PhaseImpedanceData Objects\n\n let allPhaseImpedanceData = self.model.getTargets(\n [object],\n \"PerLengthPhaseImpedance.PhaseImpedanceData\"\n );\n\n allPhaseImpedanceData.forEach(function (element, index) {\n\n let allSequenceNumber = Object.values(element.children).filter(function (obj) {\n return obj.localName == \"PhaseImpedanceData.sequenceNumber\"\n });\n\n let objSequenceNumber = allSequenceNumber[0]; //since each PhaseImpedancedata have only single sequenceNumber\n\n if (objSequenceNumber) {\n //if sequence number is defined then, get the value of the sequence number\n let nSeqNumberValue = objSequenceNumber.childNodes[0].nodeValue;\n\n /* append the name of the PerLengthPhaseImpedance Object with Sequence Number\n * of PhaseImpedanceData Object. The Resultant string is the name of the \n * PhaseImpedanceData Object\n */\n\n let nPhaseImpedanceDataName = value + \"_\" + nSeqNumberValue;\n let target = d3.select(\"div.tree\")\n .selectAll(\"ul#\" + element.attributes.getNamedItem('rdf:ID').value);\n\n if (target.empty() === false) {\n\n //if the target ul is not empty, the select the button element and change the name of the button\n\n let btn = d3.select(target.node().parentNode).select(\"button\");\n\n btn.html(nPhaseImpedanceDataName);\n }\n $(\"[cim-target=\\\"\" + element.attributes.getNamedItem('rdf:ID').value + \"\\\"]\").html(value);\n }\n });\n }\n else {\n //do this for other types if required...\n }\n }", "function rdfPerson(fullname) {\n var nameInit = fullname.charAt(0); // prendo l'iniziale del nome\n var surname = fullname.substr(fullname.indexOf(\" \"));\n\n var firstSurname = \"\";\n var secondSurname = \"\";\n\n // primo, secondo e terzo spazio nel cognome\n var first = 0, second = 0, third = 0;\n\n // ciclo per individuare gli ultimi due spazi nel cognome\n do {\n second = surname.indexOf(\" \", first + 1);\n if (second == -1) {\n firstSurname = surname.substr(first + 1);\n } else {\n third = surname.indexOf(\" \", second + 1);\n if (third == -1) {\n secondSurname = surname.substr(second + 1);\n firstSurname = surname.substr(first + 1, second - first - 1);\n } else {\n first = second;\n }\n }\n } while (firstSurname == \"\");\n \n return ((nameInit + \"-\" + firstSurname + secondSurname)).toLowerCase();\n}", "async function transferNameOwnership(connection, name, newOwner, nameClass, nameParent) {\n const hashed_name = await utils_2.getHashedName(name);\n const nameAccountKey = await utils_2.getNameAccountKey(hashed_name, nameClass, nameParent);\n let curentNameOwner;\n if (nameClass) {\n curentNameOwner = nameClass;\n }\n else {\n curentNameOwner = (await state_1.NameRegistryState.retrieve(connection, nameAccountKey)).owner;\n }\n const transferInstr = instructions_1.transferInstruction(exports.NAME_PROGRAM_ID, nameAccountKey, newOwner, curentNameOwner, nameClass);\n return transferInstr;\n}", "function getShortNameOfVcNode(vcName, fullNodeName) {\r\n\t\tlet shortName = \"\";\r\n\t\tfullNodeName.split('').forEach(function(val, i) {\r\n\t\t\tif (val != vcName.charAt(i))\r\n\t\t\t\tshortName += val ; \r\n\t\t});\r\n\t\tif (shortName.charAt(0) == \"-\" || shortName.charAt(0) == \"_\")\r\n\t\t\tshortName = shortName.substring(1);\r\n\t\treturn shortName;\r\n\t}", "function getTypeName(yagoType) {\r\n\tvar typeName = yagoType.split(/:(.+)?/)[1];\r\n\tvar wordnetCode = typeName.substr(typeName.length - 9);\r\n\t\r\n\tif(!isNaN(wordnetCode))\r\n\t\ttypeName = typeName.substr(0, typeName.length - 9);\r\n\t\r\n\treturn typeName;\r\n}", "function getTypeName(node) {\n if (node.type == 'Identifier') {\n return node.name;\n } else if (node.type == 'QualifiedTypeIdentifier') {\n return getTypeName(node.qualification) + '.' + getTypeName(node.id);\n }\n\n throw this.errorWithNode('Unsupported type: ' + node.type);\n }", "function mN3(name){\n\treturn name;\n}", "function getNodeName(node) {\n var attr = node.attributes['_ktype'];\n if (attr != undefined)\n return attr.nodeValue;\n return '';\n }", "function mN2(name){\n\treturn name;\n}", "function subtypeName() {\n return containsSuffix() ? name.split('+')[0] : name;\n }", "get termType() {\n return 'NamedNode';\n }", "get termType() {\n return 'NamedNode';\n }", "function buildSlug(node) {\n let slug = `/${_.kebabCase(node.title)}`;\n return slug;\n}", "function convertToUppercase(type_of_cast)\r\n{\r\n var return_data;\r\n if(type_of_cast.toLowerCase() == \"sg_iron\")\r\n {\r\n return_data = \"SG Iron\";\r\n }\r\n else if(type_of_cast.toLowerCase() == \"crca,foundry\")\r\n {\r\n return_data = \"CRCA, Foundry R/R\";\r\n }\r\n else{\r\n return_data = type_of_cast;\r\n }\r\n return return_data;\r\n}", "function normalizeReference(str) {\n // use .toUpperCase() instead of .toLowerCase()\n // here to avoid a conflict with Object.prototype\n // members (most notably, `__proto__`)\n return str.trim().replace(/\\s+/g, ' ').toUpperCase();\n}", "function normalizeReference(str) {\n // use .toUpperCase() instead of .toLowerCase()\n // here to avoid a conflict with Object.prototype\n // members (most notably, `__proto__`)\n return str.trim().replace(/\\s+/g, ' ').toUpperCase();\n}", "function normalizeReference(str) {\n // use .toUpperCase() instead of .toLowerCase()\n // here to avoid a conflict with Object.prototype\n // members (most notably, `__proto__`)\n return str.trim().replace(/\\s+/g, ' ').toUpperCase();\n}", "function normalizeReference(str) {\n // use .toUpperCase() instead of .toLowerCase()\n // here to avoid a conflict with Object.prototype\n // members (most notably, `__proto__`)\n return str.trim().replace(/\\s+/g, ' ').toUpperCase();\n}", "function normalizeReference(str) {\n // use .toUpperCase() instead of .toLowerCase()\n // here to avoid a conflict with Object.prototype\n // members (most notably, `__proto__`)\n return str.trim().replace(/\\s+/g, ' ').toUpperCase();\n}", "function normalizeReference(str) {\n // use .toUpperCase() instead of .toLowerCase()\n // here to avoid a conflict with Object.prototype\n // members (most notably, `__proto__`)\n return str.trim().replace(/\\s+/g, ' ').toUpperCase();\n}", "function normalizeReference(str) {\n // use .toUpperCase() instead of .toLowerCase()\n // here to avoid a conflict with Object.prototype\n // members (most notably, `__proto__`)\n return str.trim().replace(/\\s+/g, ' ').toUpperCase();\n}", "function normalizeReference(str) {\n // use .toUpperCase() instead of .toLowerCase()\n // here to avoid a conflict with Object.prototype\n // members (most notably, `__proto__`)\n return str.trim().replace(/\\s+/g, ' ').toUpperCase();\n}", "function typeConversion(type) {\n if (type === \"element\" ) type = 'photograph';\n else if (type === \"casestudy\") type = \"case study\"\n if (type in common_translations[language]) {\n return common_translations[language][type];\n } else {\n return type.charAt(0).toUpperCase() + type.slice(1); // Capitalize first letter\n }\n}", "function fix_compatibility(odata) {\n return odata.replace(/dl_/g, 'eth_')\n .replace(/nw_/g, 'ipv4_')\n .replace(/eth_vlan/g, 'vlan_vid')\n .replace(/tp_dst/g, 'udp_dst')\n .replace(/ipv4_proto/g, 'ip_proto');\n}", "function normal_name(d) {\n let inst_name = d.name.replace(/_/g, ' ').split('#')[0];\n if (inst_name.length > params.labels.max_label_char) {\n inst_name = inst_name.substring(0, params.labels.max_label_char) + '..';\n }\n return inst_name;\n }", "function getGenusStr(genusSpeciesStr, tP) { \n var nameAry = genusSpeciesStr.split(\" \");\n tP.genusParent = nameAry[0];\n }", "function convertNode(n, extraFields, subobjects) {\n var node = {};\n node.id = n.id;\n node.type = n.type;\n for (var d in n._def.defaults) {\n var defval = n._def.defaults[d].value;\n if (n[d] != defval) {\n node[d] = n[d];\n } else if (defval !== \"\" && defval !== undefined && defval !== null) {\n // include only if not empty\n node[d] = defval;\n }\n }\n if (extraFields) {\n extraFields.forEach(function(d) {\n if (d in n) {\n node[d] = n[d];\n }\n });\n }\n if (subobjects) {\n subobjects.forEach(function(d) {\n var o = n[d];\n node[d] = {};\n for (var dd in o) {\n node[d][dd] = o[dd];\n }\n });\n }\n node.x = n.x;\n node.y = n.y;\n node.z = n.z;\n node.wires = [];\n for(var i=0;i<n.outputs;i++) {\n node.wires.push([]);\n }\n var wires = links.filter(function(d){return d.source === n});\n for (var i in wires) {\n var w = wires[i];\n\n // TODO: loop over link properties\n var obj = {task: w.target.id};\n if (w.sourcePort in node.wires) {\n node.wires[w.sourcePort].push(obj);\n } else {\n node.wires[w.sourcePort] = [obj];\n }\n obj.sourcePort = w.sourcePort;\n obj.targetPort = w.targetPort;\n if (w.hasOwnProperty(\"protocol\")) {\n obj.protocol = w.protocol;\n }\n }\n return node;\n }", "function standardizeIndividual(a){\n if (a.type === \"individual\")\n return a.name;\n else if (a.type === undefined)\n return a;\n else\n alert(`standardizeIndividual(${a}): ${a} is of type \"${a.type}\"`);\n}", "function convertName(str, type){\n var result = false;\n let prefix = str.substring(0,1);\n var regClass = /^class/i;\n var regId = /^id/i;\n if (type == 'buffer'){\n if (str.substring(0,1) == '#') {\n result = strReplace(str, '#', 'id');\n } else if (str.substring(0,1) == '.') {\n result = strReplace(str, '.', 'class');\n } else {\n return str;\n }\n } else if (type == 'fix'){\n if (regClass.test(str)) {\n result = str.replace(regClass, '.');\n } else if (regId.test(str)) {\n result = str.replace(regId, '#');\n } else {\n return str;\n }\n }\n // console.log(result);\n return result;\n}", "function type(d) {\n d[yName] = +d[yName];\n return d;\n}", "function getDataspace(entityID){\n\tif(entityID.indexOf('http://dbpedia.org/') == 0) { // we have an entity from DBpedia\n\t\treturn 'dbpedia';\n\t}\n\telse {\n\t\tif(entityID.indexOf('http://data.europeana.eu/') == 0) { // we have an entity from Europeana\n\t\t\treturn 'europeana';\n\t\t}\n\t\telse { // ... in our own dataspace\n\t\t\treturn'dydra'; \n\t\t}\n\t}\n}", "function cfnFunctionDomainSAMPTPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnFunction_DomainSAMPTPropertyValidator(properties).assertSuccess();\n return {\n DomainName: cdk.stringToCloudFormation(properties.domainName),\n };\n}", "function cfnFunctionDomainSAMPTPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnFunction_DomainSAMPTPropertyValidator(properties).assertSuccess();\n return {\n DomainName: cdk.stringToCloudFormation(properties.domainName),\n };\n}", "function abbreviateNames(treeData) {\n common.visit(treeData, function(node) {\n // Do not use the full name if it is too long (to avoid label overlap)\n if (node.name && node.name.length > MAX_DISPLAY_LENGTH) {\n node.fullName = node.name;\n // Use of ellipsis character …, different from triple dots ...\n node.name = node.name.substring(0, MAX_DISPLAY_LENGTH) + \"…\";\n }\n }, common.allChildren);\n}", "function cleanUpDestination($d) {\n\t\tvar cleanDestination = $d;\n\t\tif(cleanDestination == \"Chestnut Hill West\") {\n\t\t\tcleanDestination = \"Chestnut H West\";\n\t\t} else if(cleanDestination == \"Chestnut Hill East\") {\n\t\t\tcleanDestination = \"Chestnut H West\";\n\t\t}\n\n\t\treturn cleanDestination; \n\t}", "function cfnCertificateAuthorityGeneralNamePropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnCertificateAuthority_GeneralNamePropertyValidator(properties).assertSuccess();\n return {\n DirectoryName: cfnCertificateAuthoritySubjectPropertyToCloudFormation(properties.directoryName),\n DnsName: cdk.stringToCloudFormation(properties.dnsName),\n EdiPartyName: cfnCertificateAuthorityEdiPartyNamePropertyToCloudFormation(properties.ediPartyName),\n IpAddress: cdk.stringToCloudFormation(properties.ipAddress),\n OtherName: cfnCertificateAuthorityOtherNamePropertyToCloudFormation(properties.otherName),\n RegisteredId: cdk.stringToCloudFormation(properties.registeredId),\n Rfc822Name: cdk.stringToCloudFormation(properties.rfc822Name),\n UniformResourceIdentifier: cdk.stringToCloudFormation(properties.uniformResourceIdentifier),\n };\n}", "function getNamespaceLabel(sNamespace)\n{\n\tvar sType;\n\t\n\tswitch (sNamespace)\n\t{\n\t\tcase \"Vega_Gene_Id\": sType = \"VEGA Gene\"; break;\n\t\tcase \"Vega_Transcript_Id\": sType = \"VEGA Transcript\"; break;\n\t\tcase \"Vega_Peptide_Id\": sType = \"VEGA Peptide\"; break;\n\t\tcase \"Ensembl_Gene_Id\": sType = \"ENSEMBL Gene\"; break;\n\t\tcase \"Ensembl_Transcript_Id\": sType = \"ENSEMBL Transcript\"; break;\n\t\tcase \"Ensembl_Peptide_Id\": sType = \"ENSEMBL Peptide\"; break;\n\t\tcase \"External_Id\": sType = \"External Id\"; break;\n\t\tcase \"UniProtKB_SwissProt\": sType = \"UniProtKB/SwissProt\"; break;\n\t\tcase \"CCDS\": sType = \"CCDS\"; break;\n\t}\n\treturn sType;\n}", "function cfnCertificateAuthorityOtherNamePropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnCertificateAuthority_OtherNamePropertyValidator(properties).assertSuccess();\n return {\n TypeId: cdk.stringToCloudFormation(properties.typeId),\n Value: cdk.stringToCloudFormation(properties.value),\n };\n}", "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "function giCast(from_, to_) {\n var desc = from_.toString();\n var clsName = null;\n for (var _i = 0, _a = desc.split(\" \"); _i < _a.length; _i++) {\n var k = _a[_i];\n if (k.substring(0, 7) == \"GIName:\") {\n clsName = k.substring(7);\n break;\n }\n }\n var toName = to_.name.replace(\"_\", \".\");\n if (toName === clsName)\n return from_;\n if (clsName) {\n var parents = inheritanceTable[clsName];\n if (parents) {\n if (parents.indexOf(toName) >= 0)\n return from_;\n }\n }\n throw Error(\"Invalid cast of \" + desc + \"(\" + clsName + \") to \" + toName);\n}", "function canonical(name) {\n return typeof (value) === 'string' ? name.toLowerCase() : name;\n}", "function tipo_vendedor(superior) {\n\tif (superior != '') {\n\t\tif (superior == 'Ninguno')\n\t\t\treturn 'Principal'\n\t\telse\n\t\t\treturn 'Subvendedor'\n\t}\n}", "function getName(destination) {\n return destination.destinationName;\n}", "function getNameOfEntity(entity){\n if(entity.label){\n return entity.label\n }else{\n return getNameOfUri(entity.uri)\n }\n }", "function uid2node(uid) { // @param String: unique id\r\n // @return Node/undefined:\r\n return _uid2node[uid];\r\n}", "function mapIdentifiableArtefact (node) {\n var result = {\n id: getAttrValue(node, 'id'),\n urn: getAttrValue(node, 'urn'),\n uri: getAttrValue(node, 'uri'),\n package: getAttrValue(node, 'package'),\n class: getAttrValue(node, 'class'),\n annotations: mapAnnotations(node)\n };\n\n if (result.package === undefined && result.urn !== undefined) {\n var fields = result.urn.split('=')[0].split('.');\n result.package = fields[3];\n result.class = fields[4];\n }\n\n return result;\n }", "function standardizeScriptType(type){\n if(type === \"null-data\"){\n return \"nulldata\";\n } else if (type === \"pay-to-pubkey-hash\") {\n return \"pubkeyhash\";\n }\n}", "function capitalizeType(product) {\n let productClone = { ...product };\n productClone.type = productClone.type.toUpperCase();\n return productClone;\n}", "function getChName(obj){\n var channelId = obj.split(\".\").slice(0,-1).join(\".\");\n return getObject(channelId).common.name;\n}" ]
[ "0.62638706", "0.5417477", "0.50152504", "0.4912157", "0.4820243", "0.48173767", "0.48173767", "0.4803079", "0.47787532", "0.47638088", "0.4730757", "0.46950424", "0.46944845", "0.46709007", "0.46613783", "0.46613783", "0.46492112", "0.4627388", "0.4623463", "0.4623463", "0.46210265", "0.4596111", "0.45879152", "0.45879152", "0.45879152", "0.45879152", "0.45879152", "0.45879152", "0.45879152", "0.45879152", "0.45879152", "0.45879152", "0.45879152", "0.45879152", "0.45879152", "0.45879152", "0.45870394", "0.45833734", "0.4581075", "0.45792294", "0.45784605", "0.45728073", "0.45552197", "0.45551234", "0.45497236", "0.45171294", "0.4501425", "0.45001447", "0.4496696", "0.4496468", "0.44870564", "0.4483035", "0.4477975", "0.44620267", "0.44619405", "0.44591087", "0.44591087", "0.4457199", "0.4454453", "0.4454225", "0.4454225", "0.4454225", "0.4454225", "0.4454225", "0.4454225", "0.4454225", "0.4454225", "0.4424207", "0.44195318", "0.44119594", "0.44012827", "0.44010383", "0.43826312", "0.43813255", "0.43764853", "0.43628418", "0.4344529", "0.4344529", "0.4320724", "0.43189058", "0.43094343", "0.43063536", "0.4300288", "0.42841694", "0.42841694", "0.42841694", "0.42841694", "0.42841694", "0.42841694", "0.42841694", "0.42746603", "0.42744267", "0.4272068", "0.42502618", "0.42471728", "0.4241115", "0.42396954", "0.42336962", "0.42305544", "0.42211223" ]
0.687117
0
Convert the list of attributes to a simple to use lookup string
updateLookupString() { this.lookupString = this.attributesToString(DistingishedName.lookupAttributeKeys); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "attributesToString(attributeKeys) {\n var result = null;\n for (var attributeKey of attributeKeys) {\n if (!this.attributes.has(attributeKey)) {\n throw new Error(Util.format(\"distinighed name missing attribute '%s'\", attributeKey));\n }\n if (result == null)\n result = \"\";\n else\n result += DistingishedName.attributeSeparator;\n result += attributeKey + DistingishedName.keyValueSeparator + this.attributes.get(attributeKey);\n }\n return result;\n }", "function make_attributes (attr) {\n\t\tvar attr_str = '';\n\t\tfor (var k in attr) {\n\t\t\tif (k && attr[k] != null) attr_str += ' '+ k +'='+ '\"'+ attr[k] +'\"';\n\t\t}\n\t\treturn attr_str;\n\t}", "function _getAsAttributeList(attrs) {\n\t\tvar s = '';\n\t\tfor (var name in attrs) {\n\t\t\ts += ' ' + name + '=\"' + attrs[name] + '\"';\n\t\t}\n\t\treturn s;\n\t}", "function treatAttributes(attributes) {\n\n\tvar attributes = attributes.split(\"*,\");\n\tvar aux = \"\";\n\tfor (var i in attributes) {\n\t\taux += attributes[i] + \"`\";\n\t}\n\n\treturn aux;\n}", "attr(prop, args) {\r\n\t\tres = args.find(v => v.lhs == prop);\r\n\r\n\t\treturn res && res.rhs.join(' ');\r\n\t}", "function attrsToStr(attrs){var parts=[];$.each(attrs,function(name,val){if(val!=null){parts.push(name+'=\"'+htmlEscape(val)+'\"');}});return parts.join(' ');}", "attrs(prefix, args) {\r\n\t\tlet res = '';\r\n\t\tconst len = prefix.length\r\n\t\targs.forEach(v => {\r\n\t\t\tif (v.lhs.startsWith(prefix)) {\r\n\t\t\t\t// remove the prefix\r\n\t\t\t\tres += ` ${v.lhs.substr(prefix.length)}`\r\n\t if (v.rhs.length > 0) res += `=\"${v.rhs.join(' ')}\"`\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\treturn res;\r\n\t}", "static _attributeNameForProperty(e,t){const n=t.attribute;return!1===n?void 0:\"string\"==typeof n?n:\"string\"==typeof e?e.toLowerCase():void 0}", "static _attributeNameForProperty(name,options){const attribute=options.attribute;return!1===attribute?void 0:\"string\"===typeof attribute?attribute:\"string\"===typeof name?name.toLowerCase():void 0}", "function attrsToStr(attrs) {\n var parts = [];\n $.each(attrs, function (name, val) {\n if (val != null) {\n parts.push(name + '=\"' + htmlEscape(val) + '\"');\n }\n });\n return parts.join(' ');\n}", "function attrsToStr(attrs) {\n var parts = [];\n $.each(attrs, function (name, val) {\n if (val != null) {\n parts.push(name + '=\"' + htmlEscape(val) + '\"');\n }\n });\n return parts.join(' ');\n}", "function attrsToStr(attrs) {\n var parts = [];\n $.each(attrs, function (name, val) {\n if (val != null) {\n parts.push(name + '=\"' + htmlEscape(val) + '\"');\n }\n });\n return parts.join(' ');\n}", "function attrsToStr(attrs) {\n var parts = [];\n $.each(attrs, function (name, val) {\n if (val != null) {\n parts.push(name + '=\"' + htmlEscape(val) + '\"');\n }\n });\n return parts.join(' ');\n}", "function attrsToStr(attrs) {\n var parts = [];\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape(val) + '\"');\n }\n }\n return parts.join(' ');\n }", "function attrsToStr(attrs) {\n var parts = [];\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape(val) + '\"');\n }\n }\n return parts.join(' ');\n }", "function attrsToStr(attrs) {\n var parts = [];\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape(val) + '\"');\n }\n }\n return parts.join(' ');\n }", "function attrsToStr(attrs) {\n var parts = [];\n\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape(val) + '\"');\n }\n }\n\n return parts.join(' ');\n }", "function attrsToStr(attrs) {\n var parts = [];\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape(val) + '\"');\n }\n }\n return parts.join(' ');\n}", "formatAttributeName(attr) {\n return attr.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase();\n }", "function attrsToStr(attrs) {\n var parts = [];\n\n for (var name in attrs) {\n var val = attrs[name];\n\n if (val != null) {\n parts.push(name + '=\"' + htmlEscape(val) + '\"');\n }\n }\n\n return parts.join(' ');\n }", "function attr(a,b){return ' '+a+'=\"'+b+'\"';}", "function attrsToStr$1(attrs) {\n var parts = [];\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape$1(val) + '\"');\n }\n }\n return parts.join(' ');\n }", "function attrsToStr(attrs) {\n\tvar parts = [];\n\n\t$.each(attrs, function(name, val) {\n\t\tif (val != null) {\n\t\t\tparts.push(name + '=\"' + htmlEscape(val) + '\"');\n\t\t}\n\t});\n\n\treturn parts.join(' ');\n}", "function attrsToStr(attrs) {\n\tvar parts = [];\n\n\t$.each(attrs, function(name, val) {\n\t\tif (val != null) {\n\t\t\tparts.push(name + '=\"' + htmlEscape(val) + '\"');\n\t\t}\n\t});\n\n\treturn parts.join(' ');\n}", "function attrsToStr(attrs) {\n\tvar parts = [];\n\n\t$.each(attrs, function(name, val) {\n\t\tif (val != null) {\n\t\t\tparts.push(name + '=\"' + htmlEscape(val) + '\"');\n\t\t}\n\t});\n\n\treturn parts.join(' ');\n}", "function attrsToStr(attrs) {\n\tvar parts = [];\n\n\t$.each(attrs, function(name, val) {\n\t\tif (val != null) {\n\t\t\tparts.push(name + '=\"' + htmlEscape(val) + '\"');\n\t\t}\n\t});\n\n\treturn parts.join(' ');\n}", "function attrsToStr(attrs) {\n\tvar parts = [];\n\n\t$.each(attrs, function(name, val) {\n\t\tif (val != null) {\n\t\t\tparts.push(name + '=\"' + htmlEscape(val) + '\"');\n\t\t}\n\t});\n\n\treturn parts.join(' ');\n}", "getAttributes() {\n return Object.keys(this.attributes).map(\n key => ' ' + key + '=\"' + escapeHTML(this.attributes[key]) + '\"'\n ).join('');\n }", "function formatAttributes(attributes) {\n\t\tvar att_value;\n\t\tvar apos_pos, quot_pos;\n\t\tvar use_quote, escape, quote_to_escape;\n\t\tvar att_str;\n\t\tvar re;\n\t\tvar result = '';\n\n\t\tfor (var att in attributes) {\n\t\t\tatt_value = attributes[att];\n\n\t\t\t// Find first quote marks if any\n\t\t\tapos_pos = att_value.indexOf(APOS);\n\t\t\tquot_pos = att_value.indexOf(QUOTE);\n\n\t\t\t// Determine which quote type to use around \n\t\t\t// the attribute value\n\t\t\tif (apos_pos == -1 && quot_pos == -1) {\n\t\t\t\tatt_str = ' ' + att + '=\"' + att_value + '\"';\n\t\t\t\tresult += att_str;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Prefer the single quote unless forced to use double\n\t\t\tif (quot_pos != -1 && quot_pos < apos_pos) {\n\t\t\t\tuse_quote = APOS;\n\t\t\t} else {\n\t\t\t\tuse_quote = QUOTE;\n\t\t\t}\n\n\t\t\t// Figure out which kind of quote to escape\n\t\t\t// Use nice dictionary instead of yucky if-else nests\n\t\t\tescape = ESCAPED_CHAR[use_quote];\n\n\t\t\t// Escape only the right kind of quote\n\t\t\tre = new RegExp(use_quote, 'g');\n\t\t\tatt_value = att_value.replace(re, escape);\n\t\t\tatt_str = ' ' + att + '=' + use_quote +\n\t\t\t\tescapeXMLValue(att_value, true) + use_quote;\n\t\t\tresult += att_str;\n\t\t}\n\t\treturn result;\n\t}", "function attrsToStr(attrs) {\n\t\tvar parts = [];\n\n\t\t$.each(attrs, function(name, val) {\n\t\t\tif (val != null) {\n\t\t\t\tparts.push(name + '=\"' + htmlEscape(val) + '\"');\n\t\t\t}\n\t\t});\n\n\t\treturn parts.join(' ');\n\t}", "static _attributeNameForProperty(name,options){const attribute=options.attribute;return attribute===false?undefined:typeof attribute==='string'?attribute:typeof name==='string'?name.toLowerCase():undefined;}", "function attrStr(k,v) {\n return angular.isDefined(v) ? ' ' + k + '=\"' + v + '\"' : '';\n }", "function htmlAttributeDisplayDetails() {}", "function toLowerCamelCase(attr) {\n if (_.isArray(attr)) return _.map(attr, toLowerCamelCase);\n\n return _.reduce(attr, function(memo, val, key) {\n key = _str.camelize(key);\n memo[key] = val;\n return memo;\n }, {});\n}", "function attrStr(k, v) {\n return isDefined(v) ? ' ' + k + '=\"' + v + '\"' : '';\n }", "function attrStr(k, v) {\n return isDefined(v) ? ' ' + k + '=\"' + v + '\"' : '';\n }", "function hc_attrname() {\n var success;\n var doc;\n var addressList;\n var testNode;\n var attributes;\n var streetAttr;\n var strong1;\n var strong2;\n doc = load(\"hc_staff\");\n addressList = doc.getElementsByTagName(\"acronym\");\n testNode = addressList.item(1);\n attributes = testNode.attributes;\n\n streetAttr = attributes.getNamedItem(\"class\");\n strong1 = streetAttr.nodeName;\n\n strong2 = streetAttr.name;\n\n assertEqualsAutoCase(\"attribute\", \"nodeName\",\"class\",strong1);\n assertEqualsAutoCase(\"attribute\", \"name\",\"class\",strong2);\n \n}", "function nameToAttributes (list) {\n return list.map(function (driver) {\n const driverFirst = driver.split(' ')[0];\n const driverLast = driver.split(' ')[1];\n return { firstName: driverFirst, lastName: driverLast };\n });\n}", "function stringifyAttributes(attrsObj) {\n var attributes = [];\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = (0, _getIterator3.default)((0, _entries2.default)(attrsObj)), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _ref = _step.value;\n\n var _ref2 = (0, _slicedToArray3.default)(_ref, 2);\n\n var key = _ref2[0];\n var value = _ref2[1];\n\n if (value === false) {\n continue;\n }\n\n if (Array.isArray(value)) {\n value = value.join(' ');\n }\n\n value = value === true ? '' : `=\"${String(value)}\"`;\n\n attributes.push(`${key}${value}`);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return attributes.length > 0 ? ' ' + attributes.join(' ') : '';\n}", "function buildFetchAttributeXml(columns) {\n\n var attributes = [];\n\n for (var i = 0, max = columns.length; i < max; i++) {\n\n attributes.push('<attribute name=\"' + columns[i] + '\" />');\n }\n\n return attributes.join('');\n}", "function optimizeAttributes(attrs) {\r\n // clone all attributes to make sure that original objects are \r\n // not modified\r\n attrs = _.map(attrs, function(attr) {\r\n return _.clone(attr);\r\n });\r\n \r\n var lookup = {};\r\n\r\n return _.filter(attrs, function(attr) {\r\n if (!(attr.name in lookup)) {\r\n return lookup[attr.name] = attr;\r\n }\r\n \r\n var la = lookup[attr.name];\r\n \r\n if (attr.name.toLowerCase() == 'class') {\r\n la.value += (la.value.length ? ' ' : '') + attr.value;\r\n } else {\r\n la.value = attr.value;\r\n }\r\n \r\n return false;\r\n });\r\n }", "function stateToAttributeString(state) {\n return String(state).replace(/([\\s_]+)/g, \"-\").toLowerCase();\n}", "get attributeString() {\n console.log(JSON.stringify(self.attributes))\n return JSON.stringify(self.attributes)\n }", "function attributesToPhrase(drivers) {\n return drivers.map(function(driver) {\n return `${driver.name} is from ${driver.hometown}`\n });\n}", "function URLDecompositionAttributes() {}", "function makeAttributes(attrs) {\n\t\tvar attributes = '{';\n\t\tvar attr = void 0;\n\n\t\twhile (attr = attrRegExp.exec(attrs)) {\n\t\t\tif (attributes !== '{') attributes += ', ';\n\t\t\tattributes += '\"' + attr[1].toLowerCase() + '\": ' + handleText(attr[2] || attr[3] || '', true).replace(/\\s*[,+]\\s*$/g, '');\n\t\t}\n\t\treturn attributes + '}';\n\t}", "function toAttribute(attribute, value) {\n if (value == null)\n return \"\";\n else if (typeof value !== \"string\")\n value = JSON.stringify(value);\n return \" \" + attribute + \"='\" + value + \"'\";\n}", "function attributesToPhrase(drivers) {\n return drivers.map(function (driver) {\n return `${driver.name} is from ${driver.hometown}`;\n });\n}", "function exactMatchToList(list, attribute){\n return exactMatch(list, attribute).map( (ele) => { return ele['name']})\n}", "function getAttr( attributes ) {\n const obj = {};\n\n Array.from( attributes ).map( attribute => {\n obj[attribute.name] = attribute.value;\n } );\n\n return obj;\n }", "function attr(a, b) {\n return ' ' + a + '=\"' + b + '\"';\n }", "static __attributeNameForProperty(name2, options) {\n const attribute = options.attribute;\n return attribute === false ? void 0 : typeof attribute === \"string\" ? attribute : typeof name2 === \"string\" ? name2.toLowerCase() : void 0;\n }", "getCustomAttributes( data ){\n // only items which are objects have properties which can be used as attributes\n if( !isObject(data) )\n return '';\n\n var output = {}, propName;\n\n for( propName in data ){\n if( propName.slice(0,2) != '__' && propName != 'class' && data.hasOwnProperty(propName) && data[propName] !== undefined )\n output[propName] = escapeHTML(data[propName])\n }\n return output\n }", "function joinObj(a, attr) {\n var out = [];\n\n for (var i = 0; i < a.length; i++) {\n out.push(a[i][attr]);\n }\n\n return out.join(\", \");\n}", "static _attributeNameForProperty(name, options) {\n const attribute = options.attribute;\n return attribute === false\n ? undefined\n : (typeof attribute === 'string'\n ? attribute\n : (typeof name === 'string' ? name.toLowerCase()\n : undefined));\n }", "function mergeAriaAttributeValues() {\n var ariaAttributes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n ariaAttributes[_i] = arguments[_i];\n }\n var mergedAttribute = ariaAttributes\n .filter(function (arg) { return arg; })\n .join(' ')\n .trim();\n return mergedAttribute === '' ? undefined : mergedAttribute;\n}", "function mergeAriaAttributeValues() {\n var ariaAttributes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n ariaAttributes[_i] = arguments[_i];\n }\n var mergedAttribute = ariaAttributes\n .filter(function (arg) { return arg; })\n .join(' ')\n .trim();\n return mergedAttribute === '' ? undefined : mergedAttribute;\n}", "function mergeAriaAttributeValues() {\n var ariaAttributes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n ariaAttributes[_i] = arguments[_i];\n }\n var mergedAttribute = ariaAttributes\n .filter(function (arg) { return arg; })\n .join(' ')\n .trim();\n return mergedAttribute === '' ? undefined : mergedAttribute;\n}", "function mergeAriaAttributeValues() {\n var ariaAttributes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n ariaAttributes[_i] = arguments[_i];\n }\n var mergedAttribute = ariaAttributes\n .filter(function (arg) { return arg !== undefined && arg !== null; })\n .join('');\n return mergedAttribute === '' ? undefined : mergedAttribute;\n}", "static _attributeNameForProperty(name, options) {\n const attribute = options.attribute;\n return attribute === false ?\n undefined :\n (typeof attribute === 'string' ?\n attribute :\n (typeof name === 'string' ? name.toLowerCase() : undefined));\n }", "static _attributeNameForProperty(name, options) {\n const attribute = options.attribute;\n return attribute === false ?\n undefined :\n (typeof attribute === 'string' ?\n attribute :\n (typeof name === 'string' ? name.toLowerCase() : undefined));\n }", "static _attributeNameForProperty(name, options) {\n const attribute = options.attribute;\n return attribute === false ?\n undefined :\n (typeof attribute === 'string' ?\n attribute :\n (typeof name === 'string' ? name.toLowerCase() : undefined));\n }", "uri() {\n return [\n (this.endpoint() || ''),\n (this.exists() ? this.id() : null)\n ]\n .filter(value => !!value)\n .concat([].slice.call(arguments))\n .map(part => { \n Object.entries(this.attributes)\n .forEach(([key, value]) => {\n part = part.toString().replace(new RegExp(`\\:${key}`), value);\n });\n\n return part;\n })\n .join('/');\n }", "function normalizeAndCompletePropertyDescriptor(attributes) {\n if (attributes === undefined) { return undefined; }\n var desc = toCompletePropertyDescriptor(attributes);\n // Note: no need to call FromPropertyDescriptor(desc), as we represent\n // \"internal\" property descriptors as proper Objects from the start\n for (var name in attributes) {\n if (!isStandardAttribute(name)) {\n Object.defineProperty(desc, name,\n { value: attributes[name],\n writable: true,\n enumerable: true,\n configurable: true });\n }\n }\n return desc;\n}", "function normalizeAndCompletePropertyDescriptor(attributes) {\n if (attributes === undefined) { return undefined; }\n var desc = toCompletePropertyDescriptor(attributes);\n // Note: no need to call FromPropertyDescriptor(desc), as we represent\n // \"internal\" property descriptors as proper Objects from the start\n for (var name in attributes) {\n if (!isStandardAttribute(name)) {\n Object.defineProperty(desc, name,\n { value: attributes[name],\n writable: true,\n enumerable: true,\n configurable: true });\n }\n }\n return desc;\n}", "function findAttribute(attrs, propName) {\n var index = Object.keys(attrs).filter(function (attr) {\n return attr.toLowerCase() === propName.toLowerCase();\n })[0];\n return attrs[index];\n }", "function getAbils(abils) {\n let abilities = [];\n abils.forEach(el => abilities.push(el.ability.name));\n return abilities.join(', ');\n}", "function encodeAttr(str) {\n\treturn (str+'').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}", "function Attrs(p) {\n this.toString = function() {\n var res = '';\n for (var p in this.params) {\n res += ' '+p+'=\"'+this.params[p]+'\"';\n }\n return res;\n }\n\n this.set = function(what, val) {\n this.params[what] = val;\n };\n\n this.get = function(what) {\n return this.params[what];\n };\n\n this.params = new Array();\n if (p) {\n _sg(/^\\s*([A-Za-z0-9_]+)=(\\\".*\\\"|\\'.*\\'|[^\\'\\\"]\\S*)/,\n p, function(match) {\n var name = match[1];\n var val = match[2];\n val.replace(/([\\'\\\"])(.*)\\1/g, \"$1\");\n this.params[name] = val;\n return \"\";\n });\n }\n}", "keyForAttribute(key) { return key; }", "handleAttributeExpressions(element, name, strings) {\n const prefix = name[0];\n if (prefix === '.') {\n const comitter = new _parts.PropertyCommitter(element, name.slice(1), strings);\n return comitter.parts;\n }\n if (prefix === '@') {\n return [new _parts.EventPart(element, name.slice(1))];\n }\n if (prefix === '?') {\n return [new _parts.BooleanAttributePart(element, name.slice(1), strings)];\n }\n const comitter = new _parts.AttributeCommitter(element, name, strings);\n return comitter.parts;\n }", "function uuattrget(node, // @param Node:\r\n attrs) { // @param String: \"attr1,...\"\r\n // @return String/Hash: \"value\" (one attr)\r\n // or { attr1: \"value\", ... }\r\n var rv = {}, ary = attrs.split(\",\"), v, w, i = 0, iz = ary.length,\r\n HASH = uuattr._HASH; // [IE67] for -> htmlFor, className -> class\r\n // [OTHER] for -> htmlFor, class -> className\r\n\r\n for (; i < iz; ++i) {\r\n v = ary[i];\r\n w = HASH[v] || v;\r\n if (uu.ie) {\r\n if (uu.ver.ie89 || v === \"href\" || v === \"src\") {\r\n // [IE6][IE7][FIX] a[href^=\"#\"] -> full path\r\n rv[v] = node.getAttribute(v, 2) || \"\";\r\n } else {\r\n rv[v] = node[w] || \"\";\r\n }\r\n } else {\r\n rv[v] = node.getAttribute(w) || \"\";\r\n }\r\n }\r\n return (ary.length === 1) ? rv[ary[0]] : rv; // [3][4]\r\n}", "_visitAttributesOf(el) {\n const explicitAttrNameToValue = {};\n const implicitAttrNames = this._implicitAttrs[el.name] || [];\n el.attrs.filter(attr => attr.name.startsWith(_I18N_ATTR_PREFIX))\n .forEach(attr => explicitAttrNameToValue[attr.name.slice(_I18N_ATTR_PREFIX.length)] =\n attr.value);\n el.attrs.forEach(attr => {\n if (attr.name in explicitAttrNameToValue) {\n this._addMessage([attr], explicitAttrNameToValue[attr.name]);\n }\n else if (implicitAttrNames.some(name => attr.name === name)) {\n this._addMessage([attr]);\n }\n });\n }", "_visitAttributesOf(el) {\n const explicitAttrNameToValue = {};\n const implicitAttrNames = this._implicitAttrs[el.name] || [];\n el.attrs.filter(attr => attr.name.startsWith(_I18N_ATTR_PREFIX))\n .forEach(attr => explicitAttrNameToValue[attr.name.slice(_I18N_ATTR_PREFIX.length)] =\n attr.value);\n el.attrs.forEach(attr => {\n if (attr.name in explicitAttrNameToValue) {\n this._addMessage([attr], explicitAttrNameToValue[attr.name]);\n }\n else if (implicitAttrNames.some(name => attr.name === name)) {\n this._addMessage([attr]);\n }\n });\n }", "_visitAttributesOf(el) {\n const explicitAttrNameToValue = {};\n const implicitAttrNames = this._implicitAttrs[el.name] || [];\n el.attrs.filter(attr => attr.name.startsWith(_I18N_ATTR_PREFIX))\n .forEach(attr => explicitAttrNameToValue[attr.name.slice(_I18N_ATTR_PREFIX.length)] =\n attr.value);\n el.attrs.forEach(attr => {\n if (attr.name in explicitAttrNameToValue) {\n this._addMessage([attr], explicitAttrNameToValue[attr.name]);\n }\n else if (implicitAttrNames.some(name => attr.name === name)) {\n this._addMessage([attr]);\n }\n });\n }", "_visitAttributesOf(el) {\n const explicitAttrNameToValue = {};\n const implicitAttrNames = this._implicitAttrs[el.name] || [];\n el.attrs.filter(attr => attr.name.startsWith(_I18N_ATTR_PREFIX))\n .forEach(attr => explicitAttrNameToValue[attr.name.slice(_I18N_ATTR_PREFIX.length)] =\n attr.value);\n el.attrs.forEach(attr => {\n if (attr.name in explicitAttrNameToValue) {\n this._addMessage([attr], explicitAttrNameToValue[attr.name]);\n }\n else if (implicitAttrNames.some(name => attr.name === name)) {\n this._addMessage([attr]);\n }\n });\n }", "function normalizeAttributeKey(key) {\n const hyphenIndex = key.indexOf('-');\n\n if (hyphenIndex !== -1 && key.match(HTML_CUSTOM_ATTR_R) === null) {\n key = key.replace(CAPTURE_LETTER_AFTER_HYPHEN, function(_, letter) {\n return letter.toUpperCase();\n });\n }\n\n return key;\n}", "function gA(item, att) { return item.getAttribute('data-'+att+''); }", "function gA(item, att) { return item.getAttribute('data-'+att+''); }", "function _getAttributesAsJson(attrs) {\n var rval = {};\n for(var i = 0; i < attrs.length; ++i) {\n var attr = attrs[i];\n if(attr.shortName && (\n attr.valueTagClass === asn1.Type.UTF8 ||\n attr.valueTagClass === asn1.Type.PRINTABLESTRING ||\n attr.valueTagClass === asn1.Type.IA5STRING)) {\n var value = attr.value;\n if(attr.valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(attr.value);\n }\n if(!(attr.shortName in rval)) {\n rval[attr.shortName] = value;\n } else if(forge.util.isArray(rval[attr.shortName])) {\n rval[attr.shortName].push(value);\n } else {\n rval[attr.shortName] = [rval[attr.shortName], value];\n }\n }\n }\n return rval;\n}", "function _getAttributesAsJson(attrs) {\n var rval = {};\n for(var i = 0; i < attrs.length; ++i) {\n var attr = attrs[i];\n if(attr.shortName && (\n attr.valueTagClass === asn1.Type.UTF8 ||\n attr.valueTagClass === asn1.Type.PRINTABLESTRING ||\n attr.valueTagClass === asn1.Type.IA5STRING)) {\n var value = attr.value;\n if(attr.valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(attr.value);\n }\n if(!(attr.shortName in rval)) {\n rval[attr.shortName] = value;\n } else if(forge.util.isArray(rval[attr.shortName])) {\n rval[attr.shortName].push(value);\n } else {\n rval[attr.shortName] = [rval[attr.shortName], value];\n }\n }\n }\n return rval;\n}", "function _getAttributesAsJson(attrs) {\n var rval = {};\n for(var i = 0; i < attrs.length; ++i) {\n var attr = attrs[i];\n if(attr.shortName && (\n attr.valueTagClass === asn1.Type.UTF8 ||\n attr.valueTagClass === asn1.Type.PRINTABLESTRING ||\n attr.valueTagClass === asn1.Type.IA5STRING)) {\n var value = attr.value;\n if(attr.valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(attr.value);\n }\n if(!(attr.shortName in rval)) {\n rval[attr.shortName] = value;\n } else if(forge.util.isArray(rval[attr.shortName])) {\n rval[attr.shortName].push(value);\n } else {\n rval[attr.shortName] = [rval[attr.shortName], value];\n }\n }\n }\n return rval;\n}", "function _getAttributesAsJson(attrs) {\n var rval = {};\n for(var i = 0; i < attrs.length; ++i) {\n var attr = attrs[i];\n if(attr.shortName && (\n attr.valueTagClass === asn1.Type.UTF8 ||\n attr.valueTagClass === asn1.Type.PRINTABLESTRING ||\n attr.valueTagClass === asn1.Type.IA5STRING)) {\n var value = attr.value;\n if(attr.valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(attr.value);\n }\n if(!(attr.shortName in rval)) {\n rval[attr.shortName] = value;\n } else if(forge.util.isArray(rval[attr.shortName])) {\n rval[attr.shortName].push(value);\n } else {\n rval[attr.shortName] = [rval[attr.shortName], value];\n }\n }\n }\n return rval;\n}", "function _getAttributesAsJson(attrs) {\n var rval = {};\n for(var i = 0; i < attrs.length; ++i) {\n var attr = attrs[i];\n if(attr.shortName && (\n attr.valueTagClass === asn1.Type.UTF8 ||\n attr.valueTagClass === asn1.Type.PRINTABLESTRING ||\n attr.valueTagClass === asn1.Type.IA5STRING)) {\n var value = attr.value;\n if(attr.valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(attr.value);\n }\n if(!(attr.shortName in rval)) {\n rval[attr.shortName] = value;\n } else if(forge.util.isArray(rval[attr.shortName])) {\n rval[attr.shortName].push(value);\n } else {\n rval[attr.shortName] = [rval[attr.shortName], value];\n }\n }\n }\n return rval;\n}", "function _getAttributesAsJson(attrs) {\n var rval = {};\n for(var i = 0; i < attrs.length; ++i) {\n var attr = attrs[i];\n if(attr.shortName && (\n attr.valueTagClass === asn1.Type.UTF8 ||\n attr.valueTagClass === asn1.Type.PRINTABLESTRING ||\n attr.valueTagClass === asn1.Type.IA5STRING)) {\n var value = attr.value;\n if(attr.valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(attr.value);\n }\n if(!(attr.shortName in rval)) {\n rval[attr.shortName] = value;\n } else if(forge.util.isArray(rval[attr.shortName])) {\n rval[attr.shortName].push(value);\n } else {\n rval[attr.shortName] = [rval[attr.shortName], value];\n }\n }\n }\n return rval;\n}", "function _getAttributesAsJson(attrs) {\n var rval = {};\n for(var i = 0; i < attrs.length; ++i) {\n var attr = attrs[i];\n if(attr.shortName && (\n attr.valueTagClass === asn1.Type.UTF8 ||\n attr.valueTagClass === asn1.Type.PRINTABLESTRING ||\n attr.valueTagClass === asn1.Type.IA5STRING)) {\n var value = attr.value;\n if(attr.valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(attr.value);\n }\n if(!(attr.shortName in rval)) {\n rval[attr.shortName] = value;\n } else if(forge.util.isArray(rval[attr.shortName])) {\n rval[attr.shortName].push(value);\n } else {\n rval[attr.shortName] = [rval[attr.shortName], value];\n }\n }\n }\n return rval;\n}", "function data2Attribs(data)\t{\n\t\t\t\t\t\t\tvar attribs = \" \";\n\t\t\t\t\t\t\tfor(index in data)\t{\n\t\t\t\t\t\t\t\tattribs += index+\"='\"+data[index]+\"' \";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn attribs;\n\t\t\t\t\t\t\t}", "function _attr ( elem, types, method ) {\n\t\t\n\t\t// get attribute\n\t\t// string\n\t\tif ( 'string' === typeof types ) {\n\t\t\t\n\t\t\treturn elem[method]( C.DIFF[types] || types );\n\t\t\n\t\t// del or set attribute\n\t\t// object\n\t\t} else {\n\n\t\t\teach( types, function ( k, v ) {\n\n\t\t\t\telem[method]( C.DIFF[k] || k, v );\n\n\t\t\t});\n\t\t\t\n\t\t}\n\t}", "function addAttr(str, attr, charID) {\n for (var j = 0; j < str.length; j++) {\n var testString = removeLinks(str[j]);\n\n if (testString.indexOf(attr) != -1) {\n var splitStr = testString.split(\",\");\n for (var i = 0; i < splitStr.length; i++) {\n if (splitStr[i].indexOf(attr) != -1) {\n \n var valStr = splitStr[i];\n \n valStr = valStr.replace(attr, \"\"); \n valStr = valStr.replace(\"+\", \"\");\n valStr = valStr.trim();\n var valStrArray = valStr.split(\" \");\n valStr = valStrArray[0];\n\n createObj(\"attribute\", {\n name: attr,\n current: valStr,\n max: valStr,\n characterid: charID\n });\n return;\n }\n \n }\n }\n }\n}", "function escapeAttr(value) {\n if (typeof value !== 'string') {\n return value;\n }\n\t\t\n\t\t// If not string then convert double quotes \n return value.replace(/\"/g, '&quot;');\n }", "function addRawAttr(list, key, value) {\n\t list[key] = value;\n\t }", "handleAttributeExpressions(element, name, strings, options) {\n const prefix = name[0];\n if (prefix === '.') {\n const comitter = new PropertyCommitter(element, name.slice(1), strings);\n return comitter.parts;\n }\n if (prefix === '@') {\n return [new EventPart(element, name.slice(1), options.eventContext)];\n }\n if (prefix === '?') {\n return [new BooleanAttributePart(element, name.slice(1), strings)];\n }\n const comitter = new AttributeCommitter(element, name, strings);\n return comitter.parts;\n }", "function s(a){return a.type=(null!==a.getAttribute(\"type\"))+\"/\"+a.type,a}", "findAttribute(name, attributes) {\r\n return attributes[name] || 0\r\n }", "function kwtoattr(html_attrs, merge){\n var k,v;\n var rv = '';\n if (merge) {\n for (k in merge) {\n if (merge.hasOwnProperty(k)) {\n v = merge[k];\n if(html_attrs.hasOwnProperty(k)){\n v = html_attrs[k] + ' ' + v\n }\n html_attrs[k] = v\n }\n }\n }\n\n var booleanAttributes = \" hidden novalidate formnovalidate readonly required multiple autofocus disabled selected\";\n\n for (k in html_attrs){\n if(!html_attrs.hasOwnProperty(k) || typeof html_attrs[k] !== 'string')\n continue;\n\n if (booleanAttributes.indexOf(\" \" + k + \" \") > -1) {\n if (html_attrs[k]==k || html_attrs[k]==\"\") //otherwise omit\n rv += k + \" \";\n } else {\n rv += k + '= \"' + html_attrs[k].replace(/&/g,'&amp;').replace(/\"/g,'&quot;') + '\" ';\n }\n }\n return rv;\n }", "function getPropNameFromAttrName(attrName) {\n if (isUndefined(AttrNameToPropNameMap[attrName])) {\n AttrNameToPropNameMap[attrName] = StringReplace$1.call(attrName, CAMEL_REGEX, g => g[1].toUpperCase());\n }\n\n return AttrNameToPropNameMap[attrName];\n }", "handleAttributeExpressions(element, name, strings, options) {\n const prefix = name[0];\n\n if (prefix === '.') {\n const committer = new _parts.PropertyCommitter(element, name.slice(1), strings);\n return committer.parts;\n }\n\n if (prefix === '@') {\n return [new _parts.EventPart(element, name.slice(1), options.eventContext)];\n }\n\n if (prefix === '?') {\n return [new _parts.BooleanAttributePart(element, name.slice(1), strings)];\n }\n\n const committer = new _parts.AttributeCommitter(element, name, strings);\n return committer.parts;\n }", "function getAttributeNameLiterals(name) {\n var _splitNsName5 = splitNsName(name),\n _splitNsName6 = Object(C_Users_Abid_Loqmen_Desktop_NGforce_thesis_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(_splitNsName5, 2),\n attributeNamespace = _splitNsName6[0],\n attributeName = _splitNsName6[1];\n\n var nameLiteral = literal(attributeName);\n\n if (attributeNamespace) {\n return [literal(0\n /* NamespaceURI */\n ), literal(attributeNamespace), nameLiteral];\n }\n\n return [nameLiteral];\n}", "function forEachAttributes($source, callback, prefix = '') {\n [].forEach.call($source, function (source) {\n $.each(source.attributes, function () {\n if (!prefix || this.name.startsWith(prefix)) {\n callback(this.name.replace(prefix, ''), this.value);\n }\n });\n });\n}", "function forEachAttributes($source, callback, prefix = '') {\n [].forEach.call($source, function (source) {\n $.each(source.attributes, function () {\n if (!prefix || this.name.startsWith(prefix)) {\n callback(this.name.replace(prefix, ''), this.value);\n }\n });\n });\n}" ]
[ "0.6247813", "0.6208343", "0.60990256", "0.6040961", "0.5885408", "0.57853425", "0.5724533", "0.56705606", "0.5641991", "0.55810255", "0.55810255", "0.55810255", "0.55810255", "0.55787355", "0.55787355", "0.55787355", "0.5563431", "0.5554823", "0.55394626", "0.55169815", "0.55139875", "0.54763407", "0.5466693", "0.5466693", "0.5466693", "0.5466693", "0.5466693", "0.5459306", "0.5458817", "0.5439287", "0.54384476", "0.54053843", "0.53914255", "0.5369514", "0.5347626", "0.5347626", "0.53404367", "0.5320495", "0.53140247", "0.5309301", "0.53090703", "0.53057146", "0.5297934", "0.5293001", "0.52861667", "0.52796394", "0.5264371", "0.5250021", "0.5234738", "0.52131814", "0.51517844", "0.51330143", "0.51175576", "0.507623", "0.5052806", "0.50403976", "0.50403976", "0.50403976", "0.50389165", "0.5009602", "0.5009602", "0.5009602", "0.49852097", "0.49728093", "0.49728093", "0.4965887", "0.4934794", "0.4922693", "0.49189276", "0.49111947", "0.4908349", "0.48819545", "0.48763582", "0.48763582", "0.48763582", "0.48763582", "0.48653197", "0.48640808", "0.48640808", "0.48554215", "0.48554215", "0.48554215", "0.48554215", "0.48554215", "0.48554215", "0.48554215", "0.48531333", "0.48514715", "0.48481068", "0.48369747", "0.4822821", "0.4822244", "0.48170564", "0.4815697", "0.48087478", "0.4798821", "0.47859088", "0.47806728", "0.47735766", "0.47735766" ]
0.64476913
0
Convert the list of attributes to a simple to use identity string
updateIdentityString() { this.identityString = this.attributesToString(DistingishedName.identityAttributeKeys); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function make_attributes (attr) {\n\t\tvar attr_str = '';\n\t\tfor (var k in attr) {\n\t\t\tif (k && attr[k] != null) attr_str += ' '+ k +'='+ '\"'+ attr[k] +'\"';\n\t\t}\n\t\treturn attr_str;\n\t}", "function _getAsAttributeList(attrs) {\n\t\tvar s = '';\n\t\tfor (var name in attrs) {\n\t\t\ts += ' ' + name + '=\"' + attrs[name] + '\"';\n\t\t}\n\t\treturn s;\n\t}", "function treatAttributes(attributes) {\n\n\tvar attributes = attributes.split(\"*,\");\n\tvar aux = \"\";\n\tfor (var i in attributes) {\n\t\taux += attributes[i] + \"`\";\n\t}\n\n\treturn aux;\n}", "attributesToString(attributeKeys) {\n var result = null;\n for (var attributeKey of attributeKeys) {\n if (!this.attributes.has(attributeKey)) {\n throw new Error(Util.format(\"distinighed name missing attribute '%s'\", attributeKey));\n }\n if (result == null)\n result = \"\";\n else\n result += DistingishedName.attributeSeparator;\n result += attributeKey + DistingishedName.keyValueSeparator + this.attributes.get(attributeKey);\n }\n return result;\n }", "get attributeString() {\n console.log(JSON.stringify(self.attributes))\n return JSON.stringify(self.attributes)\n }", "function stringifyAttributes(attrsObj) {\n var attributes = [];\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = (0, _getIterator3.default)((0, _entries2.default)(attrsObj)), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _ref = _step.value;\n\n var _ref2 = (0, _slicedToArray3.default)(_ref, 2);\n\n var key = _ref2[0];\n var value = _ref2[1];\n\n if (value === false) {\n continue;\n }\n\n if (Array.isArray(value)) {\n value = value.join(' ');\n }\n\n value = value === true ? '' : `=\"${String(value)}\"`;\n\n attributes.push(`${key}${value}`);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return attributes.length > 0 ? ' ' + attributes.join(' ') : '';\n}", "function attrsToStr(attrs){var parts=[];$.each(attrs,function(name,val){if(val!=null){parts.push(name+'=\"'+htmlEscape(val)+'\"');}});return parts.join(' ');}", "getAttributes() {\n return Object.keys(this.attributes).map(\n key => ' ' + key + '=\"' + escapeHTML(this.attributes[key]) + '\"'\n ).join('');\n }", "function makeAttributes(attrs) {\n\t\tvar attributes = '{';\n\t\tvar attr = void 0;\n\n\t\twhile (attr = attrRegExp.exec(attrs)) {\n\t\t\tif (attributes !== '{') attributes += ', ';\n\t\t\tattributes += '\"' + attr[1].toLowerCase() + '\": ' + handleText(attr[2] || attr[3] || '', true).replace(/\\s*[,+]\\s*$/g, '');\n\t\t}\n\t\treturn attributes + '}';\n\t}", "function attrsToStr(attrs) {\n var parts = [];\n $.each(attrs, function (name, val) {\n if (val != null) {\n parts.push(name + '=\"' + htmlEscape(val) + '\"');\n }\n });\n return parts.join(' ');\n}", "function attrsToStr(attrs) {\n var parts = [];\n $.each(attrs, function (name, val) {\n if (val != null) {\n parts.push(name + '=\"' + htmlEscape(val) + '\"');\n }\n });\n return parts.join(' ');\n}", "function attrsToStr(attrs) {\n var parts = [];\n $.each(attrs, function (name, val) {\n if (val != null) {\n parts.push(name + '=\"' + htmlEscape(val) + '\"');\n }\n });\n return parts.join(' ');\n}", "function attrsToStr(attrs) {\n var parts = [];\n $.each(attrs, function (name, val) {\n if (val != null) {\n parts.push(name + '=\"' + htmlEscape(val) + '\"');\n }\n });\n return parts.join(' ');\n}", "function attrsToStr(attrs) {\n var parts = [];\n\n for (var name in attrs) {\n var val = attrs[name];\n\n if (val != null) {\n parts.push(name + '=\"' + htmlEscape(val) + '\"');\n }\n }\n\n return parts.join(' ');\n }", "function nameToAttributes (list) {\n return list.map(function (driver) {\n const driverFirst = driver.split(' ')[0];\n const driverLast = driver.split(' ')[1];\n return { firstName: driverFirst, lastName: driverLast };\n });\n}", "function attrsToStr(attrs) {\n var parts = [];\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape(val) + '\"');\n }\n }\n return parts.join(' ');\n }", "function attrsToStr(attrs) {\n var parts = [];\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape(val) + '\"');\n }\n }\n return parts.join(' ');\n }", "function attrsToStr(attrs) {\n var parts = [];\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape(val) + '\"');\n }\n }\n return parts.join(' ');\n }", "function attrsToStr(attrs) {\n var parts = [];\n\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape(val) + '\"');\n }\n }\n\n return parts.join(' ');\n }", "function toAttribute(attribute, value) {\n if (value == null)\n return \"\";\n else if (typeof value !== \"string\")\n value = JSON.stringify(value);\n return \" \" + attribute + \"='\" + value + \"'\";\n}", "function attrsToStr(attrs) {\n var parts = [];\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape(val) + '\"');\n }\n }\n return parts.join(' ');\n}", "static get attributes() {\n return {\n id: 'id',\n firstname: 'firstname',\n lastname: 'lastname',\n othernames: 'othernames',\n phoneNumber: 'phone_number',\n email: 'email',\n username: 'username',\n password: 'password',\n registered: 'created_at',\n isAdmin: 'is_admin',\n gender: 'gender',\n avatar: 'avatar',\n bio: 'bio',\n };\n }", "function attrsToStr$1(attrs) {\n var parts = [];\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape$1(val) + '\"');\n }\n }\n return parts.join(' ');\n }", "function attrsToStr(attrs) {\n\tvar parts = [];\n\n\t$.each(attrs, function(name, val) {\n\t\tif (val != null) {\n\t\t\tparts.push(name + '=\"' + htmlEscape(val) + '\"');\n\t\t}\n\t});\n\n\treturn parts.join(' ');\n}", "function attrsToStr(attrs) {\n\tvar parts = [];\n\n\t$.each(attrs, function(name, val) {\n\t\tif (val != null) {\n\t\t\tparts.push(name + '=\"' + htmlEscape(val) + '\"');\n\t\t}\n\t});\n\n\treturn parts.join(' ');\n}", "function attrsToStr(attrs) {\n\tvar parts = [];\n\n\t$.each(attrs, function(name, val) {\n\t\tif (val != null) {\n\t\t\tparts.push(name + '=\"' + htmlEscape(val) + '\"');\n\t\t}\n\t});\n\n\treturn parts.join(' ');\n}", "function attrsToStr(attrs) {\n\tvar parts = [];\n\n\t$.each(attrs, function(name, val) {\n\t\tif (val != null) {\n\t\t\tparts.push(name + '=\"' + htmlEscape(val) + '\"');\n\t\t}\n\t});\n\n\treturn parts.join(' ');\n}", "function attrsToStr(attrs) {\n\tvar parts = [];\n\n\t$.each(attrs, function(name, val) {\n\t\tif (val != null) {\n\t\t\tparts.push(name + '=\"' + htmlEscape(val) + '\"');\n\t\t}\n\t});\n\n\treturn parts.join(' ');\n}", "function buildFetchAttributeXml(columns) {\n\n var attributes = [];\n\n for (var i = 0, max = columns.length; i < max; i++) {\n\n attributes.push('<attribute name=\"' + columns[i] + '\" />');\n }\n\n return attributes.join('');\n}", "function attrsToStr(attrs) {\n\t\tvar parts = [];\n\n\t\t$.each(attrs, function(name, val) {\n\t\t\tif (val != null) {\n\t\t\t\tparts.push(name + '=\"' + htmlEscape(val) + '\"');\n\t\t\t}\n\t\t});\n\n\t\treturn parts.join(' ');\n\t}", "function attributeEncode(value) {\n return typeof value === \"string\" ? value : JSON.stringify(value) ;\n }", "function formatAttributes(attributes) {\n\t\tvar att_value;\n\t\tvar apos_pos, quot_pos;\n\t\tvar use_quote, escape, quote_to_escape;\n\t\tvar att_str;\n\t\tvar re;\n\t\tvar result = '';\n\n\t\tfor (var att in attributes) {\n\t\t\tatt_value = attributes[att];\n\n\t\t\t// Find first quote marks if any\n\t\t\tapos_pos = att_value.indexOf(APOS);\n\t\t\tquot_pos = att_value.indexOf(QUOTE);\n\n\t\t\t// Determine which quote type to use around \n\t\t\t// the attribute value\n\t\t\tif (apos_pos == -1 && quot_pos == -1) {\n\t\t\t\tatt_str = ' ' + att + '=\"' + att_value + '\"';\n\t\t\t\tresult += att_str;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Prefer the single quote unless forced to use double\n\t\t\tif (quot_pos != -1 && quot_pos < apos_pos) {\n\t\t\t\tuse_quote = APOS;\n\t\t\t} else {\n\t\t\t\tuse_quote = QUOTE;\n\t\t\t}\n\n\t\t\t// Figure out which kind of quote to escape\n\t\t\t// Use nice dictionary instead of yucky if-else nests\n\t\t\tescape = ESCAPED_CHAR[use_quote];\n\n\t\t\t// Escape only the right kind of quote\n\t\t\tre = new RegExp(use_quote, 'g');\n\t\t\tatt_value = att_value.replace(re, escape);\n\t\t\tatt_str = ' ' + att + '=' + use_quote +\n\t\t\t\tescapeXMLValue(att_value, true) + use_quote;\n\t\t\tresult += att_str;\n\t\t}\n\t\treturn result;\n\t}", "function createUserAttributeList(attributes) {\n\tvar attributeList = [];\n\tfor(let i = attributes.length-1; i >= 0; i--) {\n\t\tattributeList.push(new AmazonCognitoIdentity.CognitoUserAttribute(attributes[i]));\n\t}\n\treturn attributeList;\n}", "function getAttr( attributes ) {\n const obj = {};\n\n Array.from( attributes ).map( attribute => {\n obj[attribute.name] = attribute.value;\n } );\n\n return obj;\n }", "function stringifyAttributeValue( data ) {\n\tif ( isPlainObject( data ) ) {\n\t\treturn JSON.stringify( data );\n\t}\n\n\treturn data;\n}", "function htmlAttributeDisplayDetails() {}", "toString(){\n return `${this.name} [${this.identity}]`;\n }", "function data2Attribs(data)\t{\n\t\t\t\t\t\t\tvar attribs = \" \";\n\t\t\t\t\t\t\tfor(index in data)\t{\n\t\t\t\t\t\t\t\tattribs += index+\"='\"+data[index]+\"' \";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn attribs;\n\t\t\t\t\t\t\t}", "function AttributeList({attributes}) {\n return (\n <div className={prefixNS('attribute-list')}>\n {attributes.map((attribute, i) => (\n <span className={prefixNS('attribute')} key={`attr-${i}`}>\n {attribute.label ? (\n <span className={prefixNS('attribute-label')}>\n {attribute.label}\n </span>\n ) : null}\n <TextAttribute attribute={attribute} className={prefixNS('textattribute')} />\n </span>\n ))}\n </div>\n );\n}", "function stateToAttributeString(state) {\n return String(state).replace(/([\\s_]+)/g, \"-\").toLowerCase();\n}", "function escape_attr(m)\n{\n if (!m)\n return m;\n\n var n = \"\";\n for (var i = 0; i < m.length; i++) {\n var c = m[i];\n // This assumes that all attributes are wrapped in '', never \"\".\n if (c === \"'\") { n += \"&#039;\"; continue; }\n n += c;\n }\n \n return n;\n}", "function attr(a,b){return ' '+a+'=\"'+b+'\"';}", "generateUniqueAttribute(options) {\n var _options = extend({\n params: {},\n callback: function(err, uniqueAttr) {\n }\n }, options);\n\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n\n const uniqueAttr = s4() + s4() + '-' + s4() + '-' + s4() + '-' +\n s4() + '-' + s4() + s4() + s4();\n\n _options.callback(null, uniqueAttr);\n }", "function encodeAttr(str) {\n\treturn (str+'').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}", "function safeSetAttributes(el, attributes) {\n Object.keys(attributes).forEach((name) => {\n safeSetAttribute(el, name, attributes[name].toString());\n });\n}", "function listString (list) {\n\tresult = \"Number items: \" + list.length + \", type \" + typeof(list) + \" \" ;\n\tfor ( i = 0 ; i < list.length ; i++ ){\n\t\tresult += list[i].getAttribute(\"name\") + \"\\n\" ;\n\t}\n\treturn result ;\n}", "getAttributes() {}", "function Entity$toIdString(obj) {\n return obj.meta.type.fullName + \"|\" + obj.meta.id;\n}", "function makeKey(attributes) {\n\n\tvar key = CryptoJS.MD5(attributes).toString();\n\n\treturn key;\n}", "_mapAttributes(data) {\n return this._arrObjMapper(data, node => {\n node.id = node.intent;\n return node;\n });\n }", "function normalizeIdentificationValues(ids) {\n const normalized = {};\n Object.entries(ids).forEach(([marker, value]) => {\n if (value === null) {\n normalized[marker] = null;\n }\n else if (Array.isArray(value)) {\n normalized[marker] = value.map((v) => v.toString());\n }\n else {\n normalized[marker] = value.toString();\n }\n });\n return normalized;\n}", "attr(prop, args) {\r\n\t\tres = args.find(v => v.lhs == prop);\r\n\r\n\t\treturn res && res.rhs.join(' ');\r\n\t}", "function getUidEncodeParams(arr) {\n var arrIds = arr.map(function(obj) {\n return obj.uid;\n });\n return arrIds\n }", "getCustomAttributes( data ){\n // only items which are objects have properties which can be used as attributes\n if( !isObject(data) )\n return '';\n\n var output = {}, propName;\n\n for( propName in data ){\n if( propName.slice(0,2) != '__' && propName != 'class' && data.hasOwnProperty(propName) && data[propName] !== undefined )\n output[propName] = escapeHTML(data[propName])\n }\n return output\n }", "static get attributes() {\n return {\n id: {\n type: this.DataTypes.INTEGER,\n primaryKey: true,\n autoIncrement: true\n },\n userId: this.DataTypes.INTEGER,\n address: this.DataTypes.STRING,\n tel: this.DataTypes.STRING,\n created: this.DataTypes.DATE,\n modified: this.DataTypes.DATE\n };\n }", "function _getAttributesAsJson(attrs) {\n var rval = {};\n for(var i = 0; i < attrs.length; ++i) {\n var attr = attrs[i];\n if(attr.shortName && (\n attr.valueTagClass === asn1.Type.UTF8 ||\n attr.valueTagClass === asn1.Type.PRINTABLESTRING ||\n attr.valueTagClass === asn1.Type.IA5STRING)) {\n var value = attr.value;\n if(attr.valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(attr.value);\n }\n if(!(attr.shortName in rval)) {\n rval[attr.shortName] = value;\n } else if(forge.util.isArray(rval[attr.shortName])) {\n rval[attr.shortName].push(value);\n } else {\n rval[attr.shortName] = [rval[attr.shortName], value];\n }\n }\n }\n return rval;\n}", "function _getAttributesAsJson(attrs) {\n var rval = {};\n for(var i = 0; i < attrs.length; ++i) {\n var attr = attrs[i];\n if(attr.shortName && (\n attr.valueTagClass === asn1.Type.UTF8 ||\n attr.valueTagClass === asn1.Type.PRINTABLESTRING ||\n attr.valueTagClass === asn1.Type.IA5STRING)) {\n var value = attr.value;\n if(attr.valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(attr.value);\n }\n if(!(attr.shortName in rval)) {\n rval[attr.shortName] = value;\n } else if(forge.util.isArray(rval[attr.shortName])) {\n rval[attr.shortName].push(value);\n } else {\n rval[attr.shortName] = [rval[attr.shortName], value];\n }\n }\n }\n return rval;\n}", "function _getAttributesAsJson(attrs) {\n var rval = {};\n for(var i = 0; i < attrs.length; ++i) {\n var attr = attrs[i];\n if(attr.shortName && (\n attr.valueTagClass === asn1.Type.UTF8 ||\n attr.valueTagClass === asn1.Type.PRINTABLESTRING ||\n attr.valueTagClass === asn1.Type.IA5STRING)) {\n var value = attr.value;\n if(attr.valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(attr.value);\n }\n if(!(attr.shortName in rval)) {\n rval[attr.shortName] = value;\n } else if(forge.util.isArray(rval[attr.shortName])) {\n rval[attr.shortName].push(value);\n } else {\n rval[attr.shortName] = [rval[attr.shortName], value];\n }\n }\n }\n return rval;\n}", "function _getAttributesAsJson(attrs) {\n var rval = {};\n for(var i = 0; i < attrs.length; ++i) {\n var attr = attrs[i];\n if(attr.shortName && (\n attr.valueTagClass === asn1.Type.UTF8 ||\n attr.valueTagClass === asn1.Type.PRINTABLESTRING ||\n attr.valueTagClass === asn1.Type.IA5STRING)) {\n var value = attr.value;\n if(attr.valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(attr.value);\n }\n if(!(attr.shortName in rval)) {\n rval[attr.shortName] = value;\n } else if(forge.util.isArray(rval[attr.shortName])) {\n rval[attr.shortName].push(value);\n } else {\n rval[attr.shortName] = [rval[attr.shortName], value];\n }\n }\n }\n return rval;\n}", "function _getAttributesAsJson(attrs) {\n var rval = {};\n for(var i = 0; i < attrs.length; ++i) {\n var attr = attrs[i];\n if(attr.shortName && (\n attr.valueTagClass === asn1.Type.UTF8 ||\n attr.valueTagClass === asn1.Type.PRINTABLESTRING ||\n attr.valueTagClass === asn1.Type.IA5STRING)) {\n var value = attr.value;\n if(attr.valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(attr.value);\n }\n if(!(attr.shortName in rval)) {\n rval[attr.shortName] = value;\n } else if(forge.util.isArray(rval[attr.shortName])) {\n rval[attr.shortName].push(value);\n } else {\n rval[attr.shortName] = [rval[attr.shortName], value];\n }\n }\n }\n return rval;\n}", "function _getAttributesAsJson(attrs) {\n var rval = {};\n for(var i = 0; i < attrs.length; ++i) {\n var attr = attrs[i];\n if(attr.shortName && (\n attr.valueTagClass === asn1.Type.UTF8 ||\n attr.valueTagClass === asn1.Type.PRINTABLESTRING ||\n attr.valueTagClass === asn1.Type.IA5STRING)) {\n var value = attr.value;\n if(attr.valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(attr.value);\n }\n if(!(attr.shortName in rval)) {\n rval[attr.shortName] = value;\n } else if(forge.util.isArray(rval[attr.shortName])) {\n rval[attr.shortName].push(value);\n } else {\n rval[attr.shortName] = [rval[attr.shortName], value];\n }\n }\n }\n return rval;\n}", "function _getAttributesAsJson(attrs) {\n var rval = {};\n for(var i = 0; i < attrs.length; ++i) {\n var attr = attrs[i];\n if(attr.shortName && (\n attr.valueTagClass === asn1.Type.UTF8 ||\n attr.valueTagClass === asn1.Type.PRINTABLESTRING ||\n attr.valueTagClass === asn1.Type.IA5STRING)) {\n var value = attr.value;\n if(attr.valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(attr.value);\n }\n if(!(attr.shortName in rval)) {\n rval[attr.shortName] = value;\n } else if(forge.util.isArray(rval[attr.shortName])) {\n rval[attr.shortName].push(value);\n } else {\n rval[attr.shortName] = [rval[attr.shortName], value];\n }\n }\n }\n return rval;\n}", "function s(a){return a.type=(null!==a.getAttribute(\"type\"))+\"/\"+a.type,a}", "function wddxSerializer_serializeAttr(s)\n{\n\tfor (var i = 0; i < s.length; ++i)\n {\n \tthis.write(this.at[s.charAt(i)]);\n }\n}", "function attributes(element) {\n\t\tlet attributes = element.attributes || [];\n\t\tconst l = attributes.length;\n\n\t\tfor (let i = 0; i < l; i++) {\n\t\t\tlet attribute = attributes[i];\n\n\t\t\tattribute.value = format.call(this, attribute.value);\n\t\t}\n\t}", "function AttributeExtras() {}", "formatAttributeName(attr) {\n return attr.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase();\n }", "function handleSimpleAttribute() {\n SIMPLEATTR.lastIndex = nextchar-1;\n var matched = SIMPLEATTR.exec(chars);\n if (!matched) throw new Error(\"should never happen\");\n var name = matched[1];\n if (!name) return false;\n var value = matched[2];\n var len = value.length;\n switch(value[0]) {\n case '\"':\n case \"'\":\n value = value.substring(1, len-1);\n nextchar += (matched[0].length-1);\n tokenizer = after_attribute_value_quoted_state;\n break;\n default:\n tokenizer = before_attribute_name_state;\n nextchar += (matched[0].length-1);\n value = value.substring(0, len-1);\n break;\n }\n\n // Make sure there isn't already an attribute with this name\n // If there is, ignore this one.\n for(var i = 0; i < attributes.length; i++) {\n if (attributes[i][0] === name) return true;\n }\n\n attributes.push([name, value]);\n return true;\n }", "function attributesToPhrase(drivers) {\n return drivers.map(function(driver) {\n return `${driver.name} is from ${driver.hometown}`\n });\n}", "function convertAttributeValue(value) {\n if (value === undefined || value === null) {\n return null;\n }\n var valueType = typeof value;\n if (valueType === \"object\") {\n try {\n value = JSON.stringify(value);\n } catch (e) {\n // Use the default conversion if JSON encoding fails\n }\n }\n return \"\" + value;\n}", "function showAttribute() {\n\tvar idName = prompt(\"Enter the id of the element who's attributes you'd like to return\", \"nameFirstShip\");\n\tvar e = document.getElementById(idName);\n\tvar elemList = \"\";\n\tfor(var element in e) {\n \t var attrib = e.getAttribute(element);\n \t if(attrib != null){\n\t \t\t\telemList = elemList + element + \": \" + attrib + \"\\n\";\n\t \t\t}\n\t}\n\talert(elemList);\t\n}", "function _getAsParameterList(attrs) {\n\t\tvar s = '';\n\t\tfor (var name in attrs) {\n\t\t\ts += '<param name=\"' + name + '\" value=\"' + attrs[name] + '\" />';\n\t\t}\n\t\treturn s;\n\t}", "static get observedAttributes() {\n return [] // List an array of attribute names\n }", "function attributesToPhrase(drivers) {\n return drivers.map(function (driver) {\n return `${driver.name} is from ${driver.hometown}`;\n });\n}", "static collect(Owner, ...attributeLists) {\n const attributes = [];\n attributeLists.push(Owner.attributes);\n\n for (let i = 0, ii = attributeLists.length; i < ii; ++i) {\n const list = attributeLists[i];\n\n if (list === void 0) {\n continue;\n }\n\n for (let j = 0, jj = list.length; j < jj; ++j) {\n const config = list[j];\n\n if (typeof config === \"string\") {\n attributes.push(new AttributeDefinition(Owner, config));\n } else {\n attributes.push(new AttributeDefinition(Owner, config.property, config.attribute, config.mode, config.converter));\n }\n }\n }\n\n return attributes;\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 createSignUpUserAttributeList(name,email,yId,userType=0) {\n\tvar attributeList = [];\n\tattributeList.push(new AmazonCognitoIdentity.CognitoUserAttribute({Name : 'name', Value : name}));\n\tattributeList.push(new AmazonCognitoIdentity.CognitoUserAttribute({Name : 'email', Value : email}));\n\tattributeList.push(new AmazonCognitoIdentity.CognitoUserAttribute({Name : 'custom:ysuId', Value : yId}));\n\tattributeList.push(new AmazonCognitoIdentity.CognitoUserAttribute({Name : 'custom:userLevel', Value : userType}));\n\treturn attributeList;\n}", "toString(nameMap = undefined) {\n return this.tags.map(a => `#${a}`).join(' ');\n }", "function nameToAttributes(drivers) {\n return drivers.map(function(name) {\n let splitName = name.split(' ');\n return { firstName: splitName[0], lastName: splitName[1] }\n });\n}", "function mergeAriaAttributeValues() {\n var ariaAttributes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n ariaAttributes[_i] = arguments[_i];\n }\n var mergedAttribute = ariaAttributes\n .filter(function (arg) { return arg; })\n .join(' ')\n .trim();\n return mergedAttribute === '' ? undefined : mergedAttribute;\n}", "function mergeAriaAttributeValues() {\n var ariaAttributes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n ariaAttributes[_i] = arguments[_i];\n }\n var mergedAttribute = ariaAttributes\n .filter(function (arg) { return arg; })\n .join(' ')\n .trim();\n return mergedAttribute === '' ? undefined : mergedAttribute;\n}", "function mergeAriaAttributeValues() {\n var ariaAttributes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n ariaAttributes[_i] = arguments[_i];\n }\n var mergedAttribute = ariaAttributes\n .filter(function (arg) { return arg; })\n .join(' ')\n .trim();\n return mergedAttribute === '' ? undefined : mergedAttribute;\n}", "function generate(attributes, suppress) {\n const inputs = [];\n for (let i in attributes) {\n const attr = attributes[i];\n if (suppress && suppress.hasOwnProperty(attr.name)) {\n continue;\n }\n\n inputs.push(React.createElement(Input, _extends({ key: attr.name }, attr)));\n }\n\n return inputs;\n}", "keyForAttribute(key) { return key; }", "function toLowerCamelCase(attr) {\n if (_.isArray(attr)) return _.map(attr, toLowerCamelCase);\n\n return _.reduce(attr, function(memo, val, key) {\n key = _str.camelize(key);\n memo[key] = val;\n return memo;\n }, {});\n}", "attrs(prefix, args) {\r\n\t\tlet res = '';\r\n\t\tconst len = prefix.length\r\n\t\targs.forEach(v => {\r\n\t\t\tif (v.lhs.startsWith(prefix)) {\r\n\t\t\t\t// remove the prefix\r\n\t\t\t\tres += ` ${v.lhs.substr(prefix.length)}`\r\n\t if (v.rhs.length > 0) res += `=\"${v.rhs.join(' ')}\"`\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\treturn res;\r\n\t}", "asString() {\n if (validation.isEmpty(this.selectedAttribute)) {\n return null;\n } else {\n return this.selectedAttribute.toString();\n }\n }", "function mergeAriaAttributeValues() {\n var ariaAttributes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n ariaAttributes[_i] = arguments[_i];\n }\n var mergedAttribute = ariaAttributes\n .filter(function (arg) { return arg !== undefined && arg !== null; })\n .join('');\n return mergedAttribute === '' ? undefined : mergedAttribute;\n}", "function escapeAttr(value) {\n if (typeof value !== 'string') {\n return value;\n }\n\t\t\n\t\t// If not string then convert double quotes \n return value.replace(/\"/g, '&quot;');\n }", "function getIdentifier(attr){\n switch (attr){\n case 'opacity-value':\n return 'fill';\n break;\n default:\n return '';\n break;\n }\n}", "renderAttributes(){\n\t\tvar\n\t\t props= this.mediaDeviceProperties|| defaults.mediaDeviceProperties,\n\t\t deviceInfo= this.deviceInfo\n\t\tfor( var prop of props){\n\t\t\tthis.setAttribute( propToAttr[ prop], deviceInfo[ prop])\n\t\t}\n\t\tif( !this.noSingleId&& !this._id){\n\t\t\tthis.setAttribute( \"id\", deviceInfo.deviceId)\n\t\t}\n\t}", "function getAttributes() {\n return ATTRS;\n}", "make_new_annotation_id() {\n var unq_str = uuidv4();\n return unq_str;\n }", "get attributes() {\n return Object.values(this.attr).reduce((result, cur) => {\n return result.concat(cur);\n }, []);\n }", "function optimizeAttributes(attrs) {\r\n // clone all attributes to make sure that original objects are \r\n // not modified\r\n attrs = _.map(attrs, function(attr) {\r\n return _.clone(attr);\r\n });\r\n \r\n var lookup = {};\r\n\r\n return _.filter(attrs, function(attr) {\r\n if (!(attr.name in lookup)) {\r\n return lookup[attr.name] = attr;\r\n }\r\n \r\n var la = lookup[attr.name];\r\n \r\n if (attr.name.toLowerCase() == 'class') {\r\n la.value += (la.value.length ? ' ' : '') + attr.value;\r\n } else {\r\n la.value = attr.value;\r\n }\r\n \r\n return false;\r\n });\r\n }", "_visitAttributesOf(el) {\n const explicitAttrNameToValue = {};\n const implicitAttrNames = this._implicitAttrs[el.name] || [];\n el.attrs.filter(attr => attr.name.startsWith(_I18N_ATTR_PREFIX))\n .forEach(attr => explicitAttrNameToValue[attr.name.slice(_I18N_ATTR_PREFIX.length)] =\n attr.value);\n el.attrs.forEach(attr => {\n if (attr.name in explicitAttrNameToValue) {\n this._addMessage([attr], explicitAttrNameToValue[attr.name]);\n }\n else if (implicitAttrNames.some(name => attr.name === name)) {\n this._addMessage([attr]);\n }\n });\n }", "_visitAttributesOf(el) {\n const explicitAttrNameToValue = {};\n const implicitAttrNames = this._implicitAttrs[el.name] || [];\n el.attrs.filter(attr => attr.name.startsWith(_I18N_ATTR_PREFIX))\n .forEach(attr => explicitAttrNameToValue[attr.name.slice(_I18N_ATTR_PREFIX.length)] =\n attr.value);\n el.attrs.forEach(attr => {\n if (attr.name in explicitAttrNameToValue) {\n this._addMessage([attr], explicitAttrNameToValue[attr.name]);\n }\n else if (implicitAttrNames.some(name => attr.name === name)) {\n this._addMessage([attr]);\n }\n });\n }", "_visitAttributesOf(el) {\n const explicitAttrNameToValue = {};\n const implicitAttrNames = this._implicitAttrs[el.name] || [];\n el.attrs.filter(attr => attr.name.startsWith(_I18N_ATTR_PREFIX))\n .forEach(attr => explicitAttrNameToValue[attr.name.slice(_I18N_ATTR_PREFIX.length)] =\n attr.value);\n el.attrs.forEach(attr => {\n if (attr.name in explicitAttrNameToValue) {\n this._addMessage([attr], explicitAttrNameToValue[attr.name]);\n }\n else if (implicitAttrNames.some(name => attr.name === name)) {\n this._addMessage([attr]);\n }\n });\n }", "_visitAttributesOf(el) {\n const explicitAttrNameToValue = {};\n const implicitAttrNames = this._implicitAttrs[el.name] || [];\n el.attrs.filter(attr => attr.name.startsWith(_I18N_ATTR_PREFIX))\n .forEach(attr => explicitAttrNameToValue[attr.name.slice(_I18N_ATTR_PREFIX.length)] =\n attr.value);\n el.attrs.forEach(attr => {\n if (attr.name in explicitAttrNameToValue) {\n this._addMessage([attr], explicitAttrNameToValue[attr.name]);\n }\n else if (implicitAttrNames.some(name => attr.name === name)) {\n this._addMessage([attr]);\n }\n });\n }", "static _attributeNameForProperty(name,options){const attribute=options.attribute;return!1===attribute?void 0:\"string\"===typeof attribute?attribute:\"string\"===typeof name?name.toLowerCase():void 0}" ]
[ "0.6765786", "0.64373475", "0.6316487", "0.6217544", "0.61595184", "0.6099874", "0.60874957", "0.59805536", "0.5862916", "0.586259", "0.586259", "0.586259", "0.586259", "0.58526134", "0.5843435", "0.58401835", "0.58401835", "0.58401835", "0.5839162", "0.5832626", "0.5829996", "0.58016765", "0.57613206", "0.5726442", "0.5726442", "0.5726442", "0.5726442", "0.5726442", "0.5675376", "0.56724256", "0.5642279", "0.5580396", "0.5540552", "0.5502068", "0.5482614", "0.5452528", "0.542779", "0.53913647", "0.53479236", "0.53227615", "0.5288324", "0.52433", "0.524247", "0.5196091", "0.519361", "0.5185047", "0.51723737", "0.5172347", "0.5157574", "0.5149675", "0.5147287", "0.51349807", "0.51346076", "0.51192987", "0.5117173", "0.51149786", "0.51149786", "0.51149786", "0.51149786", "0.51149786", "0.51149786", "0.51149786", "0.5097366", "0.50783986", "0.5048774", "0.5040371", "0.50337243", "0.49913517", "0.4977717", "0.4969843", "0.49559823", "0.49512318", "0.49473634", "0.4945406", "0.4935923", "0.49300376", "0.49292925", "0.49220493", "0.4920443", "0.49152946", "0.49152946", "0.49152946", "0.49078307", "0.49067384", "0.4906691", "0.4905542", "0.48970342", "0.4894508", "0.4892057", "0.4890637", "0.4887903", "0.4882979", "0.48789904", "0.48778486", "0.48482224", "0.48479158", "0.48479158", "0.48479158", "0.48479158", "0.48412323" ]
0.64497566
1
The convert the current attribute map into a string given the attribute keys to use
attributesToString(attributeKeys) { var result = null; for (var attributeKey of attributeKeys) { if (!this.attributes.has(attributeKey)) { throw new Error(Util.format("distinighed name missing attribute '%s'", attributeKey)); } if (result == null) result = ""; else result += DistingishedName.attributeSeparator; result += attributeKey + DistingishedName.keyValueSeparator + this.attributes.get(attributeKey); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function make_attributes (attr) {\n\t\tvar attr_str = '';\n\t\tfor (var k in attr) {\n\t\t\tif (k && attr[k] != null) attr_str += ' '+ k +'='+ '\"'+ attr[k] +'\"';\n\t\t}\n\t\treturn attr_str;\n\t}", "function attrsToStr(attrs){var parts=[];$.each(attrs,function(name,val){if(val!=null){parts.push(name+'=\"'+htmlEscape(val)+'\"');}});return parts.join(' ');}", "function attrsToStr(attrs) {\n var parts = [];\n\n for (var name in attrs) {\n var val = attrs[name];\n\n if (val != null) {\n parts.push(name + '=\"' + htmlEscape(val) + '\"');\n }\n }\n\n return parts.join(' ');\n }", "function getTransformString() {\n return keys.map(function (key) {\n var val = model.get(bindings[key]);\n // assume px if no non-digits and we're doing transforms\n return key + '(' + addDefaultUnits(val, key) + ')';\n }).join(' ');\n }", "function attrStr(k, v) {\n return isDefined(v) ? ' ' + k + '=\"' + v + '\"' : '';\n }", "function attrStr(k, v) {\n return isDefined(v) ? ' ' + k + '=\"' + v + '\"' : '';\n }", "function attrsToStr(attrs) {\n var parts = [];\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape(val) + '\"');\n }\n }\n return parts.join(' ');\n }", "function attrsToStr(attrs) {\n var parts = [];\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape(val) + '\"');\n }\n }\n return parts.join(' ');\n }", "function attrsToStr(attrs) {\n var parts = [];\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape(val) + '\"');\n }\n }\n return parts.join(' ');\n }", "function attrsToStr(attrs) {\n var parts = [];\n\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape(val) + '\"');\n }\n }\n\n return parts.join(' ');\n }", "getAttributes() {\n return Object.keys(this.attributes).map(\n key => ' ' + key + '=\"' + escapeHTML(this.attributes[key]) + '\"'\n ).join('');\n }", "get attributeString() {\n console.log(JSON.stringify(self.attributes))\n return JSON.stringify(self.attributes)\n }", "function attrsToStr(attrs) {\n var parts = [];\n $.each(attrs, function (name, val) {\n if (val != null) {\n parts.push(name + '=\"' + htmlEscape(val) + '\"');\n }\n });\n return parts.join(' ');\n}", "function attrsToStr(attrs) {\n var parts = [];\n $.each(attrs, function (name, val) {\n if (val != null) {\n parts.push(name + '=\"' + htmlEscape(val) + '\"');\n }\n });\n return parts.join(' ');\n}", "function attrsToStr(attrs) {\n var parts = [];\n $.each(attrs, function (name, val) {\n if (val != null) {\n parts.push(name + '=\"' + htmlEscape(val) + '\"');\n }\n });\n return parts.join(' ');\n}", "function attrsToStr(attrs) {\n var parts = [];\n $.each(attrs, function (name, val) {\n if (val != null) {\n parts.push(name + '=\"' + htmlEscape(val) + '\"');\n }\n });\n return parts.join(' ');\n}", "function attrsToStr$1(attrs) {\n var parts = [];\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape$1(val) + '\"');\n }\n }\n return parts.join(' ');\n }", "function attrsToStr(attrs) {\n var parts = [];\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape(val) + '\"');\n }\n }\n return parts.join(' ');\n}", "function attrStr(k,v) {\n return angular.isDefined(v) ? ' ' + k + '=\"' + v + '\"' : '';\n }", "function attrsToStr(attrs) {\n\t\tvar parts = [];\n\n\t\t$.each(attrs, function(name, val) {\n\t\t\tif (val != null) {\n\t\t\t\tparts.push(name + '=\"' + htmlEscape(val) + '\"');\n\t\t\t}\n\t\t});\n\n\t\treturn parts.join(' ');\n\t}", "function attrsToStr(attrs) {\n\tvar parts = [];\n\n\t$.each(attrs, function(name, val) {\n\t\tif (val != null) {\n\t\t\tparts.push(name + '=\"' + htmlEscape(val) + '\"');\n\t\t}\n\t});\n\n\treturn parts.join(' ');\n}", "function attrsToStr(attrs) {\n\tvar parts = [];\n\n\t$.each(attrs, function(name, val) {\n\t\tif (val != null) {\n\t\t\tparts.push(name + '=\"' + htmlEscape(val) + '\"');\n\t\t}\n\t});\n\n\treturn parts.join(' ');\n}", "function attrsToStr(attrs) {\n\tvar parts = [];\n\n\t$.each(attrs, function(name, val) {\n\t\tif (val != null) {\n\t\t\tparts.push(name + '=\"' + htmlEscape(val) + '\"');\n\t\t}\n\t});\n\n\treturn parts.join(' ');\n}", "function attrsToStr(attrs) {\n\tvar parts = [];\n\n\t$.each(attrs, function(name, val) {\n\t\tif (val != null) {\n\t\t\tparts.push(name + '=\"' + htmlEscape(val) + '\"');\n\t\t}\n\t});\n\n\treturn parts.join(' ');\n}", "function attrsToStr(attrs) {\n\tvar parts = [];\n\n\t$.each(attrs, function(name, val) {\n\t\tif (val != null) {\n\t\t\tparts.push(name + '=\"' + htmlEscape(val) + '\"');\n\t\t}\n\t});\n\n\treturn parts.join(' ');\n}", "keyForAttribute(key) { return key; }", "static toBackendAttrKey(attrKey) {\n return camelToSnake(attrKey);\n }", "function getAttrNameFromKey(key) {\n return numberToAttr[key.split(SPLIT_CHAR)[1]];\n }", "toString(nameMap = undefined) {\n return this.tags.map(a => `#${a}`).join(' ');\n }", "toFullString() {\n return this._toKey(false);\n }", "function _getAsAttributeList(attrs) {\n\t\tvar s = '';\n\t\tfor (var name in attrs) {\n\t\t\ts += ' ' + name + '=\"' + attrs[name] + '\"';\n\t\t}\n\t\treturn s;\n\t}", "function normalizeAttributeKey(key) {\n const hyphenIndex = key.indexOf('-');\n\n if (hyphenIndex !== -1 && key.match(HTML_CUSTOM_ATTR_R) === null) {\n key = key.replace(CAPTURE_LETTER_AFTER_HYPHEN, function(_, letter) {\n return letter.toUpperCase();\n });\n }\n\n return key;\n}", "function getRaw(node){\n let text = '';\n text += node.name;\n _.each(node.attribs, (value, key) => {\n if (value.length === 0) {\n text += ' ' + key;\n } else {\n text += ' ' +key + '=\"' + value + '\"';\n }\n });\n return text;\n }", "function stringifyAttributes(attrsObj) {\n var attributes = [];\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = (0, _getIterator3.default)((0, _entries2.default)(attrsObj)), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _ref = _step.value;\n\n var _ref2 = (0, _slicedToArray3.default)(_ref, 2);\n\n var key = _ref2[0];\n var value = _ref2[1];\n\n if (value === false) {\n continue;\n }\n\n if (Array.isArray(value)) {\n value = value.join(' ');\n }\n\n value = value === true ? '' : `=\"${String(value)}\"`;\n\n attributes.push(`${key}${value}`);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return attributes.length > 0 ? ' ' + attributes.join(' ') : '';\n}", "function stateToAttributeString(state) {\n return String(state).replace(/([\\s_]+)/g, \"-\").toLowerCase();\n}", "function encodeAttr(str) {\n\treturn (str+'').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}", "function keysToAttrs(context, keys, attributes) {\n return keys.reduce((attrs, key) => {\n let pathOrValue = attributes[key];\n let value = pathOrValue;\n\n // allow for non-string values, as well as 'this'\n if (isString(pathOrValue)) {\n let path = pathOrValue;\n if (path === 'this') {\n value = context;\n } else {\n value = context.get(path);\n }\n }\n\n attrs[key] = value;\n return attrs;\n }, {});\n}", "function treatAttributes(attributes) {\n\n\tvar attributes = attributes.split(\"*,\");\n\tvar aux = \"\";\n\tfor (var i in attributes) {\n\t\taux += attributes[i] + \"`\";\n\t}\n\n\treturn aux;\n}", "formatAttributeName(attr) {\n return attr.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase();\n }", "static fromBackendAttrKey(attrKey) {\n return snakeToCamel(attrKey);\n }", "toString() {\r\n\t\treturn (this.ctrl? \"Ctrl+\":\"\") +\r\n\t\t\t(this.alt? \"Alt+\":\"\") +\r\n\t\t\t(this.shift? \"Shift+\":\"\") +\r\n\t\t\tthis.name\r\n\t}", "toString() {\n this.init();\n return this.keys()\n .map(key => {\n const eKey = this.encoder.encodeKey(key);\n // `a: ['1']` produces `'a=1'`\n // `b: []` produces `''`\n // `c: ['1', '2']` produces `'c=1&c=2'`\n return this.map.get(key).map(value => eKey + '=' + this.encoder.encodeValue(value))\n .join('&');\n })\n // filter out empty values because `b: []` produces `''`\n // which results in `a=1&&c=1&c=2` instead of `a=1&c=1&c=2` if we don't\n .filter(param => param !== '')\n .join('&');\n }", "toString() {\n this.init();\n return this.keys()\n .map(key => {\n const eKey = this.encoder.encodeKey(key);\n // `a: ['1']` produces `'a=1'`\n // `b: []` produces `''`\n // `c: ['1', '2']` produces `'c=1&c=2'`\n return this.map.get(key).map(value => eKey + '=' + this.encoder.encodeValue(value))\n .join('&');\n })\n // filter out empty values because `b: []` produces `''`\n // which results in `a=1&&c=1&c=2` instead of `a=1&c=1&c=2` if we don't\n .filter(param => param !== '')\n .join('&');\n }", "toString() {\n this.init();\n return this.keys()\n .map(key => {\n const eKey = this.encoder.encodeKey(key);\n // `a: ['1']` produces `'a=1'`\n // `b: []` produces `''`\n // `c: ['1', '2']` produces `'c=1&c=2'`\n return this.map.get(key).map(value => eKey + '=' + this.encoder.encodeValue(value))\n .join('&');\n })\n // filter out empty values because `b: []` produces `''`\n // which results in `a=1&&c=1&c=2` instead of `a=1&c=1&c=2` if we don't\n .filter(param => param !== '')\n .join('&');\n }", "toString() {\n this.init();\n return this.keys()\n .map(key => {\n const eKey = this.encoder.encodeKey(key);\n // `a: ['1']` produces `'a=1'`\n // `b: []` produces `''`\n // `c: ['1', '2']` produces `'c=1&c=2'`\n return this.map.get(key).map(value => eKey + '=' + this.encoder.encodeValue(value))\n .join('&');\n })\n // filter out empty values because `b: []` produces `''`\n // which results in `a=1&&c=1&c=2` instead of `a=1&c=1&c=2` if we don't\n .filter(param => param !== '')\n .join('&');\n }", "toString() {\n this.init();\n return this.keys()\n .map(key => {\n const eKey = this.encoder.encodeKey(key);\n // `a: ['1']` produces `'a=1'`\n // `b: []` produces `''`\n // `c: ['1', '2']` produces `'c=1&c=2'`\n return this.map.get(key).map(value => eKey + '=' + this.encoder.encodeValue(value))\n .join('&');\n })\n // filter out empty values because `b: []` produces `''`\n // which results in `a=1&&c=1&c=2` instead of `a=1&c=1&c=2` if we don't\n .filter(param => param !== '')\n .join('&');\n }", "function serializeAttrs(map) {\n var ret = {};\n for (var prop, i = 0; i < map.length; i++) {\n var key = map[i].name;\n if (!startsWith(key, DataPropPrefix)) {\n prop = convertReactSVGDOMProperty(key);\n }\n ret[prop] = map[i].value;\n }\n return ret;\n}", "toString() {\n this.init();\n return this.keys().map(key => {\n const eKey = this.encoder.encodeKey(key);\n // `a: ['1']` produces `'a=1'`\n // `b: []` produces `''`\n // `c: ['1', '2']` produces `'c=1&c=2'`\n return this.map.get(key).map(value => eKey + '=' + this.encoder.encodeValue(value)).join('&');\n })\n // filter out empty values because `b: []` produces `''`\n // which results in `a=1&&c=1&c=2` instead of `a=1&c=1&c=2` if we don't\n .filter(param => param !== '').join('&');\n }", "function iconAttr(key) {\n\t return key;\n\t }", "function charMapToString(map) {\n return map.join(\" \");\n}", "static _attributeNameForProperty(name,options){const attribute=options.attribute;return!1===attribute?void 0:\"string\"===typeof attribute?attribute:\"string\"===typeof name?name.toLowerCase():void 0}", "function kwtoattr(html_attrs, merge){\n var k,v;\n var rv = '';\n if (merge) {\n for (k in merge) {\n if (merge.hasOwnProperty(k)) {\n v = merge[k];\n if(html_attrs.hasOwnProperty(k)){\n v = html_attrs[k] + ' ' + v\n }\n html_attrs[k] = v\n }\n }\n }\n\n var booleanAttributes = \" hidden novalidate formnovalidate readonly required multiple autofocus disabled selected\";\n\n for (k in html_attrs){\n if(!html_attrs.hasOwnProperty(k) || typeof html_attrs[k] !== 'string')\n continue;\n\n if (booleanAttributes.indexOf(\" \" + k + \" \") > -1) {\n if (html_attrs[k]==k || html_attrs[k]==\"\") //otherwise omit\n rv += k + \" \";\n } else {\n rv += k + '= \"' + html_attrs[k].replace(/&/g,'&amp;').replace(/\"/g,'&quot;') + '\" ';\n }\n }\n return rv;\n }", "function cssToStr(cssProps) {\n var statements = [];\n\n for (var name_1 in cssProps) {\n var val = cssProps[name_1];\n\n if (val != null && val !== '') {\n statements.push(name_1 + ':' + val);\n }\n }\n\n return statements.join(';');\n } // Given an object hash of HTML attribute names to values,", "function buildFetchAttributeXml(columns) {\n\n var attributes = [];\n\n for (var i = 0, max = columns.length; i < max; i++) {\n\n attributes.push('<attribute name=\"' + columns[i] + '\" />');\n }\n\n return attributes.join('');\n}", "function attr(a,b){return ' '+a+'=\"'+b+'\"';}", "function attributeEncode(value) {\n return typeof value === \"string\" ? value : JSON.stringify(value) ;\n }", "function toAttribute(attribute, value) {\n if (value == null)\n return \"\";\n else if (typeof value !== \"string\")\n value = JSON.stringify(value);\n return \" \" + attribute + \"='\" + value + \"'\";\n}", "updateLookupString() {\n this.lookupString = this.attributesToString(DistingishedName.lookupAttributeKeys);\n }", "function _htmlElementAsString(el, keyAttrs) {\n\t const elem = el\n\n\t;\n\n\t const out = [];\n\t let className;\n\t let classes;\n\t let key;\n\t let attr;\n\t let i;\n\n\t if (!elem || !elem.tagName) {\n\t return '';\n\t }\n\n\t out.push(elem.tagName.toLowerCase());\n\n\t // Pairs of attribute keys defined in `serializeAttribute` and their values on element.\n\t const keyAttrPairs =\n\t keyAttrs && keyAttrs.length\n\t ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])\n\t : null;\n\n\t if (keyAttrPairs && keyAttrPairs.length) {\n\t keyAttrPairs.forEach(keyAttrPair => {\n\t out.push(`[${keyAttrPair[0]}=\"${keyAttrPair[1]}\"]`);\n\t });\n\t } else {\n\t if (elem.id) {\n\t out.push(`#${elem.id}`);\n\t }\n\n\t // eslint-disable-next-line prefer-const\n\t className = elem.className;\n\t if (className && isString$2(className)) {\n\t classes = className.split(/\\s+/);\n\t for (i = 0; i < classes.length; i++) {\n\t out.push(`.${classes[i]}`);\n\t }\n\t }\n\t }\n\t const allowedAttrs = ['type', 'name', 'title', 'alt'];\n\t for (i = 0; i < allowedAttrs.length; i++) {\n\t key = allowedAttrs[i];\n\t attr = elem.getAttribute(key);\n\t if (attr) {\n\t out.push(`[${key}=\"${attr}\"]`);\n\t }\n\t }\n\t return out.join('');\n\t}", "static _attributeNameForProperty(e,t){const n=t.attribute;return!1===n?void 0:\"string\"==typeof n?n:\"string\"==typeof e?e.toLowerCase():void 0}", "attr(prop, args) {\r\n\t\tres = args.find(v => v.lhs == prop);\r\n\r\n\t\treturn res && res.rhs.join(' ');\r\n\t}", "function escape_attr(m)\n{\n if (!m)\n return m;\n\n var n = \"\";\n for (var i = 0; i < m.length; i++) {\n var c = m[i];\n // This assumes that all attributes are wrapped in '', never \"\".\n if (c === \"'\") { n += \"&#039;\"; continue; }\n n += c;\n }\n \n return n;\n}", "function formatAttributes(attributes) {\n\t\tvar att_value;\n\t\tvar apos_pos, quot_pos;\n\t\tvar use_quote, escape, quote_to_escape;\n\t\tvar att_str;\n\t\tvar re;\n\t\tvar result = '';\n\n\t\tfor (var att in attributes) {\n\t\t\tatt_value = attributes[att];\n\n\t\t\t// Find first quote marks if any\n\t\t\tapos_pos = att_value.indexOf(APOS);\n\t\t\tquot_pos = att_value.indexOf(QUOTE);\n\n\t\t\t// Determine which quote type to use around \n\t\t\t// the attribute value\n\t\t\tif (apos_pos == -1 && quot_pos == -1) {\n\t\t\t\tatt_str = ' ' + att + '=\"' + att_value + '\"';\n\t\t\t\tresult += att_str;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Prefer the single quote unless forced to use double\n\t\t\tif (quot_pos != -1 && quot_pos < apos_pos) {\n\t\t\t\tuse_quote = APOS;\n\t\t\t} else {\n\t\t\t\tuse_quote = QUOTE;\n\t\t\t}\n\n\t\t\t// Figure out which kind of quote to escape\n\t\t\t// Use nice dictionary instead of yucky if-else nests\n\t\t\tescape = ESCAPED_CHAR[use_quote];\n\n\t\t\t// Escape only the right kind of quote\n\t\t\tre = new RegExp(use_quote, 'g');\n\t\t\tatt_value = att_value.replace(re, escape);\n\t\t\tatt_str = ' ' + att + '=' + use_quote +\n\t\t\t\tescapeXMLValue(att_value, true) + use_quote;\n\t\t\tresult += att_str;\n\t\t}\n\t\treturn result;\n\t}", "function _htmlElementAsString(el, keyAttrs) {\n const elem = el\n\n ;\n\n const out = [];\n let className;\n let classes;\n let key;\n let attr;\n let i;\n\n if (!elem || !elem.tagName) {\n return '';\n }\n\n out.push(elem.tagName.toLowerCase());\n\n // Pairs of attribute keys defined in `serializeAttribute` and their values on element.\n const keyAttrPairs =\n keyAttrs && keyAttrs.length\n ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])\n : null;\n\n if (keyAttrPairs && keyAttrPairs.length) {\n keyAttrPairs.forEach(keyAttrPair => {\n out.push(`[${keyAttrPair[0]}=\"${keyAttrPair[1]}\"]`);\n });\n } else {\n if (elem.id) {\n out.push(`#${elem.id}`);\n }\n\n // eslint-disable-next-line prefer-const\n className = elem.className;\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push(`.${classes[i]}`);\n }\n }\n }\n const allowedAttrs = ['aria-label', 'type', 'name', 'title', 'alt'];\n for (i = 0; i < allowedAttrs.length; i++) {\n key = allowedAttrs[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push(`[${key}=\"${attr}\"]`);\n }\n }\n return out.join('');\n }", "toString() {\n if (this.isEmpty()) {\n return '';\n }\n const valuePairs = this.keyValues();\n //Se dicionário estiver vazio, devolve uma string vazia.\n // Caso contrário, adicionamos seu primeiro ValuePair.\n let objString = `${valuePairs[0].toString()}`;\n // só entra no laço a partir de dois ValuePairs.\n for (let i = 1; i < valuePairs.length; i++) {\n // Pega o valor de objString anterior e vai montando a objString final.\n objString = `${objString},${valuePairs[i].toString()}`;\n }\n return objString;\n }", "function stringify(evt) {\n var which = evt.which || evt.keyCode;\n var keyVal = KEY_VALUES[which];\n var key;\n var modifiers = [];\n\n if (evt.ctrlKey) modifiers.push('Ctrl');\n if (evt.originalEvent && evt.originalEvent.metaKey) modifiers.push('Meta');\n if (evt.altKey) modifiers.push('Alt');\n if (evt.shiftKey) modifiers.push('Shift');\n\n key = keyVal || String.fromCharCode(which);\n\n if (!modifiers.length && !keyVal) return key;\n\n modifiers.push(key);\n return modifiers.join('-');\n }", "function stringify(evt) {\n var which = evt.which || evt.keyCode;\n var keyVal = KEY_VALUES[which];\n var key;\n var modifiers = [];\n\n if (evt.ctrlKey) modifiers.push('Ctrl');\n if (evt.originalEvent && evt.originalEvent.metaKey) modifiers.push('Meta');\n if (evt.altKey) modifiers.push('Alt');\n if (evt.shiftKey) modifiers.push('Shift');\n\n key = keyVal || String.fromCharCode(which);\n\n if (!modifiers.length && !keyVal) return key;\n\n modifiers.push(key);\n return modifiers.join('-');\n }", "static _attributeNameForProperty(name,options){const attribute=options.attribute;return attribute===false?undefined:typeof attribute==='string'?attribute:typeof name==='string'?name.toLowerCase():undefined;}", "function _key(field, attribute)\n\t{\n\t\tif (field.originals)\n\t\t{\n\t\t\treturn field.originals.scope + '-' + field.originals.id + '-' + attribute;\n\t\t}\n\n\t\treturn field.scope + '-' + field.id + '-' + attribute;\n\t}", "updateIdentityString() {\n this.identityString = this.attributesToString(DistingishedName.identityAttributeKeys);\n }", "getAttributeLabelForRowIndex(attributesIndexMap, queryResult, rowIndex) {\n const values = [];\n for (let label in attributesIndexMap) {\n // remember, an attribute might contain multiple tuples, so the value is an array;\n const valueTuple = queryResult.getValue(rowIndex, attributesIndexMap[label]);\n if (valueTuple) {\n values.push(valueTuple.map(value => value.label).join());\n }\n\n }\n return values.join();\n }", "function _htmlElementAsString(el, keyAttrs) {\n var _a, _b;\n var elem = el;\n var out = [];\n var className;\n var classes;\n var key;\n var attr;\n var i;\n if (!elem || !elem.tagName) {\n return '';\n }\n out.push(elem.tagName.toLowerCase());\n // Pairs of attribute keys defined in `serializeAttribute` and their values on element.\n var keyAttrPairs = ((_a = keyAttrs) === null || _a === void 0 ? void 0 : _a.length) ? keyAttrs.filter(function (keyAttr) { return elem.getAttribute(keyAttr); }).map(function (keyAttr) { return [keyAttr, elem.getAttribute(keyAttr)]; })\n : null;\n if ((_b = keyAttrPairs) === null || _b === void 0 ? void 0 : _b.length) {\n keyAttrPairs.forEach(function (keyAttrPair) {\n out.push(\"[\" + keyAttrPair[0] + \"=\\\"\" + keyAttrPair[1] + \"\\\"]\");\n });\n }\n else {\n if (elem.id) {\n out.push(\"#\" + elem.id);\n }\n // eslint-disable-next-line prefer-const\n className = elem.className;\n if (className && is_1.isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push(\".\" + classes[i]);\n }\n }\n }\n var allowedAttrs = ['type', 'name', 'title', 'alt'];\n for (i = 0; i < allowedAttrs.length; i++) {\n key = allowedAttrs[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push(\"[\" + key + \"=\\\"\" + attr + \"\\\"]\");\n }\n }\n return out.join('');\n}", "function stringCoercingMapDecorator(map) {\n\tvar decoratorSymbol = canSymbol.for(\"can.route.stringCoercingMapDecorator\");\n\n\tif (!map.attr[decoratorSymbol]) {\n\t\tvar attrUndecoratedFunction = map.attr;\n\n\t\tmap.attr = function(key) {\n\n\t\t\tvar serializable = typeof key === \"string\" &&\n\t\t\t\t(this.define === undefined || this.define[key] === undefined || !!this.define[key].serialize),\n\t\t\t\targs;\n\n\t\t\tif (serializable) { // if setting non-str non-num attr\n\t\t\t\targs = stringify(Array.apply(null, arguments));\n\t\t\t} else {\n\t\t\t\targs = arguments;\n\t\t\t}\n\n\t\t\treturn attrUndecoratedFunction.apply(this, args);\n\t\t};\n\n\t\tcanReflect.setKeyValue(map.attr, decoratorSymbol, true);\n\t}\n\n\treturn map;\n}", "function calc_attributes(attr_dict) {\r\n keys = [\"Danceability\",\"Energy\",\"Speechiness\", \"Acousticness\", \"Valence\", \"Tempo\"];\r\n attributes = {};\r\n for(var i = 0; i < keys.length; i++){\r\n // console.log(keys[i]);\r\n attributes[keys[i]] = sigmoids[keys[i]](attr_dict[keys[i]]);\r\n }\r\n // console.log(attributes);\r\n return attributes;\r\n}", "function convertKeysToQueryForm(keyMap) {\n return Object.keys(keyMap).reduce(function (queryString, key) {\n let encodedKeyPair = `${key}%3d${encodeURIComponent(keyMap[key])}%26`;\n return queryString += encodedKeyPair;\n }, '');\n }", "function keyListToString(keyList) {\n if (!keyList) return keyList;\n return keyList.map(function (key) {\n return String(key);\n });\n}", "function keyListToString(keyList) {\n if (!keyList) return keyList;\n return keyList.map(function (key) {\n return String(key);\n });\n}", "function keyListToString(keyList) {\n if (!keyList) return keyList;\n return keyList.map(function (key) {\n return String(key);\n });\n}", "function keyListToString(keyList) {\n if (!keyList) return keyList;\n return keyList.map(function (key) {\n return String(key);\n });\n}", "function keyListToString(keyList) {\n if (!keyList) return keyList;\n return keyList.map(function (key) {\n return String(key);\n });\n}", "function keyListToString(keyList) {\n if (!keyList) return keyList;\n return keyList.map(function (key) {\n return String(key);\n });\n}", "function keyListToString(keyList) {\n if (!keyList) return keyList;\n return keyList.map(function (key) {\n return String(key);\n });\n}", "function keyListToString(keyList) {\n if (!keyList) return keyList;\n return keyList.map(function (key) {\n return String(key);\n });\n}", "function _htmlElementAsString(el, keyAttrs) {\n const elem = el\n\n;\n\n const out = [];\n let className;\n let classes;\n let key;\n let attr;\n let i;\n\n if (!elem || !elem.tagName) {\n return '';\n }\n\n out.push(elem.tagName.toLowerCase());\n\n // Pairs of attribute keys defined in `serializeAttribute` and their values on element.\n const keyAttrPairs =\n keyAttrs && keyAttrs.length\n ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])\n : null;\n\n if (keyAttrPairs && keyAttrPairs.length) {\n keyAttrPairs.forEach(keyAttrPair => {\n out.push(`[${keyAttrPair[0]}=\"${keyAttrPair[1]}\"]`);\n });\n } else {\n if (elem.id) {\n out.push(`#${elem.id}`);\n }\n\n // eslint-disable-next-line prefer-const\n className = elem.className;\n if (className && is.isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push(`.${classes[i]}`);\n }\n }\n }\n const allowedAttrs = ['type', 'name', 'title', 'alt'];\n for (i = 0; i < allowedAttrs.length; i++) {\n key = allowedAttrs[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push(`[${key}=\"${attr}\"]`);\n }\n }\n return out.join('');\n}", "function makeAttributes(attrs) {\n\t\tvar attributes = '{';\n\t\tvar attr = void 0;\n\n\t\twhile (attr = attrRegExp.exec(attrs)) {\n\t\t\tif (attributes !== '{') attributes += ', ';\n\t\t\tattributes += '\"' + attr[1].toLowerCase() + '\": ' + handleText(attr[2] || attr[3] || '', true).replace(/\\s*[,+]\\s*$/g, '');\n\t\t}\n\t\treturn attributes + '}';\n\t}", "function keysToString(object) {\n //i object\n //o return string\n // string to store\n let store = \"\"\n //loop with for key in\n for (let key in object){\n //add key to the string\n store += key+ \" \"\n }\n //remove last character from string\n return store.trim();\n\n}", "function get_w_AttributeText(tagNode) {\n let text = \"\";\n const attributes = [\"lemma\", \"strong\", \"srcloc\"];\n attributes.forEach((value) => {\n if (tagNode.hasOwnProperty(value)) {\n text = text === \"\" ? \"|\" : text + \" \";\n text += `${value}=\\\"${tagNode[value]}\\\"`;\n }\n });\n return text;\n}", "toString() {\n return this.key;\n }", "toString() {\n return `${this.constructor.name} [transforms=[${this.transforms.map(({ transform, inverse }) => {\n return inverse ? transform.inverse.toString() : transform.toString();\n })\n .join(\", \")}]]`;\n }", "getAttributeId(key) {\n\t\treturn `${this.options.propertyRoot}/properties/${key}`;\n\t}", "function keysToString(object) {\n //create new string to put new string into\n var string = \"\"; \n for (var key in object) { //loop over object\n string += key + ' '; //add the keys to the string var and a space\n }\n return string.trim(); //trims off the last space on the string\n}", "static _attributeNameForProperty(name, options) {\n const attribute = options.attribute;\n return attribute === false\n ? undefined\n : (typeof attribute === 'string'\n ? attribute\n : (typeof name === 'string' ? name.toLowerCase()\n : undefined));\n }", "get( key ) {\n return this.attributes[key];\n }", "translateKey(key) {\n switch(key) {\n case 'firstName':\n return 'First Name';\n case 'lastName':\n return 'Last Name';\n case 'companyName':\n return 'Company Name';\n case 'address1':\n return 'Address';\n case 'address2':\n return '';\n case 'city':\n return 'City';\n case 'state':\n return 'State';\n case 'postalCode':\n return 'Zip Code';\n case 'countryCode':\n return 'Country';\n case 'email':\n return 'Email';\n case 'phone':\n return 'Phone';\n default:\n return;\n }\n }", "_getAttr(key) {\r\n return this._data.attributes[key];\r\n }", "getAttributeByKey(key: string) {\n return this._attributeCollection.getAttributeByKey(key);\n }", "get asAttribute() {\n const keys = Array.from(this.classes.keys());\n return (keys.length ? ' class=\"' + escapeHTML(keys.join(' ')) + '\"' : '');\n }", "function composeKeyString(ev) {\n var alt = ev.altKey ? '-A': '',\n ctl = ev.ctrlKey ? '-C': '',\n meta = ev.metaKey ? '-M': '',\n shift = ev.shiftKey ? '-S': '',\n key = String(ev.which);\n return [key, alt, ctl, meta, shift].join('');\n }", "getCustomAttributes( data ){\n // only items which are objects have properties which can be used as attributes\n if( !isObject(data) )\n return '';\n\n var output = {}, propName;\n\n for( propName in data ){\n if( propName.slice(0,2) != '__' && propName != 'class' && data.hasOwnProperty(propName) && data[propName] !== undefined )\n output[propName] = escapeHTML(data[propName])\n }\n return output\n }", "function keysToString(object) {\n//I- object\n//O- string, with each key seperated by a space\n//C-\n//E-\n//for in loop again. \nlet string = \"\"\nfor (var key in object) {\n if(string === \"\") {\n string += key\n } else {\n string += \" \" + key\n}\n}\nreturn string\n}" ]
[ "0.6694932", "0.64469504", "0.6341036", "0.6306847", "0.63060904", "0.63060904", "0.62814486", "0.62814486", "0.62814486", "0.62704647", "0.62667257", "0.62106633", "0.6205157", "0.6205157", "0.6205157", "0.6205157", "0.61934173", "0.6192872", "0.6189862", "0.617363", "0.61694664", "0.61694664", "0.61694664", "0.61694664", "0.61694664", "0.6140819", "0.6133198", "0.59501123", "0.58990836", "0.5846569", "0.57990336", "0.5787047", "0.56065834", "0.5596362", "0.55955267", "0.5536936", "0.55082524", "0.5507995", "0.5488155", "0.54603297", "0.5452677", "0.5448597", "0.5448597", "0.5448597", "0.5448597", "0.5448597", "0.54455775", "0.5430335", "0.5420644", "0.5401495", "0.5391827", "0.53916633", "0.5378971", "0.5374853", "0.53421587", "0.5338463", "0.53300333", "0.5319164", "0.5315127", "0.53074497", "0.5300514", "0.5293625", "0.528937", "0.5262461", "0.52504516", "0.5247115", "0.5247115", "0.52415967", "0.5239541", "0.52363783", "0.5229378", "0.5218146", "0.5214468", "0.5209187", "0.5203949", "0.517621", "0.517621", "0.517621", "0.517621", "0.517621", "0.517621", "0.517621", "0.517621", "0.5172963", "0.51709884", "0.5170526", "0.5161348", "0.51606643", "0.5160661", "0.5154572", "0.51505035", "0.5147622", "0.51433194", "0.5143134", "0.5118597", "0.5112632", "0.51095873", "0.51063114", "0.5104594", "0.51025254" ]
0.7032027
0
Convert the TLS formatted distingished name object to the x509 libaray object
static convertTLSDistingishedName(distingishedName) { return { 'commonName': distingishedName['CN'], 'givenName': distingishedName['GN'], 'surname': distingishedName['SN'], 'initials': distingishedName['initials'], 'localityName': distingishedName['L'], 'stateOrProvinceName': distingishedName['ST'], 'countryName': distingishedName['C'], 'organizationName': distingishedName['O'], 'organizationalUnitName': distingishedName['OU'] }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSubjectString(cert, whose, extended) {\n if (typeof extended === 'undefined') {\n extended = false;\n }\n var c = Certificate.decode(new Buffer(cert), 'der');\n var fields;\n if (whose === 'issuer') {\n fields = c.tbsCertificate.issuer.value;\n } else if (whose === 'own') {\n fields = c.tbsCertificate.subject.value;\n }\n var cn_str = '';\n var o_str = '';\n var ou_str = '';\n for (var i = 0; i < fields.length; i++) {\n if (fields[i][0].type.toString() === [2, 5, 4, 3].toString()) {\n cn_str = 'CN=' + tlsn_utils.ba2str(fields[i][0].value.slice(2)) + '/';\n }\n if (fields[i][0].type.toString() === [2, 5, 4, 10].toString()) {\n o_str = 'O=' + tlsn_utils.ba2str(fields[i][0].value.slice(2)) + '/';\n }\n if (extended) {\n if (fields[i][0].type.toString() === [2, 5, 4, 11].toString()) {\n ou_str = 'OU=' + tlsn_utils.ba2str(fields[i][0].value.slice(2)) + '/';\n }\n //we have one root CA Autoridad de Certificacion Firmaprofesional CIF A62634068\n //which is distinguishable only by L=\n //we put the L= value into OU=\n if (ou_str === '') {\n if (fields[i][0].type.toString() === [2, 5, 4, 7].toString()) {\n ou_str = 'OU=' + tlsn_utils.ba2str(fields[i][0].value.slice(2)) + '/';\n }\n }\n }\n }\n if (!cn_str && !o_str) {\n return false;\n }\n return cn_str + o_str + ou_str;\n}", "function getSubjectString(cert, whose, extended){\n\tif (typeof(extended) === \"undefined\"){\n\t\textended = false;\n\t}\n\tvar c = Certificate.decode(new Buffer(cert), 'der');\n\tvar fields;\n\tif (whose === 'issuer'){\n\t\tfields = c.tbsCertificate.issuer.value;\n\t}\n\telse if (whose === 'own'){\n\t\tfields = c.tbsCertificate.subject.value;\n\t}\n\tvar cn_str = '';\n\tvar o_str = '';\n\tvar ou_str = '';\n\tfor(var i=0; i < fields.length; i++){\n\t if (fields[i][0].type.toString() === [2,5,4,3].toString()){\n\t\t cn_str = 'CN=' + ba2str(fields[i][0].value.slice(2)) + '/';\n\t }\n\t if (fields[i][0].type.toString() === [2,5,4,10].toString()){\n\t\t o_str = 'O=' + ba2str(fields[i][0].value.slice(2)) + '/';\n\t }\n\t if (extended){\n\t\t if (fields[i][0].type.toString() === [2,5,4,11].toString()){\n\t\t\t ou_str = 'OU=' + ba2str(fields[i][0].value.slice(2)) + '/';\n\t\t }\n\t\t //we have one root CA Autoridad de Certificacion Firmaprofesional CIF A62634068\n\t\t //which is distinguishable only by L=\n\t\t //we put the L= value into OU=\n\t\t if (ou_str === ''){\n\t\t\t if (fields[i][0].type.toString() === [2,5,4,7].toString()){\n\t\t\t\tou_str = 'OU=' + ba2str(fields[i][0].value.slice(2)) + '/';\n\t\t\t}\t\n\t\t }\n\t }\n\t}\n\tif (!cn_str && !o_str){\n\t return false;\n\t}\n\treturn cn_str+o_str+ou_str;\n}", "function X509(){this.subjectPublicKeyRSA=null;this.subjectPublicKeyRSA_hN=null;this.subjectPublicKeyRSA_hE=null;this.hex=null;this.getSerialNumberHex=function(){return ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,1])};this.getSignatureAlgorithmField=function(){var b=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,2,0]);var a=KJUR.asn1.ASN1Util.oidHexToInt(b);var c=KJUR.asn1.x509.OID.oid2name(a);return c};this.getIssuerHex=function(){return ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,3])};this.getIssuerString=function(){return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,3]))};this.getSubjectHex=function(){return ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,5])};this.getSubjectString=function(){return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,5]))};this.getNotBefore=function(){var a=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,4,0]);a=a.replace(/(..)/g,\"%$1\");a=decodeURIComponent(a);return a};this.getNotAfter=function(){var a=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,4,1]);a=a.replace(/(..)/g,\"%$1\");a=decodeURIComponent(a);return a};this.readCertPEM=function(c){var e=X509.pemToHex(c);var b=X509.getPublicKeyHexArrayFromCertHex(e);var d=new RSAKey();d.setPublic(b[0],b[1]);this.subjectPublicKeyRSA=d;this.subjectPublicKeyRSA_hN=b[0];this.subjectPublicKeyRSA_hE=b[1];this.hex=e};this.readCertPEMWithoutRSAInit=function(c){var d=X509.pemToHex(c);var b=X509.getPublicKeyHexArrayFromCertHex(d);if(typeof this.subjectPublicKeyRSA.setPublic===\"function\"){this.subjectPublicKeyRSA.setPublic(b[0],b[1])}this.subjectPublicKeyRSA_hN=b[0];this.subjectPublicKeyRSA_hE=b[1];this.hex=d};this.getInfo=function(){var p=\"Basic Fields\\n\";p+=\" serial number: \"+this.getSerialNumberHex()+\"\\n\";p+=\" signature algorithm: \"+this.getSignatureAlgorithmField()+\"\\n\";p+=\" issuer: \"+this.getIssuerString()+\"\\n\";p+=\" notBefore: \"+this.getNotBefore()+\"\\n\";p+=\" notAfter: \"+this.getNotAfter()+\"\\n\";p+=\" subject: \"+this.getSubjectString()+\"\\n\";p+=\" subject public key info: \\n\";var j=X509.getSubjectPublicKeyInfoPosFromCertHex(this.hex);var d=ASN1HEX.getHexOfTLV_AtObj(this.hex,j);var n=KEYUTIL.getKey(d,null,\"pkcs8pub\");if(n instanceof RSAKey){p+=\" key algorithm: RSA\\n\";p+=\" n=\"+n.n.toString(16).substr(0,16)+\"...\\n\";p+=\" e=\"+n.e.toString(16)+\"\\n\"}p+=\"X509v3 Extensions:\\n\";var m=X509.getV3ExtInfoListOfCertHex(this.hex);for(var e=0;e<m.length;e++){var b=m[e];var o=KJUR.asn1.x509.OID.oid2name(b.oid);if(o===\"\"){o=b.oid}var k=\"\";if(b.critical===true){k=\"CRITICAL\"}p+=\" \"+o+\" \"+k+\":\\n\";if(o===\"basicConstraints\"){var g=X509.getExtBasicConstraints(this.hex);if(g.cA===undefined){p+=\" {}\\n\"}else{p+=\" cA=true\";if(g.pathLen!==undefined){p+=\", pathLen=\"+g.pathLen}p+=\"\\n\"}}else{if(o===\"keyUsage\"){p+=\" \"+X509.getExtKeyUsageString(this.hex)+\"\\n\"}else{if(o===\"subjectKeyIdentifier\"){p+=\" \"+X509.getExtSubjectKeyIdentifier(this.hex)+\"\\n\"}else{if(o===\"authorityKeyIdentifier\"){var a=X509.getExtAuthorityKeyIdentifier(this.hex);if(a.kid!==undefined){p+=\" kid=\"+a.kid+\"\\n\"}}else{if(o===\"extKeyUsage\"){var h=X509.getExtExtKeyUsageName(this.hex);p+=\" \"+h.join(\", \")+\"\\n\"}else{if(o===\"subjectAltName\"){var f=X509.getExtSubjectAltName(this.hex);p+=\" \"+f.join(\", \")+\"\\n\"}else{if(o===\"cRLDistributionPoints\"){var l=X509.getExtCRLDistributionPointsURI(this.hex);p+=\" \"+l+\"\\n\"}else{if(o===\"authorityInfoAccess\"){var c=X509.getExtAIAInfo(this.hex);if(c.ocsp!==undefined){p+=\" ocsp: \"+c.ocsp.join(\",\")+\"\\n\"}if(c.caissuer!==undefined){p+=\" caissuer: \"+c.caissuer.join(\",\")+\"\\n\"}}}}}}}}}}p+=\"signature algorithm: \"+X509.getSignatureAlgorithmName(this.hex)+\"\\n\";p+=\"signature: \"+X509.getSignatureValueHex(this.hex).substr(0,16)+\"...\\n\";return p}}", "function X509(){this.subjectPublicKeyRSA=null;this.subjectPublicKeyRSA_hN=null;this.subjectPublicKeyRSA_hE=null;this.hex=null;this.getSerialNumberHex=function(){return ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,1])};this.getSignatureAlgorithmField=function(){var b=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,2,0]);var a=KJUR.asn1.ASN1Util.oidHexToInt(b);var c=KJUR.asn1.x509.OID.oid2name(a);return c};this.getIssuerHex=function(){return ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,3])};this.getIssuerString=function(){return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,3]))};this.getSubjectHex=function(){return ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,5])};this.getSubjectString=function(){return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,5]))};this.getNotBefore=function(){var a=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,4,0]);a=a.replace(/(..)/g,\"%$1\");a=decodeURIComponent(a);return a};this.getNotAfter=function(){var a=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,4,1]);a=a.replace(/(..)/g,\"%$1\");a=decodeURIComponent(a);return a};this.readCertPEM=function(c){var e=X509.pemToHex(c);var b=X509.getPublicKeyHexArrayFromCertHex(e);var d=new RSAKey();d.setPublic(b[0],b[1]);this.subjectPublicKeyRSA=d;this.subjectPublicKeyRSA_hN=b[0];this.subjectPublicKeyRSA_hE=b[1];this.hex=e};this.readCertPEMWithoutRSAInit=function(c){var d=X509.pemToHex(c);var b=X509.getPublicKeyHexArrayFromCertHex(d);if(typeof this.subjectPublicKeyRSA.setPublic===\"function\"){this.subjectPublicKeyRSA.setPublic(b[0],b[1])}this.subjectPublicKeyRSA_hN=b[0];this.subjectPublicKeyRSA_hE=b[1];this.hex=d};this.getInfo=function(){var p=\"Basic Fields\\n\";p+=\" serial number: \"+this.getSerialNumberHex()+\"\\n\";p+=\" signature algorithm: \"+this.getSignatureAlgorithmField()+\"\\n\";p+=\" issuer: \"+this.getIssuerString()+\"\\n\";p+=\" notBefore: \"+this.getNotBefore()+\"\\n\";p+=\" notAfter: \"+this.getNotAfter()+\"\\n\";p+=\" subject: \"+this.getSubjectString()+\"\\n\";p+=\" subject public key info: \\n\";var j=X509.getSubjectPublicKeyInfoPosFromCertHex(this.hex);var d=ASN1HEX.getHexOfTLV_AtObj(this.hex,j);var n=KEYUTIL.getKey(d,null,\"pkcs8pub\");if(n instanceof RSAKey){p+=\" key algorithm: RSA\\n\";p+=\" n=\"+n.n.toString(16).substr(0,16)+\"...\\n\";p+=\" e=\"+n.e.toString(16)+\"\\n\"}p+=\"X509v3 Extensions:\\n\";var m=X509.getV3ExtInfoListOfCertHex(this.hex);for(var e=0;e<m.length;e++){var b=m[e];var o=KJUR.asn1.x509.OID.oid2name(b.oid);if(o===\"\"){o=b.oid}var k=\"\";if(b.critical===true){k=\"CRITICAL\"}p+=\" \"+o+\" \"+k+\":\\n\";if(o===\"basicConstraints\"){var g=X509.getExtBasicConstraints(this.hex);if(g.cA===undefined){p+=\" {}\\n\"}else{p+=\" cA=true\";if(g.pathLen!==undefined){p+=\", pathLen=\"+g.pathLen}p+=\"\\n\"}}else{if(o===\"keyUsage\"){p+=\" \"+X509.getExtKeyUsageString(this.hex)+\"\\n\"}else{if(o===\"subjectKeyIdentifier\"){p+=\" \"+X509.getExtSubjectKeyIdentifier(this.hex)+\"\\n\"}else{if(o===\"authorityKeyIdentifier\"){var a=X509.getExtAuthorityKeyIdentifier(this.hex);if(a.kid!==undefined){p+=\" kid=\"+a.kid+\"\\n\"}}else{if(o===\"extKeyUsage\"){var h=X509.getExtExtKeyUsageName(this.hex);p+=\" \"+h.join(\", \")+\"\\n\"}else{if(o===\"subjectAltName\"){var f=X509.getExtSubjectAltName(this.hex);p+=\" \"+f.join(\", \")+\"\\n\"}else{if(o===\"cRLDistributionPoints\"){var l=X509.getExtCRLDistributionPointsURI(this.hex);p+=\" \"+l+\"\\n\"}else{if(o===\"authorityInfoAccess\"){var c=X509.getExtAIAInfo(this.hex);if(c.ocsp!==undefined){p+=\" ocsp: \"+c.ocsp.join(\",\")+\"\\n\"}if(c.caissuer!==undefined){p+=\" caissuer: \"+c.caissuer.join(\",\")+\"\\n\"}}}}}}}}}}p+=\"signature algorithm: \"+X509.getSignatureAlgorithmName(this.hex)+\"\\n\";p+=\"signature: \"+X509.getSignatureValueHex(this.hex).substr(0,16)+\"...\\n\";return p}}", "function _x509_getSubjectString() {\n return _x509_hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex, 0, [0, 5]));\n}", "function $n(){this.subjectPublicKeyRSA=null,this.subjectPublicKeyRSA_hN=null,this.subjectPublicKeyRSA_hE=null,this.hex=null,this.getSerialNumberHex=function(){return Or.getDecendantHexVByNthList(this.hex,0,[0,1])},this.getSignatureAlgorithmField=function(){var t=Or.getDecendantHexVByNthList(this.hex,0,[0,2,0]),e=Cr.asn1.ASN1Util.oidHexToInt(t),n=Cr.asn1.x509.OID.oid2name(e);return n},this.getIssuerHex=function(){return Or.getDecendantHexTLVByNthList(this.hex,0,[0,3])},this.getIssuerString=function(){return $n.hex2dn(Or.getDecendantHexTLVByNthList(this.hex,0,[0,3]))},this.getSubjectHex=function(){return Or.getDecendantHexTLVByNthList(this.hex,0,[0,5])},this.getSubjectString=function(){return $n.hex2dn(Or.getDecendantHexTLVByNthList(this.hex,0,[0,5]))},this.getNotBefore=function(){var t=Or.getDecendantHexVByNthList(this.hex,0,[0,4,0]);return t=t.replace(/(..)/g,\"%$1\"),t=decodeURIComponent(t)},this.getNotAfter=function(){var t=Or.getDecendantHexVByNthList(this.hex,0,[0,4,1]);return t=t.replace(/(..)/g,\"%$1\"),t=decodeURIComponent(t)},this.readCertPEM=function(t){var e=$n.pemToHex(t),n=$n.getPublicKeyHexArrayFromCertHex(e),r=new ve;r.setPublic(n[0],n[1]),this.subjectPublicKeyRSA=r,this.subjectPublicKeyRSA_hN=n[0],this.subjectPublicKeyRSA_hE=n[1],this.hex=e},this.readCertPEMWithoutRSAInit=function(t){var e=$n.pemToHex(t),n=$n.getPublicKeyHexArrayFromCertHex(e);this.subjectPublicKeyRSA.setPublic(n[0],n[1]),this.subjectPublicKeyRSA_hN=n[0],this.subjectPublicKeyRSA_hE=n[1],this.hex=e},this.getInfo=function(){var t=\"Basic Fields\\n\";t+=\" serial number: \"+this.getSerialNumberHex()+\"\\n\",t+=\" signature algorithm: \"+this.getSignatureAlgorithmField()+\"\\n\",t+=\" issuer: \"+this.getIssuerString()+\"\\n\",t+=\" notBefore: \"+this.getNotBefore()+\"\\n\",t+=\" notAfter: \"+this.getNotAfter()+\"\\n\",t+=\" subject: \"+this.getSubjectString()+\"\\n\",t+=\" subject public key info: \\n\";var e=$n.getSubjectPublicKeyInfoPosFromCertHex(this.hex),n=Or.getHexOfTLV_AtObj(this.hex,e),r=Rr.getKey(n,null,\"pkcs8pub\");r instanceof ve&&(t+=\" key algorithm: RSA\\n\",t+=\" n=\"+r.n.toString(16).substr(0,16)+\"...\\n\",t+=\" e=\"+r.e.toString(16)+\"\\n\"),t+=\"X509v3 Extensions:\\n\";for(var i=$n.getV3ExtInfoListOfCertHex(this.hex),s=0;s<i.length;s++){var o=i[s],a=Cr.asn1.x509.OID.oid2name(o.oid);\"\"===a&&(a=o.oid);var u=\"\";if(o.critical===!0&&(u=\"CRITICAL\"),t+=\" \"+a+\" \"+u+\":\\n\",\"basicConstraints\"===a){var h=$n.getExtBasicConstraints(this.hex);void 0===h.cA?t+=\" {}\\n\":(t+=\" cA=true\",void 0!==h.pathLen&&(t+=\", pathLen=\"+h.pathLen),t+=\"\\n\")}else if(\"keyUsage\"===a)t+=\" \"+$n.getExtKeyUsageString(this.hex)+\"\\n\";else if(\"subjectKeyIdentifier\"===a)t+=\" \"+$n.getExtSubjectKeyIdentifier(this.hex)+\"\\n\";else if(\"authorityKeyIdentifier\"===a){var c=$n.getExtAuthorityKeyIdentifier(this.hex);void 0!==c.kid&&(t+=\" kid=\"+c.kid+\"\\n\")}else if(\"extKeyUsage\"===a){var f=$n.getExtExtKeyUsageName(this.hex);t+=\" \"+f.join(\", \")+\"\\n\"}else if(\"subjectAltName\"===a){var l=$n.getExtSubjectAltName(this.hex);t+=\" \"+l.join(\", \")+\"\\n\"}else if(\"cRLDistributionPoints\"===a){var d=$n.getExtCRLDistributionPointsURI(this.hex);t+=\" \"+d+\"\\n\"}else if(\"authorityInfoAccess\"===a){var g=$n.getExtAIAInfo(this.hex);void 0!==g.ocsp&&(t+=\" ocsp: \"+g.ocsp.join(\",\")+\"\\n\"),void 0!==g.caissuer&&(t+=\" caissuer: \"+g.caissuer.join(\",\")+\"\\n\")}}return t+=\"signature algorithm: \"+$n.getSignatureAlgorithmName(this.hex)+\"\\n\",t+=\"signature: \"+$n.getSignatureValueHex(this.hex).substr(0,16)+\"...\\n\"}}", "function fixcerts() {\n var tmpcerts = { 'trusted_pubkeys': [] };\n for (var key in certs) {\n var certpem = certs[key];\n var certder = pem2der(certpem);\n //getfield(certder);\n var subj = getSubjectString(certder, 'own');\n if (tmpcerts.hasOwnProperty(subj)) {\n //Duplicate found. Rename the existing entry and the duplicate\n //with extended subject\n //console.log('adding duplicate:', subj);\n var pem_one = tmpcerts[subj];\n var der_one = pem2der(pem_one);\n var subj_one = getSubjectString(der_one, 'own', true);\n tmpcerts[subj_one] = pem_one;\n delete tmpcerts[subj];\n var subj_two = getSubjectString(certder, 'own', true);\n subj = subj_two;\n }\n tmpcerts[subj] = certpem;\n var pk = getPubkey(certder);\n tmpcerts['trusted_pubkeys'].push(tlsn_utils.b64encode(tlsn_utils.ua2ba(pk)));\n }\n certs = tmpcerts;\n}", "function cert (token) {\n const parsed = jwt.decode(token, {complete: true, json: true})\n if (parsed && parsed.header.x5c) { return '-----BEGIN CERTIFICATE-----\\n' + parsed.header.x5c[0] + '\\n-----END CERTIFICATE-----' } else { return '' }\n}", "function cfnCertificateEdiPartyNamePropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnCertificate_EdiPartyNamePropertyValidator(properties).assertSuccess();\n return {\n NameAssigner: cdk.stringToCloudFormation(properties.nameAssigner),\n PartyName: cdk.stringToCloudFormation(properties.partyName),\n };\n}", "function convertCertificate (cert) {\n var beginCert = \"-----BEGIN CERTIFICATE-----\"\n var endCert = \"-----END CERTIFICATE-----\"\n\n cert = cert.replace(\"\\n\", \"\")\n cert = cert.replace(beginCert, \"\")\n cert = cert.replace(endCert, \"\")\n\n var result = beginCert\n while (cert.length > 0) {\n\n if (cert.length > 64) {\n result += \"\\n\" + cert.substring(0, 64)\n cert = cert.substring(64, cert.length)\n }\n else {\n result += \"\\n\" + cert\n cert = \"\"\n }\n }\n\n if (result[result.length ] != \"\\n\")\n result += \"\\n\"\n result += endCert + \"\\n\"\n return result\n}", "function _signerFromAsn1(obj) {\n // validate EnvelopedData content block and capture data\n var capture = {};\n var errors = [];\n if(!asn1.validate(obj, p7.asn1.signerInfoValidator, capture, errors)) {\n var error = new Error('Cannot read PKCS#7 SignerInfo. ' +\n 'ASN.1 object is not an PKCS#7 SignerInfo.');\n error.errors = errors;\n throw error;\n }\n\n var rval = {\n version: capture.version.charCodeAt(0),\n issuer: forge.pki.RDNAttributesAsArray(capture.issuer),\n serialNumber: forge.util.createBuffer(capture.serial).toHex(),\n digestAlgorithm: asn1.derToOid(capture.digestAlgorithm),\n signatureAlgorithm: asn1.derToOid(capture.signatureAlgorithm),\n signature: capture.signature,\n authenticatedAttributes: [],\n unauthenticatedAttributes: []\n };\n\n // TODO: convert attributes\n var authenticatedAttributes = capture.authenticatedAttributes || [];\n var unauthenticatedAttributes = capture.unauthenticatedAttributes || [];\n\n return rval;\n}", "function _signerFromAsn1(obj) {\n // validate EnvelopedData content block and capture data\n var capture = {};\n var errors = [];\n if(!asn1.validate(obj, p7.asn1.signerInfoValidator, capture, errors)) {\n var error = new Error('Cannot read PKCS#7 SignerInfo. ' +\n 'ASN.1 object is not an PKCS#7 SignerInfo.');\n error.errors = errors;\n throw error;\n }\n\n var rval = {\n version: capture.version.charCodeAt(0),\n issuer: forge.pki.RDNAttributesAsArray(capture.issuer),\n serialNumber: forge.util.createBuffer(capture.serial).toHex(),\n digestAlgorithm: asn1.derToOid(capture.digestAlgorithm),\n signatureAlgorithm: asn1.derToOid(capture.signatureAlgorithm),\n signature: capture.signature,\n authenticatedAttributes: [],\n unauthenticatedAttributes: []\n };\n\n // TODO: convert attributes\n var authenticatedAttributes = capture.authenticatedAttributes || [];\n var unauthenticatedAttributes = capture.unauthenticatedAttributes || [];\n\n return rval;\n}", "function _signerFromAsn1(obj) {\n // validate EnvelopedData content block and capture data\n var capture = {};\n var errors = [];\n if(!asn1.validate(obj, p7.asn1.signerInfoValidator, capture, errors)) {\n var error = new Error('Cannot read PKCS#7 SignerInfo. ' +\n 'ASN.1 object is not an PKCS#7 SignerInfo.');\n error.errors = errors;\n throw error;\n }\n\n var rval = {\n version: capture.version.charCodeAt(0),\n issuer: forge.pki.RDNAttributesAsArray(capture.issuer),\n serialNumber: forge.util.createBuffer(capture.serial).toHex(),\n digestAlgorithm: asn1.derToOid(capture.digestAlgorithm),\n signatureAlgorithm: asn1.derToOid(capture.signatureAlgorithm),\n signature: capture.signature,\n authenticatedAttributes: [],\n unauthenticatedAttributes: []\n };\n\n // TODO: convert attributes\n var authenticatedAttributes = capture.authenticatedAttributes || [];\n var unauthenticatedAttributes = capture.unauthenticatedAttributes || [];\n\n return rval;\n}", "function _signerFromAsn1(obj) {\n // validate EnvelopedData content block and capture data\n var capture = {};\n var errors = [];\n if(!asn1.validate(obj, p7.asn1.signerInfoValidator, capture, errors)) {\n var error = new Error('Cannot read PKCS#7 SignerInfo. ' +\n 'ASN.1 object is not an PKCS#7 SignerInfo.');\n error.errors = errors;\n throw error;\n }\n\n var rval = {\n version: capture.version.charCodeAt(0),\n issuer: forge.pki.RDNAttributesAsArray(capture.issuer),\n serialNumber: forge.util.createBuffer(capture.serial).toHex(),\n digestAlgorithm: asn1.derToOid(capture.digestAlgorithm),\n signatureAlgorithm: asn1.derToOid(capture.signatureAlgorithm),\n signature: capture.signature,\n authenticatedAttributes: [],\n unauthenticatedAttributes: []\n };\n\n // TODO: convert attributes\n var authenticatedAttributes = capture.authenticatedAttributes || [];\n var unauthenticatedAttributes = capture.unauthenticatedAttributes || [];\n\n return rval;\n}", "function cfnCertificateAuthorityGeneralNamePropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnCertificateAuthority_GeneralNamePropertyValidator(properties).assertSuccess();\n return {\n DirectoryName: cfnCertificateAuthoritySubjectPropertyToCloudFormation(properties.directoryName),\n DnsName: cdk.stringToCloudFormation(properties.dnsName),\n EdiPartyName: cfnCertificateAuthorityEdiPartyNamePropertyToCloudFormation(properties.ediPartyName),\n IpAddress: cdk.stringToCloudFormation(properties.ipAddress),\n OtherName: cfnCertificateAuthorityOtherNamePropertyToCloudFormation(properties.otherName),\n RegisteredId: cdk.stringToCloudFormation(properties.registeredId),\n Rfc822Name: cdk.stringToCloudFormation(properties.rfc822Name),\n UniformResourceIdentifier: cdk.stringToCloudFormation(properties.uniformResourceIdentifier),\n };\n}", "function cfnCertificateGeneralNamePropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnCertificate_GeneralNamePropertyValidator(properties).assertSuccess();\n return {\n DirectoryName: cfnCertificateSubjectPropertyToCloudFormation(properties.directoryName),\n DnsName: cdk.stringToCloudFormation(properties.dnsName),\n EdiPartyName: cfnCertificateEdiPartyNamePropertyToCloudFormation(properties.ediPartyName),\n IpAddress: cdk.stringToCloudFormation(properties.ipAddress),\n OtherName: cfnCertificateOtherNamePropertyToCloudFormation(properties.otherName),\n RegisteredId: cdk.stringToCloudFormation(properties.registeredId),\n Rfc822Name: cdk.stringToCloudFormation(properties.rfc822Name),\n UniformResourceIdentifier: cdk.stringToCloudFormation(properties.uniformResourceIdentifier),\n };\n}", "function _signerToAsn1(obj) {\n\t // SignerInfo\n\t var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n\t // version\n\t asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n\t asn1.integerToDer(obj.version).getBytes()),\n\t // issuerAndSerialNumber\n\t asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n\t // name\n\t forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}),\n\t // serial\n\t asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n\t forge.util.hexToBytes(obj.serialNumber))\n\t ]),\n\t // digestAlgorithm\n\t asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n\t // algorithm\n\t asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n\t asn1.oidToDer(obj.digestAlgorithm).getBytes()),\n\t // parameters (null)\n\t asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n\t ])\n\t ]);\n\n\t // authenticatedAttributes (OPTIONAL)\n\t if(obj.authenticatedAttributesAsn1) {\n\t // add ASN.1 previously generated during signing\n\t rval.value.push(obj.authenticatedAttributesAsn1);\n\t }\n\n\t // digestEncryptionAlgorithm\n\t rval.value.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n\t // algorithm\n\t asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n\t asn1.oidToDer(obj.signatureAlgorithm).getBytes()),\n\t // parameters (null)\n\t asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n\t ]));\n\n\t // encryptedDigest\n\t rval.value.push(asn1.create(\n\t asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, obj.signature));\n\n\t // unauthenticatedAttributes (OPTIONAL)\n\t if(obj.unauthenticatedAttributes.length > 0) {\n\t // [1] IMPLICIT\n\t var attrsAsn1 = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, []);\n\t for(var i = 0; i < obj.unauthenticatedAttributes.length; ++i) {\n\t var attr = obj.unauthenticatedAttributes[i];\n\t attrsAsn1.values.push(_attributeToAsn1(attr));\n\t }\n\t rval.value.push(attrsAsn1);\n\t }\n\n\t return rval;\n\t}", "static initialize(obj, certIssuerName, certUsername) { \n obj['cert-issuer-name'] = certIssuerName;\n obj['cert-username'] = certUsername;\n }", "function fixcerts(){\n\tvar tmpcerts = {'trusted_pubkeys':[]};\n\tvar i = 0;\n\tfor (var key in certs){\n\t\ti += 1;\n\t\tvar certpem = certs[key];\n\t\tvar certder = pem2der(certpem);\n\t\t//getfield(certder);\n\t\tvar subj = getSubjectString(certder, 'own');\n\t\tif (tmpcerts.hasOwnProperty(subj)){\n\t\t //Duplicate found. Rename the existing entry and the duplicate\n\t\t //with extended subject\n\t\t //console.log('adding duplicate:', subj);\n\t\t var pem_one = tmpcerts[subj];\n\t\t var der_one = pem2der(pem_one);\n\t\t var subj_one = getSubjectString(der_one, 'own', true);\n\t\t tmpcerts[subj_one] = pem_one;\n\t\t delete tmpcerts[subj];\n\t\t var subj_two = getSubjectString(certder, 'own', true);\n\t\t subj = subj_two;\n\t\t}\n\t\ttmpcerts[subj] = certpem;\n\t\tvar pk = getPubkey(certder);\n\t\ttmpcerts['trusted_pubkeys'].push(b64encode(ua2ba(pk)));\n\t}\n\tcerts = tmpcerts;\t\n}", "function _signerToAsn1(obj) {\n // SignerInfo\n var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // version\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n asn1.integerToDer(obj.version).getBytes()),\n // issuerAndSerialNumber\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // name\n forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}),\n // serial\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n forge.util.hexToBytes(obj.serialNumber))\n ]),\n // digestAlgorithm\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // algorithm\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(obj.digestAlgorithm).getBytes()),\n // parameters (null)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n ])\n ]);\n\n // authenticatedAttributes (OPTIONAL)\n if(obj.authenticatedAttributesAsn1) {\n // add ASN.1 previously generated during signing\n rval.value.push(obj.authenticatedAttributesAsn1);\n }\n\n // digestEncryptionAlgorithm\n rval.value.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // algorithm\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(obj.signatureAlgorithm).getBytes()),\n // parameters (null)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n ]));\n\n // encryptedDigest\n rval.value.push(asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, obj.signature));\n\n // unauthenticatedAttributes (OPTIONAL)\n if(obj.unauthenticatedAttributes.length > 0) {\n // [1] IMPLICIT\n var attrsAsn1 = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, []);\n for(var i = 0; i < obj.unauthenticatedAttributes.length; ++i) {\n var attr = obj.unauthenticatedAttributes[i];\n attrsAsn1.values.push(_attributeToAsn1(attr));\n }\n rval.value.push(attrsAsn1);\n }\n\n return rval;\n}", "function _signerToAsn1(obj) {\n // SignerInfo\n var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // version\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n asn1.integerToDer(obj.version).getBytes()),\n // issuerAndSerialNumber\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // name\n forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}),\n // serial\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n forge.util.hexToBytes(obj.serialNumber))\n ]),\n // digestAlgorithm\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // algorithm\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(obj.digestAlgorithm).getBytes()),\n // parameters (null)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n ])\n ]);\n\n // authenticatedAttributes (OPTIONAL)\n if(obj.authenticatedAttributesAsn1) {\n // add ASN.1 previously generated during signing\n rval.value.push(obj.authenticatedAttributesAsn1);\n }\n\n // digestEncryptionAlgorithm\n rval.value.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // algorithm\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(obj.signatureAlgorithm).getBytes()),\n // parameters (null)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n ]));\n\n // encryptedDigest\n rval.value.push(asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, obj.signature));\n\n // unauthenticatedAttributes (OPTIONAL)\n if(obj.unauthenticatedAttributes.length > 0) {\n // [1] IMPLICIT\n var attrsAsn1 = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, []);\n for(var i = 0; i < obj.unauthenticatedAttributes.length; ++i) {\n var attr = obj.unauthenticatedAttributes[i];\n attrsAsn1.values.push(_attributeToAsn1(attr));\n }\n rval.value.push(attrsAsn1);\n }\n\n return rval;\n}", "function _signerToAsn1(obj) {\n // SignerInfo\n var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // version\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n asn1.integerToDer(obj.version).getBytes()),\n // issuerAndSerialNumber\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // name\n forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}),\n // serial\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n forge.util.hexToBytes(obj.serialNumber))\n ]),\n // digestAlgorithm\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // algorithm\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(obj.digestAlgorithm).getBytes()),\n // parameters (null)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n ])\n ]);\n\n // authenticatedAttributes (OPTIONAL)\n if(obj.authenticatedAttributesAsn1) {\n // add ASN.1 previously generated during signing\n rval.value.push(obj.authenticatedAttributesAsn1);\n }\n\n // digestEncryptionAlgorithm\n rval.value.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // algorithm\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(obj.signatureAlgorithm).getBytes()),\n // parameters (null)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n ]));\n\n // encryptedDigest\n rval.value.push(asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, obj.signature));\n\n // unauthenticatedAttributes (OPTIONAL)\n if(obj.unauthenticatedAttributes.length > 0) {\n // [1] IMPLICIT\n var attrsAsn1 = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, []);\n for(var i = 0; i < obj.unauthenticatedAttributes.length; ++i) {\n var attr = obj.unauthenticatedAttributes[i];\n attrsAsn1.values.push(_attributeToAsn1(attr));\n }\n rval.value.push(attrsAsn1);\n }\n\n return rval;\n}", "function _signerToAsn1(obj) {\n // SignerInfo\n var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // version\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n asn1.integerToDer(obj.version).getBytes()),\n // issuerAndSerialNumber\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // name\n forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}),\n // serial\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n forge.util.hexToBytes(obj.serialNumber))\n ]),\n // digestAlgorithm\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // algorithm\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(obj.digestAlgorithm).getBytes()),\n // parameters (null)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n ])\n ]);\n\n // authenticatedAttributes (OPTIONAL)\n if(obj.authenticatedAttributesAsn1) {\n // add ASN.1 previously generated during signing\n rval.value.push(obj.authenticatedAttributesAsn1);\n }\n\n // digestEncryptionAlgorithm\n rval.value.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // algorithm\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(obj.signatureAlgorithm).getBytes()),\n // parameters (null)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n ]));\n\n // encryptedDigest\n rval.value.push(asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, obj.signature));\n\n // unauthenticatedAttributes (OPTIONAL)\n if(obj.unauthenticatedAttributes.length > 0) {\n // [1] IMPLICIT\n var attrsAsn1 = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, []);\n for(var i = 0; i < obj.unauthenticatedAttributes.length; ++i) {\n var attr = obj.unauthenticatedAttributes[i];\n attrsAsn1.values.push(_attributeToAsn1(attr));\n }\n rval.value.push(attrsAsn1);\n }\n\n return rval;\n}", "function compare_dNSName(name, constraint)\n {\n /// <summary>Compare two dNSName values</summary>\n /// <param name=\"name\" type=\"String\">DNS from name</param>\n /// <param name=\"constraint\" type=\"String\">Constraint for DNS from name</param>\n /// <returns type=\"Boolean\">Boolean result - valid or invalid the \"name\" against the \"constraint\"</returns>\n\n // #region Make a \"string preparation\" for both name and constrain \n var name_prepared = in_window.org.pkijs.stringPrep(name);\n var constraint_prepared = in_window.org.pkijs.stringPrep(constraint);\n // #endregion \n\n // #region Make a \"splitted\" versions of \"constraint\" and \"name\" \n var name_splitted = name_prepared.split(\".\");\n var constraint_splitted = constraint_prepared.split(\".\");\n // #endregion \n\n // #region Length calculation and additional check \n var name_len = name_splitted.length;\n var constr_len = constraint_splitted.length;\n\n if((name_len === 0) || (constr_len === 0) || (name_len < constr_len))\n return false;\n // #endregion \n\n // #region Check that no part of \"name\" has zero length \n for(var i = 0; i < name_len; i++)\n {\n if(name_splitted[i].length === 0)\n return false;\n }\n // #endregion \n\n // #region Check that no part of \"constraint\" has zero length\n for(var i = 0; i < constr_len; i++)\n {\n if(constraint_splitted[i].length === 0)\n {\n if(i === 0)\n {\n if(constr_len === 1)\n return false;\n else\n continue;\n }\n\n return false;\n }\n }\n // #endregion \n\n // #region Check that \"name\" has a tail as \"constraint\" \n\n for(var i = 0; i < constr_len; i++)\n {\n if(constraint_splitted[constr_len - 1 - i].length === 0)\n continue;\n\n if(name_splitted[name_len - 1 - i].localeCompare(constraint_splitted[constr_len - 1 - i]) !== 0)\n return false;\n }\n // #endregion \n\n return true;\n }", "static get(name, id, state) {\n return new Certificate(name, state, { id });\n }", "function cfnCertificateAuthorityEdiPartyNamePropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnCertificateAuthority_EdiPartyNamePropertyValidator(properties).assertSuccess();\n return {\n NameAssigner: cdk.stringToCloudFormation(properties.nameAssigner),\n PartyName: cdk.stringToCloudFormation(properties.partyName),\n };\n}", "function comparableCertificate(certificate) {\n return {\n data: certificate.data.toString(),\n issuerName: certificate.issuerName,\n };\n}", "function CertificateAuthority(countryName, stateOrProvinceName, organizationName, commonName, verbose) {\n var _this = this;\n this.countryName = countryName;\n this.stateOrProvinceName = stateOrProvinceName;\n this.organizationName = organizationName;\n this.commonName = commonName;\n this.verbose = verbose;\n this._caCertificate = Q.nfcall(mkdirp, CertificateAuthority.keyDir).then(function () {\n return Q.all([\n Q.nfcall(fs.stat, _this.keyFile),\n Q.nfcall(fs.stat, _this.caCertFile)\n ]);\n }).catch(function () {\n var req = childProcess.spawn('openssl', [\n 'req',\n '-newkey',\n 'rsa:2048',\n '-sha256',\n '-subj',\n util.format('/C=%s/ST=%s/O=%s/CN=%s', _this.countryName, _this.stateOrProvinceName, _this.organizationName, _this.commonName),\n '-nodes',\n '-keyout',\n _this.keyFile\n ], { stdio: verbose ? [null, null, process.stderr] : null });\n var sign = childProcess.spawn('openssl', ['x509', '-req', '-signkey', _this.keyFile, '-out', _this.caCertFile], { stdio: verbose ? [null, process.stdout, process.stderr] : null });\n req.stdout.pipe(sign.stdin);\n return Q.Promise(function (resolve, reject) {\n req.on('close', function (code) {\n if (code != 0) {\n reject(new Error('CA request process exited with code ' + code));\n }\n });\n sign.on('close', function (code) {\n if (code == 0) {\n resolve(code);\n }\n else {\n reject(new Error('CA signing process exited with code ' + code));\n }\n });\n });\n }).then(function () {\n return [\n Q.nfcall(fs.readFile, _this.keyFile),\n Q.nfcall(fs.readFile, _this.caCertFile)\n ];\n }).spread(function (privateKey, certificate) {\n return {\n privateKey: '' + privateKey,\n certificate: '' + certificate\n };\n });\n }", "function buildTlsOpts(node_obj) {\n\t\tlet ret = {\n\t\t\t'ssl-target-name-override': null,\n\t\t\tpem: null\n\t\t};\n\t\tif (node_obj) {\n\t\t\tif (node_obj.tlsCACerts) {\n\t\t\t\tret.pem = loadPem(node_obj.tlsCACerts);\n\t\t\t}\n\t\t\tif (node_obj.grpcOptions) {\n\t\t\t\tret['ssl-target-name-override'] = node_obj.grpcOptions['ssl-target-name-override'];\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "static get(name, id, state, opts) {\n return new Certificate(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "function _recipientToAsn1(obj) {\n return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // Version\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n asn1.integerToDer(obj.version).getBytes()),\n // IssuerAndSerialNumber\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // Name\n forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}),\n // Serial\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n forge.util.hexToBytes(obj.serialNumber))\n ]),\n // KeyEncryptionAlgorithmIdentifier\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // Algorithm\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(obj.encryptedContent.algorithm).getBytes()),\n // Parameter, force NULL, only RSA supported for now.\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n ]),\n // EncryptedKey\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,\n obj.encryptedContent.content)\n ]);\n}", "function _recipientToAsn1(obj) {\n return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // Version\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n asn1.integerToDer(obj.version).getBytes()),\n // IssuerAndSerialNumber\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // Name\n forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}),\n // Serial\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n forge.util.hexToBytes(obj.serialNumber))\n ]),\n // KeyEncryptionAlgorithmIdentifier\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // Algorithm\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(obj.encryptedContent.algorithm).getBytes()),\n // Parameter, force NULL, only RSA supported for now.\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n ]),\n // EncryptedKey\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,\n obj.encryptedContent.content)\n ]);\n}", "function _recipientToAsn1(obj) {\n return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // Version\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n asn1.integerToDer(obj.version).getBytes()),\n // IssuerAndSerialNumber\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // Name\n forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}),\n // Serial\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n forge.util.hexToBytes(obj.serialNumber))\n ]),\n // KeyEncryptionAlgorithmIdentifier\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // Algorithm\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(obj.encryptedContent.algorithm).getBytes()),\n // Parameter, force NULL, only RSA supported for now.\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n ]),\n // EncryptedKey\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,\n obj.encryptedContent.content)\n ]);\n}", "function _recipientToAsn1(obj) {\n return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // Version\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n asn1.integerToDer(obj.version).getBytes()),\n // IssuerAndSerialNumber\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // Name\n forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}),\n // Serial\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n forge.util.hexToBytes(obj.serialNumber))\n ]),\n // KeyEncryptionAlgorithmIdentifier\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // Algorithm\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(obj.encryptedContent.algorithm).getBytes()),\n // Parameter, force NULL, only RSA supported for now.\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n ]),\n // EncryptedKey\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,\n obj.encryptedContent.content)\n ]);\n}", "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "function _dnToAsn1(obj) {\n // create an empty RDNSequence\n var rval = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n // iterate over attributes\n var attr, set;\n var attrs = obj.attributes;\n for(var i = 0; i < attrs.length; ++i) {\n attr = attrs[i];\n var value = attr.value;\n\n // reuse tag class for attribute value if available\n var valueTagClass = asn1.Type.PRINTABLESTRING;\n if('valueTagClass' in attr) {\n valueTagClass = attr.valueTagClass;\n\n if(valueTagClass === asn1.Type.UTF8) {\n value = forge.util.encodeUtf8(value);\n }\n // FIXME: handle more encodings\n }\n\n // create a RelativeDistinguishedName set\n // each value in the set is an AttributeTypeAndValue first\n // containing the type (an OID) and second the value\n set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AttributeType\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(attr.type).getBytes()),\n // AttributeValue\n asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n ])\n ]);\n rval.value.push(set);\n }\n\n return rval;\n}", "function pemToBase64(pem) { return pem.split('-----BEGIN CERTIFICATE-----').join('').split('-----END CERTIFICATE-----').join('').split('\\r\\n').join(''); }", "function _recipientToAsn1(obj) {\n\t return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n\t // Version\n\t asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n\t asn1.integerToDer(obj.version).getBytes()),\n\t // IssuerAndSerialNumber\n\t asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n\t // Name\n\t forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}),\n\t // Serial\n\t asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n\t forge.util.hexToBytes(obj.serialNumber))\n\t ]),\n\t // KeyEncryptionAlgorithmIdentifier\n\t asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n\t // Algorithm\n\t asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n\t asn1.oidToDer(obj.encryptedContent.algorithm).getBytes()),\n\t // Parameter, force NULL, only RSA supported for now.\n\t asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n\t ]),\n\t // EncryptedKey\n\t asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,\n\t obj.encryptedContent.content)\n\t ]);\n\t}", "static getFromNodeForgeDistingishedName(forgeAttributes) {\n var distingishedName = new DistingishedName();\n for (var attribute of forgeAttributes) {\n if (!('type' in attribute))\n throw new Error('node-forge produced an attribute without a valid type for a certificate distingished name');\n if (!('value' in attribute))\n throw new Error('node-forge produced an attribute without a valid value for a certificate distingished name');\n if (attribute['valueTagClass'] != 19)\n throw new Error('node-forge produced an attribute without a valid tag type for a certificate distingished name');\n var attributeType = attribute['type'];\n var attributeKey = DistingishedName.forgeTypeToAttributeKeyMap.has(attributeType) ? DistingishedName.forgeTypeToAttributeKeyMap.get(attributeType) : attributeType;\n distingishedName.addAttribute(attributeKey, attribute['value']);\n }\n distingishedName.updateIdentityString();\n distingishedName.updateLookupString();\n return distingishedName;\n }", "function cfnCertificateOtherNamePropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnCertificate_OtherNamePropertyValidator(properties).assertSuccess();\n return {\n TypeId: cdk.stringToCloudFormation(properties.typeId),\n Value: cdk.stringToCloudFormation(properties.value),\n };\n}", "function getSSLCert() {\n var sslCert =\n `-----BEGIN CERTIFICATE-----\nMIIDCzCCAfOgAwIBAgIJAMYJltRQ+3RIMA0GCSqGSIb3DQEBCwUAMBwxGjAYBgNV\nBAMMEXNhZ2UudmVub20zNjAuY29tMB4XDTE2MDQyMDAzNDQ1N1oXDTI2MDQxODAz\nNDQ1N1owHDEaMBgGA1UEAwwRc2FnZS52ZW5vbTM2MC5jb20wggEiMA0GCSqGSIb3\nDQEBAQUAA4IBDwAwggEKAoIBAQDYiw1ocWM2irjhoItx2dk1kKL74uTvyuwbN6Q8\nd0rEg3ksNj8u9V5gEpYMi/SbGQA2LyqxUo+FFWgUUfShKf8gUcEodtPqL3qhJYsp\nCRZl8X2R1F9tiBuRdPG+cwIL8hLR6Jb4NKmbw1MA8zCgC6sl4Fx4bd4u8kybGYW2\nkzGRmcJBt27r8+Zx4SFPMWDfblWzPXq91/IqiabrFufD34y0D5uihcYRKtFPDeek\nT/YLxLNaZHPiDY7LfB188ugBpgh5Qmc7OP1JnBJEERBn0w5uBFd6742w1q7AONv/\nELL67vFjIGFjc73mUvEjkAkvJJbav5eABDjazratSeo5QwdlAgMBAAGjUDBOMB0G\nA1UdDgQWBBQzx82hq08bUJrmLKb/fYjLx2q7GDAfBgNVHSMEGDAWgBQzx82hq08b\nUJrmLKb/fYjLx2q7GDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQDQ\nPfj4IS84SV5smdaSWU0kUacjXI5A6+g+WpD3849f3iOhIUEtUF5TgWS+zb4qnmrB\nBrGWeU3+IXUDDuQbwDZ3Xhbh1MwBQqvbw0oUsAXOtvcaHPsq5Y348FxKQmagiGEP\nMNaPPaD5QR8BGekTlXdTtW0atow3aCUv72uFjXtFF2E2MWlMscGZ9JvceAvGOpXX\n9/kzMpk1SldVpK2ydMRvCyfS35Dny7Nk69Y8hwINKNhpAiDioV8Moz1DFk0RF/+Y\npy/3tHqG12IDFTPKxJ71eiEW22ew0qIhK+dQKll0PtsZ0qzizTsHTaegbuBMRvYz\nIreQ+yV5jHOdES+xf/wR\n-----END CERTIFICATE-----\n`;\n return new Buffer(sslCert, \"binary\");\n}", "function cfnCertificateAuthorityOtherNamePropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnCertificateAuthority_OtherNamePropertyValidator(properties).assertSuccess();\n return {\n TypeId: cdk.stringToCloudFormation(properties.typeId),\n Value: cdk.stringToCloudFormation(properties.value),\n };\n}", "function convertKeyObj(keyObj) {\n return {\n privateKey: keyObj.private,\n publicKey: keyObj.public,\n address: keyObj.account\n };\n }", "function hostnameToKey(hostname) {\n return hostname.split(\".\").reverse().slice(0,2).join(\".\");\n}", "function CertKeyInfo(pem) {\n\n\t// ensure pem is not a buffer\n\tconst pemString = pem.toString();\n\n\tthis.getKeyInfo = function (key, prefix) {\n\n\t\tconst keyInfoXML = pemFormatting.stripPEMHeaders(pemString);\n\t\tconst element = {\n\t\t\t\"ds:X509Data\": {\n\t\t\t\t\"ds:X509Certificate\": keyInfoXML\n\t\t\t}\n\t\t};\n\t\tif (prefix && prefix !== \"ds\") {\n\t\t\telement[\"ds:X509Data\"][`${prefix}:X509Certificate`] = element[\"ds:X509Data\"][\"ds:X509Certificate\"];\n\t\t\tdelete element[\"ds:X509Data\"][\"ds:X509Certificate\"];\n\t\t\telement[`${prefix}:X509Data`] = element[\"ds:X509Data\"];\n\t\t\tdelete element[\"ds:X509Data\"];\n\t\t}\n\t\treturn xmlbuilder\n\t\t\t.begin()\n\t\t\t.ele(element)\n\t\t\t.end();\n\t};\n\n\tthis.getKey = function () {\n\t\treturn pemFormatting.addPEMHeaders(\"CERTIFICATE\", pemString);\n\t};\n}", "function _dnToAsn1(obj) {\n\t // create an empty RDNSequence\n\t var rval = asn1.create(\n\t asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n\t // iterate over attributes\n\t var attr, set;\n\t var attrs = obj.attributes;\n\t for(var i = 0; i < attrs.length; ++i) {\n\t attr = attrs[i];\n\t var value = attr.value;\n\n\t // reuse tag class for attribute value if available\n\t var valueTagClass = asn1.Type.PRINTABLESTRING;\n\t if('valueTagClass' in attr) {\n\t valueTagClass = attr.valueTagClass;\n\n\t if(valueTagClass === asn1.Type.UTF8) {\n\t value = forge.util.encodeUtf8(value);\n\t }\n\t // FIXME: handle more encodings\n\t }\n\n\t // create a RelativeDistinguishedName set\n\t // each value in the set is an AttributeTypeAndValue first\n\t // containing the type (an OID) and second the value\n\t set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n\t asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n\t // AttributeType\n\t asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n\t asn1.oidToDer(attr.type).getBytes()),\n\t // AttributeValue\n\t asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n\t ])\n\t ]);\n\t rval.value.push(set);\n\t }\n\n\t return rval;\n\t}", "function test_certificate() {\n\ttry {\n\t var caEc = cert_util.generateEcKeypair('secp256r1');\n\n\t var ec_cert = new EC_CERT(caEc);\n\t // var ec_cert = new EC_CERT(); // default curve is 'secp256r1'\n\t ec_cert.initTBSCert();\n\t \n\t var clientEc = cert_util.generateEcKeypair('secp256r1');\n\t \n\t ec_cert.setSubjectPublicKeyByGetKey(clientEc);\n\t \n\t ec_cert.setSerialNumberByParam({'int': 1234});\n\t ec_cert.setSignatureAlgByParam({'name': 'SHA1withRSA', 'paramempty': false}); // NOTE: paramempty: false to get NULL in AlgorithmIdentifier (possibly not required)\n\t var dn = \"/C=US/ST=Maryland/L=Pasadena/O=BrentBaccala/OU=R&BD/[email protected]/SN=Park\";\n\t ec_cert.setIssuerByParam({'str': dn}); \n\n\t var str1 = cert_util.getCurrentDate() + \"Z\";\n\t var obj1 = {'str': str1};\n\t console.log(obj1);\n\t ec_cert.setNotBeforeByParam(obj1);\n\n\t var str2 = cert_util.getAddMonthsDate(null, 3) + \"Z\";\n\t var obj2 = {'str': str2};\n\t console.log(obj2);\n\t ec_cert.setNotAfterByParam(obj2);\n\n\t ec_cert.setSubjectByParam({'str': \"/C=US/O=TEST\"});\n\t // extension\n\t ec_cert.appendExtension(new rs.asn1.x509.BasicConstraints({'cA': false}));\n\t ec_cert.appendExtension(new rs.asn1.x509.KeyUsage({'bin':'11'}));\n\t ec_cert.appendExtension(new rs.asn1.x509.CRLDistributionPoints({'uri':'http://www.infosec/com/newict'}));\n\n\t ec_cert.doSign();\n\t ec_cert.saveFile(\"/home/kyoungmin/tmp/skbc2.pem\");\n\t // var certPEM = ec_cert.getPemString();\n\t // console.log(certPEM);\n\t console.log(\"Good Job!\");\n\t} catch (exception) {\n\t console.log(exception);\n\t}\n}", "InitializeFromCertificate() {\n\n }", "renderCert(c){\n var data = msgpack.decode(new Buffer(c, \"hex\"));\n\n\n var username = data.s;\n if (!/^([\\w0-9._]+)$/.test(username)) {\n username = \"\";\n }\n\n var name = this.name;\n if(!/^[a-z ,.'-]+$/i.test(name)){\n name = \"\"\n }\n\n return \"<div class=\\\"card\\\" >\\n\" +\n \"<img src='img/certificateSign.png'>\"+\n \"<div class='CardTitle'><h1>\"+username+\"</h1><h2>\"+name+\"</h2></div>\\n\" +\n \"<div class='CardDescription'>Validity: \"+new Date(data.t*1000).toLocaleDateString()\n +\" - \"+new Date(data.e*1000).toLocaleDateString()+\"</div>\\n\" +\n \"</div>\"\n }", "Encode(string, X500NameFlags) {\n\n }", "function translateTLSOptions(queryString) {\n if (queryString.tls) {\n queryString.ssl = queryString.tls;\n }\n\n if (queryString.tlsInsecure) {\n queryString.checkServerIdentity = false;\n queryString.sslValidate = false;\n } else {\n Object.assign(queryString, {\n checkServerIdentity: queryString.tlsAllowInvalidHostnames ? false : true,\n sslValidate: queryString.tlsAllowInvalidCertificates ? false : true\n });\n }\n\n if (queryString.tlsCAFile) {\n queryString.sslCA = queryString.tlsCAFile;\n }\n\n if (queryString.tlsCertificateKeyFile) {\n if (queryString.tlsCertificateFile) {\n queryString.sslCert = queryString.tlsCertificateFile;\n queryString.sslKey = queryString.tlsCertificateKeyFile;\n } else {\n queryString.sslKey = queryString.tlsCertificateKeyFile;\n queryString.sslCert = queryString.tlsCertificateKeyFile;\n }\n }\n\n if (queryString.tlsCertificateKeyFilePassword) {\n queryString.sslPass = queryString.tlsCertificateKeyFilePassword;\n }\n\n return queryString;\n}", "Decode(string, EncodingType, X500NameFlags) {\n\n }", "function test_verify_certificate() {\n\ttry {\n\t var caEc = cert_util.generateEcKeypair('secp256r1');\n\n\t var ec_cert = new EC_CERT(caEc);\n\t // var ec_cert = new EC_CERT(); // default curve is 'secp256r1'\n\t ec_cert.initTBSCert();\n\t \n\t var clientEc = cert_util.generateEcKeypair('secp256r1');\n\t \n\t ec_cert.setSubjectPublicKeyByGetKey(clientEc);\n\t \n\t ec_cert.setSerialNumberByParam({'int': 1234});\n\t ec_cert.setSignatureAlgByParam({'name': 'SHA1withRSA', 'paramempty': false}); // NOTE: paramempty: false to get NULL in AlgorithmIdentifier (possibly not required)\n\t var dn = \"/C=US/ST=Maryland/L=Pasadena/O=BrentBaccala/OU=R&BD/[email protected]/SN=Park\";\n\t ec_cert.setIssuerByParam({'str': dn}); \n\n\t var str1 = cert_util.getCurrentDate() + \"Z\";\n\t var obj1 = {'str': str1};\n\t ec_cert.setNotBeforeByParam(obj1);\n\n\t var str2 = cert_util.getAddMonthsDate(null, 3) + \"Z\";\n\t var obj2 = {'str': str2};\n\t ec_cert.setNotAfterByParam(obj2);\n\n\t ec_cert.setSubjectByParam({'str': \"/C=US/O=TEST\"});\n\t // extension\n\t ec_cert.appendExtension(new rs.asn1.x509.BasicConstraints({'cA': false}));\n\t ec_cert.appendExtension(new rs.asn1.x509.KeyUsage({'bin':'11'}));\n\t ec_cert.appendExtension(new rs.asn1.x509.CRLDistributionPoints({'uri':'http://www.infosec/com/newict'}));\n\n\t ec_cert.doSign();\n\t // ec_cert.saveFile(\"/home/kyoungmin/tmp/skbc2.pem\");\n\t var certPEM = ec_cert.getPemString();\n\t // console.log(certPEM);\n\n\t // var caCertPem = getSelfSignCertificate(caEc);\n\t var pemFileFullPath = \"/home/kyoungmin/tmp/root.pem\";\n\t var result = getSelfSignCertificate(caEc, pemFileFullPath);\n\t if (pemFileFullPath != result) {\n\t \tconsole.log(\"failed to save pem file: \" + result);\n\t \treturn;\n\t }\n\t var caCertPem = cert_util.generateCertPEMFromPath(pemFileFullPath);\n\t console.log(\"verify certificate with ca certificate ---> \" + cert_util.verifyCertificate(caCertPem, certPEM));\n\t} catch (exception) {\n\t console.log(exception);\n\t}\n}", "function sylk_to_aoa(d, opts) {\n switch (opts.type) {\n case 'base64':\n return sylk_to_aoa_str(Base64.decode(d), opts);\n\n case 'binary':\n return sylk_to_aoa_str(d, opts);\n\n case 'buffer':\n return sylk_to_aoa_str(d.toString('binary'), opts);\n\n case 'array':\n return sylk_to_aoa_str(cc2str(d), opts);\n }\n\n throw new Error(\"Unrecognized type \" + opts.type);\n }", "function sylk_to_aoa(d, opts) {\n\t\tswitch(opts.type) {\n\t\t\tcase 'base64': return sylk_to_aoa_str(Base64.decode(d), opts);\n\t\t\tcase 'binary': return sylk_to_aoa_str(d, opts);\n\t\t\tcase 'buffer': return sylk_to_aoa_str(d.toString('binary'), opts);\n\t\t\tcase 'array': return sylk_to_aoa_str(cc2str(d), opts);\n\t\t}\n\t\tthrow new Error(\"Unrecognized type \" + opts.type);\n\t}", "function sylk_to_aoa(d, opts) {\n\t\tswitch(opts.type) {\n\t\t\tcase 'base64': return sylk_to_aoa_str(Base64.decode(d), opts);\n\t\t\tcase 'binary': return sylk_to_aoa_str(d, opts);\n\t\t\tcase 'buffer': return sylk_to_aoa_str(d.toString('binary'), opts);\n\t\t\tcase 'array': return sylk_to_aoa_str(cc2str(d), opts);\n\t\t}\n\t\tthrow new Error(\"Unrecognized type \" + opts.type);\n\t}", "function sylk_to_aoa(d, opts) {\n\t\tswitch(opts.type) {\n\t\t\tcase 'base64': return sylk_to_aoa_str(Base64.decode(d), opts);\n\t\t\tcase 'binary': return sylk_to_aoa_str(d, opts);\n\t\t\tcase 'buffer': return sylk_to_aoa_str(d.toString('binary'), opts);\n\t\t\tcase 'array': return sylk_to_aoa_str(cc2str(d), opts);\n\t\t}\n\t\tthrow new Error(\"Unrecognized type \" + opts.type);\n\t}", "function sylk_to_aoa(d, opts) {\n\t\tswitch(opts.type) {\n\t\t\tcase 'base64': return sylk_to_aoa_str(Base64.decode(d), opts);\n\t\t\tcase 'binary': return sylk_to_aoa_str(d, opts);\n\t\t\tcase 'buffer': return sylk_to_aoa_str(d.toString('binary'), opts);\n\t\t\tcase 'array': return sylk_to_aoa_str(cc2str(d), opts);\n\t\t}\n\t\tthrow new Error(\"Unrecognized type \" + opts.type);\n\t}", "function sylk_to_aoa(d, opts) {\n\t\tswitch(opts.type) {\n\t\t\tcase 'base64': return sylk_to_aoa_str(Base64.decode(d), opts);\n\t\t\tcase 'binary': return sylk_to_aoa_str(d, opts);\n\t\t\tcase 'buffer': return sylk_to_aoa_str(d.toString('binary'), opts);\n\t\t\tcase 'array': return sylk_to_aoa_str(cc2str(d), opts);\n\t\t}\n\t\tthrow new Error(\"Unrecognized type \" + opts.type);\n\t}", "function sylk_to_aoa(d, opts) {\n\t\tswitch(opts.type) {\n\t\t\tcase 'base64': return sylk_to_aoa_str(Base64.decode(d), opts);\n\t\t\tcase 'binary': return sylk_to_aoa_str(d, opts);\n\t\t\tcase 'buffer': return sylk_to_aoa_str(d.toString('binary'), opts);\n\t\t\tcase 'array': return sylk_to_aoa_str(cc2str(d), opts);\n\t\t}\n\t\tthrow new Error(\"Unrecognized type \" + opts.type);\n\t}", "function sylk_to_aoa(d, opts) {\n\t\tswitch(opts.type) {\n\t\t\tcase 'base64': return sylk_to_aoa_str(Base64.decode(d), opts);\n\t\t\tcase 'binary': return sylk_to_aoa_str(d, opts);\n\t\t\tcase 'buffer': return sylk_to_aoa_str(d.toString('binary'), opts);\n\t\t\tcase 'array': return sylk_to_aoa_str(cc2str(d), opts);\n\t\t}\n\t\tthrow new Error(\"Unrecognized type \" + opts.type);\n\t}", "function sylk_to_aoa(d, opts) {\n\t\tswitch(opts.type) {\n\t\t\tcase 'base64': return sylk_to_aoa_str(Base64.decode(d), opts);\n\t\t\tcase 'binary': return sylk_to_aoa_str(d, opts);\n\t\t\tcase 'buffer': return sylk_to_aoa_str(d.toString('binary'), opts);\n\t\t\tcase 'array': return sylk_to_aoa_str(cc2str(d), opts);\n\t\t}\n\t\tthrow new Error(\"Unrecognized type \" + opts.type);\n\t}", "function sylk_to_aoa(d, opts) {\n\t\tswitch(opts.type) {\n\t\t\tcase 'base64': return sylk_to_aoa_str(Base64.decode(d), opts);\n\t\t\tcase 'binary': return sylk_to_aoa_str(d, opts);\n\t\t\tcase 'buffer': return sylk_to_aoa_str(d.toString('binary'), opts);\n\t\t\tcase 'array': return sylk_to_aoa_str(cc2str(d), opts);\n\t\t}\n\t\tthrow new Error(\"Unrecognized type \" + opts.type);\n\t}", "function _recipientFromAsn1(obj) {\n\t // validate EnvelopedData content block and capture data\n\t var capture = {};\n\t var errors = [];\n\t if(!asn1.validate(obj, p7.asn1.recipientInfoValidator, capture, errors)) {\n\t var error = new Error('Cannot read PKCS#7 RecipientInfo. ' +\n\t 'ASN.1 object is not an PKCS#7 RecipientInfo.');\n\t error.errors = errors;\n\t throw error;\n\t }\n\n\t return {\n\t version: capture.version.charCodeAt(0),\n\t issuer: forge.pki.RDNAttributesAsArray(capture.issuer),\n\t serialNumber: forge.util.createBuffer(capture.serial).toHex(),\n\t encryptedContent: {\n\t algorithm: asn1.derToOid(capture.encAlgorithm),\n\t parameter: capture.encParameter ? capture.encParameter.value : undefined,\n\t content: capture.encKey\n\t }\n\t };\n\t}", "function amtcert_createCertificate(certAttributes, caPrivateKey, DERKey, issuerAttributes, extKeyUsage) {\n // Generate a keypair and create an X.509v3 certificate\n var keys, cert = forge.pki.createCertificate();\n if (!DERKey) {\n keys = forge.pki.rsa.generateKeyPair(2048);\n cert.publicKey = keys.publicKey;\n } else {\n cert.publicKey = forge.pki.publicKeyFromPem('-----BEGIN PUBLIC KEY-----' + DERKey + '-----END PUBLIC KEY-----');\n }\n cert.serialNumber = '' + Math.floor((Math.random() * 100000) + 1);\n cert.validity.notBefore = new Date(2018, 0, 1);\n //cert.validity.notBefore.setFullYear(cert.validity.notBefore.getFullYear() - 1); // Create a certificate that is valid one year before, to make sure out-of-sync clocks don't reject this cert.\n cert.validity.notAfter = new Date(2049, 11, 31);\n //cert.validity.notAfter.setFullYear(cert.validity.notAfter.getFullYear() + 20);\n var attrs = [];\n if (certAttributes['CN']) attrs.push({ name: 'commonName', value: certAttributes['CN'] });\n if (certAttributes['C']) attrs.push({ name: 'countryName', value: certAttributes['C'] });\n if (certAttributes['ST']) attrs.push({ shortName: 'ST', value: certAttributes['ST'] });\n if (certAttributes['O']) attrs.push({ name: 'organizationName', value: certAttributes['O'] });\n cert.setSubject(attrs);\n\n if (caPrivateKey) {\n // Use root attributes\n var rootattrs = [];\n if (issuerAttributes['CN']) rootattrs.push({ name: 'commonName', value: issuerAttributes['CN'] });\n if (issuerAttributes['C']) rootattrs.push({ name: 'countryName', value: issuerAttributes['C'] });\n if (issuerAttributes['ST']) rootattrs.push({ shortName: 'ST', value: issuerAttributes['ST'] });\n if (issuerAttributes['O']) rootattrs.push({ name: 'organizationName', value: issuerAttributes['O'] });\n cert.setIssuer(rootattrs);\n } else {\n // Use our own attributes\n cert.setIssuer(attrs);\n }\n\n if (caPrivateKey == null) {\n // Create a root certificate\n cert.setExtensions([{\n name: 'basicConstraints',\n cA: true\n }, {\n name: 'nsCertType',\n sslCA: true,\n emailCA: true,\n objCA: true\n }, {\n name: 'subjectKeyIdentifier'\n }]);\n } else {\n if (extKeyUsage == null) { extKeyUsage = { name: 'extKeyUsage', serverAuth: true, } } else { extKeyUsage.name = 'extKeyUsage'; }\n\n /*\n {\n name: 'extKeyUsage',\n serverAuth: true,\n clientAuth: true,\n codeSigning: true,\n emailProtection: true,\n timeStamping: true,\n '2.16.840.1.113741.1.2.1': true\n }\n */\n\n // Create a leaf certificate\n cert.setExtensions([{\n name: 'basicConstraints'\n }, {\n name: 'keyUsage',\n keyCertSign: true,\n digitalSignature: true,\n nonRepudiation: true,\n keyEncipherment: true,\n dataEncipherment: true\n }, extKeyUsage, {\n name: 'nsCertType',\n client: true,\n server: true,\n email: true,\n objsign: true,\n }, {\n name: 'subjectKeyIdentifier'\n }]);\n }\n\n // Self-sign certificate\n if (caPrivateKey) {\n cert.sign(caPrivateKey, forge.md.sha256.create());\n } else {\n cert.sign(keys.privateKey, forge.md.sha256.create());\n }\n\n if (DERKey) {\n return cert;\n } else {\n return { 'cert': cert, 'key': keys.privateKey };\n }\n}", "function _x509_getIssuerString() {\n return _x509_hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex, 0, [0, 3]));\n}", "function translateTLSOptions(queryString) {\n if (queryString.tls) {\n queryString.ssl = queryString.tls;\n }\n\n if (queryString.tlsInsecure) {\n queryString.checkServerIdentity = false;\n queryString.sslValidate = false;\n } else {\n Object.assign(queryString, {\n checkServerIdentity: queryString.tlsAllowInvalidHostnames ? false : true,\n sslValidate: queryString.tlsAllowInvalidCertificates ? false : true\n });\n }\n\n if (queryString.tlsCAFile) {\n queryString.ssl = true;\n queryString.sslCA = queryString.tlsCAFile;\n }\n\n if (queryString.tlsCertificateKeyFile) {\n queryString.ssl = true;\n if (queryString.tlsCertificateFile) {\n queryString.sslCert = queryString.tlsCertificateFile;\n queryString.sslKey = queryString.tlsCertificateKeyFile;\n } else {\n queryString.sslKey = queryString.tlsCertificateKeyFile;\n queryString.sslCert = queryString.tlsCertificateKeyFile;\n }\n }\n\n if (queryString.tlsCertificateKeyFilePassword) {\n queryString.ssl = true;\n queryString.sslPass = queryString.tlsCertificateKeyFilePassword;\n }\n\n return queryString;\n}", "function getRootCertBase64() {\n var rootcert = obj.certificates.root.cert;\n var i = rootcert.indexOf(\"-----BEGIN CERTIFICATE-----\\r\\n\");\n if (i >= 0) { rootcert = rootcert.substring(i + 29); }\n i = rootcert.indexOf(\"-----END CERTIFICATE-----\");\n if (i >= 0) { rootcert = rootcert.substring(i, 0); }\n return new Buffer(rootcert, 'base64').toString('base64');\n }", "function _recipientFromAsn1(obj) {\n // validate EnvelopedData content block and capture data\n var capture = {};\n var errors = [];\n if(!asn1.validate(obj, p7.asn1.recipientInfoValidator, capture, errors)) {\n var error = new Error('Cannot read PKCS#7 RecipientInfo. ' +\n 'ASN.1 object is not an PKCS#7 RecipientInfo.');\n error.errors = errors;\n throw error;\n }\n\n return {\n version: capture.version.charCodeAt(0),\n issuer: forge.pki.RDNAttributesAsArray(capture.issuer),\n serialNumber: forge.util.createBuffer(capture.serial).toHex(),\n encryptedContent: {\n algorithm: asn1.derToOid(capture.encAlgorithm),\n parameter: capture.encParameter.value,\n content: capture.encKey\n }\n };\n}", "function _recipientFromAsn1(obj) {\n // validate EnvelopedData content block and capture data\n var capture = {};\n var errors = [];\n if(!asn1.validate(obj, p7.asn1.recipientInfoValidator, capture, errors)) {\n var error = new Error('Cannot read PKCS#7 RecipientInfo. ' +\n 'ASN.1 object is not an PKCS#7 RecipientInfo.');\n error.errors = errors;\n throw error;\n }\n\n return {\n version: capture.version.charCodeAt(0),\n issuer: forge.pki.RDNAttributesAsArray(capture.issuer),\n serialNumber: forge.util.createBuffer(capture.serial).toHex(),\n encryptedContent: {\n algorithm: asn1.derToOid(capture.encAlgorithm),\n parameter: capture.encParameter.value,\n content: capture.encKey\n }\n };\n}", "function _recipientFromAsn1(obj) {\n // validate EnvelopedData content block and capture data\n var capture = {};\n var errors = [];\n if(!asn1.validate(obj, p7.asn1.recipientInfoValidator, capture, errors)) {\n var error = new Error('Cannot read PKCS#7 RecipientInfo. ' +\n 'ASN.1 object is not an PKCS#7 RecipientInfo.');\n error.errors = errors;\n throw error;\n }\n\n return {\n version: capture.version.charCodeAt(0),\n issuer: forge.pki.RDNAttributesAsArray(capture.issuer),\n serialNumber: forge.util.createBuffer(capture.serial).toHex(),\n encryptedContent: {\n algorithm: asn1.derToOid(capture.encAlgorithm),\n parameter: capture.encParameter.value,\n content: capture.encKey\n }\n };\n}", "function _recipientFromAsn1(obj) {\n // validate EnvelopedData content block and capture data\n var capture = {};\n var errors = [];\n if(!asn1.validate(obj, p7.asn1.recipientInfoValidator, capture, errors)) {\n var error = new Error('Cannot read PKCS#7 RecipientInfo. ' +\n 'ASN.1 object is not an PKCS#7 RecipientInfo.');\n error.errors = errors;\n throw error;\n }\n\n return {\n version: capture.version.charCodeAt(0),\n issuer: forge.pki.RDNAttributesAsArray(capture.issuer),\n serialNumber: forge.util.createBuffer(capture.serial).toHex(),\n encryptedContent: {\n algorithm: asn1.derToOid(capture.encAlgorithm),\n parameter: capture.encParameter.value,\n content: capture.encKey\n }\n };\n}", "function saslName(aName) {\n // RFC 5802 (5.1): the client SHOULD prepare the username using the \"SASLprep\".\n // The characters ’,’ or ’=’ in usernames are sent as ’=2C’ and\n // ’=3D’ respectively.\n let saslName = saslPrep(aName)\n .replace(/=/g, \"=3D\")\n .replace(/,/g, \"=2C\");\n if (!saslName) {\n throw new Error(\"Name is not valid\");\n }\n\n return saslName;\n}", "function encode(objectName) {\n\n let result = '';\n objectName.split('').forEach(function(letter) {\n if(encodings.has(letter)) {\n result += encodings.get(letter);\n } else {\n result += letter;\n }\n })\n return result;\n}", "function createCertificate(api, body) {\n return api_1.POST(api, '/certificates', { body })\n}", "pem2raw(pem) {\n\t\tpem = pem.trim();\n\t\tlet raw_key = pem.split(/\\r?\\n/)\n\t\t// console.log(raw_key)\n\t\traw_key.shift();\n\t\traw_key.pop();\n\t\t// console.log(raw_key)\n\t\traw_key = raw_key.join('');\n\t\t// console.log(raw_key)\n\t\treturn raw_key;\n\t}", "function toIdentifier(name) {\n if (t.isIdentifier(name)) return name.name;\n\n name = name + \"\";\n\n // replace all non-valid identifiers with dashes\n name = name.replace(/[^a-zA-Z0-9$_]/g, \"-\");\n\n // remove all dashes and numbers from start of name\n name = name.replace(/^[-0-9]+/, \"\");\n\n // camel case\n name = name.replace(/[-\\s]+(.)?/g, function (match, c) {\n return c ? c.toUpperCase() : \"\";\n });\n\n if (!t.isValidIdentifier(name)) {\n name = \"_\" + name;\n }\n\n return name || \"_\";\n}", "get certificate() {\n return this.getStringAttribute('certificate');\n }", "function toIdentifier(name) {\n\t if (t.isIdentifier(name)) return name.name;\n\n\t name = name + \"\";\n\n\t // replace all non-valid identifiers with dashes\n\t name = name.replace(/[^a-zA-Z0-9$_]/g, \"-\");\n\n\t // remove all dashes and numbers from start of name\n\t name = name.replace(/^[-0-9]+/, \"\");\n\n\t // camel case\n\t name = name.replace(/[-\\s]+(.)?/g, function (match, c) {\n\t return c ? c.toUpperCase() : \"\";\n\t });\n\n\t if (!t.isValidIdentifier(name)) {\n\t name = \"_\" + name;\n\t }\n\n\t return name || \"_\";\n\t}", "function toIdentifier(name) {\n\t if (t.isIdentifier(name)) return name.name;\n\n\t name = name + \"\";\n\n\t // replace all non-valid identifiers with dashes\n\t name = name.replace(/[^a-zA-Z0-9$_]/g, \"-\");\n\n\t // remove all dashes and numbers from start of name\n\t name = name.replace(/^[-0-9]+/, \"\");\n\n\t // camel case\n\t name = name.replace(/[-\\s]+(.)?/g, function (match, c) {\n\t return c ? c.toUpperCase() : \"\";\n\t });\n\n\t if (!t.isValidIdentifier(name)) {\n\t name = \"_\" + name;\n\t }\n\n\t return name || \"_\";\n\t}", "function parseName(name) {\n const parts = name.split(\":\");\n if (parts.length === 1) {\n return { contractName: parts[0] };\n }\n const contractName = parts[parts.length - 1];\n const sourceName = parts.slice(0, parts.length - 1).join(\":\");\n return { sourceName, contractName };\n}", "getHttpsCert()\n{\n var keys;\n if(!fs.existsSync('./server.key'))\n {\n keys = forge.pki.rsa.generateKeyPair({bits: 2048, e: 0x10001});\n var cert = forge.pki.createCertificate();\n cert.publicKey = keys.publicKey;\n cert.serialNumber = '01';\n cert.validity.notBefore = new Date();\n cert.validity.notAfter = new Date();\n cert.validity.notAfter.setFullYear(cert.validity.notBefore.getFullYear()+1);\n\n var attrs = [\n {name:'commonName',value:'example.org'}\n ,{name:'countryName',value:'US'}\n ,{shortName:'ST',value:'OK'}\n ,{name:'localityName',value:'Edmond'}\n ,{name:'organizationName',value:'MyCompany'}\n ,{shortName:'OU',value:'test'}\n ];\n cert.setSubject(attrs);\n cert.setIssuer(attrs);\n cert.sign(keys.privateKey);\n\n var https_key = forge.pki.privateKeyToPem(keys.privateKey);\n var https_cert = forge.pki.certificateToPem(cert);\n fs.writeFileSync('./server.key',Buffer.from(https_key));\n fs.writeFileSync('./server.cert',Buffer.from(https_cert));\n keys = {https_key,https_cert};\n }\n else\n {\n var https_key = fs.readFileSync('./server.key','utf8').toString('utf8');\n var https_cert = fs.readFileSync('./server.cert','utf8').toString('utf8');\n keys = {https_key,https_cert};\n }\n return keys;\n}", "function createDomain(name){\n domain.push(new domainObj(name));\n for(var i = 0; i < name.length; i++){\n var ascii = name.charCodeAt(i);\n domain[domain.length-1].hash[indexASCII(ascii)]++;\n }\n}", "function Cn(t){var e=t;return e=e.replace(\"-----BEGIN RSA PRIVATE KEY-----\",\"\"),e=e.replace(\"-----END RSA PRIVATE KEY-----\",\"\"),e=e.replace(/[ \\n]+/g,\"\")}", "function parseCertInfo(certInfo) {\n let certBuffer = certInfo;\n // Get a magic constant\n const magic = certBuffer.slice(0, 4).readUInt32BE(0);\n certBuffer = certBuffer.slice(4);\n // Determine the algorithm used for attestation\n const typeBuffer = certBuffer.slice(0, 2);\n certBuffer = certBuffer.slice(2);\n const type = constants_1.TPM_ST[typeBuffer.readUInt16BE(0)];\n // The name of a parent entity, can be ignored\n const qualifiedSignerLength = certBuffer.slice(0, 2).readUInt16BE(0);\n certBuffer = certBuffer.slice(2);\n const qualifiedSigner = certBuffer.slice(0, qualifiedSignerLength);\n certBuffer = certBuffer.slice(qualifiedSignerLength);\n // Get the expected hash of `attsToBeSigned`\n const extraDataLength = certBuffer.slice(0, 2).readUInt16BE(0);\n certBuffer = certBuffer.slice(2);\n const extraData = certBuffer.slice(0, extraDataLength);\n certBuffer = certBuffer.slice(extraDataLength);\n // Information about the TPM device's internal clock, can be ignored\n const clockInfoBuffer = certBuffer.slice(0, 17);\n certBuffer = certBuffer.slice(17);\n const clockInfo = {\n clock: clockInfoBuffer.slice(0, 8),\n resetCount: clockInfoBuffer.slice(8, 12).readUInt32BE(0),\n restartCount: clockInfoBuffer.slice(12, 16).readUInt32BE(0),\n safe: !!clockInfoBuffer[16],\n };\n // TPM device firmware version\n const firmwareVersion = certBuffer.slice(0, 8);\n certBuffer = certBuffer.slice(8);\n // Attested Name\n const attestedNameLength = certBuffer.slice(0, 2).readUInt16BE(0);\n certBuffer = certBuffer.slice(2);\n const attestedName = certBuffer.slice(0, attestedNameLength);\n certBuffer = certBuffer.slice(attestedNameLength);\n // Attested qualified name, can be ignored\n const qualifiedNameLength = certBuffer.slice(0, 2).readUInt16BE(0);\n certBuffer = certBuffer.slice(2);\n const qualifiedName = certBuffer.slice(0, qualifiedNameLength);\n certBuffer = certBuffer.slice(qualifiedNameLength);\n const attested = {\n nameAlg: constants_1.TPM_ALG[attestedName.slice(0, 2).readUInt16BE(0)],\n nameAlgBuffer: attestedName.slice(0, 2),\n name: attestedName,\n qualifiedName,\n };\n return {\n magic,\n type,\n qualifiedSigner,\n extraData,\n clockInfo,\n firmwareVersion,\n attested,\n };\n}", "function toIdentifier(name){\n\tvar parts = name.split(/\\W+/)\n\tparts = _.map(parts, function(part){\n\t\treturn part.replace(/^./, function(chr){ return chr.toUpperCase() })\n\t})\n\t\n\treturn parts.join('')\n}", "loadCertificates(notPrefixedIdentifier) {\n return new rxjs_1.Observable(subscriber => {\n this.getForeignObject('system.certificates', (err, obj) => {\n if (err || !obj) {\n subscriber.error(utils_1.Utils.createError(this.log, 'Could not load certificates. This should not happen. Error: ' + err));\n subscriber.complete();\n return;\n }\n let certificateKeys = utils_1.Utils.getCertificateKeys(notPrefixedIdentifier);\n let clientCert = new client_cert_1.ClientCert(obj.native.certificates[certificateKeys.cert], obj.native.certificates[certificateKeys.key]);\n if (clientCert.certificate && clientCert.privateKey) {\n this.readCertificate(clientCert, subscriber);\n }\n else {\n this.generateCertificate(clientCert, obj, certificateKeys, subscriber);\n }\n });\n });\n }", "static parseCertificate(publicCertificate) {\n /**\r\n * This is regex to identify the certs in a given certificate string.\r\n * We want to look for the contents between the BEGIN and END certificate strings, without the associated newlines.\r\n * The information in parens \"(.+?)\" is the capture group to represent the cert we want isolated.\r\n * \".\" means any string character, \"+\" means match 1 or more times, and \"?\" means the shortest match.\r\n * The \"g\" at the end of the regex means search the string globally, and the \"s\" enables the \".\" to match newlines.\r\n */\n const regexToFindCerts = /-----BEGIN CERTIFICATE-----\\r*\\n(.+?)\\r*\\n-----END CERTIFICATE-----/gs;\n const certs = [];\n let matches;\n while ((matches = regexToFindCerts.exec(publicCertificate)) !== null) {\n // matches[1] represents the first parens capture group in the regex.\n certs.push(matches[1].replace(/\\r*\\n/g, msalCommon.Constants.EMPTY_STRING));\n }\n return certs;\n }", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./, \"\"); // S4.1.2.3 & S5.2.3: ignore leading .\n\n if (IP_V6_REGEX_OBJECT.test(str)) {\n str = str.replace(\"[\", \"\").replace(\"]\", \"\");\n }\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function jsonifiableFromSignRequest(signRequest) {\n const transformedSignRequest = Object.assign({}, signRequest);\n transformedSignRequest.digest = byteListFromArrayBuffer(signRequest.digest);\n transformedSignRequest.certificate =\n byteListFromArrayBuffer(signRequest.certificate);\n return transformedSignRequest;\n}", "function test_error_certificate() {\n\ttry {\n\t var caEc = cert_util.generateEcKeypair('secp256r1');\n\t \n\t var ec_cert = new EC_CERT(caEc);\n\t // var ec_cert = new EC_CERT(); // default curve is 'secp256r1'\n\t //ec_cert.initTBSCert();\n\t \n\t var clientEc = cert_util.generateEcKeypair('secp256r1');\n\t \n\t ec_cert.setSubjectPublicKeyByGetKey(clientEc);\n\t \n\t ec_cert.setSerialNumberByParam({'int': 1234});\n\t ec_cert.setSignatureAlgByParam({'name': 'SHA1withRSA', 'paramempty': false}); // NOTE: paramempty: false to get NULL in AlgorithmIdentifier (possibly not required)\n\t var dn = \"/C=US/ST=Maryland/L=Pasadena/O=BrentBaccala/OU=R&BD/[email protected]/SN=Park\";\n\t ec_cert.setIssuerByParam({'str': dn}); \n\t \n\t var str1 = cert_util.getCurrentDate() + \"Z\";\n\t var obj1 = {'str': str1};\n\t console.log(obj1);\n\t ec_cert.setNotBeforeByParam(obj1);\n\n\t var str2 = cert_util.getAddMonthsDate(null, 3) + \"Z\";\n\t var obj2 = {'str': str2};\n\t console.log(obj2);\n\t ec_cert.setNotAfterByParam(obj2);\n\n\t ec_cert.setSubjectByParam({'str': \"/C=US/O=TEST\"});\n\t // extension\n\t ec_cert.appendExtension(new rs.asn1.x509.BasicConstraints({'cA': false}));\n\t ec_cert.appendExtension(new rs.asn1.x509.KeyUsage({'bin':'11'}));\n\t ec_cert.appendExtension(new rs.asn1.x509.CRLDistributionPoints({'uri':'http://www.infosec/com/newict'}));\n\n\t ec_cert.doSign();\n\t ec_cert.saveFile(\"/home/kyoungmin/tmp/skbc2.pem\");\n\t // var certPEM = ec_cert.getPemString();\n\t // console.log(certPEM);\n\t console.log(\"Good Job!\");\n\t} catch (exception) {\n\t console.log(exception);\n\t}\n}", "function getCliendIdFromCert() {\n\tvar x509 = require('x509');\n\tvar certJson = x509.parseCert(fs.readFileSync(process.cwd()+Constant.CERTIFICATE_PATH).toString());\n\tvar cliendId = cert && cert.subject && cert.subject.commonName;\n\n\treturn clientId;\n}", "function normalizeHostname(hostname) {\n // make sure noone gave us a full URI\n if (!hostname.startsWith(\"coap://\") && !hostname.startsWith(\"coaps://\")) {\n hostname = `coaps://${Hostname_1.getURLSafeHostname(hostname)}`;\n }\n return new url_1.URL(hostname).hostname.toLowerCase();\n}", "function _fromAsn1(msg, obj, validator) {\n var capture = {};\n var errors = [];\n if(!asn1.validate(obj, validator, capture, errors)) {\n var error = new Error('Cannot read PKCS#7 message. ' +\n 'ASN.1 object is not a supported PKCS#7 message.');\n error.errors = error;\n throw error;\n }\n\n // Check contentType, so far we only support (raw) Data.\n var contentType = asn1.derToOid(capture.contentType);\n if(contentType !== forge.pki.oids.data) {\n throw new Error('Unsupported PKCS#7 message. ' +\n 'Only wrapped ContentType Data supported.');\n }\n\n if(capture.encryptedContent) {\n var content = '';\n if(forge.util.isArray(capture.encryptedContent)) {\n for(var i = 0; i < capture.encryptedContent.length; ++i) {\n if(capture.encryptedContent[i].type !== asn1.Type.OCTETSTRING) {\n throw new Error('Malformed PKCS#7 message, expecting encrypted ' +\n 'content constructed of only OCTET STRING objects.');\n }\n content += capture.encryptedContent[i].value;\n }\n } else {\n content = capture.encryptedContent;\n }\n msg.encryptedContent = {\n algorithm: asn1.derToOid(capture.encAlgorithm),\n parameter: forge.util.createBuffer(capture.encParameter.value),\n content: forge.util.createBuffer(content)\n };\n }\n\n if(capture.content) {\n var content = '';\n if(forge.util.isArray(capture.content)) {\n for(var i = 0; i < capture.content.length; ++i) {\n if(capture.content[i].type !== asn1.Type.OCTETSTRING) {\n throw new Error('Malformed PKCS#7 message, expecting ' +\n 'content constructed of only OCTET STRING objects.');\n }\n content += capture.content[i].value;\n }\n } else {\n content = capture.content;\n }\n msg.content = forge.util.createBuffer(content);\n }\n\n msg.version = capture.version.charCodeAt(0);\n msg.rawCapture = capture;\n\n return capture;\n}", "function _fromAsn1(msg, obj, validator) {\n var capture = {};\n var errors = [];\n if(!asn1.validate(obj, validator, capture, errors)) {\n var error = new Error('Cannot read PKCS#7 message. ' +\n 'ASN.1 object is not a supported PKCS#7 message.');\n error.errors = error;\n throw error;\n }\n\n // Check contentType, so far we only support (raw) Data.\n var contentType = asn1.derToOid(capture.contentType);\n if(contentType !== forge.pki.oids.data) {\n throw new Error('Unsupported PKCS#7 message. ' +\n 'Only wrapped ContentType Data supported.');\n }\n\n if(capture.encryptedContent) {\n var content = '';\n if(forge.util.isArray(capture.encryptedContent)) {\n for(var i = 0; i < capture.encryptedContent.length; ++i) {\n if(capture.encryptedContent[i].type !== asn1.Type.OCTETSTRING) {\n throw new Error('Malformed PKCS#7 message, expecting encrypted ' +\n 'content constructed of only OCTET STRING objects.');\n }\n content += capture.encryptedContent[i].value;\n }\n } else {\n content = capture.encryptedContent;\n }\n msg.encryptedContent = {\n algorithm: asn1.derToOid(capture.encAlgorithm),\n parameter: forge.util.createBuffer(capture.encParameter.value),\n content: forge.util.createBuffer(content)\n };\n }\n\n if(capture.content) {\n var content = '';\n if(forge.util.isArray(capture.content)) {\n for(var i = 0; i < capture.content.length; ++i) {\n if(capture.content[i].type !== asn1.Type.OCTETSTRING) {\n throw new Error('Malformed PKCS#7 message, expecting ' +\n 'content constructed of only OCTET STRING objects.');\n }\n content += capture.content[i].value;\n }\n } else {\n content = capture.content;\n }\n msg.content = forge.util.createBuffer(content);\n }\n\n msg.version = capture.version.charCodeAt(0);\n msg.rawCapture = capture;\n\n return capture;\n}" ]
[ "0.5783547", "0.5614888", "0.5449339", "0.5449339", "0.5410501", "0.5138633", "0.5123641", "0.5098004", "0.49852043", "0.4980931", "0.49252653", "0.49252653", "0.49252653", "0.49252653", "0.4915836", "0.49119663", "0.48569724", "0.4850773", "0.4844865", "0.48207843", "0.48207843", "0.48207843", "0.48207843", "0.48189962", "0.47806135", "0.47785637", "0.47735843", "0.47726884", "0.47701356", "0.47360733", "0.47186208", "0.47186208", "0.47186208", "0.47186208", "0.46767452", "0.46767452", "0.46767452", "0.46767452", "0.46767452", "0.46767452", "0.46767452", "0.46629182", "0.465053", "0.46075186", "0.45908836", "0.45830315", "0.45666817", "0.45650083", "0.45472687", "0.45461336", "0.45456213", "0.4544449", "0.45423654", "0.4538907", "0.45050782", "0.4496207", "0.44882625", "0.44752502", "0.44633582", "0.44595987", "0.44595987", "0.44595987", "0.44595987", "0.44595987", "0.44595987", "0.44595987", "0.44595987", "0.44595987", "0.44522005", "0.44467503", "0.44354793", "0.44327462", "0.44312277", "0.4429036", "0.4429036", "0.4429036", "0.4429036", "0.44253814", "0.44021773", "0.43876666", "0.43871447", "0.43816894", "0.4377876", "0.43673232", "0.43673232", "0.4360726", "0.43564716", "0.4346816", "0.43415132", "0.4340096", "0.433411", "0.43256414", "0.43158326", "0.43119252", "0.43075055", "0.4305777", "0.43046767", "0.42994094", "0.42949694", "0.42949694" ]
0.56652105
1
Function for outputting array
function arrayOutput(a) { for (var i=0; i<a.length; i++) { document.writeln(a[i]+'<br>'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function outputArray(arr){\n for(i=0; i<arr.length; i++)\n console.log(arr[i]);\n}", "function outputArray( heading, theArray, output )\n{\n output.innerHTML = heading + theArray.join( \" \" ); \n} // end function outputArray", "function arrayOutput(ar){\n\tvar s = \"\";\n\tar.map((el)=>{\n\t\ts += JSON.stringify(el) + \"\\n\";\n\t});\n\treturn s;\n}", "function outputArray(heading, theArray, output) {\n\toutput.innerHTML = heading + theArray.join(\" \");\n} //end function outputArray", "function printArray(arr) {}", "function outputArray( heading, theArray, output )\n\t{\n\t\tvar content = \"<h2>\" + heading + \"</h2><table>\" +\n\t\t\t\"<thead><th>Index</th><th>Value</th></thead><tbody>\";\n\n\t\t// output the index and value of each array element\n\t\tvar length = theArray.length; // get array's length once before loop\n\n\t\tfor ( var i =0; i < length; ++i )\n\t\t{\n\t\t\tcontent += \"<tr><td>\" + i + \"</td><td>\" + theArray[ i ] +\n\t\t\t\t\"</td></tr>\";\n\t\t} \t// end for\n\n\t\tcontent += \"</tboby></table>\";\n\t\toutput.innerHTML = content; // place the table in the output elements\n\t}\t// end function outputArray", "function outputArray(arr) {\n\t// Output each element to the console\n\tfor (var j = 0; j < arr.length; j++) {\n\t\tconsole.log(arr[j]);\n\t}\n}", "function outPut (element, index, array) {\n\tconsole.log('array[' + index + '] = ' + element);\n}", "function PrintArrayVals(arr){\n}", "function printArray(){\n console.log(arr)\n}", "function output(arr) {\n\tarr = outpfx.concat(arr);\n if (SAVEDATA) psiTurk.recordTrialData(arr);\n if (LOGGING) console.log(arr.join(\" \"));\n}", "function showArray(array) {\n document.write('[');\n //document.write(array.toString());\n /*\n * array.toString() does this without the spaces between elements\n */\n for (var index = 0; index < array.length; ++index) {\n document.write(array[index]);\n if (index < array.length - 1)\n document.write(\", \");\n }\n document.write(']');\n putline();\n}", "toString() {\n return arrayToString(this);\n }", "function printArray(array){\n\n console.log(array);\n }", "function exportArray(array) {\n\treturn [\n\t\tarray.cavumConchaHeight,\n\t\tarray.cymbaConchaHeight,\n\t\tarray.cavumConchaWidth,\n\t\tarray.fossaHeight,\n\t\tarray.pinnaHeight,\n\t\tarray.pinnaWidth,\n\t\tarray.intertragalIncisureWidth,\n\t\tarray.cavumConchaDepth,\n\t\tarray.pinnaRotationAngle,\n\t\tarray.pinnaFlareAngle\n\t\t]\n}", "function arrayToScreen(){\n var outputString = \"\";\n for (var i = 0; i < randomArray.length; i++){\n outputString += \"The value in array position \" + i + \" is \" + randomArray[i] + \"<br>\";\n }\n document.getElementById(\"output\").innerHTML = outputString;\n}", "function arrayToScreen(){\n var outputString = \"\";\n for (var i = 0; i < randomArray.length; i++){\n outputString += \"The value in array position \" + i + \" is \" + randomArray[i] + \"<br>\";\n }\n document.getElementById(\"output\").innerHTML = outputString;\n}", "function showArray(elements, customText = \"\"){ \n document.write(\"<h1>Content of array \"+customText+\"</hl>\"); \n document.write(\"<ul>\"); \n elements.forEach((element, index) => { \n document.write(\"<li>\"+element+\"</li><br/>\"); \n }); \n document.write(\"</ul>\"); \n}", "function fancyArray(arr, formatting) {\n if (formatting == undefined) {\n formatting = \"->\";\n }\n for (var i = 0; i < arr.length; i++) {\n console.log(i, formatting, arr[i]);\n }\n}", "_emitArray(arr) {\n for (let i = arr.length - 1; i >= 0; i--) {\n this.emitPush(arr[i]);\n }\n return this.emitPush(arr.length).emit(OpCode.PACK);\n }", "function printArray(array) {\n return array.join();\n}", "function printArray(arr) {\n var n = arr.length;\n for (var i = 0; i < n; ++i)\n System.out.print(arr[i] + \" \");\n System.out.println();\n}", "ToArray() {\n\n }", "function outputData(dataArray) {\n //Her console.logger vi en tekst streng \"''Dette er funktionen der udskriver det hentede data: ''\"\n //samt vores array 'dataArray'\n console.log('Dette er funktionen der udskriver det hentede data: ' + dataArray);\n}", "function arrayToString(arr) {\n var output = \"\"\n arr.forEach(function(i, index, array) {\n output += i + \" \"\n });\n return output\n}", "function printLines (arrPrint) {\n for (i=0; i <arrPrint.length; i++) {\n document.write(arrPrint[i]);\n }\n return arrPrint;\n }", "function printArray(a){\nif (a.length == 0){\n return 'empty array' ;\n}\n var result = '';\nfor (var i = 0; i<a.length; i++) {\n result = result + 'row ' + i + ' \\n';\n console.log(result)\n for (var j=0; j<a[i].length; j++){\n result = result + a[i][j] + '\\n';\n }\n}\nreturn result;\n}", "function display_array(array,delimiter)\n{\n for (var i in array)\n {\n document.write(array[i]+delimiter);\n }\n document.write(\"<br />\"+\"<br />\");\n}", "function printarray()\n {\nfor(let contact of Books){\n console.log(`[${contact.title}\\t${contact.author}\\t${contact.price}\\t${contact.rating}]`)\n}\nconsole.log('Array will be printed');\n }", "print() {\n const printData = this.array.join(' ');\n debug(`\\nLOG: Here is the array content ${printData}`);\n return this.array.join(' ');\n }", "function printArray() {\r\n console.log(myArray);// Output = [Array(2), Array(2)]\r\n return myArray[0];\r\n}", "toArray() {}", "toArray() {}", "toArray() {}", "function PrintArray(array, data) {\n // Check that the argument count is correct.\n AssertEquals(array.length, data.length * 2 + 1);\n\n for (var i = 0, idx = 1; i < data.length; i++, idx += 2) {\n array[idx] = data[i];\n }\n return array.join(\"\");\n}", "function showArray () {\ndocument.getElementById(\"inputArr\").textContent = console.log(itemsArr);\n\n}", "function arrayToString(a) {\n return \"[\" + a.join(\", \") + \"]\";\n}", "function draw2DArray(array){\n var html=\"\";\n for(var i = 0; i < row; i++){\n for(var j = 0; j < col; j++){\n html = html + array[i][j] + \", \";\n }\n html=html+\"\\n\";\n }\n console.log(html);\n}", "toString() {\n let s = '[';\n for (var i = 0; i < this.#size - 1; i++) {\n s = s + this.#array[i] + ', ';\n }\n if (this.#size > 0) {\n s = s + this.#array[this.#size - 1];\n }\n return s + ']';\n }", "function writeout(array) {\n var answer = \"<h3>Lottery Numbers</h3>\";\n for (var element in array) {\n answer += \"Number \" + element + \" = \";\n answer += \"<em>\" + array[element] + \"</em><br />\";\n }\n document.getElementById(\"lblLotteryNumbers\").innerHTML = answer;\n }", "function arrayToString(array) {\n var string = \"\";\n for (let j = 0; j < array.length; j++){\n var string = string + array[j] + '\\n';\n };\n return string = string.slice(0, -1);\n }", "function printArray(array){\r\n var finalArray = \"[\";\r\n for(var i=0, alen=array.length; i < alen;i++){\r\n finalArray = finalArray.concat(array[i]);\r\n if (i != array.length - 1){\r\n finalArray = finalArray.concat(\",\");\r\n }\r\n }\r\n finalArray = finalArray.concat(\"]\");\r\n alert(finalArray);\r\n}", "function dumpArray(array) {\n console.log('[');\n array.forEach(function(value){\n console.log(' ' + value);\n });\n console.log(']');\n}", "function printStringArray(outputString)\r\n{\r\n console.log(outputString); \r\n}", "function showArray() {\n showFancyArray2();\n document\n .querySelector('#myList')\n .innerHTML =\n '[' + myArray.join(', ') + ']';\n //saving array to div\n}", "function arrayToHTML(json) {\n var output = '[<ul class=\"array collapsible\">';\n var hasContents = false;\n for (var prop in json) {\n hasContents = true;\n output += '<li>';\n output += valueToHTML(json[prop]);\n output += '</li>';\n }\n output += '</ul>]';\n\n if (!hasContents) {\n output = \"[ ]\";\n }\n\n return output;\n }", "static arrayToString(inp, end) {\n let outp = '';\n inp.forEach((key, val) => {\n outp += key;\n if (end && val + 1 !== inp.length) {\n outp += ' ';\n }\n });\n return outp;\n }", "function printintegerArray(array) {\n var size = array.length;\n var res = '';\n res += '[';\n var i = 0;\n for (i = 0; i < size; i++) {\n if (i !== 0) {\n \tres += ', ';\n }\n res += array[i];\n }\n res += ']';\n return res;\n}", "toString() {\n return JSON.stringify(this.#array);\n }", "function seeDouble(arr){\n var newArr = [];\n for(var i = 0; i < arr.length; i++){\n newArr.push(arr[i],arr[i]);\n }\n document.getElementById(\"4\").innerHTML = newArr;\n return newArr;\n}", "function ArrayToString(arr, offs, len)\r\n{\r\n\tvar str = \"[\"; \r\n\tlen += offs-1;\t\r\n\tfor(var i=offs; i <= len; i++){\r\n\t \tstr += (arr[i] > 9 && arr[i] <= 0xffffffff) ? \"0x\" + arr[i].toString(16) : arr[i];\r\n\t \tstr += (i < len) ? \", \" : \"]\";\r\n\t}\r\n\treturn str;\r\n}", "function printThisArr(arr) {\r\n\ttestFinished = \" \";\r\n\tfor(var i = 0; i < arr.length; i++) {\r\n\t\ttestFinished += arr[i] + \"<br>\";\r\n\t\t//testFinished += arr.size + \"<br>\";\r\n\t}\r\n}", "function output(element, index, array)\n{\n\tdocument.write(\"Element at index \" + index + \" has the value \" +\n\t\telement + \"<br />\")\n}", "function printUp(){\n var arr = [];\n for(var i = 255; i < 513; i++){\n arr.push(i);\n // console.log(arr);\n }\n return arr;\n}", "function arrayFactors(array){\n for (var i=0; i<array.length;i++){\n output[array[i]] = [];\n for (var j=0; j<array.length;j++){\n if (i==j){\n continue; \n } else if(array[i] % array[j] == 0){\n console.log(array[j] +' is a factor of '+ array[i]);\n output[array[i]].push(array[j]);\n }\n }\n console.log('for array element ', array[i] + ' the output is ', output[array[i]]);\n }\n\n var displayOutput = output.toString();\n console.log(output);\n return displayOutput;\n}", "function array_to_string(a) {\r\n var out = '';\r\n if (!a) return out;\r\n for (i=0;i<a.length;i++) {\r\n out = out + i + \":\" + a[i] + \"\\n\";\r\n }\r\n return out;\r\n}", "function SpecialArray(){\n //Create the array\n var values = new Array()\n values.push.apply(values, arguments);\n\n //assign the method\n values.toPipedString = function (){\n return this.join(\"|\")\n }\n return values;\n}", "function arrayToStr(buf)\n{\n output = '';\n for (var ind=0; ind<buf.length; ind++)\n {\n if (buf[ind] == 0)\n {\n return output;\n } else {\n output += String.fromCharCode(buf[ind]);\n }\n }\n return output;\n}", "function start() {\n // Initializer list specifies the number of elements and \n // a value for each element\n var colors = new Array(\"cyan\", \"magenta\", \"yellow\", \"black\");\n var integers1 = [2, 4, 6, 8];\n var integers2 = [2, , , 8];\n\n outputArray(\"Array colors contains\", colors, document.getElementById(\"output1\") );\n outputArray(\"Array integers1 contains\", integers1, document.getElementById(\"output2\") );\n outputArray(\"Array integers2 contains\", integers2, document.getElementById(\"output3\") );\n}", "function disp1() { \n return new Array(\"Shiva\",\"Tom\",\"Jack\",\"Jill\") \n }", "function print2DArray(array)\n{\n\tvar n = array.length;\n\tvar out;\n\tvar i = 0;\n\tvar j = 0;\n\tfor( i = 0; i < n ; i++)\n\t{\n\t\tfor( j=0; j < n; j++)\n\t\t{\n\t\t\tout = out + array[i][j];\n\t\t\tif ( j < n - 1)\n\t\t\t\tout = out + \" \\t\";\n\t\t}\n\t\tout = out + \"\\n\";\n\t}\n\t//print(out);\n\tdelete out\n}", "toArray() {\n\n }", "function mostrarArray(elemtos, textoCUstom = \"\") {\n document.write(\"<h1>Contenido del Array \" + textoCUstom + \"</h1>\");\n document.write(\"<ul>\")\n elemtos.forEach((element, index) => {\n document.write(\"<li><strong>\" + numeros[index] + \"</strong></h1>\")\n });\n document.write(\"</ul>\")\n}", "function debugArrayPrint(arr) {\n\t\tvar output = '';\n\t\tfor (var j = 0; j < arr.length; j++) {\n\t\t\tfor (var p = 0; p < arr[j].length; p++) {\n\t\t\t\toutput += String(arr[j][p]);\n\t\t\t}\n\t\t\toutput += \"\\n\";\n\t\t}\n\t\tconsole.log(output);\n\t}", "function arrayToString(arr) {\n return arr.join(\"\")\n }", "function printArray ( array ) {\n\n\tfor ( var i = 0; i < array.length; i++ ) {\n\t\t\n\t\tconsole.log( array[i] );\n\n\t};\n\n}", "printArrayAndCleanP() {\n document.getElementById('demo').innerHTML = this.formatArray()\n\n document.getElementById('inp').value = ''\n }", "function showArray() {\n document.getElementById('title').innerHTML = thisIsArray;\n}", "function log(array) {\n console.log(array[0]);\n console.log(array[1]);\n}", "function pringCarsArray() {\r\n for (var i = 0; i < cars.length; i++) {\r\n console.log(\"cars[\" + i + \"] = \" + cars[i].toString());\r\n }\r\n}", "function afficheTab(array) {\n //affichage du tableau\n var array;\n alert(array.join(', '));\n console.log(array);\n}", "function printer(arr) {\n for(var index = 0; index < arr.length; index++) {\n console.log(arr[index]);\n }\n}", "function SpecialArray() {\n var values = new Array();\n\n values.push.apply(values, arguments);\n \n values.toPipedString = function() {\n return this.join(\"|\");\n };\n \n return values;\n}", "function mostrarArray(elementos, textoCustom = \"\"){\n document.write(\"<h1>Contenido del Array \"+ textoCustom+\"</h1>\");\n document.write(\"<ul>\")\n elementos.forEach((elemento) => {\n document.write(\"<li>\"+elemento+\"</li>\");\n })\n document.write(\"</ul>\")\n\n}", "function displayArray(arr) {\n if (arr.length == 0) return;\n console.log(arr[0]);\n return displayArray(arr.slice(1, arr.length));\n}", "function outputPlanets (element, index, array) {\n\tconsole.log('array[' + index + '] = ' + element);\n}", "function print_Array(arr){\r\n for(var i=0; i<arr.length; i++){\r\n console.log(arr[i])\r\n }\r\n}", "function printArrayValues(array) {\n // YOUR CODE BELOW HERE //\n // using a for loop, iterate through the array\n // use .length prop\n for (var i = 0; i < array.length; i++){\n // print its values to console\n console.log(array[i]);\n }\n \n \n \n \n \n // YOUR CODE ABOVE HERE //\n}", "printEntryArray() {\r\n console.log(this._entry_array);\r\n }", "function arrayToList() {\n\n}", "function Array() {}", "function stringify(arr) {\n\tarr.forEach(function(number){\n\t\toutputStr += number + '\\n'\n\t});\n}", "function printArrayValues(array) {\n // YOUR CODE BELOW HERE //\n // use for loop to go through every value in the array\n for (var i = 0; i < array.length; i++){\n console.log(array[i]);\n }\n \n \n \n // YOUR CODE ABOVE HERE //\n}", "function nArray(num) {\r\n var num;\r\n var array = [];\r\n var listaArray = [];\r\n\r\n for (var i = 0; i < num; i++) {\r\n array = randomIntArrayLength(10, 1, 100);\r\n listaArray.push('<br>' + array);\r\n }\r\n return listaArray;\r\n}", "function print2DArray(array) {\n\tvar str = '';\n\tfor(var i=0; i<array.length; i++) {\n\t\tfor(var j=0; j<array[i].length; j++) {\n\t\t\t//console.log(array[i][j]);\n\n\t\t\tstr += ' ' + array[i][j];\n\t\t}\n\n\t\tstr += '\\n';\n\t}\n\tconsole.log(str);\n}", "function mostrarArray(elementos, textoCustom = \"\"){\n document.write(\"<h2>Contenido del Array \" + textoCustom + \" </h2>\");\n document.write(\"<ul>\")\n elementos.forEach((elemento, index) => {\n document.write(\"<li> \"+ elemento + \" </li>\");\n});\n document.write(\"</ul>\")\n}", "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 numarray(n) {\n resultArr = [n];\n for (i = 0; i < n; i++) {\n resultArr[i] = i ;\n }\n console.log(resultArr);\n}", "function _arrayToHTML(a) {\n if (a.length === 0) {\n return \"\";\n }\n if (typeof(a[0]) != 'object') {\n return toHTML(_objectToOL(a));\n } else if (! _sameProperties(a[0], a[1])) {\n return toHTML(_objectToOL(a));\n } else {\n return _likeObjectsToHTML(function (f) {\n\ta.forEach(function(value, i) {\n\t f({index: i}, value, {});\n\t });}, null);\n }\n}", "function printArray(){\n str = \"\";\n for (var i = 0; i < skuArr.length; i++) {\n str += skuArr[i] + \" -\" + qtyArr[i] + \"<br />\";\n }\n document.getElementById(\"display\").innerHTML += \"<br />\" + str;\n}", "static print(arr)\n {\n console.log(arr.matrix);\n console.log(arr.rows);\n console.log(arr.cols);\n\n }", "function array() {\n var arr = [6, 14];\n console.log(arr[0]);\n return arr[1];\n}", "function serialize_array_2d(arr) {\n// {{{\n\tvar str='';\n\tvar i = 0;\n\tstr += '' + arr[i][0];\n\tfor (var j = 1; j < arr[i].length; ++j) {\n\t\tstr += ',' + arr[i][j];\n\t}\n\n\tfor (var i = 1; i < arr.length; ++i) {\n\t\tstr += '|';\n\t\tstr += '' + arr[i][0];\n\t\tfor (var j = 1; j < arr[i].length; ++j) {\n\t\t\tstr += ',' + arr[i][j];\n\t\t}\n\t}\n\treturn str;\n// }}}\n}", "function arrayToString(array) {\n return array.join('')\n }", "function printArray(arr)\n {\n let n = arr.length;\n for (let i = 0; i < n; ++i)\n console.log(arr[i] + \" \");\n // console.log(\"<br>\");\n}", "function printArrayValues(array) {\n // YOUR CODE BELOW HERE //\n //Using a for loop, iterate through the entire array and print each value at each index.\n for (let i = 0; i < array.length; i++){\n console.log(array[i]);\n }\n \n \n \n // YOUR CODE ABOVE HERE //\n}", "function toArray(arr){\n var out = [];\n for(var i = 0; i < arr.length; i++){\n out.push([arr[i].x,arr[i].y])\n }\n return out\n}", "function showArray(arr){\n for ( i = 0; i < arr.length; i++ ) {\n console.log(\"vertices[\"+ i +\"] = \"+ arr[i]);\n }\n}", "function log(array) {\n console.log(array[0]);\n console.log(array[1]);\n}", "function displayArray(array)\n{\n\t'use strict';\n\t\n\t// If array is an object\n\tif(typeof array == \"object\")\n\t{\n\t\t// Display array on web page\n\t\tdocument.getElementById(\"array\").innerHTML = array;\n\t}\n}" ]
[ "0.7625371", "0.7390827", "0.73558474", "0.7337655", "0.72103214", "0.7100164", "0.7075473", "0.68633175", "0.68230885", "0.6666615", "0.66453016", "0.6614072", "0.6504439", "0.6481119", "0.6422144", "0.6419136", "0.6419136", "0.63970864", "0.6395362", "0.63842034", "0.6350132", "0.63367575", "0.6327898", "0.6301502", "0.6301047", "0.6291811", "0.6287595", "0.6270767", "0.62482184", "0.6226743", "0.62228733", "0.6214962", "0.6214962", "0.6214962", "0.6209613", "0.6174188", "0.61641586", "0.61556727", "0.6153415", "0.6148859", "0.6146003", "0.6128587", "0.6128422", "0.61141276", "0.61105156", "0.60918725", "0.6075349", "0.6075107", "0.6071847", "0.60557026", "0.60382557", "0.6034247", "0.60315585", "0.60040915", "0.6001513", "0.5993261", "0.5989931", "0.59848255", "0.5976703", "0.5972741", "0.5967804", "0.5967132", "0.59657264", "0.5965183", "0.59651285", "0.59635454", "0.5962508", "0.5960442", "0.59583515", "0.5954424", "0.59424937", "0.594092", "0.5934601", "0.591807", "0.58956534", "0.5890118", "0.5876019", "0.5865571", "0.5854524", "0.58525205", "0.5843878", "0.583877", "0.58283937", "0.5827569", "0.5820243", "0.58000755", "0.5785582", "0.57851875", "0.5766935", "0.57654804", "0.575415", "0.5752937", "0.57518286", "0.57479787", "0.57462585", "0.5736275", "0.57334405", "0.5728731", "0.57236475", "0.5722267" ]
0.75947565
1
This takes care of all updating values.
render() { return React.createElement("span", { class: "col", style: { padding: '10px', color: 'white', fontWeight: 'bold', fontSize: '12px' } }, " ", this.props.indexName, " : ", this.props.indexPrice, " "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n\t this.value = this.originalInputValue;\n\t }", "function update() {\n // ... no implementation required\n }", "valuesUpdate() {\n this.updateHistory()\n\n this.Volume = this.getVolume()\n this.Shuffle = this.getShuffle()\n this.Loop = this.getLoop()\n this.isPlaying = this.getIsPlaying()\n this.isInactive = this.getIsInactive()\n this.Advertisement = this.getAdvertisement()\n this.Artist = this.getArtist()\n this.Title = this.getTitle()\n this.Position = this.getPosition()\n this.Duration = this.getDuration()\n this.Timestamp = new Date()\n }", "_update() {\n }", "function update() {}", "_updateValue(value) {\n const valuesHandler = this._valuesHandler;\n valuesHandler.updateValue(valuesHandler.getActualValue(value));\n }", "updateValues() {\n const { selectedkey, cdata, onEdit } = this.props;\n let currentcomponent = { ...cdata[selectedkey] };\n let newvalues = getValues(\n this.CurveSelect.value,\n parseFloat(this.totalEnergyEntry.value.replace(\",\", \".\")),\n currentcomponent.values\n );\n currentcomponent.values = newvalues;\n onEdit(selectedkey, currentcomponent);\n }", "update()\n {\n \n }", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update(){}", "update(){}", "update(){}", "update(startingData) {}", "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "update() {\n // Subclasses should override\n }", "updated() {}", "update () {}", "function update() {\n\t\t\n\t}", "updated(_changedProperties) { }", "function updateValue()/*:void*/ {\n if (this.valueDirty$nJmn) {\n this.computeAndTrack$nJmn();\n }\n }", "update() { }", "update() { }", "function updateValues() {\r\n let given_value = temperature_value.value;\r\n convert(temperature, given_value);\r\n}", "async update() {}", "updateToAll() {}", "update() {\n this.dataChanged = true;\n this.persons.all = undefined;\n this.jobTitles.all = undefined;\n this.updateFiltered();\n this.updateTimed();\n }", "function updateAll() {\n validate();\n calculate();\n updateDose();\n DrawDose();\n}", "update()\n\t{ \n\t\tthrow new Error(\"update() method not implemented\");\n\t}", "update() {\n \n }", "updated(_changedProperties) {\n }", "updated(_changedProperties) {\n }", "updated(_changedProperties) {\n }", "_update() {\n const revision = this.model.get('fileRevision');\n const diffRevision = this.model.get('diffRevision');\n\n if (diffRevision) {\n this._values = [diffRevision, revision];\n } else {\n this._values = [0, revision];\n }\n\n if (this._rendered) {\n this._updateHandles();\n }\n }", "updated(_changedProperties){}", "updated(_changedProperties){}", "update() {\n // ...\n }", "update(t) {}", "update() {\n }", "update() {\n }", "update() {\n }", "function update() {\n calculateMonthlyPayment(values);\n updateMonthly(monthlyPayment);\n }", "recalculateValues() {\n this.remainingTime = this.startingTime;\n this.decreasePerInterval = this.startingProgressPercent / this.startingTime;\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 update(){\n keepResources()\n keepPopulation();\n keepProtection();\n keepPolitics();\n keepTech();\n}", "function _update() {\r\n this.component[this.prop] = this.control[this.prop];\r\n }", "update( e ){\n // Assign to let changedID ID of slider which has been changed\n let changedID = e.target.id;\n let value = e.target.value;\n if (changedID === 'sliderAmount') {\n this.setState({valueAmount: e.target.value});\n }\n if (changedID === 'sliderDuration'){\n this.setState({valueDuration: e.target.value});\n }\n\n\n this.calculate(changedID, value);\n }", "updateValue() {\n this.value = this.getValueFromView();\n this.emit(this.value);\n }", "function update() {\n // Extract from the object id the corresponding index of the array\n let index = checkIndex(this.id)[0];\n\n // Update the array based on the existing value of the array\n if (binaryNumbers[index]) {\n binaryNumbers[index] = 0;\n } else {\n binaryNumbers[index] = 1;\n }\n\n setIconAndNumbers();\n setDecimal();\n}", "update() {\r\n throw new Error('must be set in subclass');\r\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\t if (this.originalInputValue === '') {\n\t this._reset();\n\t }\n\t }", "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n }", "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n }", "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n }", "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n redrawTicks();\n }", "update(data) {\n this.data = data || this.data;\n this._updateID++;\n }", "function adjustObsSetters() {\r\n\r\n }", "function update() {\n\n var fluc = $rootScope.model.fluctuating;\n var rec = $rootScope.model.recurring;\n var inc = $rootScope.model.income;\n\n $rootScope.model.expTotal = 0;\n $rootScope.model.flucTotal = 0;\n $rootScope.model.recTotal = 0;\n $rootScope.model.inTotal = 0;\n\n if ((fluc !== undefined || rec !== undefined) && $rootScope.model.income != undefined) {\n\n fluc.forEach(function(entry) {\n if (entry)\n $rootScope.model.expTotal += entry.value;\n $rootScope.model.flucTotal += entry.value;\n });\n\n rec.forEach(function(entry) {\n if (entry)\n $rootScope.model.expTotal += entry.value;\n $rootScope.model.recTotal += entry.value;\n\n });\n\n inc.forEach(function(entry) {\n if (entry)\n $rootScope.model.inTotal += entry.value;\n\n });\n\n\n $rootScope.model.amountLeft = $rootScope.model.inTotal - $rootScope.model.expTotal;\n $rootScope.model.perDay = $rootScope.model.amountLeft / $rootScope.daysLeft;\n\t\t filterM();\n }\n }", "updated(_changedProperties) {\n }", "function updateValuesAndStates() {\n [values, states] = generateDefaultStateArray(getItemCount());\n}", "function update() {\n \n}", "shouldUpdate(_changedProperties){return true;}", "updated(changedProperties) {\n }", "updateAllVarCache() {\n const { delta: { varLastCalcIndex }, updateVariable } = this;\n updateVariable(varLastCalcIndex);\n }", "function updateValues() {\n const amounts = getAmountsArray(transactions);\n const total = getTotal(amounts);\n const income = getIncome(amounts);\n const expense = getExpense(amounts);\n balance.innerText = \"€\" + total;\n money_plus.innerText = \"€\" + income;\n money_minus.innerText = \"€\" + expense;\n}", "update (data) {\n for (let key in data) {\n if (this.hasOwnProperty(key)) { // Can only update already defined properties\n this[key] = data[key];\n }\n }\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "updateValue (val) {\n this._value = val;\n }", "function updateroster() {\n\n}", "afterUpdate() {}", "function updateAll() {\n updateForces();\n updateDisplay();\n}", "updateSelfData(ro) {}", "update(delta) {}", "readAfterUpdate() {\n\t\tthis.enableSubmit();\n\t}", "readAfterUpdate() {\n\t\tthis.enableSubmit();\n\t}", "function updateValues() {\n const deposits = TransactionData.map(transaction => transaction.deposit);\n const loans = TransactionData.map(transaction => transaction.loan);\n const total_deposit = deposits.reduce((acc, item) => (acc += item), 0).toFixed(2);\n const total_loan = loans.reduce((acc, item) => (acc += item), 0).toFixed(2);\n const bal = total_deposit - total_loan;\n balance.innerText = `$${bal}`;\n money_plus.innerText = `$${total_deposit}`;\n money_minus.innerText = `$${total_loan}`;\n reco.innerText = (bal >= 0)? \"You Have Sound Financial Health\": \"Your Financial Health is Weak\";\n}", "function updateData() {\n\t/*\n\t* TODO: Fetch data\n\t*/\n}", "function updateValue( value ) \n{\n \n updateComponentValue( value );\n \n}", "update() {\n throw new Error(\"Not Implemented\");\n }" ]
[ "0.7015165", "0.7004861", "0.699352", "0.6926447", "0.6907531", "0.68462944", "0.6832741", "0.68247026", "0.68210346", "0.68210346", "0.68210346", "0.68210346", "0.68210346", "0.68210346", "0.68210346", "0.68210346", "0.68210346", "0.6817754", "0.6817754", "0.6817754", "0.67669356", "0.6757699", "0.6757699", "0.67147297", "0.67059696", "0.66959655", "0.660046", "0.6599563", "0.65481603", "0.65105426", "0.65105426", "0.6499162", "0.6486828", "0.64727175", "0.64629287", "0.6412932", "0.63673115", "0.63380796", "0.63272834", "0.63272834", "0.63272834", "0.6317948", "0.62930286", "0.62930286", "0.6292454", "0.6284854", "0.62845826", "0.62845826", "0.62845826", "0.6283855", "0.62683773", "0.62610835", "0.62610835", "0.6237508", "0.62277395", "0.62254936", "0.62031245", "0.6202726", "0.6196855", "0.6195793", "0.6195793", "0.6195793", "0.6195793", "0.6195793", "0.6195793", "0.6195793", "0.6187798", "0.61787266", "0.61787266", "0.61787266", "0.616754", "0.6163984", "0.6161627", "0.6150509", "0.6149616", "0.61454594", "0.6138535", "0.6135539", "0.6133004", "0.6131717", "0.6122463", "0.6120853", "0.61190933", "0.61190933", "0.61190933", "0.61190933", "0.61190933", "0.61190933", "0.61190933", "0.61157936", "0.61033916", "0.6098484", "0.609568", "0.6081689", "0.60803664", "0.60782397", "0.60782397", "0.60757625", "0.6075702", "0.607443", "0.60652614" ]
0.0
-1
this needs a bunch of boxes
constructor(props) { super(props); this.forexList = ['EUR/USD', 'USD/CAD', 'USD/JPY', 'GBP/USD', 'AUD/USD']; this.url = "https://financialmodelingprep.com/api/v3/forex"; this.oneArray = []; $.ajax({ url: this.url, success: data => { console.log("Setting initial values for forex."); let x = data['forexList']; this.state = { valDict: { 'EUR/USD': x[0]['bid'], 'USD/CAD': x[7]['bid'], 'USD/JPY': x[1]['bid'], 'GBP/USD': x[2]['bid'], 'AUD/USD': x[8]['bid'] } }; this.oneArray = []; this.forexList.forEach(name => { this.oneArray.push(React.createElement(IndexBox, { indexName: name, indexPrice: this.state.valDict[name] })); }); }, async: false }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mkBoxes() {\n boxes.forEach(function(val){\n ctx.drawImage(boxImg, val[0] * boxSize, val[1] * boxSize, boxSize, boxSize);\n })\n}", "function boxes() {\n rectMode(CORNER);\n\n //array of different colored boxes\n for (var i = 0; i <= width - 20; i += 20) {\n for (var j = 0; j <= height - 20; j += 20) {\n stroke(0);\n fill(i * 0.50, j * 0.50, 180, 90);\n rect(i, j, 20, 20);\n }\n }\n\n noStroke();\n fill(textColor2);\n text(\"Move the mouse to make the white box move.\", 50, 50);\n\n}", "function BoxesManager() {\n\t\t \tvar iBoxsNum = name.length; \n\t\t\t//Creates the imgs\n\t\t\tfor (var i=0; i<iBoxsNum; i++) {\n\t\t\t\t//Create new img instance\n\t\t\t\tvar box = new Box(i);\t\n\t\t\t}\n\t\t\tvar div = document.createElement('div');\n\t\t\tdiv.className = \"clear\";\n\t\t\tvar main = document.getElementsByTagName(\"main\")[0];\n\t\t\tmain.appendChild(div);\n\n\t\t}", "function makeBoxes(){\n var divWidth = 0;\n var Xval = 0;\n var Yval = 0;\n for (var i = 0; i < colLength; i++) {\n var currentVal = boxArray[i][0];\n divWidth = 0;\n Yval += boxHeight;\n for (var j = 0; j <= rowLength - 1; j++) {\n divWidth += boxWidth;\n Xval += boxWidth;\n if (boxArray[i][j + 1] !== currentVal) {\n makeDiv({\n width: divWidth,\n divXlocation: Xval,\n divYlocation: Yval\n });\n currentVal = boxArray[i][j + 1];\n divWidth = 0;\n }\n }\n }\n return null;\n }", "function setupBoxes() {\n\tgirl.setupBoxes([[false,[3,2],0],[false,[6,2],0],[false,[3,9],0],[false,[1,12],0]]);\n\tguy.setupBoxes([[false,[16,2],0],[false,[10,2],0],[false,[11,11],0],[false,[17,8],0]]);\n}", "function drawBoxes(boxesArray)\t{\n\tvar scene = document.getElementById('scene');\n\tfor (i=0; i < boxesArray.length; i++)\t{\n\t\tvar myDiv = document.createElement('div');\n\t\tmyDiv.setAttribute('id',boxesArray[i].id);\n\t\tmyDiv.style.backgroundColor = boxesArray[i].color;\n\t\tmyDiv.setAttribute('class','box');\n\t\tmyDiv.style.left = boxesArray[i].x +'px';\n\t\tmyDiv.style.top = boxesArray[i].y + 'px';\n\t\tmyDiv.innerHTML = boxesArray[i].name;\n\t\tmyDiv.onclick = displayBoxContents;\n\t\tscene.appendChild(myDiv);\n\t}\n\t\n}", "function drawBoxes(boxes) {\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n };\n }", "function createBox()\n\t{\n\t\tbox = that.add('rect', {\n\t\t\tcolor: style.boxColor,\n\t\t\tborderWidth: style.borderWidth,\n\t\t\tborderColor: style.borderColor,\n\t\t\tdepth: that.depth\n\t\t}, fw.dockTo(that));\n\t}", "function selectTheBoxs(){\r\n\t\tif($(mark).width() == 0 || $(mark).height() == 0) return;\r\n\t\tfor(var i=0,j=oVar.iListNum;i<j;i++){\r\n\t\t\tvar oThisList = oVar.oLists.eq(i),\r\n\t\t\t\tiListL = oThisList.offset().left,\r\n\t\t\t\tiListT = oThisList.offset().top,\r\n\t\t\t\tiListR = iListL + oVar.iBoxW,\r\n\t\t\t\tiListB = iListT + oVar.iBoxH,\r\n\t\t\t\tselBoxL = $(mark).offset().left,\r\n\t\t\t\tselBoxT = $(mark).offset().top,\r\n\t\t\t\tselBoxR = $(mark).width() + selBoxL,\r\n\t\t\t\tselBoxB = $(mark).height() + selBoxT;\r\n\t\t\tif(selBoxL == 0 && selBoxT ==0) return;\r\n\t\t\tif(iListR > selBoxL && iListB > selBoxT && iListL < selBoxR && iListT < selBoxB){\r\n\t\t\t\tif(!oThisList.hasClass('broken') && $('.desc', oThisList).attr('category') != 'system'){\r\n\t\t\t\t\toThisList.addClass('focus');\r\n\t\t\t\t\t$('input[type=\"checkbox\"]', oThisList).attr('checked',true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$('input[type=\"checkbox\"]', oThisList).hide();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\toThisList.removeClass('focus');\r\n\t\t\t\t$('input[type=\"checkbox\"]', oThisList).attr('checked',false);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function drawBoxes(boxes) {\n progressMessage.setProgressMessage(\"draw bounding boxes\");\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }\n}", "function addBox(coin) {\nvar options = {\n width : \"18%\",\n height : \"25%\",\n content: \"Coin Pool Net Ratio\",\n tags: true,\n border: {\n type: 'line'\n },\n style: {\n fg: 'white',\n border: {\n fg: '#f0f0f0'\n },\n hover: {\n bg: 'green'\n }\n }\n}\nif (r == 1) {\n options.right = r\n} else {\n options.left = l\n}\noptions.label = \"{bold}\"+coin+\"{/bold}\";\nif (b == 1) {\n options.bottom = b;\n} else {\n options.top= t;\n}\nconsole.log(coin + t + b + l + r );\nbox[coin] = blessed.box( options);\n\n\n\nscreen.append(box[coin]);\n \n P++;\n l = P*20 + \"%\";\n \n if (P == '5' ) {\n r = '';\n rcount++;\n t = rcount * 25 + \"%\";\n l = '0%';\n P = 0;\n } \n \n \n\n}", "function drawBoxes(boxes) {\n boxpolys = new google.maps.Rectangle({\n bounds: boxes,\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }", "function resizeBoxDraw(){\n state.boxArr.forEach(function(el){\n ctx.fillStyle = el.resizeStyle;\n ctx.fillRect(el.resize.top.x, el.resize.top.y, el.resize.top.w, el.resize.top.h)\n // ctx.fillRect(el.resize.bottom.x, el.resize.bottom.y, el.resize.bottom.w, el.resize.bottom.h)\n // ctx.fillRect(el.resize.left.x, el.resize.left.y, el.resize.left.w, el.resize.left.h)\n ctx.fillRect(el.resize.right.x, el.resize.right.y, el.resize.right.w, el.resize.right.h) \n })\n \n }", "function drawBoxes(boxes) {\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }\n}", "function drawBoxes() {\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }\n}", "function makeBox() {\n\n}", "function drawBoxes(boxes) {\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 3,\n map: map\n });\n }\n}", "addBox(){\n\t\tvar x=Math.floor((Math.random()*this.width)); \n\t\tvar y=Math.floor((Math.random()*this.height)); \n\t\tif(this.getSquare(x,y)===null){\n\t\t\tvar velocity = new Pair(0,0);\n\t\t\tvar length = 50;\n\t\t\tvar health = 50;\n\t\t\tvar colour= 'rgba(223, 252, 3, 0.6)';\n\t\t\tvar position = new Pair(x,y);\n\t\t\t// check if the boxes would exceed the world\n\t\t\tif (position.x - length < 0){\n\t\t\t\tlength = position.x // boxes start from the left bound\n\t\t\t} \n\t\t\tif (position.x + length > this.width){\n\t\t\t\tlength = this.width - position.x // boxes end at the right bound\n\t\t\t} \n\t\t\tif (position.y - length < 0){\n\t\t\t\tlength = position.y // boxes start from the upper bound\n\t\t\t} \n\t\t\tif (position.y + length > this.height){\n\t\t\t\tlength = this.height - position.y // boxes end at the lower bound\n\t\t\t}\n\t\t\t// check if the boxes disappear after the above adjustments \n\t\t\tif (length != 0){\n\t\t\t\t// create the boxes and add to the list\n\t\t\t\t// the health of the boxes would be 50\n\t\t\t\tvar box = new Box(this, position, velocity, colour, length, health);\n\t\t\t\tthis.addSquare(box);\n\t\t\t\tthis.boxes_number += 1; // update the enemies number for stats\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "function boxes(n, content, cls) {\n if (!content) { content = ''; }\n\n var div = elem('div').addClass('boxes');\n for (var i = 1; i <= n; i++) {\n div.append(box(content, cls));\n }\n\n return div;\n}", "function BoxRenderer() {}", "drawBoxes () {\n let c = document.getElementById(\"canvas\").getContext(\"2d\");\n c.fillStyle = \"black\";\n for(let i = 1; i < this.state.m; i++) {\n c.fillRect(i * 20, 0, 1, this.state.n * this.state.cellSize);\n }\n for(let i = 1; i < this.state.n; i++) {\n c.fillRect(0, i * 20, this.state.m * this.state.cellSize, 1);\n }\n }", "function createBoxes(formArray,myCounter)\t{\n// assign the 0,1,2 array elements to their corresponding variables here\n\tvar boxName = formArray[0];\n\tvar boxColor = formArray[1];\n\tvar numBoxes = formArray[2];\n// create the box object\n\tfor (i=0; i < numBoxes; i++)\t{\n\t\tvar boxId = myCounter+100;\t\n\t\tvar sceneDiv = document.getElementById(\"scene\");\n\t\tvar x = Math.floor(Math.random() * (sceneDiv.offsetWidth-101));\n\t\tvar y = Math.floor(Math.random() * (sceneDiv.offsetHeight-101));\n\t\tvar myBox = new Box(boxId,boxName,boxColor,x,y);\n\t\tmyCounter +=1;\n\t\tboxes.push(myBox);\n\t\t}\n\t}", "function addBoxes () {\n // Create some cubes around the origin point\n for (var i = 0; i < BOX_QUANTITY; i++) {\n var angle = Math.PI * 2 * (i / BOX_QUANTITY);\n var geometry = new THREE.BoxGeometry(BOX_SIZE, BOX_SIZE, BOX_SIZE);\n var material = new THREE.MeshNormalMaterial();\n var cube = new THREE.Mesh(geometry, material);\n cube.position.set(Math.cos(angle) * BOX_DISTANCE, camera.position.y - 0.25, Math.sin(angle) * BOX_DISTANCE);\n scene.add(cube);\n }\n // Flip this switch so that we only perform this once\n boxesAdded = true;\n}", "function prepareOneSlideBox(slotholder, opt, visible) {\n\n var sh = slotholder;\n var img = sh.find('img')\n setSize(img, opt)\n var src = img.attr('src');\n var bgcolor = img.css('background-color');\n\n var w = img.data('neww');\n var h = img.data('newh');\n var fulloff = img.data(\"fxof\");\n if (fulloff == undefined)\n fulloff = 0;\n\n var fullyoff = img.data(\"fyof\");\n if (img.data('fullwidthcentering') != \"on\" || fullyoff == undefined)\n fullyoff = 0;\n\n\n\n var off = 0;\n\n\n\n\n // SET THE MINIMAL SIZE OF A BOX\n var basicsize = 0;\n if (opt.sloth > opt.slotw)\n basicsize = opt.sloth\n else\n basicsize = opt.slotw;\n\n\n if (!visible) {\n var off = 0 - basicsize;\n }\n\n opt.slotw = basicsize;\n opt.sloth = basicsize;\n var x = 0;\n var y = 0;\n\n\n\n for (var j = 0; j < opt.slots; j++) {\n\n y = 0;\n for (var i = 0; i < opt.slots; i++) {\n\n\n sh.append('<div class=\"slot\" ' +\n 'style=\"position:absolute;' +\n 'top:' + (fullyoff + y) + 'px;' +\n 'left:' + (fulloff + x) + 'px;' +\n 'width:' + basicsize + 'px;' +\n 'height:' + basicsize + 'px;' +\n 'overflow:hidden;\">' +\n '<div class=\"slotslide\" data-x=\"' + x + '\" data-y=\"' + y + '\" ' +\n 'style=\"position:absolute;' +\n 'top:' + (0) + 'px;' +\n 'left:' + (0) + 'px;' +\n 'width:' + basicsize + 'px;' +\n 'height:' + basicsize + 'px;' +\n 'overflow:hidden;\">' +\n '<img style=\"position:absolute;' +\n 'top:' + (0 - y) + 'px;' +\n 'left:' + (0 - x) + 'px;' +\n 'width:' + w + 'px;' +\n 'height:' + h + 'px' +\n 'background-color:' + bgcolor + ';\"' +\n 'src=\"' + src + '\"></div></div>');\n y = y + basicsize;\n }\n x = x + basicsize;\n }\n }", "function boxesGenerator (value){\n\n mainContainer.innerHTML = \"\";\n\n const percentWidth = Math.sqrt(value);\n const boxDimension = 100 / percentWidth;\n \n for (let i = 1; i <= value; i++){\n const boxN = document.createElement(\"div\");\n boxN.classList.add(\"box\");\n boxN.innerHTML += `<p class=\"user_select_none\">${i}</p>`\n boxN.style.width = boxDimension + \"%\";\n boxN.style.height = boxDimension + \"%\"; \n //qui ci devi mettere il listener al click della box (se non lo metti qua)\n boxN.addEventListener(\"click\", function(){\n this.classList.toggle(\"clicked\")\n }) \n \n mainContainer.append(boxN);\n }\n\n}", "function drawBox () {\n\n\t\t\tvar $topBar = $('<div class=\"round-top back-right-image\"><div class=\"round-top-fill back-left-image\"></div></div>');\n\n\t\t\tif(opts.headerTitle != \"\" && opts.headerThickness == \"thick\") {\n\t\t\t\tvar $text = $('<span class=\"text-top\"></span>').html(opts.headerTitle)\n\n\t\t\t\t$topBar.find('.round-top-fill').html($text);\n\t\t\t}\n\n\t\t\tvar $bodyContent = $('<div class=\"round-body\"><div class=\"round-body-content\"></div></div>');\n\n\t\t\tif(opts.type != \"\" && !opts.wrapContent){\n\t\t\t\tvar content = \"\";\n\n\t\t\t\tcontent\t+= '<div class=\"message-body\">';\n\t\t\t\tfor (i in messages) {\n\t\t\t\t\tif (typeof i != typeof function(){}) {\n\t\t\t\t\t\tif(i > 0) {\n\t\t\t\t\t\t\tfor( j=0; j < messages[i].length; j++) {\n\t\t\t\t\t\t\t\tcontent\t+= '<div class=\"message-detail\">' + messages[i][j] + '</div>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontent\t+= '<div class=\"message-summary\">' + messages[i][0] + '</div>';\n\t\t\t\t\t\t\tcontent\t+= '<div class=\"message-detail\">' + messages[i][1] + '</div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t};\n\t\t\t\tcontent\t+= '</div>';\n\n\t\t\t\t$bodyContent.children().append(content);\n\t\t\t}\n\n\t\t\tvar $bottomBar = $('<div class=\"round-bottom back-right-image\"><div class=\"round-bottom-fill back-left-image\"></div></div>');\n\n\t\t\t//for error/warning/success boxes that have no fill color specifications\n\t\t\tif(opts.fillColor != \"\")\n\t\t\t\topts.fillColor = opts.fillColor + \"-\";\n\n\t\t\tvar $container = $('<div class=\"round-container\"></div>')\n\t\t\t\t\t\t\t\t\t.addClass(opts.borderColor+\"-\"+opts.fillColor+\"container\")\n\t\t\t\t\t\t\t\t\t.append($topBar)\n\t\t\t\t\t\t\t\t\t.append($bodyContent)\n\t\t\t\t\t\t\t\t\t.append($bottomBar);\n\n\t\t\t//add an ID to the container if specified\n\t\t\tif(opts.containerId != \"\"){\n\t\t\t\t$container.attr('id',opts.containerId);\n\t\t\t}\n\n\t\t\t//add header thickness class to container if specified\n\t\t\tif(opts.headerThickness != \"\"){\n\t\t\t\t$container.addClass(opts.headerThickness+\"-top\");\n\t\t\t}\n\n\t\t\t//add more classes if specified\n\t\t\tif(opts.containerClass != \"\"){\t//FIX THIS...ONLY ADDS 1 CLASS\n\t\t\t\t$container.addClass(opts.containerClass);\n\t\t\t}\n\n\t\t\t$container.css({width : opts.width});\n\n\t\t\treturn $container;\n\t\t}", "function draw_box(element, classes) {\n\n var element_p;\n\n if (typeof $(element) === 'undefined') {\n element_p = $(element);\n } else {\n element_p = iframe.find(element);\n }\n\n // Be sure this element have.\n if (element_p.length > 0) {\n\n var marginTop = element_p.css(\"margin-top\");\n var marginBottom = element_p.css(\"margin-bottom\");\n var marginLeft = element_p.css(\"margin-left\");\n var marginRight = element_p.css(\"margin-right\");\n\n var paddingTop = element_p.css(\"padding-top\");\n var paddingBottom = element_p.css(\"padding-bottom\");\n var paddingLeft = element_p.css(\"padding-left\");\n var paddingRight = element_p.css(\"padding-right\");\n\n //Dynamic boxes variables\n var element_offset = element_p.offset();\n var topBoxes = element_offset.top;\n var leftBoxes = element_offset.left;\n if (leftBoxes < 0) {\n leftBoxes = 0;\n }\n var widthBoxes = element_p.outerWidth(false);\n var heightBoxes = element_p.outerHeight(false);\n\n var bottomBoxes = topBoxes + heightBoxes;\n\n var rightExtra = 1;\n var rightS = 1;\n\n if (is_content_selected()) {\n rightExtra = 2;\n rightS = 2;\n }\n\n var rightBoxes = leftBoxes + widthBoxes - rightExtra;\n\n var windowWidth = $(window).width();\n\n // If right border left is more then screen\n if (rightBoxes > (windowWidth - window.scroll_width - rightS)) {\n rightBoxes = windowWidth - window.scroll_width - rightS;\n }\n\n // If bottom border left is more then screen\n if ((leftBoxes + widthBoxes) > windowWidth) {\n widthBoxes = windowWidth - leftBoxes - 1;\n }\n\n if (heightBoxes > 1 && widthBoxes > 1) {\n\n // Dynamic Box\n if (iframe.find(\".\" + classes + \"-top\").length === 0) {\n iframeBody.append(\"<div class='\" + classes + \"-top'></div><div class='\" + classes + \"-bottom'></div><div class='\" + classes + \"-left'></div><div class='\" + classes + \"-right'></div>\");\n }\n\n // Margin append\n if (iframe.find(\".\" + classes + \"-margin-top\").length === 0) {\n iframeBody.append(\"<div class='\" + classes + \"-margin-top'></div><div class='\" + classes + \"-margin-bottom'></div><div class='\" + classes + \"-margin-left'></div><div class='\" + classes + \"-margin-right'></div>\");\n }\n\n // Padding append.\n if (iframe.find(\".\" + classes + \"-padding-top\").length === 0) {\n iframeBody.append(\"<div class='\" + classes + \"-padding-top'></div><div class='\" + classes + \"-padding-bottom'></div><div class='\" + classes + \"-padding-left'></div><div class='\" + classes + \"-padding-right'></div>\");\n }\n\n // Dynamic Boxes position\n iframe.find(\".\" + classes + \"-top\").css(\"top\", topBoxes).css(\"left\", leftBoxes).css(\"width\", widthBoxes);\n\n iframe.find(\".\" + classes + \"-bottom\").css(\"top\", bottomBoxes).css(\"left\", leftBoxes).css(\"width\", widthBoxes);\n\n iframe.find(\".\" + classes + \"-left\").css(\"top\", topBoxes).css(\"left\", leftBoxes).css(\"height\", heightBoxes);\n\n iframe.find(\".\" + classes + \"-right\").css(\"top\", topBoxes).css(\"left\", rightBoxes).css(\"height\", heightBoxes);\n\n // Top Margin\n iframe.find(\".\" + classes + \"-margin-top\").css(\"top\", parseFloat(topBoxes) - parseFloat(marginTop)).css(\"left\", parseFloat(leftBoxes) - parseFloat(marginLeft)).css(\"width\", parseFloat(widthBoxes) + parseFloat(marginRight) + parseFloat(marginLeft)).css(\"height\", marginTop);\n\n // Bottom Margin\n iframe.find(\".\" + classes + \"-margin-bottom\").css(\"top\", bottomBoxes).css(\"left\", parseFloat(leftBoxes) - parseFloat(marginLeft)).css(\"width\", parseFloat(widthBoxes) + parseFloat(marginRight) + parseFloat(marginLeft)).css(\"height\", marginBottom);\n\n // Left Margin\n iframe.find(\".\" + classes + \"-margin-left\").css(\"top\", topBoxes).css(\"left\", parseFloat(leftBoxes) - parseFloat(marginLeft)).css(\"height\", heightBoxes).css(\"width\", marginLeft);\n\n // Right Margin\n iframe.find(\".\" + classes + \"-margin-right\").css(\"top\", topBoxes).css(\"left\", rightBoxes + 2).css(\"height\", heightBoxes).css(\"width\", marginRight);\n\n // Top Padding\n iframe.find(\".\" + classes + \"-padding-top\").css(\"top\", parseFloat(topBoxes)).css(\"left\", parseFloat(leftBoxes)).css(\"width\", parseFloat(widthBoxes / 2)).css(\"height\", paddingTop);\n\n // Bottom Padding\n iframe.find(\".\" + classes + \"-padding-bottom\").css(\"top\", bottomBoxes - parseFloat(paddingBottom)).css(\"left\", parseFloat(leftBoxes)).css(\"width\", parseFloat(widthBoxes / 2)).css(\"height\", paddingBottom);\n\n // Left Padding\n iframe.find(\".\" + classes + \"-padding-left\").css(\"top\", topBoxes).css(\"left\", parseFloat(leftBoxes)).css(\"height\", heightBoxes / 2).css(\"width\", paddingLeft);\n\n // Right Padding\n iframe.find(\".\" + classes + \"-padding-right\").css(\"top\", topBoxes).css(\"left\", rightBoxes - parseFloat(paddingRight)).css(\"height\", heightBoxes / 2).css(\"width\", paddingRight);\n\n if (is_resizing() == false && is_dragging() == false) {\n iframe.find(\".yp-selected-handle\").css(\"left\", leftBoxes).css(\"top\", topBoxes);\n }\n\n }\n\n }\n\n }", "function showBoxData(){\n state.boxArr.forEach(function(box){\n\n if(box.selected){\n inpX.value = box.x;//box.x;\n inpY.value = box.y;//box.y;\n inpW.value = box.w;//box.w;\n inpH.value = box.h;//box.h;\n inpText.value = box.text;\n inpKey.value = box.key;\n inpItem.value = box.item;\n inpXskew.value = box.xSkew;\n }\n })\n inpPaddingX.value = xPadding;\n inpPaddingY.value = yPadding;\n }", "function getBoxes() {\r\n for (i = 0; i < 9; i++) {\r\n var boxName = \"ticTacToeBox\" + (i + 1);\r\n var box = document.getElementById(boxName);\r\n boxes[i] = {\r\n boxId: box.id\r\n };\r\n }\r\n}", "function clear_boxes() {\n for (var tt of tooltips) { tt.remove(); tooltips.delete(tt); }\n for (var box of boxes) { box.remove(); boxes.delete(box); }\n while (vgvContainer.lastChild) { vgvContainer.remove(vgvContainer.lastChild); }\n}", "addRandomBox(){\n\n\t\t// use a do...while statement because there can't be intersecting polygons\n\t\tdo{\n\n\t\t\t// random x and y coordinates, width and height\n\t\t\tvar startX = Phaser.Math.Between(10, game.config.width - 10 - gameOptions.sizeRange.max);\n\t\t\tvar startY = Phaser.Math.Between(10, game.config.height - 10 - gameOptions.sizeRange.max);\n\t\t\tvar width = Phaser.Math.Between(gameOptions.sizeRange.min, gameOptions.sizeRange.max);\n\t\t\tvar height = Phaser.Math.Between(gameOptions.sizeRange.min, gameOptions.sizeRange.max);\n\n\t\t\t// check if current box intersects other boxes\n\t\t} while(this.boxesIntersect(startX, startY, width, height));\n\n\t\t// draw the box\n\t\tthis.wallGraphics.strokeRect(startX, startY, width, height);\n\n\t\t// insert box vertices into polygons array\n\t\tthis.polygons.push([[startX, startY], [startX + width, startY], [startX + width, startY + height], [startX, startY + height]]);\n\t}", "function boxCreator() {\n let attributesForBoxes = document.createAttribute('class');\n attributesForBoxes.value = 'box-attributes';\n let box = document.createElement('div');\n box.id = `box${i}`;\n box.setAttributeNode(attributesForBoxes);\n document.getElementById('game').appendChild(box);\n document.getElementById('game').style.display = 'flex';\n }", "generateBoxes(numBoxes){\n\t\twhile(numBoxes>0){\n\t\t\t\n\t\t\t//Get random x and y position based on canvas size\n\t\t\tvar x=Math.floor((Math.random()*(this.width-200))); \n\t\t\tvar y=Math.floor((Math.random()*(this.height-200))); \n\t\t\t\n\t\t\t//If an actor does not exist at (x, y) position\n\t\t\tif(this.getActor(x,y)===null){\n\t\t\t\t\n\t\t\t\tvar red=randint(255), green=randint(255), blue=randint(255);\n\t\t\t\t\n\t\t\t\t//Random integers in range code below from\n\t\t\t\t//https://stackoverflow.com/questions/1527803/generating-random-whole-numbers-in-javascript-in-a-specific-range\n\t\t\t\t//Set width and height values between 5 and 200 inclusive\n\t\t\t\tvar width = Math.floor(Math.random() * (200 - 5 + 1)) + 5;\n\t\t\t\tvar height = Math.floor(Math.random() * (200 - 5 + 1)) + 5;\n\t\t\t\t\n\t\t\t\tvar colour= 'rgba('+red+','+green+','+blue+','+0.75+')';\n\t\t\t\tvar position = new Pair(x,y);\n\t\t\t\tvar health = 3;\n\t\t\t\tvar type = \"Ammo\";\n\t\t\t\t\n\t\t\t\t//Randomly make a Box a gun box based on gunSpawn value\n\t\t\t\tvar gunSpawn = Math.floor(Math.random()*10);\n\t\t\t\tif (gunSpawn == 0){\n\t\t\t\t\ttype = \"Pistol\";\n\t\t\t\t\thealth = 100;\n\t\t\t\t} else if (gunSpawn == 1){\n\t\t\t\t\ttype = \"Sniper\";\n\t\t\t\t\thealth = 100;\n\t\t\t\t} else if (gunSpawn == 2){\n\t\t\t\t\ttype = \"Shotgun\";\n\t\t\t\t\thealth = 100;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//Add Box to actors\n\t\t\t\tvar b = new Box(this, \"Box\", position, colour, width, height, health, type);\n\t\t\t\tthis.addActor(b);\n\t\t\t\tnumBoxes--;\n\t\t\t}\n\t\t}\n\t}", "function addInitialBoxes() {\n for (var i = 0; i < 5; i++) {\n addBoxes();\n }\n}", "function addBox(width, height, center = [0, 0, 1]) {\n let object = {\n name: '',\n type: 'box',\n width: width,\n height: height,\n center: center,\n fill: '#FFFFFF',\n stroke: '#000000',\n actualStroke: '#000000',\n T: Math.identity(),\n R: Math.identity(),\n S: Math.identity(),\n angleRotation: 0\n }\n objectSelected = objects.push(object)\n drawObjects()\n return objectSelected\n }", "function renderBoxes(count) {\n var boxes = ''\n for (var i = 0; i < count; i++) {\n if (i == count / 2) {\n boxes += `<br>\n `\n }\n boxes += `\n <div class=\"testpoint-box\">\n <input name=\"testpoint-box\" type=\"checkbox\" id=\"ch${i + 1}\" name=\"ch${\n i + 1\n }\" value=\"ch${i + 1}\">\n <label class=\"put-left\" for=\"ch${i + 1}\"> CH${i + 1}</label> \n </div>`\n }\n return boxes\n}", "function prepareOneSlideBox(slotholder, opt, visible) {\n\n var sh = slotholder;\n var img = sh.find('img')\n setSize(img, opt)\n var src = img.attr('src');\n var w = img.data('neww');\n var h = img.data('newh');\n var fulloff = img.data(\"fxof\");\n if (fulloff == undefined) fulloff = 0;\n var off = 0;\n\n\n\n\n // SET THE MINIMAL SIZE OF A BOX\n var basicsize = 0;\n if (opt.sloth > opt.slotw)\n basicsize = opt.sloth\n else\n basicsize = opt.slotw;\n\n\n if (!visible) {\n var off = 0 - basicsize;\n }\n\n opt.slotw = basicsize;\n opt.sloth = basicsize;\n var x = 0;\n var y = 0;\n\n\n\n for (var j = 0; j < opt.slots; j++) {\n\n y = 0;\n for (var i = 0; i < opt.slots; i++) {\n\n\n sh.append('<div class=\"slot\" ' +\n 'style=\"position:absolute;' +\n 'top:' + y + 'px;' +\n 'left:' + (fulloff + x) + 'px;' +\n 'width:' + basicsize + 'px;' +\n 'height:' + basicsize + 'px;' +\n 'overflow:hidden;\">' +\n\n '<div class=\"slotslide\" data-x=\"' + x + '\" data-y=\"' + y + '\" ' +\n 'style=\"position:absolute;' +\n 'top:' + (0) + 'px;' +\n 'left:' + (0) + 'px;' +\n 'width:' + basicsize + 'px;' +\n 'height:' + basicsize + 'px;' +\n 'overflow:hidden;\">' +\n\n '<img style=\"position:absolute;' +\n 'top:' + (0 - y) + 'px;' +\n 'left:' + (0 - x) + 'px;' +\n 'width:' + w + 'px;' +\n 'height:' + h + 'px\"' +\n 'src=\"' + src + '\"></div></div>');\n y = y + basicsize;\n }\n x = x + basicsize;\n }\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 box(length) {\n for (var i = 0; i < 6; i++) {\n forward(length);\n right(60);\n }\n}", "function initialize_boxes() {\n \n // build stuff for the focus hero\n boxes['focus'] = {};\n boxes['focus']['talents'] = new TalentBox(6, null, [], [], vgvContainer);\n boxes['focus']['abilities'] = [];\n for (var i = 0; i < 6; i++) {\n boxes['focus']['abilities'].push(new AbilityBox(i, 6, null, [], vgvContainer));\n }\n boxes['focus']['items'] = [];\n for (var i = 0; i < 9; i++) {\n boxes['focus']['items'].push(new ItemBox(i, 6, null, vgvContainer));\n }\n \n // build hero avatar boxes\n boxes['avatars'] = [];\n for (var i = 0; i < 10; i++) {\n boxes['avatars'].push(new AvatarBox(i, vgvContainer));\n // boxes['avatars'][i].element.addEventListener('click', function(event) {console.log(TIMER)});\n }\n}", "constructor () {\n this.size = 16;\n this.grid_status = this.makeStatus();\n this.boxies = this.makeBoxes();\n }", "function createGrid(numBox){\n var box = '<div class=\"box\"></div>';\n for(var i = 1; i <= numBox; i++){\n for(var j = 1; j <= numBox; j++){\n $('#container').append('<div class=\"box\"></div>');\n }\n }\n var size = (400 - (numBox * 2)) / numBox;\n $('.box').css({'height': size, 'width': size});\n }", "getBoxes() {\n return this.boxes.map(\n box => this.getBoxData(box)\n );\n }", "function drawBoxes() {\n // Initialize boxElement (outside of the for loop below)\n let boxElement = document.createElement(\"span\");\n // Flag to determine if this is a huge box or not.\n let hugeBox = false;\n /* Note: These functions make use of the block-scope\n * i'm promised due to me using \"let\" when\n * instantiating boxElement; this function also\n * makes use of \"hiding\" or \"closure\".\n * I don't need any other function to see mutateBox\n * and I KNOW that right from the start, so might as\n * well make it's scope only the function that needs it.\n * Downside: It makes the drawBoxes function more\n * complex and harder to understand. */\n /** Will shape and color a box element. */\n function mutateBox() {\n // Now apply them to the boxElement\n boxElement.style.width = boxWidth + \"px\";\n boxElement.style.height = boxHeight + \"px\";\n // Assign the box a random class\n boxElement.classList.add(getRandomElement(randomCSSClasses));\n // Fill in the box's value with some weird value\n boxElement.innerText = generateString();\n // Add a bunch of random CSS rules\n boxElement.style.backgroundColor = generateHexColor();\n boxElement.style.color = generateHexColor();\n /* Logic here: I want the font size to be no bigger\n * than 2rem, but no smaller than 0.02rem, unless it's\n * a \"hugeBox\", in which case, I'll blow out that font\n * size so it's at least 6rem and at most 16rem, because\n * if it's a hugeBox it'll have a large height and width\n * that we need to fill. */\n boxElement.style.fontSize = hugeBox ? randomNum(15) + 10 + \"rem\" : (Math.random() + (Math.random() * 0.5)) + \"rem\";\n /* 70% chance to align text to the left, otherwise\n * align the text to the right. */\n boxElement.style.textAlign = Math.random() < 0.7 ? \"left\" : \"right\";\n // Small chance to float right (12%)\n boxElement.style.float = Math.random() < 0.88 ? \"left\" : \"right\";\n // 80/20 chance the box will be in layer 1 or 2.\n if(Math.random() > 0.80) {\n boxElement.classList.add(\"layer-2\");\n }\n else {\n boxElement.classList.add(\"layer-1\");\n }\n // 20% chance to randomly rotate the box\n boxElement.style.transform = Math.random() > 0.80 ? \"rotate(\" + randomNum(360) + \"deg)\" : \"\";\n /* Apply the background pulse in random intervals\n * of anywhere from 0.05s-20s */\n addBackgroundPulse(boxElement, (Math.random() * (Math.random() * 20000)));\n }\n /** Will set the box's height and width, and also\n * there's a small chance the limit for both boxHeight and boxWidth\n * can change. */\n function resetBoxDimensions() {\n /* Reset our flag for huge box, because\n * this is the only function that modifies\n * the variable. */\n hugeBox = false;\n // Set boxWidth and boxHeight\n boxWidth = randomNum(boxWidthLimit);\n boxHeight = randomNum(boxHeightLimit);\n /* Reset boxWidthLimit and boxHeightLimit\n * every so often. */\n boxHeightLimit = Math.random() < 0.83 ? boxHeightLimit : randomNum(250) + randomNum(40) + 20;\n boxWidthLimit = Math.random() < 0.77 ? boxWidthLimit : randomNum(250) + randomNum(40) + 10;\n // Very small chance (2%) to return HUGE dimensions\n if (randomNum(100) > 98) {\n boxWidth = randomNum(boxWidthLimit * randomNum(10));\n boxHeight = randomNum(boxHeightLimit * randomNum(10));\n // Don't forget, we need to remember this\n // in mutateBox above when setting font size.\n hugeBox = true;\n }\n }\n /** Animates a box by attaching a CSS class;\n * the animations are defined in style.css. \n * @param {number} maxAnimationSeconds Defines how long\n * a CSS animation will last, in seconds. Optional.\n * @param {array} animationNames Make sure when\n * overridding animationNames you use valid animations defined\n * in style.css. Optional. */\n function animateBox(maxAnimationSeconds = 10, animationNames = [ \n \"spin alternate\", \n \"droppingHot\", \n \"spinBig\", \n \"wackoDacko\", \n \"onHover alternate\", \n \"onHover\", \n \"wackoDacko alternate\"]) {\n // 50/50 chance we may not even do it.\n if(randomNum() < 0.50) {\n /* 84% chance this doesn't go through, but if\n * it does, we'll set the animation of the boxElement\n * defined in this scope (in the beginning of drawBoxes)\n * to a random animation defined in animationNames, which\n * could be overridden if need be. */\n boxElement.style.animation = Math.random() < 0.84 ? boxElement.style.animation : randomNum(maxAnimationSeconds) + \"s \" + getRandomElement(animationNames);\n }\n }\n for(let i = 0; i < boxAmount; i++) {\n // Create a new span element\n boxElement = document.createElement(\"span\");\n // Get different sized boxes each time\n resetBoxDimensions();\n // Make the box look unique using CSS rules\n // like font-size, float, text-align, etc.,\n // as well as fill the box with words.\n mutateBox();\n // Animate the box\n animateBox();\n // Append the new element to the body\n document.body.appendChild(boxElement);\n }\n }", "function boxIt (arrOfArgs) {\n if (!arrOfArgs[0]){\n console.log(\"\\u250E\" + \"\\u2512\" + \"\\n\" + \"\\u2515\" + \"\\u251A\")\n return\n }\n let longest = longestName(arrOfArgs)\n console.log(drawTopBorder(longest))\n\n arrOfArgs.forEach(name => {\n console.log (drawBarsAround(name, longest))\n if (name === arrOfArgs[arrOfArgs.length-1]){\n console.log(drawBottomBorder(longest))\n }\n else\n console.log (drawMiddleBorder(longest))\n }\n ) \n}", "function createBox (box_type,size, scene) {\n var mat = new BABYLON.StandardMaterial(\"mat\", scene);\n var texture = new BABYLON.Texture(\"images/textures/box_atlas.png\", scene);\n mat.diffuseTexture = texture;\n var columns = 8; // 6 columns\n var rows = 8; // 4 rows\n var faceUV = new Array(6);\n\n switch (box_type) {\n case \"wood\":\n for (var i = 0; i < 6; i++) {\n faceUV[i] = new BABYLON.Vector4(6 / columns, 3 / rows, 7 / columns, 4 / rows);\n }\n break;\n case \"tnt\":\n var Ubottom_left = 3 / columns;\n var Vbottom_left = 3 / rows;\n var Utop_right = 4 / columns;\n var Vtop_right = 4 / rows;\n //select the face of the cube\n faceUV[0] = new BABYLON.Vector4(Utop_right, Vtop_right, Ubottom_left, Vbottom_left);\n faceUV[1] = new BABYLON.Vector4(Ubottom_left, Vbottom_left, Utop_right, Vtop_right);\n faceUV[2] = new BABYLON.Vector4(Utop_right, Vtop_right, Ubottom_left, Vbottom_left);\n faceUV[3] = new BABYLON.Vector4(Utop_right, Vtop_right, Ubottom_left, Vbottom_left);\n for (var i = 4; i < 6; i++) {\n faceUV[i] = new BABYLON.Vector4(4 / columns, 3 / rows, 5 / columns, 4 / rows);\n }\n\n\n break;\n }\n var box = BABYLON.MeshBuilder.CreateBox('box', {size:size,faceUV: faceUV}, scene);\n box.isPickable = true;\n box.material = mat;\n box.position = position;\n return box;\n }", "function addBoxes(parent, numberOfBoxes) {\n for (var i = 1; i <= numberOfBoxes; i ++) {\n addBox(parent, numberOfBoxes);\n };\n}", "function boxClicked() {\r\n let clickedBox = this.className;\r\n let mark = this;\r\n let player = \"User\";\r\n mark.style.background = \"url(img/x-brush.png) no-repeat\";\r\n mark.style.backgroundSize = \"contain\";\r\n mark.style.backgroundPosition = \"center\";\r\n mark.style.pointerEvents = \"none\";\r\n checkClass(clickedBox, player);\r\n computerRandomizer(boxRow, mark);\r\n console.log(updateList.length);\r\n\r\n state();\r\n}", "function checkBoxes() {\n boxes.forEach((box) => {\n const triggerBottom = innerHeight * 0.8;\n const boxTop = box.getBoundingClientRect().top;\n console.log(boxTop);\n console.log(triggerBottom);\n if (boxTop < triggerBottom) {\n box.classList.add(\"show\");\n } else {\n box.classList.remove(\"show\");\n }\n });\n}", "function prepareOneSlideBox(slotholder,opt,visible) {\n\n\t\t\t\tvar sh=slotholder;\n\t\t\t\tvar img = sh.find('.defaultimg');\n\n\t\t\t\tsetSize(img,opt)\n\t\t\t\tvar src = img.data('src');\n\t\t\t\tvar bgcolor=img.css('backgroundColor');\n\n\t\t\t\tvar w = opt.width;\n\t\t\t\tvar h = opt.height;\n\t\t\t\tif (opt.autoHeight==\"on\")\n\t\t\t\t h = opt.container.height();\n\t\t\t\t \n\t\t\t\tvar fulloff = img.data(\"fxof\");\n\t\t\t\tif (fulloff==undefined) fulloff=0;\n\n\t\t\t\tfullyoff=0;\n\n\n\n\t\t\t\tvar off=0;\n\n\n\n\n\t\t\t\t// SET THE MINIMAL SIZE OF A BOX\n\t\t\t\tvar basicsize = 0;\n\t\t\t\tif (opt.sloth>opt.slotw)\n\t\t\t\t\tbasicsize=opt.sloth\n\t\t\t\telse\n\t\t\t\t\tbasicsize=opt.slotw;\n\n\n\t\t\t\tif (!visible) {\n\t\t\t\t\tvar off=0-basicsize;\n\t\t\t\t}\n\n\t\t\t\topt.slotw = basicsize;\n\t\t\t\topt.sloth = basicsize;\n\t\t\t\tvar x=0;\n\t\t\t\tvar y=0;\n\n\t\t\t\tvar bgfit = img.data('bgfit');\n\t\t\t\tvar bgrepeat = img.data('bgrepeat');\n\t\t\t\tvar bgposition = img.data('bgposition');\n\n\t\t\t\tif (bgfit==undefined) bgfit=\"cover\";\n\t\t\t\tif (bgrepeat==undefined) bgrepeat=\"no-repeat\";\n\t\t\t\tif (bgposition==undefined) bgposition=\"center center\";\n\n\t\t\t\tfor (var j=0;j<opt.slots;j++) {\n\n\t\t\t\t\ty=0;\n\t\t\t\t\tfor (var i=0;i<opt.slots;i++) \t{\n\n\n\t\t\t\t\t\tsh.append('<div class=\"slot\" '+\n\t\t\t\t\t\t\t\t 'style=\"position:absolute;'+\n\t\t\t\t\t\t\t\t\t\t\t'top:'+(fullyoff+y)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'left:'+(fulloff+x)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'width:'+basicsize+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'height:'+basicsize+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'overflow:hidden;\">'+\n\n\t\t\t\t\t\t\t\t '<div class=\"slotslide\" data-x=\"'+x+'\" data-y=\"'+y+'\" '+\n\t\t\t\t\t\t\t\t \t\t\t'style=\"position:absolute;'+\n\t\t\t\t\t\t\t\t\t\t\t'top:'+(0)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'left:'+(0)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'width:'+basicsize+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'height:'+basicsize+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'overflow:hidden;\">'+\n\n\t\t\t\t\t\t\t\t '<div style=\"position:absolute;'+\n\t\t\t\t\t\t\t\t\t\t\t'top:'+(0-y)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'left:'+(0-x)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'width:'+w+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'height:'+h+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'background-color:'+bgcolor+';'+\n\t\t\t\t\t\t\t\t\t\t\t'background-image:url('+src+');'+\n\t\t\t\t\t\t\t\t\t\t\t\t\t'background-repeat:'+bgrepeat+';'+\n\t\t\t\t\t\t\t\t\t\t\t'background-size:'+bgfit+';background-position:'+bgposition+';\">'+\n\t\t\t\t\t\t\t\t '</div></div></div>');\n\t\t\t\t\t\ty=y+basicsize;\n\t\t\t\t\t}\n\t\t\t\t\tx=x+basicsize;\n\t\t\t\t}\n\t\t}", "function boxes() {\n\tthis.innerHTML = HUplayer;\n\tthis.removeEventListener('click', boxes);\n\tcheckWinner();\n\tendGameChecker();\n\tlet emptySlots = checkerForEmpty();\n\tif (emptySlots.length > 0 && !endGame) {\n\t\tlet oneEmptySlot = emptySlots[Math.floor(Math.random() * emptySlots.length)];\n\t\toneEmptySlot.innerHTML = AI;\n\t\toneEmptySlot.removeEventListener('click', boxes);\n\t\tcheckWinner();\n\t}\n}", "function drawBoxes(objects) {\n\n //clear the previous drawings\n drawCtx.clearRect(0, 0, drawCanvas.width, drawCanvas.height);\n\n //filter out objects that contain a class_name and then draw boxes and labels on each\n objects.forEach(face => {\n let scale = uploadScale();\n let _x = face.x / scale;\n let y = face.y / scale;\n let width = face.w / scale;\n let height = face.h / scale;\n //flip the x axis if local video is mirrored\n if (mirror) {\n x = drawCanvas.width - (_x + width)\n } else {\n x = _x\n }\n\n let rand_conf = face.confidence.toFixed(2);\n let title = \"\" + rand_conf + \"\";\n if (face.name != \"unknown\") {\n drawCtx.strokeStyle = \"magenta\";\n drawCtx.fillStyle = \"magenta\";\n title += ' - ' + face.name\n if (face.predict_proba > 0.0 ) {\n title += \"[\" + face.predict_proba.toFixed(2) + \"]\";\n }\n } else {\n drawCtx.strokeStyle = \"cyan\";\n drawCtx.fillStyle = \"cyan\";\n }\n drawCtx.fillText(title , x + 5, y - 5);\n drawCtx.strokeRect(x, y, width, height);\n\n if(isCaptureExample && examplesNum < maxExamples) {\n console.log(\"capure example: \", examplesNum)\n\n //Some styles for the drawcanvas\n exCtx.drawImage(imageCanvas,\n face.x, face.y, face.w, face.h,\n examplesNum * exampleSize, 0,\n exampleSize, exampleSize);\n\n examplesNum += 1;\n\n if(examplesNum == maxExamples) {\n stopCaptureExamples();\n }\n }\n\n });\n}", "function makeBox() {\n bokser.innerHTML = '';\n for (var i = 0; i < antallFarger; i++) {\n var rndFarge1 = Math.floor(Math.random() * 255);\n var rndFarge2 = Math.floor(Math.random() * 255);\n var rndFarge3 = Math.floor(Math.random() * 255);\n colorArr.push(`rgb(${rndFarge1},${rndFarge2},${rndFarge3})`);\n bokser.innerHTML += `<div id=\"boks-${i}\" style=\"\n width:100px; \n height:100px;\n float: left;\n background-color: rgb(${rndFarge1},${rndFarge2},${rndFarge3});\n \"></div>`;\n }\n}", "isBoxValid(index) {\n return (\n !this.boxes[index].classList.contains(\"wall\") &&\n !this.boxes[index].classList.contains(\"start\") &&\n !this.boxes[index].classList.contains(\"wall\")\n );\n }", "function addMoreRects() {\n for (let i = 0; i < AMOUNT; i++) {\n rects[i].float();\n rects[i].display();\n rects[i].collisionDetection();\n }\n}", "function pack() {\n var boxes = config.boardView.querySelectorAll(\".box\"),\n boxesPerRow = calculateBoxesPerRow(boxes.length),\n margin = parseInt(window.getComputedStyle(boxes[0]).marginTop.replace(\"px\", \"\")),\n boardWidth = boxesPerRow * (boxes[0].offsetWidth + 2 * margin);\n\n if (boxesPerRow === 1) {\n boxesPerRow = boxes.length;\n }\n\n config.boardView.style.width = boardWidth + \"px\";\n }", "function show() {\n\tvar pos= boxes[j].position;\n\tvar angle= boxes[j].angle;\n\t\n\tpush();\n\ttranslate(pos.x,pos.y);\n\trotate(angle);\n\tfill(0);\n\trectMode(CENTER);\n\trect(0, 0, boxWidth[j], boxHeight[j]);\n\tpop();\t\n}", "function addBoxes() {\n O('box-container').innerHTML += \"<div class='box'>More Boxes!!!!</div>\"\n}", "function gbDivs(x, y) {\n var className;\n var box = \"box\";\n var i;\n var ind;\n if(x >= y ) {\n for(ind=0; ind < y; ind++){\n for( i=0; i < x; i++){\n\n className = \"pos\" + (i+1) + \"-\" + (ind+1);\n // var newDiv = $('div').addClass( className )\n // .addClass(\"box\");\n // console.log(className);\n\n $(\".container\").append(\"<div class=\\'box \" + className + \"\\'\" + \"></div>\" );\n\n\n }\n\n }\n\n } else if ( y > x){\n className = 0;\n for( ind=0; ind < x; ind++) {\n for( i=0; i < y; i++){\n\n className = \"pos\" + (i+1) + \"-\" + (ind+1);\n\n $(\".container\").append(\"<div class=\\'box \" + className + \"\\'\" + \"></div>\" );\n }\n }\n }\n}", "generateBoxes(h,w) {\n\t\tvar bx = new Map();\n\t\tfor(var y = 0; y< h-1 ; y++)\n\t\t{\n\t\t\tfor(var x = 0 ; x< w-1; x++)\n\t\t\t{\n\t\t\t\tvar a =new Dot(x,y);\n\t\t\t\tvar box = new Box(a);\n\t\t\t\tbx.set(a.toString(), box);\n\t\t\t}\n\t\t}\n\t\treturn bx;\n\t}", "function dynamicAddBox() {\r\n\t\tif (objchoice.insertCount<6)\r\n\t\t{\r\n\t\t\tswitch (objchoice.insertCount)\r\n\t\t\t{\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\t$(\"main, main img\").css({\"width\": \"220px\", \"height\": \"220px\"});\r\n\t\t\t\t\tobjmain = new getAttribute(\"main\");\r\n\t\t\t\t\tobjmain = setmainPosition(objmain, objContainer);\r\n\t\t\t\t\tsetboxPosition(objchoice, objmain, 6);\r\n\t\t\t\t\tobjchoice.resultBox[objchoice.insertCount] = objchoice.backupBox[5];\r\n\t\t\t\t\tobjchoice.backupBox.splice(5, 1);\t\r\n\t\t\t\t\t$(\".functionBox\").show();\r\n\t\t\t\t\tobjchoice.memoryCount = 5;\r\n\t\t\t\t\tobjchoice.insertCount = 1;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tshowrandomBox(objchoice);\r\n\t\t\t}\t\r\n\t\t}\r\n\t\telse if (objchoice.insertCount<18)\r\n\t\t{\r\n\t\t\tswitch (objchoice.insertCount)\r\n\t\t\t{\r\n\t\t\t\tcase 6:\r\n\t\t\t\t\t$(\"main, main img\").css({\"width\": \"130px\", \"height\": \"130px\"});\r\n\t\t\t\t\t$(\".firstLayer\").css({\"width\": \"120px\", \"height\": \"120px\"});\r\n\t\t\t\t\t$(\".functionBox\").css({\"width\": \"100px\", \"height\": \"100px\"});\r\n\t\t\t\t\t$(\".functionButton\").css({\"width\": \"100px\", \"height\": \"50px\"});\r\n\t\t\t\t\tobjmain = new getAttribute(\"main\");\r\n\t\t\t\t\tobjmain = setmainPosition(objmain, objContainer);\r\n\t\t\t\t\tsetboxPosition(objchoice, objmain, 18);\r\n\t\t\t\t\tobjchoice.memoryCount = 11;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tshowrandomBox(objchoice);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (objchoice.insertCount<28)\r\n\t\t{\r\n\t\t\tswitch (objchoice.insertCount)\r\n\t\t\t{\r\n\t\t\t\tcase 18:\r\n\t\t\t\t\t$(\"main, main img\").css({\"width\": \"120px\", \"height\": \"120px\"});\r\n\t\t\t\t\t$(\".firstLayer\").css({\"width\": \"110px\", \"height\": \"110px\"});\r\n\t\t\t\t\t$(\".secondLayer\").css({\"width\": \"100px\", \"height\": \"100px\"});\r\n\t\t\t\t\t$(\".functionBox\").css({\"width\": \"80px\", \"height\": \"80px\"});\r\n\t\t\t\t\t$(\".functionButton\").css({\"width\": \"80px\", \"height\": \"40px\"});\r\n\t\t\t\t\tobjmain = new getAttribute(\"main\");\r\n\t\t\t\t\tobjmain = setmainPosition(objmain, objContainer);\r\n\t\t\t\t\tsetboxPosition(objchoice, objmain, objchoice.initialBox.length);\r\n\t\t\t\t\tobjchoice.memoryCount = 9;\r\n\t\t\t\tdefault: \r\n\t\t\t\t\tshowrandomBox(objchoice);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{ $(\".alertBox\").show(); }\r\n\t} // end function", "function Box() {\n this.x = 0;\n this.y = 0;\n this.w = 1; // default width and height?\n this.h = 1;\n this.fill = '#444444';\n this.sector = '0';\n this.pricenum = '0';\n this.state= 0;\n this.place= 0;\n this.line = 0;\n this.cell = 0;\n}", "function createBox(boxPos, numOfSquares) {\n let squares = '';\n\n for (let i = 0; i < numOfSquares; i++) {\n squares += createSquare(boxPos, i, 9);\n }\n\n return '<div class=\"box\"> \\n' + squares + '</div> \\n';\n}", "_addSnake(){\n for(let i =0; i<this._snake.length; i++){\n const elem = document.createElement(\"div\");\n elem.className=\"box\";\n elem.id = \"box-id\";\n elem.style.top=this._snake[i].row*this._boxSize+\"px\";\n elem.style.left=this._snake[i].col*this._boxSize+\"px\";\n this._screen.append(elem);\n this._snakeBodyElems.push(elem);\n }\n }", "function styleBoxes(selection, self) {\n selection\n .style('width', `${self.boxWidth}px`)\n .style('height', `${self.boxHeight}px`);\n // .style('margin', `${self.boxMargin / 2}px`)\n }", "function clickedBox() {\n\n\n for (var i = 0; i < boxesAmt; i++) {\n\n\n \n boxes[i].style.backgroundColor = backColor;\n \n\n }\n}", "build() {\r\n for (let y = this.y; y < height; y += height / 20) {\r\n for (let x = this.x; x < 400; x += 400 / 10) {\r\n let boxUsed = false;\r\n let col = 255;\r\n this.gameMap.push({\r\n x,\r\n y,\r\n boxUsed,\r\n col\r\n });\r\n // Visualize the grid\r\n rect(x, y, 40, 40);\r\n }\r\n }\r\n }", "function renderBoxes(array) {\n //creates box html\n boxContainer.innerHTML += array.map(num=>{\n let color = \"\";\n \n switch(num) {\n case 1:\n color = \"purple\";\n break;\n case 2:\n color = \"yellow\";\n break;\n case 3:\n color = \"blue\";\n break;\n case 4:\n color = \"pink\";\n break;\n case 5:\n color = \"lime\";\n break;\n case 6:\n color = \"orange\";\n break;\n default:\n color = \"pink\";\n }\n\n return `<div class=\"box-container__box ${color}\" id=\"${num}\"></div>`\n\n }).join(\"\\n\");\n\n //adds event listeners to each box and calls to detect user input\n document.querySelectorAll(\".box-container__box\").forEach(box => {\n box.addEventListener(\"click\", event => {\n const userNewInput = Number(event.target.id);\n if (array === easyArray){\n detectUserInput(userNewInput, \"easy\");\n } else {\n detectUserInput(userNewInput, \"hard\");\n }\n });\n });\n\n //adds classes to box container depending on mode\n if (array === easyArray) {\n boxContainer.classList.add(\"easy\");\n } else if (array === array || array === shuffled) {\n boxContainer.classList.add(\"hard\");\n }\n}", "drawBoxes() {\r\n let len = this._answer.length\r\n let div = document.createElement('div')\r\n\r\n for (var i = 0; i < len; i++) {\r\n let v = this._answer.charAt(i)\r\n let elem = document.createElement('span')\r\n div.appendChild(elem)\r\n\r\n if (v == '-') {\r\n this._container.appendChild(div)\r\n elem.className += 'hyphen'\r\n elem.innerText = '-'\r\n div = document.createElement('div')\r\n }\r\n if (v == ' ') {\r\n this._container.appendChild(div)\r\n elem.className += 'space'\r\n elem.innerText = ' '\r\n div = document.createElement('div')\r\n }\r\n if (v == \"'\") {\r\n this._container.appendChild(div)\r\n elem.className += 'apostrophe'\r\n elem.innerText = \"'\"\r\n div = document.createElement('div')\r\n }\r\n }\r\n this._container.appendChild(div)\r\n }", "function addBoxes(wrapper) {\n let container = document.getElementById(wrapper);\n container.innerHTML = \"\";\n let letter = wrapper.slice(wrapper.length -1);\n for (var box = 0; box < 12; box++) {\n // check for column, set text style \n switch(letter.toLowerCase()) {\n case \"a\":\n container.innerHTML = container.innerHTML + \"<div>\" + letter.toLowerCase() + \"0\" + box + \"</div>\";\n break;\n case \"b\":\n container.innerHTML = container.innerHTML + \"<div><b>\" + letter.toLowerCase() + \"0\" + box + \"</b></div>\";\n break;\n case \"c\":\n container.innerHTML = container.innerHTML + \"<div>\" + letter.toLowerCase() + \"0\" + box + \"</div>\";\n }\n }\n }", "render() {\n const renderBoxes = this.state.boxes.map((box) => (// Maps through \"boxes\"\n <Box\n key={box.id}\n id={box.id} // creates/returns box component for each box in the array\n color={box.color}\n handleBoxClick={this.handleBoxClick}\n />\n )\n );\n return (\n <main\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n flexDirection: \"column\",\n textAlign: \"center\",\n }}\n >\n <h1> React: State and Props </h1>{\" \"}\n <div className=\"App\"> {renderBoxes} </div>{\" \"}\n </main>\n );\n}", "function class_box(ctx) // the treasure chest that contains special items\r\n{\t\r\n\tthis.sidelength = 30;\r\n\tthis.context = ctx;\r\n\t\r\n\t//position\r\n\tthis.x = (borderwidth+this.sidelength) + Math.floor(Math.random()*(width-(borderwidth+(2*this.sidelength))+1));\r\n\tthis.y = -this.sidelength;\r\n\tthis.lastx = 0;\r\n\tthis.lasty = 0;\r\n\r\n\tthis.bActive = false;\r\n\tthis.bHit = false;\r\n\t\r\n\tthis.reset = function() {\r\n\t\tthis.lastx = this.x;\r\n\t\tthis.lasty = this.y;\r\n\t\tthis.x = (borderwidth+this.sidelength) + Math.floor(Math.random()*(width-(borderwidth+(2*this.sidelength))+1));\r\n\t\tthis.y = -this.sidelength;\r\n\t\tthis.bActive = false;\r\n\t\tsetTimeout(\"thebox.bActive = true\", 10000); // next box will spawn in 10 seconds\r\n\t};\r\n\t\t\r\n\tthis.draw = function() {\r\n\t\tif(this.bHit) this.context.drawImage(img[8], this.lastx-15, this.lasty-8, 60, 40);\r\n\t\telse if(this.bActive) this.context.drawImage(img[7], this.x, this.y, this.sidelength, this.sidelength);\r\n\t};\r\n\t\r\n\tthis.update = function() {\r\n\t\t\r\n\t\tif(!this.bActive) return;\r\n\t\t\r\n\t\tthis.y++;\r\n\t\tthis.x += Math.sin(this.y * (Math.PI/180)) / 4;\r\n\t\t\r\n\t\tif(this.y > 400) this.reset();\r\n\t};\r\n\t\t\r\n\tthis.gotHit = function() {\r\n\t\tthis.bActive = false;\r\n\t\tthis.bHit = true;\r\n\t\tthis.reset();\r\n\t\tsetTimeout(\"thebox.bHit = false\", 1000); // 1 second hit animation\r\n\t\tsetTimeout(\"thebox.bActive = true\", 10000); // in 10 seconds the next box will spawn\r\n\t};\r\n}", "render() {\n const boxComponents = this.state.boxes.map((color, i) => (\n <Box key={i} color={color}/>\n ));\n\n return (\n <section className=\"BoxesContainer\">\n {boxComponents}\n\n <p>\n <button onClick={this.handleClick}>Change a Box</button>\n </p>\n </section>\n );\n }", "constructor(h,w) {\n\t\t\n\t\tthis.boxes = this.generateBoxes(h,w);\n\t\tthis.box_count = 0;\n\t}", "function Box(id, name, color, x, y) {\n\tthis.id = id;\n\tthis.name = name;\n\tthis.color = color;\n\tthis.x = x;\n\tthis.y = y;\n }", "function find_box(blue_piece_object)\n{\n $(\"#in_function\").html(\"find_box\");\n var return_val=null;\n var extra_space=4;\n\n //iterate through all the div boxes\n $(\"div.box\").each(function(index,value)\n {\n //variables\n var boxL=value.offsetLeft;\n var boxT=value.offsetTop;//-$(\"#checkers\").offset().top;\n var boxWidth=value.offsetWidth;\n var pieceL=blue_piece_object.left;\n var pieceT=blue_piece_object.top;\n\n //compare if the left and top positions of the blue-pieve are within one of the boxes\n if(pieceL>(boxL-extra_space) && (pieceL+blue_piece_object.width)<=(boxL+boxWidth+extra_space))\n {\n if((boxT-extra_space)<pieceT && (boxT+boxWidth+extra_space)>=(pieceT+blue_piece_object.width))\n {\n //alert(value.id+\": Collision\");\n\n return_val=value.id;\n $(\"#on_box\").html(\"Box: \"+return_val);\n }\n }\n });\n\n //if(return_val==null)\n // alert(\"Move to your correct spot!\");\n\n return return_val;\n}", "function init(){\r\n\r\n\tvar identifier =0;\r\n\r\n\tvar box1=document.getElementById('box1');\r\n\tvar box2=document.getElementById('box2');\r\n\tvar box3=document.getElementById('box3');\r\n\tvar box4=document.getElementById('box4');\r\n\tvar box5=document.getElementById('box5');\r\n\tvar box6=document.getElementById('box6');\r\n\tvar box7=document.getElementById('box7');\r\n\tvar box8=document.getElementById('box8');\r\n\tvar box9=document.getElementById('box9');\r\n\r\n\tfor(var i=0;i<N_SIZE;i++){\r\n\r\n\t\tfor(var j=0;j<N_SIZE;j++){\r\n\r\n\t\t\tvar cell;\r\n\r\n\t\t\tif(i==0 & j==0){ cell = box1;}\r\n\t\t\telse if(i==0 & j==1){ cell = box2;}\r\n\t\t\telse if(i==0 & j==2){ cell = box3;}\r\n\t\t\telse if(i==1 & j==0){ cell = box4;}\r\n\t\t\telse if(i==1 & j==1){ cell = box5;}\r\n\t\t\telse if(i==1 & j==2){ cell = box6;}\r\n\t\t\telse if(i==2 & j==0){ cell = box7;}\r\n\t\t\telse if(i==2 & j==1){ cell = box8;}\r\n\t\t\telse if(i==2 & j==2){ cell = box9;}\r\n\r\n\r\n\r\n\t\t\tcell.identifier=identifier;//know \r\n\t\t\tboxes.push(cell);\r\n\t\t\tidentifier+=+1;\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n\tstartNewGame();\r\n\r\n}", "function mouseClicked() {\n arrOfTorus.pop();\n let aColoredBox = new cluelessBox(20);\n arrOfBoxes.push(aColoredBox);\n}", "function moveBoxes() {\n //Move boxes to the right as long as they haven't reached their next position\n if (posOffset1.x < offsetX2) {\n posOffset0.set(posOffset0.x+speed, posOffset0.y);\n posOffset1.set(posOffset1.x+speed, posOffset1.y);\n posOffset2.set(posOffset2.x+speed, posOffset2.y);\n if (steps<2) {\n welcomeOffset.set(welcomeOffset.x+speed, welcomeOffset.y);\n }\n //If boxes reach next position, update position data and order\n } else {\n //Re-order paper images\n for (let i=0; i<order.length; i++) {\n order[i]--;\n if (order[i] < 0) {\n order[i] = 2;\n }\n }\n posOffset0.set(offsetX0, offsetY0);\n posOffset1.set(offsetX1, offsetY1);\n posOffset2.set(offsetX2, offsetY2);\n\n //Count number of sounds that have been played so far\n steps++;\n //Only update the welcome text position until it is moved to the right out of sight\n if (steps<3) {\n welcomeOffset.set(welcomeOffsetX + steps*(offsetX2-offsetX1), welcomeOffsetY);\n }\n\n //Update artist,drawing data and sound number\n lastPt = pt;\n lastPaths = paths;\n pt = nextPt;\n paths = []; \n lastSoundNumber = soundNumber;\n soundNumber = nextSoundNumber; //Get the number of the sound that has been selected\n\n nextSound = false; //nexSound flag set to false until next sound is selected\n newSound();\n }\n}", "function Box (tag) {\n var p2 = Point.set().pop();\n var p1 = Point.set().pop();\n \n if (tag && p1 && p2) {\n // Origin is the top-left corner of the box\n this.origin = new Point(Point.leftmost(p1, p2).x, Point.topmost(p1, p2).y);\n this.box_width = Point.rightmost(p1, p2).x - this.origin.x;\n this.box_height = Point.bottommost(p1, p2).y - this.origin.y;\n this.backing_element = new Element(tag, {\n 'left': this.origin.x,\n 'top': this.origin.y \n }, null, '#stage'\n );\n \n $(this.backing_element).width(this.box_width);\n $(this.backing_element).height(this.box_height); \n \n Box.active(this);\n Box.set().push(this); \n \n // The global set of keybindings is defined here\n Box.keys({\n // 'D'elete\n 100: function (e) {\n if (Box.active() && confirm('Delete the active box?')) {\n Box.active().destroy(); \n }\n }\n });\n } \n}", "function addBoxes() {\n var $boxColumn = $(\"<div class='boxColumn'></div>\");\n var $rbb = $(\"#removeBoxesButton\");\n for (var i = 0; i < 5; i++) {\n $boxColumn.append(\"<div class='box'></div>\");\n }\n $(\"#boxContainer\").append($boxColumn);\n if ( $rbb.attr(\"disabled\") === \"disabled\" ) {\n $rbb.attr(\"disabled\", false);\n }\n}", "function stackBoxes(n) {\n return n * n;\n }", "function adjustBoxes(boxes) {\n\t if (/^td$/i.test(element.tagName)) {\n\t var table = nodeInfo.table;\n\t if (table && getPropertyValue(table.style, \"border-collapse\") == \"collapse\") {\n\t var tableBorderLeft = getBorder(table.style, \"left\").width;\n\t var tableBorderTop = getBorder(table.style, \"top\").width;\n\t // check if we need to adjust\n\t if (tableBorderLeft === 0 && tableBorderTop === 0) {\n\t return boxes; // nope\n\t }\n\t var tableBox = table.element.getBoundingClientRect();\n\t var firstCell = table.element.rows[0].cells[0];\n\t var firstCellBox = firstCell.getBoundingClientRect();\n\t if (firstCellBox.top == tableBox.top || firstCellBox.left == tableBox.left) {\n\t return slice$1$1(boxes).map(function(box){\n\t return {\n\t left : box.left + tableBorderLeft,\n\t top : box.top + tableBorderTop,\n\t right : box.right + tableBorderLeft,\n\t bottom : box.bottom + tableBorderTop,\n\t height : box.height,\n\t width : box.width\n\t };\n\t });\n\t }\n\t }\n\t }\n\t return boxes;\n\t }", "function addBox() {\n // Create '.box' element\n const newDiv = document.createElement('div');\n newDiv.className = 'box';\n // Add '.box' element to 'body'\n $body.appendChild(newDiv);\n $boxes = document.querySelectorAll('.box');\n}", "function in_box(x, y, box) {\n return (\n x >= box.x - trial.box_linewidth &&\n x <= box.x + box.w + trial.box_linewidth * 2 &&\n y >= box.y - trial.box_linewidth &&\n y <= box.y + box.h + trial.box_linewidth * 2\n );\n }", "function printBox(i) {\n $(\"<div/>\", {\n id: \"box_\" + i,\n class: \"Box\"\n }).appendTo(\"#contenido\");\n}", "function makeEditBoxes(d){\r\n editingPic = d[5]\r\n editingPoly = -1;\r\n update();\r\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 }", "function mkBox(pts = [], dis = 20){\n\tlet boxes = [];\n\tif (pts && pts.length && pts.length >= 2){\n\t\tconst lls = pts.map((pt)=>new LatLng(pt[0],pt[1]));\n\t\tconst bounds = RouteBoxer.box(lls, dis);\n\t\tboxes = bounds.map((box)=>{\n\t\t //console.log(box)\n\t\t const {_southWest,_northEast} = box;\n\t\t return [[_southWest.lat,_southWest.lng],[_northEast.lat,_northEast.lng]]\n\t\t});\n\t}\n\treturn boxes\n}", "function makeBox (width, height) {\n var i\n var solid = repeatChar (width,\"*\")\n var top = \"\"\n var bottom = \"\"\n var middle = \"\"\n \n if (height>0){top = solid}\n if (height>1){bottom = \"\\n\" + solid}\n\n for (i=1; i<height-1; i++){\n middle = middle + \"\\n\" + \"*\" + repeatChar(width-2,\" \") + \"*\"\n }\n return top + middle + bottom\n}", "function DrawBox(SArray, n) {\n\tvar p1x;\n\tvar p1y;\n\tvar p2x;\n\tvar p2y;\n\tvar p3x;\n\tvar p3y;\n\tvar p4x;\n\tvar p4y;\n\tvar S = SArray[0].plasmidsize;\n\tvar fillred = Math.round(SArray[n].red / 100 * 255);\n\tvar fillgreen = Math.round(SArray[n].green / 100 * 255);\n\tvar fillblue = Math.round(SArray[n].blue / 100 * 255);\n\tvar stred = Math.round(SArray[0].fstrokered / 100 * 255);\n\tvar stgreen = Math.round(SArray[0].fstrokegreen / 100 * 255);\n\tvar stblue = Math.round(SArray[0].fstrokeblue / 100 * 255);\n\tvar Cx = SArray[0].ox;\n\tvar Cy = SArray[0].oy;\n\n\t//Direction: sense=0, antisense=1\n\tvar sense = 0;\n\tif (SArray[n].end < SArray[n].start) sense = 1;\n\t//sweep: <=half: 0, >half: 1\n\tvar sweep = 0;\n\tif (Math.abs(SArray[n].end - SArray[n].start) / S > 0.5) sweep = 1;\n\n\tvar Cmd = [];\n\tCmd[1] = newSVG(\"path\");\n\tp1x = Cx + SArray[0].ro * Math.sin(SArray[n].start / S * Math.PI * 2);\n\tp1y = Cy - SArray[0].ro * Math.cos(SArray[n].start / S * Math.PI * 2);\n\tp2x = Cx + SArray[0].ro * Math.sin(SArray[n].end / S * 2 * Math.PI);\n\tp2y = Cy - SArray[0].ro * Math.cos(SArray[n].end / S * 2 * Math.PI);\n\tp3x = Cx + SArray[0].ri * Math.sin(SArray[n].end / S * 2 * Math.PI);\n\tp3y = Cy - SArray[0].ri * Math.cos(SArray[n].end / S * 2 * Math.PI);\n\tp4x = Cx + SArray[0].ri * Math.sin(SArray[n].start / S * 2 * Math.PI);\n\tp4y = Cy - SArray[0].ri * Math.cos(SArray[n].start / S * 2 * Math.PI);\n\tvar Para = \"\";\n\tPara += 'M' + p1x + \",\" + p1y + \" A\" + SArray[0].ro + \",\" + SArray[0].ro + \" 0 \";\n\tCmd[0] += '<path d=\"M' + p1x + \",\" + p1y + \" A\" + SArray[0].ro + \",\" + SArray[0].ro + \" 0 \";\n\tif (sweep) {\n\t\tCmd[0] += \"1,\";\n\t\tPara += \"1,\";\n\t} else {\n\t\tCmd[0] += \"0,\";\n\t\tPara += \"0,\";\n\t};\n\tif (sense) {\n\t\tCmd[0] += \"0 \";\n\t\tPara += \"0 \";\n\t} else {\n\t\tCmd[0] += \"1 \";\n\t\tPara += \"1 \";\n\t};\n\tCmd[0] += p2x + \",\" + p2y;\n\tPara += p2x + \",\" + p2y;\n\tCmd[0] += \" L\" + p3x + \",\" + p3y;\n\tPara += \" L\" + p3x + \",\" + p3y;\n\tCmd[0] += \" A\" + SArray[0].ri + \",\" + SArray[0].ri + \" 0 \";\n\tPara += \" A\" + SArray[0].ri + \",\" + SArray[0].ri + \" 0 \";\n\tif (sweep) {\n\t\tCmd[0] += \"1,\";\n\t\tPara += \"1,\";\n\t} else {\n\t\tCmd[0] += \"0,\";\n\t\tPara += \"0,\";\n\t};\n\tif (sense) {\n\t\tCmd[0] += \"1 \";\n\t\tPara += \"1 \";\n\t} else {\n\t\tCmd[0] += \"0 \";\n\t\tPara += \"0 \";\n\t};\n\tCmd[0] += p4x + \",\" + p4y;\n\tPara += p4x + \",\" + p4y + \" z\";\n\tCmd[1].setAttribute(\"d\", Para);\n\tCmd[0] += ' z\" ' + 'fill=\"rgb(' + fillred + \",\" + fillgreen + \",\" + fillblue + ')\"' + ' stroke-width=\"' + SArray[0].fstrokewidth + '\" stroke=\"rgb(' + stred + \",\" + stgreen + \",\" + stblue + ')\"/> \\n';\n\tPara = \"rgb(\" + fillred + \",\" + fillgreen + \",\" + fillblue + \")\";\n\tCmd[1].setAttribute(\"fill\", Para);\n\tCmd[1].setAttribute(\"stroke-width\", SArray[0].fstrokewidth);\n\tPara = \"rgb(\" + stred + \",\" + stgreen + \",\" + stblue + \")\";\n\tCmd[1].setAttribute(\"stroke\", Para);\n\treturn (Cmd);\n}", "function dialogueBoxes(boxObj, string, leftOffset, topOffset, size, ctx, textColor) { \n button.render(boxObj)\n wrapText(\n ctx,\n string.toString(),\n boxObj.left + leftOffset,\n boxObj.top + topOffset,\n boxObj.right - boxObj.left - 30,\n 50,\n size,\n textColor\n );\n}", "function rc(){\n \n var boxes=document.getElementsByClassName('box');\n var tar=document.querySelectorAll('.it');\n \n let grid=[[tar[0],tar[1],tar[2],tar[3],tar[4]],\n [tar[5],tar[6],tar[7],tar[8],tar[9]],\n [tar[10],tar[11],tar[12],tar[13],tar[14]],\n [tar[15],tar[16],tar[17],tar[18],tar[19]],\n [tar[20],tar[21],tar[22],tar[23],tar[24]]\n ]\n\n for(let i=0;i<5;++i){\n for(let j=0;j<5;++j){\n if(grid[i][j]===ob1){\n x= [i , j ];}\n } \n } \n \n //var chk=document.querySelector('#empty');\n var chk=ob2;\n for(let i=0;i<5;++i){\n for(let j=0;j<5;++j){\n if(grid[i][j]===chk){\n y= [i , j ];} \n }\n }\n }", "function showAllBoxes() {\n\t$.each($images,function(index,value){\n\t\tvar url = \"Photos/Thumbnails/\" + this.name;\n\t\tvar $new_image = $(\"<div class='thumbnail'><img class='small-img \" + this.title + \"' src=\" + url + \"></div>\");\n\t\t$container.append($new_image);\n\t});\n\t$(\".small-img\").on(\"click\",clickOnThumbnail);\n}", "function Scoreboard(){\n this.sheet = document.getElementById(\"sheet\"); //get the sheet element, is the sheet just a white background. \n this.list = [];\n \n // Spawns the boxes\n this.setup = function(){\n \n // Create 10 boxes\n\n for(var i=0; i<9; i++){\n var box = this.createBox(); // Create an individual box\n this.list.push(box); // Add each box to the list\n this.sheet.appendChild(box); // Add each box to the sheet\n }\n\n var lastbox = this.CreateThirdBox(); // Create an individual box\n this.list.push(lastbox); // Add each box to the list\n this.sheet.appendChild(lastbox); // Add each box to the sheet\n /*\n <div id=\"screen>\n <div class=\"box\">\n <div class=\"indent\"></div>\n <div class=\"corner\"></div>\n <div class=\"bottom\"></div>\n </div>\n </div>\n */\n // We're basically doing this with javascript^\n };\n\n this.createBox = function(){\n var c = function(className){\n var element = document.createElement(\"div\"); //create a function so it is easier to create elements, not having to repeat code\n element.className = className; //asigns a new class,\n return element;\n };\n \n var box = c(\"box\"); //creates a new box\n var indent = c(\"indent\"); //references a div tag in the html\n var corner = c(\"corner\");\n var bottom = c(\"bottom\");\n \n // Add the elements to the box.\n box.appendChild(indent);\n box.appendChild(corner);\n box.appendChild(bottom);\n \n box.setIndent = function(str){ //maniipulates the text in the elements.\n indent.textContent = str;\n };\n box.setCorner = function(str){\n corner.textContent = str;\n };\n box.setBottom = function(str){\n bottom.textContent = str;\n };\n \n return box;\n };\n \n this.CreateThirdBox = function(){ //this is the last box in bowling, which pretty much changes a lot of the rules of the game..\n var e = function(className){\n var newElement = document.createElement(\"div\");\n newElement.className = className;\n return newElement;\n };\n\n var box = e(\"box-tenth\"); //creates a new box, you can make another box variable because it is in a different scope.\n \n var corner1 = e(\"corner-tenth\"); //creates it\n var corner2 = e(\"corner-tenth\"); //creates it\n var corner3 = e(\"corner-tenth\");\n \n var bottom = e(\"bottom\");\n\n\tbox.appendChild(corner1); //add it\n box.appendChild(corner2);\n box.appendChild(corner3);\n box.appendChild(bottom);\n\n box.setCorner1 = function(str){\n corner1.textContent = str;\n };\n box.setCorner2 = function(str){\n corner2.textContent = str;\n };\n box.setCorner3 = function(str){\n corner3.textContent = str;\n };\n box.setBottom = function(str){\n bottom.textContent = str;\n };\n \n return box;\n\n }\n\n\n}", "boxes() {\n return Game.find({}, { sort: { index: 1 } });\n }", "function clearBoxes() {\n progressMessage.setProgressMessage(\"clear bounding boxes\");\n if (boxpolys != null) {\n for (var i = 0; i < boxpolys.length; i++) {\n boxpolys[i].setMap(null);\n }\n }\n boxpolys = null;\n}", "renderAllShapes( ) {\n for( var i = 0; i < 6; i++ ){ \n for(var k = 0; k < 3; k++ ) {\n this.renderShape( Piece.getRandom(), k*5, i*5 );\n }\n }\n }", "function moveBox(k){\n var id = k;\n //console.log(\"Inside move box!!: \"+id);\n //gameOver condition has to be fixed as \n //its not accurate condition for game over\n if( (players[id].bottomMostX == 1 || players[id].bottomMostX == 0) && checkOccupiedBlock(id) == true){\n gameOver(id);\n }\n else if(players[id].bottomMostX == gridHeight-1 || (checkOccupiedBlock(id)) == true){\n selectNextPiece(id);\n \n //for storing the shape data\n if(players[id].replayMode == false){\n //console.log(\"inside move box players[id].replayMode == false\");\n setTheAllShapesUsedInGame(id,players[id].shapeType,players[id].anyColor);\n }\n eraseNextShape(id);\n randomBlockGenerator(id);\n \n //for storing the next shape data\n if(players[id].replayMode == false){\n //console.log(\"inside move box players[id].replayMode == false\");\n setTheAllNextShapesUsedInGame(id,players[id].nextPiece,players[id].nextColor);\n }\n checkRowCompletion(id);\n moveShapeToInitialPos(id);\n moveNextShapeToInitialPos(id);\n colorNextShape(id);\n }\n \n else if((checkOccupiedBlock(id)) == false){\n makeBlockUnoccupied(id);\n eraseShape(id);\n moveShapeDown(id);\n makeBlockOccupied(id);\n colorTheShape(id);\n }\n }", "function box (side) {\n for (var i = 0; i<4; i++) {\n forward( side)\n right( 90)\n }\n forward( side)\n right( 90)\n forward( side)\n}", "function populatePage() {\n var boxes = document.createDocumentFragment();\n\n for (var i=0; i < appdata.app_id.length; i++){\n var boxdiv = document.createElement('div');\n boxdiv.draggable = 'true';\n boxdiv.className = 'box';\n boxdiv.innerHTML = \"<a href=\\'\"+appdata.link[i]+\"\\'>\"+appdata.name[i]+\" (\" + appdata.description[i] + \")</a>\";\n boxdiv.style = 'background-color:'+appdata.color[i];\n boxes.appendChild(boxdiv);\n }\n var cont = document.getElementById('boxcontainer');\n cont.appendChild(boxes);\n }" ]
[ "0.7293549", "0.7145911", "0.7104569", "0.70254874", "0.6969243", "0.6845548", "0.67716", "0.67625123", "0.6760329", "0.6727716", "0.6718983", "0.67084146", "0.6697506", "0.66629213", "0.662379", "0.6620975", "0.6605176", "0.65965575", "0.658183", "0.65773433", "0.6566983", "0.6562272", "0.6541304", "0.65329874", "0.6527171", "0.6480818", "0.64638716", "0.6462122", "0.64597166", "0.6455023", "0.6452529", "0.64453787", "0.64393824", "0.64294565", "0.64278156", "0.64084554", "0.64057183", "0.64022", "0.6383632", "0.63796574", "0.63503283", "0.6339733", "0.63391566", "0.6331836", "0.6327863", "0.63156414", "0.6299102", "0.6291445", "0.62894803", "0.6278868", "0.62617016", "0.62559605", "0.6253919", "0.6227049", "0.62215936", "0.62096125", "0.6199641", "0.6197575", "0.6196216", "0.61827433", "0.6177011", "0.61617917", "0.61572754", "0.61366343", "0.6100884", "0.6093354", "0.60893816", "0.60866284", "0.60755646", "0.60301954", "0.6022583", "0.602026", "0.6018724", "0.6015012", "0.60118204", "0.60091496", "0.60044557", "0.5992939", "0.5982423", "0.5980458", "0.5974234", "0.5972926", "0.5971218", "0.5964202", "0.59628695", "0.59598637", "0.59528464", "0.5949672", "0.5948173", "0.59477025", "0.5934761", "0.5928602", "0.5923125", "0.5921775", "0.5917028", "0.5912084", "0.59075737", "0.59075147", "0.59065944", "0.59048367", "0.5902217" ]
0.0
-1
this needs a bunch of boxes
constructor(props) { super(props); this.cryptoList = ['BTC', 'ETH', 'XRP', 'BCH', 'EOS']; this.url = "https://financialmodelingprep.com/api/v3/cryptocurrencies"; //this.oneArray = [ ] $.ajax({ url: this.url, success: data => { console.log("Setting initial values."); let x = data['cryptocurrenciesList']; this.state = { valDict: { 'BTC': x[0]['price'], 'ETH': x[1]['price'], 'XRP': x[2]['price'], 'BCH': x[3]['price'], 'EOS': x[4]['price'] } }; this.oneArray = []; this.cryptoList.forEach(name => { this.oneArray.push(React.createElement(IndexBox, { indexName: name, indexPrice: this.state.valDict[name] })); }); }, async: false }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mkBoxes() {\n boxes.forEach(function(val){\n ctx.drawImage(boxImg, val[0] * boxSize, val[1] * boxSize, boxSize, boxSize);\n })\n}", "function boxes() {\n rectMode(CORNER);\n\n //array of different colored boxes\n for (var i = 0; i <= width - 20; i += 20) {\n for (var j = 0; j <= height - 20; j += 20) {\n stroke(0);\n fill(i * 0.50, j * 0.50, 180, 90);\n rect(i, j, 20, 20);\n }\n }\n\n noStroke();\n fill(textColor2);\n text(\"Move the mouse to make the white box move.\", 50, 50);\n\n}", "function BoxesManager() {\n\t\t \tvar iBoxsNum = name.length; \n\t\t\t//Creates the imgs\n\t\t\tfor (var i=0; i<iBoxsNum; i++) {\n\t\t\t\t//Create new img instance\n\t\t\t\tvar box = new Box(i);\t\n\t\t\t}\n\t\t\tvar div = document.createElement('div');\n\t\t\tdiv.className = \"clear\";\n\t\t\tvar main = document.getElementsByTagName(\"main\")[0];\n\t\t\tmain.appendChild(div);\n\n\t\t}", "function makeBoxes(){\n var divWidth = 0;\n var Xval = 0;\n var Yval = 0;\n for (var i = 0; i < colLength; i++) {\n var currentVal = boxArray[i][0];\n divWidth = 0;\n Yval += boxHeight;\n for (var j = 0; j <= rowLength - 1; j++) {\n divWidth += boxWidth;\n Xval += boxWidth;\n if (boxArray[i][j + 1] !== currentVal) {\n makeDiv({\n width: divWidth,\n divXlocation: Xval,\n divYlocation: Yval\n });\n currentVal = boxArray[i][j + 1];\n divWidth = 0;\n }\n }\n }\n return null;\n }", "function setupBoxes() {\n\tgirl.setupBoxes([[false,[3,2],0],[false,[6,2],0],[false,[3,9],0],[false,[1,12],0]]);\n\tguy.setupBoxes([[false,[16,2],0],[false,[10,2],0],[false,[11,11],0],[false,[17,8],0]]);\n}", "function drawBoxes(boxesArray)\t{\n\tvar scene = document.getElementById('scene');\n\tfor (i=0; i < boxesArray.length; i++)\t{\n\t\tvar myDiv = document.createElement('div');\n\t\tmyDiv.setAttribute('id',boxesArray[i].id);\n\t\tmyDiv.style.backgroundColor = boxesArray[i].color;\n\t\tmyDiv.setAttribute('class','box');\n\t\tmyDiv.style.left = boxesArray[i].x +'px';\n\t\tmyDiv.style.top = boxesArray[i].y + 'px';\n\t\tmyDiv.innerHTML = boxesArray[i].name;\n\t\tmyDiv.onclick = displayBoxContents;\n\t\tscene.appendChild(myDiv);\n\t}\n\t\n}", "function drawBoxes(boxes) {\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n };\n }", "function createBox()\n\t{\n\t\tbox = that.add('rect', {\n\t\t\tcolor: style.boxColor,\n\t\t\tborderWidth: style.borderWidth,\n\t\t\tborderColor: style.borderColor,\n\t\t\tdepth: that.depth\n\t\t}, fw.dockTo(that));\n\t}", "function selectTheBoxs(){\r\n\t\tif($(mark).width() == 0 || $(mark).height() == 0) return;\r\n\t\tfor(var i=0,j=oVar.iListNum;i<j;i++){\r\n\t\t\tvar oThisList = oVar.oLists.eq(i),\r\n\t\t\t\tiListL = oThisList.offset().left,\r\n\t\t\t\tiListT = oThisList.offset().top,\r\n\t\t\t\tiListR = iListL + oVar.iBoxW,\r\n\t\t\t\tiListB = iListT + oVar.iBoxH,\r\n\t\t\t\tselBoxL = $(mark).offset().left,\r\n\t\t\t\tselBoxT = $(mark).offset().top,\r\n\t\t\t\tselBoxR = $(mark).width() + selBoxL,\r\n\t\t\t\tselBoxB = $(mark).height() + selBoxT;\r\n\t\t\tif(selBoxL == 0 && selBoxT ==0) return;\r\n\t\t\tif(iListR > selBoxL && iListB > selBoxT && iListL < selBoxR && iListT < selBoxB){\r\n\t\t\t\tif(!oThisList.hasClass('broken') && $('.desc', oThisList).attr('category') != 'system'){\r\n\t\t\t\t\toThisList.addClass('focus');\r\n\t\t\t\t\t$('input[type=\"checkbox\"]', oThisList).attr('checked',true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$('input[type=\"checkbox\"]', oThisList).hide();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\toThisList.removeClass('focus');\r\n\t\t\t\t$('input[type=\"checkbox\"]', oThisList).attr('checked',false);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function drawBoxes(boxes) {\n progressMessage.setProgressMessage(\"draw bounding boxes\");\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }\n}", "function addBox(coin) {\nvar options = {\n width : \"18%\",\n height : \"25%\",\n content: \"Coin Pool Net Ratio\",\n tags: true,\n border: {\n type: 'line'\n },\n style: {\n fg: 'white',\n border: {\n fg: '#f0f0f0'\n },\n hover: {\n bg: 'green'\n }\n }\n}\nif (r == 1) {\n options.right = r\n} else {\n options.left = l\n}\noptions.label = \"{bold}\"+coin+\"{/bold}\";\nif (b == 1) {\n options.bottom = b;\n} else {\n options.top= t;\n}\nconsole.log(coin + t + b + l + r );\nbox[coin] = blessed.box( options);\n\n\n\nscreen.append(box[coin]);\n \n P++;\n l = P*20 + \"%\";\n \n if (P == '5' ) {\n r = '';\n rcount++;\n t = rcount * 25 + \"%\";\n l = '0%';\n P = 0;\n } \n \n \n\n}", "function drawBoxes(boxes) {\n boxpolys = new google.maps.Rectangle({\n bounds: boxes,\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }", "function resizeBoxDraw(){\n state.boxArr.forEach(function(el){\n ctx.fillStyle = el.resizeStyle;\n ctx.fillRect(el.resize.top.x, el.resize.top.y, el.resize.top.w, el.resize.top.h)\n // ctx.fillRect(el.resize.bottom.x, el.resize.bottom.y, el.resize.bottom.w, el.resize.bottom.h)\n // ctx.fillRect(el.resize.left.x, el.resize.left.y, el.resize.left.w, el.resize.left.h)\n ctx.fillRect(el.resize.right.x, el.resize.right.y, el.resize.right.w, el.resize.right.h) \n })\n \n }", "function drawBoxes(boxes) {\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }\n}", "function drawBoxes() {\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }\n}", "function makeBox() {\n\n}", "function drawBoxes(boxes) {\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 3,\n map: map\n });\n }\n}", "addBox(){\n\t\tvar x=Math.floor((Math.random()*this.width)); \n\t\tvar y=Math.floor((Math.random()*this.height)); \n\t\tif(this.getSquare(x,y)===null){\n\t\t\tvar velocity = new Pair(0,0);\n\t\t\tvar length = 50;\n\t\t\tvar health = 50;\n\t\t\tvar colour= 'rgba(223, 252, 3, 0.6)';\n\t\t\tvar position = new Pair(x,y);\n\t\t\t// check if the boxes would exceed the world\n\t\t\tif (position.x - length < 0){\n\t\t\t\tlength = position.x // boxes start from the left bound\n\t\t\t} \n\t\t\tif (position.x + length > this.width){\n\t\t\t\tlength = this.width - position.x // boxes end at the right bound\n\t\t\t} \n\t\t\tif (position.y - length < 0){\n\t\t\t\tlength = position.y // boxes start from the upper bound\n\t\t\t} \n\t\t\tif (position.y + length > this.height){\n\t\t\t\tlength = this.height - position.y // boxes end at the lower bound\n\t\t\t}\n\t\t\t// check if the boxes disappear after the above adjustments \n\t\t\tif (length != 0){\n\t\t\t\t// create the boxes and add to the list\n\t\t\t\t// the health of the boxes would be 50\n\t\t\t\tvar box = new Box(this, position, velocity, colour, length, health);\n\t\t\t\tthis.addSquare(box);\n\t\t\t\tthis.boxes_number += 1; // update the enemies number for stats\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "function boxes(n, content, cls) {\n if (!content) { content = ''; }\n\n var div = elem('div').addClass('boxes');\n for (var i = 1; i <= n; i++) {\n div.append(box(content, cls));\n }\n\n return div;\n}", "function BoxRenderer() {}", "drawBoxes () {\n let c = document.getElementById(\"canvas\").getContext(\"2d\");\n c.fillStyle = \"black\";\n for(let i = 1; i < this.state.m; i++) {\n c.fillRect(i * 20, 0, 1, this.state.n * this.state.cellSize);\n }\n for(let i = 1; i < this.state.n; i++) {\n c.fillRect(0, i * 20, this.state.m * this.state.cellSize, 1);\n }\n }", "function createBoxes(formArray,myCounter)\t{\n// assign the 0,1,2 array elements to their corresponding variables here\n\tvar boxName = formArray[0];\n\tvar boxColor = formArray[1];\n\tvar numBoxes = formArray[2];\n// create the box object\n\tfor (i=0; i < numBoxes; i++)\t{\n\t\tvar boxId = myCounter+100;\t\n\t\tvar sceneDiv = document.getElementById(\"scene\");\n\t\tvar x = Math.floor(Math.random() * (sceneDiv.offsetWidth-101));\n\t\tvar y = Math.floor(Math.random() * (sceneDiv.offsetHeight-101));\n\t\tvar myBox = new Box(boxId,boxName,boxColor,x,y);\n\t\tmyCounter +=1;\n\t\tboxes.push(myBox);\n\t\t}\n\t}", "function addBoxes () {\n // Create some cubes around the origin point\n for (var i = 0; i < BOX_QUANTITY; i++) {\n var angle = Math.PI * 2 * (i / BOX_QUANTITY);\n var geometry = new THREE.BoxGeometry(BOX_SIZE, BOX_SIZE, BOX_SIZE);\n var material = new THREE.MeshNormalMaterial();\n var cube = new THREE.Mesh(geometry, material);\n cube.position.set(Math.cos(angle) * BOX_DISTANCE, camera.position.y - 0.25, Math.sin(angle) * BOX_DISTANCE);\n scene.add(cube);\n }\n // Flip this switch so that we only perform this once\n boxesAdded = true;\n}", "function prepareOneSlideBox(slotholder, opt, visible) {\n\n var sh = slotholder;\n var img = sh.find('img')\n setSize(img, opt)\n var src = img.attr('src');\n var bgcolor = img.css('background-color');\n\n var w = img.data('neww');\n var h = img.data('newh');\n var fulloff = img.data(\"fxof\");\n if (fulloff == undefined)\n fulloff = 0;\n\n var fullyoff = img.data(\"fyof\");\n if (img.data('fullwidthcentering') != \"on\" || fullyoff == undefined)\n fullyoff = 0;\n\n\n\n var off = 0;\n\n\n\n\n // SET THE MINIMAL SIZE OF A BOX\n var basicsize = 0;\n if (opt.sloth > opt.slotw)\n basicsize = opt.sloth\n else\n basicsize = opt.slotw;\n\n\n if (!visible) {\n var off = 0 - basicsize;\n }\n\n opt.slotw = basicsize;\n opt.sloth = basicsize;\n var x = 0;\n var y = 0;\n\n\n\n for (var j = 0; j < opt.slots; j++) {\n\n y = 0;\n for (var i = 0; i < opt.slots; i++) {\n\n\n sh.append('<div class=\"slot\" ' +\n 'style=\"position:absolute;' +\n 'top:' + (fullyoff + y) + 'px;' +\n 'left:' + (fulloff + x) + 'px;' +\n 'width:' + basicsize + 'px;' +\n 'height:' + basicsize + 'px;' +\n 'overflow:hidden;\">' +\n '<div class=\"slotslide\" data-x=\"' + x + '\" data-y=\"' + y + '\" ' +\n 'style=\"position:absolute;' +\n 'top:' + (0) + 'px;' +\n 'left:' + (0) + 'px;' +\n 'width:' + basicsize + 'px;' +\n 'height:' + basicsize + 'px;' +\n 'overflow:hidden;\">' +\n '<img style=\"position:absolute;' +\n 'top:' + (0 - y) + 'px;' +\n 'left:' + (0 - x) + 'px;' +\n 'width:' + w + 'px;' +\n 'height:' + h + 'px' +\n 'background-color:' + bgcolor + ';\"' +\n 'src=\"' + src + '\"></div></div>');\n y = y + basicsize;\n }\n x = x + basicsize;\n }\n }", "function boxesGenerator (value){\n\n mainContainer.innerHTML = \"\";\n\n const percentWidth = Math.sqrt(value);\n const boxDimension = 100 / percentWidth;\n \n for (let i = 1; i <= value; i++){\n const boxN = document.createElement(\"div\");\n boxN.classList.add(\"box\");\n boxN.innerHTML += `<p class=\"user_select_none\">${i}</p>`\n boxN.style.width = boxDimension + \"%\";\n boxN.style.height = boxDimension + \"%\"; \n //qui ci devi mettere il listener al click della box (se non lo metti qua)\n boxN.addEventListener(\"click\", function(){\n this.classList.toggle(\"clicked\")\n }) \n \n mainContainer.append(boxN);\n }\n\n}", "function drawBox () {\n\n\t\t\tvar $topBar = $('<div class=\"round-top back-right-image\"><div class=\"round-top-fill back-left-image\"></div></div>');\n\n\t\t\tif(opts.headerTitle != \"\" && opts.headerThickness == \"thick\") {\n\t\t\t\tvar $text = $('<span class=\"text-top\"></span>').html(opts.headerTitle)\n\n\t\t\t\t$topBar.find('.round-top-fill').html($text);\n\t\t\t}\n\n\t\t\tvar $bodyContent = $('<div class=\"round-body\"><div class=\"round-body-content\"></div></div>');\n\n\t\t\tif(opts.type != \"\" && !opts.wrapContent){\n\t\t\t\tvar content = \"\";\n\n\t\t\t\tcontent\t+= '<div class=\"message-body\">';\n\t\t\t\tfor (i in messages) {\n\t\t\t\t\tif (typeof i != typeof function(){}) {\n\t\t\t\t\t\tif(i > 0) {\n\t\t\t\t\t\t\tfor( j=0; j < messages[i].length; j++) {\n\t\t\t\t\t\t\t\tcontent\t+= '<div class=\"message-detail\">' + messages[i][j] + '</div>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontent\t+= '<div class=\"message-summary\">' + messages[i][0] + '</div>';\n\t\t\t\t\t\t\tcontent\t+= '<div class=\"message-detail\">' + messages[i][1] + '</div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t};\n\t\t\t\tcontent\t+= '</div>';\n\n\t\t\t\t$bodyContent.children().append(content);\n\t\t\t}\n\n\t\t\tvar $bottomBar = $('<div class=\"round-bottom back-right-image\"><div class=\"round-bottom-fill back-left-image\"></div></div>');\n\n\t\t\t//for error/warning/success boxes that have no fill color specifications\n\t\t\tif(opts.fillColor != \"\")\n\t\t\t\topts.fillColor = opts.fillColor + \"-\";\n\n\t\t\tvar $container = $('<div class=\"round-container\"></div>')\n\t\t\t\t\t\t\t\t\t.addClass(opts.borderColor+\"-\"+opts.fillColor+\"container\")\n\t\t\t\t\t\t\t\t\t.append($topBar)\n\t\t\t\t\t\t\t\t\t.append($bodyContent)\n\t\t\t\t\t\t\t\t\t.append($bottomBar);\n\n\t\t\t//add an ID to the container if specified\n\t\t\tif(opts.containerId != \"\"){\n\t\t\t\t$container.attr('id',opts.containerId);\n\t\t\t}\n\n\t\t\t//add header thickness class to container if specified\n\t\t\tif(opts.headerThickness != \"\"){\n\t\t\t\t$container.addClass(opts.headerThickness+\"-top\");\n\t\t\t}\n\n\t\t\t//add more classes if specified\n\t\t\tif(opts.containerClass != \"\"){\t//FIX THIS...ONLY ADDS 1 CLASS\n\t\t\t\t$container.addClass(opts.containerClass);\n\t\t\t}\n\n\t\t\t$container.css({width : opts.width});\n\n\t\t\treturn $container;\n\t\t}", "function draw_box(element, classes) {\n\n var element_p;\n\n if (typeof $(element) === 'undefined') {\n element_p = $(element);\n } else {\n element_p = iframe.find(element);\n }\n\n // Be sure this element have.\n if (element_p.length > 0) {\n\n var marginTop = element_p.css(\"margin-top\");\n var marginBottom = element_p.css(\"margin-bottom\");\n var marginLeft = element_p.css(\"margin-left\");\n var marginRight = element_p.css(\"margin-right\");\n\n var paddingTop = element_p.css(\"padding-top\");\n var paddingBottom = element_p.css(\"padding-bottom\");\n var paddingLeft = element_p.css(\"padding-left\");\n var paddingRight = element_p.css(\"padding-right\");\n\n //Dynamic boxes variables\n var element_offset = element_p.offset();\n var topBoxes = element_offset.top;\n var leftBoxes = element_offset.left;\n if (leftBoxes < 0) {\n leftBoxes = 0;\n }\n var widthBoxes = element_p.outerWidth(false);\n var heightBoxes = element_p.outerHeight(false);\n\n var bottomBoxes = topBoxes + heightBoxes;\n\n var rightExtra = 1;\n var rightS = 1;\n\n if (is_content_selected()) {\n rightExtra = 2;\n rightS = 2;\n }\n\n var rightBoxes = leftBoxes + widthBoxes - rightExtra;\n\n var windowWidth = $(window).width();\n\n // If right border left is more then screen\n if (rightBoxes > (windowWidth - window.scroll_width - rightS)) {\n rightBoxes = windowWidth - window.scroll_width - rightS;\n }\n\n // If bottom border left is more then screen\n if ((leftBoxes + widthBoxes) > windowWidth) {\n widthBoxes = windowWidth - leftBoxes - 1;\n }\n\n if (heightBoxes > 1 && widthBoxes > 1) {\n\n // Dynamic Box\n if (iframe.find(\".\" + classes + \"-top\").length === 0) {\n iframeBody.append(\"<div class='\" + classes + \"-top'></div><div class='\" + classes + \"-bottom'></div><div class='\" + classes + \"-left'></div><div class='\" + classes + \"-right'></div>\");\n }\n\n // Margin append\n if (iframe.find(\".\" + classes + \"-margin-top\").length === 0) {\n iframeBody.append(\"<div class='\" + classes + \"-margin-top'></div><div class='\" + classes + \"-margin-bottom'></div><div class='\" + classes + \"-margin-left'></div><div class='\" + classes + \"-margin-right'></div>\");\n }\n\n // Padding append.\n if (iframe.find(\".\" + classes + \"-padding-top\").length === 0) {\n iframeBody.append(\"<div class='\" + classes + \"-padding-top'></div><div class='\" + classes + \"-padding-bottom'></div><div class='\" + classes + \"-padding-left'></div><div class='\" + classes + \"-padding-right'></div>\");\n }\n\n // Dynamic Boxes position\n iframe.find(\".\" + classes + \"-top\").css(\"top\", topBoxes).css(\"left\", leftBoxes).css(\"width\", widthBoxes);\n\n iframe.find(\".\" + classes + \"-bottom\").css(\"top\", bottomBoxes).css(\"left\", leftBoxes).css(\"width\", widthBoxes);\n\n iframe.find(\".\" + classes + \"-left\").css(\"top\", topBoxes).css(\"left\", leftBoxes).css(\"height\", heightBoxes);\n\n iframe.find(\".\" + classes + \"-right\").css(\"top\", topBoxes).css(\"left\", rightBoxes).css(\"height\", heightBoxes);\n\n // Top Margin\n iframe.find(\".\" + classes + \"-margin-top\").css(\"top\", parseFloat(topBoxes) - parseFloat(marginTop)).css(\"left\", parseFloat(leftBoxes) - parseFloat(marginLeft)).css(\"width\", parseFloat(widthBoxes) + parseFloat(marginRight) + parseFloat(marginLeft)).css(\"height\", marginTop);\n\n // Bottom Margin\n iframe.find(\".\" + classes + \"-margin-bottom\").css(\"top\", bottomBoxes).css(\"left\", parseFloat(leftBoxes) - parseFloat(marginLeft)).css(\"width\", parseFloat(widthBoxes) + parseFloat(marginRight) + parseFloat(marginLeft)).css(\"height\", marginBottom);\n\n // Left Margin\n iframe.find(\".\" + classes + \"-margin-left\").css(\"top\", topBoxes).css(\"left\", parseFloat(leftBoxes) - parseFloat(marginLeft)).css(\"height\", heightBoxes).css(\"width\", marginLeft);\n\n // Right Margin\n iframe.find(\".\" + classes + \"-margin-right\").css(\"top\", topBoxes).css(\"left\", rightBoxes + 2).css(\"height\", heightBoxes).css(\"width\", marginRight);\n\n // Top Padding\n iframe.find(\".\" + classes + \"-padding-top\").css(\"top\", parseFloat(topBoxes)).css(\"left\", parseFloat(leftBoxes)).css(\"width\", parseFloat(widthBoxes / 2)).css(\"height\", paddingTop);\n\n // Bottom Padding\n iframe.find(\".\" + classes + \"-padding-bottom\").css(\"top\", bottomBoxes - parseFloat(paddingBottom)).css(\"left\", parseFloat(leftBoxes)).css(\"width\", parseFloat(widthBoxes / 2)).css(\"height\", paddingBottom);\n\n // Left Padding\n iframe.find(\".\" + classes + \"-padding-left\").css(\"top\", topBoxes).css(\"left\", parseFloat(leftBoxes)).css(\"height\", heightBoxes / 2).css(\"width\", paddingLeft);\n\n // Right Padding\n iframe.find(\".\" + classes + \"-padding-right\").css(\"top\", topBoxes).css(\"left\", rightBoxes - parseFloat(paddingRight)).css(\"height\", heightBoxes / 2).css(\"width\", paddingRight);\n\n if (is_resizing() == false && is_dragging() == false) {\n iframe.find(\".yp-selected-handle\").css(\"left\", leftBoxes).css(\"top\", topBoxes);\n }\n\n }\n\n }\n\n }", "function showBoxData(){\n state.boxArr.forEach(function(box){\n\n if(box.selected){\n inpX.value = box.x;//box.x;\n inpY.value = box.y;//box.y;\n inpW.value = box.w;//box.w;\n inpH.value = box.h;//box.h;\n inpText.value = box.text;\n inpKey.value = box.key;\n inpItem.value = box.item;\n inpXskew.value = box.xSkew;\n }\n })\n inpPaddingX.value = xPadding;\n inpPaddingY.value = yPadding;\n }", "function getBoxes() {\r\n for (i = 0; i < 9; i++) {\r\n var boxName = \"ticTacToeBox\" + (i + 1);\r\n var box = document.getElementById(boxName);\r\n boxes[i] = {\r\n boxId: box.id\r\n };\r\n }\r\n}", "function clear_boxes() {\n for (var tt of tooltips) { tt.remove(); tooltips.delete(tt); }\n for (var box of boxes) { box.remove(); boxes.delete(box); }\n while (vgvContainer.lastChild) { vgvContainer.remove(vgvContainer.lastChild); }\n}", "addRandomBox(){\n\n\t\t// use a do...while statement because there can't be intersecting polygons\n\t\tdo{\n\n\t\t\t// random x and y coordinates, width and height\n\t\t\tvar startX = Phaser.Math.Between(10, game.config.width - 10 - gameOptions.sizeRange.max);\n\t\t\tvar startY = Phaser.Math.Between(10, game.config.height - 10 - gameOptions.sizeRange.max);\n\t\t\tvar width = Phaser.Math.Between(gameOptions.sizeRange.min, gameOptions.sizeRange.max);\n\t\t\tvar height = Phaser.Math.Between(gameOptions.sizeRange.min, gameOptions.sizeRange.max);\n\n\t\t\t// check if current box intersects other boxes\n\t\t} while(this.boxesIntersect(startX, startY, width, height));\n\n\t\t// draw the box\n\t\tthis.wallGraphics.strokeRect(startX, startY, width, height);\n\n\t\t// insert box vertices into polygons array\n\t\tthis.polygons.push([[startX, startY], [startX + width, startY], [startX + width, startY + height], [startX, startY + height]]);\n\t}", "function boxCreator() {\n let attributesForBoxes = document.createAttribute('class');\n attributesForBoxes.value = 'box-attributes';\n let box = document.createElement('div');\n box.id = `box${i}`;\n box.setAttributeNode(attributesForBoxes);\n document.getElementById('game').appendChild(box);\n document.getElementById('game').style.display = 'flex';\n }", "generateBoxes(numBoxes){\n\t\twhile(numBoxes>0){\n\t\t\t\n\t\t\t//Get random x and y position based on canvas size\n\t\t\tvar x=Math.floor((Math.random()*(this.width-200))); \n\t\t\tvar y=Math.floor((Math.random()*(this.height-200))); \n\t\t\t\n\t\t\t//If an actor does not exist at (x, y) position\n\t\t\tif(this.getActor(x,y)===null){\n\t\t\t\t\n\t\t\t\tvar red=randint(255), green=randint(255), blue=randint(255);\n\t\t\t\t\n\t\t\t\t//Random integers in range code below from\n\t\t\t\t//https://stackoverflow.com/questions/1527803/generating-random-whole-numbers-in-javascript-in-a-specific-range\n\t\t\t\t//Set width and height values between 5 and 200 inclusive\n\t\t\t\tvar width = Math.floor(Math.random() * (200 - 5 + 1)) + 5;\n\t\t\t\tvar height = Math.floor(Math.random() * (200 - 5 + 1)) + 5;\n\t\t\t\t\n\t\t\t\tvar colour= 'rgba('+red+','+green+','+blue+','+0.75+')';\n\t\t\t\tvar position = new Pair(x,y);\n\t\t\t\tvar health = 3;\n\t\t\t\tvar type = \"Ammo\";\n\t\t\t\t\n\t\t\t\t//Randomly make a Box a gun box based on gunSpawn value\n\t\t\t\tvar gunSpawn = Math.floor(Math.random()*10);\n\t\t\t\tif (gunSpawn == 0){\n\t\t\t\t\ttype = \"Pistol\";\n\t\t\t\t\thealth = 100;\n\t\t\t\t} else if (gunSpawn == 1){\n\t\t\t\t\ttype = \"Sniper\";\n\t\t\t\t\thealth = 100;\n\t\t\t\t} else if (gunSpawn == 2){\n\t\t\t\t\ttype = \"Shotgun\";\n\t\t\t\t\thealth = 100;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//Add Box to actors\n\t\t\t\tvar b = new Box(this, \"Box\", position, colour, width, height, health, type);\n\t\t\t\tthis.addActor(b);\n\t\t\t\tnumBoxes--;\n\t\t\t}\n\t\t}\n\t}", "function addInitialBoxes() {\n for (var i = 0; i < 5; i++) {\n addBoxes();\n }\n}", "function addBox(width, height, center = [0, 0, 1]) {\n let object = {\n name: '',\n type: 'box',\n width: width,\n height: height,\n center: center,\n fill: '#FFFFFF',\n stroke: '#000000',\n actualStroke: '#000000',\n T: Math.identity(),\n R: Math.identity(),\n S: Math.identity(),\n angleRotation: 0\n }\n objectSelected = objects.push(object)\n drawObjects()\n return objectSelected\n }", "function renderBoxes(count) {\n var boxes = ''\n for (var i = 0; i < count; i++) {\n if (i == count / 2) {\n boxes += `<br>\n `\n }\n boxes += `\n <div class=\"testpoint-box\">\n <input name=\"testpoint-box\" type=\"checkbox\" id=\"ch${i + 1}\" name=\"ch${\n i + 1\n }\" value=\"ch${i + 1}\">\n <label class=\"put-left\" for=\"ch${i + 1}\"> CH${i + 1}</label> \n </div>`\n }\n return boxes\n}", "function prepareOneSlideBox(slotholder, opt, visible) {\n\n var sh = slotholder;\n var img = sh.find('img')\n setSize(img, opt)\n var src = img.attr('src');\n var w = img.data('neww');\n var h = img.data('newh');\n var fulloff = img.data(\"fxof\");\n if (fulloff == undefined) fulloff = 0;\n var off = 0;\n\n\n\n\n // SET THE MINIMAL SIZE OF A BOX\n var basicsize = 0;\n if (opt.sloth > opt.slotw)\n basicsize = opt.sloth\n else\n basicsize = opt.slotw;\n\n\n if (!visible) {\n var off = 0 - basicsize;\n }\n\n opt.slotw = basicsize;\n opt.sloth = basicsize;\n var x = 0;\n var y = 0;\n\n\n\n for (var j = 0; j < opt.slots; j++) {\n\n y = 0;\n for (var i = 0; i < opt.slots; i++) {\n\n\n sh.append('<div class=\"slot\" ' +\n 'style=\"position:absolute;' +\n 'top:' + y + 'px;' +\n 'left:' + (fulloff + x) + 'px;' +\n 'width:' + basicsize + 'px;' +\n 'height:' + basicsize + 'px;' +\n 'overflow:hidden;\">' +\n\n '<div class=\"slotslide\" data-x=\"' + x + '\" data-y=\"' + y + '\" ' +\n 'style=\"position:absolute;' +\n 'top:' + (0) + 'px;' +\n 'left:' + (0) + 'px;' +\n 'width:' + basicsize + 'px;' +\n 'height:' + basicsize + 'px;' +\n 'overflow:hidden;\">' +\n\n '<img style=\"position:absolute;' +\n 'top:' + (0 - y) + 'px;' +\n 'left:' + (0 - x) + 'px;' +\n 'width:' + w + 'px;' +\n 'height:' + h + 'px\"' +\n 'src=\"' + src + '\"></div></div>');\n y = y + basicsize;\n }\n x = x + basicsize;\n }\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 box(length) {\n for (var i = 0; i < 6; i++) {\n forward(length);\n right(60);\n }\n}", "function initialize_boxes() {\n \n // build stuff for the focus hero\n boxes['focus'] = {};\n boxes['focus']['talents'] = new TalentBox(6, null, [], [], vgvContainer);\n boxes['focus']['abilities'] = [];\n for (var i = 0; i < 6; i++) {\n boxes['focus']['abilities'].push(new AbilityBox(i, 6, null, [], vgvContainer));\n }\n boxes['focus']['items'] = [];\n for (var i = 0; i < 9; i++) {\n boxes['focus']['items'].push(new ItemBox(i, 6, null, vgvContainer));\n }\n \n // build hero avatar boxes\n boxes['avatars'] = [];\n for (var i = 0; i < 10; i++) {\n boxes['avatars'].push(new AvatarBox(i, vgvContainer));\n // boxes['avatars'][i].element.addEventListener('click', function(event) {console.log(TIMER)});\n }\n}", "constructor () {\n this.size = 16;\n this.grid_status = this.makeStatus();\n this.boxies = this.makeBoxes();\n }", "function createGrid(numBox){\n var box = '<div class=\"box\"></div>';\n for(var i = 1; i <= numBox; i++){\n for(var j = 1; j <= numBox; j++){\n $('#container').append('<div class=\"box\"></div>');\n }\n }\n var size = (400 - (numBox * 2)) / numBox;\n $('.box').css({'height': size, 'width': size});\n }", "getBoxes() {\n return this.boxes.map(\n box => this.getBoxData(box)\n );\n }", "function drawBoxes() {\n // Initialize boxElement (outside of the for loop below)\n let boxElement = document.createElement(\"span\");\n // Flag to determine if this is a huge box or not.\n let hugeBox = false;\n /* Note: These functions make use of the block-scope\n * i'm promised due to me using \"let\" when\n * instantiating boxElement; this function also\n * makes use of \"hiding\" or \"closure\".\n * I don't need any other function to see mutateBox\n * and I KNOW that right from the start, so might as\n * well make it's scope only the function that needs it.\n * Downside: It makes the drawBoxes function more\n * complex and harder to understand. */\n /** Will shape and color a box element. */\n function mutateBox() {\n // Now apply them to the boxElement\n boxElement.style.width = boxWidth + \"px\";\n boxElement.style.height = boxHeight + \"px\";\n // Assign the box a random class\n boxElement.classList.add(getRandomElement(randomCSSClasses));\n // Fill in the box's value with some weird value\n boxElement.innerText = generateString();\n // Add a bunch of random CSS rules\n boxElement.style.backgroundColor = generateHexColor();\n boxElement.style.color = generateHexColor();\n /* Logic here: I want the font size to be no bigger\n * than 2rem, but no smaller than 0.02rem, unless it's\n * a \"hugeBox\", in which case, I'll blow out that font\n * size so it's at least 6rem and at most 16rem, because\n * if it's a hugeBox it'll have a large height and width\n * that we need to fill. */\n boxElement.style.fontSize = hugeBox ? randomNum(15) + 10 + \"rem\" : (Math.random() + (Math.random() * 0.5)) + \"rem\";\n /* 70% chance to align text to the left, otherwise\n * align the text to the right. */\n boxElement.style.textAlign = Math.random() < 0.7 ? \"left\" : \"right\";\n // Small chance to float right (12%)\n boxElement.style.float = Math.random() < 0.88 ? \"left\" : \"right\";\n // 80/20 chance the box will be in layer 1 or 2.\n if(Math.random() > 0.80) {\n boxElement.classList.add(\"layer-2\");\n }\n else {\n boxElement.classList.add(\"layer-1\");\n }\n // 20% chance to randomly rotate the box\n boxElement.style.transform = Math.random() > 0.80 ? \"rotate(\" + randomNum(360) + \"deg)\" : \"\";\n /* Apply the background pulse in random intervals\n * of anywhere from 0.05s-20s */\n addBackgroundPulse(boxElement, (Math.random() * (Math.random() * 20000)));\n }\n /** Will set the box's height and width, and also\n * there's a small chance the limit for both boxHeight and boxWidth\n * can change. */\n function resetBoxDimensions() {\n /* Reset our flag for huge box, because\n * this is the only function that modifies\n * the variable. */\n hugeBox = false;\n // Set boxWidth and boxHeight\n boxWidth = randomNum(boxWidthLimit);\n boxHeight = randomNum(boxHeightLimit);\n /* Reset boxWidthLimit and boxHeightLimit\n * every so often. */\n boxHeightLimit = Math.random() < 0.83 ? boxHeightLimit : randomNum(250) + randomNum(40) + 20;\n boxWidthLimit = Math.random() < 0.77 ? boxWidthLimit : randomNum(250) + randomNum(40) + 10;\n // Very small chance (2%) to return HUGE dimensions\n if (randomNum(100) > 98) {\n boxWidth = randomNum(boxWidthLimit * randomNum(10));\n boxHeight = randomNum(boxHeightLimit * randomNum(10));\n // Don't forget, we need to remember this\n // in mutateBox above when setting font size.\n hugeBox = true;\n }\n }\n /** Animates a box by attaching a CSS class;\n * the animations are defined in style.css. \n * @param {number} maxAnimationSeconds Defines how long\n * a CSS animation will last, in seconds. Optional.\n * @param {array} animationNames Make sure when\n * overridding animationNames you use valid animations defined\n * in style.css. Optional. */\n function animateBox(maxAnimationSeconds = 10, animationNames = [ \n \"spin alternate\", \n \"droppingHot\", \n \"spinBig\", \n \"wackoDacko\", \n \"onHover alternate\", \n \"onHover\", \n \"wackoDacko alternate\"]) {\n // 50/50 chance we may not even do it.\n if(randomNum() < 0.50) {\n /* 84% chance this doesn't go through, but if\n * it does, we'll set the animation of the boxElement\n * defined in this scope (in the beginning of drawBoxes)\n * to a random animation defined in animationNames, which\n * could be overridden if need be. */\n boxElement.style.animation = Math.random() < 0.84 ? boxElement.style.animation : randomNum(maxAnimationSeconds) + \"s \" + getRandomElement(animationNames);\n }\n }\n for(let i = 0; i < boxAmount; i++) {\n // Create a new span element\n boxElement = document.createElement(\"span\");\n // Get different sized boxes each time\n resetBoxDimensions();\n // Make the box look unique using CSS rules\n // like font-size, float, text-align, etc.,\n // as well as fill the box with words.\n mutateBox();\n // Animate the box\n animateBox();\n // Append the new element to the body\n document.body.appendChild(boxElement);\n }\n }", "function boxIt (arrOfArgs) {\n if (!arrOfArgs[0]){\n console.log(\"\\u250E\" + \"\\u2512\" + \"\\n\" + \"\\u2515\" + \"\\u251A\")\n return\n }\n let longest = longestName(arrOfArgs)\n console.log(drawTopBorder(longest))\n\n arrOfArgs.forEach(name => {\n console.log (drawBarsAround(name, longest))\n if (name === arrOfArgs[arrOfArgs.length-1]){\n console.log(drawBottomBorder(longest))\n }\n else\n console.log (drawMiddleBorder(longest))\n }\n ) \n}", "function createBox (box_type,size, scene) {\n var mat = new BABYLON.StandardMaterial(\"mat\", scene);\n var texture = new BABYLON.Texture(\"images/textures/box_atlas.png\", scene);\n mat.diffuseTexture = texture;\n var columns = 8; // 6 columns\n var rows = 8; // 4 rows\n var faceUV = new Array(6);\n\n switch (box_type) {\n case \"wood\":\n for (var i = 0; i < 6; i++) {\n faceUV[i] = new BABYLON.Vector4(6 / columns, 3 / rows, 7 / columns, 4 / rows);\n }\n break;\n case \"tnt\":\n var Ubottom_left = 3 / columns;\n var Vbottom_left = 3 / rows;\n var Utop_right = 4 / columns;\n var Vtop_right = 4 / rows;\n //select the face of the cube\n faceUV[0] = new BABYLON.Vector4(Utop_right, Vtop_right, Ubottom_left, Vbottom_left);\n faceUV[1] = new BABYLON.Vector4(Ubottom_left, Vbottom_left, Utop_right, Vtop_right);\n faceUV[2] = new BABYLON.Vector4(Utop_right, Vtop_right, Ubottom_left, Vbottom_left);\n faceUV[3] = new BABYLON.Vector4(Utop_right, Vtop_right, Ubottom_left, Vbottom_left);\n for (var i = 4; i < 6; i++) {\n faceUV[i] = new BABYLON.Vector4(4 / columns, 3 / rows, 5 / columns, 4 / rows);\n }\n\n\n break;\n }\n var box = BABYLON.MeshBuilder.CreateBox('box', {size:size,faceUV: faceUV}, scene);\n box.isPickable = true;\n box.material = mat;\n box.position = position;\n return box;\n }", "function addBoxes(parent, numberOfBoxes) {\n for (var i = 1; i <= numberOfBoxes; i ++) {\n addBox(parent, numberOfBoxes);\n };\n}", "function boxClicked() {\r\n let clickedBox = this.className;\r\n let mark = this;\r\n let player = \"User\";\r\n mark.style.background = \"url(img/x-brush.png) no-repeat\";\r\n mark.style.backgroundSize = \"contain\";\r\n mark.style.backgroundPosition = \"center\";\r\n mark.style.pointerEvents = \"none\";\r\n checkClass(clickedBox, player);\r\n computerRandomizer(boxRow, mark);\r\n console.log(updateList.length);\r\n\r\n state();\r\n}", "function checkBoxes() {\n boxes.forEach((box) => {\n const triggerBottom = innerHeight * 0.8;\n const boxTop = box.getBoundingClientRect().top;\n console.log(boxTop);\n console.log(triggerBottom);\n if (boxTop < triggerBottom) {\n box.classList.add(\"show\");\n } else {\n box.classList.remove(\"show\");\n }\n });\n}", "function prepareOneSlideBox(slotholder,opt,visible) {\n\n\t\t\t\tvar sh=slotholder;\n\t\t\t\tvar img = sh.find('.defaultimg');\n\n\t\t\t\tsetSize(img,opt)\n\t\t\t\tvar src = img.data('src');\n\t\t\t\tvar bgcolor=img.css('backgroundColor');\n\n\t\t\t\tvar w = opt.width;\n\t\t\t\tvar h = opt.height;\n\t\t\t\tif (opt.autoHeight==\"on\")\n\t\t\t\t h = opt.container.height();\n\t\t\t\t \n\t\t\t\tvar fulloff = img.data(\"fxof\");\n\t\t\t\tif (fulloff==undefined) fulloff=0;\n\n\t\t\t\tfullyoff=0;\n\n\n\n\t\t\t\tvar off=0;\n\n\n\n\n\t\t\t\t// SET THE MINIMAL SIZE OF A BOX\n\t\t\t\tvar basicsize = 0;\n\t\t\t\tif (opt.sloth>opt.slotw)\n\t\t\t\t\tbasicsize=opt.sloth\n\t\t\t\telse\n\t\t\t\t\tbasicsize=opt.slotw;\n\n\n\t\t\t\tif (!visible) {\n\t\t\t\t\tvar off=0-basicsize;\n\t\t\t\t}\n\n\t\t\t\topt.slotw = basicsize;\n\t\t\t\topt.sloth = basicsize;\n\t\t\t\tvar x=0;\n\t\t\t\tvar y=0;\n\n\t\t\t\tvar bgfit = img.data('bgfit');\n\t\t\t\tvar bgrepeat = img.data('bgrepeat');\n\t\t\t\tvar bgposition = img.data('bgposition');\n\n\t\t\t\tif (bgfit==undefined) bgfit=\"cover\";\n\t\t\t\tif (bgrepeat==undefined) bgrepeat=\"no-repeat\";\n\t\t\t\tif (bgposition==undefined) bgposition=\"center center\";\n\n\t\t\t\tfor (var j=0;j<opt.slots;j++) {\n\n\t\t\t\t\ty=0;\n\t\t\t\t\tfor (var i=0;i<opt.slots;i++) \t{\n\n\n\t\t\t\t\t\tsh.append('<div class=\"slot\" '+\n\t\t\t\t\t\t\t\t 'style=\"position:absolute;'+\n\t\t\t\t\t\t\t\t\t\t\t'top:'+(fullyoff+y)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'left:'+(fulloff+x)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'width:'+basicsize+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'height:'+basicsize+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'overflow:hidden;\">'+\n\n\t\t\t\t\t\t\t\t '<div class=\"slotslide\" data-x=\"'+x+'\" data-y=\"'+y+'\" '+\n\t\t\t\t\t\t\t\t \t\t\t'style=\"position:absolute;'+\n\t\t\t\t\t\t\t\t\t\t\t'top:'+(0)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'left:'+(0)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'width:'+basicsize+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'height:'+basicsize+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'overflow:hidden;\">'+\n\n\t\t\t\t\t\t\t\t '<div style=\"position:absolute;'+\n\t\t\t\t\t\t\t\t\t\t\t'top:'+(0-y)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'left:'+(0-x)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'width:'+w+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'height:'+h+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'background-color:'+bgcolor+';'+\n\t\t\t\t\t\t\t\t\t\t\t'background-image:url('+src+');'+\n\t\t\t\t\t\t\t\t\t\t\t\t\t'background-repeat:'+bgrepeat+';'+\n\t\t\t\t\t\t\t\t\t\t\t'background-size:'+bgfit+';background-position:'+bgposition+';\">'+\n\t\t\t\t\t\t\t\t '</div></div></div>');\n\t\t\t\t\t\ty=y+basicsize;\n\t\t\t\t\t}\n\t\t\t\t\tx=x+basicsize;\n\t\t\t\t}\n\t\t}", "function boxes() {\n\tthis.innerHTML = HUplayer;\n\tthis.removeEventListener('click', boxes);\n\tcheckWinner();\n\tendGameChecker();\n\tlet emptySlots = checkerForEmpty();\n\tif (emptySlots.length > 0 && !endGame) {\n\t\tlet oneEmptySlot = emptySlots[Math.floor(Math.random() * emptySlots.length)];\n\t\toneEmptySlot.innerHTML = AI;\n\t\toneEmptySlot.removeEventListener('click', boxes);\n\t\tcheckWinner();\n\t}\n}", "function drawBoxes(objects) {\n\n //clear the previous drawings\n drawCtx.clearRect(0, 0, drawCanvas.width, drawCanvas.height);\n\n //filter out objects that contain a class_name and then draw boxes and labels on each\n objects.forEach(face => {\n let scale = uploadScale();\n let _x = face.x / scale;\n let y = face.y / scale;\n let width = face.w / scale;\n let height = face.h / scale;\n //flip the x axis if local video is mirrored\n if (mirror) {\n x = drawCanvas.width - (_x + width)\n } else {\n x = _x\n }\n\n let rand_conf = face.confidence.toFixed(2);\n let title = \"\" + rand_conf + \"\";\n if (face.name != \"unknown\") {\n drawCtx.strokeStyle = \"magenta\";\n drawCtx.fillStyle = \"magenta\";\n title += ' - ' + face.name\n if (face.predict_proba > 0.0 ) {\n title += \"[\" + face.predict_proba.toFixed(2) + \"]\";\n }\n } else {\n drawCtx.strokeStyle = \"cyan\";\n drawCtx.fillStyle = \"cyan\";\n }\n drawCtx.fillText(title , x + 5, y - 5);\n drawCtx.strokeRect(x, y, width, height);\n\n if(isCaptureExample && examplesNum < maxExamples) {\n console.log(\"capure example: \", examplesNum)\n\n //Some styles for the drawcanvas\n exCtx.drawImage(imageCanvas,\n face.x, face.y, face.w, face.h,\n examplesNum * exampleSize, 0,\n exampleSize, exampleSize);\n\n examplesNum += 1;\n\n if(examplesNum == maxExamples) {\n stopCaptureExamples();\n }\n }\n\n });\n}", "function makeBox() {\n bokser.innerHTML = '';\n for (var i = 0; i < antallFarger; i++) {\n var rndFarge1 = Math.floor(Math.random() * 255);\n var rndFarge2 = Math.floor(Math.random() * 255);\n var rndFarge3 = Math.floor(Math.random() * 255);\n colorArr.push(`rgb(${rndFarge1},${rndFarge2},${rndFarge3})`);\n bokser.innerHTML += `<div id=\"boks-${i}\" style=\"\n width:100px; \n height:100px;\n float: left;\n background-color: rgb(${rndFarge1},${rndFarge2},${rndFarge3});\n \"></div>`;\n }\n}", "isBoxValid(index) {\n return (\n !this.boxes[index].classList.contains(\"wall\") &&\n !this.boxes[index].classList.contains(\"start\") &&\n !this.boxes[index].classList.contains(\"wall\")\n );\n }", "function addMoreRects() {\n for (let i = 0; i < AMOUNT; i++) {\n rects[i].float();\n rects[i].display();\n rects[i].collisionDetection();\n }\n}", "function pack() {\n var boxes = config.boardView.querySelectorAll(\".box\"),\n boxesPerRow = calculateBoxesPerRow(boxes.length),\n margin = parseInt(window.getComputedStyle(boxes[0]).marginTop.replace(\"px\", \"\")),\n boardWidth = boxesPerRow * (boxes[0].offsetWidth + 2 * margin);\n\n if (boxesPerRow === 1) {\n boxesPerRow = boxes.length;\n }\n\n config.boardView.style.width = boardWidth + \"px\";\n }", "function show() {\n\tvar pos= boxes[j].position;\n\tvar angle= boxes[j].angle;\n\t\n\tpush();\n\ttranslate(pos.x,pos.y);\n\trotate(angle);\n\tfill(0);\n\trectMode(CENTER);\n\trect(0, 0, boxWidth[j], boxHeight[j]);\n\tpop();\t\n}", "function addBoxes() {\n O('box-container').innerHTML += \"<div class='box'>More Boxes!!!!</div>\"\n}", "function gbDivs(x, y) {\n var className;\n var box = \"box\";\n var i;\n var ind;\n if(x >= y ) {\n for(ind=0; ind < y; ind++){\n for( i=0; i < x; i++){\n\n className = \"pos\" + (i+1) + \"-\" + (ind+1);\n // var newDiv = $('div').addClass( className )\n // .addClass(\"box\");\n // console.log(className);\n\n $(\".container\").append(\"<div class=\\'box \" + className + \"\\'\" + \"></div>\" );\n\n\n }\n\n }\n\n } else if ( y > x){\n className = 0;\n for( ind=0; ind < x; ind++) {\n for( i=0; i < y; i++){\n\n className = \"pos\" + (i+1) + \"-\" + (ind+1);\n\n $(\".container\").append(\"<div class=\\'box \" + className + \"\\'\" + \"></div>\" );\n }\n }\n }\n}", "generateBoxes(h,w) {\n\t\tvar bx = new Map();\n\t\tfor(var y = 0; y< h-1 ; y++)\n\t\t{\n\t\t\tfor(var x = 0 ; x< w-1; x++)\n\t\t\t{\n\t\t\t\tvar a =new Dot(x,y);\n\t\t\t\tvar box = new Box(a);\n\t\t\t\tbx.set(a.toString(), box);\n\t\t\t}\n\t\t}\n\t\treturn bx;\n\t}", "function dynamicAddBox() {\r\n\t\tif (objchoice.insertCount<6)\r\n\t\t{\r\n\t\t\tswitch (objchoice.insertCount)\r\n\t\t\t{\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\t$(\"main, main img\").css({\"width\": \"220px\", \"height\": \"220px\"});\r\n\t\t\t\t\tobjmain = new getAttribute(\"main\");\r\n\t\t\t\t\tobjmain = setmainPosition(objmain, objContainer);\r\n\t\t\t\t\tsetboxPosition(objchoice, objmain, 6);\r\n\t\t\t\t\tobjchoice.resultBox[objchoice.insertCount] = objchoice.backupBox[5];\r\n\t\t\t\t\tobjchoice.backupBox.splice(5, 1);\t\r\n\t\t\t\t\t$(\".functionBox\").show();\r\n\t\t\t\t\tobjchoice.memoryCount = 5;\r\n\t\t\t\t\tobjchoice.insertCount = 1;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tshowrandomBox(objchoice);\r\n\t\t\t}\t\r\n\t\t}\r\n\t\telse if (objchoice.insertCount<18)\r\n\t\t{\r\n\t\t\tswitch (objchoice.insertCount)\r\n\t\t\t{\r\n\t\t\t\tcase 6:\r\n\t\t\t\t\t$(\"main, main img\").css({\"width\": \"130px\", \"height\": \"130px\"});\r\n\t\t\t\t\t$(\".firstLayer\").css({\"width\": \"120px\", \"height\": \"120px\"});\r\n\t\t\t\t\t$(\".functionBox\").css({\"width\": \"100px\", \"height\": \"100px\"});\r\n\t\t\t\t\t$(\".functionButton\").css({\"width\": \"100px\", \"height\": \"50px\"});\r\n\t\t\t\t\tobjmain = new getAttribute(\"main\");\r\n\t\t\t\t\tobjmain = setmainPosition(objmain, objContainer);\r\n\t\t\t\t\tsetboxPosition(objchoice, objmain, 18);\r\n\t\t\t\t\tobjchoice.memoryCount = 11;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tshowrandomBox(objchoice);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (objchoice.insertCount<28)\r\n\t\t{\r\n\t\t\tswitch (objchoice.insertCount)\r\n\t\t\t{\r\n\t\t\t\tcase 18:\r\n\t\t\t\t\t$(\"main, main img\").css({\"width\": \"120px\", \"height\": \"120px\"});\r\n\t\t\t\t\t$(\".firstLayer\").css({\"width\": \"110px\", \"height\": \"110px\"});\r\n\t\t\t\t\t$(\".secondLayer\").css({\"width\": \"100px\", \"height\": \"100px\"});\r\n\t\t\t\t\t$(\".functionBox\").css({\"width\": \"80px\", \"height\": \"80px\"});\r\n\t\t\t\t\t$(\".functionButton\").css({\"width\": \"80px\", \"height\": \"40px\"});\r\n\t\t\t\t\tobjmain = new getAttribute(\"main\");\r\n\t\t\t\t\tobjmain = setmainPosition(objmain, objContainer);\r\n\t\t\t\t\tsetboxPosition(objchoice, objmain, objchoice.initialBox.length);\r\n\t\t\t\t\tobjchoice.memoryCount = 9;\r\n\t\t\t\tdefault: \r\n\t\t\t\t\tshowrandomBox(objchoice);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{ $(\".alertBox\").show(); }\r\n\t} // end function", "function Box() {\n this.x = 0;\n this.y = 0;\n this.w = 1; // default width and height?\n this.h = 1;\n this.fill = '#444444';\n this.sector = '0';\n this.pricenum = '0';\n this.state= 0;\n this.place= 0;\n this.line = 0;\n this.cell = 0;\n}", "function createBox(boxPos, numOfSquares) {\n let squares = '';\n\n for (let i = 0; i < numOfSquares; i++) {\n squares += createSquare(boxPos, i, 9);\n }\n\n return '<div class=\"box\"> \\n' + squares + '</div> \\n';\n}", "_addSnake(){\n for(let i =0; i<this._snake.length; i++){\n const elem = document.createElement(\"div\");\n elem.className=\"box\";\n elem.id = \"box-id\";\n elem.style.top=this._snake[i].row*this._boxSize+\"px\";\n elem.style.left=this._snake[i].col*this._boxSize+\"px\";\n this._screen.append(elem);\n this._snakeBodyElems.push(elem);\n }\n }", "function styleBoxes(selection, self) {\n selection\n .style('width', `${self.boxWidth}px`)\n .style('height', `${self.boxHeight}px`);\n // .style('margin', `${self.boxMargin / 2}px`)\n }", "function clickedBox() {\n\n\n for (var i = 0; i < boxesAmt; i++) {\n\n\n \n boxes[i].style.backgroundColor = backColor;\n \n\n }\n}", "build() {\r\n for (let y = this.y; y < height; y += height / 20) {\r\n for (let x = this.x; x < 400; x += 400 / 10) {\r\n let boxUsed = false;\r\n let col = 255;\r\n this.gameMap.push({\r\n x,\r\n y,\r\n boxUsed,\r\n col\r\n });\r\n // Visualize the grid\r\n rect(x, y, 40, 40);\r\n }\r\n }\r\n }", "function renderBoxes(array) {\n //creates box html\n boxContainer.innerHTML += array.map(num=>{\n let color = \"\";\n \n switch(num) {\n case 1:\n color = \"purple\";\n break;\n case 2:\n color = \"yellow\";\n break;\n case 3:\n color = \"blue\";\n break;\n case 4:\n color = \"pink\";\n break;\n case 5:\n color = \"lime\";\n break;\n case 6:\n color = \"orange\";\n break;\n default:\n color = \"pink\";\n }\n\n return `<div class=\"box-container__box ${color}\" id=\"${num}\"></div>`\n\n }).join(\"\\n\");\n\n //adds event listeners to each box and calls to detect user input\n document.querySelectorAll(\".box-container__box\").forEach(box => {\n box.addEventListener(\"click\", event => {\n const userNewInput = Number(event.target.id);\n if (array === easyArray){\n detectUserInput(userNewInput, \"easy\");\n } else {\n detectUserInput(userNewInput, \"hard\");\n }\n });\n });\n\n //adds classes to box container depending on mode\n if (array === easyArray) {\n boxContainer.classList.add(\"easy\");\n } else if (array === array || array === shuffled) {\n boxContainer.classList.add(\"hard\");\n }\n}", "drawBoxes() {\r\n let len = this._answer.length\r\n let div = document.createElement('div')\r\n\r\n for (var i = 0; i < len; i++) {\r\n let v = this._answer.charAt(i)\r\n let elem = document.createElement('span')\r\n div.appendChild(elem)\r\n\r\n if (v == '-') {\r\n this._container.appendChild(div)\r\n elem.className += 'hyphen'\r\n elem.innerText = '-'\r\n div = document.createElement('div')\r\n }\r\n if (v == ' ') {\r\n this._container.appendChild(div)\r\n elem.className += 'space'\r\n elem.innerText = ' '\r\n div = document.createElement('div')\r\n }\r\n if (v == \"'\") {\r\n this._container.appendChild(div)\r\n elem.className += 'apostrophe'\r\n elem.innerText = \"'\"\r\n div = document.createElement('div')\r\n }\r\n }\r\n this._container.appendChild(div)\r\n }", "function addBoxes(wrapper) {\n let container = document.getElementById(wrapper);\n container.innerHTML = \"\";\n let letter = wrapper.slice(wrapper.length -1);\n for (var box = 0; box < 12; box++) {\n // check for column, set text style \n switch(letter.toLowerCase()) {\n case \"a\":\n container.innerHTML = container.innerHTML + \"<div>\" + letter.toLowerCase() + \"0\" + box + \"</div>\";\n break;\n case \"b\":\n container.innerHTML = container.innerHTML + \"<div><b>\" + letter.toLowerCase() + \"0\" + box + \"</b></div>\";\n break;\n case \"c\":\n container.innerHTML = container.innerHTML + \"<div>\" + letter.toLowerCase() + \"0\" + box + \"</div>\";\n }\n }\n }", "render() {\n const renderBoxes = this.state.boxes.map((box) => (// Maps through \"boxes\"\n <Box\n key={box.id}\n id={box.id} // creates/returns box component for each box in the array\n color={box.color}\n handleBoxClick={this.handleBoxClick}\n />\n )\n );\n return (\n <main\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n flexDirection: \"column\",\n textAlign: \"center\",\n }}\n >\n <h1> React: State and Props </h1>{\" \"}\n <div className=\"App\"> {renderBoxes} </div>{\" \"}\n </main>\n );\n}", "function class_box(ctx) // the treasure chest that contains special items\r\n{\t\r\n\tthis.sidelength = 30;\r\n\tthis.context = ctx;\r\n\t\r\n\t//position\r\n\tthis.x = (borderwidth+this.sidelength) + Math.floor(Math.random()*(width-(borderwidth+(2*this.sidelength))+1));\r\n\tthis.y = -this.sidelength;\r\n\tthis.lastx = 0;\r\n\tthis.lasty = 0;\r\n\r\n\tthis.bActive = false;\r\n\tthis.bHit = false;\r\n\t\r\n\tthis.reset = function() {\r\n\t\tthis.lastx = this.x;\r\n\t\tthis.lasty = this.y;\r\n\t\tthis.x = (borderwidth+this.sidelength) + Math.floor(Math.random()*(width-(borderwidth+(2*this.sidelength))+1));\r\n\t\tthis.y = -this.sidelength;\r\n\t\tthis.bActive = false;\r\n\t\tsetTimeout(\"thebox.bActive = true\", 10000); // next box will spawn in 10 seconds\r\n\t};\r\n\t\t\r\n\tthis.draw = function() {\r\n\t\tif(this.bHit) this.context.drawImage(img[8], this.lastx-15, this.lasty-8, 60, 40);\r\n\t\telse if(this.bActive) this.context.drawImage(img[7], this.x, this.y, this.sidelength, this.sidelength);\r\n\t};\r\n\t\r\n\tthis.update = function() {\r\n\t\t\r\n\t\tif(!this.bActive) return;\r\n\t\t\r\n\t\tthis.y++;\r\n\t\tthis.x += Math.sin(this.y * (Math.PI/180)) / 4;\r\n\t\t\r\n\t\tif(this.y > 400) this.reset();\r\n\t};\r\n\t\t\r\n\tthis.gotHit = function() {\r\n\t\tthis.bActive = false;\r\n\t\tthis.bHit = true;\r\n\t\tthis.reset();\r\n\t\tsetTimeout(\"thebox.bHit = false\", 1000); // 1 second hit animation\r\n\t\tsetTimeout(\"thebox.bActive = true\", 10000); // in 10 seconds the next box will spawn\r\n\t};\r\n}", "render() {\n const boxComponents = this.state.boxes.map((color, i) => (\n <Box key={i} color={color}/>\n ));\n\n return (\n <section className=\"BoxesContainer\">\n {boxComponents}\n\n <p>\n <button onClick={this.handleClick}>Change a Box</button>\n </p>\n </section>\n );\n }", "constructor(h,w) {\n\t\t\n\t\tthis.boxes = this.generateBoxes(h,w);\n\t\tthis.box_count = 0;\n\t}", "function Box(id, name, color, x, y) {\n\tthis.id = id;\n\tthis.name = name;\n\tthis.color = color;\n\tthis.x = x;\n\tthis.y = y;\n }", "function find_box(blue_piece_object)\n{\n $(\"#in_function\").html(\"find_box\");\n var return_val=null;\n var extra_space=4;\n\n //iterate through all the div boxes\n $(\"div.box\").each(function(index,value)\n {\n //variables\n var boxL=value.offsetLeft;\n var boxT=value.offsetTop;//-$(\"#checkers\").offset().top;\n var boxWidth=value.offsetWidth;\n var pieceL=blue_piece_object.left;\n var pieceT=blue_piece_object.top;\n\n //compare if the left and top positions of the blue-pieve are within one of the boxes\n if(pieceL>(boxL-extra_space) && (pieceL+blue_piece_object.width)<=(boxL+boxWidth+extra_space))\n {\n if((boxT-extra_space)<pieceT && (boxT+boxWidth+extra_space)>=(pieceT+blue_piece_object.width))\n {\n //alert(value.id+\": Collision\");\n\n return_val=value.id;\n $(\"#on_box\").html(\"Box: \"+return_val);\n }\n }\n });\n\n //if(return_val==null)\n // alert(\"Move to your correct spot!\");\n\n return return_val;\n}", "function init(){\r\n\r\n\tvar identifier =0;\r\n\r\n\tvar box1=document.getElementById('box1');\r\n\tvar box2=document.getElementById('box2');\r\n\tvar box3=document.getElementById('box3');\r\n\tvar box4=document.getElementById('box4');\r\n\tvar box5=document.getElementById('box5');\r\n\tvar box6=document.getElementById('box6');\r\n\tvar box7=document.getElementById('box7');\r\n\tvar box8=document.getElementById('box8');\r\n\tvar box9=document.getElementById('box9');\r\n\r\n\tfor(var i=0;i<N_SIZE;i++){\r\n\r\n\t\tfor(var j=0;j<N_SIZE;j++){\r\n\r\n\t\t\tvar cell;\r\n\r\n\t\t\tif(i==0 & j==0){ cell = box1;}\r\n\t\t\telse if(i==0 & j==1){ cell = box2;}\r\n\t\t\telse if(i==0 & j==2){ cell = box3;}\r\n\t\t\telse if(i==1 & j==0){ cell = box4;}\r\n\t\t\telse if(i==1 & j==1){ cell = box5;}\r\n\t\t\telse if(i==1 & j==2){ cell = box6;}\r\n\t\t\telse if(i==2 & j==0){ cell = box7;}\r\n\t\t\telse if(i==2 & j==1){ cell = box8;}\r\n\t\t\telse if(i==2 & j==2){ cell = box9;}\r\n\r\n\r\n\r\n\t\t\tcell.identifier=identifier;//know \r\n\t\t\tboxes.push(cell);\r\n\t\t\tidentifier+=+1;\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n\tstartNewGame();\r\n\r\n}", "function mouseClicked() {\n arrOfTorus.pop();\n let aColoredBox = new cluelessBox(20);\n arrOfBoxes.push(aColoredBox);\n}", "function moveBoxes() {\n //Move boxes to the right as long as they haven't reached their next position\n if (posOffset1.x < offsetX2) {\n posOffset0.set(posOffset0.x+speed, posOffset0.y);\n posOffset1.set(posOffset1.x+speed, posOffset1.y);\n posOffset2.set(posOffset2.x+speed, posOffset2.y);\n if (steps<2) {\n welcomeOffset.set(welcomeOffset.x+speed, welcomeOffset.y);\n }\n //If boxes reach next position, update position data and order\n } else {\n //Re-order paper images\n for (let i=0; i<order.length; i++) {\n order[i]--;\n if (order[i] < 0) {\n order[i] = 2;\n }\n }\n posOffset0.set(offsetX0, offsetY0);\n posOffset1.set(offsetX1, offsetY1);\n posOffset2.set(offsetX2, offsetY2);\n\n //Count number of sounds that have been played so far\n steps++;\n //Only update the welcome text position until it is moved to the right out of sight\n if (steps<3) {\n welcomeOffset.set(welcomeOffsetX + steps*(offsetX2-offsetX1), welcomeOffsetY);\n }\n\n //Update artist,drawing data and sound number\n lastPt = pt;\n lastPaths = paths;\n pt = nextPt;\n paths = []; \n lastSoundNumber = soundNumber;\n soundNumber = nextSoundNumber; //Get the number of the sound that has been selected\n\n nextSound = false; //nexSound flag set to false until next sound is selected\n newSound();\n }\n}", "function Box (tag) {\n var p2 = Point.set().pop();\n var p1 = Point.set().pop();\n \n if (tag && p1 && p2) {\n // Origin is the top-left corner of the box\n this.origin = new Point(Point.leftmost(p1, p2).x, Point.topmost(p1, p2).y);\n this.box_width = Point.rightmost(p1, p2).x - this.origin.x;\n this.box_height = Point.bottommost(p1, p2).y - this.origin.y;\n this.backing_element = new Element(tag, {\n 'left': this.origin.x,\n 'top': this.origin.y \n }, null, '#stage'\n );\n \n $(this.backing_element).width(this.box_width);\n $(this.backing_element).height(this.box_height); \n \n Box.active(this);\n Box.set().push(this); \n \n // The global set of keybindings is defined here\n Box.keys({\n // 'D'elete\n 100: function (e) {\n if (Box.active() && confirm('Delete the active box?')) {\n Box.active().destroy(); \n }\n }\n });\n } \n}", "function addBoxes() {\n var $boxColumn = $(\"<div class='boxColumn'></div>\");\n var $rbb = $(\"#removeBoxesButton\");\n for (var i = 0; i < 5; i++) {\n $boxColumn.append(\"<div class='box'></div>\");\n }\n $(\"#boxContainer\").append($boxColumn);\n if ( $rbb.attr(\"disabled\") === \"disabled\" ) {\n $rbb.attr(\"disabled\", false);\n }\n}", "function stackBoxes(n) {\n return n * n;\n }", "function adjustBoxes(boxes) {\n\t if (/^td$/i.test(element.tagName)) {\n\t var table = nodeInfo.table;\n\t if (table && getPropertyValue(table.style, \"border-collapse\") == \"collapse\") {\n\t var tableBorderLeft = getBorder(table.style, \"left\").width;\n\t var tableBorderTop = getBorder(table.style, \"top\").width;\n\t // check if we need to adjust\n\t if (tableBorderLeft === 0 && tableBorderTop === 0) {\n\t return boxes; // nope\n\t }\n\t var tableBox = table.element.getBoundingClientRect();\n\t var firstCell = table.element.rows[0].cells[0];\n\t var firstCellBox = firstCell.getBoundingClientRect();\n\t if (firstCellBox.top == tableBox.top || firstCellBox.left == tableBox.left) {\n\t return slice$1$1(boxes).map(function(box){\n\t return {\n\t left : box.left + tableBorderLeft,\n\t top : box.top + tableBorderTop,\n\t right : box.right + tableBorderLeft,\n\t bottom : box.bottom + tableBorderTop,\n\t height : box.height,\n\t width : box.width\n\t };\n\t });\n\t }\n\t }\n\t }\n\t return boxes;\n\t }", "function addBox() {\n // Create '.box' element\n const newDiv = document.createElement('div');\n newDiv.className = 'box';\n // Add '.box' element to 'body'\n $body.appendChild(newDiv);\n $boxes = document.querySelectorAll('.box');\n}", "function in_box(x, y, box) {\n return (\n x >= box.x - trial.box_linewidth &&\n x <= box.x + box.w + trial.box_linewidth * 2 &&\n y >= box.y - trial.box_linewidth &&\n y <= box.y + box.h + trial.box_linewidth * 2\n );\n }", "function printBox(i) {\n $(\"<div/>\", {\n id: \"box_\" + i,\n class: \"Box\"\n }).appendTo(\"#contenido\");\n}", "function makeEditBoxes(d){\r\n editingPic = d[5]\r\n editingPoly = -1;\r\n update();\r\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 }", "function mkBox(pts = [], dis = 20){\n\tlet boxes = [];\n\tif (pts && pts.length && pts.length >= 2){\n\t\tconst lls = pts.map((pt)=>new LatLng(pt[0],pt[1]));\n\t\tconst bounds = RouteBoxer.box(lls, dis);\n\t\tboxes = bounds.map((box)=>{\n\t\t //console.log(box)\n\t\t const {_southWest,_northEast} = box;\n\t\t return [[_southWest.lat,_southWest.lng],[_northEast.lat,_northEast.lng]]\n\t\t});\n\t}\n\treturn boxes\n}", "function makeBox (width, height) {\n var i\n var solid = repeatChar (width,\"*\")\n var top = \"\"\n var bottom = \"\"\n var middle = \"\"\n \n if (height>0){top = solid}\n if (height>1){bottom = \"\\n\" + solid}\n\n for (i=1; i<height-1; i++){\n middle = middle + \"\\n\" + \"*\" + repeatChar(width-2,\" \") + \"*\"\n }\n return top + middle + bottom\n}", "function DrawBox(SArray, n) {\n\tvar p1x;\n\tvar p1y;\n\tvar p2x;\n\tvar p2y;\n\tvar p3x;\n\tvar p3y;\n\tvar p4x;\n\tvar p4y;\n\tvar S = SArray[0].plasmidsize;\n\tvar fillred = Math.round(SArray[n].red / 100 * 255);\n\tvar fillgreen = Math.round(SArray[n].green / 100 * 255);\n\tvar fillblue = Math.round(SArray[n].blue / 100 * 255);\n\tvar stred = Math.round(SArray[0].fstrokered / 100 * 255);\n\tvar stgreen = Math.round(SArray[0].fstrokegreen / 100 * 255);\n\tvar stblue = Math.round(SArray[0].fstrokeblue / 100 * 255);\n\tvar Cx = SArray[0].ox;\n\tvar Cy = SArray[0].oy;\n\n\t//Direction: sense=0, antisense=1\n\tvar sense = 0;\n\tif (SArray[n].end < SArray[n].start) sense = 1;\n\t//sweep: <=half: 0, >half: 1\n\tvar sweep = 0;\n\tif (Math.abs(SArray[n].end - SArray[n].start) / S > 0.5) sweep = 1;\n\n\tvar Cmd = [];\n\tCmd[1] = newSVG(\"path\");\n\tp1x = Cx + SArray[0].ro * Math.sin(SArray[n].start / S * Math.PI * 2);\n\tp1y = Cy - SArray[0].ro * Math.cos(SArray[n].start / S * Math.PI * 2);\n\tp2x = Cx + SArray[0].ro * Math.sin(SArray[n].end / S * 2 * Math.PI);\n\tp2y = Cy - SArray[0].ro * Math.cos(SArray[n].end / S * 2 * Math.PI);\n\tp3x = Cx + SArray[0].ri * Math.sin(SArray[n].end / S * 2 * Math.PI);\n\tp3y = Cy - SArray[0].ri * Math.cos(SArray[n].end / S * 2 * Math.PI);\n\tp4x = Cx + SArray[0].ri * Math.sin(SArray[n].start / S * 2 * Math.PI);\n\tp4y = Cy - SArray[0].ri * Math.cos(SArray[n].start / S * 2 * Math.PI);\n\tvar Para = \"\";\n\tPara += 'M' + p1x + \",\" + p1y + \" A\" + SArray[0].ro + \",\" + SArray[0].ro + \" 0 \";\n\tCmd[0] += '<path d=\"M' + p1x + \",\" + p1y + \" A\" + SArray[0].ro + \",\" + SArray[0].ro + \" 0 \";\n\tif (sweep) {\n\t\tCmd[0] += \"1,\";\n\t\tPara += \"1,\";\n\t} else {\n\t\tCmd[0] += \"0,\";\n\t\tPara += \"0,\";\n\t};\n\tif (sense) {\n\t\tCmd[0] += \"0 \";\n\t\tPara += \"0 \";\n\t} else {\n\t\tCmd[0] += \"1 \";\n\t\tPara += \"1 \";\n\t};\n\tCmd[0] += p2x + \",\" + p2y;\n\tPara += p2x + \",\" + p2y;\n\tCmd[0] += \" L\" + p3x + \",\" + p3y;\n\tPara += \" L\" + p3x + \",\" + p3y;\n\tCmd[0] += \" A\" + SArray[0].ri + \",\" + SArray[0].ri + \" 0 \";\n\tPara += \" A\" + SArray[0].ri + \",\" + SArray[0].ri + \" 0 \";\n\tif (sweep) {\n\t\tCmd[0] += \"1,\";\n\t\tPara += \"1,\";\n\t} else {\n\t\tCmd[0] += \"0,\";\n\t\tPara += \"0,\";\n\t};\n\tif (sense) {\n\t\tCmd[0] += \"1 \";\n\t\tPara += \"1 \";\n\t} else {\n\t\tCmd[0] += \"0 \";\n\t\tPara += \"0 \";\n\t};\n\tCmd[0] += p4x + \",\" + p4y;\n\tPara += p4x + \",\" + p4y + \" z\";\n\tCmd[1].setAttribute(\"d\", Para);\n\tCmd[0] += ' z\" ' + 'fill=\"rgb(' + fillred + \",\" + fillgreen + \",\" + fillblue + ')\"' + ' stroke-width=\"' + SArray[0].fstrokewidth + '\" stroke=\"rgb(' + stred + \",\" + stgreen + \",\" + stblue + ')\"/> \\n';\n\tPara = \"rgb(\" + fillred + \",\" + fillgreen + \",\" + fillblue + \")\";\n\tCmd[1].setAttribute(\"fill\", Para);\n\tCmd[1].setAttribute(\"stroke-width\", SArray[0].fstrokewidth);\n\tPara = \"rgb(\" + stred + \",\" + stgreen + \",\" + stblue + \")\";\n\tCmd[1].setAttribute(\"stroke\", Para);\n\treturn (Cmd);\n}", "function dialogueBoxes(boxObj, string, leftOffset, topOffset, size, ctx, textColor) { \n button.render(boxObj)\n wrapText(\n ctx,\n string.toString(),\n boxObj.left + leftOffset,\n boxObj.top + topOffset,\n boxObj.right - boxObj.left - 30,\n 50,\n size,\n textColor\n );\n}", "function rc(){\n \n var boxes=document.getElementsByClassName('box');\n var tar=document.querySelectorAll('.it');\n \n let grid=[[tar[0],tar[1],tar[2],tar[3],tar[4]],\n [tar[5],tar[6],tar[7],tar[8],tar[9]],\n [tar[10],tar[11],tar[12],tar[13],tar[14]],\n [tar[15],tar[16],tar[17],tar[18],tar[19]],\n [tar[20],tar[21],tar[22],tar[23],tar[24]]\n ]\n\n for(let i=0;i<5;++i){\n for(let j=0;j<5;++j){\n if(grid[i][j]===ob1){\n x= [i , j ];}\n } \n } \n \n //var chk=document.querySelector('#empty');\n var chk=ob2;\n for(let i=0;i<5;++i){\n for(let j=0;j<5;++j){\n if(grid[i][j]===chk){\n y= [i , j ];} \n }\n }\n }", "function showAllBoxes() {\n\t$.each($images,function(index,value){\n\t\tvar url = \"Photos/Thumbnails/\" + this.name;\n\t\tvar $new_image = $(\"<div class='thumbnail'><img class='small-img \" + this.title + \"' src=\" + url + \"></div>\");\n\t\t$container.append($new_image);\n\t});\n\t$(\".small-img\").on(\"click\",clickOnThumbnail);\n}", "function Scoreboard(){\n this.sheet = document.getElementById(\"sheet\"); //get the sheet element, is the sheet just a white background. \n this.list = [];\n \n // Spawns the boxes\n this.setup = function(){\n \n // Create 10 boxes\n\n for(var i=0; i<9; i++){\n var box = this.createBox(); // Create an individual box\n this.list.push(box); // Add each box to the list\n this.sheet.appendChild(box); // Add each box to the sheet\n }\n\n var lastbox = this.CreateThirdBox(); // Create an individual box\n this.list.push(lastbox); // Add each box to the list\n this.sheet.appendChild(lastbox); // Add each box to the sheet\n /*\n <div id=\"screen>\n <div class=\"box\">\n <div class=\"indent\"></div>\n <div class=\"corner\"></div>\n <div class=\"bottom\"></div>\n </div>\n </div>\n */\n // We're basically doing this with javascript^\n };\n\n this.createBox = function(){\n var c = function(className){\n var element = document.createElement(\"div\"); //create a function so it is easier to create elements, not having to repeat code\n element.className = className; //asigns a new class,\n return element;\n };\n \n var box = c(\"box\"); //creates a new box\n var indent = c(\"indent\"); //references a div tag in the html\n var corner = c(\"corner\");\n var bottom = c(\"bottom\");\n \n // Add the elements to the box.\n box.appendChild(indent);\n box.appendChild(corner);\n box.appendChild(bottom);\n \n box.setIndent = function(str){ //maniipulates the text in the elements.\n indent.textContent = str;\n };\n box.setCorner = function(str){\n corner.textContent = str;\n };\n box.setBottom = function(str){\n bottom.textContent = str;\n };\n \n return box;\n };\n \n this.CreateThirdBox = function(){ //this is the last box in bowling, which pretty much changes a lot of the rules of the game..\n var e = function(className){\n var newElement = document.createElement(\"div\");\n newElement.className = className;\n return newElement;\n };\n\n var box = e(\"box-tenth\"); //creates a new box, you can make another box variable because it is in a different scope.\n \n var corner1 = e(\"corner-tenth\"); //creates it\n var corner2 = e(\"corner-tenth\"); //creates it\n var corner3 = e(\"corner-tenth\");\n \n var bottom = e(\"bottom\");\n\n\tbox.appendChild(corner1); //add it\n box.appendChild(corner2);\n box.appendChild(corner3);\n box.appendChild(bottom);\n\n box.setCorner1 = function(str){\n corner1.textContent = str;\n };\n box.setCorner2 = function(str){\n corner2.textContent = str;\n };\n box.setCorner3 = function(str){\n corner3.textContent = str;\n };\n box.setBottom = function(str){\n bottom.textContent = str;\n };\n \n return box;\n\n }\n\n\n}", "boxes() {\n return Game.find({}, { sort: { index: 1 } });\n }", "function clearBoxes() {\n progressMessage.setProgressMessage(\"clear bounding boxes\");\n if (boxpolys != null) {\n for (var i = 0; i < boxpolys.length; i++) {\n boxpolys[i].setMap(null);\n }\n }\n boxpolys = null;\n}", "renderAllShapes( ) {\n for( var i = 0; i < 6; i++ ){ \n for(var k = 0; k < 3; k++ ) {\n this.renderShape( Piece.getRandom(), k*5, i*5 );\n }\n }\n }", "function moveBox(k){\n var id = k;\n //console.log(\"Inside move box!!: \"+id);\n //gameOver condition has to be fixed as \n //its not accurate condition for game over\n if( (players[id].bottomMostX == 1 || players[id].bottomMostX == 0) && checkOccupiedBlock(id) == true){\n gameOver(id);\n }\n else if(players[id].bottomMostX == gridHeight-1 || (checkOccupiedBlock(id)) == true){\n selectNextPiece(id);\n \n //for storing the shape data\n if(players[id].replayMode == false){\n //console.log(\"inside move box players[id].replayMode == false\");\n setTheAllShapesUsedInGame(id,players[id].shapeType,players[id].anyColor);\n }\n eraseNextShape(id);\n randomBlockGenerator(id);\n \n //for storing the next shape data\n if(players[id].replayMode == false){\n //console.log(\"inside move box players[id].replayMode == false\");\n setTheAllNextShapesUsedInGame(id,players[id].nextPiece,players[id].nextColor);\n }\n checkRowCompletion(id);\n moveShapeToInitialPos(id);\n moveNextShapeToInitialPos(id);\n colorNextShape(id);\n }\n \n else if((checkOccupiedBlock(id)) == false){\n makeBlockUnoccupied(id);\n eraseShape(id);\n moveShapeDown(id);\n makeBlockOccupied(id);\n colorTheShape(id);\n }\n }", "function box (side) {\n for (var i = 0; i<4; i++) {\n forward( side)\n right( 90)\n }\n forward( side)\n right( 90)\n forward( side)\n}", "function populatePage() {\n var boxes = document.createDocumentFragment();\n\n for (var i=0; i < appdata.app_id.length; i++){\n var boxdiv = document.createElement('div');\n boxdiv.draggable = 'true';\n boxdiv.className = 'box';\n boxdiv.innerHTML = \"<a href=\\'\"+appdata.link[i]+\"\\'>\"+appdata.name[i]+\" (\" + appdata.description[i] + \")</a>\";\n boxdiv.style = 'background-color:'+appdata.color[i];\n boxes.appendChild(boxdiv);\n }\n var cont = document.getElementById('boxcontainer');\n cont.appendChild(boxes);\n }" ]
[ "0.7293549", "0.7145911", "0.7104569", "0.70254874", "0.6969243", "0.6845548", "0.67716", "0.67625123", "0.6760329", "0.6727716", "0.6718983", "0.67084146", "0.6697506", "0.66629213", "0.662379", "0.6620975", "0.6605176", "0.65965575", "0.658183", "0.65773433", "0.6566983", "0.6562272", "0.6541304", "0.65329874", "0.6527171", "0.6480818", "0.64638716", "0.6462122", "0.64597166", "0.6455023", "0.6452529", "0.64453787", "0.64393824", "0.64294565", "0.64278156", "0.64084554", "0.64057183", "0.64022", "0.6383632", "0.63796574", "0.63503283", "0.6339733", "0.63391566", "0.6331836", "0.6327863", "0.63156414", "0.6299102", "0.6291445", "0.62894803", "0.6278868", "0.62617016", "0.62559605", "0.6253919", "0.6227049", "0.62215936", "0.62096125", "0.6199641", "0.6197575", "0.6196216", "0.61827433", "0.6177011", "0.61617917", "0.61572754", "0.61366343", "0.6100884", "0.6093354", "0.60893816", "0.60866284", "0.60755646", "0.60301954", "0.6022583", "0.602026", "0.6018724", "0.6015012", "0.60118204", "0.60091496", "0.60044557", "0.5992939", "0.5982423", "0.5980458", "0.5974234", "0.5972926", "0.5971218", "0.5964202", "0.59628695", "0.59598637", "0.59528464", "0.5949672", "0.5948173", "0.59477025", "0.5934761", "0.5928602", "0.5923125", "0.5921775", "0.5917028", "0.5912084", "0.59075737", "0.59075147", "0.59065944", "0.59048367", "0.5902217" ]
0.0
-1
this needs a bunch of boxes
constructor(props) { super(props); this.marketList = ['DJIA', 'S&P', 'NASDAQ', 'RUSSELL', 'PHX G/S']; this.url = 'https://financialmodelingprep.com/api/v3/majors-indexes'; //this.oneArray = [ ] $.ajax({ url: this.url, success: data => { console.log("Setting initial values for the market."); let x = data['majorIndexesList']; this.state = { valDict: { 'DJIA': x[0]['price'], 'S&P': x[1]['price'], 'NASDAQ': x[2]['price'], 'RUSSELL': x[4]['price'], 'PHX G/S': x[14]['price'] } }; this.oneArray = []; this.marketList.forEach(name => { this.oneArray.push(React.createElement(IndexBox, { indexName: name, indexPrice: this.state.valDict[name] })); }); }, async: false }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mkBoxes() {\n boxes.forEach(function(val){\n ctx.drawImage(boxImg, val[0] * boxSize, val[1] * boxSize, boxSize, boxSize);\n })\n}", "function boxes() {\n rectMode(CORNER);\n\n //array of different colored boxes\n for (var i = 0; i <= width - 20; i += 20) {\n for (var j = 0; j <= height - 20; j += 20) {\n stroke(0);\n fill(i * 0.50, j * 0.50, 180, 90);\n rect(i, j, 20, 20);\n }\n }\n\n noStroke();\n fill(textColor2);\n text(\"Move the mouse to make the white box move.\", 50, 50);\n\n}", "function BoxesManager() {\n\t\t \tvar iBoxsNum = name.length; \n\t\t\t//Creates the imgs\n\t\t\tfor (var i=0; i<iBoxsNum; i++) {\n\t\t\t\t//Create new img instance\n\t\t\t\tvar box = new Box(i);\t\n\t\t\t}\n\t\t\tvar div = document.createElement('div');\n\t\t\tdiv.className = \"clear\";\n\t\t\tvar main = document.getElementsByTagName(\"main\")[0];\n\t\t\tmain.appendChild(div);\n\n\t\t}", "function makeBoxes(){\n var divWidth = 0;\n var Xval = 0;\n var Yval = 0;\n for (var i = 0; i < colLength; i++) {\n var currentVal = boxArray[i][0];\n divWidth = 0;\n Yval += boxHeight;\n for (var j = 0; j <= rowLength - 1; j++) {\n divWidth += boxWidth;\n Xval += boxWidth;\n if (boxArray[i][j + 1] !== currentVal) {\n makeDiv({\n width: divWidth,\n divXlocation: Xval,\n divYlocation: Yval\n });\n currentVal = boxArray[i][j + 1];\n divWidth = 0;\n }\n }\n }\n return null;\n }", "function setupBoxes() {\n\tgirl.setupBoxes([[false,[3,2],0],[false,[6,2],0],[false,[3,9],0],[false,[1,12],0]]);\n\tguy.setupBoxes([[false,[16,2],0],[false,[10,2],0],[false,[11,11],0],[false,[17,8],0]]);\n}", "function drawBoxes(boxesArray)\t{\n\tvar scene = document.getElementById('scene');\n\tfor (i=0; i < boxesArray.length; i++)\t{\n\t\tvar myDiv = document.createElement('div');\n\t\tmyDiv.setAttribute('id',boxesArray[i].id);\n\t\tmyDiv.style.backgroundColor = boxesArray[i].color;\n\t\tmyDiv.setAttribute('class','box');\n\t\tmyDiv.style.left = boxesArray[i].x +'px';\n\t\tmyDiv.style.top = boxesArray[i].y + 'px';\n\t\tmyDiv.innerHTML = boxesArray[i].name;\n\t\tmyDiv.onclick = displayBoxContents;\n\t\tscene.appendChild(myDiv);\n\t}\n\t\n}", "function drawBoxes(boxes) {\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n };\n }", "function createBox()\n\t{\n\t\tbox = that.add('rect', {\n\t\t\tcolor: style.boxColor,\n\t\t\tborderWidth: style.borderWidth,\n\t\t\tborderColor: style.borderColor,\n\t\t\tdepth: that.depth\n\t\t}, fw.dockTo(that));\n\t}", "function selectTheBoxs(){\r\n\t\tif($(mark).width() == 0 || $(mark).height() == 0) return;\r\n\t\tfor(var i=0,j=oVar.iListNum;i<j;i++){\r\n\t\t\tvar oThisList = oVar.oLists.eq(i),\r\n\t\t\t\tiListL = oThisList.offset().left,\r\n\t\t\t\tiListT = oThisList.offset().top,\r\n\t\t\t\tiListR = iListL + oVar.iBoxW,\r\n\t\t\t\tiListB = iListT + oVar.iBoxH,\r\n\t\t\t\tselBoxL = $(mark).offset().left,\r\n\t\t\t\tselBoxT = $(mark).offset().top,\r\n\t\t\t\tselBoxR = $(mark).width() + selBoxL,\r\n\t\t\t\tselBoxB = $(mark).height() + selBoxT;\r\n\t\t\tif(selBoxL == 0 && selBoxT ==0) return;\r\n\t\t\tif(iListR > selBoxL && iListB > selBoxT && iListL < selBoxR && iListT < selBoxB){\r\n\t\t\t\tif(!oThisList.hasClass('broken') && $('.desc', oThisList).attr('category') != 'system'){\r\n\t\t\t\t\toThisList.addClass('focus');\r\n\t\t\t\t\t$('input[type=\"checkbox\"]', oThisList).attr('checked',true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$('input[type=\"checkbox\"]', oThisList).hide();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\toThisList.removeClass('focus');\r\n\t\t\t\t$('input[type=\"checkbox\"]', oThisList).attr('checked',false);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function drawBoxes(boxes) {\n progressMessage.setProgressMessage(\"draw bounding boxes\");\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }\n}", "function addBox(coin) {\nvar options = {\n width : \"18%\",\n height : \"25%\",\n content: \"Coin Pool Net Ratio\",\n tags: true,\n border: {\n type: 'line'\n },\n style: {\n fg: 'white',\n border: {\n fg: '#f0f0f0'\n },\n hover: {\n bg: 'green'\n }\n }\n}\nif (r == 1) {\n options.right = r\n} else {\n options.left = l\n}\noptions.label = \"{bold}\"+coin+\"{/bold}\";\nif (b == 1) {\n options.bottom = b;\n} else {\n options.top= t;\n}\nconsole.log(coin + t + b + l + r );\nbox[coin] = blessed.box( options);\n\n\n\nscreen.append(box[coin]);\n \n P++;\n l = P*20 + \"%\";\n \n if (P == '5' ) {\n r = '';\n rcount++;\n t = rcount * 25 + \"%\";\n l = '0%';\n P = 0;\n } \n \n \n\n}", "function drawBoxes(boxes) {\n boxpolys = new google.maps.Rectangle({\n bounds: boxes,\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }", "function resizeBoxDraw(){\n state.boxArr.forEach(function(el){\n ctx.fillStyle = el.resizeStyle;\n ctx.fillRect(el.resize.top.x, el.resize.top.y, el.resize.top.w, el.resize.top.h)\n // ctx.fillRect(el.resize.bottom.x, el.resize.bottom.y, el.resize.bottom.w, el.resize.bottom.h)\n // ctx.fillRect(el.resize.left.x, el.resize.left.y, el.resize.left.w, el.resize.left.h)\n ctx.fillRect(el.resize.right.x, el.resize.right.y, el.resize.right.w, el.resize.right.h) \n })\n \n }", "function drawBoxes(boxes) {\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }\n}", "function drawBoxes() {\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }\n}", "function makeBox() {\n\n}", "function drawBoxes(boxes) {\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 3,\n map: map\n });\n }\n}", "addBox(){\n\t\tvar x=Math.floor((Math.random()*this.width)); \n\t\tvar y=Math.floor((Math.random()*this.height)); \n\t\tif(this.getSquare(x,y)===null){\n\t\t\tvar velocity = new Pair(0,0);\n\t\t\tvar length = 50;\n\t\t\tvar health = 50;\n\t\t\tvar colour= 'rgba(223, 252, 3, 0.6)';\n\t\t\tvar position = new Pair(x,y);\n\t\t\t// check if the boxes would exceed the world\n\t\t\tif (position.x - length < 0){\n\t\t\t\tlength = position.x // boxes start from the left bound\n\t\t\t} \n\t\t\tif (position.x + length > this.width){\n\t\t\t\tlength = this.width - position.x // boxes end at the right bound\n\t\t\t} \n\t\t\tif (position.y - length < 0){\n\t\t\t\tlength = position.y // boxes start from the upper bound\n\t\t\t} \n\t\t\tif (position.y + length > this.height){\n\t\t\t\tlength = this.height - position.y // boxes end at the lower bound\n\t\t\t}\n\t\t\t// check if the boxes disappear after the above adjustments \n\t\t\tif (length != 0){\n\t\t\t\t// create the boxes and add to the list\n\t\t\t\t// the health of the boxes would be 50\n\t\t\t\tvar box = new Box(this, position, velocity, colour, length, health);\n\t\t\t\tthis.addSquare(box);\n\t\t\t\tthis.boxes_number += 1; // update the enemies number for stats\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "function boxes(n, content, cls) {\n if (!content) { content = ''; }\n\n var div = elem('div').addClass('boxes');\n for (var i = 1; i <= n; i++) {\n div.append(box(content, cls));\n }\n\n return div;\n}", "function BoxRenderer() {}", "drawBoxes () {\n let c = document.getElementById(\"canvas\").getContext(\"2d\");\n c.fillStyle = \"black\";\n for(let i = 1; i < this.state.m; i++) {\n c.fillRect(i * 20, 0, 1, this.state.n * this.state.cellSize);\n }\n for(let i = 1; i < this.state.n; i++) {\n c.fillRect(0, i * 20, this.state.m * this.state.cellSize, 1);\n }\n }", "function createBoxes(formArray,myCounter)\t{\n// assign the 0,1,2 array elements to their corresponding variables here\n\tvar boxName = formArray[0];\n\tvar boxColor = formArray[1];\n\tvar numBoxes = formArray[2];\n// create the box object\n\tfor (i=0; i < numBoxes; i++)\t{\n\t\tvar boxId = myCounter+100;\t\n\t\tvar sceneDiv = document.getElementById(\"scene\");\n\t\tvar x = Math.floor(Math.random() * (sceneDiv.offsetWidth-101));\n\t\tvar y = Math.floor(Math.random() * (sceneDiv.offsetHeight-101));\n\t\tvar myBox = new Box(boxId,boxName,boxColor,x,y);\n\t\tmyCounter +=1;\n\t\tboxes.push(myBox);\n\t\t}\n\t}", "function addBoxes () {\n // Create some cubes around the origin point\n for (var i = 0; i < BOX_QUANTITY; i++) {\n var angle = Math.PI * 2 * (i / BOX_QUANTITY);\n var geometry = new THREE.BoxGeometry(BOX_SIZE, BOX_SIZE, BOX_SIZE);\n var material = new THREE.MeshNormalMaterial();\n var cube = new THREE.Mesh(geometry, material);\n cube.position.set(Math.cos(angle) * BOX_DISTANCE, camera.position.y - 0.25, Math.sin(angle) * BOX_DISTANCE);\n scene.add(cube);\n }\n // Flip this switch so that we only perform this once\n boxesAdded = true;\n}", "function prepareOneSlideBox(slotholder, opt, visible) {\n\n var sh = slotholder;\n var img = sh.find('img')\n setSize(img, opt)\n var src = img.attr('src');\n var bgcolor = img.css('background-color');\n\n var w = img.data('neww');\n var h = img.data('newh');\n var fulloff = img.data(\"fxof\");\n if (fulloff == undefined)\n fulloff = 0;\n\n var fullyoff = img.data(\"fyof\");\n if (img.data('fullwidthcentering') != \"on\" || fullyoff == undefined)\n fullyoff = 0;\n\n\n\n var off = 0;\n\n\n\n\n // SET THE MINIMAL SIZE OF A BOX\n var basicsize = 0;\n if (opt.sloth > opt.slotw)\n basicsize = opt.sloth\n else\n basicsize = opt.slotw;\n\n\n if (!visible) {\n var off = 0 - basicsize;\n }\n\n opt.slotw = basicsize;\n opt.sloth = basicsize;\n var x = 0;\n var y = 0;\n\n\n\n for (var j = 0; j < opt.slots; j++) {\n\n y = 0;\n for (var i = 0; i < opt.slots; i++) {\n\n\n sh.append('<div class=\"slot\" ' +\n 'style=\"position:absolute;' +\n 'top:' + (fullyoff + y) + 'px;' +\n 'left:' + (fulloff + x) + 'px;' +\n 'width:' + basicsize + 'px;' +\n 'height:' + basicsize + 'px;' +\n 'overflow:hidden;\">' +\n '<div class=\"slotslide\" data-x=\"' + x + '\" data-y=\"' + y + '\" ' +\n 'style=\"position:absolute;' +\n 'top:' + (0) + 'px;' +\n 'left:' + (0) + 'px;' +\n 'width:' + basicsize + 'px;' +\n 'height:' + basicsize + 'px;' +\n 'overflow:hidden;\">' +\n '<img style=\"position:absolute;' +\n 'top:' + (0 - y) + 'px;' +\n 'left:' + (0 - x) + 'px;' +\n 'width:' + w + 'px;' +\n 'height:' + h + 'px' +\n 'background-color:' + bgcolor + ';\"' +\n 'src=\"' + src + '\"></div></div>');\n y = y + basicsize;\n }\n x = x + basicsize;\n }\n }", "function boxesGenerator (value){\n\n mainContainer.innerHTML = \"\";\n\n const percentWidth = Math.sqrt(value);\n const boxDimension = 100 / percentWidth;\n \n for (let i = 1; i <= value; i++){\n const boxN = document.createElement(\"div\");\n boxN.classList.add(\"box\");\n boxN.innerHTML += `<p class=\"user_select_none\">${i}</p>`\n boxN.style.width = boxDimension + \"%\";\n boxN.style.height = boxDimension + \"%\"; \n //qui ci devi mettere il listener al click della box (se non lo metti qua)\n boxN.addEventListener(\"click\", function(){\n this.classList.toggle(\"clicked\")\n }) \n \n mainContainer.append(boxN);\n }\n\n}", "function drawBox () {\n\n\t\t\tvar $topBar = $('<div class=\"round-top back-right-image\"><div class=\"round-top-fill back-left-image\"></div></div>');\n\n\t\t\tif(opts.headerTitle != \"\" && opts.headerThickness == \"thick\") {\n\t\t\t\tvar $text = $('<span class=\"text-top\"></span>').html(opts.headerTitle)\n\n\t\t\t\t$topBar.find('.round-top-fill').html($text);\n\t\t\t}\n\n\t\t\tvar $bodyContent = $('<div class=\"round-body\"><div class=\"round-body-content\"></div></div>');\n\n\t\t\tif(opts.type != \"\" && !opts.wrapContent){\n\t\t\t\tvar content = \"\";\n\n\t\t\t\tcontent\t+= '<div class=\"message-body\">';\n\t\t\t\tfor (i in messages) {\n\t\t\t\t\tif (typeof i != typeof function(){}) {\n\t\t\t\t\t\tif(i > 0) {\n\t\t\t\t\t\t\tfor( j=0; j < messages[i].length; j++) {\n\t\t\t\t\t\t\t\tcontent\t+= '<div class=\"message-detail\">' + messages[i][j] + '</div>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontent\t+= '<div class=\"message-summary\">' + messages[i][0] + '</div>';\n\t\t\t\t\t\t\tcontent\t+= '<div class=\"message-detail\">' + messages[i][1] + '</div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t};\n\t\t\t\tcontent\t+= '</div>';\n\n\t\t\t\t$bodyContent.children().append(content);\n\t\t\t}\n\n\t\t\tvar $bottomBar = $('<div class=\"round-bottom back-right-image\"><div class=\"round-bottom-fill back-left-image\"></div></div>');\n\n\t\t\t//for error/warning/success boxes that have no fill color specifications\n\t\t\tif(opts.fillColor != \"\")\n\t\t\t\topts.fillColor = opts.fillColor + \"-\";\n\n\t\t\tvar $container = $('<div class=\"round-container\"></div>')\n\t\t\t\t\t\t\t\t\t.addClass(opts.borderColor+\"-\"+opts.fillColor+\"container\")\n\t\t\t\t\t\t\t\t\t.append($topBar)\n\t\t\t\t\t\t\t\t\t.append($bodyContent)\n\t\t\t\t\t\t\t\t\t.append($bottomBar);\n\n\t\t\t//add an ID to the container if specified\n\t\t\tif(opts.containerId != \"\"){\n\t\t\t\t$container.attr('id',opts.containerId);\n\t\t\t}\n\n\t\t\t//add header thickness class to container if specified\n\t\t\tif(opts.headerThickness != \"\"){\n\t\t\t\t$container.addClass(opts.headerThickness+\"-top\");\n\t\t\t}\n\n\t\t\t//add more classes if specified\n\t\t\tif(opts.containerClass != \"\"){\t//FIX THIS...ONLY ADDS 1 CLASS\n\t\t\t\t$container.addClass(opts.containerClass);\n\t\t\t}\n\n\t\t\t$container.css({width : opts.width});\n\n\t\t\treturn $container;\n\t\t}", "function draw_box(element, classes) {\n\n var element_p;\n\n if (typeof $(element) === 'undefined') {\n element_p = $(element);\n } else {\n element_p = iframe.find(element);\n }\n\n // Be sure this element have.\n if (element_p.length > 0) {\n\n var marginTop = element_p.css(\"margin-top\");\n var marginBottom = element_p.css(\"margin-bottom\");\n var marginLeft = element_p.css(\"margin-left\");\n var marginRight = element_p.css(\"margin-right\");\n\n var paddingTop = element_p.css(\"padding-top\");\n var paddingBottom = element_p.css(\"padding-bottom\");\n var paddingLeft = element_p.css(\"padding-left\");\n var paddingRight = element_p.css(\"padding-right\");\n\n //Dynamic boxes variables\n var element_offset = element_p.offset();\n var topBoxes = element_offset.top;\n var leftBoxes = element_offset.left;\n if (leftBoxes < 0) {\n leftBoxes = 0;\n }\n var widthBoxes = element_p.outerWidth(false);\n var heightBoxes = element_p.outerHeight(false);\n\n var bottomBoxes = topBoxes + heightBoxes;\n\n var rightExtra = 1;\n var rightS = 1;\n\n if (is_content_selected()) {\n rightExtra = 2;\n rightS = 2;\n }\n\n var rightBoxes = leftBoxes + widthBoxes - rightExtra;\n\n var windowWidth = $(window).width();\n\n // If right border left is more then screen\n if (rightBoxes > (windowWidth - window.scroll_width - rightS)) {\n rightBoxes = windowWidth - window.scroll_width - rightS;\n }\n\n // If bottom border left is more then screen\n if ((leftBoxes + widthBoxes) > windowWidth) {\n widthBoxes = windowWidth - leftBoxes - 1;\n }\n\n if (heightBoxes > 1 && widthBoxes > 1) {\n\n // Dynamic Box\n if (iframe.find(\".\" + classes + \"-top\").length === 0) {\n iframeBody.append(\"<div class='\" + classes + \"-top'></div><div class='\" + classes + \"-bottom'></div><div class='\" + classes + \"-left'></div><div class='\" + classes + \"-right'></div>\");\n }\n\n // Margin append\n if (iframe.find(\".\" + classes + \"-margin-top\").length === 0) {\n iframeBody.append(\"<div class='\" + classes + \"-margin-top'></div><div class='\" + classes + \"-margin-bottom'></div><div class='\" + classes + \"-margin-left'></div><div class='\" + classes + \"-margin-right'></div>\");\n }\n\n // Padding append.\n if (iframe.find(\".\" + classes + \"-padding-top\").length === 0) {\n iframeBody.append(\"<div class='\" + classes + \"-padding-top'></div><div class='\" + classes + \"-padding-bottom'></div><div class='\" + classes + \"-padding-left'></div><div class='\" + classes + \"-padding-right'></div>\");\n }\n\n // Dynamic Boxes position\n iframe.find(\".\" + classes + \"-top\").css(\"top\", topBoxes).css(\"left\", leftBoxes).css(\"width\", widthBoxes);\n\n iframe.find(\".\" + classes + \"-bottom\").css(\"top\", bottomBoxes).css(\"left\", leftBoxes).css(\"width\", widthBoxes);\n\n iframe.find(\".\" + classes + \"-left\").css(\"top\", topBoxes).css(\"left\", leftBoxes).css(\"height\", heightBoxes);\n\n iframe.find(\".\" + classes + \"-right\").css(\"top\", topBoxes).css(\"left\", rightBoxes).css(\"height\", heightBoxes);\n\n // Top Margin\n iframe.find(\".\" + classes + \"-margin-top\").css(\"top\", parseFloat(topBoxes) - parseFloat(marginTop)).css(\"left\", parseFloat(leftBoxes) - parseFloat(marginLeft)).css(\"width\", parseFloat(widthBoxes) + parseFloat(marginRight) + parseFloat(marginLeft)).css(\"height\", marginTop);\n\n // Bottom Margin\n iframe.find(\".\" + classes + \"-margin-bottom\").css(\"top\", bottomBoxes).css(\"left\", parseFloat(leftBoxes) - parseFloat(marginLeft)).css(\"width\", parseFloat(widthBoxes) + parseFloat(marginRight) + parseFloat(marginLeft)).css(\"height\", marginBottom);\n\n // Left Margin\n iframe.find(\".\" + classes + \"-margin-left\").css(\"top\", topBoxes).css(\"left\", parseFloat(leftBoxes) - parseFloat(marginLeft)).css(\"height\", heightBoxes).css(\"width\", marginLeft);\n\n // Right Margin\n iframe.find(\".\" + classes + \"-margin-right\").css(\"top\", topBoxes).css(\"left\", rightBoxes + 2).css(\"height\", heightBoxes).css(\"width\", marginRight);\n\n // Top Padding\n iframe.find(\".\" + classes + \"-padding-top\").css(\"top\", parseFloat(topBoxes)).css(\"left\", parseFloat(leftBoxes)).css(\"width\", parseFloat(widthBoxes / 2)).css(\"height\", paddingTop);\n\n // Bottom Padding\n iframe.find(\".\" + classes + \"-padding-bottom\").css(\"top\", bottomBoxes - parseFloat(paddingBottom)).css(\"left\", parseFloat(leftBoxes)).css(\"width\", parseFloat(widthBoxes / 2)).css(\"height\", paddingBottom);\n\n // Left Padding\n iframe.find(\".\" + classes + \"-padding-left\").css(\"top\", topBoxes).css(\"left\", parseFloat(leftBoxes)).css(\"height\", heightBoxes / 2).css(\"width\", paddingLeft);\n\n // Right Padding\n iframe.find(\".\" + classes + \"-padding-right\").css(\"top\", topBoxes).css(\"left\", rightBoxes - parseFloat(paddingRight)).css(\"height\", heightBoxes / 2).css(\"width\", paddingRight);\n\n if (is_resizing() == false && is_dragging() == false) {\n iframe.find(\".yp-selected-handle\").css(\"left\", leftBoxes).css(\"top\", topBoxes);\n }\n\n }\n\n }\n\n }", "function showBoxData(){\n state.boxArr.forEach(function(box){\n\n if(box.selected){\n inpX.value = box.x;//box.x;\n inpY.value = box.y;//box.y;\n inpW.value = box.w;//box.w;\n inpH.value = box.h;//box.h;\n inpText.value = box.text;\n inpKey.value = box.key;\n inpItem.value = box.item;\n inpXskew.value = box.xSkew;\n }\n })\n inpPaddingX.value = xPadding;\n inpPaddingY.value = yPadding;\n }", "function getBoxes() {\r\n for (i = 0; i < 9; i++) {\r\n var boxName = \"ticTacToeBox\" + (i + 1);\r\n var box = document.getElementById(boxName);\r\n boxes[i] = {\r\n boxId: box.id\r\n };\r\n }\r\n}", "function clear_boxes() {\n for (var tt of tooltips) { tt.remove(); tooltips.delete(tt); }\n for (var box of boxes) { box.remove(); boxes.delete(box); }\n while (vgvContainer.lastChild) { vgvContainer.remove(vgvContainer.lastChild); }\n}", "addRandomBox(){\n\n\t\t// use a do...while statement because there can't be intersecting polygons\n\t\tdo{\n\n\t\t\t// random x and y coordinates, width and height\n\t\t\tvar startX = Phaser.Math.Between(10, game.config.width - 10 - gameOptions.sizeRange.max);\n\t\t\tvar startY = Phaser.Math.Between(10, game.config.height - 10 - gameOptions.sizeRange.max);\n\t\t\tvar width = Phaser.Math.Between(gameOptions.sizeRange.min, gameOptions.sizeRange.max);\n\t\t\tvar height = Phaser.Math.Between(gameOptions.sizeRange.min, gameOptions.sizeRange.max);\n\n\t\t\t// check if current box intersects other boxes\n\t\t} while(this.boxesIntersect(startX, startY, width, height));\n\n\t\t// draw the box\n\t\tthis.wallGraphics.strokeRect(startX, startY, width, height);\n\n\t\t// insert box vertices into polygons array\n\t\tthis.polygons.push([[startX, startY], [startX + width, startY], [startX + width, startY + height], [startX, startY + height]]);\n\t}", "function boxCreator() {\n let attributesForBoxes = document.createAttribute('class');\n attributesForBoxes.value = 'box-attributes';\n let box = document.createElement('div');\n box.id = `box${i}`;\n box.setAttributeNode(attributesForBoxes);\n document.getElementById('game').appendChild(box);\n document.getElementById('game').style.display = 'flex';\n }", "generateBoxes(numBoxes){\n\t\twhile(numBoxes>0){\n\t\t\t\n\t\t\t//Get random x and y position based on canvas size\n\t\t\tvar x=Math.floor((Math.random()*(this.width-200))); \n\t\t\tvar y=Math.floor((Math.random()*(this.height-200))); \n\t\t\t\n\t\t\t//If an actor does not exist at (x, y) position\n\t\t\tif(this.getActor(x,y)===null){\n\t\t\t\t\n\t\t\t\tvar red=randint(255), green=randint(255), blue=randint(255);\n\t\t\t\t\n\t\t\t\t//Random integers in range code below from\n\t\t\t\t//https://stackoverflow.com/questions/1527803/generating-random-whole-numbers-in-javascript-in-a-specific-range\n\t\t\t\t//Set width and height values between 5 and 200 inclusive\n\t\t\t\tvar width = Math.floor(Math.random() * (200 - 5 + 1)) + 5;\n\t\t\t\tvar height = Math.floor(Math.random() * (200 - 5 + 1)) + 5;\n\t\t\t\t\n\t\t\t\tvar colour= 'rgba('+red+','+green+','+blue+','+0.75+')';\n\t\t\t\tvar position = new Pair(x,y);\n\t\t\t\tvar health = 3;\n\t\t\t\tvar type = \"Ammo\";\n\t\t\t\t\n\t\t\t\t//Randomly make a Box a gun box based on gunSpawn value\n\t\t\t\tvar gunSpawn = Math.floor(Math.random()*10);\n\t\t\t\tif (gunSpawn == 0){\n\t\t\t\t\ttype = \"Pistol\";\n\t\t\t\t\thealth = 100;\n\t\t\t\t} else if (gunSpawn == 1){\n\t\t\t\t\ttype = \"Sniper\";\n\t\t\t\t\thealth = 100;\n\t\t\t\t} else if (gunSpawn == 2){\n\t\t\t\t\ttype = \"Shotgun\";\n\t\t\t\t\thealth = 100;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//Add Box to actors\n\t\t\t\tvar b = new Box(this, \"Box\", position, colour, width, height, health, type);\n\t\t\t\tthis.addActor(b);\n\t\t\t\tnumBoxes--;\n\t\t\t}\n\t\t}\n\t}", "function addInitialBoxes() {\n for (var i = 0; i < 5; i++) {\n addBoxes();\n }\n}", "function addBox(width, height, center = [0, 0, 1]) {\n let object = {\n name: '',\n type: 'box',\n width: width,\n height: height,\n center: center,\n fill: '#FFFFFF',\n stroke: '#000000',\n actualStroke: '#000000',\n T: Math.identity(),\n R: Math.identity(),\n S: Math.identity(),\n angleRotation: 0\n }\n objectSelected = objects.push(object)\n drawObjects()\n return objectSelected\n }", "function renderBoxes(count) {\n var boxes = ''\n for (var i = 0; i < count; i++) {\n if (i == count / 2) {\n boxes += `<br>\n `\n }\n boxes += `\n <div class=\"testpoint-box\">\n <input name=\"testpoint-box\" type=\"checkbox\" id=\"ch${i + 1}\" name=\"ch${\n i + 1\n }\" value=\"ch${i + 1}\">\n <label class=\"put-left\" for=\"ch${i + 1}\"> CH${i + 1}</label> \n </div>`\n }\n return boxes\n}", "function prepareOneSlideBox(slotholder, opt, visible) {\n\n var sh = slotholder;\n var img = sh.find('img')\n setSize(img, opt)\n var src = img.attr('src');\n var w = img.data('neww');\n var h = img.data('newh');\n var fulloff = img.data(\"fxof\");\n if (fulloff == undefined) fulloff = 0;\n var off = 0;\n\n\n\n\n // SET THE MINIMAL SIZE OF A BOX\n var basicsize = 0;\n if (opt.sloth > opt.slotw)\n basicsize = opt.sloth\n else\n basicsize = opt.slotw;\n\n\n if (!visible) {\n var off = 0 - basicsize;\n }\n\n opt.slotw = basicsize;\n opt.sloth = basicsize;\n var x = 0;\n var y = 0;\n\n\n\n for (var j = 0; j < opt.slots; j++) {\n\n y = 0;\n for (var i = 0; i < opt.slots; i++) {\n\n\n sh.append('<div class=\"slot\" ' +\n 'style=\"position:absolute;' +\n 'top:' + y + 'px;' +\n 'left:' + (fulloff + x) + 'px;' +\n 'width:' + basicsize + 'px;' +\n 'height:' + basicsize + 'px;' +\n 'overflow:hidden;\">' +\n\n '<div class=\"slotslide\" data-x=\"' + x + '\" data-y=\"' + y + '\" ' +\n 'style=\"position:absolute;' +\n 'top:' + (0) + 'px;' +\n 'left:' + (0) + 'px;' +\n 'width:' + basicsize + 'px;' +\n 'height:' + basicsize + 'px;' +\n 'overflow:hidden;\">' +\n\n '<img style=\"position:absolute;' +\n 'top:' + (0 - y) + 'px;' +\n 'left:' + (0 - x) + 'px;' +\n 'width:' + w + 'px;' +\n 'height:' + h + 'px\"' +\n 'src=\"' + src + '\"></div></div>');\n y = y + basicsize;\n }\n x = x + basicsize;\n }\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 box(length) {\n for (var i = 0; i < 6; i++) {\n forward(length);\n right(60);\n }\n}", "function initialize_boxes() {\n \n // build stuff for the focus hero\n boxes['focus'] = {};\n boxes['focus']['talents'] = new TalentBox(6, null, [], [], vgvContainer);\n boxes['focus']['abilities'] = [];\n for (var i = 0; i < 6; i++) {\n boxes['focus']['abilities'].push(new AbilityBox(i, 6, null, [], vgvContainer));\n }\n boxes['focus']['items'] = [];\n for (var i = 0; i < 9; i++) {\n boxes['focus']['items'].push(new ItemBox(i, 6, null, vgvContainer));\n }\n \n // build hero avatar boxes\n boxes['avatars'] = [];\n for (var i = 0; i < 10; i++) {\n boxes['avatars'].push(new AvatarBox(i, vgvContainer));\n // boxes['avatars'][i].element.addEventListener('click', function(event) {console.log(TIMER)});\n }\n}", "constructor () {\n this.size = 16;\n this.grid_status = this.makeStatus();\n this.boxies = this.makeBoxes();\n }", "function createGrid(numBox){\n var box = '<div class=\"box\"></div>';\n for(var i = 1; i <= numBox; i++){\n for(var j = 1; j <= numBox; j++){\n $('#container').append('<div class=\"box\"></div>');\n }\n }\n var size = (400 - (numBox * 2)) / numBox;\n $('.box').css({'height': size, 'width': size});\n }", "getBoxes() {\n return this.boxes.map(\n box => this.getBoxData(box)\n );\n }", "function drawBoxes() {\n // Initialize boxElement (outside of the for loop below)\n let boxElement = document.createElement(\"span\");\n // Flag to determine if this is a huge box or not.\n let hugeBox = false;\n /* Note: These functions make use of the block-scope\n * i'm promised due to me using \"let\" when\n * instantiating boxElement; this function also\n * makes use of \"hiding\" or \"closure\".\n * I don't need any other function to see mutateBox\n * and I KNOW that right from the start, so might as\n * well make it's scope only the function that needs it.\n * Downside: It makes the drawBoxes function more\n * complex and harder to understand. */\n /** Will shape and color a box element. */\n function mutateBox() {\n // Now apply them to the boxElement\n boxElement.style.width = boxWidth + \"px\";\n boxElement.style.height = boxHeight + \"px\";\n // Assign the box a random class\n boxElement.classList.add(getRandomElement(randomCSSClasses));\n // Fill in the box's value with some weird value\n boxElement.innerText = generateString();\n // Add a bunch of random CSS rules\n boxElement.style.backgroundColor = generateHexColor();\n boxElement.style.color = generateHexColor();\n /* Logic here: I want the font size to be no bigger\n * than 2rem, but no smaller than 0.02rem, unless it's\n * a \"hugeBox\", in which case, I'll blow out that font\n * size so it's at least 6rem and at most 16rem, because\n * if it's a hugeBox it'll have a large height and width\n * that we need to fill. */\n boxElement.style.fontSize = hugeBox ? randomNum(15) + 10 + \"rem\" : (Math.random() + (Math.random() * 0.5)) + \"rem\";\n /* 70% chance to align text to the left, otherwise\n * align the text to the right. */\n boxElement.style.textAlign = Math.random() < 0.7 ? \"left\" : \"right\";\n // Small chance to float right (12%)\n boxElement.style.float = Math.random() < 0.88 ? \"left\" : \"right\";\n // 80/20 chance the box will be in layer 1 or 2.\n if(Math.random() > 0.80) {\n boxElement.classList.add(\"layer-2\");\n }\n else {\n boxElement.classList.add(\"layer-1\");\n }\n // 20% chance to randomly rotate the box\n boxElement.style.transform = Math.random() > 0.80 ? \"rotate(\" + randomNum(360) + \"deg)\" : \"\";\n /* Apply the background pulse in random intervals\n * of anywhere from 0.05s-20s */\n addBackgroundPulse(boxElement, (Math.random() * (Math.random() * 20000)));\n }\n /** Will set the box's height and width, and also\n * there's a small chance the limit for both boxHeight and boxWidth\n * can change. */\n function resetBoxDimensions() {\n /* Reset our flag for huge box, because\n * this is the only function that modifies\n * the variable. */\n hugeBox = false;\n // Set boxWidth and boxHeight\n boxWidth = randomNum(boxWidthLimit);\n boxHeight = randomNum(boxHeightLimit);\n /* Reset boxWidthLimit and boxHeightLimit\n * every so often. */\n boxHeightLimit = Math.random() < 0.83 ? boxHeightLimit : randomNum(250) + randomNum(40) + 20;\n boxWidthLimit = Math.random() < 0.77 ? boxWidthLimit : randomNum(250) + randomNum(40) + 10;\n // Very small chance (2%) to return HUGE dimensions\n if (randomNum(100) > 98) {\n boxWidth = randomNum(boxWidthLimit * randomNum(10));\n boxHeight = randomNum(boxHeightLimit * randomNum(10));\n // Don't forget, we need to remember this\n // in mutateBox above when setting font size.\n hugeBox = true;\n }\n }\n /** Animates a box by attaching a CSS class;\n * the animations are defined in style.css. \n * @param {number} maxAnimationSeconds Defines how long\n * a CSS animation will last, in seconds. Optional.\n * @param {array} animationNames Make sure when\n * overridding animationNames you use valid animations defined\n * in style.css. Optional. */\n function animateBox(maxAnimationSeconds = 10, animationNames = [ \n \"spin alternate\", \n \"droppingHot\", \n \"spinBig\", \n \"wackoDacko\", \n \"onHover alternate\", \n \"onHover\", \n \"wackoDacko alternate\"]) {\n // 50/50 chance we may not even do it.\n if(randomNum() < 0.50) {\n /* 84% chance this doesn't go through, but if\n * it does, we'll set the animation of the boxElement\n * defined in this scope (in the beginning of drawBoxes)\n * to a random animation defined in animationNames, which\n * could be overridden if need be. */\n boxElement.style.animation = Math.random() < 0.84 ? boxElement.style.animation : randomNum(maxAnimationSeconds) + \"s \" + getRandomElement(animationNames);\n }\n }\n for(let i = 0; i < boxAmount; i++) {\n // Create a new span element\n boxElement = document.createElement(\"span\");\n // Get different sized boxes each time\n resetBoxDimensions();\n // Make the box look unique using CSS rules\n // like font-size, float, text-align, etc.,\n // as well as fill the box with words.\n mutateBox();\n // Animate the box\n animateBox();\n // Append the new element to the body\n document.body.appendChild(boxElement);\n }\n }", "function boxIt (arrOfArgs) {\n if (!arrOfArgs[0]){\n console.log(\"\\u250E\" + \"\\u2512\" + \"\\n\" + \"\\u2515\" + \"\\u251A\")\n return\n }\n let longest = longestName(arrOfArgs)\n console.log(drawTopBorder(longest))\n\n arrOfArgs.forEach(name => {\n console.log (drawBarsAround(name, longest))\n if (name === arrOfArgs[arrOfArgs.length-1]){\n console.log(drawBottomBorder(longest))\n }\n else\n console.log (drawMiddleBorder(longest))\n }\n ) \n}", "function createBox (box_type,size, scene) {\n var mat = new BABYLON.StandardMaterial(\"mat\", scene);\n var texture = new BABYLON.Texture(\"images/textures/box_atlas.png\", scene);\n mat.diffuseTexture = texture;\n var columns = 8; // 6 columns\n var rows = 8; // 4 rows\n var faceUV = new Array(6);\n\n switch (box_type) {\n case \"wood\":\n for (var i = 0; i < 6; i++) {\n faceUV[i] = new BABYLON.Vector4(6 / columns, 3 / rows, 7 / columns, 4 / rows);\n }\n break;\n case \"tnt\":\n var Ubottom_left = 3 / columns;\n var Vbottom_left = 3 / rows;\n var Utop_right = 4 / columns;\n var Vtop_right = 4 / rows;\n //select the face of the cube\n faceUV[0] = new BABYLON.Vector4(Utop_right, Vtop_right, Ubottom_left, Vbottom_left);\n faceUV[1] = new BABYLON.Vector4(Ubottom_left, Vbottom_left, Utop_right, Vtop_right);\n faceUV[2] = new BABYLON.Vector4(Utop_right, Vtop_right, Ubottom_left, Vbottom_left);\n faceUV[3] = new BABYLON.Vector4(Utop_right, Vtop_right, Ubottom_left, Vbottom_left);\n for (var i = 4; i < 6; i++) {\n faceUV[i] = new BABYLON.Vector4(4 / columns, 3 / rows, 5 / columns, 4 / rows);\n }\n\n\n break;\n }\n var box = BABYLON.MeshBuilder.CreateBox('box', {size:size,faceUV: faceUV}, scene);\n box.isPickable = true;\n box.material = mat;\n box.position = position;\n return box;\n }", "function addBoxes(parent, numberOfBoxes) {\n for (var i = 1; i <= numberOfBoxes; i ++) {\n addBox(parent, numberOfBoxes);\n };\n}", "function boxClicked() {\r\n let clickedBox = this.className;\r\n let mark = this;\r\n let player = \"User\";\r\n mark.style.background = \"url(img/x-brush.png) no-repeat\";\r\n mark.style.backgroundSize = \"contain\";\r\n mark.style.backgroundPosition = \"center\";\r\n mark.style.pointerEvents = \"none\";\r\n checkClass(clickedBox, player);\r\n computerRandomizer(boxRow, mark);\r\n console.log(updateList.length);\r\n\r\n state();\r\n}", "function checkBoxes() {\n boxes.forEach((box) => {\n const triggerBottom = innerHeight * 0.8;\n const boxTop = box.getBoundingClientRect().top;\n console.log(boxTop);\n console.log(triggerBottom);\n if (boxTop < triggerBottom) {\n box.classList.add(\"show\");\n } else {\n box.classList.remove(\"show\");\n }\n });\n}", "function prepareOneSlideBox(slotholder,opt,visible) {\n\n\t\t\t\tvar sh=slotholder;\n\t\t\t\tvar img = sh.find('.defaultimg');\n\n\t\t\t\tsetSize(img,opt)\n\t\t\t\tvar src = img.data('src');\n\t\t\t\tvar bgcolor=img.css('backgroundColor');\n\n\t\t\t\tvar w = opt.width;\n\t\t\t\tvar h = opt.height;\n\t\t\t\tif (opt.autoHeight==\"on\")\n\t\t\t\t h = opt.container.height();\n\t\t\t\t \n\t\t\t\tvar fulloff = img.data(\"fxof\");\n\t\t\t\tif (fulloff==undefined) fulloff=0;\n\n\t\t\t\tfullyoff=0;\n\n\n\n\t\t\t\tvar off=0;\n\n\n\n\n\t\t\t\t// SET THE MINIMAL SIZE OF A BOX\n\t\t\t\tvar basicsize = 0;\n\t\t\t\tif (opt.sloth>opt.slotw)\n\t\t\t\t\tbasicsize=opt.sloth\n\t\t\t\telse\n\t\t\t\t\tbasicsize=opt.slotw;\n\n\n\t\t\t\tif (!visible) {\n\t\t\t\t\tvar off=0-basicsize;\n\t\t\t\t}\n\n\t\t\t\topt.slotw = basicsize;\n\t\t\t\topt.sloth = basicsize;\n\t\t\t\tvar x=0;\n\t\t\t\tvar y=0;\n\n\t\t\t\tvar bgfit = img.data('bgfit');\n\t\t\t\tvar bgrepeat = img.data('bgrepeat');\n\t\t\t\tvar bgposition = img.data('bgposition');\n\n\t\t\t\tif (bgfit==undefined) bgfit=\"cover\";\n\t\t\t\tif (bgrepeat==undefined) bgrepeat=\"no-repeat\";\n\t\t\t\tif (bgposition==undefined) bgposition=\"center center\";\n\n\t\t\t\tfor (var j=0;j<opt.slots;j++) {\n\n\t\t\t\t\ty=0;\n\t\t\t\t\tfor (var i=0;i<opt.slots;i++) \t{\n\n\n\t\t\t\t\t\tsh.append('<div class=\"slot\" '+\n\t\t\t\t\t\t\t\t 'style=\"position:absolute;'+\n\t\t\t\t\t\t\t\t\t\t\t'top:'+(fullyoff+y)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'left:'+(fulloff+x)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'width:'+basicsize+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'height:'+basicsize+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'overflow:hidden;\">'+\n\n\t\t\t\t\t\t\t\t '<div class=\"slotslide\" data-x=\"'+x+'\" data-y=\"'+y+'\" '+\n\t\t\t\t\t\t\t\t \t\t\t'style=\"position:absolute;'+\n\t\t\t\t\t\t\t\t\t\t\t'top:'+(0)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'left:'+(0)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'width:'+basicsize+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'height:'+basicsize+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'overflow:hidden;\">'+\n\n\t\t\t\t\t\t\t\t '<div style=\"position:absolute;'+\n\t\t\t\t\t\t\t\t\t\t\t'top:'+(0-y)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'left:'+(0-x)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'width:'+w+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'height:'+h+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'background-color:'+bgcolor+';'+\n\t\t\t\t\t\t\t\t\t\t\t'background-image:url('+src+');'+\n\t\t\t\t\t\t\t\t\t\t\t\t\t'background-repeat:'+bgrepeat+';'+\n\t\t\t\t\t\t\t\t\t\t\t'background-size:'+bgfit+';background-position:'+bgposition+';\">'+\n\t\t\t\t\t\t\t\t '</div></div></div>');\n\t\t\t\t\t\ty=y+basicsize;\n\t\t\t\t\t}\n\t\t\t\t\tx=x+basicsize;\n\t\t\t\t}\n\t\t}", "function boxes() {\n\tthis.innerHTML = HUplayer;\n\tthis.removeEventListener('click', boxes);\n\tcheckWinner();\n\tendGameChecker();\n\tlet emptySlots = checkerForEmpty();\n\tif (emptySlots.length > 0 && !endGame) {\n\t\tlet oneEmptySlot = emptySlots[Math.floor(Math.random() * emptySlots.length)];\n\t\toneEmptySlot.innerHTML = AI;\n\t\toneEmptySlot.removeEventListener('click', boxes);\n\t\tcheckWinner();\n\t}\n}", "function drawBoxes(objects) {\n\n //clear the previous drawings\n drawCtx.clearRect(0, 0, drawCanvas.width, drawCanvas.height);\n\n //filter out objects that contain a class_name and then draw boxes and labels on each\n objects.forEach(face => {\n let scale = uploadScale();\n let _x = face.x / scale;\n let y = face.y / scale;\n let width = face.w / scale;\n let height = face.h / scale;\n //flip the x axis if local video is mirrored\n if (mirror) {\n x = drawCanvas.width - (_x + width)\n } else {\n x = _x\n }\n\n let rand_conf = face.confidence.toFixed(2);\n let title = \"\" + rand_conf + \"\";\n if (face.name != \"unknown\") {\n drawCtx.strokeStyle = \"magenta\";\n drawCtx.fillStyle = \"magenta\";\n title += ' - ' + face.name\n if (face.predict_proba > 0.0 ) {\n title += \"[\" + face.predict_proba.toFixed(2) + \"]\";\n }\n } else {\n drawCtx.strokeStyle = \"cyan\";\n drawCtx.fillStyle = \"cyan\";\n }\n drawCtx.fillText(title , x + 5, y - 5);\n drawCtx.strokeRect(x, y, width, height);\n\n if(isCaptureExample && examplesNum < maxExamples) {\n console.log(\"capure example: \", examplesNum)\n\n //Some styles for the drawcanvas\n exCtx.drawImage(imageCanvas,\n face.x, face.y, face.w, face.h,\n examplesNum * exampleSize, 0,\n exampleSize, exampleSize);\n\n examplesNum += 1;\n\n if(examplesNum == maxExamples) {\n stopCaptureExamples();\n }\n }\n\n });\n}", "function makeBox() {\n bokser.innerHTML = '';\n for (var i = 0; i < antallFarger; i++) {\n var rndFarge1 = Math.floor(Math.random() * 255);\n var rndFarge2 = Math.floor(Math.random() * 255);\n var rndFarge3 = Math.floor(Math.random() * 255);\n colorArr.push(`rgb(${rndFarge1},${rndFarge2},${rndFarge3})`);\n bokser.innerHTML += `<div id=\"boks-${i}\" style=\"\n width:100px; \n height:100px;\n float: left;\n background-color: rgb(${rndFarge1},${rndFarge2},${rndFarge3});\n \"></div>`;\n }\n}", "isBoxValid(index) {\n return (\n !this.boxes[index].classList.contains(\"wall\") &&\n !this.boxes[index].classList.contains(\"start\") &&\n !this.boxes[index].classList.contains(\"wall\")\n );\n }", "function addMoreRects() {\n for (let i = 0; i < AMOUNT; i++) {\n rects[i].float();\n rects[i].display();\n rects[i].collisionDetection();\n }\n}", "function pack() {\n var boxes = config.boardView.querySelectorAll(\".box\"),\n boxesPerRow = calculateBoxesPerRow(boxes.length),\n margin = parseInt(window.getComputedStyle(boxes[0]).marginTop.replace(\"px\", \"\")),\n boardWidth = boxesPerRow * (boxes[0].offsetWidth + 2 * margin);\n\n if (boxesPerRow === 1) {\n boxesPerRow = boxes.length;\n }\n\n config.boardView.style.width = boardWidth + \"px\";\n }", "function show() {\n\tvar pos= boxes[j].position;\n\tvar angle= boxes[j].angle;\n\t\n\tpush();\n\ttranslate(pos.x,pos.y);\n\trotate(angle);\n\tfill(0);\n\trectMode(CENTER);\n\trect(0, 0, boxWidth[j], boxHeight[j]);\n\tpop();\t\n}", "function addBoxes() {\n O('box-container').innerHTML += \"<div class='box'>More Boxes!!!!</div>\"\n}", "function gbDivs(x, y) {\n var className;\n var box = \"box\";\n var i;\n var ind;\n if(x >= y ) {\n for(ind=0; ind < y; ind++){\n for( i=0; i < x; i++){\n\n className = \"pos\" + (i+1) + \"-\" + (ind+1);\n // var newDiv = $('div').addClass( className )\n // .addClass(\"box\");\n // console.log(className);\n\n $(\".container\").append(\"<div class=\\'box \" + className + \"\\'\" + \"></div>\" );\n\n\n }\n\n }\n\n } else if ( y > x){\n className = 0;\n for( ind=0; ind < x; ind++) {\n for( i=0; i < y; i++){\n\n className = \"pos\" + (i+1) + \"-\" + (ind+1);\n\n $(\".container\").append(\"<div class=\\'box \" + className + \"\\'\" + \"></div>\" );\n }\n }\n }\n}", "generateBoxes(h,w) {\n\t\tvar bx = new Map();\n\t\tfor(var y = 0; y< h-1 ; y++)\n\t\t{\n\t\t\tfor(var x = 0 ; x< w-1; x++)\n\t\t\t{\n\t\t\t\tvar a =new Dot(x,y);\n\t\t\t\tvar box = new Box(a);\n\t\t\t\tbx.set(a.toString(), box);\n\t\t\t}\n\t\t}\n\t\treturn bx;\n\t}", "function dynamicAddBox() {\r\n\t\tif (objchoice.insertCount<6)\r\n\t\t{\r\n\t\t\tswitch (objchoice.insertCount)\r\n\t\t\t{\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\t$(\"main, main img\").css({\"width\": \"220px\", \"height\": \"220px\"});\r\n\t\t\t\t\tobjmain = new getAttribute(\"main\");\r\n\t\t\t\t\tobjmain = setmainPosition(objmain, objContainer);\r\n\t\t\t\t\tsetboxPosition(objchoice, objmain, 6);\r\n\t\t\t\t\tobjchoice.resultBox[objchoice.insertCount] = objchoice.backupBox[5];\r\n\t\t\t\t\tobjchoice.backupBox.splice(5, 1);\t\r\n\t\t\t\t\t$(\".functionBox\").show();\r\n\t\t\t\t\tobjchoice.memoryCount = 5;\r\n\t\t\t\t\tobjchoice.insertCount = 1;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tshowrandomBox(objchoice);\r\n\t\t\t}\t\r\n\t\t}\r\n\t\telse if (objchoice.insertCount<18)\r\n\t\t{\r\n\t\t\tswitch (objchoice.insertCount)\r\n\t\t\t{\r\n\t\t\t\tcase 6:\r\n\t\t\t\t\t$(\"main, main img\").css({\"width\": \"130px\", \"height\": \"130px\"});\r\n\t\t\t\t\t$(\".firstLayer\").css({\"width\": \"120px\", \"height\": \"120px\"});\r\n\t\t\t\t\t$(\".functionBox\").css({\"width\": \"100px\", \"height\": \"100px\"});\r\n\t\t\t\t\t$(\".functionButton\").css({\"width\": \"100px\", \"height\": \"50px\"});\r\n\t\t\t\t\tobjmain = new getAttribute(\"main\");\r\n\t\t\t\t\tobjmain = setmainPosition(objmain, objContainer);\r\n\t\t\t\t\tsetboxPosition(objchoice, objmain, 18);\r\n\t\t\t\t\tobjchoice.memoryCount = 11;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tshowrandomBox(objchoice);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (objchoice.insertCount<28)\r\n\t\t{\r\n\t\t\tswitch (objchoice.insertCount)\r\n\t\t\t{\r\n\t\t\t\tcase 18:\r\n\t\t\t\t\t$(\"main, main img\").css({\"width\": \"120px\", \"height\": \"120px\"});\r\n\t\t\t\t\t$(\".firstLayer\").css({\"width\": \"110px\", \"height\": \"110px\"});\r\n\t\t\t\t\t$(\".secondLayer\").css({\"width\": \"100px\", \"height\": \"100px\"});\r\n\t\t\t\t\t$(\".functionBox\").css({\"width\": \"80px\", \"height\": \"80px\"});\r\n\t\t\t\t\t$(\".functionButton\").css({\"width\": \"80px\", \"height\": \"40px\"});\r\n\t\t\t\t\tobjmain = new getAttribute(\"main\");\r\n\t\t\t\t\tobjmain = setmainPosition(objmain, objContainer);\r\n\t\t\t\t\tsetboxPosition(objchoice, objmain, objchoice.initialBox.length);\r\n\t\t\t\t\tobjchoice.memoryCount = 9;\r\n\t\t\t\tdefault: \r\n\t\t\t\t\tshowrandomBox(objchoice);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{ $(\".alertBox\").show(); }\r\n\t} // end function", "function Box() {\n this.x = 0;\n this.y = 0;\n this.w = 1; // default width and height?\n this.h = 1;\n this.fill = '#444444';\n this.sector = '0';\n this.pricenum = '0';\n this.state= 0;\n this.place= 0;\n this.line = 0;\n this.cell = 0;\n}", "function createBox(boxPos, numOfSquares) {\n let squares = '';\n\n for (let i = 0; i < numOfSquares; i++) {\n squares += createSquare(boxPos, i, 9);\n }\n\n return '<div class=\"box\"> \\n' + squares + '</div> \\n';\n}", "_addSnake(){\n for(let i =0; i<this._snake.length; i++){\n const elem = document.createElement(\"div\");\n elem.className=\"box\";\n elem.id = \"box-id\";\n elem.style.top=this._snake[i].row*this._boxSize+\"px\";\n elem.style.left=this._snake[i].col*this._boxSize+\"px\";\n this._screen.append(elem);\n this._snakeBodyElems.push(elem);\n }\n }", "function styleBoxes(selection, self) {\n selection\n .style('width', `${self.boxWidth}px`)\n .style('height', `${self.boxHeight}px`);\n // .style('margin', `${self.boxMargin / 2}px`)\n }", "function clickedBox() {\n\n\n for (var i = 0; i < boxesAmt; i++) {\n\n\n \n boxes[i].style.backgroundColor = backColor;\n \n\n }\n}", "build() {\r\n for (let y = this.y; y < height; y += height / 20) {\r\n for (let x = this.x; x < 400; x += 400 / 10) {\r\n let boxUsed = false;\r\n let col = 255;\r\n this.gameMap.push({\r\n x,\r\n y,\r\n boxUsed,\r\n col\r\n });\r\n // Visualize the grid\r\n rect(x, y, 40, 40);\r\n }\r\n }\r\n }", "function renderBoxes(array) {\n //creates box html\n boxContainer.innerHTML += array.map(num=>{\n let color = \"\";\n \n switch(num) {\n case 1:\n color = \"purple\";\n break;\n case 2:\n color = \"yellow\";\n break;\n case 3:\n color = \"blue\";\n break;\n case 4:\n color = \"pink\";\n break;\n case 5:\n color = \"lime\";\n break;\n case 6:\n color = \"orange\";\n break;\n default:\n color = \"pink\";\n }\n\n return `<div class=\"box-container__box ${color}\" id=\"${num}\"></div>`\n\n }).join(\"\\n\");\n\n //adds event listeners to each box and calls to detect user input\n document.querySelectorAll(\".box-container__box\").forEach(box => {\n box.addEventListener(\"click\", event => {\n const userNewInput = Number(event.target.id);\n if (array === easyArray){\n detectUserInput(userNewInput, \"easy\");\n } else {\n detectUserInput(userNewInput, \"hard\");\n }\n });\n });\n\n //adds classes to box container depending on mode\n if (array === easyArray) {\n boxContainer.classList.add(\"easy\");\n } else if (array === array || array === shuffled) {\n boxContainer.classList.add(\"hard\");\n }\n}", "drawBoxes() {\r\n let len = this._answer.length\r\n let div = document.createElement('div')\r\n\r\n for (var i = 0; i < len; i++) {\r\n let v = this._answer.charAt(i)\r\n let elem = document.createElement('span')\r\n div.appendChild(elem)\r\n\r\n if (v == '-') {\r\n this._container.appendChild(div)\r\n elem.className += 'hyphen'\r\n elem.innerText = '-'\r\n div = document.createElement('div')\r\n }\r\n if (v == ' ') {\r\n this._container.appendChild(div)\r\n elem.className += 'space'\r\n elem.innerText = ' '\r\n div = document.createElement('div')\r\n }\r\n if (v == \"'\") {\r\n this._container.appendChild(div)\r\n elem.className += 'apostrophe'\r\n elem.innerText = \"'\"\r\n div = document.createElement('div')\r\n }\r\n }\r\n this._container.appendChild(div)\r\n }", "function addBoxes(wrapper) {\n let container = document.getElementById(wrapper);\n container.innerHTML = \"\";\n let letter = wrapper.slice(wrapper.length -1);\n for (var box = 0; box < 12; box++) {\n // check for column, set text style \n switch(letter.toLowerCase()) {\n case \"a\":\n container.innerHTML = container.innerHTML + \"<div>\" + letter.toLowerCase() + \"0\" + box + \"</div>\";\n break;\n case \"b\":\n container.innerHTML = container.innerHTML + \"<div><b>\" + letter.toLowerCase() + \"0\" + box + \"</b></div>\";\n break;\n case \"c\":\n container.innerHTML = container.innerHTML + \"<div>\" + letter.toLowerCase() + \"0\" + box + \"</div>\";\n }\n }\n }", "render() {\n const renderBoxes = this.state.boxes.map((box) => (// Maps through \"boxes\"\n <Box\n key={box.id}\n id={box.id} // creates/returns box component for each box in the array\n color={box.color}\n handleBoxClick={this.handleBoxClick}\n />\n )\n );\n return (\n <main\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n flexDirection: \"column\",\n textAlign: \"center\",\n }}\n >\n <h1> React: State and Props </h1>{\" \"}\n <div className=\"App\"> {renderBoxes} </div>{\" \"}\n </main>\n );\n}", "function class_box(ctx) // the treasure chest that contains special items\r\n{\t\r\n\tthis.sidelength = 30;\r\n\tthis.context = ctx;\r\n\t\r\n\t//position\r\n\tthis.x = (borderwidth+this.sidelength) + Math.floor(Math.random()*(width-(borderwidth+(2*this.sidelength))+1));\r\n\tthis.y = -this.sidelength;\r\n\tthis.lastx = 0;\r\n\tthis.lasty = 0;\r\n\r\n\tthis.bActive = false;\r\n\tthis.bHit = false;\r\n\t\r\n\tthis.reset = function() {\r\n\t\tthis.lastx = this.x;\r\n\t\tthis.lasty = this.y;\r\n\t\tthis.x = (borderwidth+this.sidelength) + Math.floor(Math.random()*(width-(borderwidth+(2*this.sidelength))+1));\r\n\t\tthis.y = -this.sidelength;\r\n\t\tthis.bActive = false;\r\n\t\tsetTimeout(\"thebox.bActive = true\", 10000); // next box will spawn in 10 seconds\r\n\t};\r\n\t\t\r\n\tthis.draw = function() {\r\n\t\tif(this.bHit) this.context.drawImage(img[8], this.lastx-15, this.lasty-8, 60, 40);\r\n\t\telse if(this.bActive) this.context.drawImage(img[7], this.x, this.y, this.sidelength, this.sidelength);\r\n\t};\r\n\t\r\n\tthis.update = function() {\r\n\t\t\r\n\t\tif(!this.bActive) return;\r\n\t\t\r\n\t\tthis.y++;\r\n\t\tthis.x += Math.sin(this.y * (Math.PI/180)) / 4;\r\n\t\t\r\n\t\tif(this.y > 400) this.reset();\r\n\t};\r\n\t\t\r\n\tthis.gotHit = function() {\r\n\t\tthis.bActive = false;\r\n\t\tthis.bHit = true;\r\n\t\tthis.reset();\r\n\t\tsetTimeout(\"thebox.bHit = false\", 1000); // 1 second hit animation\r\n\t\tsetTimeout(\"thebox.bActive = true\", 10000); // in 10 seconds the next box will spawn\r\n\t};\r\n}", "render() {\n const boxComponents = this.state.boxes.map((color, i) => (\n <Box key={i} color={color}/>\n ));\n\n return (\n <section className=\"BoxesContainer\">\n {boxComponents}\n\n <p>\n <button onClick={this.handleClick}>Change a Box</button>\n </p>\n </section>\n );\n }", "constructor(h,w) {\n\t\t\n\t\tthis.boxes = this.generateBoxes(h,w);\n\t\tthis.box_count = 0;\n\t}", "function Box(id, name, color, x, y) {\n\tthis.id = id;\n\tthis.name = name;\n\tthis.color = color;\n\tthis.x = x;\n\tthis.y = y;\n }", "function find_box(blue_piece_object)\n{\n $(\"#in_function\").html(\"find_box\");\n var return_val=null;\n var extra_space=4;\n\n //iterate through all the div boxes\n $(\"div.box\").each(function(index,value)\n {\n //variables\n var boxL=value.offsetLeft;\n var boxT=value.offsetTop;//-$(\"#checkers\").offset().top;\n var boxWidth=value.offsetWidth;\n var pieceL=blue_piece_object.left;\n var pieceT=blue_piece_object.top;\n\n //compare if the left and top positions of the blue-pieve are within one of the boxes\n if(pieceL>(boxL-extra_space) && (pieceL+blue_piece_object.width)<=(boxL+boxWidth+extra_space))\n {\n if((boxT-extra_space)<pieceT && (boxT+boxWidth+extra_space)>=(pieceT+blue_piece_object.width))\n {\n //alert(value.id+\": Collision\");\n\n return_val=value.id;\n $(\"#on_box\").html(\"Box: \"+return_val);\n }\n }\n });\n\n //if(return_val==null)\n // alert(\"Move to your correct spot!\");\n\n return return_val;\n}", "function init(){\r\n\r\n\tvar identifier =0;\r\n\r\n\tvar box1=document.getElementById('box1');\r\n\tvar box2=document.getElementById('box2');\r\n\tvar box3=document.getElementById('box3');\r\n\tvar box4=document.getElementById('box4');\r\n\tvar box5=document.getElementById('box5');\r\n\tvar box6=document.getElementById('box6');\r\n\tvar box7=document.getElementById('box7');\r\n\tvar box8=document.getElementById('box8');\r\n\tvar box9=document.getElementById('box9');\r\n\r\n\tfor(var i=0;i<N_SIZE;i++){\r\n\r\n\t\tfor(var j=0;j<N_SIZE;j++){\r\n\r\n\t\t\tvar cell;\r\n\r\n\t\t\tif(i==0 & j==0){ cell = box1;}\r\n\t\t\telse if(i==0 & j==1){ cell = box2;}\r\n\t\t\telse if(i==0 & j==2){ cell = box3;}\r\n\t\t\telse if(i==1 & j==0){ cell = box4;}\r\n\t\t\telse if(i==1 & j==1){ cell = box5;}\r\n\t\t\telse if(i==1 & j==2){ cell = box6;}\r\n\t\t\telse if(i==2 & j==0){ cell = box7;}\r\n\t\t\telse if(i==2 & j==1){ cell = box8;}\r\n\t\t\telse if(i==2 & j==2){ cell = box9;}\r\n\r\n\r\n\r\n\t\t\tcell.identifier=identifier;//know \r\n\t\t\tboxes.push(cell);\r\n\t\t\tidentifier+=+1;\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n\tstartNewGame();\r\n\r\n}", "function mouseClicked() {\n arrOfTorus.pop();\n let aColoredBox = new cluelessBox(20);\n arrOfBoxes.push(aColoredBox);\n}", "function moveBoxes() {\n //Move boxes to the right as long as they haven't reached their next position\n if (posOffset1.x < offsetX2) {\n posOffset0.set(posOffset0.x+speed, posOffset0.y);\n posOffset1.set(posOffset1.x+speed, posOffset1.y);\n posOffset2.set(posOffset2.x+speed, posOffset2.y);\n if (steps<2) {\n welcomeOffset.set(welcomeOffset.x+speed, welcomeOffset.y);\n }\n //If boxes reach next position, update position data and order\n } else {\n //Re-order paper images\n for (let i=0; i<order.length; i++) {\n order[i]--;\n if (order[i] < 0) {\n order[i] = 2;\n }\n }\n posOffset0.set(offsetX0, offsetY0);\n posOffset1.set(offsetX1, offsetY1);\n posOffset2.set(offsetX2, offsetY2);\n\n //Count number of sounds that have been played so far\n steps++;\n //Only update the welcome text position until it is moved to the right out of sight\n if (steps<3) {\n welcomeOffset.set(welcomeOffsetX + steps*(offsetX2-offsetX1), welcomeOffsetY);\n }\n\n //Update artist,drawing data and sound number\n lastPt = pt;\n lastPaths = paths;\n pt = nextPt;\n paths = []; \n lastSoundNumber = soundNumber;\n soundNumber = nextSoundNumber; //Get the number of the sound that has been selected\n\n nextSound = false; //nexSound flag set to false until next sound is selected\n newSound();\n }\n}", "function Box (tag) {\n var p2 = Point.set().pop();\n var p1 = Point.set().pop();\n \n if (tag && p1 && p2) {\n // Origin is the top-left corner of the box\n this.origin = new Point(Point.leftmost(p1, p2).x, Point.topmost(p1, p2).y);\n this.box_width = Point.rightmost(p1, p2).x - this.origin.x;\n this.box_height = Point.bottommost(p1, p2).y - this.origin.y;\n this.backing_element = new Element(tag, {\n 'left': this.origin.x,\n 'top': this.origin.y \n }, null, '#stage'\n );\n \n $(this.backing_element).width(this.box_width);\n $(this.backing_element).height(this.box_height); \n \n Box.active(this);\n Box.set().push(this); \n \n // The global set of keybindings is defined here\n Box.keys({\n // 'D'elete\n 100: function (e) {\n if (Box.active() && confirm('Delete the active box?')) {\n Box.active().destroy(); \n }\n }\n });\n } \n}", "function addBoxes() {\n var $boxColumn = $(\"<div class='boxColumn'></div>\");\n var $rbb = $(\"#removeBoxesButton\");\n for (var i = 0; i < 5; i++) {\n $boxColumn.append(\"<div class='box'></div>\");\n }\n $(\"#boxContainer\").append($boxColumn);\n if ( $rbb.attr(\"disabled\") === \"disabled\" ) {\n $rbb.attr(\"disabled\", false);\n }\n}", "function stackBoxes(n) {\n return n * n;\n }", "function adjustBoxes(boxes) {\n\t if (/^td$/i.test(element.tagName)) {\n\t var table = nodeInfo.table;\n\t if (table && getPropertyValue(table.style, \"border-collapse\") == \"collapse\") {\n\t var tableBorderLeft = getBorder(table.style, \"left\").width;\n\t var tableBorderTop = getBorder(table.style, \"top\").width;\n\t // check if we need to adjust\n\t if (tableBorderLeft === 0 && tableBorderTop === 0) {\n\t return boxes; // nope\n\t }\n\t var tableBox = table.element.getBoundingClientRect();\n\t var firstCell = table.element.rows[0].cells[0];\n\t var firstCellBox = firstCell.getBoundingClientRect();\n\t if (firstCellBox.top == tableBox.top || firstCellBox.left == tableBox.left) {\n\t return slice$1$1(boxes).map(function(box){\n\t return {\n\t left : box.left + tableBorderLeft,\n\t top : box.top + tableBorderTop,\n\t right : box.right + tableBorderLeft,\n\t bottom : box.bottom + tableBorderTop,\n\t height : box.height,\n\t width : box.width\n\t };\n\t });\n\t }\n\t }\n\t }\n\t return boxes;\n\t }", "function addBox() {\n // Create '.box' element\n const newDiv = document.createElement('div');\n newDiv.className = 'box';\n // Add '.box' element to 'body'\n $body.appendChild(newDiv);\n $boxes = document.querySelectorAll('.box');\n}", "function in_box(x, y, box) {\n return (\n x >= box.x - trial.box_linewidth &&\n x <= box.x + box.w + trial.box_linewidth * 2 &&\n y >= box.y - trial.box_linewidth &&\n y <= box.y + box.h + trial.box_linewidth * 2\n );\n }", "function printBox(i) {\n $(\"<div/>\", {\n id: \"box_\" + i,\n class: \"Box\"\n }).appendTo(\"#contenido\");\n}", "function makeEditBoxes(d){\r\n editingPic = d[5]\r\n editingPoly = -1;\r\n update();\r\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 }", "function mkBox(pts = [], dis = 20){\n\tlet boxes = [];\n\tif (pts && pts.length && pts.length >= 2){\n\t\tconst lls = pts.map((pt)=>new LatLng(pt[0],pt[1]));\n\t\tconst bounds = RouteBoxer.box(lls, dis);\n\t\tboxes = bounds.map((box)=>{\n\t\t //console.log(box)\n\t\t const {_southWest,_northEast} = box;\n\t\t return [[_southWest.lat,_southWest.lng],[_northEast.lat,_northEast.lng]]\n\t\t});\n\t}\n\treturn boxes\n}", "function makeBox (width, height) {\n var i\n var solid = repeatChar (width,\"*\")\n var top = \"\"\n var bottom = \"\"\n var middle = \"\"\n \n if (height>0){top = solid}\n if (height>1){bottom = \"\\n\" + solid}\n\n for (i=1; i<height-1; i++){\n middle = middle + \"\\n\" + \"*\" + repeatChar(width-2,\" \") + \"*\"\n }\n return top + middle + bottom\n}", "function DrawBox(SArray, n) {\n\tvar p1x;\n\tvar p1y;\n\tvar p2x;\n\tvar p2y;\n\tvar p3x;\n\tvar p3y;\n\tvar p4x;\n\tvar p4y;\n\tvar S = SArray[0].plasmidsize;\n\tvar fillred = Math.round(SArray[n].red / 100 * 255);\n\tvar fillgreen = Math.round(SArray[n].green / 100 * 255);\n\tvar fillblue = Math.round(SArray[n].blue / 100 * 255);\n\tvar stred = Math.round(SArray[0].fstrokered / 100 * 255);\n\tvar stgreen = Math.round(SArray[0].fstrokegreen / 100 * 255);\n\tvar stblue = Math.round(SArray[0].fstrokeblue / 100 * 255);\n\tvar Cx = SArray[0].ox;\n\tvar Cy = SArray[0].oy;\n\n\t//Direction: sense=0, antisense=1\n\tvar sense = 0;\n\tif (SArray[n].end < SArray[n].start) sense = 1;\n\t//sweep: <=half: 0, >half: 1\n\tvar sweep = 0;\n\tif (Math.abs(SArray[n].end - SArray[n].start) / S > 0.5) sweep = 1;\n\n\tvar Cmd = [];\n\tCmd[1] = newSVG(\"path\");\n\tp1x = Cx + SArray[0].ro * Math.sin(SArray[n].start / S * Math.PI * 2);\n\tp1y = Cy - SArray[0].ro * Math.cos(SArray[n].start / S * Math.PI * 2);\n\tp2x = Cx + SArray[0].ro * Math.sin(SArray[n].end / S * 2 * Math.PI);\n\tp2y = Cy - SArray[0].ro * Math.cos(SArray[n].end / S * 2 * Math.PI);\n\tp3x = Cx + SArray[0].ri * Math.sin(SArray[n].end / S * 2 * Math.PI);\n\tp3y = Cy - SArray[0].ri * Math.cos(SArray[n].end / S * 2 * Math.PI);\n\tp4x = Cx + SArray[0].ri * Math.sin(SArray[n].start / S * 2 * Math.PI);\n\tp4y = Cy - SArray[0].ri * Math.cos(SArray[n].start / S * 2 * Math.PI);\n\tvar Para = \"\";\n\tPara += 'M' + p1x + \",\" + p1y + \" A\" + SArray[0].ro + \",\" + SArray[0].ro + \" 0 \";\n\tCmd[0] += '<path d=\"M' + p1x + \",\" + p1y + \" A\" + SArray[0].ro + \",\" + SArray[0].ro + \" 0 \";\n\tif (sweep) {\n\t\tCmd[0] += \"1,\";\n\t\tPara += \"1,\";\n\t} else {\n\t\tCmd[0] += \"0,\";\n\t\tPara += \"0,\";\n\t};\n\tif (sense) {\n\t\tCmd[0] += \"0 \";\n\t\tPara += \"0 \";\n\t} else {\n\t\tCmd[0] += \"1 \";\n\t\tPara += \"1 \";\n\t};\n\tCmd[0] += p2x + \",\" + p2y;\n\tPara += p2x + \",\" + p2y;\n\tCmd[0] += \" L\" + p3x + \",\" + p3y;\n\tPara += \" L\" + p3x + \",\" + p3y;\n\tCmd[0] += \" A\" + SArray[0].ri + \",\" + SArray[0].ri + \" 0 \";\n\tPara += \" A\" + SArray[0].ri + \",\" + SArray[0].ri + \" 0 \";\n\tif (sweep) {\n\t\tCmd[0] += \"1,\";\n\t\tPara += \"1,\";\n\t} else {\n\t\tCmd[0] += \"0,\";\n\t\tPara += \"0,\";\n\t};\n\tif (sense) {\n\t\tCmd[0] += \"1 \";\n\t\tPara += \"1 \";\n\t} else {\n\t\tCmd[0] += \"0 \";\n\t\tPara += \"0 \";\n\t};\n\tCmd[0] += p4x + \",\" + p4y;\n\tPara += p4x + \",\" + p4y + \" z\";\n\tCmd[1].setAttribute(\"d\", Para);\n\tCmd[0] += ' z\" ' + 'fill=\"rgb(' + fillred + \",\" + fillgreen + \",\" + fillblue + ')\"' + ' stroke-width=\"' + SArray[0].fstrokewidth + '\" stroke=\"rgb(' + stred + \",\" + stgreen + \",\" + stblue + ')\"/> \\n';\n\tPara = \"rgb(\" + fillred + \",\" + fillgreen + \",\" + fillblue + \")\";\n\tCmd[1].setAttribute(\"fill\", Para);\n\tCmd[1].setAttribute(\"stroke-width\", SArray[0].fstrokewidth);\n\tPara = \"rgb(\" + stred + \",\" + stgreen + \",\" + stblue + \")\";\n\tCmd[1].setAttribute(\"stroke\", Para);\n\treturn (Cmd);\n}", "function dialogueBoxes(boxObj, string, leftOffset, topOffset, size, ctx, textColor) { \n button.render(boxObj)\n wrapText(\n ctx,\n string.toString(),\n boxObj.left + leftOffset,\n boxObj.top + topOffset,\n boxObj.right - boxObj.left - 30,\n 50,\n size,\n textColor\n );\n}", "function rc(){\n \n var boxes=document.getElementsByClassName('box');\n var tar=document.querySelectorAll('.it');\n \n let grid=[[tar[0],tar[1],tar[2],tar[3],tar[4]],\n [tar[5],tar[6],tar[7],tar[8],tar[9]],\n [tar[10],tar[11],tar[12],tar[13],tar[14]],\n [tar[15],tar[16],tar[17],tar[18],tar[19]],\n [tar[20],tar[21],tar[22],tar[23],tar[24]]\n ]\n\n for(let i=0;i<5;++i){\n for(let j=0;j<5;++j){\n if(grid[i][j]===ob1){\n x= [i , j ];}\n } \n } \n \n //var chk=document.querySelector('#empty');\n var chk=ob2;\n for(let i=0;i<5;++i){\n for(let j=0;j<5;++j){\n if(grid[i][j]===chk){\n y= [i , j ];} \n }\n }\n }", "function showAllBoxes() {\n\t$.each($images,function(index,value){\n\t\tvar url = \"Photos/Thumbnails/\" + this.name;\n\t\tvar $new_image = $(\"<div class='thumbnail'><img class='small-img \" + this.title + \"' src=\" + url + \"></div>\");\n\t\t$container.append($new_image);\n\t});\n\t$(\".small-img\").on(\"click\",clickOnThumbnail);\n}", "function Scoreboard(){\n this.sheet = document.getElementById(\"sheet\"); //get the sheet element, is the sheet just a white background. \n this.list = [];\n \n // Spawns the boxes\n this.setup = function(){\n \n // Create 10 boxes\n\n for(var i=0; i<9; i++){\n var box = this.createBox(); // Create an individual box\n this.list.push(box); // Add each box to the list\n this.sheet.appendChild(box); // Add each box to the sheet\n }\n\n var lastbox = this.CreateThirdBox(); // Create an individual box\n this.list.push(lastbox); // Add each box to the list\n this.sheet.appendChild(lastbox); // Add each box to the sheet\n /*\n <div id=\"screen>\n <div class=\"box\">\n <div class=\"indent\"></div>\n <div class=\"corner\"></div>\n <div class=\"bottom\"></div>\n </div>\n </div>\n */\n // We're basically doing this with javascript^\n };\n\n this.createBox = function(){\n var c = function(className){\n var element = document.createElement(\"div\"); //create a function so it is easier to create elements, not having to repeat code\n element.className = className; //asigns a new class,\n return element;\n };\n \n var box = c(\"box\"); //creates a new box\n var indent = c(\"indent\"); //references a div tag in the html\n var corner = c(\"corner\");\n var bottom = c(\"bottom\");\n \n // Add the elements to the box.\n box.appendChild(indent);\n box.appendChild(corner);\n box.appendChild(bottom);\n \n box.setIndent = function(str){ //maniipulates the text in the elements.\n indent.textContent = str;\n };\n box.setCorner = function(str){\n corner.textContent = str;\n };\n box.setBottom = function(str){\n bottom.textContent = str;\n };\n \n return box;\n };\n \n this.CreateThirdBox = function(){ //this is the last box in bowling, which pretty much changes a lot of the rules of the game..\n var e = function(className){\n var newElement = document.createElement(\"div\");\n newElement.className = className;\n return newElement;\n };\n\n var box = e(\"box-tenth\"); //creates a new box, you can make another box variable because it is in a different scope.\n \n var corner1 = e(\"corner-tenth\"); //creates it\n var corner2 = e(\"corner-tenth\"); //creates it\n var corner3 = e(\"corner-tenth\");\n \n var bottom = e(\"bottom\");\n\n\tbox.appendChild(corner1); //add it\n box.appendChild(corner2);\n box.appendChild(corner3);\n box.appendChild(bottom);\n\n box.setCorner1 = function(str){\n corner1.textContent = str;\n };\n box.setCorner2 = function(str){\n corner2.textContent = str;\n };\n box.setCorner3 = function(str){\n corner3.textContent = str;\n };\n box.setBottom = function(str){\n bottom.textContent = str;\n };\n \n return box;\n\n }\n\n\n}", "boxes() {\n return Game.find({}, { sort: { index: 1 } });\n }", "function moveBox(k){\n var id = k;\n //console.log(\"Inside move box!!: \"+id);\n //gameOver condition has to be fixed as \n //its not accurate condition for game over\n if( (players[id].bottomMostX == 1 || players[id].bottomMostX == 0) && checkOccupiedBlock(id) == true){\n gameOver(id);\n }\n else if(players[id].bottomMostX == gridHeight-1 || (checkOccupiedBlock(id)) == true){\n selectNextPiece(id);\n \n //for storing the shape data\n if(players[id].replayMode == false){\n //console.log(\"inside move box players[id].replayMode == false\");\n setTheAllShapesUsedInGame(id,players[id].shapeType,players[id].anyColor);\n }\n eraseNextShape(id);\n randomBlockGenerator(id);\n \n //for storing the next shape data\n if(players[id].replayMode == false){\n //console.log(\"inside move box players[id].replayMode == false\");\n setTheAllNextShapesUsedInGame(id,players[id].nextPiece,players[id].nextColor);\n }\n checkRowCompletion(id);\n moveShapeToInitialPos(id);\n moveNextShapeToInitialPos(id);\n colorNextShape(id);\n }\n \n else if((checkOccupiedBlock(id)) == false){\n makeBlockUnoccupied(id);\n eraseShape(id);\n moveShapeDown(id);\n makeBlockOccupied(id);\n colorTheShape(id);\n }\n }", "renderAllShapes( ) {\n for( var i = 0; i < 6; i++ ){ \n for(var k = 0; k < 3; k++ ) {\n this.renderShape( Piece.getRandom(), k*5, i*5 );\n }\n }\n }", "function clearBoxes() {\n progressMessage.setProgressMessage(\"clear bounding boxes\");\n if (boxpolys != null) {\n for (var i = 0; i < boxpolys.length; i++) {\n boxpolys[i].setMap(null);\n }\n }\n boxpolys = null;\n}", "function box (side) {\n for (var i = 0; i<4; i++) {\n forward( side)\n right( 90)\n }\n forward( side)\n right( 90)\n forward( side)\n}", "function populatePage() {\n var boxes = document.createDocumentFragment();\n\n for (var i=0; i < appdata.app_id.length; i++){\n var boxdiv = document.createElement('div');\n boxdiv.draggable = 'true';\n boxdiv.className = 'box';\n boxdiv.innerHTML = \"<a href=\\'\"+appdata.link[i]+\"\\'>\"+appdata.name[i]+\" (\" + appdata.description[i] + \")</a>\";\n boxdiv.style = 'background-color:'+appdata.color[i];\n boxes.appendChild(boxdiv);\n }\n var cont = document.getElementById('boxcontainer');\n cont.appendChild(boxes);\n }" ]
[ "0.7293411", "0.71446043", "0.7104251", "0.7024517", "0.69693756", "0.6845289", "0.67703927", "0.676199", "0.6760461", "0.67263126", "0.67184913", "0.67070764", "0.66976845", "0.66616493", "0.662293", "0.66206086", "0.6604009", "0.65959376", "0.6581031", "0.6576488", "0.65666574", "0.65627134", "0.6540541", "0.65328807", "0.65271044", "0.64806324", "0.6464543", "0.6463117", "0.6460195", "0.6454446", "0.64515686", "0.6445222", "0.6439621", "0.6428848", "0.64268845", "0.6407963", "0.6405623", "0.6401257", "0.6382684", "0.63810796", "0.6350127", "0.6338967", "0.63389456", "0.63321525", "0.63263893", "0.63156253", "0.62993574", "0.6291623", "0.6289492", "0.6278947", "0.6261691", "0.6256081", "0.62533504", "0.6226198", "0.62210745", "0.62095976", "0.6199381", "0.61968875", "0.6195773", "0.6182682", "0.617729", "0.616044", "0.6156751", "0.6136054", "0.6100733", "0.60934806", "0.608909", "0.60863376", "0.60758746", "0.60296357", "0.60220236", "0.60210544", "0.601829", "0.6015343", "0.6011186", "0.6009114", "0.60053617", "0.59925425", "0.5982798", "0.59800375", "0.5972947", "0.59727937", "0.5970066", "0.5963864", "0.5961563", "0.59595543", "0.5952091", "0.59491944", "0.5947833", "0.59466475", "0.5934232", "0.5928531", "0.59234285", "0.59217626", "0.5917343", "0.59112024", "0.5906913", "0.5906685", "0.5906676", "0.5903947", "0.59019876" ]
0.0
-1
this.props.whichActive will tell indexContainer which to display
constructor(props) { super(props); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isActive(index) {\n return this.indexStart === index ? \"active\" : \"\";\n }", "_isActive(index,active){return index===active}", "isActive(index){\n if(this.currentIndex === index) {\n return \"active\"\n } return \" \";\n //scritta in ternario\n // return this.currentIndex === index ? \"active\" : \" \";\n }", "setActiveIndex(index, url_title) {\r\n this.setState({ activeIndex: index });\r\n }", "isActive(pane) {\n return this.props.whichPaneActive == pane ? 'active' : '';\n }", "isActive (key) {\n return this.props.selected === key\n }", "get activeItemIndex() {\n return this._activeItemIndex;\n }", "get activeItemIndex() {\n return this._activeItemIndex;\n }", "get activeItemIndex() {\n return this._activeItemIndex;\n }", "get activeItemIndex() {\n return this._activeItemIndex;\n }", "changePageActive(index) {\r\n this.setState({pageActive: index});\r\n }", "activeListNode(index) {\n for (let i = 0; i < this.queryItems.length; i++) {\n if (index === i) {\n this.queryItems[i].active = true;\n this.selectedDataIndex = index;\n }\n else {\n this.queryItems[i].active = false;\n }\n }\n }", "activate() {\n this.parent.activeLayerIndex = this.index;\n }", "function getCurrentIndex() {\n console.log(\"slideshow.currentIndex\");\n for ( let i = 0, n = slides.length; i < n; i++ ) {\n if ( slides[i].classList.contains(\"active\") ) {\n return i;\n }\n }\n }", "activeSelect(e,itemIndex) {\n this.state.active === itemIndex ? \n this.setState({active: null}) : \n this.setState({active: itemIndex})\n }", "get selectedIndex() {\n var tree = this.getElement({type: \"engine_list\"});\n var treeNode = tree.getNode();\n\n return treeNode.view.selection.currentIndex;\n }", "_setNextActive() {\n let nextActive = this.state.activeIndex + 1;\n\n if (nextActive >= this.props.data.length) {\n nextActive = 0;\n }\n\n this.setState({\n activeIndex: nextActive,\n direction: 'left'\n });\n }", "setActive(number, collections){\n if (this.state.selected===number) {\n number=null\n }\n this.state.selected = number;\n // let activeCollection = this.state.collections[number];\n //this.state.activeCollection = collections[number];\n this.setState({\n selected: number,\n activeCollection: this.state.collections[number],\n renderCollections: this.renderCollections(this.state.collections)\n })\n }", "checkActivePage() {\n console.log('Active Page: ' + this.props.activePageNum);\n if (this.props.pageIndex === this.props.activePageNum) return 'active';\n else return '';\n }", "function getActiveSectionIndex() {\n var activeIndex = void 0;\n _elements.sections.forEach(function (section, index) {\n if (section.classList.contains('active')) {\n activeIndex = index;\n }\n });\n return activeIndex;\n}", "activatePanel(index) {\n\t\tthis.setState((prev) => ({\n\t\t\tactivePanel: prev.activePanel === index ? -1 : index,\n\t\t}));\n\t}", "get activeRowIndex() {\n return this._activeRowIndex;\n }", "focusActiveElement() {\n const instance = this;\n focusmanager.setFocus({\n component: instance,\n index: instance.state.index,\n transitionTime: instance.props.transitionTime\n });\n }", "viewOnClick () {\n this.setState({ viewActive: this.state.viewActive === 'list' ? 'grid' : 'list' })\n }", "getCurrentIndex() {\n const index = this.filteredAppButtonList.indexOf(\n this.currentButtonFocused\n );\n if (index < 0 || index > this.maxIndex) {\n this.highlightInitialButton();\n }\n return index;\n }", "function getCurrentIndex() {\n\t\treturn currentIndex;\n\t}", "openMenù(index){\r\n (this.counter == index) ? this.counter = null : this.counter = index; \r\n }", "toggle(index) {\r\n if (this.state.active === index) {\r\n this.setState({active: null})\r\n } else {\r\n this.setState({active: index})\r\n }\r\n }", "onSelectChangeIndex(index) {\n // setting the state to the index of the user click\n this.setState({\n selected_index: index,\n })\n }", "function GetDisplayIndex()\n{\n return actualDisplayIndex;\n}", "render() {\n return (\n <div className=\"part1\">\n <div>\n {this.props.index+1})\n </div>\n </div>\n )\n }", "questionSelect(val,index){\n console.log(val + index);\n this.state.isResponseVisible = val;\n if(index)\n this.state.currentIndex = index;\n this.setState({});\n }", "handleClick(event){\n this.props.handleClick(this.props.index);\n }", "switchSelected(index) {\n\n if (typeof index == 'number') {\n this.current = index;\n return;\n }\n\n let nextInd = travelArray(this.items, this.current);\n\n if (this.items[nextInd].hidden)\n nextInd = travelArray(this.items, nextInd)\n\n this.current = nextInd;\n }", "selectIndex(ct) {\n this.props.onChangeHighlightedItem(this.state.items[ct]); // fire a callback\n this.setState({selectedIndex: ct}); // update the state for real\n }", "get index() { return this._index; }", "getIndex() {\nreturn this.index;\n}", "function index(event) {\n current.win.style.zIndex = Math.floor(new Date().getTime()/1000);\n }", "clicked(index){\r\n this.indice = index;\r\n }", "function getIndex() {\n return internal.index;\n }", "_getFocusIndex() {\n return this._keyManager ? this._keyManager.activeItemIndex : this._selectedIndex;\n }", "getComponent(id) { return this.childIndex.getItem(id) }", "activateNextPanel(index) {\n\t\tthis.setState((next) => ({\n\t\t\tactivePanel: next.activePanel === index ? +1 : index,\n\t\t}));\n\t}", "get focusIndex() {\n return this.keyManager ? this.keyManager.activeItemIndex : 0;\n }", "activePrevSlider(){\n if(this.index.prev !== undefined){\n this.changeSlide(this.index.prev)\n }\n }", "constructor(props) {\n super(props)\n /* FivestarHeader Component State variables Initialization */\n this.state = {\n activeIndex: 0\n }\n \n }", "constructor(props) {\n super(props)\n /* FivestarHeader Component State variables Initialization */\n this.state = {\n activeIndex: 0\n }\n \n }", "_setPrevActive() {\n let nextActive = this.state.activeIndex - 1;\n\n if (nextActive < 0) {\n nextActive = this.props.data.length - 1;\n }\n\n this.setState({\n activeIndex: nextActive,\n direction: 'right'\n });\n }", "onRowClick({ index }) {\n const { expandedHeight } = this.props;\n const { openIndex } = this.state;\n const selectedIndex =\n expandedHeight && index === openIndex ? undefined : index;\n this.setState({ openIndex: selectedIndex });\n }", "updateIndex(){\n this.props.updateIndex(this.props.currentState.index + 10);\n this.props.removeAllStoriesFromSelection(true); // This is done to ensure that there are no selected stories when we go to the next set of stories\n this.props.toggleLoader(true); // Show the loader again, since the new set of stories will be fetched from the api\n this.props.setLoaderText('Fetching stories');\n }", "get current(){\n return this._accordion.openedIndexes.map( index => {\n return {\n header: this._accordion.headers[ index ],\n panel: this._accordion.panels[ index ]\n };\n });\n }", "indexCallback(indx){\n // console.log(\"callback index \", indx);\n this.props.updateRenderDrip(indx);\n }", "onclickAnswer(index){\n this.props.selected(index);\n this.props.next();\n }", "highlight(index) {\r\n if (this.state.active === index) {\r\n return \"#f5f5f5\";\r\n }\r\n return \"\";\r\n }", "getIndexByClass(list){\n\t\tfor (var i=0;i<list.length;i++){\n\t\t\tif (list[i].className === \"active\"){\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\n\t}", "function read (index) {\n var idx = (index !== undefined) ? index : element.puiaccordion('getActiveIndex');\n scope[attrs.puiAccordion].activeIndex = idx;\n }", "function getRawActiveLayerIndex()\n{\n var ref = new ActionReference();\n ref.putProperty( classProperty, keyItemIndex );\n ref.putEnumerated( classLayer, typeOrdinal, enumTarget );\n var resultDesc = executeActionGet( ref );\n return resultDesc.getInteger( keyItemIndex ) - 1;\n}", "get contextIndex() {\r\n if (this._contextIndex < 0) {\r\n this._contextIndex = this.add(staticProperty(\"Current\", \"{3747adcd-a3c3-41b9-bfab-4a64dd2f1e0a}\", \r\n // actions\r\n objectPath()));\r\n }\r\n return this._contextIndex;\r\n }", "activeNextSlider(){\n if(this.index.next !== undefined){\n this.changeSlide(this.index.next)\n }\n }", "setIndexCallback () {\n if (this.props.callback) {\n this.props.callback(this.state.currentIndex)\n }\n }", "function hendleClick (index) {\n //console.log('hendleClick HeaderMenu' + index);\n let tempMenu = menu.map((item) => {\n return {title: item.title, active: false};\n });\n tempMenu[index].active = true;\n //console.log('tempMenu' + tempMenu);\n setMenu(tempMenu);\n }", "render() {\n const { thumbNail, index, currentImageIndex, thumbnailClick } = this.props;\n if (index === currentImageIndex) {\n return (\n <div className=\"carouselSidebarThumbnail\">\n <img\n src={thumbNail}\n alt={index}\n className=\"carouselThumbnail\"\n id=\"selectedCarouselThumbnail\"\n />\n </div>\n );\n }\n return (\n <div className=\"carouselSidebarThumbnail\">\n <img\n src={thumbNail}\n alt={index}\n className=\"carouselThumbnail\"\n onClick={thumbnailClick}\n />\n </div>\n );\n }", "function setActiveIDX(aID){\r\n\tactiveID = aID;\r\n\tformID = aID;\r\n}", "getExpandedIndex() {\n return this.state.activeSubMenuIndex;\n }", "get selectedIndex() {\n let selectedElement = this._widget.selectedItem;\n if (selectedElement) {\n return this._indexOfElement(selectedElement);\n }\n return -1;\n }", "handleRowHover(index) {\n this.setState({\n currentActive: index\n });\n }", "selectIndex(state) {\n let index = state.playerList.findIndex((item, index) => {\n return item.id === state.mediaUrlId;\n })\n return index;\n }", "function getSelectedIndex(idx) {\n return selectedIndex;\n }", "get activeSectionIndex() {\n if (!this.activeSection) {\n return null;\n }\n return this.sections.indexOf(this.activeSection);\n }", "function PageIndex(props)\n{\n const { page, indexStyles } = props;\n const indexClass = page.smallIndex ? \"halfscreen\" : \"fullscreen\";\n\n return (\n <div className={indexClass}>\n { page.index.map((item, itemIndex) => \n <PageIndexElement \n key={itemIndex} \n onFadeOut={props.onFadeOut}\n onClick={props.onClick} \n index={itemIndex} \n item={item} \n style={indexStyles[itemIndex]} />)}\n </div>\n )\n\n}", "_handleActiveSlide(activeSlide, index) {\n let activeSlideArr = this.state.activeSlide;\n activeSlideArr[index] = activeSlide;\n this.setState({\n activeSlide: activeSlideArr,\n });\n }", "_changeActive(index){\n /*remove active class from carousel items*/\n $(this._items).removeClass(this._states.isCurrentItemClass);\n $(this._jumps).removeClass(this._states.isCurrentJumpClass);\n /*target new item*/\n let itemSelector = `${this._elementSelectors.item}[${this._itemIndexAttr}=${index}]`;\n let newItem = this._carousel.find(itemSelector);\n /*target new active jump control*/\n let jumpSelector = `${this._controlSelectors.jump}[${this._itemIndexAttr}=${index}]`;\n let newJump = this._carousel.find(jumpSelector);\n /*add active class to current carousel elements*/\n $(newItem).addClass(this._states.isCurrentItemClass);\n $(jumpSelector).addClass(this._states.isCurrentJumpClass);\n /*set new index*/\n this._currentItem = index;\n }", "function getActiveImgIndex() {\n var currentImgId = $('.slide.slide-bg-selected > .slide-img').attr('id');\n var index = parseInt(currentImgId.replace(/^img_/, ''), 10);\n\n return index; \n }", "get focusIndex() {\n return this._keyManager ? this._keyManager.activeItemIndex : 0;\n }", "openLightBox(){\n this.props.openLightBox(this.props.index)\n }", "get active() { return this._isActive; }", "get index() {\r\n return this.i.index;\r\n }", "highlightComponent(keyCode) {\n let items = document.getElementsByClassName('list-item');\n items = Array.prototype.slice.call(items,0);\n let activeItem = document.getElementsByClassName(\"activeItem\");\n let itemIndex = null, newId = null, newItem = null;\n let {entities} = this.state;\n let newName = '';\n if(items.length > 0) {\n switch(keyCode) {\n case 40: //Down Arrow Key\n if(activeItem.length > 0) {\n itemIndex = items.findIndex((o)=>{return parseInt(o.getAttribute(\"data-id\"), 10) === parseInt(activeItem[0].getAttribute(\"data-id\"), 10);});\n if(itemIndex < (items.length - 1)) { //make next component active\n newId = parseInt(items[itemIndex + 1].getAttribute(\"data-id\"), 10);\n newItem = entities.find((o)=>{return o.id === newId;});\n } else {\n newId = parseInt(items[0].getAttribute(\"data-id\"), 10);\n newItem = entities.find((o)=>{return o.id === newId;});\n }\n } else { //make first component active if no active item present\n newId = parseInt(items[0].getAttribute(\"data-id\"), 10);\n newItem = entities.find((o)=>{return o.id === newId;});\n }\n if(newItem.subType === 'CUSTOM') {\n let config = newItem.topologyComponentUISpecification.fields,\n name = _.find(config, {fieldName: \"name\"});\n newName = name ? name.defaultValue : 'Custom';\n } else {\n newName = newItem.name;\n }\n if(this.refs.searchInput) {\n this.setState({activeComponentId: newId, activeComponentName: newName});\n }\n break;\n case 38: //Up Arrow Key\n if(activeItem.length > 0) {\n itemIndex = items.findIndex((o)=>{return parseInt(o.getAttribute(\"data-id\"), 10) === parseInt(activeItem[0].getAttribute(\"data-id\"), 10);});\n if(itemIndex > 0) { //make next component active\n newId = parseInt(items[itemIndex - 1].getAttribute(\"data-id\"), 10);\n newItem = entities.find((o)=>{return o.id === newId;});\n } else {\n newId = parseInt(items[items.length - 1].getAttribute(\"data-id\"), 10);\n newItem = entities.find((o)=>{return o.id === newId;});\n }\n } else {//make first component active if no active item present\n newId = parseInt(items[0].getAttribute(\"data-id\"), 10);\n newItem = entities.find((o)=>{return o.id === newId;});\n }\n if(newItem.subType === 'CUSTOM') {\n let config = newItem.topologyComponentUISpecification.fields,\n name = _.find(config, {fieldName: \"name\"});\n newName = name ? name.defaultValue : 'Custom';\n } else {\n newName = newItem.name;\n }\n if(this.refs.searchInput) {\n this.setState({activeComponentId: newId, activeComponentName: newName});\n }\n break;\n }\n }\n }", "function GridControlGetIndex() {\n this.index = this.object.selectedIndex; //get prior selection\n return this.index;\n}", "get activeColumnIndex() {\n return this._activeColumnIndex;\n }", "toggleClass(index) {\n this.setState({ activeIndex: index });\n this.props.onCallBack(index);\n }", "getComponent(index)\n {\n return this.component_list[index];\n }", "getNextindex() {\n return this.state.index+this.state.loadNumber;\n }", "function getCurrentIndex () {\n let currentClass = $(\"#main-wrapper\").attr(\"class\");\n\n cocktailList.each(function( ) {\n if( $(this).attr(\"class\") === currentClass ) {\n current = $(this).index();\n }\n });\n}", "render() {\n let { select_id, items } = this.props\n console.log(\"select_id \" + select_id);\n return (\n <div className={styles.main}>\n {items.map(item => {\n return (\n <div key={item.id} className={styles.text_main}>\n <div onClick={() => { this.showCmp(item.id) }}\n className={styles.text_css}>{item.name}</div>\n {this.props.select_id==item.id?<div className={styles.line} />:null}\n </div>)\n })}\n </div>\n )\n }", "componentWillMount() {\n React.Children.forEach(this.props.children, (child, index) => {\n if (index !== 0 && child.props.selected) {\n this.setState(() => ({selectedTabIdx: index}));\n }\n });\n }", "onTabChange(e, { activeIndex }) {\n this.setState({ activeIndex });\n }", "_getIndex(isNextSlide) {\n\t\t\t\tlet currentIndex = this.indexOf(this.getCurrentModel());\n\n\t\t\t\treturn isNextSlide ? currentIndex === this.length - 1 ? 0 : ++currentIndex : currentIndex === 0 ? this.length - 1 : --currentIndex;\n\t\t\t}", "minIndex () {\n\t\treturn this.stage.getChildIndex( this.background );\n\t}", "get index() {\n\t\treturn this.__index;\n\t}", "function clickPiece(e){\t\t\n\tif(activePiece != -1)\n\t\tpieces[activePiece].classList.toggle('active');\n\te.currentTarget.classList.toggle('active');\n\tactivePiece = e.currentTarget.dataset.index;\n\tconsole.log(activePiece);\n}", "handleClick() {\n const currentIndex = this.adapter_.getFocusedElementIndex();\n\n if (currentIndex === -1) return;\n\n this.setSelectedIndex(currentIndex);\n }", "get index() {\n\t\treturn parseInt(this.getAttribute('index'));\n\t}", "function queueComponentIndexForCheck() {\n if (firstTemplatePass) {\n (tView.components || (tView.components = [])).push(previousOrParentTNode.index);\n }\n}", "prev() {\n const {active} = this.props.store\n\n this._setActive(active > 0 ? active - 1 : 0)\n }", "prev() {\n const {active} = this.props.store\n\n this._setActive(active > 0 ? active - 1 : 0)\n }", "render() {\n let slides;\n let current = this.props.slide\n let qqLength = this.props.data.length\n let checkout = false;\n if (current === qqLength-1) { checkout = true}\n\n slides = this.props.data.map((slide, index) => {\n let isActive = current == index;\n return (\n <Slide getOption={this.props.getOptions}\n checkOut={this.props.checkOut}\n active={isActive} ident={slide.id} key={slide.id} label={slide.label} before={slide.image_before} after={slide.image_after} description={slide.product_description} options={slide.options} checkout={checkout} />\n\n )})\n return (\n <div className=\"slides\">\n {slides}\n </div>\n );\n }", "function setActiveToIndexBtn(index) {\n if (btns.length > 0) {\n for (var i = 0; i < btns.length; i++) {\n btns[i].classList.remove('selected');\n }\n if (btns.length == 1) {\n index = 0\n }\n btns[index].classList.add('selected');\n }\n}", "getCurrentIndexTabControl(target) {\n let ele;\n let cindex = 0;\n let currentIndex = -1;\n const tabsControl = this.getElementsBySelector(this.selectorTabsControl);\n const tabs = this.getArrayFromNodeList(tabsControl);\n tabs.map(tabControl => {\n ele = tabControl.querySelector(TAB_TITLE_CLASS);\n if (ele.isEqualNode(target)) {\n currentIndex = cindex;\n }\n cindex = cindex + 1;\n });\n return currentIndex;\n }", "displayCompoundTypes(e) {\n this.setState({ menuPosition: e.currentTarget })\n }", "goToSelectedImage (index) {\n this.setState({\n currentImage: index,\n });\n }" ]
[ "0.7032529", "0.6807644", "0.65913194", "0.6589763", "0.6555256", "0.6506908", "0.63807774", "0.63807774", "0.63807774", "0.63489145", "0.6299889", "0.6295473", "0.62571865", "0.62223935", "0.6155405", "0.60720724", "0.6071895", "0.6049608", "0.6026485", "0.60120606", "0.601137", "0.59965706", "0.5985458", "0.5959425", "0.59493524", "0.5934892", "0.5921946", "0.5921895", "0.590945", "0.59013754", "0.58479035", "0.584778", "0.58366686", "0.5802333", "0.58010113", "0.57995415", "0.5793725", "0.5789053", "0.578808", "0.5777095", "0.57605624", "0.57506853", "0.5742812", "0.5742349", "0.5726042", "0.57142925", "0.57142925", "0.5713242", "0.57122624", "0.56879383", "0.56873286", "0.5685321", "0.56827277", "0.5682289", "0.56775653", "0.56699336", "0.56662565", "0.5652921", "0.5642971", "0.56399584", "0.56374025", "0.5628299", "0.5610617", "0.5604942", "0.560025", "0.5596988", "0.55953354", "0.55918205", "0.55889946", "0.5588182", "0.55832654", "0.5581946", "0.55787027", "0.5576658", "0.5575981", "0.55715257", "0.5559337", "0.5536926", "0.55369127", "0.5533177", "0.55315685", "0.5520326", "0.55180264", "0.5503706", "0.55022806", "0.5496304", "0.54948187", "0.549063", "0.5487274", "0.54784304", "0.54714435", "0.54661524", "0.5463673", "0.5459725", "0.5458699", "0.5458699", "0.5449486", "0.54488254", "0.5448409", "0.5442633", "0.5438549" ]
0.0
-1
APP DASHBOARDS Facebook: Google: GitHub:
loginCallback(err) { if(err) { console.log(err); alert(err.message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function social_share(network)\n{\n var intent;\n switch (network)\n {\n case 'diaspora':\n intent = 'https://sharetodiaspora.github.io/?title=Look%20at%20this%20OpenBeerMap!&url=';\n break;\n case 'twitter':\n intent = 'https://twitter.com/intent/tweet?text=Look%20at%20this%20OpenBeerMap!&hashtags=openbeermap,beer,osm&url='\n break;\n case 'facebook':\n intent = 'https://www.facebook.com/sharer/sharer.php?p[url]=';\n break;\n default:\n return false;\n }\n window.location.assign(intent + document.URL);\n}", "function run() {\n var service = getService();\n if (service.hasAccess()) {\n\n var url = 'https://graph.facebook.com/v2.6/me/accounts?';\n\n var response = UrlFetchApp.fetch(url, {\n headers: {\n 'Authorization': 'Bearer ' + service.getAccessToken()\n }\n });\n var result = JSON.parse(response.getContentText());\n Logger.log(JSON.stringify(result , null, 2));\n } else {\n var authorizationUrl = service.getAuthorizationUrl();\n\n Logger.log('Open the following URL and re-run the script: %s',authorizationUrl);\n \n\n\n}}", "function linkshare() {\r\n fx('pageUrl').fadeIn(250);\r\n fx('bg2').fadeIn(500);\r\n if (!channel.id || !location.hash.split('#!/')[1])changeText(doc.q('#pageUrl input'),'https://youcount.github.io/');\r\n}", "openAppUrl(url) {\n // check url, get item id\n let info = new URL(url, true);\n info.id = info.query.id;\n\n // tmall: first check tmall client, then check taobao client\n if (info.host == \"detail.tmall.com\") {\n // check tmall client\n let appURL = \"tmall://page.tm/itemDetail?itemId=\" + info.id;\n Linking.canOpenURL(appURL).then(supported => {\n if (supported) {\n Linking.openURL(appURL);\n } else {\n // check taobao client\n appURL = \"taobao://item.taobao.com/item.htm?id=\" + info.id;\n Linking.canOpenURL(appURL).then(supported => {\n if (supported)\n Linking.openURL(appURL);\n else\n Linking.openURL(url);\n }).catch(error => { Linking.openURL(url) });\n }\n }).catch(error => { Linking.openURL(url) });\n }\n // taobao\n else if (info.host == \"item.taobao.com\") {\n let appURL = \"taobao://item.taobao.com/item.htm?id=\" + info.id;\n Linking.canOpenURL(appURL).then(supported => {\n if (supported)\n Linking.openURL(appURL);\n else\n Linking.openURL(url);\n }).catch(error => { Linking.openURL(url) });\n }\n // jingdong\n else if (info.host == \"item.jd.com\") {\n let jdInfo = url.match(/\\/[0-9]{1,}\\.html/);\n if (jdInfo && jdInfo[0]) {\n jdInfo = jdInfo[0].match(/\\d+/);\n\n let appURL = 'openapp.jdmobile://virtual?params={\"category\":\"jump\",\"des\":\"productDetail\",\"skuId\":\"' + jdInfo[0] + '\",\"sourceType\":\"homefloor\",\"sourceValue\":\"4384\", \"landPageId\":\"jshop.cx.mobile\"}';\n Linking.canOpenURL(appURL).then(supported => {\n if (supported)\n Linking.openURL(appURL);\n else\n Linking.openURL(url);\n }).catch(error => { Linking.openURL(url) });\n }\n } else {\n Linking.openURL(url);\n }\n return;\n //this.openApp(\"com.taobao.taobao\", \"com.taobao.tao.detail.activity.DetailActivity\", url);\n //Linking.openURL(\"tmall://page.tm/itemDetail?itemId=18212959600\");\n //Linking.openURL('openapp.jdmobile://virtual?params={\"category\":\"jump\",\"des\":\"productDetail\",\"skuId\":\"3129320\",\"sourceType\":\"homefloor\",\"sourceValue\":\"4384\", \"landPageId\":\"jshop.cx.mobile\"}');\n //Linking.openURL(\"taobao://item.taobao.com/item.htm?id=18212959600\");\n }", "function STXSocial(){\n\t\t}", "function openApp() {\n\tconst apps = [\"music://\", \"spotify://\", \"youtube://\", \"pcast://\", \"soundcloud://\"];\n\twindow.location = apps[config.chosenApp];\n}", "function shareToFacebook(){\n var url = window.location.host + vm.url;\n fb_publish(vm.title, vm.detail, url , vm.imgsrc);\n }", "function facebookLink() {\n window.open(\"https://www.facebook.com/sharer/sharer.php?u=https://blackfemaleinventors.netlify.com/\", \" \", \"width=500,height=500\");\n}", "function updateHistory() {\n \n var ottPlatforms = ['netflix', 'hotstar', 'primevideo', 'sonyliv'];\n\tfor(var i=0;i<4;i++){\n\t chrome.history.search({\n\t \t'text': ottPlatforms[i],\n\t \tmaxResults: 10\n\t }, function(historyItems) {\n\t for (var i = 0; i<historyItems.length&&i<10;++i) {\n\t \tconsole.log(historyItems[i].url);\n\t }\n\t });\n }\n}", "function onShare(args) {\n if (app.android) {\n socialShare.shareText(\"Download the official TSS Announcements App. Available now at: https://play.google.com/store/apps/details?id=ca.tssappclub.tssannouncements&hl=en and https://itunes.apple.com/ca/app/tss-announcements/id1271411385?mt=8\");\n } else if (app.ios) {\n socialShare.shareText(\"Download the official TSS Announcements App. Available now at: https://play.google.com/store/apps/details?id=ca.tssappclub.tssannouncements&hl=en and https://itunes.apple.com/ca/app/tss-announcements/id1271411385?mt=8\");\n }\n}", "function facebookShare(type){ \r\n jQuery('#sonnyGif').attr('onclick', 'analytics(\"facebook_share\")').click();\r\n if(type == 'finished'){\r\n var msg = 'I finished the 10 day compassion challenge! That\\'s 5 acts of kindness in 5 days! Try it now';\r\n }\r\n else{\r\n msg = jQuery('.taskDetail'+ type +' .kindnessTxt').text();\r\n }\r\n FB.ui({\r\n quote: msg,\r\n hashtag: '#kindness',\r\n method: 'share',\r\n mobile_iframe: true,\r\n href: 'http://thekindnessapp.com',\r\n }, function(response){});\r\n }", "function SocialAccountLinkModule(){}", "function socialClick(share){\r\n\tvar link = share.getAttribute(\"data-dash-href\");\r\n\twindow.open(link);\r\n}", "function getHuntlyUrl() {\n // var currentTime = getCurrentTime();\n // var currentDay = currentTime.getDay();\n var contestId = 340;//contestIdMapping[currentDay];\n if (contestId) {\n return null; //'https://srv.huntlyapp.com/deployments/' + deploymentId + '/leaderboards/' + contestId + '/topten ';\n } else {\n return null;\n }\n }", "onShareAppMessage() {\n\n }", "function getAppLinkIntentFilterData(preferences) {\n const intentFilterData = [];\n const linkDomains = [...preferences.androidLinkDomain, ...preferences.linkDomain];\n\n for (let i = 0; i < linkDomains.length; i++) {\n const linkDomain = linkDomains[i];\n\n // app.link link domains need -alternate associated domains as well (for Deep Views)\n if (linkDomain.indexOf(\"app.link\") !== -1) {\n const first = linkDomain.split(\".\")[0];\n const rest = linkDomain\n .split(\".\")\n .slice(1)\n .join(\".\");\n const alternate = `${first}-alternate` + `.${rest}`;\n\n intentFilterData.push(getAppLinkIntentFilterDictionary(linkDomain));\n intentFilterData.push(getAppLinkIntentFilterDictionary(alternate));\n } else {\n // bnc.lt\n if (\n linkDomain.indexOf(\"bnc.lt\") !== -1 &&\n preferences.androidPrefix === null\n ) {\n throw new Error(\n 'BRANCH SDK: Invalid \"android-prefix\" in <branch-config> in your config.xml. Docs https://goo.gl/GijGKP'\n );\n }\n intentFilterData.push(\n getAppLinkIntentFilterDictionary(\n linkDomain,\n preferences.androidPrefix\n )\n );\n }\n }\n\n return intentFilterData;\n }", "function get_idfacebook_from_url() {\n\n adverra_id_extractor();\n function adverra_id_extractor() {\n text = '';\n // iziToast.info({\n // title: 'รอสักครู่',\n // position: 'topCenter',\n // timeout: 2000,\n // message: 'กำลังเช็ค ID...',\n // });\n\n\n // original_url = $('#adverra_id_extractor_url').val();\n // original_url = `https://www.facebook.com/DevasBrightmoon/videos/171934840819450/?v=171934840819450`;\n // original_url = `https://www.facebook.com/pg/ETD.ERRORTODAY`;\n original_url = `https://www.facebook.com/groups/dmts.g/permalink/2177334155612192/`;\n url = original_url;\n var url_process = url.match(/([a-z]+\\:\\/+)([^\\/\\s]*)([a-z0-9\\-@\\^=%&;\\/~\\+]*)[\\?]?([^ \\#]*)#?([^ \\#]*)/ig);\n if (url_process) {\n\n url = url.replace(\"https\\:\\/\\/\", \"\").replace(\"http\\:\\/\\/\", \"\").replace(\"\\:\\/\\/\", \"\");\n url = url.split(\"\\/\");\n if (url[0].match(\".facebook.com\")) {\n if (url[1].split(\"?\")) {\n if (url[1] && url[1] != \"\") {\n\n\n /////////////////////////////////////////\t \n var url_array_collect = [];\n for (temp_var = 1; url[temp_var]; temp_var++) {\n console.log(\"url[\" + temp_var + \"]=\" + url[temp_var].split(\"\\?\")[0]);\n if (url[temp_var].split(\"\\?\")[0] && url[temp_var].split(\"\\?\")[0] != \"\") {\n url_array_collect.push(url[temp_var].split(\"\\?\")[0]);\n }\n if (url[temp_var].split(\"\\?\")[1] && url[temp_var].split(\"\\?\")[1] != \"\") {\n var location_search = \"\\?\" + url[temp_var].split(\"\\?\")[1];\n }\n }\n\n\n var post_id = getParam('fbid', location_search);\n\n var set = getParam('set', location_search);\n var story_fbid = getParam('story_fbid', location_search);\n var account_id = getParam('id', location_search);\n //to detect facebook notes\n if (url[1] == \"notes\") {\n if (!isNaN(url[4])) {\n title = \"Note ID\";\n console.log(title + \"=\" + url[4]);\n append_html_code(title, url[4]);\n }\n if (!isNaN(url[3])) {\n title = \"Note ID\";\n console.log(title + \"=\" + url[3]);\n append_html_code(title, url[3]);\n }\n }\n if (account_id) {\n if (!isNaN(account_id)) {\n title = \"Account ID\";\n console.log(title + \"=\" + account_id);\n append_html_code(title, account_id);\n }\n }\n if (story_fbid) {\n if (!isNaN(story_fbid)) {\n title = \"Post ID\";\n console.log(title + \"=\" + story_fbid);\n append_html_code(title, story_fbid);\n }\n }\n if (post_id != \"\") {\n var photo_post_id = post_id;\n if (!isNaN(photo_post_id)) {\n title = \"Post ID/Photo ID:\";\n types = '2';\n }\n append_html_code(title, photo_post_id);\n }\n if (set) {\n set = set.split(\".\");\n if (set) {\n var account_id = set[3];\n if (!isNaN(account_id)) {\n title = \"Account ID:\";\n console.log(title + \"=\" + account_id);\n append_html_code(title, account_id);\n }\n }\n }\n //extract account id from https://www.facebook.com/profile.php?id=100009125604149\n if (original_url.match(\"profile\\.php\")) { }\n if (original_url.match(\"\\/photos\\/\")) {\n splited = original_url.split(\"/\");\n photo_id = splited[splited.length - 2];\n if (!isNaN(photo_id)) {\n title = \"Photo ID:\";\n console.log(title + \"=\" + photo_id);\n append_html_code(title, photo_id);\n }\n }\n console.log(url_array_collect);\n extraction_process_url_params(url_array_collect);\n\n\n\n\n\n\n /////////////////////////\t \n\n\n\n }\n else {\n\n\n console.log('เกิดข้อผิดพลาด', 'ไม่สามารถดึง ID กรุณากรอก URL อื่น', 'error');\n\n\n }\n }\n }\n else {\n\n console.log('เกิดข้อผิดพลาด', 'URL ที่ใส่ ต้องเป็น URL ของ Facebook', 'error');\n }\n }\n else {\n\n console.log('นี่ไม่ใช่ URL ', 'กรุณากรอก URL ของ Facebook', 'error');\n\n }\n\n\n }\n\n\n\n\n\n\n\n function extract_page_id(page_id) {\n if (!isNaN(page_id)) {\n console.log(\"page id=\" + page_id);\n title = \"Page id:\";\n append_html_code(title, page_id);\n } else {\n alert(\"URL is tampered.\");\n }\n }\n function extract_post_id(post_id) {\n if (!isNaN(post_id)) {\n console.log(\"post_id=\" + post_id);\n title = \"Post id:\";\n append_html_code(title, post_id);\n } else {\n alert(\"URL is tampered.\");\n }\n }\n function event_post_id_append(post_id) {\n if (!isNaN(post_id)) {\n console.log(\"event_post_id=\" + post_id);\n title = \"Event post id:\";\n append_html_code(title, post_id);\n } else {\n alert(\"URL is tampered.\");\n }\n }\n function group_post_id_append(post_id) {\n if (!isNaN(post_id)) {\n console.log(\"group_post_id=\" + post_id);\n title = \"Group post id:\";\n append_html_code(title, post_id);\n } else {\n alert(\"URL is tampered.\");\n }\n }\n function id_extract_event(account_username) {\n if (!isNaN(account_username)) {\n console.log(\"Event id is:\" + account_username);\n title = \"Event ID:\";\n append_html_code(title, account_username);\n } else {\n alert(\"URL is tampered.\");\n }\n }\n function extract_video_id(video_id) {\n if (!isNaN(video_id)) {\n console.log(\"video id is=\" + video_id);\n title = \"Post ID/ Video id:\";\n append_html_code(title, video_id);\n }\n }\n function id_extract_group(account_username) {\n\n if (isNaN(account_username)) {\n pageurl = \"https://mbasic.facebook.com/groups/\" + account_username;\n dinesh = new XMLHttpRequest();\n dinesh.open(\"GET\", pageurl, true);\n dinesh.onreadystatechange = function () {\n console.log(`dinesh.readyState: `, dinesh.readyState);\n console.log(`dinesh.status: `, dinesh.status);\n if (dinesh.readyState == 4 && dinesh.status == 200) {\n var responsa = dinesh.responseText.match(/\\/groups\\/\\d+/g)[0];\n responsa = responsa.replace(\"\\/groups\\/\", \"\");\n title = \"Group ID:\";\n console.log(title + responsa);\n append_html_code(title, responsa);\n }\n }\n dinesh.send();\n } else {\n title = \"Group ID:\";\n console.log(title + account_username);\n append_html_code(title, account_username);\n }\n }\n\n\n\n\n\n function append_html_code(title, id) {\n title = '<b style=\"font-size:20px;font-weight:bold\">' + title;\n text = text + '<p>' + title + '<input class=\"copytext' + id + '\" type=\"text\" value=\"' + id + '\" style=\"font-size:30px; text-align:center;width:90%;\" ><a datashow=\"copytext' + id + '\" class=\"copyto btn-floating mb-1 btn-flat waves-effect waves-light pink accent-2 white-text\"> <i class=\"material-icons\">content_copy</i></a><p></b>';\n\n console.log({\n title: 'Copy ตัวเลขไปใช้ได้เลยค่ะ',\n type: 'success',\n html: text,\n })\n // iziToast.success({\n // title: 'เรียบร้อย',\n // position: 'topCenter',\n // timeout: 3000,\n // message: 'พบ ID แล้ว Copy ไปใช้ได้เลย',\n // });\n }\n\n\n\n\n\n\n function extraction_process_url_params(url_array_collect) {\n console.log(url_array_collect);\n\n\n if (url_array_collect[2]) {\n if (url_array_collect[2] == \"permalink\") {\n if (url_array_collect[0] == \"groups\") {\n id_extract_group(url_array_collect[1]);\n if (!isNaN(url_array_collect[3])) {\n group_post_id_append(url_array_collect[3]);\n }\n }\n if (url_array_collect[0] == \"events\") {\n id_extract_event(url_array_collect[1]);\n if (!isNaN(url_array_collect[3])) {\n event_post_id_append(url_array_collect[3]);\n }\n }\n }\n if (url_array_collect[1] == \"videos\") {\n extract_video_id(url_array_collect[2]);\n }\n if (url_array_collect[0] == \"pages\") {\n if (!isNaN(url_array_collect[2])) {\n extract_page_id(url_array_collect[2]);\n }\n }\n if (url_array_collect[1] == \"posts\") {\n if (url_array_collect[0]) {\n id_extract_account(url_array_collect[0]);\n }\n if (!isNaN(url_array_collect[2])) {\n extract_post_id(url_array_collect[2]);\n }\n } else {\n id_extract_account(url_array_collect[0]);\n }\n } else {\n if (url_array_collect[1]) {\n if (url_array_collect[0] == \"groups\") {\n id_extract_group(url_array_collect[1]);\n }\n if (url_array_collect[0] == \"events\") {\n id_extract_event(url_array_collect[1]);\n }\n if (url_array_collect[0] == \"pg\") {\n id_extract_account(url_array_collect[1]);\n }\n } else {\n id_extract_account(url_array_collect[0]);\n }\n }\n }\n\n\n\n\n\n\n\n\n\n function id_extract_account(account_username) {\n\n function error_msgs() {\n //toastr.error(\"Unable to retrieve account ID\");\n }\n\n if (isNaN(account_username)) {\n responsa = '';\n pageurl = \"https://m.facebook.com/\" + account_username + \"\";\n\n dinesh = new XMLHttpRequest();\n dinesh.open(\"GET\", pageurl, true);\n dinesh.onreadystatechange = function () {\n if (dinesh.readyState == 4 && dinesh.status == 200) {\n var responsa = dinesh.responseText;\n responsa = responsa.replace(/&quot;/g, '\"');\n if (responsa.match(/\"profile_id\":\\d+/g)) {\n\n var last_array = (responce_id = responsa.match(/\"profile_id\":\\d+/g).length - 1);\n\n var responce_id = responsa.match(/\"profile_id\":\\d+/g)[last_array];\n responce_id = responce_id.replace('\"profile_id\":', \"\");\n if (!isNaN(responce_id)) {\n title = \"Account ID:\";\n console.log(title + \"=\" + responce_id);\n append_html_code(title, responce_id);\n\n\n } else {\n error_msgs();\n }\n }\n\n else\n\n if (responsa.match(/page_id:\\\"\\d+/g)) {\n\n var last_array = responsa.match(/page_id:\\\"\\d+/g)[0];\n responce_id = last_array.replace('page_id:\\\"', \"\");\n if (!isNaN(responce_id)) {\n title = \"Page ID:\";\n console.log(title + responce_id);\n append_html_code(title, responce_id);\n\n\n } else {\n error_msgs();\n }\n }\n\n\n\n\n }\n }\n dinesh.send();\n } else {\n alert(\"account id is:\" + responsa.id);\n //document.getElementById(\"fst789_id_extractor_result\").innerText = account_username;\n }\n }\n\n\n\n\n\n\n\n\n\n function getParam(sname, location_search) {\n if (location_search && sname) {\n\n var params = location_search.substr(location_search.indexOf(\"?\") + 1);\n var sval = \"\";\n params = params.split(\"&\");\n // split param and value into individual pieces\n for (var i = 0; i < params.length; i++) {\n temp = params[i].split(\"=\");\n if ([temp[0]] == sname) { sval = temp[1]; }\n }\n\n return sval;\n } else {\n return '';\n }\n }\n\n}", "function getDeslideSupportedSites() {\n return { \n 'about.com': '*.about.com', 'accessatlanta.com': '*.accessatlanta.com', 'answers.com': '*.answers.com', 'aol.com': '*.aol.com', 'askmen.com': '*.askmen.com', 'bleacherreport.com': '*.bleacherreport.com', 'cafemom.com': '*.cafemom.com', 'cbslocal.com': '*.cbslocal.com', 'cnn.com': '*.cnn.com', 'competitor.com': '*.competitor.com', 'complex.com': '*.complex.com', 'egotastic.com': '*.egotastic.com', 'eonline.com': '*.eonline.com', 'ew.com': '*.ew.com', 'fark.com': '*.fark.com', 'forbes.com': '*.forbes.com', 'howstuffworks.com': '*.howstuffworks.com', 'ibtimes.com': '*.ibtimes.com', 'imageshack.us': '*.imageshack.us', 'instyle.com': '*.instyle.com', 'latimes.com': '*.latimes.com', 'likes.com': '*.likes.com', 'mercurynews.com': '*.mercurynews.com', 'metromix.com': '*.metromix.com', 'msn.com': '*.msn.com', 'nymag.com': '*.nymag.com', 'nytimes.com': '*.nytimes.com', 'omaha.com': '*.omaha.com', 'photobucket.com': '*.photobucket.com', 'reuters.com': '*.reuters.com', 'seriouseats.com': '*.seriouseats.com', 'sfgate.com': '*.sfgate.com', 'slate.com': '*.slate.com', 'talkingpointsmemo.com': '*.talkingpointsmemo.com', 'theglobeandmail.com': '*.theglobeandmail.com', 'time.com': '*.time.com', 'topix.com': '*.topix.com', 'uproxx.com': '*.uproxx.com', 'viralnova.com': '*.viralnova.com', 'wtnh.com': '*.wtnh.com', 'yahoo.com': '*.yahoo.com', 'diply.com': '*diply.com', 'wildammo.com': '*wildammo.com', //' ': 'Coppermine galleries', // huh?\n 'abcnews.go.com': 'abcnews.go.com', \n 'espn.go.com': 'espn.go.com', 'all-that-is-interesting.com': 'all-that-is-interesting.com', 'animal.discovery.com': 'animal.discovery.com', 'arstechnica.com': 'arstechnica.com', 'austin.culturemap.com': 'austin.culturemap.com', 'blastr.com': 'blastr.com', 'blog.chron.com': 'blog.chron.com', 'blog.laptopmag.com': 'blog.laptopmag.com', 'blog.makezine.com': 'blog.makezine.com', 'blog.moviefone.com': 'blog.moviefone.com', 'blog.seattlepi.com': 'blog.seattlepi.com', 'blog.timesunion.com': 'blog.timesunion.com', 'blog.amctv.com': 'blogs.amctv.com', 'blog.laweekly.com': 'blogs.laweekly.com', 'bossip.com': 'bossip.com', 'boston.com': 'boston.com', 'thestreet.com': 'business-news.thestreet.com', 'bustedcoverage.com': 'bustedcoverage.com', 'buzzlie.com': 'buzzlie.com', 'celebritytoob.com': 'celebritytoob.com', 'celebuzz.com': 'celebslam.celebuzz.com', 'coed.com': 'coed.com', 'coedmagazine.com': 'coedmagazine.com', 'collegecandy.com': 'collegecandy.com', 'kiplinger.com': 'content.kiplinger.com', 'dailycaller.ca': 'dailycaller.ca', 'dailycaller.com': 'dailycaller.com', 'dailysanctuary.com': 'dailysanctuary.com', 'dallas.culturemap.com': 'dallas.culturemap.com', 'darkroom.baltimoresun.com': 'darkroom.baltimoresun.com', 'deadspin.com': 'deadspin.com', 'definition.org': 'definition.org', 'diffuser.fm': 'diffuser.fm', 'dvice.com': 'dvice.com', 'einestages.spiegel.de': 'einestages.spiegel.de', 'emgn.com': 'emgn.com', 'empireonline.com': 'empireonline.com', 'english.caixin.com': 'english.caixin.com', \n 'fansided.com': 'fansided.com', 'fashion.telegraph.co.uk': 'fashion.telegraph.co.uk', 'firstwefeast.com': 'firstwefeast.com', 'flavorwire.com': 'flavorwire.com', 'fu-berlin.de': 'fu-berlin.de', 'funnie.st': 'funnie.st', 'gamedayr.com': 'gamedayr.com', 'gamerant.com': 'gamerant.com', 'gamingbolt.com': 'gamingbolt.com', 'gawker.com': 'gawker.com', // Gawker Are Fucking Dead\n 'gizmodo.com': 'gizmodo.com', 'gothamist.com': 'gothamist.com', 'guff.com': 'guff.com', 'guyism.com': 'guyism.com', 'hdden.com': 'hdden.com', 'heavy.com': 'heavy.com', 'heldendesalltags.net': 'heldendesalltags.net', 'hollywoodlife.com': 'hollywoodlife.com', 'houston.culturemap.com': 'houston.culturemap.com', 'humorsignals.com': 'humorsignals.com', 'idolator.com': 'idolator.com', 'images.businessweek.com': 'images.businessweek.com', 'imgur.com': 'imgur.com', 'io9.com': 'io9.com', 'jalopnik.com': 'jalopnik.com', 'jezebel.com': 'jezebel.com', 'juicyceleb.com': 'juicyceleb.com', 'justviral.eu': 'justviral.eu', 'kittentoob.com': 'kittentoob.com', 'kotaku.com': 'kotaku.com', 'lifehacker.com': 'lifehacker.com', 'listcovery.com': 'listcovery.com', 'lotsoflaughters.com': 'lotoflaughters.com', 'm.n4g.com': 'm.n4g.com', 'm.spiegel.de': 'm.spiegel.de', 'madamenoire.com': 'madamenoire.com', 'makezine.com': 'makezine.com', 'mashable.com': 'mashable.com', 'mediacenter.dailycamera.com': 'mediacenter.dailycamera.com', 'mediagallery.usatoday.com': 'mediagallery.usatoday.com', 'menify.com': 'menify.com', 'mentalflare.com': 'mentalflare.com', 'metv.com': 'metv.com', 'mommynoire.com': 'mommynoire.com', 'motherjones.com': 'motherjones.com', 'moviesum.com': 'movieseum.com', 'msn.foxsports.com': 'msn.foxsports.com', 'myfox8.com': 'myfox8.com', 'n4g.com': 'n4g.com', 'natmonitor.com': 'natmonitor.com', 'news.cincinnati.com': 'news.cincinnati.com', 'news.cnet.com': 'news.cnet.com', 'news.discovery.com': 'news.discovery.com', 'news.moviefone.com': 'news.moviefone.com', 'news.nationalgeographic.com': 'news.nationalgeographic.com', 'news.xinhuanet.com': 'news.xinhuanet.com', 'nflspinzone.com': 'nflspinzone.com', 'noisey.vice.com': 'noisey.vice.com', 'nypost.com': 'nypost.com', 'opinion.people.com.cn': 'opinion.people.com.cn', 'origin.wtsp.com': 'origin.wtsp.com', 'perezhilton.com': 'perezhilton.com', 'photos.caixin.com': 'photos.caixin.com', 'photos.denverpost.com': 'photos.denverpost.com', 'photos.ellen.warnerbros.com': 'photos.ellen.warnerbros.com', 'photos.nj.com': 'photos.nj.com', 'photos.pennlive.com': 'photos.pennlive.com', 'photos.tmz.com': 'photos.tmz.com', 'photos.toofab.com': 'photos.toofab.com', 'picasaweb.google.com': 'picasaweb.google.com', 'popnhop.com': 'popnhop.com', 'puppytoob.com': 'puppytoob.com', 'pyz.am': 'pyz.am', 'radaronline.com': 'radaronline.com', 'rantchic.com': 'rantchic.com', 'regretfulmorning.com': 'regretfulmorning.com', 'reviews.cnet.com': 'reviews.cnet.com', 'ripbird.com': 'ripbird.com', 'rottenpanda.com': 'rottenpanda.com', 'runt-of-the-web.com': 'runt-of-the-web.com', 'salary.com': 'salary.com', 'screencrush.com': 'screencrush.com', 'screenrant.com': 'screenrant.com', 'seattletimes.com': 'seattletimes.com', 'seattletimes.nwsource.com': 'seattletimes.nwsource.com', 'shortlist.com': 'shortlist.com', 'slideshow.nbcnews.com': 'slideshow.nbcnews.com', 'slideshow.today.com': 'slideshow.today.com', 'slideshows.collegehumor.com': 'slideshows.collegehumor.com', 'socialitelife.com': 'socialitelife.com', 'static.thefrisky.com': 'static.thefrisky.com', 'story.wittyfeed.com': 'story.wittyfeed.com', 'styleblazer.com': 'styleblazer.com', 'sz-magazin.sueddeutsche.de': 'sz-magazin.sueddeutsche.de', 'theblemish.com': 'theblemish.com', 'thehill.com': 'thehill.com', 'theweek.com': 'theweek.com', 'thewire.co.uk': 'thewire.co.uk', 'time.com': 'time.com', 'travel.allwomenstalk.com': 'travel.allwomenstalk.com', // always wonder how to parse this - \"all women's talk\" or \"all women stalk\"??\n 'twentytwowords.com': 'twentytwowords.com', 'venturebeat.com': 'venturebeat.com', 'viewmixed.com': 'viewmixed.com', 'wallstcheatsheet.com': 'wallstcheatsheet.com', 'whatculture.com': 'whatculture.com', 'worldwideinterweb.com': 'worldwideinterweb.com', 'worthly.com': 'worthly.com', 'wtkr.com': 'wtkr.com', 'wtvr.com': 'wtvr.com', '10best.com': 'www.10best.com', '123inspiration.com': 'www.123inspiration.com', '29-95.com': 'www.29-95.com', 'aarp.org': 'www.aarp.org', 'adweek.com': 'www.adweek.com', 'ajc.com': 'www.ajc.com', 'animalplanet.com': 'www.animalplanet.com', 'aolnews.com': 'www.aolnews.com', 'art-magazin.de': 'www.art-magazin.de', 'autobild.de': 'www.autobild.de', 'azcentral.com': 'www.azcentral.com', 'azfamily.com': 'www.azfamily.com', 'babble.com': 'www.babble.com', 'baltimoresun.com': 'www.baltimoresun.com', 'bankrate.com': 'www.bankrate.com', 'bbc.co.uk': 'www.bbc.co.uk', 'bbc.com': 'www.bbc.com', 'belfasttelegraph.co.uk': 'www.belfasttelegraph.co.uk', 'bellasugar.com': 'www.bellasugar.com', 'berliner-zeitung.de': 'www.berliner-zeitung.de', 'bild.de': 'www.bild.de', 'bizjournals.com': 'www.bizjournals.com', 'blastr.com': 'www.blastr.com', 'bleedingcool.com': 'www.bleedingcool.com', 'bloomberg.com': 'www.bloomberg.com', 'bobvila.com': 'www.bobvila.com', 'bonappetit.com': 'www.bonappetit.com', 'boredlion.com': 'www.boredlion.com', 'boston.com': 'www.boston.com', 'bostonherald.com': 'www.bostonherald.com', 'bracketsdaily.com': 'www.bracketsdaily.com', 'brainjet.com': 'www.brainjet.com', 'break.com': 'www.break.com', 'brisbanetimes.com.au': 'www.brisbanetimes.com.au', 'brobible.com': 'www.brobible.com', // ew\n 'buddytv.com': 'www.buddytv.com', 'businessinsider.com': 'www.businessinsider.com', 'businessnewsdaily.com': 'www.businessnewsdaily.com', 'bustle.com': 'www.bustle.com', 'buzzfeed.com': 'www.buzzfeed.com', 'buzzsugar.com': 'www.buzzsugar.com', 'bytesized.me': 'www.bytesized.me', 'canberratimes.com.au': 'www.canberratimes.com.au', 'casasugar.com': 'www.casasugar.com', 'cbc.ca': 'www.cbc.ca', 'cbs.com': 'www.cbs.com', 'cbsnews.com': 'www.cbsnews.com', 'cbssports.com': 'www.cbssports.com', 'celebritynetworth.com': 'www.celebritynetworth.com', 'celebstyle.com': 'www.celebstyle.com', // ' ': 'www.celebuzz.com', \n 'celebzen.com': 'www.celebzen.com', 'celebzen.com.au': 'www.celebzen.com.au', 'chacha.com': 'www.chacha.com', 'cheatcc.com': 'www.cheatcc.com', 'chicagotribune.com': 'www.chicagotribune.com', 'chip.de': 'www.chip.de', 'chron.com': 'www.chron.com', 'cinemablend.com': 'www.cinemablend.com', 'cio.com': 'www.cio.com', 'classicfm.com': 'www.classicfm.com', 'clickorlando.com': 'www.clickorlando.com', 'cnbc.com': 'www.cnbc.com', 'cntraveler.com': 'www.cntraveler.com', 'collegehumor.com': 'www.collegehumor.com', 'comicbookmovie.com': 'www.comicbookmovie.com', 'complexmag.ca': 'www.complexmag.ca', 'complexmag.com': 'www.complexmag.com', 'computerworld.com': 'www.computerworld.com', 'corriere.it': 'www.corriere.it', 'cosmopolitan.co.uk': 'www.cosmopolitan.co.uk', 'cosmopolitan.com ': 'www.cosmopolitan.com', 'courant.com': 'www.courant.com', 'cracked.com': 'www.cracked.com', 'csmonitor.com': 'www.csmonitor.com', 'csoonline.com': 'www.csoonline.com', 'ctnow.com': 'www.ctnow.com', 'dailyfunlists.com': 'www.dailyfunlists.com', 'dailygazette.com': 'www.dailygazette.com', 'dallasobserver.com': 'www.dallasobserver.com', 'darkreading.com': 'www.darkreading.com', 'daytondailynews.com': 'www.daytondailynews.com', 'delish.com': 'www.delish.com', 'designsponge.com': 'www.designsponge.com', 'desmoinesregister.com': 'www.desmoinesregister.com', 'digitalone.com.sg': 'www.digitalone.com.sg', 'digitalspy.co.uk': 'www.digitalspy.co.uk', 'digitalspy.com': 'www.digitalspy.com', 'digitalspy.com.au': 'www.digitalspy.com.au', 'dispatch.com': 'www.dispatch.com', 'dorkly.com': 'www.dorkly.com', 'ebaumsworld.com': 'www.ebaumsworld.com', 'elle.com': 'www.elle.com', 'empireonline.com': 'www.empireonline.com', 'entertainmentwise.com': 'www.entertainmentwise.com', 'environmentalgraffiti.com': 'www.environmentalgraffiti.com', 'escapehere.com': 'www.escapehere.com', 'esquire.com': 'www.esquire.com', 'everyjoe.com': 'www.everyjoe.com', 'eweek.com': 'www.eweek.com', 'examiner.com': 'www.examiner.com', 'fabsugar.com': 'www.fabsugar.com', 'fame10.com': 'www.fame10.com', 'fastcodesign.com': 'www.fastcodesign.com', 'faz.net': 'www.faz.net', 'fieldandstream.com': 'www.fieldandstream.com', 'fitsugar.com': 'www.fitsugar.com', 'flavorwire.com': 'www.flavorwire.com', 'focus.de': 'www.focus.de', 'food.com': 'www.food.com', 'foodandwine.com': 'www.foodandwine.com', 'footballnation.com': 'www.footballnation.com', 'foreignpolicy.com': 'www.foreignpolicy.com', 'fox2now.com': 'www.fox2now.com', 'fox40.com': 'www.fox40.com', 'fox59.com': 'www.fox59.com', 'fox5sandiego.com': 'www.fox5sandiego.com', 'foxnews.com': 'www.foxnews.com', 'fr-online.de': 'www.fr-online.de', 'gameranx.com': 'www.gameranx.com', 'gamesblog.it': 'www.gamesblog.it', 'gamespot.com': 'www.gamespot.com', 'gamesradar.com': 'www.gamesradar.com', 'geeksaresexy.net': 'www.geeksaresexy.net', 'geeksugar.com': 'www.geeksugar.com', 'gigwise.com': 'www.gigwise.com', 'gizmopod.com': 'www.gizmopod.com', 'golf.com': 'www.golf.com', 'gq.com': 'www.gq.com', 'grated.com': 'www.grated.com', 'guardian.co.uk': 'www.guardian.co.uk', 'haikudeck.com': 'www.haikudeck.com', 'harpersbazaar.com': 'www.harpersbazaar.com', 'health.com': 'www.health.com', 'heise.de': 'www.heise.de', 'hgtvremodels.com': 'www.hgtvremodels.com', 'highrated.net': 'www.highrated.net', 'hitfix.com': 'www.hitfix.com', 'hlntv.com': 'www.hlntv.com', 'hollyscoop.com': 'www.hollyscoop.com', 'hollywood.com': 'www.hollywood.com', 'hollywoodreporter.com': 'www.hollywoodreporter.com', 'hollywoodtuna.com': 'www.hollywoodtuna.com', 'houstonpress.com': 'www.houstonpress.com', 'huffingtonpost.com': 'www.huffingtonpost.*', // TODO\n 'idolator.com': 'www.idolator.com', 'ign.com': 'www.ign.com', 'imdb.com': 'www.imdb.com', 'informationweek.com': 'www.informationweek.com', 'infoworld.com': 'www.infoworld.com', 'irishcentral.com': 'www.irishcentral.com', 'itworld.com': 'www.itworld.com', 'ivillage.com': 'www.ivillage.com', 'kare11.com': 'www.kare11.com', 'katu.com': 'www.katu.com', 'kentucky.com': 'www.kentucky.com', 'kicker.de': 'www.kicker.de', 'killsometime.com': 'www.killsometime.com', 'kiplinger.com': 'www.kiplinger.com', 'kitv.com': 'www.kitv.com', 'ktla.com': 'www.ktla.com', 'ktvu.com': 'www.ktvu.com', 'kvia.com': 'www.kvia.com', 'laudable.com': 'www.laudable.com', 'laweekly.com': 'www.laweekly.com', 'life.com': 'www.life.com', 'lifebuzz.com': 'www.lifebuzz.com', 'lifedaily.com': 'www.lifedaily.com', 'lifescript.com': 'www.lifescript.com', 'lilsugar.com': 'www.lilsugar.com', 'littlethings.com': 'www.littlethings.com', 'livescience.com': 'www.livescience.com', 'livestrong.com': 'www.livestrong.com', 'local10.com': 'www.local10.com', 'london2012.com': 'www.london2012.com', 'makezine.com': 'www.makezine.com', 'mandatory.com': 'www.mandatory.com', 'marketwatch.com': 'www.marketwatch.com', 'mcall.com': 'www.mcall.com', 'menshealth.com': 'www.menshealth.com', 'miamiherald.com': 'www.miamiherald.com', 'mirror.co.uk': 'www.mirror.co.uk', 'mlive.com': 'www.mlive.com', 'mnn.com': 'www.mnn.com', 'monopol-magazin.de': 'www.monopol-magazin.de', 'motherjones.com': 'www.motherjones.com', 'myfox8.com': 'www.myfox8.com', 'myhealthnewsdaily.com': 'www.myhealthnewsdaily.com', 'mysanantonio.com': 'www.mysanantonio.com', 'nationaltimes.com.au': 'www.nationaltimes.com.au', 'nba.com': 'www.nba.com', 'nbc.com': 'www.nbc*', // TODO\n 'nbcnews.com': 'www.nbcnews.com', 'networkworld.com': 'www.networkworld.com', 'neverunderdressed.com': 'www.neverunderdressed.com', 'news800.com': 'www.news800.com', 'newsarama.com': 'www.newsarama.com', 'newser.com': 'www.newser.com', 'newstimes.com': 'www.newstimes.com', 'newyorker.com': 'www.newyorker.com', 'nfl.com': 'www.nfl.com', 'ngz-online.de': 'www.ngz-online.de', 'nj.com': 'www.nj.com', 'nme.com': 'www.nme.com', 'notsafeforwhat.com': 'www.notsafeforwhat.com', 'npr.org': 'www.npr.org', 'nsmbl.nl': 'www.nsmbl.nl', 'numberfire.com': 'www.numberfire.com', 'nuts.co.uk': 'www.nuts.co.uk', 'nydailynews.com': 'www.nydailynews.com', 'nypost.com': 'www.nypost.com', 'ocregister.com': 'www.ocregister.com', 'ocweekly.com': 'www.ocweekly.com', 'officialplaystationmagazine.co.uk': 'www.officialplaystationmagazine.co.uk', 'omghacks.com': 'www.omghacks.com', 'opposingviews.com': 'www.opposingviews.com', 'oregonlive.com': 'www.oregonlive.com', 'orlandosentinel.com': 'www.orlandosentinel.com', 'ouramazingplanet.com': 'www.ouramazingplanet.com', 'parenting.com': 'www.parenting.com', 'parents.com': 'www.parents.com', 'parentsociety.com': 'www.parentsociety.com', 'pcgamer.com': 'www.pcgamer.com', 'pcmag.com': 'www.pcmag.com', 'pcworld.com': 'www.pcworld.com', 'people.com': 'www.people.com', 'peoplepets.com': 'www.peoplepets.com', 'peoplestylewatch.com': 'www.peoplestylewatch.com', 'petsugar.com': 'www.petsugar.com', 'philly.com': 'www.philly.com', 'phoenixnewtimes.com': 'www.phoenixnewtimes.com', 'politico.com': 'www.politico.com', 'popcrunch.com': 'www.popcrunch.com', 'popsci.com': 'www.popsci.com', 'popsugar.com': 'www.popsugar.com', 'popularmechanics.com': 'www.popularmechanics.com', 'press-citizen.com': 'www.press-citizen.com', 'pressroomvip.com': 'www.pressroomvip.com', 'q13fox.com': 'www.q13fox.com', 'ranker.com': 'www.ranker.com', 'rantchic.com': 'www.rantchic.com', 'rantfood.com': 'www.rantfood.com', 'rantlifestyle.com': 'www.rantlifestyle.com', 'rantsports.com': 'www.rantsports.com', 'rd.com': 'www.rd.com', 'readersdigest.ca': 'www.readersdigest.ca', 'realclearscience.com': 'www.realclearscience.com', 'realclearworld.com': 'www.realclearworld.com', 'realsimple.com': 'www.realsimple.com', 'realtor.com': 'www.realtor.com', 'rebelcircus.com': 'www.rebelcircus.com', 'redeyechicago.com': 'www.redeyechicago.com', 'refinedguy.com': 'www.refinedguy.com', 'refinery29.com': 'www.refinery29.com', 'repubblica.it': 'www.repubblica.it', 'riverfronttimes.com': 'www.riverfronttimes.com', 'roasted.com': 'www.roasted.com', 'rollingstone.com': 'www.rollingstone.com', 'rottenpanda.com': 'www.rottenpanda.com', 'rottentomatoes.com': 'www.rottentomatoes.com', 'rp-online.de': 'www.rp-online.de', 'rsvlts.com': 'www.rsvlts.com', // 'salary.com': 'www.salary.com', \n 'salon.com': 'www.salon.com', 'savvysugar.com': 'www.savvysugar.com', 'seattlepi.com': 'www.seattlepi.com', 'seattleweekly.com': 'www.seattleweekly.com', 'sfweekly.com': 'www.sfweekly.com', 'sfx.co.uk': 'www.sfx.co.uk', 'shape.com': 'www.shape.com', 'shebudgets.com': 'www.shebudgets.com', 'shefinds.com': 'www.shefinds.com', 'shortlist.com': 'www.shortlist.com', 'si.com': 'www.si.com', 'slideshare.net': 'www.slideshare.net', 'sltrib.com': 'www.sltrib.com', 'smh.com.au': 'www.smh.com.au', 'smithsonianmag.com': 'www.smithsonianmag.com', 'snakkle.com': 'www.snakkle.com', 'southernliving.com': 'www.southernliving.com', 'space.com': 'www.space.com', 'spiegel.de': 'www.spiegel.de', 'spin.com': 'www.spin.com', 'sportal.de': 'www.sportal.de', 'sportsradiokjr.com': 'www.sportsradiokjr.com', 'stamfordadvocate.com': 'www.stamfordadvocate.com', 'star-telegram.com': 'www.star-telegram.com', 'starpulse.com': 'www.starpulse.com', 'stereogum.com': 'www.stereogum.com', 'stereotude.com': 'www.stereotude.com', 'stern.de': 'www.stern.de', 'stuff.co.nz': 'www.stuff.co.nz', 'stuffyoushouldknow.com': 'www.stuffyoushouldknow.com', 'stylebistro.com': 'www.stylebistro.com', 'stylelist.com': 'www.stylelist.com', 'stylist.co.uk': 'www.stylist.co.uk', 'sueddeutsche.de': 'www.sueddeutsche.de', 'suggest.com': 'www.suggest.com', 'sun-sentinel.com': 'www.sun-sentinel.com', 'tagesschau.de': 'www.tagesschau.de', 'tagesspiegel.de': 'www.tagesspiegel.de', 'takepart.com': 'www.takepart.com', 'techconnect.com': 'www.techconnect.com', 'technewsdaily.com': 'www.technewsdaily.com', 'techradar.com': 'www.techradar.com', 'techrepublic.com': 'www.techrepublic.com', 'techworld.com.au': 'www.techworld.com.au', 'telegraph.co.uk': 'www.telegraph.co.uk', 'theage.com.au': 'www.theage.com.au', 'theatlantic.com': 'www.theatlantic.com', 'thedailybeast.com': 'www.thedailybeast.com', 'thedailymeal.com': 'www.thedailymeal.com', 'thefiscaltimes.com': 'www.thefiscaltimes.com', 'thefrisky.com': 'www.thefrisky.com', 'thefumble.com': 'www.thefumble.com', 'theguardian.com': 'www.theguardian.com', 'theleek.com': 'www.theleek.com', 'thelocal.com': 'www.thelocal.*', // TODO\n 'theonion.com': 'www.theonion.com', 'thepostgame.com': 'www.thepostgame.com', 'therichest.com': 'www.therichest.com', 'thesmokinggun.com': 'www.thesmokinggun.com', 'thestreet.com': 'www.thestreet.com', 'thesun.co.uk': 'www.thesun.co.uk', 'thesuperficial.com': 'www.thesuperficial.com', 'thevine.com.au': 'www.thevine.com.au', 'thewrap.com': 'www.thewrap.com', 'thinkadvisor.com': 'www.thinkadvisor.com', 'thisoldhouse.com': 'www.thisoldhouse.com', 'tmz.com': 'www.tmz.com', 'today.com': 'www.today.com', 'tomorrowoman.com': 'www.tomorrowoman.com', 'tomsguide.com': 'www.tomsguide.com', 'tomshardware.com': 'www.tomshardware.com', 'topgear.com': 'www.topgear.com', 'torontosun.com': 'www.torontosun.com', 'totalfilm.com': 'www.totalfilm.com', 'totalprosports.com': 'www.totalprosports.com', 'travelandleisure.com': 'www.travelandleisure.com', 'treehugger.com': 'www.treehugger.com', 'tressugar.com': 'www.tressugar.com', 'trutv.com': 'www.trutv.com', 'tvguide.com': 'www.tvguide.com', 'tvovermind.com': 'www.tvovermind.com', 'upi.com': 'www.upi.com', 'usmagazine.com': 'www.usmagazine.com', 'usnews.com': 'www.usnews.com', 'vanityfair.com': 'www.vanityfair.com', 'vg247.com': 'www.vg247.com', 'vh1.com': 'www.vh1.com', 'vice.com': 'www.vice.com', 'villagevoice.com': 'www.villagevoice.com', 'viralands.com': 'www.viralands.com', 'vulture.com': 'www.vulture.com', 'washingtonpost.com': 'www.washingtonpost.com', 'watoday.com.au': 'www.watoday.com.au', 'wbaltv.com': 'www.wbaltv.com', 'wcvb.com': 'www.wcvb.com', 'weather.com': 'www.weather.com', 'weblyest.com': 'www.weblyest.com', 'welt.de': 'www.welt.de', 'wesh.com': 'www.wesh.com', 'westworld.com': 'www.westword.com', 'wftv.com': 'www.wftv.com', 'wgal.com': 'www.wgal.com', 'whas11.com': 'www.whas11.com', 'wholeliving.com': 'www.wholeliving.com', 'wired.co.uk': 'www.wired.co.uk', 'wired.com': 'www.wired.com', 'wisn.com': 'www.wisn.com', 'wittyfeed.com': 'www.wittyfeed.com', 'wlac.com': 'www.wlac.com', 'wlsam.com': 'www.wlsam.com', 'wlwt.com': 'www.wlwt.com', 'wmtw.com': 'www.wmtw.com', 'wowthatscool.com': 'www.wowthatscool.com', 'wpix.com': 'www.wpix.com', 'wptv.com': 'www.wptv.com', 'wsbtv.com': 'www.wsbtv.com', 'wtae.com': 'www.wtae.com', 'wtkr.com': 'www.wtkr.com', 'wtsp.com': 'www.wtsp.com', 'wusa9.com': 'www.wusa9.com', 'wwe.com': 'www.wwe.com', 'wwtdd.com': 'www.wwtdd.com', 'yumsugar.com': 'www.yumsugar.com', 'zagat.com': 'www.zagat.com', 'zap2it.com': 'www.zap2it.com', 'zdnet.com': 'www.zdnet.com', 'zeit.de': 'www.zeit.de', 'zimbio.com': 'www.zimbio.com', 'www2.tbo.com': 'www2.tbo.com', 'xfinity.comcast.net': 'xfinity.comcast.net', 'xhamster.com': 'xhamster.com' // not sure about this one\n };\n}", "function getPermalink(item){\n // console.log('getPermalink:', item);\n switch(getService(item)) {\n case 'facebook':\n return 'https://www.facebook.com/photo.php?fbid='+item.data.id;\n // case 'foursquare':\n // return 'https://foursquare.com/ + ??? + /checkin/'+item.data.checkin.id;\n case 'twitter':\n return 'https://twitter.com/' + item.data.user.screen_name + '/statuses/' + item.data.id_str;\n case 'instagram':\n return item.data.link;\n case 'tumblr':\n return item.data.post_url;\n // case 'linkedin':\n // return '#';\n default:\n return '#link-unknown';\n }\n}", "function share_link() {\n let postUrl = encodeURI(document.location.href)\n let postTitle = encodeURI('Hi, please click here to join the meeting: ')\n facebookBtn.setAttribute(\n 'href',\n `https://www.facebook.com/sharer.php?u=${postUrl}`\n )\n linkedinBtn.setAttribute(\n 'href',\n `https://www.linkedin.com/shareArticle?url=${postUrl}&title=${postTitle}`\n )\n whatsappBtn.setAttribute(\n 'href',\n `https://wa.me/?text=${postTitle} ${postUrl}`\n )\n}", "get feed(){\n return fbpage+\"/feed\";\n }", "blogPostShared(articleInformation) {\n let shareOption = articleInformation.replace('goodshare','');\n if (typeof window !== 'undefined') {\n window.analytics.track(\"Blog Post Shared\", {\n article_share_option: shareOption,\n })\n }\n }", "function visualiserFb(){\n // service pour visualiser facebook\n var url = \"https://www.facebook.com/conservatoireculinaireduquebec/\";\n window.open(url,\"_blank\");\n} // end visualiser pdffeed", "function do_fb()\n {\n console.log(\"Doing FB\");\n my_query.check_about_page=false;\n var result={email:\"\",name:\"\",url:window.location.href,phone:\"\"};\n var i;\n var contactlinks=document.getElementsByClassName(\"_50f4\");\n var namelinks=document.getElementsByClassName(\"_42ef\");\n if(window.location.href.indexOf(\"/about/\")===-1)\n {\n do_fbhome();\n return;\n }\n\n do_fb_about();\n return;\n }", "function codepad_share() {\n var share_url = \"?c=\" + codepad_get_scene();\n for (var i = 0; i < codepad_sessions.length; i++) {\n var compressed_code = LZString.compressToBase64(codepad_get_code(i + 1));\n compressed_code = \"&s\" + (i + 1) + \"=\" + compressed_code;\n share_url = share_url + compressed_code;\n }\n\n window.location.hash = share_url;\n}", "function getShareOptions(feed_title, feed_url){\n return \"\";\n}", "function shareOhOnFaceBook (a_id,type)\n{\n var shareurl = 'http://www.facebook.com/sharer.php?u=';\n if(type == 'private')\n shareurl = shareurl + 'http://www.smashed.in/oh/'+a_id;\n else\n shareurl = shareurl + a_id;\n\tshareSocial(shareurl);\n}", "function first_start() {\n // add sites 1 by 1 in sync\n blackListSite(\"facebook.com\", function() {\n blackListSite(\"youtube.com\", function() {\n blackListSite(\"instagram.com\");\n });\n });\n}", "function shareToFB() {\n\tFB.ui({\n\t\tmethod: 'feed',\n\t\tlink: 'http://weba.cegepsherbrooke.qc.ca/~tia16001/service.php',\n\t\tcaption: 'An example caption',\n\t\t}, function(response){});\n}", "function _handleFb() {\n\t\tlet shortToken;\n\t\tif (window.location.hash) {\n\n\t\t\tconsole.log(\"window.location\", window.location);\n\n\t\t\t\tlet accessTokenMatch = window.location.hash.match(/access_token\\=([a-zA-Z0-9]+)/);\n\t\t\tconsole.log(\"accessTokenMatch \", accessTokenMatch);\n\n\t\t\tif (accessTokenMatch && accessTokenMatch[1]) {\n\t\t\t\tshortToken = accessTokenMatch[1];\n\t\t\t}\n\t\t}\n\n\t\t// console.log(\"_handleFb \");\n\t\t// console.log(\"shortToken \", shortToken);\n\n\t\tif (shortToken) {\n\t\t\t// We came here from Facebook redirect, with a token\n\t\t\tif (getUrlParams()[\"accountLinking\"]) {\n\t\t\t\t_getFBMeWithShortToken({\n\t\t\t\t\tshortToken,\n\t\t\t\t\tcallback: function(data) {\n\n\t\t\t\t\t\tconsole.log(\"_getFBMeWithShortToken data\", data);\n\t\t\t\t\t\t//console.log('updating', data)\n\t\t\t\t\t\tupdateClient({\"facebookLogin\": data[\"id\"]}, function(d, e) {\n\t\t\t\t\t\t\tconsole.log('updated!');\n\t\t\t\t\t\t\tconsole.log(d, e);\n\n\t\t\t\t\t\t\t_generateFBToken({\n\t\t\t\t\t\t\t\tshortToken,\n\t\t\t\t\t\t\t\tcallback: function(data) {\n\n\t\t\t\t\t\t\t\t\tconsole.log()\n\t\t\t\t\t\t\t\t\tif (data && data[\"value\"] === \"ok\") {\n\t\t\t\t\t\t\t\t\t\t_store._fbAllowed = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t// Clear query parameter from address bar\n\t\t\t\twindow.setTimeout(function() {\n\t\t\t\t\thistory.pushState(\"\", document.title, window.location.pathname);\n\t\t\t\t}, 0);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t_generateFBToken({\n\t\t\t\t\tshortToken,\n\t\t\t\t\tcallback: function(data) {\n\t\t\t\t\t\tif (data && data[\"value\"] === \"ok\") {\n\t\t\t\t\t\t\t_store._fbAllowed = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif(window.altyn.zonePrefix === \"\"||(window.isMobile && window.altyn.zonePrefix ==\"/open\")){\n\t\t\t\t//Just came on page, need to get token status\n\t\t\t\t_getFBTokenStatus(function(response) {\n\t\t\t\t\tif (response && response[\"value\"] === true) {\n\t\t\t\t\t\t_store._fbAllowed = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t}\n\t}", "function preferences(ctx, next){\n ctx.appId = env.match(/^prod/)\n ? '1502658849963792'\n : '1513748688854808';\n return next();\n}", "function showBillerFeedBackUrl() {\n\tshowFooterPopup(messages['biller.findMyBiller']);\n\treturn false;\n}", "function facebookCallback() {\n FB.Event.subscribe('edge.create', function() {\n goTo('twitter');\n });\n}", "static get DB_APP_NAME() {\n return 'restaurants-app-data-';\n }", "getLoginUrl(){\n const stringifiedParams = queryString.stringify({\n client_id: AppConfig.FB_APPID,\n redirect_uri: AppConfig.FB_DEFAULT_REDIRECT_URI,\n scope: AppConfig.FB_SCOPE.join(','), // comma seperated string\n response_type: AppConfig.RESP_CODE,\n auth_type: AppConfig.DEFAULT_AUTH_TYPE,\n display: AppConfig.DEFAULT_FB_DISPLAY,\n });\n return `${AppConfig.FB_DIALOG_URI}?${stringifiedParams}`;\n }", "devBaseUrls() {\n var baseUrl = new URL(window.location.origin);\n var parts = baseUrl.hostname.split(\".\");\n\n if (parts.includes(\"platformsh\") && parts.includes(\"www\")) {\n // We are on a Platform.sh development environment under\n // the app subdomain. Let's strip out the www subdomain.\n parts.shift();\n baseUrl = \"https://\" + parts.join(\".\");\n\n // Create docs url.\n let docsUrl = new URL(baseUrl);\n docsUrl.hostname = \"docs.\" + docsUrl.hostname;\n this.docs = docsUrl;\n\n // Create app url.\n let appUrl = new URL(baseUrl);\n appUrl.hostname = \"app.\" + appUrl.hostname;\n this.app = appUrl;\n }\n }", "function shareApp(){\n // this is the complete list of currently supported params you can pass to the plugin (all optional)\n //alert(share_text);\nvar options = {\n message: \"Download app ya Global Radio upate habari na matukio. \" + app_link, // not supported on some apps (Facebook, Instagram)\n subject: '+255 Global Radio', // fi. for email\n files: ['', ''], // an array of filenames either locally or remotely\n url: '',\n chooserTitle: 'Share using' // Android only, you can override the default share sheet title,\n };\n \n var onSuccess = function(result) {\n console.log(\"Share completed? \" + result.completed); // On Android apps mostly return false even while it's true\n console.log(\"Shared to app: \" + result.app); // On Android result.app since plugin version 5.4.0 this is no longer empty. On iOS it's empty when sharing is cancelled (result.completed=false)\n };\n \n var onError = function(msg) {\n console.log(\"Sharing failed with message: \" + msg);\n };\n \n window.plugins.socialsharing.shareWithOptions(options, onSuccess, onError);\n}", "handle_submit() {\n const {article, content} = this.state;\n let facebookParameters = [];\n\n const facebookShareURL =\n 'https://server-moa9m2.turbo360-vertex.com/share/EJ5BXsTgFr43dx4Y';\n facebookParameters.push('quote=' + encodeURI(content));\n facebookParameters.push('u=' + encodeURI(facebookShareURL));\n\n console.log(facebookParameters);\n const url =\n 'https://www.facebook.com/sharer/sharer.php?' +\n facebookParameters.join('&');\n Linking.openURL(url)\n .then(data => {\n this.handle_cancel();\n console.log('Facebook Opened');\n })\n .catch(() => {\n console.log('Something went wrong');\n });\n }", "function facebookShare() {\n var s=s_gi(s_account);\n s.eVar2='fShare';\n s.events='event12';\n s.trackExternalLinks = false;\n s.linkTrackVars='eVar2,events';\n s.linkTrackEvents='event12';\n s.tl(this,'o','fShare');\n}", "function shareApp(){\n // this is the complete list of currently supported params you can pass to the plugin (all optional)\n //alert(share_text);\nvar options = {\n message: \"Download app ya Global Radio usikilize radio na upate habari na matukio kupitia simu yako ya mkononi. \" + app_link, // not supported on some apps (Facebook, Instagram)\n subject: '+255 Global Radio', // fi. for email\n files: ['', ''], // an array of filenames either locally or remotely\n url: '',\n chooserTitle: 'Share using' // Android only, you can override the default share sheet title,\n };\n\n var onSuccess = function(result) {\n console.log(\"Share completed? \" + result.completed); // On Android apps mostly return false even while it's true\n console.log(\"Shared to app: \" + result.app); // On Android result.app since plugin version 5.4.0 this is no longer empty. On iOS it's empty when sharing is cancelled (result.completed=false)\n };\n\n var onError = function(msg) {\n console.log(\"Sharing failed with message: \" + msg);\n };\n\n window.plugins.socialsharing.shareWithOptions(options, onSuccess, onError);\n}", "function makeURL(domain, userApiKey) {\r\n var base = \"https://api.shodan.io/shodan/host/search?key=\";\r\n var url = base + userApiKey + '&query=hostname:' + domain;\r\n console.log(url);\r\n return url;\r\n}", "function updateWatchHistory() {\n\tchrome.history.search({\n\t\t'text': '',\n\t\tmaxResults: 1\n\t}, function(historyItems) {\n\t\tvar str = historyItems[0].url;\n if(str.includes(\"netflix.com/watch\")){\n \t getNetflixMediaTitle();\n }else if(str.includes(\"hotstar\")&&str.includes(\"watch\")){\n \tconsole.log(historyItems[0].title);\n \t//getHotstarTitle();\n }else if(str.includes(\"primevideo\")&&str.includes(\"detail\")){\n //console.log(historyItems[0].title);\n getPrimeMediaTitle();\n }\n \n\t});\n}", "nameDB() {\n let hostname = window.location.host.split('.')\n let response = hostname\n\n //Set capitalize to all words\n hostname.forEach((word, index) => {\n if (index >= 1) {\n hostname[index] = word.charAt(0).toUpperCase() + word.slice(1)\n }\n })\n\n //Remove .com .org....\n if (hostname.length >= 2) response.pop()\n\n return `${response.join('')}DB`//Response\n }", "_showGitHubPage() {\n window.open('https://github.com/chromeos/pwa-play-billing', '_blank');\n }", "nacosGoBack(url) {\r\n const params = window.location.hash.split('?')[1];\r\n const urlArr = params.split('&') || [];\r\n const queryParams = [];\r\n for (let i = 0; i < urlArr.length; i++) {\r\n if (\r\n urlArr[i].split('=')[0] !== '_k' &&\r\n urlArr[i].split('=')[0] !== 'dataId' &&\r\n urlArr[i].split('=')[0] !== 'group'\r\n ) {\r\n if (urlArr[i].split('=')[0] === 'searchDataId') {\r\n queryParams.push(`dataId=${urlArr[i].split('=')[1]}`);\r\n } else if (urlArr[i].split('=')[0] === 'searchGroup') {\r\n queryParams.push(`group=${urlArr[i].split('=')[1]}`);\r\n } else {\r\n queryParams.push(urlArr[i]);\r\n }\r\n }\r\n }\r\n if (localStorage.getItem('namespace')) {\r\n queryParams.push(`namespace=${localStorage.getItem('namespace')}`);\r\n }\r\n this.props.history.push(`/${url}?${queryParams.join('&')}`);\r\n }", "buildUrlEndpoint(action) {\n\t\t\tconst host = this._configuration.getDomain() + '/api/Bookmark/'\n\t\t\tconst endpoint = action || '';\n\t\t\treturn host + endpoint;\n\t\t}", "function generateShareBar() {\r\n\t\t\tvar jq = null;\r\n\t\t\tvar code = null;\r\n\t\t\t// twitter\r\n\t\t\tif (self.options.share.twitter.enabled) {\r\n\t\t\t\tcode = '<li><a href=\"https://mobile.twitter.com/compose/tweet?status=' + encodeURI(self.options.share.shareLink) + '\" target=\"_blank\" class=\"jp-twitter-share\"><i class=\"icon-twitter icon-2x\"></i></a></li>';\r\n\t\t\t\tjq = $(code).appendTo(self.bbgCss.jq.share);\r\n\t\t\t\tjq.children(\"a\").on(\"click\",function(e) {\r\n\t\t\t\t\ttrackTwitter(getMediaTitleForTracking());\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t// facebook\r\n\t\t\tif (self.options.share.facebook.enabled) {\r\n\t\t\t\tcode = '<li><a href=\"https://www.facebook.com/sharer/sharer.php?u=' + encodeURI(self.options.share.shareLink) + '\" target=\"_blank\" class=\"jp-facebook-share\"><i class=\"icon-facebook icon-2x\"></i></a></li>';\r\n\t\t\t\tjq = $(code).appendTo(self.bbgCss.jq.share);\r\n\t\t\t\tjq.children(\"a\").on(\"click\",function(e) {\r\n\t\t\t\t\ttrackFacebook(getMediaTitleForTracking());\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t// email\r\n\t\t\tif (self.options.share.email.enabled) {\r\n\t\t\t\tcode = '<a class=\"jp-email-share\" target=\"_blank\" href=\"mailto:?subject=' + self.options.share.email.subject + '&body=' + self.options.share.email.body + '%0A%0A' + self.options.share.shareLink + '\"><i class=\"icon-envelope icon-2x\"></i></a>';\r\n\t\t\t\tjq = $('<li>' + code + '</li>').appendTo(self.bbgCss.jq.share);\r\n\t\t\t\tjq.children(\"a\").on(\"click\",function(e) {\r\n\t\t\t\t\ttrackEmail(getMediaTitleForTracking());\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t// embed\r\n\t\t\tif (self.options.share.embed.enabled) {\r\n\t\t\t\tif (self.bbgCss.jq.sharePanel && self.bbgCss.jq.sharePanel.length > 0) {\r\n\t\t\t\t\t$(self.bbgCss.css.sharePanel + ' .instructions').html(self.options.share.embed.instructions);\r\n\t\t\t\t\t$(self.bbgCss.css.sharePanel + ' .share-hide').val(self.options.share.embed.hide);\r\n\t\t\t\t\t// use existing share panel\r\n\t\t\t\t\tif (!self.bbgCss.jq.share || self.bbgCss.jq.share.length == 0) {\r\n\t\t\t\t\t\t// add to share bar and save to bbgCss for usage later\r\n\t\t\t\t\t\tself.bbgCss.jq.shaare.append('<a href=\"javascript:;\" class=\"jp-share\">Share</a>');\r\n\t\t\t\t\t\tself.bbgCss.css.share = self.bbgCss.css.ancestor + ' .jp-share';\r\n\t\t\t\t\t\tself.bbgCss.jq.share = $(self.bbgCss.css.share);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// open share panel upon share link click\r\n\t\t\t\t\tself.bbgCss.jq.share.on('click',function(e) {\r\n\t\t\t\t\t\tdisplayShareOptions();\r\n\t\t\t\t\t});\r\n\t\t\t\t\tself.bbgCss.jq.share.show();\r\n\t\t\t\t\tself.bbgCss.jq.sharePanel.hide();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// no share panel defined\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function handleDeepLinkIntent (app) {\n tellMoreAboutProject(app);\n }", "function share(action){\n\tgtag('event','click',{'event_category':'share','event_label':action});\n\t\n\tvar loc = location.href\n\tloc = loc.substring(0, loc.lastIndexOf(\"/\") + 1);\n\t\n\tvar title = '';\n\tvar text = '';\n\t\n\ttitle = shareTitle.replace(\"[SCORE]\", addCommas(playerData.score));\n\ttitle = title.replace(\"[LEVEL]\", gameData.levelNum+1);\n\ttext = shareMessage.replace(\"[SCORE]\", addCommas(playerData.score));\n\ttext = text.replace(\"[LEVEL]\", gameData.levelNum+1);\n\tvar shareurl = '';\n\t\n\tif( action == 'twitter' ) {\n\t\tshareurl = 'https://twitter.com/intent/tweet?url='+loc+'&text='+text;\n\t}else if( action == 'facebook' ){\n\t\tshareurl = 'https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(loc+'share.php?desc='+text+'&title='+title+'&url='+loc+'&thumb='+loc+'share.jpg&width=590&height=300');\n\t}else if( action == 'google' ){\n\t\tshareurl = 'https://plus.google.com/share?url='+loc;\n\t}else if( action == 'whatsapp' ){\n\t\tshareurl = \"whatsapp://send?text=\" + encodeURIComponent(text) + \" - \" + encodeURIComponent(loc);\n\t}\n\t\n\twindow.open(shareurl);\n}", "function getAccessToken() {\n /*\n *The access token is returned in the hash part of the document.location\n * #access_token=1234&response_type=token\n */\n\n const response = hash.replace(/^#/, '').split('&').reduce((result, pair) => {\n const keyValue = pair.split('=');\n result[keyValue[0]] = keyValue[1];\n return result;\n }, {});\n\n\n\n if (!localStorage.getItem(response.state)) {\n // We need to verify the random state we have set before starting the request,\n // otherwise this could be an access token belonging to someone else rather than our user\n document.getElementById('step-2').style.display = 'none';\n alert(\"CSRF Attack\");\n return;\n }\n\n if (response.access_token) {\n document.getElementById('step-1').style.display = 'none';\n } else {\n start();\n const error = document.createElement('p');\n error.innerHTML = response.error_description.split('+').join(' ');\n document.getElementById('step-1').appendChild(error);\n return;\n }\n\n localStorage.removeItem(response.state);\n\n // The token is removed from the URL\n document.location.hash = '';\n\n // The token is used to fetch the user's list of sites from the account API\n fetch('https://account-api.datocms.com/sites', {\n headers: {\n 'Authorization': 'Bearer ' + response.access_token,\n 'Accept': 'application/json',\n }\n }).then((response) => {\n return response.json();\n }).then((json) => {\n showOutput('Your sites: ' + json.data.map((site) => {\n const domain = site.attributes.domain || site.attributes.internal_domain;\n const url = `https://${domain}/`;\n const accessUrl = `${url}enter?access_token=${site.attributes.access_token}`;\n return `<a href=\"${accessUrl}\">${site.attributes.name}</a>`;\n }).join(', '));\n }).catch((error) => {\n showOutput(`Error fetching sites: ${error}`);\n });\n}", "function App() {\n // // tracking\n // let linkText = window.location.href;\n // console.log(linkText);\n // let entrySource = (linkText.match(/#/)) ? linkText.match(/#(.*?)(&|$|\\?)/)[1] : 'organic';\n // let article_id = (linkText.match(/utm_source=inline_article/)) ? linkText.match(/utm_source=inline_article_(.*?)(&|$|\\?)/)[1] : 'organic';\n // // const [entryS, setEntryS] = useState(entrySource);\n\n // switch(entrySource) {\n // case \"article\":\n // case \"base\":\n // case \"issue\":\n // break;\n // default:\n // entrySource = \"organic\";\n // TrackEvent.fireArticlePV(TrackEvent.removehash(window.location.href));\n // };\n return (\n <div>\n <Brand />\n <DistrictsEighteen >\n </DistrictsEighteen>\n </div>\n );\n}", "encodedHashtags () {\n if (this.key === 'facebook' && this.hashtags.length) {\n return '%23' + this.hashtags.split(',')[0]\n }\n\n return this.hashtags\n }", "function byApp(appName, amount, callback) {\n jitsu.logs.byApp(appName, amount, function (err, results) {\n if (err) {\n return callback(err);\n }\n putLogs(results, appName, amount);\n callback();\n });\n }", "function Share_trip(Share_id)\n{\n console.log(\"share tour\");\n \n var link =\"http://wms-dev.com/xplore/index.php/site/Shared?Tour_Id=\";\n \n if(typeof Share_id !== 'undefined')\n {\n link =link + Share_id;\n }\n else\n {\n return;\n }\n \n link=encodeURI(link);\n //alert(link);\n facebookConnectPlugin.showDialog(\n {\n method: \"feed\",\n link: link,\n caption: 'Check This Out'\n },\n function (userData_2) {\n console.log(userData_2);\n },\n function (error) {\n swal(\"\" + error);\n });\n //alert(\"share\");\n}", "function urlMaker(nameArray) {\n var urls = new Array();\n for (var i = 0; i < userArray.length; i++) {\n var name = nameArray[i];\n //API Query to return JSON status information\n urls[i] = \"https://wind-bow.gomix.me/twitch-api/streams/\" + name + \"?callback=?\";\n }\n return urls;\n }", "function App() {\n window.location.href = \"https://facebook.com/jammmg\";\n return <div className=\"App\">{/* <Navigation />\n <Home /> */}</div>;\n}", "get BASE_URL() {\n return this.USE_LOCAL_BACKEND ?\n 'http://' + manifest.debuggerHost.split(`:`).shift() + ':3000/' + this.API_VERSION :\n 'https://mhacks.org/' + this.API_VERSION\n }", "function getFlurryAllAppsInfo(){\n cc('getFlurryAllAppsInfo','run');\n $.getJSON( constructFlurryAllAppsInfoEndpoint(), function( Flurry_json ) {\n console.log('getting url_Flurry data...');\n console.log(Flurry_json);\n // Parse using javasript json parser\n console.log('@companyName:' +Flurry_json['@companyName']);\n console.log('@generatedDate:' +Flurry_json['@generatedDate']);\n console.log('@version:' +Flurry_json['@version']);\n console.log('application:');\n console.log(Flurry_json['application']);\n var all_app_versions = Flurry_json['application'];\n // loop through the version history and pass all version names to a list\n // @apiKey\":\"3R6JJMNY284SC6B3TD99\",\"@createdDate\":\"2014-10-11\",\"@platform\":\"Android\",\"@name\"\n jQuery.each(all_app_versions, function(i, vdata) {\n console.log('app_versions DATA');\n console.log(vdata);\n var this_url = window.location.href;\n var v_name = vdata['@name'];\n var v_platform = vdata['@platform'];\n var v_createdDate = vdata['@createdDate'];\n var v_apiKey = vdata['@apiKey'];\n var v_analytics_link = this_url+'analytics.html?apiKey='+v_apiKey;\n var v_app_data = '<li><h5><a class=\"link_to_analytics\" href=\"'+v_analytics_link+'\" target=\"blank\"><i class=\"fa fa-file\"></i> ' +v_name+ '<span style=\"float:right;\"><i class=\"fa fa-external-link\"></i></span></a></h5></li><li><strong><i class=\"fa fa-apple\"></i> Platform: </strong> ' +v_platform+ '</li><li><strong><i class=\"fa fa-calendar\"></i> Created: </strong> ' +v_createdDate+ '</li><li><strong><i class=\"fa fa-key\"></i> API Key: </strong> ' +v_apiKey +'</li><li style=\"display:none;\"><strong><a href=\"'+v_analytics_link+'\" target=\"blank\"><i class=\"fa fa-external-link\"></i> '+v_analytics_link+'</a></strong></li>';\n //console.log('v_version: '+v_version);\n var v_all_apps = '<li><ul class=\"app_overview\">'+v_app_data+'</ul></li>';\n // Display all apps in a list\n $('ul.all_apps').append(v_all_apps);\n });\n console.log('----- END getFlurryAllAppsInfo -----');\n });\n}", "async handleAppStateChange(url) {\n var userName = await AsyncStorage.getItem(\"username\");\n var isFirstRun=await AsyncStorage.getItem(\"firstrun\");\n setTimeout(() => {\n if (userName != null) {\n var urlData = \"\";\n if (url != null&&userName!=commons.guestuserkey()) { //Accept shared stax \n urlData = url.split(\"#\");\n commons.replaceScreen(this, 'widgetrecievebeta', { \"launchurl\": urlData[1] });\n }\n else { \n var wIdFromHSW=\"\";\n wIdFromHSW=this.props.screenProps[\"WidgetID\"];\n if(wIdFromHSW!=null&&wIdFromHSW!='undefined'&&wIdFromHSW!=undefined&&wIdFromHSW!=\"\")\n {\n commons.replaceScreen(this, \"bottom_menu\", { \"page\": \"STAX\", \"widget_id1\": wIdFromHSW });\n }\n else{\n commons.replaceScreen(this, 'bottom_menu', {});\n } \n }\n }\n else {\n if(isFirstRun==null)\n commons.replaceScreen(this, 'userypeselector', {});\n else\n commons.replaceScreen(this, 'login', {});\n }\n }, 500); \n }", "function getAppUrl() {\n return ScriptApp.getService().getUrl();\n}", "get webId () {\n\n\t\t// Author bios are a special case,\n\t\t// identified only by their prefix\n\t\tif (this.biographical) {\n\t\t\treturn `@${this.sender}`;\n\t\t}\n\n\t\t// Make the url clean and human readable\n\t\tconst s = this.title.replace(/[~!@#%^&*()+={}\\[\\]:;<>?/.,\\|'\"’‘”“`´—]/g, '').trim().split(/\\s+/).join('-').toLowerCase();\n\n\t\t// Prefix with author name and encode\n\t\treturn `@${this.sender}:${encodeURIComponent(s)}`;\t\t\n\t}", "function constructFlurryAllAppsInfoEndpoint(){\n url_app_metric_specific = 'getAllApplications';\n url_new_Flurry = base_url_Flurry + 'appInfo/' + url_app_metric_specific + '/?apiAccessCode=' + apiAccessCode;\n return url_new_Flurry;\n}", "function appendShareData (data, channel) {\n\n var detailUrl = data['detailUrl'];\n if(detailUrl && detailUrl.length) {\n if(detailUrl.indexOf('?') < 0) {\n detailUrl += ('?channel=' + channel);\n }\n else {\n detailUrl += ('&channel=' + channel);\n }\n\n data['detailUrl'] = detailUrl;\n }\n\n\n\n // 兼容以前客户端与江俊定义好的协议。\n if(data['detailUrl'] && data['detailUrl'].length) {\n data['shareUrl'] = data['detailUrl'];\n }\n // share in wx app.\n else if(data['link'] && data['link'].length) {\n data['shareUrl'] = data['link'];\n }\n\n if(data['desc'].length) {\n data['content'] = data['desc'];\n }\n else if(data['title'].length) {\n data['content'] = data['title'];\n }\n\n // 将分享URL添加到分享内容里面去。\n if(UP.W.Cordova.isIos && data.detailUrl && data.detailUrl.length) {\n data.content = data.content + data.detailUrl;\n }\n /****新浪分享添加url在分享内容中去-gaoyu***/\n var isAndroid=navigator.userAgent.indexOf('Android') > -1 || navigator.userAgent.indexOf('Linux') > -1;\n if(channel==1&&isAndroid){\n data.content = data.content + data.detailUrl;\n }\n /****新浪分享添加url在分享内容中去-gaoyu***/\n return data;\n}", "function main() {\n\n Memes.getMemesUrl(memes => {\n clearElement('feed')\n memes.forEach(meme => {\n \n let cardHtml = createMemeHtml(meme);\n insertHtml('feed', cardHtml)\n })\n })\n \n\n\n }", "function get_steam_url(websites) {\n for (var i_steam = 0; i_steam < websites.length; i_steam++) {\n if(websites[i_steam].category == 13 ) {\n var steam_url = websites[i_steam].url;\n return steam_url;\n }\n }\n }", "shareToSocialMedia(deepLink, appName, storeURL) {\n //deep link into the provided app if installed\n Linking.canOpenURL(appName.toLowerCase() + '://').then(supported => {\n if (!supported) {\n Alert.alert(`You must install the ${appName} app in order to use this feature.`,\n '',\n [{text: `Install ${appName}`, onPress: () => Linking.openURL(storeURL)},\n {text: 'Not Now'}]\n );\n //else direct user to the proper app store link\n } else {\n return Linking.openURL(deepLink);\n }\n }).catch(err => console.error('Error: ', err));\n }", "function fbShareAsLike() {\n\t// nebo s obrazkem\n\tFB.ui({\n\t\tmethod: 'share_open_graph',\n\t\taction_type: 'og.likes',\n\t\taction_properties: JSON.stringify({\n//\t\tobject:'http://x51.cz',\n\t\tobject: url_share,\n\t})\n\t}, function(response){\n\t\tconsole.log(response);\n\t});\n}", "fbShareButtonClick() {\n\n\t\tconst quoteMessage= \n\t\t\t(this.state.request) ?\n\t\t\t\t`Fuckinator fuckinated my fucking text from \"${this.state.request}\" to: \"${this.state.response}\"`: null;\n\n\t\twindow.FB.ui({\n\t\t\tmethod: 'share',\n\t\t\thref: 'http://fuckinator.herokuapp.com/',\n\t\t\thashtag: '#fuckinator',\n\t\t\tmobile_iframe: true,\n\t\t\tquote: quoteMessage,\n\t\t}, res => {});\n\t}", "constructor() {\n this.socials = [\n {url: \"https://www.linkedin.com/in/brian-j-ma/\", icon: \"https://simpleicons.org/icons/linkedin.svg\"},\n {url: \"https://github.com/bjma/\", icon: \"https://simpleicons.org/icons/github.svg\"},\n {url: \"https://www.instagram.com/freshjingjer\", icon: \"https://simpleicons.org/icons/instagram.svg\"}\n ]\n }", "brandUserInputUrls(urls) {\n return urls;\n }", "function giveCredit(creditNames){\n if (creditNames==true){\n return \"https://github.com/\"+creditNames;\n }else{ return '';\n }\n \n}", "_shareMessage(){\n Share.share({\n message:'Hello,Get the COVID-19 Contact Tracing Expo Project at https://play.google.com/store/apps/details?id=com.TwiSDAHymn.twi_hymn'\n })\n }", "function verHashtag(){\n\tvar WindowObjectReference = window.open(\"https://www.facebook.com/hashtag/comotecuidasen10palabras\", \"ver_hashtag\", \"menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes\");\n}", "navigateToSocialPage() {\n return this._navigate(this.buttons.social, 'socialPage.js');\n }", "static get instanceIdentifier() {\n return \"BITBUCKET_\";\n }", "function NgFacebook() {\n this.appId = settings.appId;\n }", "get homepageURL() {\n let url = this._formatURLPref(PREF_GETADDONS_BROWSEADDONS, {});\n return (url != null) ? url : \"about:blank\";\n }", "function constructFlurryAppInfoEndpoint(){\n url_app_metric_specific = 'getApplication';\n url_new_Flurry = base_url_Flurry + 'appInfo/' + url_app_metric_specific + '/?apiAccessCode=' + apiAccessCode + '&apiKey=' + apiKey;\n return url_new_Flurry;\n}", "function onDomain() {\n if (window.location.href.indexOf('https://junn3r.github.io/') != -1) {\n return true;\n } else {\n return false;\n }\n }", "function facebookLogin()\r\n{\r\n var fb = FBConnect.install();\r\n fb.connect(client_id,redir_url,\"touch\");\r\n fb.onConnect = onFBConnected;\r\n \r\n}", "constructor() {\n this.apiUrl = 'https://graph.facebook.com/v4.0';\n this.access_token = process.env.ACCESS_TOKEN;\n }", "shareToSocialMedia(deepLink, appName, storeURL) {\n //deep link into the provided app if installed, else direct user to the proper app store link\n Linking.canOpenURL(appName.toLowerCase() + '://').then(supported => {\n if (!supported) {\n Alert.alert(`You must install the ${appName} app in order to use this feature.`,\n '',\n [{text: `Install ${appName}`, onPress: () => Linking.openURL(storeURL)},\n {text: 'Not Now'}]\n );\n } else {\n return Linking.openURL(deepLink);\n }\n }).catch(err => /*Alert.alert('Error; ', err), */console.error('Error: ', err));\n }", "function getAgmId(comments) {\n for (c of comments) {\n if (c.body.includes('Linked to Agile Manager')) {\n return c.body.split('API ID #')[1].slice(0, -1);\n }\n }\n }", "_showPlayStore() {\n window.open('https://play.google.com/store/apps/details?id=<PLAY_PACKAGE_NAME>', '_blank');\n }", "function Head({ params }) {\n return (\n <>\n <meta name=\"theme-color\" content=\"#18684d\" />\n <title>Página não encontrada - Site Base</title>\n <meta\n name=\"description\"\n content=\"Poxaa! Não conseguimos encontrar a página que você estava buscando.\"\n />\n <meta property=\"og:title\" content=\"Página não encontrada - Site Base\" />\n <meta name=\"title\" content=\"Página não encontrada - Site Base\" />\n <meta\n property=\"og:description\"\n content=\"Poxaa! Não conseguimos encontrar a página que você estava buscando.\"\n />\n <link\n rel=\"apple-touch-icon\"\n href=\"https://piscinapraia.com.br/logo192.png\"\n />\n <meta\n rel=\"icon\"\n type=\"image/png\"\n href=\"https://piscinapraia.com.br/logo192.png\"\n />\n <meta\n property=\"og:image\"\n content=\"https://piscinapraia.com.br/logo512.png\"\n />\n <meta property=\"og:site_name\" content=\"Site Base\" />\n <meta property=\"og:url\" content=\"https://piscinapraia.com.br\" />\n <link rel=\"manifest\" href=\"public/manifest.json\" />\n <meta property=\"og:image:type\" content=\"image/jpeg\" />\n <meta property=\"og:image:width\" content=\"800\" />\n <meta property=\"og:image:height\" content=\"420\" />\n <meta property=\"og:locale\" content=\"pt_BR\" />\n <meta property=\"og:type\" content=\"website\" />\n <link rel=\"icon\" href=\"/public/favicon.ico\" />\n </>\n );\n}", "function triggerRepresentationByHistory(startDate,endDate,blacklist) {\n chrome.history.search({text: '', startTime:startDate, endTime:endDate}, function (data) {\n if(localStorage[\"hostname\"] == \"\"){\n var list = {};\n data.forEach(function(page) {\n if(!isBlackListed(blacklist,page.url) && (extractHostname(page.url) != extractHostname(chrome.extension.getURL(\"\")))){\n var string = extractHostname(page.url);\n if(list[string] == null){\n httpGetAsync(extractHostname(page.url));\n list[string] = 1;\n }\n }\n });\n }else{\n var contor = 0;\n data.forEach(function(page) {\n if(!isBlackListed(blacklist,page.url) && (extractHostname(page.url) == localStorage[\"hostname\"]) && contor < results && !containCharacter(page.url,\";\")){\n contor = contor + 1;\n httpGetAsync(page.url);\n }\n });\n\n }\n localStorage[\"hostname\"] = \"\";\n });\n\n document.getElementById(\"dateSubmit\").disabled = false;\n}", "getAppName() {\n return process.env.APP_NAME;\n }", "domain() {\n const domain = this.props.notice.DOMN;\n if (!domain || !Array.isArray(domain) || !domain.length) {\n return null;\n }\n const links = domain\n .map(d => (\n <a href={`/search/list?domn=[\"${d}\"]`} key={d}>\n {d}\n </a>\n ))\n .reduce((p, c) => [p, \", \", c]);\n return <React.Fragment>{links}</React.Fragment>;\n }", "onOpenNewGhPersonalAccessTokenClick () {\n shell.openExternal('https://github.com/settings/tokens/new')\n }", "function addFollows(follows) {\n var logo = \"https://www.gravatar.com/avatar/a2b6df699ae0cd59f5077a5cae4cf994/?s=80&r=pg&d=mm\";\n var status = \"\";\n var online = false;\n // Add a Twitch account that was closed\n if (follows.indexOf(\"brunofin\") === -1) { follows.push([\"brunofin\",status,logo,online]); }\n // Add a Twitch account that never existed\n if (follows.indexOf(\"comster404\") === -1) { follows.push([\"comster404\",status,logo,online]); }\n // Add some Twitch accounts that are usually active\n if (follows.indexOf(\"OgamingSC2\") === -1) { follows.push([\"OgamingSC2\",status,logo,online]); }\n if (follows.indexOf(\"ESL_SC2\") === -1) { follows.push([\"ESL_SC2\",status,logo,online]); }\n if (follows.indexOf(\"cretetion\") === -1) { follows.push([\"cretetion\",status,logo,online]); }\n if (follows.indexOf(\"freecodecamp\") === -1) { follows.push([\"freecodecamp\",status,\"https://static-cdn.jtvnw.net/jtv_user_pictures/freecodecamp-profile_image-d9514f2df0962329-300x300.png\",online]); }\n if (follows.indexOf(\"storbeck\") === -1) { follows.push([\"storbeck\",status,logo,online]); }\n if (follows.indexOf(\"habathcx\") === -1) { follows.push([\"habathcx\",status,logo,online]); }\n if (follows.indexOf(\"RobotCaleb\") === -1) { follows.push([\"RobotCaleb\",status,logo,online]); }\n if (follows.indexOf(\"noobs2ninjas\") === -1) { follows.push([\"noobs2ninjas\",status,logo,online]); }\n }", "function displaySocial() {\n Reddcoin.viewSocialNetworks.getView();\n}", "function runme() {\n var arr = [\"https://www.restaurantbateau.com/\", \n \"https://www.nueseattle.com/\", \n \"http://www.terraplata.com/\", \n \"https://www.facebook.com/aplushkkitchen/\", \n \"https://catering.gourmondoco.com/index.cfm?fuseaction=order&action=menu-category&category-id=191\", \n \"https://www.ladyjaye.com/\", \n \"https://www.buddhabruddah.com/\", \n \"https://falafelsalam.com/\", \n \"https://www.haymakerseattle.com/\", \n \"http://www.bakerynouveau.com/\", \n \"https://www.islandsoulrestaurant.com/\", \n \"https://www.restauranthomer.com/\", \n \"https://www.eightrow.com/\", \n \"https://facebook.com/Cafe-Munir-117120638400154/\", \n \"https://www.facebook.com/watsonscounter/\", \n \"https://delanceyseattle.com/\", \n \"https://www.eatatporkchop.com/\", \n \"https://www.artofthetable.net/\", \n \"https://www.thewhalewins.com/\", \n \"https://www.kamonegiseattle.com/\", \n \"http://uneedaburger.com/\", \n \"http://elcaminorestaurant.com/\", \n \"https://www.the5pointcafe.com/\", \n \"https://www.agrodolcefremont.com/\", \n \"https://www.instagram.com/alisonscoastalcafe/\", \n \"https://anjuseattle.com/\", \n \"https://www.bangbangseattle.com/cafe\", \n \"https://www.bardelcorso.com/\", \n \"https://benparis.com/\", \n \"https://www.bluestarcafeandpub.com/\", \n \"https://www.buddhabruddah.com/\", \n \"https://burgermaster.biz/\", \n \"https://caffeappassionato.com/\", \n \"https://canlis.com/\", \n \"https://delfinospizza.com\", \n \"https://dintaifungusa.com/locations.html\", \n \"https://duecucina.com/\", \n \"https://elliottbaybrewing.com\", \n \"https://www.elliottbaybrewing.com/\", \n \"https://elliottbaybrewing.com\", \n \"https://frans.com/\", \n \"http://www.harrysfinefoods.com/\", \n \"https://www.birthdaysdontstop.com/\", \n \"http://jadegardenseattle.com/\", \n \"https://javajahn.com/\", \n \"https://jimmysonbroadway.com\", \n \"https://kabulrestaurant.com/\", \n \"http://www.kaukaubbq.com/\", \n \"https://www.kindeeseattle.com/\", \n \"http://www.kneehighstocking.com/\", \n \"https://www.rmdessertbar.com/\", \n \"https://mamnoonrestaurant.com/\", \n \"https://marjorierestaurant.com/\", \n \"https://www.mashikorestaurant.com/\", \n \"http://mirotea.com/\", \n \"http://mrwestcafebar.com/\", \n \"http://mrwestcafebar.com/\", \n \"https://www.oldstove.com/\", \n \"https://www.onsafarifoods.com/online-ordering\", \n \"https://www.paragonseattle.com/\", \n \"https://seattle.piatti.com/\", \n \"https://www.pilgrimcoffeehouse.com/\", \n \"https://plumbistro.com\", \n \"https://rachelsgingerbeer.com/\", \n \"https://rachelsgingerbeer.com/\", \n \"https://www.ristorantemachiavelli.com/\", \n \"http://rocket-taco.com/seattle/\", \n \"https://www.samchoyspoke.com/\", \n \"https://spark.adobe.com/page/fA6c9GFhgTJc3/\", \n \"https://www.taitungrestaurant.com/\", \n \"http://www.tasteofthecaribbeanseattle.com/\", \n \"https://www.marriott.com/hotels/hotel-information/restaurant/seasm-renaissance-seattle-hotel/\", \n \"https://theBridgeSeattle.com\", \n \"http://fremontdock.com/\", \n \"https://www.marriott.com/hotels/hotel-information/restaurant/seasm-renaissance-seattle-hotel/\", \n \"https://matadorrestaurants.com/\", \n \"https://mecca-cafe.com/\", \n \"http://theyardcafe.com/\", \n \"https://www.chefmariahines.com/\", \n \"http://trailbendtaproom.com/\", \n \"https://www.themaplepub.com/\", \n \"https://www.wildginger.net/\", \n \"https://www.facebook.com/burienpress/\", \n \"https://www.facebook.com/moonshotcoffee/\", \n \"https://proletariatpizza.com\", \n \"https://ethanstowellrestaurants.com/order\", \n \"https://togo.famousdaves.com\", \n \"https://ethanstowellrestaurants.com/order\", \n \"https://geraldinescounter.com\", \n \"https://www.copineseattle.com/\", \n \"https://ethanstowellrestaurants.com/order\", \n \"https://jerkshackseattle.com/\", \n \"https://www.boatstreetkitchen.com/\", \n \"https://www.themetropolitangrill.com/\", \n \"https://localpubliceatery.com/neighbourhoods/terry-ave/\", \n \"http://gainsbourglounge.com/\", \n \"https://www.piroshkybakery.com/\", \n \"https://nijosushi.com/\", \n \"http://jacksbbq.com/\", \n \"https://www.norensushi.com\", \n \"https://patagonseattle.com\", \n \"https://www.skylarkcafe.com/\", \n \"https://soicapitolhill.com/\", \n \"https://thedaneseattle.com\", \n \"https://yeslerwayseattlewa.thehalalguys.com\", \n \"https://facebook.com/Viengthong206\", \n \"https://thewingdome.com/\", \n \"http://www.raccoltoseattle.com/\", \n \"https://www.yenworvillagewa.com/\", \n \"https://www.miopostopizza.com/\", \n \"https://www.bangbangseattle.com/\", \n \"https://www.judesoldtown.com/\", \n \"http://www.waywardvegancafe.com/\", \n \"https://www.arthursseattle.com/#arthurscollective\", \n \"https://babarseattle.com/capitol-hill/\", \n \"https://marinationmobile.com\", \n \"https://www.baitongthaistreetcafe.com/\", \n \"https://www.facebook.com/pg/Betsutenjin-Ramen-USA-112504659439834\", \n \"https://cactusrestaurants.com/location/south-lake-union/\", \n \"https://callunaseattle.com/curb-side-pickup/\", \n \"https://southtownpie.com/stp-contact/\", \n \"https://www.yannis-greek-restaurant.com/\", \n \"http://Katyscornercafe.com\", \n \"http://witnessbar.com/\", \n \"https://www.willmottsghost.com/\", \n \"https://www.eatatbetty.com/\", \n \"https://www.tljus.com/\", \n \"https://www.toppotdoughnuts.com\", \n \"https://coppercoinseattle.com/\", \n \"https://cutterscrabhouse.com/\", \n \"http://www.thaithanikitchen.com/SouthLakeUnion.html\", \n \"https://www.elchupacabraseattle.com/\", \n \"https://www.elchupacabraseattle.com/\", \n \"http://www.elfarolseattle.com\", \n \"https://www.seattlemeetsoaxaca.com/el-mezcalito/\", \n \"https://www.seattlemeetsoaxaca.com/la-carta-de-oaxaca/\", \n \"https://evergreens.com/locations/\", \n \"https://evergreens.com/locations/\", \n \"http://www.franksoysterhouse.com/\", \n \"https://tacodelmar.com/\", \n \"https://heritagedistilling.com/\", \n \"https://heritagedistilling.com/\", \n \"http://hurrycurryoftokyo-seattle.com/\", \n \"https://www.lupofremont.com/\", \n \"https://www.specialtys.com/location.aspx?store=se10&utm_source=google&utm_medium=local-listings&utm_campaign=seattle&utm_content=520-terry-ave-n\", \n \"https://www.southpawpizza.com/\", \n \"https://order.habitburger.com/store/a17ff353-018d-e911-822e-02838e5eb552/category/cfcbb04a-c88e-e911-8259-020f3289bcb6\", \n \"https://order.habitburger.com/store/7de7f1ee-c4dc-e811-822e-02eaf1e04748/category/cfcbb04a-c88e-e911-8259-020f3289bcb6\", \n \"http://www.bakerynouveau.com/\", \n \"https://www.chowfoods.com/endolyne-joes\", \n \"https://ezellschicken.com/\", \n \"https://ezellschicken.com/\", \n \"https://www.serendipitycafeandlounge.com\", \n \"https://ezellschicken.com/\", \n \"https://www.mcgilvraspub.com/\", \n \"http://www.samurainoodle.com/location/index.html\", \n \"http://www.samurainoodle.com/location/index.html#\", \n \"http://northstardiner.com/\", \n \"https://www.razzispizza.com/\", \n \"https://www.razzispizza.com/\", \n \"https://www.perihelion.beer/\", \n \"http://www.panwathai.com/index.html\", \n \"https://www.ohanasushigrill.com/\", \n \"https://www.nirmalseattle.com/\", \n \"https://www.modern-seattle.com/\", \n \"http://mezcaleriaoaxaca.com/\", \n \"https://www.meetkoreanbbq.com/\", \n \"https://marinationmobile.com/locations\", \n \"https://www.lecoinseattle.com/\", \n \"https://www.ladyyum.com\", \n \"https://fogonseattle.com/\", \n \"https://www.facebook.com/FeedCoBurgersCentral/\", \n \"https://www.bongosseattle.com/\", \n \"https://www.kizuki.com/\", \n \"https://www.miopostopizza.com/\", \n \"https://www.miopostopizza.com/\", \n \"https://cactusrestaurants.com/location/madison-park/\", \n \"https://www.ddir.com\", \n \"https://www.kiddvalley.com\", \n \"https://www.ethanstowellrestaurants.com/locations/tavolata-capitol-hill/\", \n \"https://www.ethanstowellrestaurants.com/locations/rione-xiii/\", \n \"https://www.ethanstowellrestaurants.com/locations/red-cow/\", \n \"https://www.bluwaterbistro.com/locations/leschi/\", \n \"https://orders.modpizza.com/\", \n \"https://orders.modpizza.com/\", \n \"https://orders.modpizza.com/\", \n \"https://orders.modpizza.com/\", \n \"https://orders.modpizza.com/\", \n \"https://www.othercoastcafe.com/\", \n \"https://www.othercoastcafe.com/\", \n \"https://www.thatsamoreseattle.com/\", \n \"https://www.kizuki.com\", \n \"https://www.coneandsteiner.com/\", \n \"http://lorettasnorthwesterner.com/\", \n \"https://www.cherryst.com\", \n \"https://www.cherryst.com/locations\", \n \"https://www.cherryst.com\", \n \"https://www.plentyofclouds.com/\", \n \"https://www.potbelly.com/stores/23391\", \n \"https://www.potbelly.com/\", \n \"https://www.potbelly.com/\", \n \"https://www.potbelly.com/\", \n \"https://www.specialtys.com/Location.aspx?Store=SE02\", \n \"https://www.specialtys.com/Location.aspx?Store=SE05\", \n \"https://www.specialtys.com/Location.aspx?Store=SE01\", \n \"https://www.specialtys.com/Location.aspx?Store=SE08\", \n \"https://www.cherryst.com\", \n \"https://www.cherryst.com\", \n \"https://www.cherryst.com\", \n \"https://www.cherryst.com\", \n \"http://www.flyingsquirrelpizza.com/about.php\", \n \"http://www.flyingsquirrelpizza.com\", \n \"https://easystreetonline.com/Cafe\", \n \"https://coastlineburgers.com/\", \n \"https://www.seattlefishcompany.com\", \n \"https://www.ayutthayathai.com/\", \n \"http://www.thesushisamurai.com\", \n \"https://www.ravennavarsity.com/\", \n \"https://www.eltana.com/order\", \n \"https://www.eltana.com/order\", \n \"https://www.mightyo.com/ways-to-order/\", \n \"https://www.mightyo.com/ways-to-order/\", \n \"https://www.mightyo.com/ways-to-order/\", \n \"http://crawfishkingwa.com/#/\", \n \"https://www.taprootseattle.com/\", \n \"https://ondaorigins.com/\", \n \"https://www.ivars.com/\", \n \"https://www.ivars.com/all-locations\", \n \"https://www.kiddvalley.com/\", \n \"https://www.kiddvalley.com/\", \n \"https://www.buhowhitecenter.com/\", \n \"https://www.underbellyofseattle.com/\", \n \"http://www.bokabokchicken.com/\", \n \"http://www.bokabokchicken.com/\", \n \"https://www.portagebaycafe.com/\", \n \"https://www.thewestyseattle.com/\", \n \"https://westfive.com/\", \n \"https://lunaparkcafe.com/\", \n \"http://jaksgrill.com/\", \n \"http://bluemoonburgers.com/\", \n \"https://christosonalki.com/\", \n \"https://www.circalove.com/\", \n \"https://www.westseattleswinery.com/\", \n \"https://www.ittostapas.com/\", \n \"https://westofchicagopizzacompany.com/\", \n \"http://www.freshfloursseattle.com/\", \n \"http://www.freshfloursseattle.com/\", \n \"http://www.stoupbrewing.com\", \n \"https://www.junebabyseattle.com/welcome\", \n \"http://www.ravennabrewing.com/\", \n \"http://sunlightcafevegetarian.com/\", \n \"https://www.olmsteadseattle.com/\", \n \"https://www.olympiapizza3.com/\", \n \"http://www.populuxebrewing.com\", \n \"https://belleepicurean.com/\", \n \"https://belleepicurean.com/\", \n \"https://www.vitosseattle.com/#overview\", \n \"https://www.elysianbrewing.com/herewithyou\", \n \"https://www.olympiapizzapasta.com/\", \n \"http://www.soundandfog.com\", \n \"https://www.jimmysonfirst.com\", \n \"https://www.maximilienrestaurant.com/le-meal-bag/\", \n \"http://relishbistroseattle.com\", \n \"https://www.arashiramen.com/\", \n \"https://www.arashiramen.com/\", \n \"https://www.evefremont.com/\", \n \"https://squareup.com/store/stone-way-cafe\", \n \"https://www.seattlechukis.com/\", \n \"https://www.seattlechukis.com/\", \n \"https://www.seattlechukis.com/\", \n \"https://www.seattlechukis.com/\", \n \"http://bottegaitaliana.com/\", \n \"https://cinnamonworks.com/\", \n \"https://www.honestbiscuits.com\", \n \"https://indichocolate.com/\", \n \"https://michoudeli.com/menu/\", \n \"https://www.mrdsgreekdelicacies.com/\", \n \"https://www.pikespit.com/\", \n \"http://seattlebagel.com/\", \n \"https://stories.starbucks.com/stories/2015/store-tour-inside-1912-pike-place-seattle-usa/\", \n \"https://taproomatpikeplace.com/\", \n \"https://threegirlsbakery.com/\", \n \"https://ulisfamoussausage.com/\", \n \"https://www.bestofhandsbarrelhouse.com/home\", \n \"https://phoanlakecity.hrpos.heartland.us/\", \n \"https://www.doughzonedumplinghouse.com/restaurant-locator\", \n \"http://www.2cthai.com/\", \n \"https://www.beyondthebowl.net/\", \n \"https://www.josestaqueria.com/\", \n \"https://www.manousheexpress.com/\", \n \"https://www.thaioneonseattle.com/\", \n \"http://www.saffrongrillseattle.com\", \n \"https://www.blazingbagels.com\", \n \"http://www.brownrigghardcider.com\", \n \"https://www.efeste.com\", \n \"https://madwine.com\", \n \"https://falllinewinery.com\", \n \"https://ghostfish-brewing-order-to-go.square.site\", \n \"https://kerloocellars.com\", \n \"http://Mrbsmeadery.business.site\", \n \"https://www.ethanstowellrestaurants.com/locations/seltzery/\", \n \"http://www.tasteofindiaseattle.com\", \n \"https://www.machinehousebrewery.com/\", \n \"http://www.stellarpizza.com/index.html\", \n \"https://www.smartypantsseattle.com/\", \n \"http://jellyfishbrewing.com/\", \n \"http://georgetownliquorco.com/\", \n \"https://www.fullthrottlebottles.com/\", \n \"https://winesofsubstance.com/\", \n \"http://counterbalancebeer.com/\", \n \"https://www.raizseattle.com\", \n \"https://chuminhtofu.com\", \n \"https://www.hardwokcafeseattle.com/\", \n \"http://www.heydayseattle.com/\", \n \"https://www.lamsseafood.com/\", \n \"https://www.lovinghutseattle.com/\", \n \"https://www.seattlemilacay.com/\", \n \"https://www.thephobac.com/\", \n \"https://phnompenh.hrpos.heartland.us/\", \n \"http://www.saigonvndeli.com/\", \n \"https://peddler-brewing-company.square.site/\", \n \"https://www.sevenstarspepper.com/\", \n \"https://songphangkongseattle.com/\", \n \"https://tamarindtreerestaurant.com/\", \n \"https://thanhviseattle.com/\", \n \"http://tsukushinbo.juisyfood.com/\", \n \"http://amysmerkato.com/menu/\", \n \"https://pestlerock.com/\", \n \"https://www.sennoodlebar.com/\", \n \"https://twodoorsdown.square.site\", \n \"http://www.kaffeeklatschseattle.com/\", \n \"http://www.buddharuksa.com\", \n \"https://www.facebook.com/musashis/\", \n \"http://donluchosinseattle.com/\", \n \"https://www.uptownchinaseattle.com/menu.aspx\", \n \"https://www.georgetownbeer.com/\", \n \"http://www.slimslastchance.com/\", \n \"http://www.bin41wine.com/Site/bin_41_intro.html\", \n \"https://dreamdinners.com/main.php?page=store&id=54\", \n \"https://www.facebook.com/greatamericandinerbar/\", \n \"https://www.flyingapron.com/\", \n \"https://www.tensushiseattle35.com/\", \n \"https://www.tensushiseattle.com/\", \n \"https://www.8ozburgerandco.com\", \n \"https://badjimmysbrewery.com/\", \n \"http://www.ballardbeercompany.com/\", \n \"https://dambrosiogelato.com/\", \n \"https://gatherkitchenandbar.com/menus\", \n \"http://www.graciaseattle.com/\", \n \"https://halesbrewery.com/\", \n \"http://hatties-hat.com\", \n \"https://www.katsuburger.com/copy-of-ballard\", \n \"http://www.kitchen-istanbul.com/\", \n \"http://www.seattleindiabistro.com/Dinner_Menu.html\", \n \"http://www.hotelalbatross.com/\", \n \"https://www.facebook.com/LockandKeel/\", \n \"https://locustcideronline.square.site/\", \n \"http://mabelcoffee.com/\", \n \"https://maritimebrewery.com\", \n \"https://www.mrgyroseattle.com/\", \n \"http://palermoballard.squarespace.com/\", \n \"https://patxispizza.com/location/ballard/\", \n \"https://www.piebarballard.com/\", \n \"http://pinkbeewa.smiledining.com\", \n \"http://poke-square.com/#locations\", \n \"https://reubensbrews.com/\", \n \"https://saltandstraw.com/pages/ballard\", \n \"https://www.saltandsugarcafe.com/\", \n \"https://www.scanspecialties.com/\", \n \"https://thesecretsavory.com\", \n \"https://www.facebook.com/Nikos-Gyros-Beacon-Hill-385414422005563/\", \n \"https://www.sipandship.com/\", \n \"https://www.facebook.com/LittleChengdu/\", \n \"http://www.skalballard.com/\", \n \"https://sushiiballard.com\", \n \"http://themonkeybridge.com\", \n \"https://senormoose.com/\", \n \"https://bananagrillseattle.com/\", \n \"https://thenoblefir.com/\", \n \"https://thecomfortzonesoulfood.com/\", \n \"https://www.rainierrestaurant.com/\", \n \"https://www.facebook.com/cortefino206/\", \n \"https://www.facebook.com/pg/huongduong.sunflower/about/?ref=page_internal\", \n \"http://663bistrotogo.com\", \n \"https://www.facebook.com/Bun-Bo-Hue-Hoang-Lan-170431412980541/\", \n \"http://asibarbqueseattle.com\", \n \"https://www.facebook.com/pages/Othello-Wok-Teriyaki/474889102584360\", \n \"https://www.facebook.com/kaffacoffeeseattle/\", \n \"http://www.bushgarden.net/\", \n \"https://www.facebook.com/Union-bar-and-restaurant-602348090272395/\", \n \"https://www.facebook.com/CongeezBreakfast/\", \n \"http://cafeeastern.com\", \n \"https://www.hotwirecoffee.com/\", \n \"https://www.huskydeli.com/\", \n \"http://www.lulacoffee.com/\", \n \"https://fortunacafeseattle.com\", \n \"https://www.fujisushiseattle.com/\", \n \"http://www.maharajawestseattle.com/\", \n \"http://goldenwheatbakeryseattle.cafecityguide.website\", \n \"http://greenleaftaste.com/#!/home/\", \n \"http://nikkoteriyaki.com/\", \n \"http://www.harborcityrestaurant.com/\", \n \"https://www.hohoseafood.com/\", \n \"https://houseofhongseattle.com/\", \n \"https://pizzeriacredo.com/\", \n \"http://joyaleseafood.com\", \n \"http://puertovallartawestseattle.com/\", \n \"http://www.yummyhousebakery.com/\", \n \"http://www.tacosguaymas.com/\", \n \"https://www.foodbooking.com/ordering/restaurant/menu?company_uid=6f1c2487-f756-4933-a66e-823549618df2&restaurant_uid=a30aab44-6739-4ffd-8722-cd389b1fd106&facebook=true\", \n \"http://newstarseafood.com\", \n \"https://www.oceanstarseattle.com/\", \n \"https://www.seattlefishguys.com\", \n \"http://www.seoul-tofu-house-seattle.com\", \n \"https://www.sizzlingpotking.net/\", \n \"https://bistroboxrestaurant.com/\", \n \"https://theshopclubs.com/derby/\", \n \"http://jacksbbq.com/\", \n \"https://macrinabakery.com/\", \n \"https://ninepiespizza.com/\", \n \"https://www.paseorestaurants.com/\", \n \"https://www.pecospit.com/\", \n \"http://phocyclocafe.com/\", \n \"http://pick-quick.com/\", \n \"http://www.sliceboxpizza.com/\", \n \"https://www.facebook.com/sodochicken\", \n \"http://sodopoke.com/\", \n \"https://crepesandwine.com/\", \n \"https://www.emeraldcitysmoothie.com/\", \n \"https://nilespeacock.com \", \n \"https://www.facebook.com/JavaJiveThru/\", \n \"https://www.opuscorestaurant.com/\", \n \"https://www.facebook.com/elcostenoSODO/\", \n \"https://www.tljus.com/\", \n \"http://www.takismadgreek.com/\", \n \"https://nuflours.com/\", \n \"https://www.seoulbowlco.com/\", \n \"https://www.facebook.com/SAGO-Kitchen-105376394299988/\", \n \"https://www.thewildmountaincafe.com/\", \n \"https://www.anthonys.com/restaurants/detail/little-chinooks/\", \n \"https://athenasfoodtrucks.com/\", \n \"https://www.anthonys.com/restaurants/detail/anthonys-beach-cafe/\", \n \"https://bangbarthai.com/\", \n \"https://beveridgeplacetogo.square.site/\", \n \"https://www.wondersportbar.com/\", \n \"http://www.bossdrivein.com/\", \n \"https://karaagesetsuna.com/\", \n \"https://www.caffeladro.com/locations/west-seattle-caffe-ladro/\", \n \"https://cafeflora.com/\", \n \"https://www.coldcrashbrewing.com/\", \n \"https://www.grillbird.com/\", \n \"http://www.dubseacoffee.com/\", \n \"https://www.duospickup.com/\", \n \"https://banhtown.com/\", \n \"https://www.unionsaloonseattle.com/\", \n \"https://www.sushikudasaiseattle.com/\", \n \"https://macstrianglepub.com/\", \n \"http://www.snoutandco.com\", \n \"https://www.thestonehousecafe.com/\", \n \"http://www.cookweaver.com/\", \n \"https://www.curecocktail.com/\", \n \"https://www.luigisitalianeatery.com/\", \n \"https://www.futureprimitivebeer.com/\", \n \"https://www.pineboxbar.com/\", \n \"https://www.chowfoods.com/tnt-taqueria\", \n \"https://www.galosusa.com/\", \n \"http://www.teriyaki-madness-seattle.com/\", \n \"https://pizza.dominos.com/washington/seattle/2320-n-45th-st/\", \n \"https://www.kisaku.com/\", \n \"https://flyingbike.coop/\", \n \"https://locustcideronline.square.site/\", \n \"https://locustcideronline.square.site/\", \n \"https://www.tacosandbeerseattle.com/\", \n \"https://www.saltoroseattle.com/\", \n \"http://ordersalvadoreanbakery.com/\", \n \"http://www.woodlandspizza.com/contact/\", \n \"https://patrickscafeandbakery.com/\", \n \"https://www.goodweatherinseattle.com/\", \n \"https://www.tippeanddrague.com/\", \n \"https://www.pizzutositalian.com/\", \n \"https://fitbarcafe.com/west-seattle-store-hours\", \n \"https://www.facebook.com/pg/freshyscoffee\", \n \"https://www.greenbridgecafe.com/\", \n \"https://www.indulgedessertsllc.com/\", \n \"https://www.facebook.com/pg/itsbbqtimealki/posts/?ref=page_internal\", \n \"https://locations.papajohns.com/united-states/wa/98105-2436/seattle/5401c-25th-ave-ne\", \n \"https://www.facebook.com/LittlePragueBakery/\", \n \"http://locolseattle.com/#\", \n \"http://westseattle.mylucianos.com/zgrid/proc/site/sitep.jsp\", \n \"https://pecadobueno.com/\", \n \"https://www.menchies.com/locations/frozen-yogurt-admiral-wa/catering\", \n \"https://www.missioncantinaseattle.com/\", \n \"https://pecadobueno.com/\", \n \"https://9th-hennepin-donuts.square.site/\", \n \"https://ounceswestseattle.com\", \n \"http://zippysgiantburgers.com/\", \n \"https://zeekspizza.com/locations-hours/zeeks-pizza-west-seattle/\", \n \"https://www.spicewaala.com/\", \n \"https://youngstowncoffeeco.com/\", \n \"http://wildwoodwestseattle.com/\", \n \"https://www.westseattlegrounds.com/\", \n \"https://westseattlewinecellars.com/\", \n \"http://www.pettirossoseattle.com/\", \n \"https://westseattlebrewing.com/\", \n \"http://www.highlinerpub.net/\", \n \"https://www.yoroshikuseattle.com/\", \n \"https://www.facebook.com/themustardseedcafe/\", \n \"https://www.pecospit.com/west-seattle/\", \n \"https://peelandpressws.com\", \n \"https://pegasuspizza.com/\", \n \"https://www.phoeneciawestseattle.com/\", \n \"https://www.whiteswanpublichouse.com/\", \n \"https://pizzeria22.com/\", \n \"https://order.menudrive.com/mobile/sopranospizzawest#restaurantDetailsPage\", \n \"https://ilovespiros.com/locations/\", \n \"https://www.tangletownpublichouse.com/\", \n \"http://www.thebryantcornercafe.com/\", \n \"https://www.springhousethaikitchenandpho.com/\", \n \"https://www.alkispud.com/\", \n \"http://srivilaithai.com/\", \n \"https://scarlet-rhubarb-shrj.squarespace.com/\", \n \"https://www.ericriveracooks.com/\", \n \"https://www.urbansushikitchen.com/\", \n \"https://www.lulasalads.com/store\", \n \"https://pokefresh.me/\", \n \"https://www.frelardtamales.com/\", \n \"https://www.mainstayprovisions.com/\", \n \"https://www.paseorestaurants.com/\", \n \"http://bountykitchenseattle.com/\", \n \"https://orders.cake.net/11104736\", \n \"https://www.tekutavern.beer/\", \n \"https://cloudburstbrew.com/#\", \n \"https://orders.cake.net/11276538\", \n \"https://www.busstopespresso.com/\", \n \"http://cortonacafe.com/#the-kitchen\", \n \"http://www.thaifusionbistro.com\", \n \"https://geosbarandgrill.com/\", \n \"http://ballardkisscafe.com/\", \n \"https://barcottopizzeria.com/\", \n \"https://www.nielsenspastries.com/\", \n \"http://www.thaithanikitchen.com\", \n \"https://elementalpizza.com/\", \n \"https://thebutcherstable.com/\", \n \"https://www.aokisushiandgrill.com/\", \n \"https://pastaco.com/\", \n \"https://www.frankiesbtownbistro.com/takeout/\", \n \"https://casa-del-mariachi.negocio.site/\", \n \"https://www.beachcomber.com\", \n \"https://www.normseatery.com\", \n \"http://www.madpizza.com/\", \n \"https://www.bottlehouseseattle.com/\", \n \"https://www.byenbakeri.com/\", \n \"https://www.ruthschris.com/restaurant-locations/seattle/\", \n \"https://metropolitandelicafefh.com/\", \n \"https://www.facebook.com/cafezumzumsea/\", \n \"https://www.36stone.com/\", \n \"https://tamnoodlebox.com/\", \n \"https://standardbrew.com/\", \n \"https://g.page/fresh-deli-mart?gm\", \n \"https://www.shiros.com\", \n \"https://www.facebook.com/pages/Bento-World/117781248248063\", \n \"http://www.delimeatsbar.com/#about\", \n \"https://www.trianglefremont.com/\", \n \"http://www.domaniqueenanne.com/\", \n \"http://banhtown.com/\", \n \"https://www.facebook.com/pages/Yume-Sushi/221088681813188\", \n \"https://www.welcomeroadwinery.com/\", \n \"https://www.facebook.com/pages/Wanna-Teriyaki-and-Burger/589778237737368\", \n \"https://www.visconcellars.com/\", \n \"https://chameleon-cinnamon-xjjk.squarespace.com/\", \n \"https://www.facebook.com/unwindcafellc\", \n \"https://www.blazingbagels.com/locations\", \n \"https://www.facebook.com/2fingerssocial/\", \n \"https://toshisgrill.com/toshis-teriyaki-seattle-westwood-village\", \n \"https://thepantryseattle.com/\", \n \"https://www.goodsocietybeer.com/\", \n \"http://www.tacosymariscoseltiburon.club/?utm_source=google&utm_medium=website&utm_campaign=Tacos%20y%20Mariscos%20El%20Tiburon&utm_term=5b735b1d59b86a0001f3746e\", \n \"https://www.supreme.bar/\", \n \"https://www.pickledpreserved.com/\", \n \"http://www.himalayansherpahouse.com/\", \n \"https://ramendanbo.com/\", \n \"http://sawyerseattle.com/\", \n \"https://www.monorailespresso.com/\", \n \"https://www.monorailespresso.com/\", \n \"https://tacodelmar.com/\", \n \"https://www.katespub.com/\", \n \"https://otterbarandburger.com/\", \n \"https://www.snappydragon.com\", \n \"https://www.pungkangnoodle.com/\", \n \"https://nishinorestaurant.com/\", \n \"https://www.matsuseattle.com/\", \n \"https://www.momijiseattle.com/\", \n \"https://www.umisakehouse.com/\", \n \"https://www.fatshack.com/\", \n \"http://www.elliottbaypizzaseattle.com/\", \n \"https://www.bangrakmarket.com/\", \n \"https://www.pastramisandwich.com/petes-fremont-fire-pit\", \n \"https://www.pastramisandwich.com/lets-taco\", \n \"https://zaikaseattle.com/\", \n \"https://motimahalindianseattle.com/8182\", \n \"http://www.tandoorihutseattle.com/\", \n \"http://varlamospizza.com/\", \n \"https://zainafood.com/\", \n \"https://caskandtrotter.com/wp-content/uploads/2019/11/CASK-SEATTLE-2019-food-menu-.pdf\", \n \"https://www.ballardloft.com/\", \n \"https://www.apizzamartuniversity.com/\", \n \"https://www.apizzamartseattle.com/\", \n \"https://www.apizzamartcapitolhill.com/\", \n \"http://www.bocarestobar.com/home.html\", \n \"https://www.facebook.com/Elcatrinmexicanfood/\", \n \"https://www.facebook.com/TheLockspotCafe/\", \n \"http://www.libertybars.com/\", \n \"https://mavenmeals.com/\", \n \"https://www.bisoncreekpizza.com/\", \n \"https://www.cedarbrooklodge.com/copperleaf-restaurant.php\", \n \"https://mojitoseattle.com\", \n \"http://www.marcopolopub.com/\", \n \"http://www.relayrestaurantgroup.com/restaurants/revel/\", \n \"http://saffronspiceseattle.com/\", \n \"http://bigtimebrewery.com/\", \n \"http://thefiddlersinn.com/\", \n \"https://www.amandineseattle.com/\", \n \"https://www.jaksgrill.com\", \n \"https://littlebigburger.com/\", \n \"https://www.dumplingsoffury.com/\", \n \"https://www.squirrelchops.com/\", \n \"https://www.facebook.com/pages/category/Deli/Hans-Deli-Grocery-137591902949441/\", \n \"http://www.morfireseattle.com/\", \n \"http://www.madreskitchen.com/the-menu\", \n \"https://www.roccosseattle.com\", \n \"http://Lookinghomewardcoffee.com\", \n \"https://www.kruaseattle.com/\", \n \"https://centralpizzaseattle.com/\", \n \"https://www.yelp.com/menu/the-dish-cafe-ballard-seattle\", \n \"http://jaesasianbistroandsushi-seattle.com/\", \n \"https://www.marmiteseattle.com/\", \n \"http://WWW.LAEMBURI.COM\", \n \"http://www.chutneysbistro.com/\", \n \"http://www.bamboo-thai.com/\", \n \"https://santouka-usa.com/\", \n \"https://teinei-seattle.com/\", \n \"http://menyamusashi-seattle.us/\", \n \"https://freshudon.com/\", \n \"https://www.wazseattle.com/\", \n \"https://issianjapanesestonegrill.weebly.com\", \n \"https://catering.subway.com/Cart/Menu2.aspx?r=1703428079\", \n \"https://store.luckyenvelopebrewing.com/\", \n \"http://www.chicknfix.com\", \n \"http://seattlegyros.com/\", \n \"https://lapalmamexicanrestaurant.com/\", \n \"http://www.obecbrewing.com\", \n \"https://www.elparchecolombiano.com\", \n \"http://somerandombar.com\", \n \"https://orderhh.com/\", \n \"http://www.yardhouse.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://nwtxbbq.com/\", \n \"http://www.theconfectionery.com/\", \n \"https://www.tuttabella.com\", \n \"https://www.tuttabella.com\", \n \"https://www.tuttabella.com\", \n \"https://www.facebook.com/TaurusOxSeattle/\", \n \"https://www.nayascafekent.com\", \n \"https://www.mrsaigonbanhmi.com/\", \n \"https://rosellinis.com/\", \n \"http://www.markethousemeats.co/\", \n \"https://cafe-weekend.square.site\", \n \"http://www.ivars.com\", \n \"http://vincesrestaurants.com/pizzeria-pulcinella\", \n \"https://villaverdipizza-online-ordering.securebrygid.com/zgrid/themes/829/intro/index.jsp\", \n \"http://Estersenoteca.com\", \n \"http://www.veracipizza.com/seattle\", \n \"http://Spudgreenlake.com\", \n \"https://www.grandcentralbakery.com/\", \n \"https://www.grandcentralbakery.com/\", \n \"https://www.grandcentralbakery.com/\", \n \"https://www.unbienseattle.com/\", \n \"https://www.unbienseattle.com/\", \n \"https://palermo-pizza-and-pasta-capitol-hill.securebrygid.com/zgrid/proc/site/sitep.jsp\", \n \"http://www.sullysqueenanne.com\", \n \"https://www.grubhub.com/restaurant/modena-pizza--pasta-8014-lake-city-way-ne-ste-f-seattle/345086\", \n \"https://www.brothersandco.me\", \n \"http://www.thefishbox.net\", \n \"http://www.ufbeer.com\", \n \"http://www.Jebenacafe.com\", \n \"http://irwinsbakeryseattle.com\", \n \"http://www.eathomegrown.com\", \n \"http://www.eathomegrown.com\", \n \"http://www.wann-izakaya.com\", \n \"http://www.liberatedfoods.com\", \n \"http://www.generationswinery.com/\", \n \"http://Malaysatay.com\", \n \"http://www.konvene.coffee\", \n \"https://tacodelmar.com/\", \n \"http://eathomegrown.com\", \n \"http://evvivapizza.com\", \n \"http://www.bucha-belly.com\", \n \"https://www.instagram.com/kfteaseattle/\", \n \"https://us.orderspoon.com/6KRN4SEZQ2Y31\", \n \"http://humblepieseattle.com\", \n \"https://bobaupseattle.com/\", \n \"https://www.instagram.com/dingteaseattle/\", \n \"https://squareup.com/gift/AX208H75RNCKT/order\", \n \"https://theochocolate.com/theo-to-go\", \n \"https://www.instagram.com/yifangwa/\", \n \"https://www.facebook.com/TeaRepublik/\", \n \"http://portagebaycafe.com\", \n \"http://xiannoodles.com\", \n \"http://northlaketavern.com/\", \n \"http://littleduckwa.com\", \n \"http://redpepperusa.com\", \n \"https://www.beyondmenu.com/24537/seattle/china-first-seattle-98105.aspx\", \n \"http://herkimercoffee.com\", \n \"https://seattleallegro.com/\", \n \"http://fatducksdeli.com\", \n \"http://coldplatedessert.com\", \n \"https://www.facebook.com/ohbearcafe/\", \n \"http://www.guanacostacospupuseria.site/?utm_source=google\", \n \"http://jewelofindiacuisine.com\", \n \"https://cedarsseattle.com/\", \n \"https://bbsteriyaki.com/\", \n \"http://www.bahamabreeze.com\", \n \"https://freshudon.com/\", \n \"http://www.urbanluxecafe.com\", \n \"http://aguaverdecafe.com/\", \n \"https://voilabistrot.com/\", \n \"http://www.custombakedcakes.com\", \n \"http://www.yummycaferestaurant.com\", \n \"http://www.seawolfbakers.com\", \n \"http://delishethiopianfood.com/\", \n \"http://varsityinnrestaurant.com/\", \n \"http://www.avivhummusbar.com\", \n \"http://www.ninehatswines.com\", \n \"http://hafremont.com\", \n \"http://www.tamalemylife.com\", \n \"http://retreat-greenlake.com\", \n \"https://revolvefoodwine.com/\", \n \"https://kafeneowoodstonegroup.com/demetris/\", \n \"https://kafeneowoodstonegroup.com/kafe-neo-edmonds/\", \n \"http://macrinabakery.com\", \n \"http://macrinabakery.com\", \n \"http://macrinabakery.com\", \n \"https://kafeneowoodstonegroup.com/tablas-woodstone-taverna/\", \n \"http://macrinabakery.com\", \n \"http://uwkoreanbbq.com\", \n \"https://pagliacci.com\", \n \"https://kafeneowoodstonegroup.com/kafe-neo-mill-creek/\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://uwkoreanrestaurant.com/menu/\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://www.facebook.com/pages/category/Korean-Restaurant/Korean-Tofu-House-120918917959893/\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://www.pagliacci.com/location/sammamish\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://delaurenti.com\", \n \"http://aslanbrewing.com\", \n \"http://Kokucafemarket.com\", \n \"http://www.shawarmakingus.com/#front\", \n \"http://byrekandbaguette.org\", \n \"http://www.juliasseattle.com\", \n \"http://persepolis-grill.com\", \n \"https://www.thirdleafnw.com/\", \n \"http://www.starbroadway.com\", \n \"http://justpoke.com\", \n \"http://www.tacotimenw.com\", \n \"https://www.yelp.com/biz/blue-heron-seattle\", \n \"http://hiroshis.com/\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://cocoabanana.com\", \n \"http://www.mondelloristorante.com/\", \n \"http://meesumpastryseattle.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://henrysseattle.com\", \n \"http://www.sweetnothingsandmore.com\", \n \"http://www.tacotimenw.com\", \n \"https://order.tacotimenw.com/menu/sammamish-plateau?BasketId=beff0850-7418-49dc-b979-929d0219b958\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"https://www.taylorshellfishfarms.com/location/capitol-hill-melrose\", \n \"http://tacotimenw.com\", \n \"https://jai-thai-udub.business.site/\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"https://www.wedgwoodalehouse.com/\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://thaigerroom.com\", \n \"http://www.tacotimenw.com\", \n \"https://www.wedgwoodbroiler.com/\", \n \"https://www.greatstateburger.com/\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://raincityburgers.com/\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"https://amazing-thai-cuisine.business.site/\", \n \"http://arayasplace.com\", \n \"http://broadforkcafe.com/\", \n \"http://www.theoliveandgrape.com\", \n \"https://www.facebook.com/ArepaVen/\", \n \"http://caffeladro.com\", \n \"http://caffeladro.com\", \n \"https://www.facebook.com/PhoShizzleVietnameseCuisine\", \n \"https://www.caffeladro.com/locations/fremont-caffe-ladro/\", \n \"https://www.caffeladro.com/locations/capitol-hill-caffe-ladro/\", \n \"http://thanhvi.net/\", \n \"http://caffeladro.com\", \n \"http://caffeladro.com\", \n \"http://caffeladro.com\", \n \"http://thanbrothers.com\", \n \"http://caffeladro.com\", \n \"http://caffeladro.com\", \n \"http://caffeladro.com\", \n \"http://caffeladro.com\", \n \"http://Www.murphysseattle.com\", \n \"http://www.thaiplaceseattle.com/\", \n \"http://www.rachathai.com\", \n \"http://sandpointgrill.com/\", \n \"http://centralcafeseattle.com\", \n \"http://iconiqseattle.net\", \n \"http://www.epulobistro.com\", \n \"http://pagliacci.com\", \n \"http://crumbleandflake.com\", \n \"http://pagliacci.com\", \n \"http://pagliacci.com\", \n \"http://pagliacci.com\", \n \"http://pagliacci.com\", \n \"http://www.zylberschtein.com\", \n \"http://www.elborracho.co\", \n \"http://theshopagora.com\", \n \"http://www.elborracho.co\", \n \"https://pioneersquarede.com/\", \n \"https://tapas-lab.business.site/\", \n \"https://www.carillonkitchen.com/\", \n \"https://www.facebook.com/georgiasgreekrestaurantanddeli/\", \n \"http://www.jeepneycaphill.com\", \n \"https://www.thewingdome.com\", \n \"https://www.steepologie.com/\", \n \"https://lostlakecafe.com/\", \n \"https://www.divaespresso.com/pages/cafes\", \n \"https://www.divaespresso.com/pages/cafes\", \n \"https://www.divaespresso.com/pages/cafes\", \n \"https://www.divaespresso.com/pages/cafes\", \n \"https://www.divaespresso.com/pages/cafes\", \n \"https://www.divaespresso.com/pages/cafes\", \n \"https://www.neighborhoodgrills.com\", \n \"http://www.oasisteazone.com\", \n \"http://www.oasisteazone.com\", \n \"https://www.kativeganthai.com\", \n \"https://www.teasomerestaurant.com/\", \n \"http://www.thebarkingdogalehouse.com\", \n \"http://www.oliverstwistseattle.com/\", \n \"http://www.taqueriacantina.com\", \n \"http://www.lucky-chinese-restaurant.com/\", \n \"http://www.pizzagallery.biz\", \n \"https://breezytownpizza.com/order\", \n \"https://www.windycitypie.com/\", \n \"http://MARSEILLEFOODANDWINE.COM\", \n \"http://tengusushi.com\", \n \"http://www.ilovesushiseattle.com\", \n \"http://www.fremontbowl.com\", \n \"http://www.donburistationseattle.com\", \n \"https://www.facebook.com/Mocha-Maddness-123307447733913/\", \n \"https://footprintwine.com\", \n \"http://www.recklessnoodles.com\", \n \"http://www.thaiocean.com/\", \n \"https://gkseattle.com/\", \n \"https://www.fujibakeryinc.com/\", \n \"http://floatingbridgebrewing.com/\", \n \"https://www.fujibakeryinc.com/\", \n \"http://www.laparisienneseattle.com/\", \n \"http://www.littlewatercantina.com/wp-content/uploads/2018/10/LWC-DinnerMenu.pdf\", \n \"http://www.ristorantepicolinos.com/\", \n \"https://www.jbgardenseattle.com\", \n \"http://www.volterrarestaurant.com\", \n \"https://manustacos.com/\", \n \"https://www.facebook.com/Wah-Kue-Cafe-141849926563751\", \n \"http://www.jacksbbq.com/\", \n \"http://www.sthooligans.com/\", \n \"https://www.queenmargheritaseattle.com\", \n \"https://www.facebook.com/twilightonrainier/\", \n \"http://www.jaderestaurant.net/\", \n \"https://www.bluewatertacogrill.com/#locations\", \n \"https://www.arosacafe.com/\", \n \"http://fourgenerals.com\", \n \"https://ballardbrothers.com/\", \n \"https://www.laredosgrill.com/\", \n \"https://www.themoomilkbar.com/\", \n \"https://www.bluewatertacogrill.com/#locations\", \n \"https://mykonosgreenlake.com/\", \n \"https://www.pgaribaldi.com/menu\", \n \"https://www.lowriderbakingco.com/\", \n \"https://909coffeeandwine.com/\", \n \"https://www.downtownromios.com\", \n \"https://www.pinksaltseattle.com/\", \n \"https://www.thegrowlerguys.com/locations/seattle-northeast/\", \n \"https://joliseattle.com/\", \n \"https://voulasoffshore.com/\", \n \"https://silenceheartnest.com/\", \n \"http://sweetalchemyicecreamery.com\", \n \"http://sweetalchemyicecreamery.com\", \n \"https://www.dirtycouchbrewing.com\", \n \"https://www.laspiga.com/\", \n \"https://www.facebook.com/pg/Twilight-Exit-133599351440/about/?ref=page_internal\", \n \"https://plumbistro.com/\", \n \"http://adeyabeba.net/\", \n \"https://www.nuttysquirrel.com/\", \n \"https://www.nuttysquirrel.com\", \n \"https://www.lakeunioncafe.com/take-out-menu/\", \n \"https://www.shakerandspear.com/\", \n \"http://Www.queenannecoffeeco.com\", \n \"https://www.ridgepizzanortheast.com/welcome\", \n \"http://www.streetzeria.com\", \n \"http://www.celinepatisserie.com\", \n \"https://www.meatyjohnsons.com/\", \n \"https://www.postalley.pizza/\", \n \"https://www.outerplanetbrewing.com/\", \n \"https://www.fresheverythyme.com/\", \n \"http://www.sunrisetacosseattle.com/\", \n \"https://www.streettreatswa.com/\", \n \"https://www.facebook.com/pg/Tup-Tim-Thai-111854295516312/posts/?ref=page_internal\", \n \"http://seattlebageloasis.com/index.html\", \n \"http://sugarhillseattle.com/home\", \n \"http://www.loursinseattle.com/\", \n \"http://emeraldcityfishandchips.com\", \n \"https://www.ebbandcompany.com/shop\", \n \"https://cafebesalu.com/\", \n \"http://www.letsgogrub.com/\", \n \"https://www.musangseattle.com/home\", \n \"http://www.littleredhen.com\", \n \"http://www.rookiesseattle.com\", \n \"https://www.pelotonseattle.com/\", \n \"http://bbqpetes.com\", \n \"https://www.delicatusseattle.com/\", \n \"https://store.fairislebrewing.com/\", \n \"https://www.silvercloud.com/university/dining/\", \n \"https://www.bizzarroitaliancafe.com/\", \n \"http://www.lionheadseattle.com/\", \n \"https://www.facebook.com/KrakenBarSeattle/\", \n \"https://www.facebook.com/casapatronseattle/ \", \n \"https://www.lacopacafe.com/\", \n \"http://www.thudsuanthai.com/\", \n \"http://www.sanfermoseattle.com/\", \n \"https://mamnoonstreet.com/\", \n \"http://deluxebarandgrill.com/\", \n \"https://www.take5urbanmarket.com/\", \n \"https://www.jardintea.com/\", \n \"https://performancekitchen.com/our-stores\", \n \"https://www.performancekitchen.com\", \n \"http://Santorinipizza.com\", \n \"http://mokshadining.com\", \n \"https://www.nicksonmadison.com/\", \n \"https://kwanjaithaicuisine.com/\", \n \"https://www.damoorikitchen.com\", \n \"http://quetzalseattle.com/\", \n \"http://www.muraseattle.com\", \n \"https://www.greatstateburger.com/\", \n \"https://www.tubssubs.com/\", \n \"https://rooftopbrewco.com/\", \n \"http://www.ridgecrest.pub/\", \n \"https://www.elranchonmagnolia.com/\", \n \"http://ichiroteriyakirestaurant.com/index.php\", \n \"http://places.singleplatform.com/malenas-taco-shop-2/menu\", \n \"https://www.yumbitseattle.com/\", \n \"http://www.chaiyonorthgate.com/\", \n \"https://zapverr.com/\", \n \"https://www.sisikaythai.com/\", \n \"http://hopvinepub.com/\", \n \"http://Www.resistenciacoffee.com\", \n \"http://www.joebarseattle.com\", \n \"http://le-fournil.com/\", \n \"https://www.larsensbakery.com/\", \n \"https://www.broadcastcoffeeroasters.com/\", \n \"https://www.medmixjackson.com/\", \n \"http://flyinglionbrewing.com\", \n \"http://www.sharpsroasthouse.com\", \n \"https://www.athinagrill.com/\", \n \"https://www.basilicqueenanne.com/\", \n \"https://www.themasonryseattle.com/\", \n \"https://mintandolives.com/\", \n \"https://rotirestaurantseattle.com/\", \n \"https://sugarbakerycafe.com/\", \n \"http://www.ferrynoodlehousethai.com/\", \n \"http://bua9thaicuisineseattle3.cafecityguide.website/\", \n \"https://www.seattle.noithaicuisine.com/\", \n \"http://elsombreroseattle.com/\", \n \"https://www.empireespresso.coffee/\", \n \"https://www.fulltilticecream.com/\", \n \"https://keziracaffe.com/\", \n \"http://www.lamedusaseattle.com\", \n \"https://safari-restaurant.business.site/\", \n \"https://www.rupeeseattle.com\", \n \"http://pitstoptaproom.com\", \n \"https://www.aluelcellars.com\", \n \"https://www.domanicocellars.com/\", \n \"https://www.trubistro.com/\", \n \"http://www.figureheadbrewingcompany.com\", \n \"http://www.veracipizza.com\", \n \"https://www.thestationbh.com/\", \n \"http://carnitasmichoacanseattle2.cafecityguide.website/\", \n \"https://oak-seattle.com/\", \n \"https://www.facebook.com/rainiercoffeecoburien/\", \n \"http://www.sichuan-cuisine.com/\", \n \"https://www.americanoburgers.com/\", \n \"https://bigmariosnewyorkpizza.com\", \n \"https://www.broadcastcoffeeroasters.com/\", \n \"https://www.starbucks.com/\", \n \"https://www.collectiveseattle.com/\", \n \"https://qmenu.us/#/gourmet-noodle-bowl-seattle/menu/menu-1\", \n \"http://www.takuseattle.com\", \n \"https://www.yoshinoteriyaki.com/\", \n \"https://www.tougocoffee.com/\", \n \"https://order.subway.com/en-us/restaurant/26999/menu/?utm_source=yxt-goog&utm_medium=local&utm_term=acq&utm_content=26999&utm_campaign=evergreen-2020\", \n \"http://stockboxgrocers.com/stores/first-hill-grocery/\", \n \"https://206burgercompany.com/\", \n \"https://206burgercompany.com/\", \n \"https://bluewatertacogrill.com/#locations\", \n \"https://www.tomdouglas.com/events/serious-takeout\", \n \"http://georgessausageanddelicatessenseattle.cafecityguide.website\", \n \"http://hilltopdeliseattle.cafecityguide.website/\", \n \"https://www.italianfamilypizzamenu.com/\", \n \"https://www.jimmyjohns.com/\", \n \"https://delivery.panerabread.com/\", \n \"https://delivery.panerabread.com/\", \n \"http://www.hellbentbrewingcompany.com/\", \n \"https://www.littleneontogo.com/\", \n \"https://delivery.panerabread.com/\", \n \"https://delivery.panerabread.com/\", \n \"https://delivery.panerabread.com/\", \n \"https://www.westmanstogo.com/\", \n \"https://www.piroshkirestaurant.com/\", \n \"https://www.edenhillprovisions.com/\", \n \"https://www.redmondbombaygrill.com/\", \n \"https://shop.alexandrianicolecellars.com/Shop/Browse-All-Wines\", \n \"https://www.heartbeethealthy.com/\", \n \"http://lacabanaseattle.com/\", \n \"http://www.pacinnpub.com\", \n \"http://www.szechuan-fish.com/\", \n \"http://sammyspizzatacoma.com/OrderOnline.aspx\", \n \"https://www.facebook.com/ricostacostacoma/?hc_location=ufi\", \n \"https://javasti.com/maple-leaf/\", \n \"https://javasti.com/\", \n \"https://www.youngteaglobal.com/\", \n \"http://www.thai-taste.net/\", \n \"https://www.katsuburger.com/\", \n \"https://www.katsuburger.com/\", \n \"https://www.katsuburger.com/\", \n \"http://dingfelders.com/\", \n \"http://villaescondidaseattle.com\", \n \"http://zhengcafe.com\", \n \"http://www.thatbrowngirl.com/\", \n \"http://thaicurryman.com\", \n \"http://caferacerseattle.com\", \n \"https://www.chuanbbq.com/\", \n \"https://www.malasatayseattle.com/menu\", \n \"http://meskelethiopian.com\", \n \"https://www.yelp.com/biz/shawns-cafe-and-bakery-mercer-island-2\", \n \"http://islandcrustcafe.com/\", \n \"https://www.eddiesp.com\", \n \"https://www.seattlesunshinecoffee.com/\", \n \"https://www.shelterlounge.com/\", \n \"http://www.batchbakingco.com\", \n \"https://www.facebook.com/minerslandingpier57/photos/a.472879502725738/3301236889889971/?type=3&theater\", \n \"https://www.facebook.com/pg/minerslandingpier57/posts/\", \n \"https://www.miopostopizza.com/mercerisland\", \n \"https://www.starbucks.com/store-locator/store/12517/se-27th-76th-mercer-island-7620-se-27th-st-mercer-island-wa-980402805-us\", \n \"https://www.ohchocolate.com/\", \n \"http://mercerisland.relish.com/www.islandtreatsnw.com\", \n \"https://barrelswinebar.com/\", \n \"https://www.toasttab.com/sano-cafe/v3#!/\", \n \"http://eatmopizza.com/zgrid/proc/site/sitep.jsp\", \n \"https://www.menchies.com/yogurt-shop-our-locations\", \n \"https://www.sushijoa.com/\", \n \"https://locations.einsteinbros.com/index.html?q=Mercer+Island%2C+Washington%2C+United+States\", \n \"https://www.baitongrestaurant.com/\", \n \"http://www.baitongrestaurant.com/\", \n \"http://www.thefrenchbakery.com/\", \n \"http://www.thefrenchbakery.com/\", \n \"http://www.eathomegrown.com/menu\", \n \"http://www.eathomegrown.com/\", \n \"https://justpoke.com\", \n \"https://justpoke.com/\", \n \"https://www.kizuki.com/\", \n \"http://www.kizuki.com\", \n \"http://Madrasdosacorner.com\", \n \"http://www.modpizza.com/\", \n \"http://modpizza.com\", \n \"http://Modpizza.com\", \n \"https://modpizza.com/locations/issaquah/\", \n \"https://modpizza.com/locations/sammamish/\", \n \"http://www.oobatooba.com/\", \n \"http://oobatooba.com\", \n \"http://www.pinkabellacupcakes.com/\", \n \"http://www.pinkabellacupcakesissaquah.com\", \n \"http://www.potbelly.com/Shops/ShopLocator.aspx?PotbellyShopId=247\", \n \"http://potbelly.com\", \n \"http://www.redrobin.com/\", \n \"http://redrobin.com\", \n \"http://Www.ristoranteparadiso.com\", \n \"https://www.starbucks.com/store-locator/store/1005562/issaquah-highlands-issaquah-903-ne-park-drive-issaquah-wa-980297424-us\", \n \"http://Www.kirklandtacos.com\", \n \"https://www.toppotdoughnuts.com\", \n \"http://www.toppotdoughnuts.com/index.html\", \n \"http://toppotdoughnuts.com\", \n \"http://tuttabella.com\", \n \"http://tuttabella.com\", \n \"http://www.zeekspizza.com/\", \n \"https://zeekspizza.com/menu/\", \n \"http://www.12thavenuecafe.com\", \n \"http://www.3pigsbarbq.com\", \n \"http://www.5hermanosrestaurant.com/\", \n \"http://www.520barandgrill.com/\", \n \"http://www.thai65cafe.com/\", \n \"http://www.Acropolispizzapasta.com\", \n \"https://agavecocina.com/\", \n \"http://agaverest.com/\", \n \"http://www.ajisushiissaquah.com\", \n \"http://www.alohagrillrenton.com/\", \n \"http://amarorestaurant.com/\", \n \"http://www.andiamobellevue.com\", \n \"https://www.angelosofbellevue.com/\", \n \"http://www.angelosinrenton.net/\", \n \"http://www.arayasplace.com/\", \n \"http://www.ascendprime.com/\", \n \"https://www.facebook.com/EastsideBambu/\", \n \"http://www.bangkok-basil.com/\", \n \"http://www.beardsleeph.com\", \n \"http://www.belldencafe.com/\", \n \"https://www.bellepastry.com\", \n \"http://www.bellevuebrewing.com\", \n \"https://www.bestwokchineserestaurant.com\", \n \"https://www.bevmo.com/stores/issaquah-wa/\", \n \"https://bhojanxpress.com/\", \n \"http://www.bigblockbrewery.com\", \n \"https://www.facebook.com/bigislandpoke/\", \n \"https://thaikitchenbirdpepper.com/\", \n \"http://bisonmain.com/\", \n \"http://www.bjsrestaurants.com/\", \n \"https://www.facebook.com/blackbearcoffeecompany/\", \n \"http://www.blackravenbrewing.com/\", \n \"https://www.blazingbagels.com\", \n \"https://www.blossomrenton.com/\", \n \"http://www.blusardinia.com \", \n \"http://www.Boehms.com\", \n \"http://www.bpgroupusa.com\", \n \"http://www.boonboonacoffee.com/\", \n \"http://www.thebrewmasterstaproom.com/\", \n \"http://www.briatorepizza.com\", \n \"http://thebriefencounter.dinehere.us/?fbclid=IwAR1s4gckkYv3613JHj-3TGLXfW7eay5hK1d7_VlhZllEvYCwCmoUz1YB75E\", \n \"http://www.bukharaissaquah.com\", \n \"http://www.jbbungalow.com\", \n \"https://burgermaster.biz/bellevue\", \n \"http://www.cactusrestaurants.com\", \n \"http://www.cafecesura.com/\", \n \"http://www.mexicanfoodrenton.com/\", \n \"https://www.cafeoriwa.com/\", \n \"https://cafeveloce.com/\", \n \"http://calabriamillcreek.com\", \n \"http://www.newcastlegolf.com\", \n \"http://www.capricellars.com\", \n \"http://www.casaricardos.com\", \n \"https://www.hilton.com/en/hotels/seables-embassy-suites-seattle-bellevue/dining/\", \n \"https://www.caspianbellevue.com\", \n \"https://www.castillarestaurant.com/\", \n \"http://www.cedarriversmokehouse.com/\", \n \"http://centralbar.com/\", \n \"https://www.cepae.com/\", \n \"http://www.chainlinebrew.com\", \n \"http://www.bit.ly/CheesecakeBellevue\", \n \"http://chinoisecafe.com/\", \n \"http://www.chipotle.com\", \n \"https://www.cielobellevue.com/\", \n \"http://www.cloudnineburgers.com\", \n \"http://www.coconutthaiwa.com\", \n \"https://www.comousa.com\", \n \"http://www.cowchipcookies.com/\", \n \"https://www.cypresscoffeecompany.com/\", \n \"http://www.dakshinbistro.com\", \n \"http://www.derumarket.com\", \n \"https://orders.dickeys.com/order?storeNumber=684&categoryId=1\", \n \"http://www.dintaifungusa.com/\", \n \"http://www.pizza.dominos.com/washington/issaquah\", \n \"http://dongtingchun.net/#\", \n \"https://www.doughzonedumplinghouse.com/\", \n \"https://eastsidebeerworks.com/welcome/index\", \n \"https://www.doordash.com/store/el-maestro-del-taco-bellevue-682809/en-US\", \n \"https://www.eltoreador.com\", \n \"http://www.facebook.com/espressodaviso/\", \n \"http://www.facingeastrestaurant.com/\", \n \"https://locations.fatburger.com/united-states/wa/redmond/17181-redmond-way\", \n \"https://postmates.com/merchant/fatburger-6220-e-lake-sammamish-pkwy-se?client=customer.web&version=3.0.0\", \n \"https://www.fernthaionmain.com/\", \n \"http://www.finsbistroissaquah.com\", \n \"https://fitbarcafe.com/\", \n \"https://order.fiveguys.com/menu/commons/\", \n \"http://www.florestaurant.com/\", \n \"http://www.flycasterbrewing.com\", \n \"http://www.flyingpiepizzeria.com\", \n \"https://streetfoodfinder.com/bellevuehilton\", \n \"http://www.forestfairybakery.com\", \n \"http://www.frankies-pizza.com\", \n \"https://www.facebook.com/FreshtheJuiceBar/\", \n \"http://garliccrush.com/order-online-issaquah/\", \n \"http://www.gaslampbarandgrill.com\", \n \"http://www.gilbertsonmain.com/\", \n \"http://www.greatchinawa.com/\", \n \"http://www.greenappleec.com\", \n \"http://www.Gyroworldkirkland.com\", \n \"http://www.gyroshouse.com/\", \n \"http://www.habitburger.com/locations/issaquah/\", \n \"http://www.hectorskirkland.com\", \n \"http://www.hopheads-taproom.com\", \n \"https://issaquahtrike.square.site/\", \n \"http://isushiissaquah.com\", \n \"http://ivars.com\", \n \"http://jjchinesefood.com\", \n \"http://www.jacksbbq.com\", \n \"http://jaksgrill.com\", \n \"http://jamba.com\", \n \"https://www.facebook.com/pages/Japan-Ginger/113453918675900\", \n \"http://www.japonessa.com/\", \n \"http://Jerseymikes.com\", \n \"https://locations.jimmyjohns.com/wa/issaquah/sandwiches-1983.html\", \n \"https://jinya-ramenbar.com/locations/detail/bellevue\", \n \"http://www.joeyrestaurants.com/location/joey-bellevue\", \n \"http://www.johnhowiesteak.com/\", \n \"http://justpoke.com\", \n \"http://www.justtiffins.com/\", \n \"http://www.kanishkaofredmond.com/\", \n \"https://www.facebook.com/KhaoSanThaiCuisine/\", \n \"http://www.kitanda.com/\", \n \"http://krawbar.com\", \n \"http://www.kringlesbakery.com/\", \n \"https://krispykreme.com/shop/order-start\", \n \"http://laislacuisine.com/\", \n \"http://www.rivieramayafoodtruck.com\", \n \"https://www.ladyyum.com\", \n \"http://lasmargaritasrest.com\", \n \"https://www.bistrolegrand.com/\", \n \"http://originallemongrass.com/Lemongrass/Menu.html\", \n \"http://lunchboxlaboratory.com/\", \n \"http://Www.lynnsbistro.com\", \n \"http://mamaskitchenbellevue.com\", \n \"http://mariannaristorante.com/\", \n \"http://masakitchen.com\", \n \"http://www.mccormickandschmicks.com/\", \n \"http://mediterraneankitchens.net\", \n \"https://www.mercurys.com/\", \n \"https://minamotowa.com/\", \n \"http://www.mixpokebar.com/\", \n \"https://www.facebook.com/pages/Momoya-Japanese-Restaurant/111549395550817\", \n \"http://mongacafe.com\", \n \"https://www.facebook.com/montalcinoristorante/\", \n \"http://mustardseedgrill.com\", \n \"http://naanncurry.com\", \n \"https://order.namastheredmond.com/\", \n \"http://newyorkcupcakes.com/\", \n \"http://newzensushi.com/\", \n \"http://nicksgrillkirkland.com\", \n \"http://nicksgreekitalian.com\", \n \"http://Nicolino.net\", \n \"http://facebook.com/OchaThaiRenton/\", \n \"http://ocharissaquahthai.com\", \n \"http://ohanasushigrill.com\", \n \"http://www.orenjisushinoodles.com\", \n \"http://www.pfchangs.com/Locations/LocationDetail.aspx?sid=3700&checked=1\", \n \"http://palacebbq.com\", \n \"https://papamurphys.olo.express/menu/papa-murphys-132nd-ave-ne\", \n \"http://www.pastaco.com/default.htm\", \n \"http://pastayagotcha.com\", \n \"http://www.peonykitchen.com/\", \n \"https://pizzabankrestaurant.com/\", \n \"https://www.plazagarcia.com\", \n \"http://plumdelicious.net/\", \n \"https://www.pomegranatebistro.com/\", \n \"http://postdocbrewing.com/\", \n \"http://www.pressedjuicery.com/\", \n \"http://redmondprime.com/\", \n \"http://qdoba.com\", \n \"http://www.rachathai.com/\", \n \"http://redbamboobistro.com/\", \n \"http://theredtearoom.com/\", \n \"http://redmondsgrill.com/\", \n \"http://resonatebrewery.com\", \n \"http://ricardosfactoria.com\", \n \"http://www.romiosredmond.com/zgrid/proc/site/sitep.jsp\", \n \"http://Www.romiostotemlake.com\", \n \"http://www.royalindiacuisine.com\", \n \"http://www.ruthschris.com/\", \n \"https://local.safeway.com/safeway/wa/issaquah/1451-highlands-dr.html\", \n \"http://Sagesrestaurant.com\", \n \"http://samstavernseattle.com/menu/\", \n \"http://tressandwich.com\", \n \"http://seastarrestaurant.com/\", \n \"http://Seoulhotpot.com\", \n \"http://www.shabushabukyoto.com\", \n \"https://www.1992sharetea.com\", \n \"http://thaifoodforyou.com/\", \n \"http://singtongthai.com/\", \n \"https://www.sipthaibistro.com/\", \n \"https://www.smokeandshine.com\", \n \"http://southgate-garden.com\", \n \"https://www.sparkpizzaredmond.com/\", \n \"http://squarelotus.com\", \n \"http://stansbarbq.com\", \n \"http://www.subway.com/en-us\", \n \"http://sunsetalehouse.com\", \n \"http://Sushiinjoybellevue.com\", \n \"http://sushimebellevue.com\", \n \"http://swiftwatercellarsbellevue.com/\", \n \"https://tacodelmar.com\", \n \"http://tapatiomexicangrill.com\", \n \"http://elrinconsito.com\", \n \"https://temsibbellevue.com/\", \n \"http://TerryskitchenBellevue.com\", \n \"http://thaiginger.com\", \n \"http://thaivpbellevue.com/\", \n \"https://theboxonwheels.com/the-box-burgers-coming-september-2017/\", \n \"https://thecottagebothell.com\", \n \"http://Redmondirishpub.com\", \n \"http://Thegameneighborhoodgrillandbar.com\", \n \"http://thehollywoodtavern.com\", \n \"https://www.thelodgesportsgrille.com\", \n \"http://melrosegrill.com/\", \n \"http://www.thepizzacoop.com\", \n \"http://therollpod.com/online-order\", \n \"http://theslip2.com\", \n \"http://thirstyhop.com/\", \n \"http://www.tiantiannoodles.com/\", \n \"http://www.tipsycowburgerbar.com/\", \n \"http://tokyostopteriyaki.com\", \n \"http://www.topolinopizza.com/\", \n \"http://www.ristorantetropea.com/\", \n \"http://www.victorscelticcoffee.com/\", \n \"http://vincesrestaurants.com/\", \n \"https://www.thewaffler.com/contact-1\", \n \"http://Www.wahluck.com\", \n \"https://2goservices.com/YankeeGrill\", \n \"https://www.zaucer.com/\", \n \"http://www.zeitoongrill.com\", \n \"https://www.zulusgames.com/\", \n \"https://www.ivars.com\", \n \"https://alehousepub.com/\", \n \"https://www.facebook.com/UPStationBarandGrill\", \n \"https://www.facebook.com/springlakecafe\", \n \"https://www.facebook.com/Paos-Donuts-Coffee-Shop-193087870758560/\", \n \"https://cloverleafpizza.com/menu/\", \n \"https://www.icecreambliss.com/\", \n \"https://steamersseafoodcafe.com/\", \n \"https://www.sapporosteakhouse.com/\", \n \"https://www.mariasup.com/\", \n \"http://souperphorestaurant.com/\", \n \"http://www.roundtablepizza.com/\", \n \"https://www.habitburger.com/locations/\", \n \"https://www.oddfellaspubtacoma.com/\", \n \"https://www.joeseppisitalian.com/menu\", \n \"https://www.antiquesandwich.com/\", \n \"https://farrellispizza.com/\", \n \"https://www.katiedowns.com/menu/\", \n \"https://www.anthonys.com/restaurants/best-of-season/\", \n \"https://www.facebook.com/hardwokcafebellevue\", \n \"http://sususeattle.com\", \n \"https://heritagewoodinville.com\", \n \"https://www.sunnyhillseattle.com/\", \n \"https://www.facebook.com/jibeespressobar/\", \n \"http://www.meekongbar.com\", \n \"https://zeekspizza.com\", \n \"https://www.shawarmaniac.com\", \n \"https://www.shakeshack.com/location/kirkland-wa/\", \n \"http://www.eathomegrown.com\", \n \"http://www.kozmokitchen.com\", \n \"https://www.qdoba.com/\", \n \"https://performancekitchen.com/\", \n \"https://www.zomato.com/mercer-island-wa/gourmet-teriyaki-mercer-island/menu\", \n \"https://www.subway.com/en-US\", \n \"http://anisethaicuisine.com/\", \n \"https://www.mcdonalds.com/us/en-us.html\", \n \"https://tigergardentogo.com/#page-top\", \n \"https://tuscanstonepizza.com/\", \n \"https://www.baskinrobbins.com/en\", \n \"http://facebook.com/iceboxgrocery\", \n \"http://www.eathomegrown.com/\", \n \"https://www.lexperienceparis.com/\", \n \"https://phoem.business.site/\", \n \"http://ponproemthai.com/\", \n \"https://www.saharapizzamercerisland.com/\", \n \"https://toshisgrill.com/toshis-teriyaki-mercer-island\", \n \"https://www.rivieramayawa.com/\", \n \"http://lacasita-sammamish.com/\", \n \"http://www.myaugustmoon.com/\", \n \"https://donerboxkebab.com\", \n \"https://www.chansplaces.com/\", \n \"https://order.subway.com/en-us/restaurant/12000/menu/?utm_source=yxt-goog&utm_medium=local&utm_term=acq&utm_content=12000&utm_campaign=evergreen-2020\", \n \"https://order.subway.com/en-us/restaurant/23793/menu/?utm_source=yxt-goog&utm_medium=local&utm_term=acq&utm_content=23793&utm_campaign=evergreen-2020\", \n \"https://locations.jimmyjohns.com/wa/sammamish/sandwiches-1984.html\", \n \"https://www.portofinopizza.com/\", \n \"https://www.fremontbrewing.com \", \n \"http://www.freshfloursseattle.com\", \n \"https://www.curbsidesnofallscandyshoppe.com/\", \n \"http://www.freshfloursseattle.com/\", \n \"http://theloftlounge.com/\", \n \"http://bit.ly/salishtogo\", \n \"http://www.sigillocellars.com \", \n \"https://www.jerseymikes.com/18030/sammamish-wa\", \n \"http://www.arturomexicanrestaurant.com/\", \n \"https://www.mcdonalds.com/us/en-us/location/wa/sammamish/615-228th-ave-ne/11996.html?cid=RF:YXT:GMB::Clicks\", \n \"https://borealisonaurora.com/\", \n \"https://www.adasbooks.com/adas-pop-pie-shop\", \n \"https://m.facebook.com/pages/El-Kiosko/148295225309246\", \n \"http://www.seabendmeat.com/\", \n \"https://lanponi.blogspot.com/\", \n \"https://www.buckleyspubs.com/queenanne/\", \n \"https://thaiginger.com/order-online/\", \n \"http://www.hawaiianstylebbq.net/\", \n \"http://vinason.net/\", \n \"https://thelocal104.com/\", \n \"https://dlasanta.com/\", \n \"http://pinelakealehouse.com/the-food/\", \n \"http://tastythaifactoria.com/\", \n \"https://www.tanoor.com/\", \n \"https://zeekspizza.com/locations-hours/zeeks-pizza-sammamish/\", \n \"https://locations.chipotle.com/wa/sammamish/22704-se-4th-st?utm_source=google&utm_medium=yext&utm_campaign=yext_listings\", \n \"http://copperstonepasta.com\", \n \"http://nasaiteriyakisammamish.com/?utm_source=gmb&utm_medium=referral\", \n \"https://kryptonitebarandpizza.com/\", \n \"https://order.papamurphys.com/menu/papa-murphys-228th-ave-ne\", \n \"https://order.papamurphys.com/menu/papa-murphys-klahanie-drive\", \n \"https://locations.jackinthebox.com/us/wa/sammamish/620-228th-ave-ne\", \n \"https://locations.papajohns.com/united-states/wa/98074-7223/sammamish/721-228th-ave-ne?utm_source=gmb&utm_medium=organic\", \n \"http://pinelakepizza.com/\", \n \"http://mommyskitchen1.com/\", \n \"https://www.dairyqueen.com/us-en/locator/Detail/?localechange=1&store-id=15118&\", \n \"https://www.wmgrassiewines.com/\", \n \"https://www.ubereats.com/seattle/food-delivery/yoko-teriyaki/-8Yhe0v4Qp25-uG2ITAx4Q\", \n \"https://order.subway.com/en-us/restaurant/56349/menu/?utm_source=yxt-goog&utm_medium=local&utm_term=acq&utm_content=56349&utm_campaign=evergreen-2020\", \n \"http://www.elcaporalfallcity.com/\", \n \"https://saharapizza.com/\", \n \"https://fcroadhouse.com/\", \n \"http://places.singleplatform.com/small-fryes/menu?ref=google\", \n \"https://ixtapa-carnation.business.site/\", \n \"http://redpepperpizzeria.com/\", \n \"https://www.samsnoodletown.com/\", \n \"http://restaurants.quiznos.com/wa/duvall/duvallsafewayplaza-98019\", \n \"https://www.ixtaparedmondridge.com/\", \n \"https://tonymaronispizza.com/\", \n \"https://www.doordash.com/store/himitsu-teriyaki-redmond-28388/en-US/?utm_campaign=gpa\", \n \"https://www.orderindiqzeen.com/#menu\", \n \"https://modpizza.com/locations/redmond-ridge/\", \n \"https://www.fallsbrew.com\", \n \"https://www.lazysusanseattle.com/\", \n \"https://www.indiabistroroosevelt.com/\", \n \"https://www.villagepizza.org/\", \n \"https://www.suikaseattle.com\", \n \"https://ethio-emperor-bar-n-restaurant.business.site/\", \n \"http://www.paranormalp.site/\", \n \"https://qeerroo-restaurant.business.site/\", \n \"https://www.limoncelloseattle.com/\", \n \"https://www.trottersfamilyrestaurant.com/\", \n \"http://www.rainbowcafediner.com/\", \n \"http://memosmexicanfood.com/\", \n \"http://leafsdeli.com/\", \n \"https://www.gorgaithai.com/\", \n \"https://www.seamless.com/menu/alive-juice-bar-20226-ballinger-way-ne-shoreline/807903\", \n \"http://sushidowa.com/\", \n \"https://www.zomato.com/shoreline-wa/hae-nam-kalbi-calamari-shoreline/menu\", \n \"https://www.rioblancowa.com/\", \n \"https://www.hillsshoreline.com/\", \n \"https://cielo-restaurant.business.site/\", \n \"http://hibachibuffetauburn.com/\", \n \"http://chinahouseauburn.com/\", \n \"https://www.theredlotusauburn.com/\", \n \"https://www.athenspizzaauburn.com/\", \n \"https://m.facebook.com/pages/Koong-Thong-Thai-Cuisine/116151188410242\", \n \"https://www.lasmargaritasrest.com/\", \n \"https://www.facebook.com/SUSHI-Konami-INC-548447711867916/\", \n \"http://www.twedescafe.com/\", \n \"https://www.oddfellaspubauburn.com/\", \n \"https://www.longhornbarbecue.com/\", \n \"http://www.loscabosmexicanrestaurant.com/home.php\", \n \"https://m.facebook.com/pages/Starting-Gate-Restaurant/117322438285858\", \n \"https://www.sunnyteriyakiauburn.com/\", \n \"http://themazatlanmex.com/\", \n \"https://m.facebook.com/pages/Belen-Pupuseria-Y-Taqueria/103780789767685\", \n \"https://www.therockwfp.com/\", \n \"https://places.singleplatform.com/mediterranean-oasis/menu?ref=Microsoft\", \n \"https://www.thestonehousecafe.com/\", \n \"https://www.johnnyrockets.com/locations/the-outlet-collection-auburn-wa-usa/\", \n \"http://www.pekinghouserestaurant.com/menu.php\", \n \"https://www.facebook.com/Top-Pho-246836315523040/\", \n \"https://www.zomato.com/shoreline-wa/pho-tic-tac-shoreline\", \n \"https://outletcollectionseattle.com/dining/nori-japan\", \n \"https://ilovespiros.com/\", \n \"http://www.elrinconsito.com/\", \n \"https://happy-express.business.site/\", \n \"https://sizzledogs.com/\", \n \"https://www.thaibistro.us/shoreline\", \n \"https://m.facebook.com/pages/Joy-Pho-Terriyaki/235258129911841\", \n \"https://www.sweetricewa.com/\", \n \"https://www.todomexicorestaurants.com/menu\", \n \"https://solamentealpastor.com/\", \n \"http://www.morselseattle.com\", \n \"https://www.spudfishandchips.com\", \n \"https://www.sushizenmillcreek.com\", \n \"https://www.spudfishandchips.com\", \n \"http://www.ixtapalynnwood.com\", \n \"http://www.lombardisitalian.com\", \n \"https://eatonopoke.com\", \n \"http://www.lombardisitalian.com\", \n \"http://www.jamba.com\", \n \"https://www.jamba.com\", \n \"https://bucksamericancafe.com\", \n \"https://www.jamba.com\", \n \"https://WWW.JAMBA.COM\", \n \"http://www.doubleddmeats.com\", \n \"http://Gyrostoppita.com\", \n \"http://Brooklynbros.com\", \n \"http://Gyrostoppita.com\", \n \"http://Brooklynbros.com\", \n \"http://HEAVENSENTFRIEDCHICKEN.COM\", \n \"https://HEAVENSENTFRIEDCHICKEN.COM\", \n \"http://www.hemlockstate.com\", \n \"http://Gyrostoppita.com\", \n \"http://gyrostoppita.com\", \n \"http://gyrostoppita.com\", \n \"https://www.amantepizzaeverett.com/\", \n \"https://Subway.com\", \n \"https://Subway.com\", \n \"https://www.facebook.com/ixtapa.lakestevens/\", \n \"http://www.aversanos.com/\", \n \"https://www.drinkbambu.com/menu/tacoma\", \n \"https://www.blackfleetbrewing.com/\", \n \"http://www.casamiarestaurants.com/restaurants/lakewood-casa-mi/\", \n \"https://doylespublichouse.com/\", \n \"https://locations.pitapitusa.com/ll/US/WA/Tacoma/921-Pacific-Ave\", \n \"https://www.sizzler.com/locations/sizzler-s-tacoma-way\", \n \"https://theswisspub.com/\", \n \"http://acornbeer.com/\", \n \"https://www.oakbrookgolfclub.com/adriatic-at-oakbrook/\", \n \"http://allagorestaurant.com/menu1/\", \n \"https://www.facebook.com/AngleasRestaurant/posts/\", \n \"https://www.asadotacoma.com/\", \n \"http://barbistrotacoma.com/\", \n \"http://www.blackstar.pub/\", \n \"https://www.facebook.com/BlueSteeleCoffee/\", \n \"https://bluebeardcoffee.com/\", \n \"http://www.branksbbq.com/\", \n \"https://brewersrowtacoma.com/\", \n \"https://3uilt.com/main-menu\", \n \"http://www.thecampbar.com/menu/\", \n \"https://www.carneaqui.com/menus/\", \n \"http://www.caskcades.com\", \n \"https://www.facebook.com/CitronEuropeanBistro/\", \n \"https://cookstavern.com/\", \n \"https://www.countryroserestauranttacoma.com/main-menu\", \n \"http://www.craft19coffee.com/\", \n \"http://www.crispgreens.co/\", \n \"https://www.crudoandcotto.com/\", \n \"https://www.dairyqueen.com/us-en/locator/Detail/?localechange=1&&store-id=6113\", \n \"https://www.devotedkisscafe.com/\", \n \"https://elborrachotacoma.hrpos.heartland.us/\", \n \"https://www.elpueblitorestaurant.com/0a04de11-3f5f-404f-89de-ae0e9c9fbfbc\", \n \"http://www.eltorofamily.com/\", \n \"http://www.eltorofamily.com/\", \n \"http://www.eltorofamily.com/\", \n \"http://www.eltorofamily.com/\", \n \"https://www.myelementsnw.com/\", \n \"https://erawanbar.smartonlineorder.com\", \n \"https://www.essenceloungetacoma.com/\", \n \"https://www.facebook.com/farm12news\", \n \"https://www.fatzachspizza.com/\", \n \"https://www.fiestataqueriaandtequilabar.com/menu\", \n \"https://frankies-pizza.com/our-locations/\", \n \"https://www.galluccis.com/onthego/\", \n \"https://www.facebook.com/gayleorthcatering\", \n \"https://www.ginosrestaurants.com/gino-s-at-the-point\", \n \"http://www.goldenteakthai.com/\", \n \"http://www.happybellytacoma.com\", \n \"https://heritagedistilling.com/\", \n \"https://heritagedistilling.com/\", \n \"https://pickup.honeybaked.com/stores/details/2100\", \n \"https://www.inclineciderhouse.com/\", \n \"https://jonzcatering.com/\", \n \"http://jubileeburger.com/\", \n \"http://karmaindiancuisinepuyallup.com/menu/\", \n \"https://lele-east-west-thai-vietnamese-cuisine.business.site/\", \n \"http://eatatlizzielous.com\", \n \"https://www.locustcider.com/taprooms/tacoma/ \", \n \"https://www.facebook.com/LukesDonuts/\", \n \"https://www.dinemarzano.com/takeout-menu\", \n \"https://www.mcnamaraspubandeatery.com/\", \n \"https://www.facebook.com/moshitacoma/\", \n \"https://www.facebook.com/pages/category/Diner/Mrs-Turners-Hometown-Cafe-1432728696990758/\", \n \"https://www.nothingbundtcakes.com/bakery/wa/South-Hill\", \n \"https://www.facebook.com/pages/category/Bakery/Old-Times-Bakery-Deli-1531945310270755/\", \n \"https://www.facebook.com/OSJInternational/\", \n \"https://www.outback.com/locations/wa/tacoma\", \n \"https://overthemooncafe.net/\", \n \"https://www.instagram.com/p/B95ZsVfgzAw/\", \n \"http://Facebook.com/PhoEverPuyallup\", \n \"http://pick-quick.com/locations/\", \n \"https://www.facebook.com/PLAYAAZUL/\", \n \"http://www.pomodoroproctor.com/\", \n \"https://tacomapsp.com/\", \n \"https://www.facebook.com/reynasmexicanrestaurant/\", \n \"http://rosegardenfoods.net/\", \n \"http://www.roundtablepizza.com\", \n \"https://www.route66pizza.com/\", \n \"https://salamonespizzeria.com/menu\", \n \"http://sammyspizzatacoma.com/OrderOnline.aspx\", \n \"https://www.thespartavern.com/\", \n \"https://www.stanleyandseaforts.com/takeout-catering.php\", \n \"https://stephs-pizza-online-ordering.securebrygid.com/zgrid/themes/13035/mobile/pages/specials.jsp\", \n \"https://www.stinktacoma.com/menus\", \n \"https://www.thesummitpub.com/menu#menu=to-go-menu\", \n \"https://www.sushiari.com/menu-1\", \n \"http://sushitamarestaurant.com/\", \n \"https://www.t47.com/\", \n \"https://www.facebook.com/tamisintacoma/?rf=1073826176150049\", \n \"https://www.carlsonblock.com/\", \n \"https://www.facebook.com/thechurchcantina/\", \n \"http://www.EatTheDutch.com\", \n \"https://www.harborgeneral.com/menu-c14aw\", \n \"https://www.themillofmilton.com/\", \n \"https://vaultcatering.com/cuisine-to-you/\", \n \"https://www.tims-kitchen.com/\", \n \"https://www.tims-kitchen.com/\", \n \"https://toscanospuyallup.com/menus/\", \n \"https://www.pizzatrackside.com/online-order.html\", \n \"https://www.pizzatrackside.com/online-order.html\", \n \"https://www.facebook.com/TheTrellisCafeandBoutique/\", \n \"https://urbanelktacoma.com/menu-1\", \n \"https://www.wallysrestaurants.com/wallysdrivein\", \n \"https://www.facebook.com/zogsonfoxisland/\", \n \"https://www.beefysburgers.me/our-menu\", \n \"https://www.facebook.com/Bourbon-Street-Creole-Kitchen-Bar-1381773648744625/\", \n \"https://btthairestaurant.business/\", \n \"https://www.carrsrestaurant.net/\", \n \"http://www.changthaicuisine.com/\", \n \"http://www.changthaiexpress.com/\", \n \"https://www.chick-fil-a.com/locations/wa/fircrest\", \n \"https://www.cfalakewood.com/\", \n \"http://www.cfapuyallup.com\", \n \"https://www.chick-fil-a.com/locations/wa/38th-steele\", \n \"https://www.facebook.com/DLaraMediterraneanGrillBonneyLake/\", \n \"http://davesofmilton.com\", \n \"https://locations.dennys.com/WA/TACOMA/247539\", \n \"http://www.ehouse9.com/restaurant\", \n \"https://www.firehousesubs.com/locations/wa/lakewood-pavilion/\", \n \"https://www.flyingtomatogrillandbar.com/welcome\", \n \"https://www.gardensgourmetsalads.com/\", \n \"https://www.gophillycheesesteaks.com/\", \n \"https://www.gophillycheesesteaks.com/\", \n \"http://www.thehappyteriyaki.com/menu-fife.html\", \n \"http://Happyphotime.com \", \n \"http://www.thehappyteriyaki.com/\", \n \"https://www.i5photacoma.com/#/\", \n \"http://indochinedowntown.com/\", \n \"https://islandlodge.net/home\", \n \"https://www.itsgreektomerestaurant.com/menu\", \n \"https://www.ivars.com\", \n \"https://www.ivars.com\", \n \"https://www.jazzbones.com/\", \n \"https://louiegspizza.com/\", \n \"https://www.facebook.com/mazatlancanyon/\", \n \"https://www.moctezumas.com/#tequila-bars\", \n \"https://www.moctezumas.com/#tequila-bars\", \n \"https://musclemakergrill.com/locations/\", \n \"http://ILoveOPH.com\", \n \"http://iloveoph.com/\", \n \"https://order.papamurphys.com/menu/papa-murphys-point-fosdick\", \n \"https://order.papamurphys.com/menu/papa-murphys-valley-avenue\", \n \"https://order.papamurphys.com/menu/papa-murphys-borgen-blvd\", \n \"http://www.therockwfp.com\", \n \"http://www.therockwfp.com/\", \n \"https://rushbowls.com/lakewood/order-online\", \n \"https://www.samchoyspoke.com/tacoma-menu\", \n \"https://orders.cake.net/11146816\", \n \"https://www.spankyburger.com/menu\", \n \"https://www.thekoitacoma.com/\", \n \"https://www.trapperssushi.com/\", \n \"https://www.trapperssushi.com/\", \n \"https://www.trapperssushi.com/\", \n \"http://onthemenu-tacoma.tripod.com/id2.html\", \n \"https://www.iloveamici.com/menu/\", \n \"https://www.texasbbq2u.com/\", \n \"https://www.bjsrestaurants.com/locations/wa/puyallup\", \n \"https://www.bjsrestaurants.com/locations/wa/tacoma\", \n \"https://corinabakery.com/tacoma/\", \n \"https://www.crockettspublichouse.com/puyallup/\", \n \"https://farrellispizza.com/\", \n \"http://www.farrellispizza.com/\", \n \"https://farrellispizza.com/\", \n \"https://farrellispizza.com/\", \n \"https://farrellispizza.com/\", \n \"http://www.fatzachspizza.com\", \n \"https://www.facebook.com/GabesOldFashionedIceCream\", \n \"https://www.giorgiosgreekcafe.com/\", \n \"https://www.homesteadwa.com/\", \n \"https://www.facebook.com/sumnergals/\", \n \"https://www.facebook.com/hubgigharbor/\", \n \"https://www.facebook.com/HubPuyallup/\", \n \"https://www.facebook.com/Lostamalestacoma/\", \n \"http://luckysparkland.com/\", \n \"https://www.mannysplacetacoma.com/\", \n \"http://www.phoandmoregigharbor.com/\", \n \"http://pizzacasa.com/\", \n \"http://www.pizazzpizza.com/menu.html\", \n \"http://Sanblasmexicanrestaurant.com\", \n \"https://www.facebook.com/uptownkoffee/?hc_location=ufi\", \n \"https://www.facebook.com/Vuelva-A-La-Vida-100118676745013/\", \n \"https://www.warthogbbq.com/menus\", \n \"https://www.warthogbbq.com/menus\", \n \"https://wickedpiepizza.com/\", \n \"https://zeekspizza.com\", \n \"http://Bluburgersandbrew.com\", \n \"http://www.avantipizzalynnwood.com\", \n \"http://www.wildwasabisushi.com\", \n \"https://moosecreekbbq.com\", \n \"http://SolFoodEverett.com\", \n \"http://kelnero.bar\", \n \"http://yummyteriyakiseattle.com\", \n \"https://www.lindastavern.com/\", \n \"http://www.kingsballard.com/\", \n \"http://twistedlimepub.com\", \n \"http://bbpmenu.com\", \n \"http://bucksamericancafe.com\", \n \"http://buzzinnsteakhouse.com\", \n \"http://cafezippy.com\", \n \"http://indigoeverett.com/dining.php\", \n \"http://themazatlanmex.com/everett\", \n \"http://midnightcookieco.com\", \n \"http://thevintagecafe.net\", \n \"http://www.nomnomteriyakinmore.com/\", \n \"http://www.afktavern.com/\", \n \"http://portgardnerbaywinery.com\", \n \"http://starbucks.com\", \n \"https://subway.com\", \n \"http://www.katanasushieverett.com\", \n \"http://cafeuu.net\", \n \"http://valleyorganicdeli.com\", \n \"http://www.royalthaibistro.com/\", \n \"https://www.facebook.com/pokepopco/\", \n \"https://locu.com/places/kaihana-seattle-us/\", \n \"https://www.cubesbaking.com\", \n \"http://www.maonoseattle.com\", \n \"https://www.bothwayscafe.com/\", \n \"https://www.instagram.com/kimchibristroseattle/\", \n \"http://192brewing.com\", \n \"http://www.countrysidecafewa.com/welcome\", \n \"http://kiddvalley.com\", \n \"https://blackbeardiner.com/location/federal-way/\", \n \"https://www.bk.com/\", \n \"http://thehodgepodgecafe.com\", \n \"http://tsriumathaikenmore.com\", \n \"https://www.coldstonecreamery.com/\", \n \"https://ikiikisushi.com/\", \n \"https://www.tastybistroeverett.com\", \n \"https://www.cairnbrewing.com/\", \n \"https://www.umamieverett.com\", \n \"http://www.thelodgesportsgrille.com\", \n \"https://www.ivars.com\", \n \"https://locations.jackinthebox.com/us/wa/federal-way/1610-s-347th-pl\", \n \"https://locations.jackinthebox.com/us/wa/federal-way/2400-sw-336th-st\", \n \"https://locations.jackinthebox.com/us/wa/federal-way/31130-pacific-hwy-s\", \n \"http://jamba.com\", \n \"https://locations.jimmyjohns.com/wa/federalway/sandwiches-1438.html\", \n \"https://www.ivars.com\", \n \"http://www.thelodgesportsgrille.com\", \n \"https://majorleaguepizza.com\", \n \"https://www.graciescuisine.com\", \n \"https://www.everettpizzahouse.com\", \n \"http://www.sportysbeefandbrew.com\", \n \"https://bhupingthaicuisine.com\", \n \"http://deluxebarandgrill.com\", \n \"http://www.airwaysbrewing.com\", \n \"https://www.facebook.com/CCs-20-Espresso-Ice-Creamery-334104710024053/\", \n \"http://www.australianpieco.com/\", \n \"https://theburienfishhouse.com/\", \n \"http://www.elrinconsito.com/\", \n \"https://snack-gyro.business.site/\", \n \"http://vincesrestaurants.com/\", \n \"http://www.ivars.com\", \n \"https://www.taquerialaestacionseattle.com/\", \n \"http://sammamish.cafesinc.com/\", \n \"http://bellalunapizzaandpasta.com/zgrid/themes/13030/intro/index.jsp\", \n \"https://www.facebook.com/TheNewMexicans/\", \n \"http://www.labambakent.com/home.html\", \n \"https://www.facebook.com/pages/category/Chicken-Joint/That-Chicken-Place-563512834051166/\", \n \"http://www.barkadaedmonds.com\", \n \"http://places.singleplatform.com/thai-on-main-street--/menu\", \n \"https://www.westsidepizza.com/\", \n \"https://sawatdythai.com/\", \n \"https://www.hammysburgers.com/\", \n \"https://casa-rojas-express.business.site/\", \n \"https://islabonitarestaurant.com/\", \n \"https://curriesineverett.com\", \n \"https://www.marriott.com\", \n \"https://www.redrocksubs.com\", \n \"https://www.romioseverett.com\", \n \"https://winnyha.wixsite.com/hotironmongolian\", \n \"https://www.elparaisomexicangrill.com\", \n \"https://www.elparaisomexicangrill.com\", \n \"http://boatshed.restaurant/\", \n \"https://www.hellokfresh.com\", \n \"https://www.that1place.net/\", \n \"https://www.coamexicaneatery.com/\", \n \"https://www.thaibistro.us/federalway\", \n \"https://bargreenscoffee.com\", \n \"https://www.thaivalley-restaurant.com\", \n \"http://www.pizzazza.com/\", \n \"https://petitesweetbakery.com\", \n \"https://www.thaimana.com/\", \n \"http://www.kaisushiroll.com/\", \n \"https://www.dickeys.com\", \n \"https://www.alfyspizza.com\", \n \"https://www.alfyspizza.com\", \n \"https://www.tampico-mexicanrestaurant.com\", \n \"http://www.mythaichili.com/\", \n \"https://althascajunspices.com/\", \n \"https://www.mamastortinis.com\", \n \"https://www.facebook.com/pages/Burritos-el-incapaz/162913063762144\", \n \"https://wildwheatbakery.com/\", \n \"https://www.facebook.com/pages/Mexico-Lindo/120617377955112\", \n \"https://www.mamastortinis.com\", \n \"http://www.myegghole.com\", \n \"https://www.mamastortinis.com\", \n \"http://Www.Iwantsomebigboys.Com\", \n \"http://www.trapperssushi.com/kentstation\", \n \"https://www.noodlenationeverett.com\", \n \"http://www.antiguaguatemalarestaurant.com\", \n \"https://www.bluewaterdistilling.com\", \n \"https://capersandolives.com\", \n \"https://www.thecakewalkshop.com\", \n \"https://www.cafewylde.com\", \n \"https://theirishmen.com\", \n \"https://apogeepub.com/\", \n \"https://www.applebees.com/en/restaurants-renton-wa/375-s-grady-way-7520\", \n \"http://www.togos.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.Dickeys.com\", \n \"https://www.ddir.com/kentlocation/\", \n \"https://www.paolositalian.com\", \n \"https://www.facebook.com/SayaJapaneseAndThai/\", \n \"http://kjscakerybakery.com\", \n \"http://www.tastydoux.com\", \n \"https://www.yelp.com/biz/mei-wa-bakery-kent\", \n \"https://happydonut.business.site\", \n \"http://saigonsoulrestaurant.com/\", \n \"https://108-vietnamese-restaurant.business.site/\", \n \"https://sweetthemesbakery.com\", \n \"http://www.Olivegarden.com\", \n \"https://www.thewestyseattle.com/\", \n \"https://www.pizzamartkent.com/\", \n \"https://togoorder.com/web/1550#/\", \n \"https://www.facebook.com/boilingcrawfishkent/\", \n \"https://www.facebook.com/pages/Yummy-Teriyaki/121484877865311\", \n \"https://www.facebook.com/pages/Bucks-Teriyaki/115882655099456\", \n \"https://www.facebook.com/pages/Nikko-Teriyaki/155736057780627\", \n \"https://www.facebook.com/pages/Kings-Teriyaki/117538944939084\", \n \"https://www.facebook.com/pages/Konichs-Teriyaki/120759777938348\", \n \"https://www.facebook.com/pages/category/Asian-Restaurant/Ichi-2-Teriyaki-160109784049840/\", \n \"https://www.facebook.com/pages/Kims-Teriyaki/115791471775119\", \n \"https://www.facebook.com/pages/Ichi-Teriyaki/113506478683997\", \n \"http://www.hungrymungrys.com\", \n \"https://www.facebook.com/Bento-Teriyaki-172111859497362/\", \n \"https://www.facebook.com/pages/Tokyo-Town-Teriyaki/117828944910857\", \n \"https://www.facebook.com/pages/Himitsu-Teriyaki/117588011593179\", \n \"https://www.jackinthebox.com/\", \n \"http://www.bertassalvadorankitchen.com/contact-us/\", \n \"https://desmoinesmandarinkitchen.com/\", \n \"https://www.originvietnamesebistro.com/\", \n \"http://bokabokchicken.com\", \n \"http://places.singleplatform.com/dinos-ice-cream/menu?ref=google\", \n \"https://www.yummychinesemenu.com/\", \n \"https://www.menupix.com/seattle/restaurants/4706491/Manna-Teriyaki-Des-Moines-WA\", \n \"http://kingwha.com\", \n \"https://dragongate.business.site/\", \n \"https://www.subway.com/en-us\", \n \"http://www.jalisco-mex.com/Jalisco/Jalisco_Lake_City.html\", \n \"https://newtokyoteriyaki.com/\", \n \"http://amonosmex.com/\", \n \"http://angelosofburien.com\", \n \"https://the-best-teriyaki-sushi-wa.hub.biz/\", \n \"http://aztecamex.com\", \n \"http://burienpizzeria.com\", \n \"http://burgerbroiler.com\", \n \"https://teacup-bubble-tea-store.business.site/\", \n \"https://www.facebook.com/phodinhrestaurant/\", \n \"https://www.desmoinesthaicuisine.com/\", \n \"https://bigfootjava.com/\", \n \"https://www.restaurantji.com/wa/des-moines/haru-sushi-and-teriyaki-/\", \n \"https://www.bing.com/maps?q=sharetea&form=EDGEAR&qs=LS&cvid=ef666cde4eb5433a861f834c3fce40bb&cc=US&setlang=en-US&plvar=0\", \n \"https://www.facebook.com/CherryValleyWinery/\", \n \"https://www.auntieirenes.com/\", \n \"https://www.gpdoughnuts.com/locations/capitol-hill\", \n \"https://www.quarterdeckdm.com/\", \n \"https://www.gpdoughnuts.com/locations/laurelhurst\", \n \"http://northwestgrocers.com/\", \n \"https://www.bing.com/search?q=homefront+ice+cream+des+moines&form=EDGEAR&qs=AS&cvid=530f5fcc560c44059378035413684897&cc=US&setlang=en-US&plvar=0\", \n \"http://duvallfarmersmarket.org/\", \n \"https://www.minithedough-nut.com/\", \n \"https://restaurants.subway.com/united-states/wa/des-moines/21425-pacific-hwy-south?utm_source=yxt-bing&utm_medium=local&utm_term=acq&utm_content=3524&utm_campaign=evergreen-2020\", \n \"https://www.subway.com/en-us\", \n \"https://www.tjmexicanfood.com\", \n \"https://www.marineviewespresso.net/\", \n \"https://www.facebook.com/Northhillespresso/\", \n \"https://bizzy-bean-espresso.business.site/\", \n \"https://www.facebook.com/riptideroast/\", \n \"http://www.peyrassolcafe.com/\", \n \"http://www.cubesbaking.com/\", \n \"https://www.kentgyrostation.com/\", \n \"https://www.wallysrestaurants.com/wallyschowderhouse\", \n \"https://www.saltys.com/south-seattle/\", \n \"https://www.anthonys.com/restaurants/detail/anthonys-homeport-des-moines\", \n \"https://www.bandemeats.com/\", \n \"https://www.bing.com/maps?&ty=18&q=Viva%20Mexico%20Des%20Moines%20WA&ss=ypid.YN926x15851500&ppois=47.36823272705078_-122.30463409423828_Viva%20Mexico_YN926x15851500~&cp=47.368233~-122.304634&v=2&sV=1\", \n \"https://www.facebook.com/californiaburritobtech195/\", \n \"https://www.bing.com/maps?&ty=18&q=Cemitas%20Tepeaca%202%20Des%20Moines%20WA&ss=ypid.YN873x134793378&ppois=47.40752029418945_-122.2978286743164_Cemitas%20Tepeaca%202_YN873x134793378~&cp=47.40752~-122.297829&v=2&sV=1\", \n \"https://locations.tacobell.com/wa/kent/27001-pacific-hwy-s.html?utm_source=yext&utm_campaign=googlelistings&utm_medium=referral&utm_term=031320&utm_content=website\", \n \"https://www.facebook.com/menuderiamaria/\", \n \"http://www.athenspizzapasta.com/\", \n \"http://vincesrestaurants.com/via-marina\", \n \"https://www.facebook.com/SpyrosGyrosEtc/\", \n \"https://www.hilton.com/en/hotels/sealwes-embassy-suites-seattle-north-lynnwood/dining/\", \n \"https://www.bing.com/maps?q=papa+murphys+des+moines&form=EDGEAR&qs=PF&cvid=11b7bb2085f14d65bae74d741102c02b&cc=US&setlang=en-US&plvar=0\", \n \"https://www.bobalustteahouse.com/\", \n \"https://www.restaurantji.com/wa/des-moines/midway-donuts-and-gyros-/\", \n \"https://locu.com/places/des-moines-dog-house-des-moines-us/\", \n \"https://www.bing.com/maps?&ty=18&q=Jack%27s%20Country%20Restaurant%20Des%20Moines%20WA&ss=ypid.YN926x15851476&ppois=47.40538024902344_-122.32514953613281_Jack%27s%20Country%20Restaurant_YN926x15851476~&cp=47.40538~-122.32515&v=2&sV=1\", \n \"https://order.redrobin.com/menu/red-robin-des-moines\", \n \"https://www.cybercoupons.com/wa/tuscany-at-des-moines-creek-des-moines\", \n \"https://www.jerseymikes.com/18031/kent-wa\", \n \"https://www.jpsbars.com/location/jps-taproom-grill/\", \n \"https://www.bing.com/maps?q=jack+in+the+box+des+moines&form=EDGEAR&qs=PF&cvid=b752ce0903f04b639bb33c5fb8ba5d39&cc=US&setlang=en-US&plvar=0\", \n \"http://www.olivetreemenu.com\", \n \"http://mamasdoughkent.com\", \n \"http://agaverest.com/\", \n \"https://sweetnotescafe.com/\", \n \"https://taste-togo-banhmi.business.site/\", \n \"https://www.habitburger.com/locations/kent/\", \n \"http://drinkbambu.com\", \n \"https://www.alkibakery.com/\", \n \"https://www.facebook.com/pg/DuvallGrill/posts/?ref=page_internal\", \n \"https://locations.jackinthebox.com/us/wa/des-moines/1810-s-272nd-st\", \n \"https://locations.kfc.com/wa/des-moines/25925-pacific-highway-south\", \n \"https://locations.churchs.com/wa/des-moines/23839-pacific-hwy-south\", \n \"https://www.mcdonalds.com/us/en-us/location/wa/des-moines/22644-pacific-hwy-s/5760.html\", \n \"https://www.facebook.com/duvallvodka/\", \n \"https://www.facebook.com/GratefulBreadDuvall/\", \n \"https://www.facebook.com/pages/Happy-At-The-Bay/116442285050382\", \n \"https://www.facebook.com/pages/Blinker-Tavern/121351824546475\", \n \"https://www.facebook.com/hollyhockfarmnw/\", \n \"https://www.ixtapaduvall.com/\", \n \"http://localrootsfarm.com/farm-stand/\", \n \"https://www.facebook.com/LongevityFoods/\", \n \"https://www.terracottaredbistro.com\", \n \"https://www.facebook.com/OxbowCenter/\", \n \"https://order.papamurphys.com/menu/papa-murphys-big-rock\", \n \"https://theorganiccoup.com/\", \n \"https://www.facebook.com/phothailand/\", \n \"http://www.magic-flavors.com\", \n \"https://www.facebook.com/pickletimeduvall/\", \n \"https://www.aesirmeadery.com\", \n \"http://www.mazagrill.co\", \n \"https://atlargebrewing.com\", \n \"https://cruciblebrewing.com\", \n \"https://www.jamesbaydistillers.com/\", \n \"http://restaurants.quiznos.com/wa/duvall\", \n \"https://www.facebook.com/MiddletonBrews/\", \n \"http://redpepperpizzeria.com/\", \n \"https://scuttlebuttbrewing.com\", \n \"https://theindependentbeerbar.com\", \n \"https://www.rusticcabincoffee.com/\", \n \"https://local.safeway.com/safeway/wa/duvall/14020-main-st-ne.html\", \n \"https://orders.ordercoldstone.com/menu/lakewood-gravelly-lake-dr\", \n \"https://www.facebook.com/Ayjaliscos/?rf=939571796120769\", \n \"https://www.bickersonsbrewhouse.com/\", \n \"https://www.facebook.com/Starbucks-155903124420285/\", \n \"https://burgeraddict.com/\", \n \"https://order.subway.com/en-US/restaurant/12116/menu\", \n \"http://www.swiftandsavory.com/\", \n \"http://www.thaiduvall.com/\", \n \"https://www.thegrangeduvall.com/\", \n \"https://ezellschicken.com/\", \n \"https://www.facebook.com/twindragonsportsbar/\", \n \"https://valleyhousebrewing.com/\", \n \"https://www.zazynia.com/\", \n \"https://www.facebook.com/CarriageSquareBar/\", \n \"https://www.ilpaesanoristorante.com/\", \n \"https://theironduckpublichouse.com/food/\", \n \"https://www.carlsjr.com/\", \n \"http://Www.subway.com\", \n \"http://Www.subway.com\", \n \"http://Www.subway.com\", \n \"http://Www.subway.com\", \n \"https://apollogreekfood.com/menu\", \n \"https://arbys.com/\", \n \"https://www.blimpie.com/stores/11227\", \n \"https://locations.bk.com/wa/north-bend/736-sw-mt-si-blvd.html\", \n \"http://chowdercafenb.com/\", \n \"http://www.elcaporalnorthbend.com/\", \n \"https://frankies-pizza.com/our-locations/\", \n \"https://huxdottercoffee.com/\", \n \"https://www.jerseymikes.com/18024/north-bend-wa\", \n \"http://www.littlesirestaurantandlounge.com/\", \n \"http://outandaboutburgers.com/food.htm\", \n \"https://www.facebook.com/antonysfrutasyantojitos/\", \n \"https://therobinhoodpizza.com/\", \n \"https://m.facebook.com/La-Rioja-Mexican-Cuisine-329444801207244/posts/\", \n \"https://www.facebook.com/menchieslakelandtowncenter/\", \n \"https://www.frugalburger.com/\", \n \"http://projectfeast.org/index.html\", \n \"https://locations.chipotle.com/wa/renton/439-rainier-ave-s\", \n \"https://www.facebook.com/chucksdonutrenton/\", \n \"https://dubtownbrewingcompany.com/\", \n \"https://www.safeway.com/\", \n \"http://pickup.pochibubbletea.com\", \n \"https://www.mixpokebar.com/\", \n \"http://www.loscabos-northbend.com\", \n \"https://www.mcdonalds.com/us/en-us/location/wa/north-bend/735-mount-si-blvd/10356.html\", \n \"https://thenorthbendbakery.com/\", \n \"https://order.papamurphys.com/menu/papa-murphys-sw-mt-si\", \n \"https://pioneercoffeeco.com/\", \n \"https://www.riobravomex.com/\", \n \"https://places.singleplatform.com/the-riverbend-cafe/menu?ref=Microsoft\", \n \"https://scottsdairyfreeze.smartonlineorder.com/\", \n \"https://order.subway.com\", \n \"https://order.tacotimenw.com/menu/north-bend\", \n \"https://trapperssushi.com/northbend\", \n \"http://wildflowerwineshop.com/\", \n \"https://www.facebook.com/Al-carbon-mexican-asadero-367335087440770/\", \n \"https://elmcoffeeroasters.com\", \n \"https://elmcoffeeroasters.com\", \n \"https://www.facebook.com/sluggers.seattle/\", \n \"https://abitoftaste.com/\", \n \"https://www.communitylunch.org/#\", \n \"https://www.egganduswa.com/location/the-egg-us-ballard/\", \n \"https://www.aerlumeseattle.com/\", \n \"https://candpcoffee.com/\", \n \"https://www.humblevinewine.com/\", \n \"http://www.shrimpshack.us\", \n \"https://www.facebook.com/thaieaterysnoqualmie/\", \n \"http://ti22belltown.com\", \n \"http://sriumathaikenmore.com/\", \n \"https://kentdogwood.com\", \n \"https://JOULERESTAURANT.COM\", \n \"https://www.theguesthouserestaurant.com/takeout/\", \n \"http://jasperscoffee.com\", \n \"https://www.woodringnorthwest.com\", \n \"https://Www.cathousepizza.com\", \n \"https://www.serafinaseattle.com\", \n \"https://www.cicchettiseattle.com\", \n \"https://www.dickeys.com/\", \n \"https://www.thebinebothell.com/\", \n \"https://www.chontongthaicuisineseatac.com/\", \n \"http://www.eastlake-coffee.com\", \n \"https://applebees.com\", \n \"http://bedlamcoffee.com\", \n \"https://www.einsteinbros.com/\", \n \"https://tintecellars.com/\", \n \"https://www.einsteinbros.com/\", \n \"https://www.tintecellars.com\", \n \"https://www.cafejuanita.com\", \n \"https://order.royceconfectusa.com/\", \n \"https://7615300.wixsite.com/teriyakiplus\", \n \"http://www.harvestbeat.com/\", \n \"http://medzogelatobar.com\", \n \"https://www.lgskitchen.com/\", \n \"https://www.lacostaburien.com\", \n \"http://www.royaleverestburienwa.com\", \n \"https://2121pub.com\", \n \"http://www.pizzastudio.com/\", \n \"https://www.coldstonecreamery.com/\", \n \"https://www.coldstonecreamery.com/\", \n \"https://www.coldstonecreamery.com/\", \n \"http://www.blackstar.pub/\", \n \"https://orders.ordercoldstone.com/menu/woodinville\", \n \"https://orders.ordercoldstone.com/menu/mill-creek-town-center\", \n \"http://kimskitchenseattle.com\", \n \"https://bit.ly/AlohaOrderedOnline\", \n \"http://www.hanumanthai-cafe.com/\", \n \"https://ajisushigrill.com/\", \n \"https://blackbeardiner.com/location/lakewood/\", \n \"http://www.blazingonion.com/\", \n \"https://www.facebook.com/DIYTeaLab/\", \n \"https://www.moshimoshiseattle.com\", \n \"http://vivipizzeria.com\", \n \"https://orders.ordercoldstone.com/menu/lacey\", \n \"https://coldstonecreamery.com\", \n \"https://coldstonecreamery.com\", \n \"http://SubZeroIceCream.com\", \n \"https://www.fondi.com\", \n \"http://Blueagavemexicangrilltequilabar.com\", \n \"https://www.the-sitting-room.com/\", \n \"https://www.mcmenamins.com/queen-anne\", \n \"https://glorybucha.com\", \n \"https://www.itsbrewing.com\", \n \"https://tokyohouse.uwu.ai/\", \n \"https://skookumbrewery.com\", \n \"https://www.localjoeespresso.com\", \n \"https://bluebirdcafei.com\", \n \"https://lahaciendawa.com/\", \n \"https://www.moesespresso.com\", \n \"https://www.playabonita.com\", \n \"http://arlingtonpharmacy.com\", \n \"https://www.sanjuansalsa.com\", \n \"http://www.vashoniq.com\", \n \"https://magnusonbrewery.com/\", \n \"https://www.facebook.com/FiveGuysRentonWA/\", \n \"https://www.facebook.com/jaguarrestaurantrenton/\", \n \"http://www.jayberryscafe.com/\", \n \"https://justpoke.com/\", \n \"http://www.naanncurry.com/\", \n \"https://www.facebook.com/OJBG.renton/\", \n \"https://www.facebook.com/papayalanding/\", \n \"https://mypizzadudes.com/home.php\", \n \"https://www.shopantiques4u.com/heritage-ciders\", \n \"https://www.refuel-cafe.com/\", \n \"https://www.therockwfp.com/\", \n \"https://sansonina-ristorante-italiano.business.site/?m=true\", \n \"https://www.smokingmonkeypizza.com/\", \n \"https://www.facebook.com/Sorrentos-Coffee-Renton-Highlands-105200382966366/\", \n \"https://tacodelmar.com/location/?id=59\", \n \"https://www.toreros-mexicanrestaurants.com/\", \n \"http://www.toshiteriyaki.com/\", \n \"https://www.trencherskitchenandtap.com/\", \n \"https://www.facebook.com/pg/VinoAtTheLanding/posts/?ref=page_internal\", \n \"https://www.wingstop.com/location/wingstop-748-renton-wa-98057/menu\", \n \"https://www.fortuneinnchinese.com/orderonline.aspx\", \n \"https://www.jerseymikes.com/\", \n \"https://jetcity.breakawayiris.com/?location_code=GRE04001\", \n \"https://www.locochonbarandgrill.com/\", \n \"https://orders.ordercoldstone.com/menu/factoria\", \n \"https://modpizza.com\", \n \"https://papamurphys.com\", \n \"https://subway.com\", \n \"http://tuscanstonepizza.com\", \n \"https://yangskitchennewcastle.com\", \n \"https://yeaswok.com\", \n \"https://www.coldstonecreamery.com/stores/21157\", \n \"http://www.maelstrombrewing.com/\", \n \"https://www.TriplehornBrewing.com\", \n \"https://mrkleen.com/cafe/\", \n \"http://belltownpizza.net/\", \n \"https://pho-ever-bellevue.com/\", \n \"https://www.hubbspizza.com\", \n \"https://www.russelllowell.com/\", \n \"https://www.emorys.com\", \n \"http://localjoeespresso.com\", \n \"https://www.facebook.com/roosters.espresso.inc.mlt/\", \n \"https://www.facebook.com/roosters.espresso.inc/\", \n \"http://www.lumpiaworld.com\", \n \"http://www.quinnspubseattle.com\", \n \"http://www.kvltmead.com\", \n \"http://www.purplecafe.com\", \n \"http://www.thecommonscafe.com/\", \n \"http://www.meetthemooncafe.com\", \n \"https://pabloypablo.com\", \n \"https://fiascoseattle.com\", \n \"http://www.barriorestaurant.com\", \n \"https://www.wildfinamericangrill.com/what-a-catch-fishbar/\", \n \"https://www.wildfinamericangrill.com/what-a-catch-fishbar/\", \n \"http://www.zolascafe.com\", \n \"http://sugeesboxlunch.com\", \n \"https://www.zomato.com/bellevue-wa/i-love-teriyaki-bellevue/menu\", \n \"http://regentbakeryandcafe.com/redmond\", \n \"https://m.facebook.com/mackysdimsum/\", \n \"http://www.theblackduckcaskandbottle.com\", \n \"http://www.noodleboat.com\", \n \"https://www.mcdonalds.com\", \n \"https://www.mcdonalds.com\", \n \"http://Www.thefrenchbakery.com\", \n \"https://vivibubbletea.com/about.html\", \n \"http://thexcj.com\", \n \"http://Www.theguilttriprestaurant.com\", \n \"https://www.yelp.com/biz/herfys-burgers-redmond\", \n \"http://Nikoteriyaki.com\", \n \"http://www.stonekorean.com\", \n \"https://www.offthevinecaterers.com/\", \n \"https://hopsndrops.com/\", \n \"https://locations.jimmyjohns.com/wa/kirkland/sandwiches-1074.html\", \n \"https://locations.jimmyjohns.com/wa/bellevue/sandwiches-1519.html\", \n \"https://earls.ca/locations/bellevue\", \n \"https://pearlbellevue.com/\", \n \"https://locations.maggianos.com/washington/bellevue/10455-ne-8th-st./\", \n \"https://www.cocoizakayabellevue.com/\", \n \"https://istanbul-cuisine.square.site/\", \n \"https://fogodechao.com/location/bellevue/\", \n \"https://bamboo-gardens.com/inchins-bamboo-garden-locations##WAWA\", \n \"https://www.bowl-gogi.com/\", \n \"http://www.dolarshop.com/en/Seattlemenu.htm\", \n \"https://order.subway.com/en-us/restaurant/24777/menu/?utm_source=yxt-goog&utm_medium=local&utm_term=acq&utm_content=24777&utm_campaign=evergreen-2020\", \n \"http://www.aztecamex.com/bellevue-azteca/\", \n \"http://www.rockysempanadas.com\", \n \"https://www.yelp.com/biz/nasai-teriyaki-kirkland\", \n \"https://www.couzinscafekirkland.com/\", \n \"http://www.georgeskirkland.com\", \n \"https://coastlineburgers.com/\", \n \"https://www.facebook.com/Divinity-Coffee-Co-343149205759369/\", \n \"http://CafeOrganiqueKirkland.square.site\", \n \"http://www.padriacafe.com/\", \n \"https://www.yelp.com/biz/aa-sushi-kirkland\", \n \"https://www.chipotle.com/\", \n \"https://www.joesburgers.com/\", \n \"http://www.kenzaburosushi.com\", \n \"https://www.macalusositalianrestaurant.com/\", \n \"http://www.europabistro.net/\", \n \"http://www.illucanoristorante.com/\", \n \"https://www.massimobarandgrill.com/\", \n \"https://www.osf.com/location/lynnwood-wa/\", \n \"https://www.osf.com/location/tacoma-wa/\", \n \"https://www.osf.com/location/tukwila-wa/\", \n \"http://onthemenu-tacoma.tripod.com/id1.html\", \n \"https://www.tatankatakeout.com/\", \n \"https://www.facebook.com/MSM-Deli-81746047858/\", \n \"https://www.peaksandpints.com/\", \n \"http://www.viva4life.com/\", \n \"http://www.dirtyoscarsannex.com/\", \n \"https://www.jpsbars.com/\", \n \"http://www.tkirishpub.com/\", \n \"http://topsidebargrill.com/\", \n \"http://www.thebairbistro.com/\", \n \"https://m.facebook.com/pages/Magoos/227313433999721\", \n \"https://www.mcmenamins.com/elks-temple\", \n \"https://bobsburgersandbrew.com/\", \n \"http://instagram.com/BURGERSEOUL\", \n \"https://www.dustyshideaway.com/\", \n \"http://www.lumidessertcafe.com\", \n \"http://www.vivapoquitos.com\", \n \"http://Banhmibites.com\", \n \"https://thewingdome.com/\", \n \"http://www.omabap.com\", \n \"http://thaiwisdomkirkland.com/\", \n \"http://www.gophillycheesesteaks.com \", \n \"https://www.cheesemongerstable.com/\", \n \"https://www.socialgroundscoffee.com/\", \n \"http://stonecreekwfp.com/\", \n \"https://www.ivars.com/\", \n \"https://www.benjerry.com/kirkland\", \n \"https://kirkland.isarnkitchen.com/\", \n \"http://www.jujubeet.com\", \n \"http://primogrilltacoma.com\", \n \"https://www.facebook.com/pages/Thai-Tom/116869645004757\", \n \"http://www.madison-kitchen.com/\", \n \"http://www.juliorestaurant.com\", \n \"https://oishi-yummu.business.site/?utm_medium=referral&utm_source=gmb\", \n \"http://thaifoodtogo.com\", \n \"http://shakeys.com\", \n \"https://watershedpub.com/\", \n \"http://www.planetjavadiner.com/Site/Planet_Java_Diner.html\", \n \"http://bitterrootbbq.com\", \n \"http://mammothseattle.com\", \n \"https://www.ingallina.net/\", \n \"https://www.sodopizza.com/\", \n \"http://www.shikijapaneserestaurant.com/\", \n \"https://rosewoodcafe.com\", \n \"https://monsoonrestaurants.com/seattle/\", \n \"http://gloscafe.com/\", \n \"https://www.facebook.com/cafeosita/\", \n \"https://www.facebook.com/alkibeachpubandeatery/\", \n \"https://bonchon.com/korean-fried-chicken-first-hill-wa/\", \n \"http://www.gelatiamo.com/\", \n \"https://www.siprestaurant.com\", \n \"https://baskinrobbins.com\", \n \"https://baskinrobbins.com\", \n \"http://Piroshkion3rd.com\", \n \"http://www.shikusushi.com\", \n \"https://www.eatwafflestop.com\", \n \"http://www.adasbooks.com\", \n \"http://www.omegaouzeri.com\", \n \"http://www.vioscafe.com\", \n \"http://www.harvestvine.com\", \n \"http://www.eatacadia.com\", \n \"http://snowyriverbelltown.com\", \n \"http://qedcoffee.com\", \n \"http://www.forgeroncellars.com\", \n \"https://www.zeekspizza.com\", \n \"http://Tilikumplacecafe.com\", \n \"https://www.grumpysfoodtruck.com/\", \n \"https://www.ivars.com/locations/acres-of-clams\", \n \"https://www.ivars.com/locations/salmon-house\", \n \"https://www.ivars.com/\", \n \"http://www.cafecampagne.com\", \n \"https://www.bentoyagoemon.com/\", \n \"https://www.izumikirkland.com/\", \n \"http://heartbeethealthy.com/\", \n \"http://www.crawfishhouse206.com/\", \n \"https://www.harrysbeachhouse.com/ea\", \n \"https://www.olympiacoffee.com/\", \n \"https://www.shadowlandwest.com/\", \n \"https://www.starbucks.com/store-locator/store/8771/west-seattle-4101-sw-admiral-way-seattle-wa-981162517-us\", \n \"https://www.whiskywest.com/\", \n \"https://www.evergreens.com/locations\", \n \"https://www.seaplanekitchen.com/\", \n \"https://wickedchopstix.business.site/?utm_source=gmb&utm_medium=referral\", \n \"https://www.listbelltown.com/\", \n \"https://www.cinqueterreseattle.com/\", \n \"http://www.baroloseattle.com\", \n \"https://diamondknot.com\", \n \"https://diamondknot.com\", \n \"https://diamondknot.com/\", \n \"https://www.andaluca.com/to-go-menu/\", \n \"https://www.squareup.com/store/wildrose\", \n \"https://www.moxboardinghouse.com/bellevue/\", \n \"https://www.moxboardinghouse.com/seattle/\", \n \"https://www.ladiveseattle.com\", \n \"https://www.mexicanfoodrenton.com/\", \n \"https://www.facebook.com/sushimakiburien\", \n \"https://bizremix.com/kitchen-remix\", \n \"sushikudasai.com\"];\n var value = arr[Math.floor(Math.random() * arr.length)];\n //alert(\"Going to: \" + value);\n window.location = value;\n}", "function showFeedBackUrl() {\n\tremoveMessageFromDivId();\n\tremoveSuccessOrFailureStrip();\n\tvar userId = getCookie(\"userId\");\n\tvar registerUser = parseBoolean(localStorage.getItem(\"registerUser\"));\n\tvar isGuest = true;\n\tvar email =\"\";\n\tvar phone = \"\";\n\tif(registerUser && user_get_profile_obj){\n\t\tisGuest = false;\n\t\temail = user_get_profile_obj.user.email;\n\t\tphone = user_get_profile_obj.user.phone;\n\t}\n\tvar url = footerUrlName[\"FooterFeedBackUrl\"] + \"?userID=\" + userId + \"&isGuest=\" + isGuest + \"&email=\" + email + \"&phone=\" + phone;\n\tbookmarks.sethash('#moreinfo',showFooterPopup, url); \n\treturn false;\n}", "function globalDR() {\r\n\twindow.plugins.webintent.onNewIntent(function (url) {\r\n\t\tfollowIntent(url);\r\n\t});\r\n}", "tweetButton(evnt, org) {\n let base = '<a class=\"button share\" target=\"_blank\" rel=\"noopener\" href=\"http://twitter.com/home?status=MESSAGE\">Share</a>';\n let msg = `Check out this event by ${org.twitterHandle ? '@' + org.twitterHandle : org.name} - ${evnt.title} `;\n if (msg.length >=106) {\n msg = msg.slice(0, 102);\n msg += '...';\n }\n msg += `https://community-events-pwa.herokuapp.com/event/${evnt.id} #GatherSW`;\n msg = encodeURIComponent(msg);\n return base.replace('MESSAGE', msg);\n }", "function atLinks() {\n linklist = [\"239MTG\", \"affinityforartifacts\", \"alliesmtg\", \"AllStandards\", \"Alphabetter\", \"Amonkhet\", \"architectMTG\", \"ArclightPhoenixMTG\", \"aristocratsMTG\", \"BadMTGCombos\", \"basementboardgames\", \"BaSE_MtG\", \"BudgetBrews\", \"budgetdecks\", \"BulkMagic\", \"cardsphere\", \"casualmtg\", \"CatsPlayingMTG\", \"CircuitContest\", \"cocomtg\", \"CompetitiveEDH\", \"custommagic\", \"DeckbuildingPrompts\", \"edh\", \"EDHug\", \"EggsMTG\", \"ElvesMTG\", \"enchantress\", \"EsperMagic\", \"findmycard\", \"fishmtg\", \"FlickerMTG\", \"freemagic\", \"goblinsMTG\", \"HamiltonMTG\", \"HardenedScales\", \"humansmtg\", \"infect\", \"johnnys\", \"kikichord\", \"lanternmtg\", \"lavaspike\", \"locketstorm\", \"lrcast\", \"magicarena\", \"Magicdeckbuilding\", \"MagicDuels\", \"magicTCG\", \"magicTCG101\", \"MakingMagic\", \"marchesatheblackrose\", \"marduMTG\", \"MentalMentalMagic\", \"millMTG\", \"ModernLoam\", \"modernmagic\", \"ModernRecMTG\", \"modernspikes\", \"ModernZombies\", \"monobluemagic\", \"mtg\", \"MTGAngels\", \"mtgbattlebox\", \"mtgbracket\", \"mtgbrawl\", \"mtgbudgetmodern\", \"mtgcardfetcher\", \"mtgcube\", \"MTGDredge\", \"mtgfinalfrontier\", \"mtgfinance\", \"mtgfrontier\", \"mtglegacy\", \"MTGManalessDredge\", \"MTGMaverick\", \"mtgmel\", \"mtgrules\", \"mtgspirits\", \"mtgtreefolk\", \"mtgvorthos\", \"neobrand\", \"nicfitmtg\", \"oathbreaker_mtg\", \"oldschoolmtg\", \"pauper\", \"PauperArena\", \"PauperEDH\", \"peasantcube\", \"PennyDreadfulMTG\", \"PioneerMTG\", \"planeshiftmtg\", \"ponzamtg\", \"RatsMTG\", \"RealLifeMTG\", \"RecklessBrewery\", \"rpg_brasil\", \"scapeshift\", \"shittyjudgequestions\", \"sistersmtg\", \"skredred\", \"Sligh\", \"spikes\", \"stoneblade\", \"StrangeBrewEDH\", \"SuperUltraBudgetEDH\", \"therandomclub\", \"Thoptersword\", \"threecardblind\", \"TinyLeaders\", \"TronMTG\", \"UBFaeries\", \"uwcontrol\", \"xmage\", \"reddit.com/message\", \"reddit.com/user/MTGCardFetcher\"]\n\n for (j = 0; j < linklist.length; j++) {\n if (location.href.toLowerCase().includes(linklist[j].toLowerCase()))\n return true;\n }\n return false;\n}", "function share(action){\r\n\tvar loc = location.href\r\n\tloc = loc.substring(0, loc.lastIndexOf(\"/\") + 1);\r\n\tvar title = shareTitle.replace(\"[SCORE]\", playerData.newScore);\r\n\tvar text = shareTitle.replace(\"[SCORE]\", playerData.newScore);\r\n\tvar shareurl = '';\r\n\t\r\n\tif( action == 'twitter' ) {\r\n\t\tshareurl = 'https://twitter.com/intent/tweet?url='+loc+'&text='+text;\r\n\t}else if( action == 'facebook' ){\r\n\t\tshareurl = 'http://www.facebook.com/sharer.php?u='+encodeURIComponent(loc+'share.php?desc='+text+'&title='+title+'&url='+loc+'&thumb='+loc+'share.jpg');\r\n\t}else if( action == 'google' ){\r\n\t\tshareurl = 'https://plus.google.com/share?url='+loc;\r\n\t}\r\n\t\r\n\twindow.open(shareurl);\r\n}", "static getRecommendations() {\n return `accounts/brands/favorite`\n }", "function _GetFacebookInfo(site) {\n return $http.get(\"/api/widget/profile/\" + site)\n .then(_GetInfoSuccess)\n .catch(_GetInfoFail);\n }", "function urlToCode(url) {\n var code = url.replace(/ /g,'');\n if (url.indexOf('addthis.com/oexchange')>-1) {\n // special case\n code = url.split('oexchange/0.8/xrd/').pop().split('.').shift();\n }\n return code;\n }", "function buildUrl(name) {\n return \"https://api.github.com/users/\"+name;\n }" ]
[ "0.5522433", "0.53849095", "0.5373598", "0.5370209", "0.52420473", "0.5171384", "0.51689017", "0.5166397", "0.5165559", "0.51281446", "0.5105208", "0.5081464", "0.5073163", "0.5071567", "0.50082743", "0.50032276", "0.4986905", "0.4982798", "0.49758306", "0.49696445", "0.4966726", "0.49376762", "0.49356547", "0.4925758", "0.49220973", "0.49180636", "0.49178046", "0.4907221", "0.48860097", "0.4866038", "0.48494637", "0.48472276", "0.48392552", "0.48339832", "0.48333722", "0.483315", "0.48317796", "0.48295188", "0.48278427", "0.48072058", "0.47963166", "0.47893393", "0.4787837", "0.47866246", "0.4774705", "0.47711685", "0.47679728", "0.47672337", "0.47642624", "0.47630486", "0.4756104", "0.47483644", "0.4747334", "0.47435692", "0.47409672", "0.47329986", "0.47224736", "0.4720538", "0.4712573", "0.471022", "0.4707154", "0.4702161", "0.46984947", "0.46871814", "0.4685993", "0.46833548", "0.46791017", "0.46785668", "0.46701434", "0.46642178", "0.46637392", "0.46623203", "0.4650369", "0.46490353", "0.46401912", "0.46399787", "0.4638853", "0.46372354", "0.46340784", "0.46331286", "0.46271038", "0.46250853", "0.46170527", "0.4614246", "0.46134052", "0.4612633", "0.46079552", "0.46079358", "0.46061334", "0.45950493", "0.45935485", "0.45921817", "0.45901904", "0.4588615", "0.45884657", "0.45869315", "0.4585875", "0.45805767", "0.45804664", "0.45782992", "0.45771968" ]
0.0
-1
region responsive code begin you can remove responsive code if you don't want the slider scales while window resizing
function ScaleSlider() { var parentWidth = jssor_slider1.$Elmt.parentNode.clientWidth; if (parentWidth) jssor_slider1.$ScaleWidth(Math.min(parentWidth, 720)); else $Jssor$.$Delay(ScaleSlider, 30); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function responsive(){\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\n var heightLimit = options.responsiveHeight;\n\n //only calculating what we need. Remember its called on the resize event.\n var isBreakingPointWidth = widthLimit && $window.outerWidth() < widthLimit;\n var isBreakingPointHeight = heightLimit && $window.height() < heightLimit;\n\n if(widthLimit && heightLimit){\n FP.setResponsive(isBreakingPointWidth || isBreakingPointHeight);\n }\n else if(widthLimit){\n FP.setResponsive(isBreakingPointWidth);\n }\n else if(heightLimit){\n FP.setResponsive(isBreakingPointHeight);\n }\n\n /* nectar addition */ \n $(SECTION_NAV_SEL).css('margin-top', '-' + (($(SECTION_NAV_SEL).height()/2) - $adminBar - $headerHeight/2) + 'px');\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 }", "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 }", "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 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 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_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 }", "function responsive(){\r\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\r\n var heightLimit = options.responsiveHeight;\r\n\r\n //only calculating what we need. Remember its called on the resize event.\r\n var isBreakingPointWidth = widthLimit && window.innerWidth < widthLimit;\r\n var isBreakingPointHeight = heightLimit && window.innerHeight < heightLimit;\r\n\r\n if(widthLimit && heightLimit){\r\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\r\n }\r\n else if(widthLimit){\r\n setResponsive(isBreakingPointWidth);\r\n }\r\n else if(heightLimit){\r\n setResponsive(isBreakingPointHeight);\r\n }\r\n }", "function responsive(){\r\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\r\n var heightLimit = options.responsiveHeight;\r\n\r\n //only calculating what we need. Remember its called on the resize event.\r\n var isBreakingPointWidth = widthLimit && window.innerWidth < widthLimit;\r\n var isBreakingPointHeight = heightLimit && window.innerHeight < heightLimit;\r\n\r\n if(widthLimit && heightLimit){\r\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\r\n }\r\n else if(widthLimit){\r\n setResponsive(isBreakingPointWidth);\r\n }\r\n else if(heightLimit){\r\n setResponsive(isBreakingPointHeight);\r\n }\r\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 responsive(){\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\n var heightLimit = options.responsiveHeight;\n\n //only calculating what we need. Remember its called on the resize event.\n var isBreakingPointWidth = widthLimit && $window.outerWidth() < widthLimit;\n var isBreakingPointHeight = heightLimit && $window.height() < heightLimit;\n\n if(widthLimit && heightLimit){\n FP.setResponsive(isBreakingPointWidth || isBreakingPointHeight);\n }\n else if(widthLimit){\n FP.setResponsive(isBreakingPointWidth);\n }\n else if(heightLimit){\n FP.setResponsive(isBreakingPointHeight);\n }\n }", "function responsive(){\r\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\r\n var heightLimit = options.responsiveHeight;\r\n\r\n //only calculating what we need. Remember its called on the resize event.\r\n var isBreakingPointWidth = widthLimit && $window.outerWidth() < widthLimit;\r\n var isBreakingPointHeight = heightLimit && $window.height() < heightLimit;\r\n\r\n if(widthLimit && heightLimit){\r\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\r\n }\r\n else if(widthLimit){\r\n setResponsive(isBreakingPointWidth);\r\n }\r\n else if(heightLimit){\r\n setResponsive(isBreakingPointHeight);\r\n }\r\n }", "function responsive(){\r\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\r\n var heightLimit = options.responsiveHeight;\r\n\r\n //only calculating what we need. Remember its called on the resize event.\r\n var isBreakingPointWidth = widthLimit && $window.outerWidth() < widthLimit;\r\n var isBreakingPointHeight = heightLimit && $window.height() < heightLimit;\r\n\r\n if(widthLimit && heightLimit){\r\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\r\n }\r\n else if(widthLimit){\r\n setResponsive(isBreakingPointWidth);\r\n }\r\n else if(heightLimit){\r\n setResponsive(isBreakingPointHeight);\r\n }\r\n }", "function responsive(){\r\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\r\n var heightLimit = options.responsiveHeight;\r\n\r\n //only calculating what we need. Remember its called on the resize event.\r\n var isBreakingPointWidth = widthLimit && $window.outerWidth() < widthLimit;\r\n var isBreakingPointHeight = heightLimit && $window.height() < heightLimit;\r\n\r\n if(widthLimit && heightLimit){\r\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\r\n }\r\n else if(widthLimit){\r\n setResponsive(isBreakingPointWidth);\r\n }\r\n else if(heightLimit){\r\n setResponsive(isBreakingPointHeight);\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 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 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 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 responsive(){\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\n var heightLimit = options.responsiveHeight;\n\n //only calculating what we need. Remember its called on the resize event.\n var isBreakingPointWidth = widthLimit && window.innerWidth < widthLimit;\n var isBreakingPointHeight = heightLimit && window.innerHeight < heightLimit;\n\n if(widthLimit && heightLimit){\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\n }\n else if(widthLimit){\n setResponsive(isBreakingPointWidth);\n }\n else if(heightLimit){\n setResponsive(isBreakingPointHeight);\n }\n }", "function responsive(){\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\n var heightLimit = options.responsiveHeight;\n\n //only calculating what we need. Remember its called on the resize event.\n var isBreakingPointWidth = widthLimit && window.innerWidth < widthLimit;\n var isBreakingPointHeight = heightLimit && window.innerHeight < heightLimit;\n\n if(widthLimit && heightLimit){\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\n }\n else if(widthLimit){\n setResponsive(isBreakingPointWidth);\n }\n else if(heightLimit){\n setResponsive(isBreakingPointHeight);\n }\n }", "function responsive(){\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\n var heightLimit = options.responsiveHeight;\n\n //only calculating what we need. Remember its called on the resize event.\n var isBreakingPointWidth = widthLimit && window.innerWidth < widthLimit;\n var isBreakingPointHeight = heightLimit && window.innerHeight < heightLimit;\n\n if(widthLimit && heightLimit){\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\n }\n else if(widthLimit){\n setResponsive(isBreakingPointWidth);\n }\n else if(heightLimit){\n setResponsive(isBreakingPointHeight);\n }\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 responsive(){\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\n var heightLimit = options.responsiveHeight;\n\n //only calculating what we need. Remember its called on the resize event.\n var isBreakingPointWidth = widthLimit && $window.outerWidth() < widthLimit;\n var isBreakingPointHeight = heightLimit && $window.height() < heightLimit;\n\n if(widthLimit && heightLimit){\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\n }\n else if(widthLimit){\n setResponsive(isBreakingPointWidth);\n }\n else if(heightLimit){\n setResponsive(isBreakingPointHeight);\n }\n }", "function responsive(){\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\n var heightLimit = options.responsiveHeight;\n\n //only calculating what we need. Remember its called on the resize event.\n var isBreakingPointWidth = widthLimit && $window.outerWidth() < widthLimit;\n var isBreakingPointHeight = heightLimit && $window.height() < heightLimit;\n\n if(widthLimit && heightLimit){\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\n }\n else if(widthLimit){\n setResponsive(isBreakingPointWidth);\n }\n else if(heightLimit){\n setResponsive(isBreakingPointHeight);\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 }", "function responsive() {\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\n var heightLimit = options.responsiveHeight;\n\n //only calculating what we need. Remember its called on the resize event.\n var isBreakingPointWidth = widthLimit && $window.outerWidth() < widthLimit;\n var isBreakingPointHeight = heightLimit && $window.height() < heightLimit;\n\n if (widthLimit && heightLimit) {\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\n } else if (widthLimit) {\n setResponsive(isBreakingPointWidth);\n } else if (heightLimit) {\n setResponsive(isBreakingPointHeight);\n }\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 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\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() {\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() {\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 }", "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() {\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 reCalculateSliderParams() {\n //if ($('.bxslider-img li').length > 1) {\n // isAuto = true;\n //}\n\n var wd = window.innerWidth || $(window).width();\n if (wd < 1200) {\n if (wd > 767) {\n slides = 2;\n slideMode = 'vertical';\n }\n else if (wd <= 767 && wd > 600) {\n slideMode = 'horizontal';\n }\n else if (wd <= 600 && wd > 500) {\n slideMode = 'horizontal';\n slides = 2;\n }\n else {\n slideMode = 'horizontal';\n slides = 2;\n }\n }\n}", "function runMobilePhotoSlider() {\n if ($(window).width() < 1152) {\n $(\".photoGallery__list\").slick({\n infinite: false,\n speed: 600,\n arrows:false,\n dots:false,\n swipe:true,\n slidesToShow: 2,\n slidesToScroll: 2,\n responsive: [\n {\n breakpoint: 992,\n settings: {\n slidesToShow: 2,\n slidesToScroll: 2\n }\n },\n {\n breakpoint: 480,\n settings: {\n slidesToShow: 1,\n slidesToScroll: 1\n }\n }\n ]\n }).slick('setPosition');\n } else {\n if($(\".photoGallery__list\").hasClass(\"slick-slider\"))\n $('.photoGallery__list').slick(\"unslick\");\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\t var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n\t if (refSize) {\n\t refSize = Math.min(refSize, 809);\n\t jssor_1_slider.$ScaleWidth(refSize);\n\t }\n\t else {\n\t window.setTimeout(ScaleSlider, 30);\n\t }\n\t}", "function resizeMobileFunctions() {\n\t\tif ( !productGalleryThumbsSliderInitialized ) initSlickProductGallerySlider();\n\t}", "function responsive() {\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\n\n var heightLimit = options.responsiveHeight; //only calculating what we need. Remember its called on the resize event.\n\n var isBreakingPointWidth = widthLimit && window.innerWidth < widthLimit;\n var isBreakingPointHeight = heightLimit && window.innerHeight < heightLimit;\n\n if (widthLimit && heightLimit) {\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\n } else if (widthLimit) {\n setResponsive(isBreakingPointWidth);\n } else if (heightLimit) {\n setResponsive(isBreakingPointHeight);\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() {\n\t var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n\t if (refSize) {\n\t refSize = Math.min(refSize, 800);\n\t jssor_1_slider.$ScaleWidth(refSize);\n\t }\n\t else {\n\t window.setTimeout(ScaleSlider, 30);\n\t }\n\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 ScaleSlider() {\r\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\r\n if (refSize) {\r\n refSize = Math.min(refSize, 1400);\r\n jssor_1_slider.$ScaleWidth(refSize);\r\n }\r\n else {\r\n window.setTimeout(ScaleSlider, 30);\r\n }\r\n }", "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 getSize() {\n\t\t\tvar width = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);\n\t\t\t\n\t\t\t/*=========== EXTRA SMALL (576px) ==========*/\n\t\t\tif(width <= 576) {\n\t\t\t\tsliderInsightsWidth = 100;\n\t\t\t\tsliderInsightsHeight = 30;\n\t\t\t\tsliderInsightsPadding = 4.5;\n\t\t\t\t\n\t\t\t\tsliderWidth = 80;\n\t\t\t\tsliderHeight = 30;\n\t\t\t\tsliderMargin = 5;\n\t\t\t}\n\t\t\t\n\t\t\t/*=========== SMALL (768px) ==========*/\n\t\t\telse if(width <= 768) {\n\t\t\t\tsliderInsightsWidth = 90;\n\t\t\t\tsliderInsightsHeight = 35;\n\t\t\t\tsliderInsightsPadding = 4.5;\n\t\t\t\t\n\t\t\t\tsliderWidth = 80;\n\t\t\t\tsliderHeight = 42\t;\n\t\t\t\tsliderMargin = 5;\n\t\t\t}\n\t\t\t\n\t\t\t/*=========== MEDIUM (992px) ==========*/\n\t\t\telse if(width <= 992) {\n\t\t\t\tsliderInsightsWidth = 45;\n\t\t\t\tsliderInsightsHeight = 32;\n\t\t\t\tsliderInsightsPadding = 3;\n\t\t\t\t\n\t\t\t\tsliderWidth = 55;\n\t\t\t\tsliderHeight = 42;\n\t\t\t\tsliderMargin = 5;\n\t\t\t}\n\t\t\t\n\t\t\t/*=========== LARGE (1200px) ==========*/\n\t\t\telse if(width <= 1200) {\n\t\t\t\tsliderInsightsWidth = 45;\n\t\t\t\tsliderInsightsHeight = 38;\n\t\t\t\tsliderInsightsPadding = 3;\n\t\t\t\t\n\t\t\t\tsliderWidth = 50;\n\t\t\t\tsliderHeight = 42;\n\t\t\t\tsliderMargin = 5;\n\t\t\t}\n\t\t\t\n\t\t\t/*======== EXTRA LARGE (1600px) =======*/\n\t\t\telse if(width <= 1600) {\n\t\t\t\tsliderInsightsWidth = 32;\n\t\t\t\tsliderInsightsHeight = 36;\n\t\t\t\tsliderInsightsPadding = 2;\n\t\t\t\t\n\t\t\t\tsliderWidth = 35;\n\t\t\t\tsliderHeight = 42;\n\t\t\t\tsliderMargin = 5;\n\t\t\t}\n\t\t\t\n\t\t\t/*======== BIGGER SCREENS (>1600px) =======*/\n\t\t\telse if(width > 1600) {\n\t\t\t\tsliderInsightsWidth = 30;\n\t\t\t\tsliderInsightsHeight = 38;\n\t\t\t\tsliderInsightsPadding = 3.5;\n\t\t\t\t\n\t\t\t\tsliderWidth = 30;\n\t\t\t\tsliderHeight = 42;\n\t\t\t\tsliderMargin = 5;\n\t\t\t}\n\t\t}", "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 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 }", "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 }", "function ScaleSlider(slider) {\n var parentWidth = slider.$Elmt.parentNode.clientWidth;\n if (parentWidth)\n slider.$ScaleWidth(Math.max(Math.min(parentWidth, 800), 300));\n else\n window.setTimeout(ScaleSlider(slider), 30);\n }", "onResize(){\n setTimeout(() =>{\n this.slidesConfig();\n this.changeSlide(this.index.active)\n },600)\n \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\t\tvar refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n\t\tif (refSize) {\n\t\t\trefSize = Math.min(refSize, 600);\n\t\t\tjssor_1_slider.$ScaleWidth(refSize);\n\t\t}\n\t\telse {\n\t\t\twindow.setTimeout(ScaleSlider, 30);\n\t\t}\n\t}", "function handleResponsive() {\n app.ResponsiveBreakpoints.register_event(\n '0-768',\n 'image-swap-0-768-'+self.initCount ,\n self.setup0_768.bind(self) // using es5-shim.js\n )\n\n app.ResponsiveBreakpoints.register_event(\n '768-+',\n 'image-swap-768up-'+self.initCount ,\n self.setup769up.bind(self) // using es5-shim.js\n )\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 recalculate() {\n\n\t/* set xs size as body class for easier css settings */\n\tif( $(window).width() < 550 ) {\n\t\t$('body').addClass('xs');\n\t}else{\n\t\t$('body').removeClass('xs');\n\t}\n\n\t/* calculate images sizes respecting retina as well */\n\tif(pixelFullWidth==0 || pixelTeaserWidth==0 || pixelRatio == 0) {\n\t\tpixelRatio = 1;\n\t\tif (getDevicePixelRatio() > 1.5) pixelRatio = 2;\n\t\tif( $(window).width() <= 549 ) {\n\t\t\tif(pixelRatio==2){\n\t\t\t\tpixelTeaserWidth = 520;\n\t\t\t\tpixelFullWidth = 960;\n\t\t\t}else{\n\t\t\t\tpixelTeaserWidth = 520;\n\t\t\t\tpixelFullWidth = 520;\n\t\t\t}\n\t\t}else if ( $(window).width() <= 991 ) {\n\t\t\tif(pixelRatio==2){\n\t\t\t\tpixelTeaserWidth = 520;\n\t\t\t\tpixelFullWidth = 1200;\n\t\t\t}else{\n\t\t\t\tpixelTeaserWidth = 520;\n\t\t\t\tpixelFullWidth = 960;\n\t\t\t}\n\t\t}else if ( $(window).width() <= 1199 ) {\n\t\t\tif(pixelRatio==2){\n\t\t\t\tpixelTeaserWidth = 520;\n\t\t\t\tpixelFullWidth = 1200;\n\t\t\t}else{\n\t\t\t\tpixelTeaserWidth = 520;\n\t\t\t\tpixelFullWidth = 1200;\n\t\t\t}\n\t\t}else if ( $(window).width() <= 1599 ) {\n\t\t\tif(pixelRatio==2){\n\t\t\t\tpixelTeaserWidth = 520;\n\t\t\t\tpixelFullWidth = 1600;\n\t\t\t}else{\n\t\t\t\tpixelTeaserWidth = 520;\n\t\t\t\tpixelFullWidth = 1600;\n\t\t\t}\n\t\t}else {\n\t\t\tif(pixelRatio==2){\n\t\t\t\tpixelTeaserWidth = 520;\n\t\t\t\tpixelFullWidth = 1600;\n\t\t\t}else{\n\t\t\t\tpixelTeaserWidth = 520;\n\t\t\t\tpixelFullWidth = 1600;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* apply scaled responsive images on promotion slides */\n\t$(\"#promotion-slides .item\").each(function(n) {\n\t\timgURL = $(this).attr(\"data-image\");\n\t\tif(cloudinaryAccount){\n\t\t\tcloudinaryURL = \"http://res.cloudinary.com/\"+cloudinaryAccount+\"/image/fetch/w_\"+pixelFullWidth+\",q_88,f_auto,fl_progressive,fl_force_strip/\"+imgURL;\t\t\n\t\t\t// console.log('generate url: '+cloudinaryURL);\n\t\t\t$(this).attr(\"style\",\"background-image:url('\"+cloudinaryURL+\"')\");\n\t\t}else{\n\t\t\t$(this).attr(\"style\",\"background-image:url('\"+imgURL+\"')\");\n\t\t}\n\t});\n\n\t/* apply scaled responsive images on project tiles */\n\t$(\"#project-tiles .project-tile a\").each(function(n) {\n\t\timgURL = $(this).attr(\"data-image\");\n\t\tif(cloudinaryAccount){\n\t\t\tcloudinaryURL = \"http://res.cloudinary.com/\"+cloudinaryAccount+\"/image/fetch/w_\"+pixelTeaserWidth+\",q_88,f_auto,fl_progressive,fl_force_strip/\"+imgURL;\t\n\t\t\t// console.log(cloudinaryURL);\n\t\t\t$(this).css(\"background-image\",\"url('\"+cloudinaryURL+\"')\");\n\t\t}else{\n\t\t\t$(this).css(\"background-image\",\"url('\"+imgURL+\"')\");\n\t\t}\n\t});\n\n\t$('#project-tiles').isotope({\n\t // set itemSelector so .grid-sizer is not used in layout\n\t itemSelector: '.project-tile',\n\t percentPosition: true,\n\t masonry: {\n\t // use element for option\n\t columnWidth: '.project-tile'\n\t }\n\t});\n\t\n\t/* detect a hash in the url and filter automatically on load */\n\tif(window.location.hash.split('#')[1]){\n\t\t// console.log('hash in the url ' + window.location.hash.split('#')[1]);\n\t\tfilter(window.location.hash.split('#')[1]);\n\t}\n\n\n}", "function resize() {\n // $pages.find('.sc-slides').find('.infos').height(window.innerHeight);\n // _controller.update(true);\n}", "function quotesSlider() {\n\tif ($(window).innerWidth() < 992 && $(\".js-quotes-slider\").length) {\n\t\t$(\".js-quotes-slider\").slick({\n\t\t\tarrows: false,\n\t\t\tdots: false,\n\t\t\tautoplay: true,\n\t\t\t// fade: true,\n\t\t\tautoPlaySpeed: 7000,\n\t\t\tmobileFirst: true,\n\t\t\tresponsive: [\n\t\t\t\t{\n\t\t\t\t\tbreakpoint: 992,\n\t\t\t\t\tsettings: \"unslick\"\n\t\t\t\t}\n\t\t\t]\n\t\t});\n\t}\n}", "function handleSliderFrameResize()\n {\n console.log(\"Resize fired\");\n let hero = $('.social_hero');\n let mobileAlert = $('.social-mobile-alert');\n if(forceMobile) {\n console.log(\"Forced mobile view\");\n if(isPortrait()) {\n console.log(\"It's portrait\");\n portrait = true;\n hero.fadeOut();\n mobileAlert.css('display', 'block');\n //make the person turn it over.\n } else {\n console.log(\"Now horizontal\");\n portrait = false;\n mobileAlert.css('display', 'none');\n hero.fadeIn();\n }\n\n } else {\n console.log(\"Mobile version is not forced.\");\n }\n\n /*\n Check if the screen is portrait\n */\n\n\n }", "function resizeslider(){\n\t$(\".slider .items\").css({\"height\":$(window).height()});\n\t$(\".slider\").css({\"height\":$(window).height()});\n}", "function sliderMainSlider(){\n $('.main-slider').slick({\n dots: true,\n arrows: false,\n infinite: true,\n autoplay: false,\n pauseOnDotsHover: true,\n autoplaySpeed: 7500,\n responsive: [\n {\n breakpoint: 992,\n settings: {\n slidesToScroll: 1,\n slidesToShow: 1\n }\n },\n {\n breakpoint: 800,\n settings: {\n slidesToScroll: 1,\n slidesToShow: 1\n }\n },\n {\n breakpoint: 520,\n settings: {\n slidesToScroll: 1,\n slidesToShow: 1\n }\n }\n ]\n });\n}", "function responsive() {\n // Do these on every screen resize\n\n\n // Do these on certain widths\n if ( $(window).width() > 600 ) { // above mobile size\n $('#primary-navigation .menu').removeAttr('style');\n $('#mobile-menu-button').removeClass('has-open');\n } else { // mobile size\n\n }\n }", "function slick_on_mobile(slider, settings) {\r\n\t\t$(window).on('load resize', function () {\r\n\t\t\tif ($(window).width() >= 768) {\r\n\t\t\t\tif (slider.hasClass('slick-initialized')) {\r\n\t\t\t\t\tslider.slick('unslick');\r\n\t\t\t\t}\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t\tif (!slider.hasClass('slick-initialized')) {\r\n\t\t\t\treturn slider.slick(settings);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "function handleResponsive() {\n app.ResponsiveBreakpoints.register_event(\n '0-768',\n 'interior-beer-0-768',\n self.setup0_768.bind(self) // using es5-shim.js\n )\n\n app.ResponsiveBreakpoints.register_event(\n '768-+',\n 'interior-beer-768up',\n self.setup769up.bind(self) // using es5-shim.js\n )\n }", "function reloadSlider() {\n if (window.innerWidth < 769) {\n jQuery('.contact-wrapper').slick('refresh');\n }\n else{\n jQuery('.contact-wrapper').slick('unslick');\n }\n}", "function responsive(){\n \t \tif(options.responsive){\n \t \t\tvar isResponsive = container.hasClass('fp-responsive');\n \t \t\tif ($(window).width() < options.responsive ){\n \t \t\t\tif(!isResponsive){\n \t \t\t\t\t$.fn.fullpage.setAutoScrolling(false, 'internal');\n \t \t\t\t\t$('#fp-nav').hide();\n \t\t\t\t\t\tcontainer.addClass('fp-responsive');\n \t \t\t\t}\n \t \t\t}else if(isResponsive){\n \t \t\t\t$.fn.fullpage.setAutoScrolling(originals.autoScrolling, 'internal');\n \t \t\t\t$('#fp-nav').show();\n \t\t\t\t\tcontainer.removeClass('fp-responsive');\n \t \t\t}\n \t \t}\n \t }", "function regularStyles() { \n \n \t//create slider if screensize is not mobile\t\n\t$('.bxslider').bxSlider({\n\t\tauto: true,\n\t\tspeed: 2000,\n\t\tpause: 6000,\n\t\ttouchEnabled: false,\n\t\tadaptiveHeight: true\n\t});\t\n\t\n}//end regularStyles", "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 responsive_width() {\n\t\n\tif ( $( window ).outerWidth() < 480 ){\n\t\t\n\t\t$( 'body' ).addClass( 'width-480-lower' );\n\t\t$( 'body' ).removeClass( 'width-480-640' );\n\t\t$( 'body' ).removeClass( 'width-640-960' );\n\t\t$( 'body' ).removeClass( 'width-960-greater' );\n\t\t\n\t}\n\telse if ( $( window ).outerWidth() >= 480 && $( window ).outerWidth() < 640 ){\n\t\t\n\t\t$( 'body' ).removeClass( 'width-480-lower' );\n\t\t$( 'body' ).addClass( 'width-480-640' );\n\t\t$( 'body' ).removeClass( 'width-640-960' );\n\t\t$( 'body' ).removeClass( 'width-960-greater' );\n\t\t\n\t}\n\telse if ( $( window ).outerWidth() >= 640 && $( window ).outerWidth() < 960 ){\n\t\t\n\t\t$( 'body' ).removeClass( 'width-480-lower' );\n\t\t$( 'body' ).removeClass( 'width-480-640' );\n\t\t$( 'body' ).addClass( 'width-640-960' );\n\t\t$( 'body' ).removeClass( 'width-960-greater' );\n\t\t\n\t}\n\telse if ( $( window ).outerWidth() > 960 ){\n\t\t\n\t\t$( 'body' ).removeClass( 'width-480-lower' );\n\t\t$( 'body' ).removeClass( 'width-480-640' );\n\t\t$( 'body' ).removeClass( 'width-640-960' );\n\t\t$( 'body' ).addClass( 'width-960-greater' );\n\t\t\n\t}\n\t\n}", "function makeResponsive() {\n $(window)\n .resize(() => {\n resizer();\n })\n .trigger('resize');\n }", "function resizeEnd() {\r\n initial = true;\r\n windowWidth = window.innerWidth;\r\n initSlider();\r\n hideTimer = setTimeout(() => {\r\n sliderCanvas.classList.remove('pieces-slider__canvas--hidden');\r\n }, 500);\r\n }", "function ScaleSlider() {\n\t\t\t\t\n\t\t\t\tvar $j=1;\n\t\t\t\tvar parentWidth = 0;\n\t\t\t\t$(document.body).find('div.jk_galery_slider_class').each(function(){\n\t\t\t\t\tvar $_this = $(this);\n\t\t\t\t\tparentWidth = $_this.closest('div.jk_galery_slider_class').width();\n\t\t\t\t\tconsole.log(parentWidth);\n\t\t\t\t\tswitch($j) {\n\t\t\t\t\t\tcase 1:\t\n\t\t\t\t\t\t\tif (parentWidth)\n\t\t\t\t\t\t\t\tjk_gallery_slider1.$ScaleWidth(parentWidth);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\twindow.setTimeout(ScaleSlider, 30);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tif (parentWidth)\n\t\t\t\t\t\t\t\tjk_gallery_slider2.$ScaleWidth(parentWidth);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\twindow.setTimeout(ScaleSlider, 30);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tif (parentWidth)\n\t\t\t\t\t\t\t\tjk_gallery_slider3.$ScaleWidth(parentWidth);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\twindow.setTimeout(ScaleSlider, 30);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tif (parentWidth)\n\t\t\t\t\t\t\t\tjk_gallery_slider4.$ScaleWidth(parentWidth);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\twindow.setTimeout(ScaleSlider, 30);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\tif (parentWidth)\n\t\t\t\t\t\t\t\tjk_gallery_slider5.$ScaleWidth(parentWidth);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\twindow.setTimeout(ScaleSlider, 30);\n\t\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\tif (parentWidth)\n\t\t\t\t\t\t\t\tjk_gallery_slider6.$ScaleWidth(parentWidth);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\twindow.setTimeout(ScaleSlider, 30);\n\t\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t\tcase 7:\n\t\t\t\t\t\t\tif (parentWidth)\n\t\t\t\t\t\t\t\tjk_gallery_slider7.$ScaleWidth(parentWidth);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\twindow.setTimeout(ScaleSlider, 30);\n\t\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t\tcase 8:\n\t\t\t\t\t\t\tif (parentWidth)\n\t\t\t\t\t\t\t\tjk_gallery_slider8.$ScaleWidth(parentWidth);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\twindow.setTimeout(ScaleSlider, 30);\n\t\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t\tcase 9:\n\t\t\t\t\t\t\tif (parentWidth)\n\t\t\t\t\t\t\t\tjk_gallery_slider9.$ScaleWidth(parentWidth);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\twindow.setTimeout(ScaleSlider, 30);\n\t\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t\tcase 10:\n\t\t\t\t\t\t\tif (parentWidth)\n\t\t\t\t\t\t\t\tjk_gallery_slider10.$ScaleWidth(parentWidth);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\twindow.setTimeout(ScaleSlider, 30);\n\t\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t} \n\t\t\t\t$j++;\n\t\t\t\t\t\n\t\t\t\t});\n\n }", "updateSize(range) {\n if (this.model.time.splash) return;\n\n this.model.time.pause();\n\n this.profile = this.getActiveProfile(this.profiles, this.presentationProfileChanges);\n\n const slider_w = parseInt(this.slider_outer.style(\"width\"), 10) || 0;\n const slider_h = parseInt(this.slider_outer.style(\"height\"), 10) || 0;\n\n if (!slider_h || !slider_w) return utils.warn(\"time slider resize() aborted because element is too small or has display:none\");\n\n this.width = slider_w - this.profile.margin.left - this.profile.margin.right;\n this.height = slider_h - this.profile.margin.bottom - this.profile.margin.top;\n const _this = this;\n\n //translate according to margins\n this.slider.attr(\"transform\", \"translate(\" + this.profile.margin.left + \",\" + this.profile.margin.top + \")\");\n\n this.xScale.range(range || [0, this.width]);\n\n this.slide\n .attr(\"transform\", \"translate(0,\" + this.height / 2 + \")\")\n .attr(\"x1\", this.xScale.range()[0])\n .attr(\"x2\", this.xScale.range()[1])\n .style(\"stroke-width\", this.profile.radius * 2 + \"px\");\n //.call(this.brush\n //.extent([[this.xScale.range()[0], 0], [this.xScale.range()[1], this.height]]));\n\n //adjust axis with scale\n this.xAxis = this.xAxis.scale(this.xScale)\n .tickSizeInner(0)\n .tickSizeOuter(0)\n .tickPadding(this.profile.label_spacing)\n .tickSizeMinor(0, 0);\n\n this.axis.attr(\"transform\", \"translate(0,\" + this.height / 2 + \")\")\n .classed(\"vzb-hidden\", this.model.ui.presentation)\n .call(this.xAxis);\n\n this.select.attr(\"transform\", \"translate(0,\" + this.height / 2 + \")\");\n this.progressBar.attr(\"transform\", \"translate(0,\" + this.height / 2 + \")\");\n\n this.slide.select(\".background\")\n .attr(\"height\", this.height);\n\n //size of handle\n this.handle.attr(\"transform\", \"translate(0,\" + this.height / 2 + \")\")\n .attr(\"r\", this.profile.radius);\n\n this.sliderWidth = _this.slider.node().getBoundingClientRect().width;\n\n const forecastBoundaryIsOn = this.model.time.end > this.model.time.endBeforeForecast;\n this.forecastBoundary\n .classed(\"vzb-hidden\", !forecastBoundaryIsOn);\n\n if (forecastBoundaryIsOn) {\n this.forecastBoundary\n .attr(\"transform\", \"translate(0,\" + this.height / 2 + \")\")\n .attr(\"x1\", this.xScale(this.model.time.endBeforeForecast) - this.profile.radius / 2)\n .attr(\"x2\", this.xScale(this.model.time.endBeforeForecast) + this.profile.radius / 2)\n .attr(\"y1\", this.profile.radius)\n .attr(\"y2\", this.profile.radius);\n }\n\n this.resizeSelectedLimiters();\n this._resizeProgressBar();\n this._setHandle();\n\n this.playButtons.style(\"width\", this.profile.margin.left + \"px\");\n }", "function resize() {\n\t\t\tsetMinHeights(); // Reset the minimum heights.\n\t\t\tinitialise(); // Check new screen sizes to see if Slidebars should still operate.\n\t\t\tif (leftActive) { // Left Slidebar is open whilst the window is resized.\n\t\t\t\topen('left'); // Running the open method will ensure the slidebar is the correct width for new screen size.\n\t\t\t} else if (rightActive) { // Right Slidebar is open whilst the window is resized.\n\t\t\t\topen('right'); // Running the open method will ensure the slidebar is the correct width for new screen size.\n\t\t\t}\n\t\t}", "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 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 clientIconSlideResponsive() {\n $(window).resize(function () {\n clientIconSlideReInit();\n });\n}", "onSliderResized() {\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 resizeCall(){\n pageCalculations();\n\n $('.navigation:not(.disable-animation)').addClass('disable-animation');\n\n $('.swiper-container.initialized[data-slides-per-view=\"responsive\"]').each(function(){\n var thisSwiper = swipers['swiper-'+$(this).attr('id')], $t = $(this), slidesPerViewVar = updateSlidesPerView($t), centerVar = thisSwiper.params.centeredSlides;\n thisSwiper.params.slidesPerView = slidesPerViewVar;\n thisSwiper.resizeFix(true);\n if(!centerVar){\n var paginationSpan = $t.find('.pagination span');\n var paginationSlice = paginationSpan.hide().slice(0,(paginationSpan.length+1-slidesPerViewVar));\n if(paginationSlice.length<=1 || slidesPerViewVar>=$t.find('.swiper-slide').length) $t.addClass('pagination-hidden');\n else $t.removeClass('pagination-hidden');\n paginationSlice.show();\n }\n });\n }", "function onChange()\n\t{\n\t\t// decide if we need sliders based on new content size. default is they are hidden\n\t\t// we update both h and v sliders even when only content.width is changed as it's possible that both sliders\n\t\t// will hide/show based on the change in content.width alone\n\t\thslider.hide = true; \n\t\tvslider.hide = true; \n\t\tif (content.width > display.width) hslider.hide = false; \n\t\tif (content.height > display.height) vslider.hide = false; \n\t\tif ((content.width > display.width - t) && (content.height > display.height)){ hslider.hide = false; } \n\t\tif ((content.height > display.height - t) && (content.width > display.width)){ vslider.hide = false; } \n\n\t\t// now that we know which slider(v/s) is enabled, update their sizes\n\t\t// we set a rule that sliders will try to fill container.size. e.g. if vslider is hidden, hslider.height = container.height\n\t\t// both h and s sliders to be updated as it's possible that both slides will hide/show based on change in content.width alone\n\t\t//if (!hslider.hide){ hslider.width = w - (vslider.hide? 0 : t); }\n\t\t//if (!vslider.hide){ vslider.height = h - (hslider.hide? 0 : t); }\n\t\thslider.width = hslider.hide? 0: (w - (vslider.hide? 0 : t)); \n\t\tvslider.height = vslider.hide? 0 : (h - (hslider.hide? 0 : t)); \n\n\t\t// set slider's min/max. max value is calculated as the value difference between content size and display size.\n\t\t// the excess size of content will be the scroll size of slider. if content size < display size, max < 0 but slider class will \n\t\t// handle this properly and fix the thumbsize and its position to ensure no undesired behavior occurs\n\t\t// since both h and s sliders might have hide/show from this change, update max for both sliders\n\t\tvslider.min = 0; // min = 0, default.\n\t\thslider.min = 0; // min = 0, default.\n\t\tvslider.max = content.height - display.height + (hslider.hide? 0 : t);\n\t\thslider.max = content.width - display.width + (vslider.hide? 0 : t);\n\n\t\t// we want thumbsize to be based on ratio between content.size and frame.size. slider size is expected to fill frame size\n\t\t// but if both sliders (h and v), slider.size = frame.size - slider.t \n\t\t// since both v and h sliders might have changed their sizes, we update both thumbsize\n\t\tvslider.thumbsize = display.height / content.height * (vslider.height - (hslider.hide? 0 : t));\n\t\thslider.thumbsize = display.width / content.width * (hslider.width - (vslider.hide? 0 : t));\n\n\t\t// let's set min value for thumbsize, 32, because if content.size is too big, thumbsize will be too small to click.\n\t\tif (vslider.thumbsize < 32) vslider.thumbsize = 32;\n\t\tif (hslider.thumbsize < 32) hslider.thumbsize = 32;\n\t}", "function checkWinSize() { //also properly redraws the slider.\n\t//for some reason, the slider doesn't retain good form\n\t// (but it does when you refresh, given that this code doesn't exist)\n\t\n\tconsole.log('checkWinSize');\n\tsetTimeout(function() {\n\t\tconsole.clear();\n\t}, 1);\n\t\n\tvar bool = window.innerWidth <= 1100;\n \n\t$('.expand').css('display', bool ? 'inline' : 'none');\n $('#menu-icon').css('display', bool ? 'inline' : 'none');\n $('.collapsible').css('display', bool ? 'none' : 'inline');\n $('.collapsible > *').css('display', bool ? 'none' : 'inline');\n}", "function window_resize() {\n\t\t\n\t // Get Viewport width\n\t \n\t var responsive_viewport = $(window).width() + $.bitly.scrollbar_width;\n\t \n\t // If Viewport is below 481px\n\t \n\t if (responsive_viewport < 481) {\n\t \n\t }\n\t \n\t\t// If Viewport is larger than 481px\n\t \n\t if (responsive_viewport > 481) {\n\t \n\t }\n\t \n\t // If Viewport is above or equal to 768px\n\t \n\t if (responsive_viewport < 768) {\n\t \t\n\t \t$(\"#link-shortener-url\").removeClass(\"inverse\");\n\n\t }\n\t \n\t // If Viewport is above or equal to 768px\n\n\t if( responsive_viewport >= 768 && responsive_viewport < 800 ){\n\n\t \t$(\"#form-header-link-shortener-url-input-group\").css(\"width\", 180 );\n\t \t\n\t }else{\n\n\t\t\t$(\"#form-header-link-shortener-url-input-group\").removeAttr(\"style\");\n\n\t }\n\n\t if (responsive_viewport >= 768) {\n\t \t\n\t \tstage_sidebar_close();\n\t\t\t\n\t\t // If Viewport is above or equal to 768px\n\t\t \n\t\t if ($(\"#header\").hasClass(\"header-inverse\")) {\n\t\t \t\n\t\t \t$(\"#link-shortener-url\").addClass(\"inverse\");\n\t\t \t\n\t\t }\n\t \t\n\t \t$(\"#link-shortener-url\").attr(\"placeholder\", \"Paste a link\");\n\n\t }\n\t \n\t // If Viewport is above or equal to 992px\n\t \n\t if (responsive_viewport > 992) {\n\t \t$(\"#link-shortener-url\").attr(\"placeholder\", \"Paste a link to shorten it\");\n\t \t\n\t \t\n\t }\n\t \n\t // If Viewport is above or equal to 1160px\n\t \n\t if (responsive_viewport > 1400) {\n\t \t\n\t \t\n\t }\n\t \n\t\t/* --------------------------------------------------\n\t\tAdjust Stage Height for WP Admin Bar\n\t\t-------------------------------------------------- */\n\t \n\t var wordpress_admin_bar = $(\"#wpadminbar\");\n\t \n\t if (wordpress_admin_bar != null) {\n\t\t \n\t\t var wordpress_admin_bar_height = wordpress_admin_bar.outerHeight();\n\t\t \n\t\t $(\"#stage\").css({\n\t\t\t \n\t\t\t 'margin-top'\t:\twordpress_admin_bar_height\n\t\t\t \n\t\t });\n\t\t \n\t }\n\t \n\t\t/* --------------------------------------------------\n\t\tAdjust Page Header Height\n\t\t-------------------------------------------------- */\n\t \n\t var page_header = $(\"#page-header\");\n\t var page_header_inner = $(\"#page-header-inner\");\n\t\t\n\t if (page_header.hasClass(\"page-header-fullscreen\")) {\n\t\t \n\t\t var screen_height = $(window).height();\n\t\t var page_header_height = 0;\n\t\t \n\t\t page_header_height = screen_height;\n\t\t \n\t\t if (wordpress_admin_bar != null) {\n\t\t\t\t\n\t\t\t\tpage_header_height = page_header_height - wordpress_admin_bar_height;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif (page_header_height < page_header_inner.outerHeight()) {\n\t\t\t\t\n\t\t\t\tpage_header_height = page_header_inner.outerHeight();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tpage_header.css({\n\t\t\t\t\n\t\t\t\t'height':\tpage_header_height\n\t\t\t\t\n\t\t\t});\n\t\t \n\t }\n\t \n\t\t/* --------------------------------------------------\n\t\tAdjust Page Header Video Width\n\t\t-------------------------------------------------- */\n\t \n\t var page_header_background_video = $(\"#page-header-background-video\");\n\t var page_header_background_video_width = page_header_background_video.width();\n\t var page_header_background_video_height = page_header_background_video.height();\n\t \n\t var page_header_background_video_player = $(\"#page-header-background-video video\");\n\t var page_header_background_video_player_width = 1280;\n\t var page_header_background_video_player_height = 720;\n\t \n\t var page_header_background_video_player_width_new = page_header_background_video_width;\n\t var page_header_background_video_player_height_new = (page_header_background_video_player_width_new / page_header_background_video_player_width) * page_header_background_video_player_height;\n\t \n\t if (page_header_background_video_player_height_new < page_header_background_video_height) {\n\t\t \n\t\t var page_header_background_video_player_height_new = page_header_background_video_height;\n\t\t var page_header_background_video_player_width_new = (page_header_background_video_player_height_new / page_header_background_video_player_height) * page_header_background_video_player_width;\n\t\t \n\t }\n\t \n\t page_header_background_video_player.css({\n\t\t \n\t\t 'width'\t\t\t:\tpage_header_background_video_player_width_new,\n\t\t 'height'\t\t\t:\tpage_header_background_video_player_height_new,\n\t\t 'position'\t\t:\t'absolute',\n\t\t 'top'\t\t\t:\t'50%',\n\t\t 'left'\t\t\t:\t'50%',\n\t\t 'margin-left'\t:\t(-1 * (page_header_background_video_player_width_new / 2)),\n\t\t 'margin-top'\t\t:\t(-1 * (page_header_background_video_player_height_new / 2))\n\t\t \n\t });\n\t \n\t\t/* --------------------------------------------------\n\t\tAdjust Stage Sidebar Width\n\t\t-------------------------------------------------- */\n\t\t\n\t\tstage_sidebar_resize();\n\t \n\t\t/* --------------------------------------------------\n\t\tScroll\n\t\t-------------------------------------------------- */\n\t\t\n\t\twindow_scroll();\n\t \t\t\n\t\t/* --------------------------------------------------\n\t\tResize Modal\n\t\t-------------------------------------------------- */\n\t\t\n\t\tmodal_resize();\n\t\t\n\t\t/* --------------------------------------------------\n\t\tScroller\n\t\t-------------------------------------------------- */\n\t\t\n\t\t$('.container-scrollable').perfectScrollbar('update');\n\n\t\t/* --------------------------------------------------\n\t\tAdjust Dynamically Positioned Elements\n\t\t-------------------------------------------------- */\n\t\t\n\t\t$('.scale-to-fit').scaleToFit();\n\t\t$('.size-to-fit').sizeToFit();\n\t\t$('.fill-vertical').fillVertical();\n\t\t$('.center-vertical').centerVertical();\n\t\t$('.center-horizontal').centerHorizontal();\n\t\t$('.vertically-balanced').verticallyBalanced();\n\n\t\t/* --------------------------------------------------\n\t\tResize Videos\n\t\t-------------------------------------------------- */\n\t\t\n\t\tadjust_fluid_videos();\n\t\t\n\t}", "function hoverBannerMobileSlider() {\n\tif ($(\".js-hover-banner-slider\").length) {\n\t\t$(\".js-hover-banner-slider\").slick({\n\t\t\tslidesToShow: 2,\n\t\t\tarrows: false,\n\t\t\tdots: false,\n\t\t\tautoplay: true,\n\t\t\tautoplaySpeed: 5000,\n\t\t\tresponsive: [\n\t\t\t\t{\n\t\t\t\t\tbreakpoint: 767,\n\t\t\t\t\tsettings: {\n\t\t\t\t\t\tslidesToShow: 1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t});\n\n\t\t$(\".js-hover-banner-slider\").on(\"beforeChange\", function(\n\t\t\tevent,\n\t\t\tslick,\n\t\t\tcurrSlide,\n\t\t\tnextSlide\n\t\t) {\n\t\t\tconst next = \"0\" + (nextSlide + 1);\n\t\t\t$(this)\n\t\t\t\t.next()\n\t\t\t\t.find(\".js-current-slide\")\n\t\t\t\t.text(next);\n\t\t});\n\t}\n}", "function windowSizeChanged(){\r\n\tTweenMax.killAll();\r\n\tcheckMenu();\r\n\tstartSlider();\r\n}", "function resizeContentMobile() {\n var height = $(window).height() - 119;\n $('.slideResize').height(height);\n }", "function responsiveSetup(){\n\tif( typeof $(\"#mobile-style-detector:visible\") !== \"undefined\" && $(\"#mobile-style-detector:visible\").length >= 1 ){\n\t\t$(\"#product-wrapper\").detach().appendTo(\".work-desk.mobile\");\n\t} else {\n\t\t$(\"#product-wrapper\").detach().appendTo(\".work-desk.web\");\n\t\n\t\tstep = $(\".back-next-butt-wrapper\").data( \"current_step\");\n\t\tswitch(step){\n\t\t\tcase \"select layout\": break;\n\t\t\t\n\t\t\tcase \"layout page\": toggleScrollBar(\".layout-templates:visible\"); break;\n\t\t\tcase \"styles page\": toggleScrollBar(\".graphic-templates:visible\"); break;\n\t\t\t\n\t\t\tcase \"upload photos\": toggleScrollBar(\".layout-templates:visible\"); break;\n\t\t\tcase \"facebook page\": toggleScrollBar(\".layout-templates:visible\"); break;\n\n\t\t\tcase \"edit pictures\": toggleScrollBar(\".upload-page-wrapper:visible\"); break;\n\n\t\t\tcase \"select color insert or save\": toggleScrollBar(\".optional-surface:visible\"); break;\n\n\t\t\tcase \"presave preview\":\n\t\t\t\t\n\t\t\tbreak;\n\n\t\t\tcase \"save product\":\n\t\t\t\t\n\t\t\tbreak;\n\t\t}\n\t}\n}", "__initJS() {\n var mq = window.matchMedia( \"(max-width: 767px)\" );\n this.__checkWinSize( mq );\n const self = this;\n $( window ).on( 'load resize', function () {\n self.__checkWinSize( mq );\n } );\n }", "function mainSlider() {\n\tvar BasicSlider = $('.hero-slider');\n\tBasicSlider.on('init', function (e, slick) {\n\t\tvar $firstAnimatingElements = $('.single-slide:first-child').find('[data-animation]');\n\t\tdoAnimations($firstAnimatingElements);\n\t});\n\tBasicSlider.on('beforeChange', function (e, slick, currentSlide, nextSlide) {\n\t\tvar $animatingElements = $('.single-slide[data-slick-index=\"' + nextSlide + '\"]').find('[data-animation]');\n\t\tdoAnimations($animatingElements);\n\t});\n\tBasicSlider.slick({\n\t\tautoplay: false,\n\t\tautoplaySpeed: 10000,\n\t\tdots: true,\n\t\tfade: true,\n\t\tarrows: false,\n\t\t// nextArrow: '<div class=\"next\"><i class=\"las la-long-arrow-alt-right\"></i></div>',\n // prevArrow: '<div class=\"prev\"><i class=\"las la-long-arrow-alt-left\"></i></div>',\n\t\tresponsive: [\n\t\t\t\t{\n\t\t\t\t\tbreakpoint: 1024,\n\t\t\t\t\tsettings: {\n\t\t\t\t\t\tslidesToShow: 1,\n\t\t\t\t\t\tslidesToScroll: 1,\n\t\t\t\t\t\tinfinite: true,\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tbreakpoint: 991,\n\t\t\t\t\tsettings: {\n\t\t\t\t\t\tslidesToShow: 1,\n\t\t\t\t\t\tslidesToScroll: 1,\n\t\t\t\t\t\tarrows: false\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tbreakpoint: 767,\n\t\t\t\t\tsettings: {\n\t\t\t\t\t\tslidesToShow: 1,\n\t\t\t\t\t\tslidesToScroll: 1,\n\t\t\t\t\t\tarrows: false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t});\n\n\tfunction doAnimations(elements) {\n\t\tvar animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\n\t\telements.each(function () {\n\t\t\tvar $this = $(this);\n\t\t\tvar $animationDelay = $this.data('delay');\n\t\t\tvar $animationType = 'animated ' + $this.data('animation');\n\t\t\t$this.css({\n\t\t\t\t'animation-delay': $animationDelay,\n\t\t\t\t'-webkit-animation-delay': $animationDelay\n\t\t\t});\n\t\t\t$this.addClass($animationType).one(animationEndEvents, function () {\n\t\t\t\t$this.removeClass($animationType);\n\t\t\t});\n\t\t});\n\t}\n}", "function resizeF()\n\t\t{\n\t\tvar scaleX = window.innerWidth / 782;\n\t\tvar scaleY = window.innerHeight / 440;\n\t\tvar scale = Math.min(scaleX, scaleY);\n\t\tgame.scale.scaleMode = Phaser.ScaleManager.USER_SCALE;\n\t\tgame.scale.setUserScale(scale, scale);\n\t\tgame.scale.pageAlignHorizontally = true;\n\t\tgame.scale.pageAlignVertically = true;\n\t\tgame.scale.refresh();\n\t\t}", "function makeMobileSlider(slider,wcParams,slickParams){\r\n\t\t$(slider)\r\n\t\t\t.on('init',function(event, slick){\r\n\t\t\t\tif(slick.$slider.attr('id') == slider.attr('id')){ /*[1]*/\r\n\t\t\t\t\t$(this).removeClass('wc-invisible'); /*[2]*/\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t$(slider).slick({\r\n\t\t\tresponsive:[\r\n\t\t\t\t{\r\n\t\t\t\t\tbreakpoint:9000,\r\n\t\t\t\t\tsettings:\"unslick\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tbreakpoint:768,\r\n\t\t\t\t\tsettings:{\r\n\t\t\t\t\t\tslidesToShow:1,\r\n\t\t\t\t\t\tdots: true,\r\n\t\t\t\t\t\tarrows: false,\r\n\t\t\t\t\t\tspeed:300,\r\n\t\t\t\t\t\tautoplay: wcParams.autoplay,\r\n\t\t\t\t\t\tautoplaySpeed: wcParams.autoplaySpeed\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\taccessibility: false /*[3]*/\r\n\t\t});\r\n\t}", "function handleResize() {\r\n\t\t\t// 1. update height of step elements\r\n\t\t\tvar stepHeight = Math.floor(window.innerHeight * 0.75);\r\n\t\t\t\r\n\r\n\t\t\t// 2. update width/height of graphic element\r\n\t\t\tvar bodyWidth = d3.select('body').node().offsetWidth;\r\n\r\n\t\t\tvar graphicMargin = 16 * 4;\r\n\t\t\tvar textWidth = text.node().offsetWidth;\r\n\t\t\tvar graphicWidth = container.node().offsetWidth - textWidth - graphicMargin;\r\n\t\t\tvar graphicHeight = Math.floor(window.innerHeight/2)\r\n\t\t\tvar graphicMarginTop = Math.floor(graphicHeight/2)\r\n\r\n\t\t\tgraphic\r\n\t\t\t\t.style('width', '100%')\r\n\t\t\t\t .style('height', '100%')\r\n\t\t\t\t.style('top', graphicMarginTop + 'px');\r\n\r\n\r\n\t\t\t// 3. tell scrollama to update new element dimensions\r\n\t\t\tscroller.resize();\r\n\t\t}", "function main_slider4(){\n if ( $('#main_slider4').length ){\n $(\"#main_slider4\").revolution({\n sliderType:\"standard\",\n sliderLayout:\"auto\",\n delay:4000,\n disableProgressBar:\"on\",\n navigation: {\n onHoverStop: 'off',\n touch:{\n touchenabled:\"on\"\n },\n arrows: {\n style:\"zeus\",\n enable:true,\n hide_onmobile:true,\n hide_under:767,\n hide_onleave:true,\n hide_delay:200,\n hide_delay_mobile:1200,\n tmp:'<div class=\"tp-title-wrap\"> \t<div class=\"tp-arr-imgholder\"></div> </div>',\n left: {\n h_align: \"left\",\n v_align: \"center\",\n h_offset: 50,\n v_offset: 0\n },\n right: {\n h_align: \"right\",\n v_align: \"center\",\n h_offset: 50,\n v_offset: 0\n }\n },\n },\n responsiveLevels:[4096,1199,992,767,480],\n gridwidth:[1170,1000,750,700,300],\n gridheight:[954,954,750,600,500],\n lazyType:\"smart\",\n fallbacks: {\n simplifyAll:\"off\",\n nextSlideOnWindowFocus:\"off\",\n disableFocusListener:false,\n }\n })\n }\n }", "onResize() {\n let mobile = window.innerWidth < 800\n if (mobile !== this.isMobile) {\n this.isMobile = mobile\n }\n }", "function initSliderCarousel() {\n let $slider = $(\"#sliderCarousel\");\n $slider.slick({\n dots: false,\n arrows: false,\n infinite: true,\n slidesToShow: 5,\n speed: 1000,\n slidesToScroll: 1,\n swipeToSlide: true,\n centerMode: true,\n // focusOnSelect: true,\n // autoplay: true\n // the magic\n responsive: [{\n breakpoint: 1400,\n settings: {\n slidesToShow: 4\n }\n }, {\n breakpoint: 1025,\n settings: {\n slidesToShow: 3\n }\n }, {\n breakpoint: 900,\n settings: {\n slidesToShow: 2\n }\n }, {\n breakpoint: 421,\n settings: {\n slidesToShow: 1\n }\n }]\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}", "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 responsiveResize() {\n var leftMax = $('#bar-load').offset().left + 50;\n var rightMax = $('#bar-help').offset().left;\n var w = $(window).width();\n var $l = $('img.logo');\n var $v = $('span.version');\n\n // If the mode button pos is greater than half the width less 100px, adjust\n // the logo.\n if (leftMax > (w/2)-100) {\n if (rightMax < leftMax + 150) {\n // There's no room left for logo or version... goodbye!\n $l.add($v).css('opacity', 0);\n } else {\n // Squeeze logo and version together\n $l.css({\n left: leftMax + 100,\n width: 130,\n top: 0,\n opacity: 1\n });\n\n $v.css({\n left: (leftMax - 89) + 32,\n opacity: 1\n });\n }\n\n } else {\n $l.css({\n left: '',\n width: '',\n top: '',\n opacity: ''\n });\n\n $v.css({\n left: '',\n opacity: ''\n });\n }\n\n}", "function comparePlansSlider() {\n\tif ($(\".js-plans-slider\").length) {\n\t\tconst slider = $(\".js-plans-slider\");\n\t\tconst sliderParent = slider.closest(\".compare-plans__content\");\n\t\tlet deviceType = \"desktop\";\n\n\t\t// Init slick if on mobile\n\t\tif ($(window).innerWidth() < 992) {\n\t\t\tinitSlider();\n\t\t}\n\t\tfunction initSlider() {\n\t\t\tslider.slick({\n\t\t\t\tarrows: false,\n\t\t\t\tdots: false,\n\t\t\t\tfade: true,\n\t\t\t\tmobileFirst: true,\n\t\t\t\tresponsive: [\n\t\t\t\t\t{\n\t\t\t\t\t\tbreakpoint: 992,\n\t\t\t\t\t\tsettings: \"unslick\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t});\n\n\t\t\tdeviceType = \"mobile\";\n\t\t}\n\n\t\t// Window resize handler\n\t\t$(window).on(\"resize\", function() {\n\t\t\tif ($(window).innerWidth() < 992) {\n\t\t\t\t$(\".js-matchHeight-mob\").matchHeight();\n\t\t\t\tif (deviceType == \"desktop\") {\n\t\t\t\t\tinitSlider();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($(window).innerWidth() >= 992) {\n\t\t\t\tdeviceType = \"desktop\";\n\t\t\t\t$(\".compare-plans__content\").removeClass(\"u-bg-beige-2\");\n\t\t\t}\n\t\t});\n\n\t\t// Change background colour on slide change\n\t\tslider.on(\"beforeChange\", function(\n\t\t\tevent,\n\t\t\tslick,\n\t\t\tcurrentSlide,\n\t\t\tnextSlide\n\t\t) {\n\t\t\tif (nextSlide == 1) {\n\t\t\t\tsliderParent.addClass(\"u-bg-beige-2\");\n\t\t\t} else {\n\t\t\t\tsliderParent.removeClass(\"u-bg-beige-2\");\n\t\t\t}\n\t\t});\n\t}\n}" ]
[ "0.74970555", "0.72891724", "0.721348", "0.7196995", "0.7188501", "0.7188501", "0.71750337", "0.71448797", "0.71295065", "0.71295065", "0.7125741", "0.7125117", "0.71169466", "0.71169466", "0.71169466", "0.71135604", "0.7103749", "0.71029866", "0.7100784", "0.70974845", "0.70974845", "0.70974845", "0.70966524", "0.70823306", "0.70823306", "0.70710474", "0.7055782", "0.70555204", "0.70483965", "0.7042308", "0.70034766", "0.7003137", "0.69921595", "0.6990836", "0.6990836", "0.6969135", "0.6941407", "0.6933409", "0.6922859", "0.69140226", "0.6912117", "0.6903104", "0.6902107", "0.6901878", "0.69014025", "0.6880412", "0.6880131", "0.68561876", "0.68402743", "0.6824462", "0.6801487", "0.6796406", "0.6796042", "0.67915565", "0.6789053", "0.6771256", "0.67663014", "0.6756635", "0.6755592", "0.67554027", "0.67397213", "0.66753274", "0.6666069", "0.6655024", "0.6651487", "0.66430527", "0.6626535", "0.6620858", "0.66197926", "0.6597623", "0.6586413", "0.6584902", "0.65668565", "0.655983", "0.65570813", "0.6550292", "0.65466875", "0.65417784", "0.6527231", "0.65050995", "0.65020895", "0.64980394", "0.6497243", "0.64914405", "0.648319", "0.6436776", "0.6425009", "0.6421333", "0.6416361", "0.6412675", "0.64051586", "0.6395218", "0.6381429", "0.63687307", "0.6364286", "0.6363159", "0.6351287", "0.6350233", "0.63235736", "0.63195723" ]
0.7040623
30
applies the necessary transform value to scale the item up
function applyTransforms(el, nobodyscale) { // zoomer area and scale value var zoomerArea = el.querySelector('.zoomer__area'), zoomerAreaSize = {width: zoomerArea.offsetWidth, height: zoomerArea.offsetHeight}, zoomerOffset = zoomerArea.getBoundingClientRect(), scaleVal = zoomerAreaSize.width/zoomerAreaSize.height < win.width/win.height ? win.width/zoomerAreaSize.width : win.height/zoomerAreaSize.height; if( bodyScale && !nobodyscale ) { scaleVal /= bodyScale; } // apply transform el.style.WebkitTransform = 'translate3d(' + Number(win.width/2 - (zoomerOffset.left+zoomerAreaSize.width/2)) + 'px,' + Number(win.height/2 - (zoomerOffset.top+zoomerAreaSize.height/2)) + 'px,0) scale3d(' + scaleVal + ',' + scaleVal + ',1)'; el.style.transform = 'translate3d(' + Number(win.width/2 - (zoomerOffset.left+zoomerAreaSize.width/2)) + 'px,' + Number(win.height/2 - (zoomerOffset.top+zoomerAreaSize.height/2)) + 'px,0) scale3d(' + scaleVal + ',' + scaleVal + ',1)'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function upScaleLabel(i){\n\tvar currentScale = $(\"#size_group_\" + i).attr(\"size_scale\");\n\tvar currentX = $(\"#size_group_\" + i).attr(\"translate_x\");\n\tvar currentY = $(\"#size_group_\" + i).attr(\"translate_y\");\n\t\n\tvar newScale = parseFloat(currentScale) + filterScale;\n\tvar newX = parseFloat(currentX) - filterTransformX;\n\tvar newY = parseFloat(currentY) - filterTransformY;\n\tif(parseFloat(newScale).toFixed(3) > parseFloat(minimumSize).toFixed(3)){\n\t\tnewTransform = \"translate(\" + newX + \" \" + newY + \") scale(\" + newScale + \")\";\n\t\t$(\"#size_group_\" + i).attr(\"translate_x\", newX);\n\t\t$(\"#size_group_\" + i).attr(\"translate_y\", newY);\n\t}\n\telse{\n\t\tnewTransform = \"translate(\" + currentX + \" \" + currentY + \") scale(\" + minimumSize + \")\";\n\t}\t\t\n\t$(\"#size_group_\" + i).attr(\"transform\", newTransform);\n\t$(\"#size_group_\" + i).attr(\"size_scale\", newScale);\n}", "scaleTo() {}", "beforeUpdate() {\n this.items.children[this.index].style.transform = `scale(1)`\n }", "function scaleAll2(newScale){\r\n if(newScale>MIN_SCALE && newScale<MAX_SCALE){\r\n canvas.forEachObject(function(item, index, arry){\r\n if(!item.isTag){\r\n item.scale(newScale);\r\n if(item != fabImg){\r\n //When scaling move element so that distance of elements for center is always in portion wiht scale\r\n var x = ((item.getLeft() - AnnotationTool.originX)/AnnotationTool.SCALE) * newScale + AnnotationTool.originX;\r\n var y = ((item.getTop() - AnnotationTool.originY)/AnnotationTool.SCALE) * newScale + AnnotationTool.originY;\r\n if(item.elementObj){\r\n item.elementObj.setItemPos(x, y, newScale);\r\n }\r\n }\r\n \r\n }\r\n });\r\n canvas.renderAll();\r\n AnnotationTool.SCALE = newScale;\r\n }\r\n }", "function scaleUp() {\n console.log('scale up triggered');\n var m = new THREE.Matrix4();\n m.set( 1.1, 0, 0, 0,\n 0, 1.1, 0, 0,\n 0, 0, 1.1, 0,\n 0, 0, 0, 1 );\n geometry.applyMatrix(m);\n render();\n}", "function rescale() {\n\t\ttrans = d3.event.translate\n\t\tscale = d3.event.scale\n\t\tsvg.attr(\"transform\", \"translate(\" + trans + \")\" + \" scale(\" + scale + \")\")\n\t}", "transform(type, value) {\n switch (type) {\n case 'scale':\n this.scale = value;\n break;\n }\n }", "function decreaseFornScale() {\n\tvar f= fornSelected;\n\t\n\tif (f==null)\n\t\treturn 0;\n\t\n\tvar scale= f.currSize.width/f.currSize.height;\n\t\n\tf.currSize.width -= (2*scale);\n\tf.currSize.height -= 2;\n\t\n\tif ((f.currSize.width >= f.minSize.width) && (f.currSize.height >= f.minSize.height)) {\n\t\tfornSelected.m= fornSelected.m.translate((1*scale),1);\n\t}\n\telse {\n\t\tf.currSize.width += (2*scale);\n\t\tf.currSize.height += 2;\n\t}\n\t\n\tinvalidated= true;\n}", "function zoom(svgObj, directionValue) {\n var s = svgObj;\n\n var scaleX = s.transform().localMatrix.a + directionValue;\n var scaleY = s.transform().localMatrix.d + directionValue;\n\n var x = s.transform().localMatrix.e;\n var y = s.transform().localMatrix.f;\n\n if (scaleX > 1 || scaleY > 1) {\n x = (width * (scaleX - 1)) / 2;\n y = (height * (scaleY - 1)) / 2;\n }\n else {\n x = 0;\n y = 0;\n }\n\n s.attr({\n transform: \"martix(\" + scaleX + \",\" + s.transform().localMatrix.b + \",\" + s.transform().localMatrix.c + \",\" + scaleY + \",\" + x + \",\" + y + \")\"\n })\n\n var newTransform = s.transform().localMatrix;\n console.log(\"nT: \" + newTransform);\n}", "function increaseFornScale() {\n\tvar f= fornSelected;\n\t\n\tif (f==null)\n\t\treturn 0;\n\t\n\tvar scale= f.currSize.width/f.currSize.height;\n\t\n\tf.currSize.width += (2*scale);\n\tf.currSize.height += 2;\n\t\n\tif ((f.currSize.width >= f.minSize.width) && (f.currSize.height >= f.minSize.height)) {\n\t\tfornSelected.m= fornSelected.m.translate((-1*scale),-1);\n\t}\n\telse {\n\t\tf.currSize.width -= (2*scale);\n\t\tf.currSize.height -= 2;\n\t}\n\t\n\tinvalidated= true;\n}", "setBaseTransform(item) {\n const transform = this.rootSvg.createSVGTransform();\n\n transform.setTranslate(0, 0);\n\n item.transform.baseVal.appendItem(transform);\n }", "function setTransform() {\n items.style.transform = 'translate3d(' + (-pos * 480) + 'px,0,0)';\n}", "transform()\n {\n super.transform();\n \n spriteStrategyManager.transform();\n }", "setTransformObject(item, x, y) {\n const transformBase = item.transform.baseVal;\n const transform = transformBase.getItem(0);\n\n transform.setTranslate(x, y);\n }", "function scaleUpPreviewBtnClick(event) {\n gImageInfoListViewer.setScale(gImageInfoListViewer.scale * 2);\n}", "function Scale () {}", "setScale(sx, sy, sz){\n let e = this.elements;\n e[0] = sx; e[4] = 0; e[8] = 0; e[12] = 0;\n e[1] = 0; e[5] = sy; e[9] = 0; e[13] = 0;\n e[2] = 0; e[6] = 0; e[10] = sz; e[14] = 0;\n e[3] = 0; e[7] = 0; e[11] = 0; e[15] = 1;\n return this;\n }", "function scale(el, val) {\n el.style.mozTransform = el.style.msTransform = el.style.webkitTransform = el.style.transform = 'scale3d(' + val + ', ' + val + ', 1)';\n}", "setScale(newScale) {\n\n let isSmall = this.state.size.width < this.props.width || this.state.size.height < this.props.height;\n var newScale;\n\n if (isSmall && newScale < 1) newScale = 1;\n\n oldScale = this.state.scale;\n\n oldWidth = this.state.size.width * oldScale;\n oldHeight = this.state.size.height * oldScale;\n\n newWidth = this.state.size.width * newScale;\n newHeight = this.state.size.height * newScale;\n\n if (this.props.width > newWidth && !isSmall) {\n newWidth = this.props.width;\n newScale = newWidth / this.state.size.width;\n } else if (this.props.height > newHeight && !isSmall) {\n newHeight = this.props.height;\n newScale = newHeight / this.state.size.height;\n }\n\n this.setState({ scale: newScale });\n\n let xMovement = (newWidth - oldWidth) / 2;\n let yMovement = (newHeight - oldHeight) / 2;\n\n x = this.state.pos.x - xMovement;\n y = this.state.pos.y - yMovement;\n\n this.setState({ pos: this.constrain(x, y, newScale) });\n\n }", "function scaleItems() {\n if (rescale) {\n d3.select('svg').selectAll('tmp')\n .data(items).enter()\n .append('text')\n .text(function(d){ return d; })\n .style(style.text)\n .attr('x', -1000)\n .attr('y', -1000)\n .attr('class', 'tmp');\n var z = d3.selectAll('.tmp')[0]\n .map(function(x){ return x.getBBox(); });\n width = d3.max(z.map(function(x){ return x.width; }));\n margin = margin * width;\n width = width + 2 * margin;\n height = d3.max(z.map(function(x){ return x.height + margin / 2; }));\n \n // cleanup\n d3.selectAll('.tmp').remove();\n rescale = false;\n }\n }", "setScale(x,y,z=this.scale.z){\n this.scale.x = x;\n this.scale.y = y;\n }", "function updateScale() {\n circle.css(toVendorCSS({\n transform : $mdUtil.supplant('scale( {0} )',[getDiameterRatio()])\n }));\n }", "rescale(scale) {\n this.scale = scale;\n }", "function normalizeAndRescale(obj, newScale)\r\n{\r\n var scale = getMaxSize(obj); // Available in 'utils.js'\r\n obj.scale.set(newScale * (1.0/scale),\r\n newScale * (1.0/scale),\r\n newScale * (1.0/scale));\r\n return obj;\r\n}", "function normalizeAndRescale(obj, newScale)\r\n{\r\n var scale = getMaxSize(obj); // Available in 'utils.js'\r\n obj.scale.set(newScale * (1.0/scale),\r\n newScale * (1.0/scale),\r\n newScale * (1.0/scale));\r\n return obj;\r\n}", "updateLayoutForScale() {\n const { layout, originalLayout, parentLayout, element } = this;\n // Update layout\n const { width, height } = originalLayout;\n const { x, y, width: scaledWidth, height: scaledHeight } = layout;\n // Update size\n const widthPx = width + \"px\";\n const heightPx = height + \"px\";\n const { style } = element;\n if (style.width !== widthPx)\n style.width = widthPx;\n if (style.height !== heightPx)\n style.height = heightPx;\n // Calculate translation\n const translateX = x - parentLayout.x;\n const translateY = y - parentLayout.y;\n // Calculate scale\n const scaleX = scaledWidth / width;\n const scaleY = scaledHeight / height;\n // Update transform matrix\n style.transform = createTransform(translateX, translateY, scaleX, scaleY);\n // Update content element\n const { style: contentStyle } = this._contentElement;\n if (contentStyle.width !== widthPx)\n contentStyle.width = widthPx;\n if (contentStyle.height !== heightPx)\n contentStyle.height = heightPx;\n contentStyle.transform = createTransform();\n }", "onUpdateScale() {\n this.wall.scale.set(this.size.x, this.size.y, 1);\n }", "function normalizeAndRescale(obj, newScale)\n{\n var scale = getMaxSize(obj); \n obj.scale.set(newScale * (1.0/scale),\n newScale * (1.0/scale),\n newScale * (1.0/scale));\n return obj;\n}", "_applyScale() {\n // adjust textures size\n for(let i = 0; i < this.textures.length; i++) {\n this.textures[i].resize();\n }\n\n // we should update the plane mvMatrix\n this._updateMVMatrix = true;\n }", "function normalizeAndRescale(obj, newScale) {\n var scale = getMaxSize(obj); // Available in 'utils.js'\n obj.scale.set(newScale * (1.0 / scale),\n newScale * (1.0 / scale),\n newScale * (1.0 / scale));\n return obj;\n}", "_primaryTransform() {\n // We use a 3d transform to work around some rendering issues in iOS Safari. See #19328.\n const scale = this.value / 100;\n return { transform: `scale3d(${scale}, 1, 1)` };\n }", "function setScale() {\n\tscale = scale + (direction * halfStep);\n\t\n\tif (scale < 0.1 ) scale = 0.1;\n\tif (scale > 2) scale = 2;\n\n\tvar newWidth = naturalWidth * scale;\n\tvar newHeight = naturalHeight * scale;\n\t\n\timage.width(newWidth);\n\timage.height(newHeight);\t\t\n}", "function scaleObj(scroll){\r\n\r\n if (buttonE && currPick!=null){\r\n\r\n if(scroll > 0){\r\n if(scale <= 2 && scale >= 1){\r\n scale+=0.1;\r\n console.log(\"scale up by:\", scale);\r\n }else if(scale < 1){\r\n scale = 1;\r\n }\r\n }else{\r\n if(scale >= 0.5 && scale <= 1){\r\n scale-=0.1;\r\n console.log(\"scale down by:\", scale);\r\n }else if(scale > 1){\r\n scale = 1;\r\n }\r\n }\r\n\r\n vert = currPick.vert;\r\n var updatedVert = [];\r\n var S = new Matrix4();\r\n S = S.setScale(scale, scale, scale);\r\n \r\n for (var i=0; i<vert.length; i+=3){\r\n if(scale<0.5 || scale>2){break;}\r\n var newVert = new Vector3([vert[i], vert[i+1], vert[i+2]]);\r\n newVert = S.multiplyVector3(newVert);\r\n updatedVert.push(newVert.elements[0], newVert.elements[1], newVert.elements[2]);\r\n }\r\n\r\n if(scale>=0.5 && scale<=2){currPick.vert = updatedVert;}\r\n console.log(\"scaled\");\r\n drawObjects();\r\n \r\n return false;\r\n }\r\n}", "changePosition(x, y) {\n this.zoomImg.style.transformOrigin = `${x}% ${y}%`;\n }", "zoomed(self) {\n var t = d3\n .event\n .transform;\n \n if( self.previous_scale > t.k )\n {\n self.removeStateSelection();\n self.previous_scale = 0;\n self.ui.removeUI(); //interface screen\n self.ui.applyUI(self.selected_state_id);\n \n } \n \n //save previous scale\n self.countriesGroup.attr(\"transform\",\"translate(\" + [t.x, t.y] + \")scale(\" + t.k + \")\");\n self.bordersGroup.attr(\"transform\",\"translate(\" + [t.x, t.y] + \")scale(\" + t.k + \")\");\n }", "updateTransform()\n {\n this.validate();\n this.containerUpdateTransform();\n }", "setScale(scale) {\n // Save the new scale\n this.scale = scale\n this.tModelToWorld.setScale(scale, scale)\n }", "updateTransform() {\n super.updateTransform();\n // TODO don't need to!\n // this.displayObjectUpdateTransform();\n // PIXI.Container.prototype.updateTransform.call( this );\n }", "function handleScale(e) {\n var origins = getTransformOrigin(el);\n var parts = getTransform(el);\n var oldScale = +parts[0];\n if ((e.deltaY < 0 && oldScale >= maxScale)\n || (e.deltaY > 0 && oldScale <= minScale)) {\n return;\n }\n var deltScale = e.deltaY * 0.005;\n var scale = Math.min(Math.max(minScale, oldScale - deltScale), maxScale);\n if (mouseX !== -1) {\n // deltScale * el.offsetWidth * ((mouseX - origins[0]) / el.offsetWidth);\n var deltW = deltScale * (mouseX - origins[0]);\n parts[4] = +parts[4] + deltW;\n }\n if (mouseY !== -1) {\n // deltScale * el.offsetHeight * ((mouseY - origins[1])/ el.offsetHeight);\n var deltH = deltScale * (mouseY - origins[1]);\n parts[5] = +parts[5] + deltH;\n }\n parts[0] = scale;\n parts[3] = scale;\n // @ts-ignore\n el.style[transformProperty] = \"matrix(\" + parts.join(\",\") + \")\";\n if (onScaleChange) {\n onScaleChange({ scale: scale });\n }\n e.preventDefault();\n }", "function setTransform(xPos, yPos, scale, el) {\n el.style.transform = `translate3d(${xPos}px, ${yPos}px, 0) scale(${scale}, ${scale})`;\n }", "scale(scale) {\n this._height *= scale;\n this._width += scale;\n }", "scale() {\n this.p.scale(this._scaleFactor);\n }", "scale() {\n this.p.scale(this._scaleFactor);\n }", "scale() {\n this.p.scale(this._scaleFactor);\n }", "setTransform(valueNew){let t=e.ValueConverter.toObject(valueNew);if(null===t&&(t=this.getAttributeDefaultValueInternal(\"Transform\")),t&&!Array.isArray(t))return void(TCHMI_CONSOLE_LOG_LEVEL>=1&&e.Log.error(\"[Source=Control, Module=TcHmi.Controls.System.TcHmiControl, Id=\"+this.getId()+\", Attribute=Transform] Non array values are not supported.\"));let r=this.__objectResolvers.get(\"transform\");r&&(r.watchDestroyer&&r.watchDestroyer(),r.resolver.destroy());let s=new e.Symbol.ObjectResolver(t);this.__objectResolvers.set(\"transform\",{resolver:s,watchCallback:this.__onResolverForTransformWatchCallback,watchDestroyer:s.watch(this.__onResolverForTransformWatchCallback)})}", "function applyScaleToWidget(widget, scaleObj) {\n if (scaleObj.sx === scaleObj.sy && scaleObj.sx === scaleObj.sz) {\n widget.SetScale(Number(scaleObj.sx));\n } else {\n widget.SetScaleXYZ(Number(scaleObj.sx), Number(scaleObj.sy), Number(scaleObj.sz));\n }\n }", "adjustScale(cx, cy, scale) {\n this.onModelReady.push(() => {\n this.viewMatrix.adjustScale(cx, cy, scale);\n });\n }", "set currentScale(newScale) {\n if (this._zoomDirty) {\n this._updateMatrix();\n }\n // We use dimensional analysis to set the scale. Remember we can't\n // just set the scale absolutely because atSCTransform is an accumulating matrix.\n // We have to take its current value and compute a new value based\n // on the passed in value.\n // Also, I can use atSCTransform.a because I don't allow rotations within in the game,\n // so the diagonal components correctly represent the matrix's current scale.\n // And because I only perform uniform scaling I can safely use just the \"a\" element.\n const scaleFactor = newScale / this._atSCTransform.a;\n this._scaleX = scaleFactor;\n this._scaleY = scaleFactor;\n this._zoomDirty = true;\n }", "updateTransform() {\n this.transform = Object(transformation_matrix__WEBPACK_IMPORTED_MODULE_9__[\"toSVG\"])(Object(transformation_matrix__WEBPACK_IMPORTED_MODULE_9__[\"smoothMatrix\"])(this.transformationMatrix, 100));\n }", "function setTransforms() {\n itemsStyle.style.transform = 'translate3d(' + (posI * 550) + 'px,0,0)';\n}", "processScale(context, result, inputParams, index) {\n var _a;\n result.element = (_a = result.element) !== null && _a !== void 0 ? _a : [];\n const element = inputParams.element;\n const point = inputParams.center;\n const factor = +inputParams.factor;\n const matrix = new SVG.Matrix(element);\n matrix.scale(factor, factor, point.x, point.y);\n this.applyMatrix(element, matrix);\n result.element.push(element);\n }", "function scaleUpBtnClick(event) {\n gImageInfoViewer.setScale(gImageInfoViewer.scale * 2);\n scaleFactor.innerText = Math.round(gImageInfoViewer.scale * 100) + \"%\";\n}", "handleScale(factor, config, reverse) {\n this.scaleMobject(reverse ? 1 / factor : factor);\n }", "function scale(vec, setTo) {\n\t\tthis.transform(this.transformation.scale, vec, setTo);\n\t}", "set transform(value) {}", "set transform(value) {}", "set transform(value) {}", "set transform(value) {}", "update(){ // call to update transforms\n dirty = false;\n m[3] = m[0] = scale;\n m[1] = m[2] = 0;\n m[4] = pos.x;\n m[5] = pos.y;\n if(useConstraint){\n this.constrain();\n }\n this.invScale = 1 / scale;\n // calculate the inverse transformation\n let cross = m[0] * m[3] - m[1] * m[2];\n im[0] = m[3] / cross;\n im[1] = -m[1] / cross;\n im[2] = -m[2] / cross;\n im[3] = m[0] / cross;\n }", "push() {\n\t\t// the ratio of the receptor size when pushed down\n\t\tvar ratio = 0.90;\n\t\t\n\t\tif (this.graphic.scale > ratio) {\n\t\t\tthis.graphic.scale -= 0.1;\n\t\t\tif (this.graphic.scale < ratio) {\n\t\t\t\tthis.graphic.scale = ratio;\n\t\t\t}\n\t\t}\n\t}", "function zoom_actions() {\n inner.attr('transform', d3.zoomTransform(svg.node()));\n }", "function scaleDownPreviewBntClick(event) {\n gImageInfoListViewer.setScale(gImageInfoListViewer.scale / 2);\n}", "function dragpointScale() {\n var\n cssrule = '#'+self.cfg.stylesId+'{ #'+svgContainer.id+'_dragpoint }',\n scale = 0.0025 * Math.min( boxW, boxH );\n $.stylesheet(cssrule).css( 'transform', 'scale('+scale+')' );\n }", "function scaleValue(value){\n //Assuming army size is between \n}", "update()\n {\n this.scale += this.ds;\n\n if(this.scale <= SMIN)\n {\n this.scale = SMIN;\n this.ds = -this.ds;\n }\n\n if(this.scale >= SMAX)\n {\n this.scale = SMAX;\n this.ds = -this.ds;\n }\n }", "function scaleDown() {\n console.log('scale down triggered');\n var m = new THREE.Matrix4();\n m.set( 10/11, 0, 0, 0,\n 0, 10/11, 0, 0,\n 0, 0, 10/11, 0,\n 0, 0, 0, 1 );\n geometry.applyMatrix(m);\n // render\n render();\n}", "function applyScale(tree, last) {\n let horizontal = graph.scale.horizontal\n tree.eachBefore(d => {\n if (tree.data.id === d.data.id) return\n if (last) d.x *= graph.scale.vertical.value / last\n if (d.parent) {\n if (!graph.style.align) {\n d.y = d.data.data.value * horizontal.value * horizontal.scalingFactor + d.parent.y\n } else d.y = d.depth * horizontal.scalingFactor * horizontal.value\n }\n })\n }", "_updateTransform() {\n this._applyTransform(this._transform)\n this.redraw()\n if (this.callbacks.didUpdateTransform) {\n this.callbacks.didUpdateTransform(this._transform)\n }\n }", "function scaleIcon(icon, value) {\n var icon_bbox = icon.node().getBBox();\n var icon_x = icon_bbox.x;\n var icon_y = icon_bbox.y;\n var icon_scaling_factor = value;\n icon.attr('transform', 'translate('+(1 - icon_scaling_factor) * (icon_x+50)+', '+(1 - icon_scaling_factor) * (icon_y+50)+') scale('+icon_scaling_factor+')');\n}", "set_by_scale_translate( scale = 1, translate = 0 ) {\n this.scale = Math.fround( scale );\n this.translate = Math.fround( translate );\n }", "function zoom_actions(){\n g.attr(\"transform\", d3.event.transform)\n }", "setScale(xscale, yscale) {\n this.a = xscale\n this.e = yscale\n }", "applyCurrentTransform () {\n this.tempPosition.set(this.position);\n this.tempOrientation = this.orientation;\n this.tempScale.set(this.scale);\n }", "function drawToScale(input) {\n return height - ( (input-minX)*height) / (maxX-minX); \n }", "function unscale(el){\n var svg = el.ownerSVGElement;\n var xf = el.scaleIndependentXForm;\n if (!xf){\n // Keep a single transform matrix in the stack for fighting transformations\n // Be sure to apply this transform after existing transforms (translate)\n xf = el.scaleIndependentXForm = svg.createSVGTransform();\n el.transform.baseVal.appendItem(xf);\n }\n var m = svg.getTransformToElement(el.parentNode);\n m.e = m.f = 0; // Ignore (preserve) any translations done up to this point\n xf.setMatrix(m);\n}", "zoomOut() {\n this.zoomWithScaleFactor(2.0)\n }", "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function scale(scale)\n{\n // Loop through each value pair\n for (var i = 0, size = positions.length; i < size; i+=2)\n {\n // Get x and y coordinates\n var x = positions[i];\n var y = positions[i+1];\n\n // Multiply x and y valu by scale value\n x += x * scale;\n y += y * scale;\n\n // Set position values\n positions[i] = x;\n positions[i+1] = y;\n }\n\n // Redraw the image\n loadImage();\n}", "function zoom() {\n $scope.svg.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function move() {\r\n var t = d3.event.translate;\r\n var s = d3.event.scale; \r\n\r\n zoom.translate(t);\r\n g.style(\"stroke-width\", 1 / s).attr(\"transform\", \"translate(\" + t + \")scale(\" + s + \")\");\r\n }", "_moveHandle(handle, v) {\n handle.attr(\"transform\", \"translate(\" + this._scale(v) + \",0)\");\n }", "function zoomHandler() {\n svg.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n /*$.each(pies, function(k, pie) {\n pie.attr(\"transform\", \"scale(-\" + d3.event.scale + \")\");\n });*/\n}", "function transform(el, value) {\n el.style['transform'] = value;\n el.style['webkitTransform'] = value;\n}", "function ripple_transform(el, value) {\n el.style['transform'] = value;\n el.style['webkitTransform'] = value;\n}", "transformVector(vector)\n {\n vector = vector.scaleUniform(this.tileset.size);\n vector = super.transformVector(vector);\n return vector;\n }", "_applyTransform() {\n this.wrapper.style.transform = [\n 'translateX(-50%)',\n `translateX(${this._translate})`,\n ].join(' ');\n }", "function scaleBy(point, value) {\n point.x *= value;\n point.y *= value;\n }", "get scaled() { return this._scaled; }", "get scaled() { return this._scaled; }", "scale(sx, sy, sz){\n let e = this.elements;\n e[0] *= sx; e[4] *= sy; e[8] *= sz;\n e[1] *= sx; e[5] *= sy; e[9] *= sz;\n e[2] *= sx; e[6] *= sy; e[10] *= sz;\n e[3] *= sx; e[7] *= sy; e[11] *= sz;\n return this;\n }", "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function transform_image() {\n mirror = document.getElementsByClassName('mirror')[0];\n zoom = document.getElementById('zoom').value;\n norm_image = document.getElementById(\"drag-img\");\n mod_image = document.getElementById(\"mod-img\");\n\n //If checkbox is checked, mirror the image\n if (mirror.checked == true) {\n if (mod_image != null) {\n mod_image.style.transform = 'scaleX(-1)'\n }\n else {\n norm_image.style.transform = 'scaleX(-1)';\n }\n }\n else {\n if (mod_image != null) {\n mod_image.style.transform = 'scaleX(1)'\n }\n else {\n norm_image.style.transform = 'scaleX(1)';\n }\n }\n\n\n}", "setAutoScalen()\n{\n this.auto_scale = true;\n}", "function updateScales(width,height){\n\t\tscales[state].x.range([0, width]);\n\n\t\tscales[state].y.range([height,0]);\n\t}", "function zoom() {\n svgGroup.attr(\"transform\", `translate(${d3.event.translate})scale(${d3.event.scale})`);\n }", "cancelScale() {\n this.p.scale(this._inversedScaleFactor);\n }" ]
[ "0.7050058", "0.67608386", "0.67524034", "0.673005", "0.6546912", "0.65293264", "0.65057826", "0.6440724", "0.63353074", "0.6333923", "0.6257631", "0.62325096", "0.6229856", "0.62294656", "0.6219475", "0.621456", "0.62137073", "0.6204079", "0.619404", "0.61829716", "0.61465275", "0.6113747", "0.6113063", "0.60997146", "0.60997146", "0.6086502", "0.6063032", "0.60571307", "0.60166353", "0.5940924", "0.5912443", "0.5904578", "0.59029335", "0.5895688", "0.5893767", "0.5888928", "0.5888034", "0.5887794", "0.5880351", "0.58780295", "0.5868834", "0.58594537", "0.58594537", "0.58594537", "0.5853838", "0.585087", "0.58443785", "0.58386165", "0.5830389", "0.58302367", "0.5816843", "0.5813656", "0.58006936", "0.57935107", "0.5788615", "0.5788615", "0.5788615", "0.5788615", "0.5776058", "0.57680523", "0.5760384", "0.57565475", "0.57481503", "0.5738843", "0.5728384", "0.5722558", "0.57222897", "0.57171834", "0.5716907", "0.5699341", "0.5659783", "0.56571805", "0.56565213", "0.5655014", "0.56353855", "0.56315815", "0.56287515", "0.56158674", "0.56137526", "0.5613291", "0.5612279", "0.5607354", "0.56060445", "0.56046873", "0.56035393", "0.5600424", "0.55987614", "0.5594168", "0.5594168", "0.55856735", "0.5575374", "0.5575374", "0.5575374", "0.5575374", "0.5575374", "0.5567767", "0.5563346", "0.5559703", "0.5552726", "0.5551206" ]
0.57161057
69
disallow scrolling (on the scrollContainer)
function noscroll() { if(!lockScroll) { lockScroll = true; xscroll = scrollContainer.scrollLeft; yscroll = scrollContainer.scrollTop; } scrollContainer.scrollTop = yscroll; scrollContainer.scrollLeft = xscroll; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preventScrollEvents(e){\n e.stopPropagation();\n }", "function preventScrollEvents(e){\n e.stopPropagation();\n }", "disable() {\n if (this._scrollSubscription) {\n this._scrollSubscription.unsubscribe();\n this._scrollSubscription = null;\n }\n }", "disable() {\n if (this._scrollSubscription) {\n this._scrollSubscription.unsubscribe();\n this._scrollSubscription = null;\n }\n }", "function cancelScrolling(event) {\n event.preventDefault();\n }", "function preventScrolling(e) {\n e.preventDefault();\n }", "function preventScrolling(e) {\n e.preventDefault();\n }", "function preventScrolling(e) {\n e.preventDefault();\n }", "function preventScroll () {\n var body = document.body;\n body.style.overflowY = \"hidden\";\n }", "_preventUserScrollForDefaultBehavior() {\n return;\n }", "_stopScrolling(event) {\n return false;\n }", "disableHideOnScroll() {\n this.root.removeAttribute('data-hide-on-scroll');\n this.hideOnScroll = false;\n this.root.classList.remove('is-hidden-scroll');\n }", "function preventScrolling(e) {\n\t e.preventDefault();\n\t }", "function disableScrolling() {\n\t\t\t$el.unbind('touchmove');\n\t\t\tif ($(window).height() >= 300) {\n\t\t\t\t$el.bind('touchmove', function(e) { e.preventDefault(); });\n\t\t\t}\n\t\t}", "disableInfiniteScroll() {\n if (!this._hasInfiniteScroll) {\n return;\n }\n this._modalComponent._infiniteScroll.disabled = true;\n }", "function preventBodyScroll() {\n $(\"body\").toggleClass(\"is-unscrollable\");\n }", "function stopScrolling (e) {\n e.preventDefault();\n e.stopPropagation();\n return false;\n}", "function disableElementScroll() {\n let zIndex = 50;\n let scrollMask = Ember.$(`<div class=\"md-scroll-mask\" style=\"z-index: ${zIndex}\">\n <div class=\"md-scroll-mask-bar\"></div>\n </div>`);\n body.appendChild(scrollMask[0]);\n\n scrollMask.on('wheel', preventDefault);\n scrollMask.on('touchmove', preventDefault);\n $document.on('keydown', disableKeyNav);\n\n return function restoreScroll() {\n scrollMask.off('wheel');\n scrollMask.off('touchmove');\n scrollMask[0].parentNode.removeChild(scrollMask[0]);\n $document.off('keydown', disableKeyNav);\n delete util.disableScrollAround._enableScrolling;\n };\n\n // Prevent keypresses from elements inside the body\n // used to stop the keypresses that could cause the page to scroll\n // (arrow keys, spacebar, tab, etc).\n function disableKeyNav() {\n // -- temporarily removed this logic, will possibly re-add at a later date\n return;\n /* if (!element[0].contains(e.target)) {\n e.preventDefault();\n e.stopImmediatePropagation();\n } */\n }\n\n function preventDefault(e) {\n e.preventDefault();\n }\n }", "function disableScroll() {\n window.addEventListener('DOMMouseScroll', preventDefault, false); // older FF\n window.addEventListener(wheelEvent, preventDefault, wheelOpt); // modern desktop\n window.addEventListener('touchmove', preventDefault, wheelOpt); // mobile\n window.addEventListener('keydown', preventDefaultForScrollKeys, false);\n scrollDisabled = true\n}", "function stopTheScroll () {\n $('body').css({\n 'overflow': 'hidden',\n })\n }", "function handleScrollStop() {\n scrollEngaged = false;\n}", "function cancelScroll() {\n\tif (!o3_followscroll || typeof over.scroller == 'undefined') return;\n\tover.scroller.canScroll = 1;\n\t\n\tif (over.scroller.timer) {\n\t\tclearTimeout(over.scroller.timer);\n\t\tover.scroller.timer=null;\n\t}\n}", "function disableScroll() {\n window.addEventListener(\"DOMMouseScroll\", preventDefault, false); // older FF\n window.addEventListener(wheelEvent, preventDefault, wheelOpt); // modern desktop\n window.addEventListener(\"touchmove\", preventDefault, wheelOpt); // mobile\n }", "function disableScroll() {\n window.addEventListener('DOMMouseScroll', preventDefault, false); // older FF\n window.addEventListener(wheelEvent, preventDefault, wheelOpt); // modern desktop\n window.addEventListener('touchmove', preventDefault, wheelOpt); // mobile\n window.addEventListener('keydown', preventDefaultForScrollKeys, false);\n }", "function disableScroll() {\n savedY = $(\"body\").scrollTop();\n $(window).on(\"scroll\", cancelScroll);\n $(window).on(\"wheel\", checkScroll);\n}", "disable() {\n if (this._isEnabled) {\n const html = this._document.documentElement;\n const body = this._document.body;\n const htmlStyle = html.style;\n const bodyStyle = body.style;\n const previousHtmlScrollBehavior = htmlStyle.scrollBehavior || '';\n const previousBodyScrollBehavior = bodyStyle.scrollBehavior || '';\n this._isEnabled = false;\n htmlStyle.left = this._previousHTMLStyles.left;\n htmlStyle.top = this._previousHTMLStyles.top;\n html.classList.remove('cdk-global-scrollblock');\n // Disable user-defined smooth scrolling temporarily while we restore the scroll position.\n // See https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior\n htmlStyle.scrollBehavior = bodyStyle.scrollBehavior = 'auto';\n window.scroll(this._previousScrollPosition.left, this._previousScrollPosition.top);\n htmlStyle.scrollBehavior = previousHtmlScrollBehavior;\n bodyStyle.scrollBehavior = previousBodyScrollBehavior;\n }\n }", "function stopBackgroundScroll() {\n\tif ('ontouchmove' in document.documentElement) {\n\t\t/* To stop scrolling background when any popup appears for design area */\n\t\t$('.row_box').bind('touchmove', function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t});\n\t}\n}", "function disableScroll() {\n window.addEventListener('DOMMouseScroll', preventDefault, false); // older FF\n window.addEventListener(wheelEvent, preventDefault, wheelOpt); // modern desktop\n window.addEventListener('touchmove', preventDefault, wheelOpt); // mobile\n window.addEventListener('keydown', preventDefaultForScrollKeys, false);\n}", "function allowTouchScroll() {\n log(\"allowTouchScroll\");\n\n document.removeEventListener(\"touchmove\", preventDefault);\n }", "function noScroll() {\n window.scrollTo(0, scroll);\n }", "function disableScroll() {\n window.addEventListener('DOMMouseScroll', preventDefault, false); // older FF\n window.addEventListener(wheelEvent, preventDefault, wheelOpt); // modern desktop\n window.addEventListener('touchmove', preventDefault, wheelOpt); // mobile\n window.addEventListener('keydown', preventDefaultForScrollKeys, false);\n}", "function disableScroll() {\n window.addEventListener('DOMMouseScroll', preventDefault, false); // older FF\n window.addEventListener(wheelEvent, preventDefault, wheelOpt); // modern desktop\n window.addEventListener('touchmove', preventDefault, wheelOpt); // mobile\n window.addEventListener('keydown', preventDefaultForScrollKeys, false);\n}", "function disableScroll() {\n window.addEventListener('DOMMouseScroll', preventDefault, false); // older FF\n window.addEventListener(wheelEvent, preventDefault, wheelOpt); // modern desktop\n window.addEventListener('touchmove', preventDefault, wheelOpt); // mobile\n window.addEventListener('keydown', preventDefaultForScrollKeys, false);\n}", "stop() {\n\t\tthis.scroll.stop();\n\t}", "function enableScroll() {\n $(window).off(\"scroll\", cancelScroll);\n $(window).off(\"wheel\", checkScroll);\n}", "function disableScrolling(){\n document.querySelector('body').classList.add('stop-scrolling');\n }", "function disableElementScroll() {\n var zIndex = 50;\n var scrollMask = $('<div class=\"md-scroll-mask\" style=\"z-index: ' + zIndex + '\">\\n <div class=\"md-scroll-mask-bar\"></div>\\n </div>');\n body.appendChild(scrollMask[0]);\n\n scrollMask.on('wheel', preventDefault);\n scrollMask.on('touchmove', preventDefault);\n $document.on('keydown', disableKeyNav);\n\n return function restoreScroll() {\n scrollMask.off('wheel');\n scrollMask.off('touchmove');\n scrollMask[0].parentNode.removeChild(scrollMask[0]);\n $document.off('keydown', disableKeyNav);\n delete util.disableScrollAround._enableScrolling;\n };\n\n // Prevent keypresses from elements inside the body\n // used to stop the keypresses that could cause the page to scroll\n // (arrow keys, spacebar, tab, etc).\n function disableKeyNav(e) {\n // -- temporarily removed this logic, will possibly re-add at a later date\n return;\n if (!element[0].contains(e.target)) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n }\n\n function preventDefault(e) {\n e.preventDefault();\n }\n }", "function disableElementScroll() {\n var zIndex = 50;\n var scrollMask = $('<div class=\"md-scroll-mask\" style=\"z-index: ' + zIndex + '\">\\n <div class=\"md-scroll-mask-bar\"></div>\\n </div>');\n body.appendChild(scrollMask[0]);\n\n scrollMask.on('wheel', preventDefault);\n scrollMask.on('touchmove', preventDefault);\n $document.on('keydown', disableKeyNav);\n\n return function restoreScroll() {\n scrollMask.off('wheel');\n scrollMask.off('touchmove');\n scrollMask[0].parentNode.removeChild(scrollMask[0]);\n $document.off('keydown', disableKeyNav);\n delete util.disableScrollAround._enableScrolling;\n };\n\n // Prevent keypresses from elements inside the body\n // used to stop the keypresses that could cause the page to scroll\n // (arrow keys, spacebar, tab, etc).\n function disableKeyNav(e) {\n // -- temporarily removed this logic, will possibly re-add at a later date\n return;\n if (!element[0].contains(e.target)) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n }\n\n function preventDefault(e) {\n e.preventDefault();\n }\n }", "function disableElementScroll() {\n var zIndex = 50;\n var scrollMask = $('<div class=\"md-scroll-mask\" style=\"z-index: ' + zIndex + '\">\\n <div class=\"md-scroll-mask-bar\"></div>\\n </div>');\n body.appendChild(scrollMask[0]);\n\n scrollMask.on('wheel', preventDefault);\n scrollMask.on('touchmove', preventDefault);\n $document.on('keydown', disableKeyNav);\n\n return function restoreScroll() {\n scrollMask.off('wheel');\n scrollMask.off('touchmove');\n scrollMask[0].parentNode.removeChild(scrollMask[0]);\n $document.off('keydown', disableKeyNav);\n delete util.disableScrollAround._enableScrolling;\n };\n\n // Prevent keypresses from elements inside the body\n // used to stop the keypresses that could cause the page to scroll\n // (arrow keys, spacebar, tab, etc).\n function disableKeyNav(e) {\n // -- temporarily removed this logic, will possibly re-add at a later date\n return;\n if (!element[0].contains(e.target)) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n }\n\n function preventDefault(e) {\n e.preventDefault();\n }\n }", "function disableScrolling() {\n var x = window.scrollX;\n var y = window.scrollY;\n window.onscroll = function() {\n window.scrollTo(x, y);\n };\n}", "function ScrollStop() {\r\n return false;\r\n}", "function startTheScroll () {\n $('body').css({\n 'overflow': '',\n })\n }", "function disableParentScroll(disabled){if(disabled&&!lastParentOverFlow){lastParentOverFlow=disableScrollTarget.css('overflow');disableScrollTarget.css('overflow','hidden');}else if(angular.isDefined(lastParentOverFlow)){disableScrollTarget.css('overflow',lastParentOverFlow);lastParentOverFlow=undefined;}}", "function disableElementScrollEvents(element){function preventDefault(e){e.preventDefault();}element.on('wheel',preventDefault);element.on('touchmove',preventDefault);return function(){element.off('wheel',preventDefault);element.off('touchmove',preventDefault);};}", "function disable() {\n workspaceScroller.disable();\n}", "function disableScrolling(){\n var x=window.scrollX;\n var y=window.scrollY;\n window.onscroll=function(){window.scrollTo(x, y);};\n}", "function bodyScroll (event) {\n event.preventDefault()\n}", "disableScroll() {\n window.addEventListener('DOMMouseScroll', preventDefault, false); // older FF\n window.addEventListener(wheelEvent, preventDefault, wheelOpt); // modern desktop\n window.addEventListener('touchmove', preventDefault, wheelOpt); // mobile\n window.addEventListener('keydown', preventDefaultForScrollKeys, false);\n }", "function enableScroll() {\n window.removeEventListener('DOMMouseScroll', preventDefault, false);\n window.removeEventListener(wheelEvent, preventDefault, wheelOpt); \n window.removeEventListener('touchmove', preventDefault, wheelOpt);\n window.removeEventListener('keydown', preventDefaultForScrollKeys, false);\n scrollDisabled = false\n}", "function disarmWindowScroller() {\n window.removeEventListener('mousemove', updateMousePosition);\n window.removeEventListener('touchmove', updateMousePosition);\n mousePosition = undefined;\n window.clearTimeout(next$1);\n resetScrolling$1();\n }", "function disableScroll() { \n // Get the current page scroll position \n scrollTop = window.pageYOffset || document.documentElement.scrollTop; \n scrollLeft = window.pageXOffset || document.documentElement.scrollLeft, \n\n // if any scroll is attempted, set this to the previous value \n window.onscroll = function() { \n window.scrollTo(scrollLeft, scrollTop); \n }; \n}", "enableHideOnScroll() {\n if (!this.sticky) {\n this.enableSticky();\n }\n\n this.root.setAttribute('data-hide-on-scroll', '');\n this.hideOnScroll = true;\n }", "function preventScroll(event)\n {\n if(mouserOverPlayer){\n event.preventDefault();\n event.returnValue=!mouserOverPlayer;\n if(event.wheelDeltaY < 0){\n globalVolume-=2;\n }else if(event.wheelDeltaY > 0){\n globalVolume+=2;\n }\n globalVolume = (globalVolume<0)?0:(globalVolume>100)?100:globalVolume;\n setVol();\n }\n }", "function noscroll() {\n window.scrollTo(0, 0);\n }", "function noScroll(event) {\n\tlet pageY = event.pageY;\n\n\tif (pageY !== undefined) {\n\t\twindow.scrollTo(0, event.pageY);\n\t}\n\t\n }", "function noScrollFn() {\n window.scrollTo(scrollPosition ? scrollPosition.x : 0, scrollPosition ? scrollPosition.y : 0);\n }", "function disableElementScroll(element) {\n element = angular.element(element || body)[0];\n var zIndex = 50;\n var scrollMask = angular.element(\n '<div class=\"md-scroll-mask\">' +\n ' <div class=\"md-scroll-mask-bar\"></div>' +\n '</div>').css('z-index', zIndex);\n element.appendChild(scrollMask[0]);\n\n scrollMask.on('wheel', preventDefault);\n scrollMask.on('touchmove', preventDefault);\n\n return function restoreScroll() {\n scrollMask.off('wheel');\n scrollMask.off('touchmove');\n scrollMask[0].parentNode.removeChild(scrollMask[0]);\n delete $mdUtil.disableScrollAround._enableScrolling;\n };\n\n function preventDefault(e) {\n e.preventDefault();\n }\n }", "function preventDefultScroll(e) {\n if([32, 37, 38, 39, 40, 16].indexOf(e.keyCode) > -1) {\n e.preventDefault()\n }\n }", "function disableScrollBars() {\n\tdocument.documentElement.style.overflow = 'hidden'; // firefox, chrome\n\tdocument.body.style.overflow = \"hidden\";\n\tdocument.body.scroll = \"no\"; // ie only\n}", "function disablePageScroll() {\n if (!jQuery('html').hasClass('noscroll')) {\n if (jQuery(document).height() > jQuery(window).height()) {\n var scrollTop = (jQuery('html').scrollTop()) ? jQuery('html').scrollTop() : jQuery('body').scrollTop();\n jQuery('html').addClass('noscroll').css('top',-scrollTop); \n };\n };\n }", "function disableElementScroll(element) {\n element = angular.element(element || body)[0];\n var scrollMask = angular.element(\n '<div class=\"md-scroll-mask\">' +\n ' <div class=\"md-scroll-mask-bar\"></div>' +\n '</div>');\n element.appendChild(scrollMask[0]);\n\n scrollMask.on('wheel', preventDefault);\n scrollMask.on('touchmove', preventDefault);\n\n return function restoreScroll() {\n scrollMask.off('wheel');\n scrollMask.off('touchmove');\n scrollMask[0].parentNode.removeChild(scrollMask[0]);\n delete $mdUtil.disableScrollAround._enableScrolling;\n };\n\n function preventDefault(e) {\n e.preventDefault();\n }\n }", "function enableScroll() {\n window.removeEventListener('DOMMouseScroll', preventDefault, false);\n window.removeEventListener(wheelEvent, preventDefault, wheelOpt); \n window.removeEventListener('touchmove', preventDefault, wheelOpt);\n window.removeEventListener('keydown', preventDefaultForScrollKeys, false);\n }", "function noScrollFn() {\n\t\twindow.scrollTo( scrollPosition ? scrollPosition.x : 0, scrollPosition ? scrollPosition.y : 0 );\n\t}", "function disableMiddleBtnScroll()\n{\n document.addEventListener(\"mousedown\", function(e){\n if(e.button==1)\n {\n e.preventDefault(); \n return false\n }\n });\n}", "function disableParentScroll(disabled) {\n if ( disabled && !lastParentOverFlow ) {\n lastParentOverFlow = disableScrollTarget.css('overflow');\n disableScrollTarget.css('overflow', 'hidden');\n } else if (angular.isDefined(lastParentOverFlow)) {\n disableScrollTarget.css('overflow', lastParentOverFlow);\n lastParentOverFlow = undefined;\n }\n }", "function noScrollFn() {\n\t\t\t\t\twindow.scrollTo( scrollPosition ? scrollPosition.x : 0, scrollPosition ? scrollPosition.y : 0 );\n\t\t\t\t}", "function noScrollFn() {\n\t\t\t\t\twindow.scrollTo( scrollPosition ? scrollPosition.x : 0, scrollPosition ? scrollPosition.y : 0 );\n\t\t\t\t}", "_disposeScrollStrategy() {\n const scrollStrategy = this._scrollStrategy;\n if (scrollStrategy) {\n scrollStrategy.disable();\n if (scrollStrategy.detach) {\n scrollStrategy.detach();\n }\n }\n }", "function disableParentScroll(disabled) {\n if (disabled && !lastParentOverFlow) {\n lastParentOverFlow = disableScrollTarget.css('overflow');\n disableScrollTarget.css('overflow', 'hidden');\n } else if (angular.isDefined(lastParentOverFlow)) {\n disableScrollTarget.css('overflow', lastParentOverFlow);\n lastParentOverFlow = undefined;\n }\n }", "function enableScroll() {\n window.removeEventListener('DOMMouseScroll', preventDefault, false);\n window.removeEventListener(wheelEvent, preventDefault, wheelOpt); \n window.removeEventListener('touchmove', preventDefault, wheelOpt);\n window.removeEventListener('keydown', preventDefaultForScrollKeys, false);\n}", "function enableScroll() {\n window.removeEventListener('DOMMouseScroll', preventDefault, false);\n window.removeEventListener(wheelEvent, preventDefault, wheelOpt); \n window.removeEventListener('touchmove', preventDefault, wheelOpt);\n window.removeEventListener('keydown', preventDefaultForScrollKeys, false);\n}", "enableInfiniteScroll() {\n if (!this._hasInfiniteScroll) {\n return;\n }\n this._modalComponent._infiniteScroll.disabled = false;\n }", "function disablePageScroll() {\n\n\tif (!jQuery('html').hasClass('noscroll')) {\n\t\tif (jQuery(document).height() > jQuery(window).height()) {\n\t\t\tvar scrollTop = (jQuery('html').scrollTop()) ? jQuery('html').scrollTop() : jQuery('body').scrollTop();\n\t\t\tjQuery('html').addClass('noscroll').css('top',-scrollTop);\n\t\t};\n\t};\n}", "function enableScroll() {\n window.removeEventListener('DOMMouseScroll', preventDefault, false);\n window.removeEventListener(wheelEvent, preventDefault, wheelOpt);\n window.removeEventListener('touchmove', preventDefault, wheelOpt);\n window.removeEventListener('keydown', preventDefaultForScrollKeys, false);\n}", "function noScroll() {\n window.scrollTo(0, 0)\n}", "function preventTouchScroll() {\n log(\"preventTouchScroll\");\n\n if (! document.addEventListener) {\n throwMissingAddEventListenerError(\"Cannot preventTouchScroll; document.addEventListener is not a function\");\n }\n\n document.addEventListener(\"touchmove\", preventDefault);\n }", "function enableScroll() {\n window.removeEventListener('DOMMouseScroll', preventDefault, false);\n window.removeEventListener(wheelEvent, preventDefault, wheelOpt);\n window.removeEventListener('touchmove', preventDefault, wheelOpt);\n window.removeEventListener('keydown', preventDefaultForScrollKeys, false);\n}", "handleScroll(){\n this.setState({\n detachIOPanel: window.scrollY > 80\n });\n }", "function disableElementScroll(element) {\n element = angular.element(element || body)[0];\n var zIndex = 50;\n var scrollMask = angular.element(\n '<div class=\"md-scroll-mask\" style=\"z-index: ' + zIndex + '\">' +\n ' <div class=\"md-scroll-mask-bar\"></div>' +\n '</div>');\n element.appendChild(scrollMask[0]);\n\n scrollMask.on('wheel', preventDefault);\n scrollMask.on('touchmove', preventDefault);\n $document.on('keydown', disableKeyNav);\n\n return function restoreScroll() {\n scrollMask.off('wheel');\n scrollMask.off('touchmove');\n scrollMask[0].parentNode.removeChild(scrollMask[0]);\n $document.off('keydown', disableKeyNav);\n delete $mdUtil.disableScrollAround._enableScrolling;\n };\n\n // Prevent keypresses from elements inside the body\n // used to stop the keypresses that could cause the page to scroll\n // (arrow keys, spacebar, tab, etc).\n function disableKeyNav(e) {\n //-- temporarily removed this logic, will possibly re-add at a later date\n //if (!element[0].contains(e.target)) {\n // e.preventDefault();\n // e.stopImmediatePropagation();\n //}\n }\n\n function preventDefault(e) {\n e.preventDefault();\n }\n }", "function disableElementScroll(element) {\n element = angular.element(element || body);\n var scrollMask;\n if (options && options.disableScrollMask) {\n scrollMask = element;\n } else {\n element = element[0];\n scrollMask = angular.element(\n '<div class=\"md-scroll-mask\">' +\n ' <div class=\"md-scroll-mask-bar\"></div>' +\n '</div>');\n element.appendChild(scrollMask[0]);\n }\n\n scrollMask.on('wheel', preventDefault);\n scrollMask.on('touchmove', preventDefault);\n\n return function restoreScroll() {\n scrollMask.off('wheel');\n scrollMask.off('touchmove');\n scrollMask[0].parentNode.removeChild(scrollMask[0]);\n delete $mdUtil.disableScrollAround._enableScrolling;\n };\n\n function preventDefault(e) {\n e.preventDefault();\n }\n }", "function no_scrolling()\r\n\t{ \r\n\twindow.scrollTo(0,0); \r\n\t}", "function disarmWindowScroller() {\n console.debug('disarming window scroller');\n window.removeEventListener('mousemove', updateMousePosition);\n window.removeEventListener('touchmove', updateMousePosition);\n mousePosition = undefined;\n window.clearTimeout(next$1);\n resetScrolling$1();\n}", "function disableParentScroll(disabled) {\n var parent = element.parent();\n if ( disabled && !lastParentOverFlow ) {\n\n lastParentOverFlow = parent.css('overflow');\n parent.css('overflow', 'hidden');\n\n } else if (angular.isDefined(lastParentOverFlow)) {\n\n parent.css('overflow', lastParentOverFlow);\n lastParentOverFlow = undefined;\n\n }\n }", "function disableParentScroll(disabled) {\n var parent = element.parent();\n if ( disabled && !lastParentOverFlow ) {\n\n lastParentOverFlow = parent.css('overflow');\n parent.css('overflow', 'hidden');\n\n } else if (angular.isDefined(lastParentOverFlow)) {\n\n parent.css('overflow', lastParentOverFlow);\n lastParentOverFlow = undefined;\n\n }\n }", "function disableBodyScroll() {\n var htmlNode = body.parentNode;\n var restoreHtmlStyle = htmlNode.getAttribute('style') || '';\n var restoreBodyStyle = body.getAttribute('style') || '';\n var scrollOffset = body.scrollTop + body.parentElement.scrollTop;\n var clientWidth = body.clientWidth;\n\n\n if (body.scrollHeight > body.clientHeight) {\n applyStyles(body, {\n position: 'fixed',\n width: '100%',\n top: -scrollOffset + 'px'\n });\n\n applyStyles(htmlNode, {\n overflowY: 'scroll'\n });\n }\n\n if (body.clientWidth < clientWidth) {\n applyStyles(body, { overflow: 'hidden' });\n }\n\n return function restoreScroll() {\n body.setAttribute('style', restoreBodyStyle);\n htmlNode.setAttribute('style', restoreHtmlStyle);\n body.scrollTop = scrollOffset;\n };\n }", "function disableBodyScroll() {\n var htmlNode = body.parentNode;\n var restoreHtmlStyle = htmlNode.getAttribute('style') || '';\n var restoreBodyStyle = body.getAttribute('style') || '';\n var scrollOffset = body.scrollTop + body.parentElement.scrollTop;\n var clientWidth = body.clientWidth;\n\n\n if (body.scrollHeight > body.clientHeight) {\n applyStyles(body, {\n position: 'fixed',\n width: '100%',\n top: -scrollOffset + 'px'\n });\n\n applyStyles(htmlNode, {\n overflowY: 'scroll'\n });\n }\n\n if (body.clientWidth < clientWidth) {\n applyStyles(body, { overflow: 'hidden' });\n }\n\n return function restoreScroll() {\n body.setAttribute('style', restoreBodyStyle);\n htmlNode.setAttribute('style', restoreHtmlStyle);\n body.scrollTop = scrollOffset;\n };\n }", "function disableScrollLock() {\n if (isScrollLocked) {\n var scrollPosition = getElementScroll();\n var htmlTag = document.documentElement;\n htmlTag.classList.remove(className);\n htmlTag.style.marginTop = '';\n htmlTag.style.position = '';\n htmlTag.style.overflow = '';\n htmlTag.style.width = ''; // Set the scroll position to what it was before\n\n window.scrollTo(scrollPosition.left, scrollTop); // Trigger event on target. You can listen for it using document.body.addEventListener(\"akqa.scrollLock:disable\", callbackHere)\n // (document.body, \"akqa.scrollLock:disable\");\n // Remember state\n\n isScrollLocked = false;\n }\n}", "_patchWheelOverScrolling() {\n const selector = this._selector;\n selector.addEventListener('wheel', e => {\n const scroller = selector._scroller || selector.scrollTarget;\n const scrolledToTop = scroller.scrollTop === 0;\n const scrolledToBottom = scroller.scrollHeight - scroller.scrollTop - scroller.clientHeight <= 1;\n\n if (scrolledToTop && e.deltaY < 0) {\n e.preventDefault();\n } else if (scrolledToBottom && e.deltaY > 0) {\n e.preventDefault();\n }\n });\n }", "_togglePageScrollability() {\n const pageContainer = document.querySelector('html');\n\n pageContainer.classList.toggle(CLASS_NAME.unscrollable);\n\n if (pageContainer.classList.contains(CLASS_NAME.unscrollable)) {\n disableBodyScroll(this.elementRef);\n } else {\n enableBodyScroll(this.elementRef);\n }\n }", "function disableBodyScroll() {\n var doc = Object(__WEBPACK_IMPORTED_MODULE_0__dom__[\"e\" /* getDocument */])();\n if (doc && doc.body && !_bodyScrollDisabledCount) {\n doc.body.classList.add(DisabledScrollClassName);\n }\n _bodyScrollDisabledCount++;\n}", "function disableBodyScroll() {\n var htmlNode = body.parentNode;\n var restoreHtmlStyle = htmlNode.getAttribute('style') || '';\n var restoreBodyStyle = body.getAttribute('style') || '';\n var scrollOffset = body.scrollTop + body.parentElement.scrollTop;\n var clientWidth = body.clientWidth;\n\n if (body.scrollHeight > body.clientHeight) {\n applyStyles(body, {\n position: 'fixed',\n width: '100%',\n top: -scrollOffset + 'px'\n });\n\n applyStyles(htmlNode, {\n overflowY: 'scroll'\n });\n }\n\n if (body.clientWidth < clientWidth) {\n applyStyles(body, { overflow: 'hidden' });\n }\n\n return function restoreScroll() {\n body.setAttribute('style', restoreBodyStyle);\n htmlNode.setAttribute('style', restoreHtmlStyle);\n body.scrollTop = scrollOffset;\n };\n }", "function giveBackScroll () {\n var body = document.body;\n body.style.overflowY = \"visible\";\n }", "function disableElementScroll(element){element=angular.element(element||body);var scrollMask;if(options&&options.disableScrollMask){scrollMask=element;}else{element=element[0];scrollMask=angular.element('<div class=\"md-scroll-mask\">'+' <div class=\"md-scroll-mask-bar\"></div>'+'</div>');element.appendChild(scrollMask[0]);}scrollMask.on('wheel',preventDefault);scrollMask.on('touchmove',preventDefault);return function restoreScroll(){scrollMask.off('wheel');scrollMask.off('touchmove');scrollMask[0].parentNode.removeChild(scrollMask[0]);delete $mdUtil.disableScrollAround._enableScrolling;};function preventDefault(e){e.preventDefault();}}// Converts the body to a position fixed block and translate it to the proper scroll position", "function disableBodyScroll() {\r\n var doc = getDocument();\r\n if (doc && doc.body && !_bodyScrollDisabledCount) {\r\n doc.body.classList.add(DisabledScrollClassName);\r\n doc.body.addEventListener('touchmove', _disableIosBodyScroll, { passive: false, capture: false });\r\n }\r\n _bodyScrollDisabledCount++;\r\n}", "function disableBodyScroll() {\r\n var doc = getDocument();\r\n if (doc && doc.body && !_bodyScrollDisabledCount) {\r\n doc.body.classList.add(DisabledScrollClassName);\r\n doc.body.addEventListener('touchmove', _disableIosBodyScroll, { passive: false, capture: false });\r\n }\r\n _bodyScrollDisabledCount++;\r\n}", "function disableBodyScroll() {\n let htmlNode = body.parentNode;\n let restoreHtmlStyle = htmlNode.getAttribute('style') || '';\n let restoreBodyStyle = body.getAttribute('style') || '';\n let scrollOffset = body.scrollTop + body.parentElement.scrollTop;\n let { clientWidth } = body;\n\n if (body.scrollHeight > body.clientHeight) {\n applyStyles(body, {\n position: 'fixed',\n width: '100%',\n top: `${-scrollOffset}px`\n });\n\n applyStyles(htmlNode, {\n overflowY: 'scroll'\n });\n }\n\n if (body.clientWidth < clientWidth) {\n applyStyles(body, { overflow: 'hidden' });\n }\n\n return function restoreScroll() {\n body.setAttribute('style', restoreBodyStyle);\n htmlNode.setAttribute('style', restoreHtmlStyle);\n body.scrollTop = scrollOffset;\n };\n }", "function disableBodyScroll() {\n var htmlNode = body.parentNode;\n var restoreHtmlStyle = htmlNode.style.cssText || '';\n var restoreBodyStyle = body.style.cssText || '';\n var scrollOffset = $mdUtil.scrollTop(body);\n var clientWidth = body.clientWidth;\n\n if (body.scrollHeight > body.clientHeight + 1) {\n applyStyles(body, {\n position: 'fixed',\n width: '100%',\n top: -scrollOffset + 'px'\n });\n\n applyStyles(htmlNode, {\n overflowY: 'scroll'\n });\n }\n\n if (body.clientWidth < clientWidth) applyStyles(body, {overflow: 'hidden'});\n\n return function restoreScroll() {\n body.style.cssText = restoreBodyStyle;\n htmlNode.style.cssText = restoreHtmlStyle;\n body.scrollTop = scrollOffset;\n htmlNode.scrollTop = scrollOffset;\n };\n }", "function disableBodyScroll() {\n var htmlNode = body.parentNode;\n var restoreHtmlStyle = htmlNode.getAttribute('style') || '';\n var restoreBodyStyle = body.getAttribute('style') || '';\n var scrollOffset = $mdUtil.scrollTop(body);\n var clientWidth = body.clientWidth;\n\n if (body.scrollHeight > body.clientHeight) {\n applyStyles(body, {\n position: 'fixed',\n width: '100%',\n top: -scrollOffset + 'px'\n });\n\n applyStyles(htmlNode, {\n overflowY: 'scroll'\n });\n }\n\n if (body.clientWidth < clientWidth) applyStyles(body, {overflow: 'hidden'});\n\n return function restoreScroll() {\n body.setAttribute('style', restoreBodyStyle);\n htmlNode.setAttribute('style', restoreHtmlStyle);\n body.scrollTop = scrollOffset;\n };\n }", "function disableElementScroll(element) {\n element = angular.element(element || body);\n\n var scrollMask;\n\n if (options.disableScrollMask) {\n scrollMask = element;\n } else {\n scrollMask = angular.element(\n '<div class=\"md-scroll-mask\">' +\n ' <div class=\"md-scroll-mask-bar\"></div>' +\n '</div>');\n element.append(scrollMask);\n }\n\n scrollMask.on('wheel', preventDefault);\n scrollMask.on('touchmove', preventDefault);\n\n return function restoreElementScroll() {\n scrollMask.off('wheel');\n scrollMask.off('touchmove');\n\n if (!options.disableScrollMask && scrollMask[0].parentNode) {\n scrollMask[0].parentNode.removeChild(scrollMask[0]);\n }\n };\n\n function preventDefault(e) {\n e.preventDefault();\n }\n }", "function disableBodyScroll() {\n var htmlNode = body.parentNode;\n var restoreHtmlStyle = htmlNode.style.cssText || '';\n var restoreBodyStyle = body.style.cssText || '';\n var scrollOffset = $mdUtil.scrollTop(body);\n var clientWidth = body.clientWidth;\n\n if (body.scrollHeight > body.clientHeight + 1) {\n applyStyles(body, {\n position: 'fixed',\n width: '100%',\n top: -scrollOffset + 'px'\n });\n\n htmlNode.style.overflowY = 'scroll';\n }\n\n if (body.clientWidth < clientWidth) applyStyles(body, {overflow: 'hidden'});\n\n return function restoreScroll() {\n body.style.cssText = restoreBodyStyle;\n htmlNode.style.cssText = restoreHtmlStyle;\n body.scrollTop = scrollOffset;\n htmlNode.scrollTop = scrollOffset;\n };\n }" ]
[ "0.7802953", "0.7802953", "0.7754712", "0.7754712", "0.76643085", "0.76616085", "0.76412237", "0.76412237", "0.75906134", "0.75863", "0.7559726", "0.75518143", "0.751002", "0.74728215", "0.73956966", "0.7394975", "0.7326676", "0.7179368", "0.717164", "0.71296954", "0.71157813", "0.7111506", "0.71018416", "0.70671827", "0.7053981", "0.70521283", "0.70231116", "0.7022218", "0.70200896", "0.70131886", "0.70112705", "0.70112705", "0.70112705", "0.7007043", "0.70003015", "0.69717103", "0.6924344", "0.6924344", "0.6924344", "0.6922803", "0.69085526", "0.6899024", "0.6885964", "0.68851286", "0.68692285", "0.6856928", "0.68516195", "0.6840515", "0.6838114", "0.68254584", "0.6818933", "0.6801507", "0.67786187", "0.67750233", "0.673503", "0.6731745", "0.6715089", "0.6702579", "0.6697002", "0.6692056", "0.6689203", "0.6674983", "0.66732144", "0.666041", "0.66397816", "0.66384494", "0.66384494", "0.66324925", "0.66305476", "0.66223645", "0.66223645", "0.6619776", "0.6613821", "0.6604006", "0.66018856", "0.6601805", "0.65884334", "0.65845543", "0.65795743", "0.6575596", "0.6563445", "0.6561975", "0.65558004", "0.65558004", "0.6555682", "0.6555682", "0.6538291", "0.6535228", "0.6523942", "0.65082645", "0.6506692", "0.64901054", "0.64776874", "0.64762646", "0.64762646", "0.647552", "0.64708173", "0.64614505", "0.64537156", "0.64412165" ]
0.7503821
13
function for totaling IN OUT TOT and appending them
function addUpTotals(mycourse, teeIndex) { for(let i = 0; i < mycourse.length; i++) { if (i <= 8) { totalYardsIn += Number(mycourse[i].teeBoxes[teeIndex].yards); totalParIn += Number(mycourse[i].teeBoxes[teeIndex].par); totalHCPIn += Number(mycourse[i].teeBoxes[teeIndex].hcp); } if (i < mycourse.length && i >= 9) { totalYardsOut += Number(mycourse[i].teeBoxes[teeIndex].yards); totalParOut += Number(mycourse[i].teeBoxes[teeIndex].par); totalHCPOut += Number(mycourse[i].teeBoxes[teeIndex].hcp); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getStakeOutsTotal() {\n let val = new bn_js_1.default(0);\n for (let i = 0; i < this.stakeOuts.length; i++) {\n val = val.add(this.stakeOuts[i].getOutput().getAmount());\n }\n return val;\n }", "function callTotal() {\n var totRow = document.getElementById('timeTot');\n\n // Make sure our row is empty\n while (totRow.lastChild) {\n totRow.removeChild(totRow.lastChild);\n }\n\n var totLabel = document.createElement('th');\n totLabel.textContent = 'Hourly Totals';\n totRow.appendChild(totLabel);\n\n var grandTotal = 0;\n\n for (var k = 0; k < hours.length - 1; k++) {\n\n var currentHour = hours[k]; // e.g. \"8:00AM\";\n var currentHourSales = [];\n\n for (var l = 0; l < data.length; l++) {\n var currentStore = data[l];\n currentHourSales.push(currentStore.sales[currentHour]);\n }\n\n // currentHourSales.push(pike.stats[k], seaTac.stats[k], seaCtr.stats[k], capHill.stats[k], alki.stats[k]);\n\n var sum = currentHourSales.reduce(function (a, b) { return a + b; }, 0);\n grandTotal += sum;\n\n var tot = document.createElement('td');\n tot.textContent = Math.round(sum);\n totRow.appendChild(tot);\n domTable.appendChild(totRow);\n }\n //var allTots = [];\n //allTots.push(pike.sums, seaTac.sums, seaCtr.sums, capHill.sums, alki.sums);\n\n //console.log('parseint' + allTots);\n //var sums = parseInt(allTots[0]) + parseInt(allTots[1]) + parseInt(allTots[2]) + parseInt(allTots[3]) + parseInt(allTots[4]);\n\n //console.log(sums);\n\n var grandTotalElement = document.createElement('td');\n grandTotalElement.textContent = Math.round(grandTotal);\n totRow.appendChild(grandTotalElement);\n}", "total (itens) {\n prod1 = list[0].amount\n prod2 = list[1].amount\n prod3 = list[2].amount\n prod4 = list[3].amount\n\n itens = prod1 + prod2 + prod3 + prod4\n\n return itens\n }", "function totalcalc() {\n let total = 1299 + rmemory + ssd + deli;\n return total;;\n}", "function totals_row_maker(datasets) {\n var total_cost = $scope.total_order_cost;\n var total_quant = 0;\n var total_scrap = $scope.total_order_scrap + '\\\"';\n for (var prop in datasets) {\n total_quant += datasets[prop][1];\n }\n $('#summary').append('<tfoot class=\"totals-row\"><tr><th class=\"total-cell\">Totals:</th><td class=\"total-cell\">' + total_quant + '</td><td class=\"total-cell\">' + total_cost + '</td><td class=\"total-cell\">' + total_scrap + '</td></tr></tfoot>');\n }", "function appendTotals(inputs) {\n\tvar input = _.clone(inputs);\n\tvar total={};\n\t\n\ttotal.totalsales = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('summary')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.sales)+init;},0)\n\t\t\t\t\t .value())\n\t;\n\n\ttotal.totaltransactions=_(input.list).chain()\n\t .pluck('summary')\n\t .reduce(function(init,item){ return Number(item.numberoftransactions)+init;},0)\n\t .value();\n\ttotal.totaltax1 = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('summary')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.tax1)+init;},0)\n\t\t\t\t\t .value());\n\ttotal.totaltax3 = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('summary')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.tax3)+init;},0)\n\t\t\t\t\t .value());\n\ttotal.totaltotalsales = currency_format(_(input.list).chain()\n\t\t\t\t\t\t.pluck('summary')\n\t\t\t\t\t\t.reduce(function(init,item){ return Number(item.totalsales)+init;},0)\n\t\t\t\t\t\t.value());\n\ttotal.totalcash = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('summary')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.cash)+init;},0)\n\t\t\t\t\t .value());\n\ttotal.totalcredit = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('summary')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.credit)+init;},0)\n\t\t\t\t\t .value());\n\ttotal.totaldebit = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('summary')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.debit)+init;},0)\n\t\t\t\t\t .value());\n\ttotal.totalmobile = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('summary')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.mobile)+init;},0)\n\t\t\t\t\t .value());\n\ttotal.totalother = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('summary')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.other)+init;},0)\n\t\t\t\t\t .value());\n\tinput.total = total;\n\treturn input;\n }", "function getTotalData(){\r\n\t \t\t var totalUnitData = 0;\r\n\t \t\t for (var i=0; i<unitValues.length;i++){\r\n\t \t\t\t totalUnitData += unitValues[i]; \r\n\t \t\t }\r\n\t \t\t return totalUnitData;\r\n\t \t }", "function dataTotal(v) {\n\tvar vT = 0;\n\tfor(var i=0, len=v.length; i<len; i++) {\n\t\tvT += v[i];\n\t}\n\treturn vT;\n}", "calculateTotals(data) {\n let calculate = (acc, current) => acc + current;\n let total = data.reduce(calculate);\n return total;\n }", "function calculateTotal() {\n calculateSubtotals();\n for (var x in subtotal) {\n preuTotal+=subtotal[x].value;\n }\n console.log('Total: '+preuTotal);\n}", "function totalMU(values) {\n\t\t\tif(values === undefined || values.length == 0) return 0;\n\t\t\tvar total = 0;\n\t\t\tfor(var loop = 0; loop < values.length; loop++) total += values[loop].footprint;\n\t\t\treturn total;\n\t\t}", "function totalTotalSum(){\n totalTurtle = 0;\n for (var i in allStoreTotals){\n totalTurtle += allStoreTotals[i];\n }\n}", "function appendTotal(table) {\n\tvar priceRow = document.createElement('tr');\n\ttable.appendChild(priceRow);\n\tvar totalHeading = document.createElement('th');\n\ttotalHeading.setAttribute('colspan', '2');\n\ttotalHeading.innerText = 'Total';\n\tpriceRow.appendChild(totalHeading);\n\tvar totalRow = document.createElement('tr');\n\tvar totalCell = document.createElement('td');\n\ttotalCell.innerText = total();\n\ttotalCell.setAttribute('colspan', '2');\n\ttotalRow.appendChild(totalCell);\n\ttable.appendChild(totalRow);\n}", "function CalculateAllTotals() {\n //use temp variables to prevent multiple dom updates\n var wt = 0;\n var dt = 0;\n var gt = 0;\n for (var i = 0; i < vm.territorySalesNumbers.length; i++) {\n wt += vm.territoryWritten[i];\n dt += vm.territoryDelivered[i];\n gt += vm.goals[i];\n }\n\n vm.writtenTotal = Round(wt, 2);\n vm.deliveredTotal = Round(dt, 2);\n vm.goalsTotal = Round(gt, 2);\n vm.goalsWrittenDifference = Round(vm.writtenTotal - vm.goalsTotal, 2);\n\n if (vm.goalsWrittenDifference > 0)\n vm.goalsWrittenDifference = '+' + vm.goalsWrittenDifference;\n\n }", "function calcAll() {\n let subTotal = 0;\n [...cart.children].forEach(product => subTotal += updateSubtot(product));\n document.querySelector('h2 > span').innerHTML = subTotal;\n}", "function totalsIntakeSpace(ov){\n\tvar maxsp=0, ops = \"\";\n\tov.map((il)=>{\t\n\t\tif(il.tl > maxsp){\n\t\t\tmaxsp = il.tl;\n\t\t}\n\t});\n\treturn ov.reduce((ops, il)=>{\n\t\t\treturn ops += \til.ind + \" \" +\n\t\t\t\t\t\t\til.alg + \" \".repeat(maxsp - il.tl + 1) + \n\t\t\t\t\t\t\til.sub + \": \" +\n\t\t\t\t\t\t\tMath.round(parseFloat(il.qty) * 100) / 100 + \"\\n\";\n\n\t}, \"\");\n}", "function appendTotal (){\n activities.appendChild(totalLabel);\n}", "function calcTotalTotal() {\n totalTotal = 0;\n for (var i = 0; i < hours.length; i++) {\n totalTotal += combinedHourlyCookies[i];\n }\n}", "function calculateAllTotals() {\n\tfor (var i = 0; i < sumSlots.length; i++) {\n\t\tsumStatTotal(sumSlots[i]);\n\t}\n\t\n\tif ($(\"#wep\").find(\".ticks\").val() != \"\") {\n\t\t$(\"#total\").find(\".ticks\").val($(\"#wep\").find(\".ticks\").val());\n\t}\n}", "function tableTotals(){\n let cookieTotals = [];\n for (let i=0; i < shopLocations.length; i++){\n let currentShop = shopLocations[i];\n for (let j = 0; j < currentShop.todaySales.length; j++){\n if (!cookieTotals[j]){cookieTotals[j] = 0;}\n cookieTotals[j] += currentShop.todaySales[j][2];\n }\n }\n\n let parentEl = document.getElementById('Totals');\n let totalText = 'Totals';\n newChildNode(parentEl, 'th', totalText);\n for (let i = 0; i < cookieTotals.length; i++){\n let text = cookieTotals[i];\n newChildNode(parentEl, 'td', text);\n }\n}", "function getTotal(){\n\t\t\treturn total;\n\t\t}", "function createTotalTable(){\n\t// console.log(\"\\n---------- CREATING TOTAL TABLE ----------\");\n\tvar cDiv = $(\".blockTotal table\");\n\tvar html = [];\n\t// console.log(\"table : \");\n\t// console.log(cDiv);\n\thtml.push('<thead><th>MONEDA</th><th>+</th><th>-</th><th>TOTAL</th></thead><tbody>');\n\t$.each(curArr,function(i,v){\n\t\thtml.push('<tr><td class=\"totCur '+v+'\">'+v+'</td><td class=\"pos '+v+'\">---</td><td class=\"neg '+v+'\">---</td><th class=\"tot '+v+'\">---</th></tr>');\n\t});\n\thtml.push('</tbody>');\n\thtml.push('<tfoot><td>');\n\thtml.push('<div class=\"input-group-btn\">\\\n\t\t <button type=\"button\" class=\"btn btn-default dropdown-toggle\" data-toggle=\"dropdown\" align=\"left\">\\\n\t\t\t<span class=\"targetDropdown curTotal curChoice in\" id=\"inCuIn\"></span>\\\n\t\t\t<span class=\"caret\"></span>\\\n\t\t </button>\\\n\t\t <ul class=\"dropdown-menu\">\\\n\t\t </ul>\\\n\t\t </div>');\n\thtml.push('</td><th class=\"pos total\">---</th><th class=\"neg total\">---</th><th class=\"tot total\">---</th></tfoot>');\n\tcDiv.append(html.join(''));\n\t// console.log(\"\\n---------- END CREATING TOTAL TABLE ----------\");\n}", "function calculerTotal(){ \r\n var total = 0\r\n for (var i in achats) {\r\n total = total + achats[i].nbre*achats[i].prix;\r\n }\r\n setElem(\"tot\", total.toFixed(2));\r\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}", "function Total(data) {\n var total = 0\n angular.forEach(data, function(value) {\n total += value;\n })\n return total;\n }", "function dataTableTotal(){\n console.log(table.page.info());\n let startPage = table.page.info().start;\n let endPage = table.page.info().end;\n let totalHarga = 0;\n let totalData = parseInt(table.page.info().end - table.page.info().start);\n // console.log(table.page.info().start);\n for (let i = startPage; i < endPage; i++) {\n row = table.rows(i).data();\n // Karena kolom 5 menyesuaikan dengan kolom didatatable, untuk 0 adalah data dari dalam datatable\n totalHarga += convertRupiahToNumber(row[0][6]) * row[0][5];\n }\n\n $('#totalPage').html(totalData);\n $('#totalHarga').html(convertNumberToRupiah(totalHarga));\n\n }", "function calcTotal (taxTot, shipTot, subTot) {\n taxTot = parseFloat(taxTot);\n shipTot = parseFloat(shipTot);\n subTot = parseFloat(subTot);\n console.log(\"in calcTotal\");\n total = (subTot + taxTot + shipTot);\n total = total.toFixed(2);\n document.getElementById(\"total\").innerHTML = \"Total: $\" + total;\n // Update Total in Table\n}", "function createFooter() {\n let footerEL = document.createElement('tfoot');\n let tdEL = document.createElement('td');\n\n tdEL.textContent='Totals'\n\n footerEL.appendChild(tdEL);\n tableEL.appendChild(footerEL)\n\n let maintotal = 0\n\n for(let i=0 ; i <hours.length ; i++){\n let summ = 0;\n let tdel = document.createElement('td');\n for(let j = 0 ; j < shopss.length ; j++){\n summ = summ + shopss[j].avgCookiesPerH[i]\n \n console.log(summ);\n }\n maintotal+=summ;\n tdel.textContent = summ ;\n footerEL.appendChild(tdel);\n }\n let totaltd = document.createElement('td')\n totaltd.textContent = maintotal;\n footerEL.appendChild(totaltd)\n\n}", "function IndicadorTotal () {}", "function addTotal(arr){\n arr.forEach(function(ele){\n let total=0;\n total=ele.science+ele.maths+ele.english\n ele.total=total;\n })\n }", "function sum(self) { return self.leftFoot + self.rightFoot; }", "function muestroTotalProductos() {\r\n var subTotalCompleto = 0;\r\n subTotalCompletoImporte = 0;\r\n if ($('.articuloDeLista').length > 0) {\r\n $('.articuloDeLista').each(function () {\r\n subTotalCompleto = parseFloat($(this).children('.productSubtotal').text());\r\n subTotalCompletoImporte += subTotalCompleto;\r\n document.getElementById(\"productCostText\").innerHTML = subTotalCompletoImporte;\r\n });\r\n }\r\n }", "function fn_total(row) {\n var total = 0.0;\n for (var i = 0; i < row; i++) {\n if ($(\"#cbo-enfoque\").val() == 1) {\n if ($(\"#txt-det-7-\" + (i + 1)).val() != '') {\n total += parseFloat($(\"#txt-det-7-\" + (i + 1)).val());\n }\n } else if ($(\"#cbo-enfoque\").val() == 2) {\n if ($(\"#txt-det-8-\" + (i + 1)).val() != '') {\n total += parseFloat($(\"#txt-det-8-\" + (i + 1)).val());\n }\n } else if ($(\"#cbo-enfoque\").val() == 3) {\n if ($(\"#txt-det-5-\" + (i + 1)).val() != '') {\n total += parseFloat($(\"#txt-det-5-\" + (i + 1)).val());\n }\n } else if ($(\"#cbo-enfoque\").val() == 4) {\n if ($(\"#txt-det-6-\" + (i + 1)).val() != '') {\n total += parseFloat($(\"#txt-det-6-\" + (i + 1)).val());\n }\n }\n }\n $(\"#cuerpoTablaIndicador\").data(\"total\", total);\n $(\"#total-detalle\").html(\"\");\n $(\"#total-detalle\").append((Math.round(total * 100) / 100));\n //$(\"#total-detalle2\").html(\"\");\n //$(\"#total-detalle2\").append((Math.round(total * 100) / 100));\n}", "function makeTotalRow(tableElement){\n //compute total per hour of all locations\n hourlyTotal = calculateHourlyTotal();\n //add total\n tableElement.append(makeTableRow('Totals', hourlyTotal, getSum(hourlyTotal) ));\n}", "function appetize(total){\n\n}", "function calculateTotal(section) {\n return section.length && section.filter(a => a && a.length !== null && !a.error).reduce((a, b) => ({\n value: unformatted(a.value) + unformatted(b.value)\n })).value\n}", "function totales()\n{\n var subtotal = 0;\n var total = 0.00;\n var totalcantidad = 0;\n var subcantidad = 0;\n var total_dinero = 0;\n var total_cantidad = 0;\n var sub_exento=0;\n $(\"#inventable>tbody tr\").each(function()\n {\n var compra = $(this).find(\".precio_compra\").val();\n var unidad = $(this).find(\".unidad\").val();\n var venta = $(this).find(\".precio_venta\").val();\n var cantidad = parseInt($(this).find(\".cant\").val());\n var vence = $(this).find(\".vence\").val();\n var exento = parseInt($(this).find(\".exento\").val());\n console.log(cantidad);\n if (isNaN(cantidad) == true)\n {\n cantidad = 0;\n }\n subtotal = compra * cantidad;\n\n totalcantidad += cantidad;\n if (isNaN(subtotal) == true)\n {\n subtotal = 0;\n }\n\n if(exento==1)\n {\n sub_exento=sub_exento+subtotal;\n }\n else\n {\n total += subtotal;\n }\n\n });\n if (isNaN(total) == true)\n {\n total = 0;\n }\n sumas_sin_iva=total;\n sumas_sin_iva=round(total, 2);\n\n if(isNaN(sub_exento))\n {\n sub_exento=0;\n }\n\n tipo_doc=$('#tipo_doc').val();\n\n percepcion = $('#percepcion').val();\n\n var monto_percepcion = $('#monto_percepcion').val();\n var iva = $('#porc_iva').val();\n\n total_percepcion=0;\n iva = round((total * iva), 4);\n sub_exento = round(sub_exento, 2);\n\n if (total >= monto_percepcion)\n total_percepcion = round((total * percepcion), 4);\n\n total += total_percepcion;\n if(tipo_doc=='CCF')\n {\n total += iva;\n }\n else\n {\n iva=0;\n\n }\n\n\n total+= sub_exento;\n total_dinero =parseFloat(total).toFixed(2);\n /*if(total_dinero=='0'){\n total_dinero=\"0.00\";\n }else{\n total_dinero=total_dinero =parseFloat(total).toFixed(2);;\n }*/\n total_cantidad = round(totalcantidad,2);\n $('#totcant').html(total_cantidad);\n $('#sumas_sin_iva').html(round(sumas_sin_iva,2));\n $('#subtotal').html(round((sumas_sin_iva+iva), 2));\n $('#iva').html(round(iva,2));\n $('#venta_exenta').html(sub_exento);\n $('#total_percepcion').html(round(total_percepcion, 2));\n $('#total_dinero').html(total_dinero);\n $('#totaltexto').load('compras.php?' + 'process=total_texto&total=' + total_dinero);\n}", "function getMoney() {\n\t$('entries').apend('<tr><th></th><thd>') + total + '</td></tr>'();\n}", "function totalOrder() {\n var salePriceTotal = 0,\n laborPriceTotal = 0,\n shopSupplies = 0,\n hazardMaterials = 0,\n taxableAmount = 0,\n extras = 0,\n SHOP_SUPPLIES_CAP = 19.73,\n HAZARD_MATERIALS_CAP = 19.73,\n length = $scope.parts.length,\n parts = $scope.parts,\n i = 0;\n\n for (i = 0; i < length; i++) {\n hazardMaterials += parts[i].salePriceTotal * 0.06;\n shopSupplies += parts[i].laborPrice * 0.06;\n salePriceTotal += parts[i].salePriceTotal;\n laborPriceTotal += parts[i].laborPrice;\n }\n if (hazardMaterials > HAZARD_MATERIALS_CAP) {\n hazardMaterials = HAZARD_MATERIALS_CAP;\n }\n if (shopSupplies > SHOP_SUPPLIES_CAP) {\n shopSupplies = SHOP_SUPPLIES_CAP;\n }\n if (!$scope.parts.noExtras) {\n extras = hazardMaterials + shopSupplies;\n }\n taxableAmount = salePriceTotal + extras;\n $scope.parts.subTotal = salePriceTotal + laborPriceTotal;\n $scope.parts.tax = taxableAmount * 0.06;\n $scope.parts.total = (taxableAmount * 1.06) + laborPriceTotal;\n $scope.parts.hazardMaterials = hazardMaterials;\n $scope.parts.shopSupplies = shopSupplies;\n }", "function fnAlltotal(){\n console.log(\"TOTAL hit\")\n var subTotal=0;\n\n $(\".amount\").each(function(){\n subTotal += parseFloat($(this).val()||0);\n });\n\n \n final.subTotal = subTotal\n final.total = subTotal\n $('#td-subtotal').html(( final.subTotal).toFixed(3)); \n $('#td-total').html(( final.total).toFixed(3) - lead['discount'].toFixed(3));\n}", "function createFooter() {\n\n let trfooEl =document.createElement('tr');\n let tdEl=document.createElement('td');\n tdEl.textContent = 'Totals';\n trfooEl.appendChild(tdEl);\n tableEl.appendChild(trfooEl);\n let megaTotal = 0;\n\n for (let h=0 ; h < openhours.length ; h++ ) {\n\n let tdEl=document.createElement('td');\n let sum=0;\n \n for (let s=0 ; s < locations.length ; s++){\n\n\n sum = sum + locations[s].cookiesinhour[h];\n\n }\n megaTotal += sum;\n tdEl.textContent = sum;\n trfooEl.appendChild(tdEl);\n\n }\n let totalTdEl = document.createElement('td');\n totalTdEl.textContent = megaTotal;\n trfooEl.appendChild(totalTdEl);\n }", "function addTotals(ind, finTimer){\n var compare = finTimer.date;\n var compareWeek = getWeekStart(compare);\n // check if timer finished in the same day as stored today - update day total \n if( compareDay(compare, statsinfo.today )){\n statsinfo.todayTotal += finTimer.time;\n }\n else{\n /* create new day */\n createToday();\n /* total just finished timer */\n statsinfo.todayTotal = finTimer.time;\n }\n // check if timer finished in the same day as stored today - update week total\n if( compareDay(compareWeek, statsinfo.week )){\n statsinfo.weekTotal += finTimer.time;\n }\n else{\n createToday();\n statsinfo.weekTotal = finTimer.time;\n }\n\n /* always add to total */\n statsinfo.total += finTimer.time;\n\n /* update displays */\n updateStatDisplay();\n\n \n}", "calcTotal(){\n\t\t\tlet length = this.sales.length;\n\t\t\tthis.paidCommissionTotal = 0;\n\t\t\tthis.commissionTotal = 0;\n\t\t\tfor(let i = 0; i < length; ++i){\n\t\t\t\t\tthis.commissionTotal += this.sales[i].commission;\n\t\t\t\t\tif(this.sales[i].paid == true){\n\t\t\t\t\t\tthis.paidCommissionTotal += this.sales[i].commission;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tthis.sales.length;\n\t\t}", "function total(index) {\n\n var total = 0\n matrix[index].forEach(element => {\n total += element\n })\n return total; \n\n }", "function total() {\n var outputData = outputSheet.getDataRange().getValues();\n var inputSheet = ss.getSheetByName('data entry'); // this is the name of the input sheet tab\n var emptyRow = outputData.length + 1;\n var count = [];\n var title = [];\n \n for (var i=1;i<20;i+=6) { //this is rows\n for (var j=1;j<8;j+=2) { //this is columns\n var label = inputSheet.getRange(i+1,j).getValue();\n var value = inputSheet.getRange(i,j).getValue();\n if (label != \"\") {\n count.push(value);\n title.push(label);\n }\n inputSheet.getRange(i,j).setValue('0'); //resets the counter to 0\n }\n }\n saveOutput(emptyRow,count,title);\n}", "function footerRow() {\n let tr = document.createElement('tr');\n table.appendChild(tr);\n let th = document.createElement('th');\n tr.appendChild(th);\n th.textContent = 'Total';\n\n /*\n let thTotal = document.createElement('th');\n tr.appendChild(thTotal)\n thTotal.textContent='Totals';\n */\n\n let sum;\n let megaTotal = 0;\n for (let i = 0; i < hourWork.length; i++) {\n sum = 0;\n\n for (let j = 0; j < arr.length; j++) {\n\n sum = sum + arr[j].arrcookiesPerHour[i];\n\n }\n\n megaTotal = megaTotal + sum;\n th = document.createElement('th');\n tr.appendChild(th);\n th.textContent = sum;\n }\n let Ttotal = document.createElement('th');\n tr.appendChild(Ttotal);\n Ttotal.textContent = megaTotal;\n\n\n}", "function totalFooter() {\n var updateFooter = document.getElementById('hourly-totals');\n if (updateFooter) {\n updateFooter.parentNode.removeChild(updateFooter);\n }\n var tableFoot = document.createElement('tfoot');\n tableFoot.setAttribute('id', 'hourly-totals');\n var cookieTable = document.getElementById('cookie-table');\n cookieTable.appendChild(tableFoot);\n var hourlyTotals = document.getElementById('hourly-totals');\n var firstFoot = document.createElement('th');\n firstFoot.textContent = 'Total';\n hourlyTotals.appendChild(firstFoot);\n var grandTotal = 0;\n for (var i = 0; i < eachHour.length; i++) {\n var footerTotals = document.createElement('td');\n footerTotals.textContent = eachHour[i];\n hourlyTotals.appendChild(footerTotals);\n grandTotal += eachHour[i];\n }\n var finalFoot = document.createElement('td');\n finalFoot.textContent = grandTotal;\n tableFoot.appendChild(finalFoot);\n}", "function makeTotal() {\n\tvar $tr = $(\"<tr>\").attr(\"id\", \"total\");\n\tvar $symbol = $(\"<td>\").html(\"\");\n\tvar $name = $(\"<td>\").html(\"<b>Total</b>\");\n\tvar $ticks = $(\"<td>\").append($('<input class=\"ticks\" size=\"5\">'));\n\tvar $str = $(\"<td>\").append($('<input class=\"str\" size=\"5\">'));\n\tvar $st = $(\"<td>\").append($('<input class=\"st\" size=\"5\">'));\n\tvar $sl = $(\"<td>\").append($('<input class=\"sl\" size=\"5\">'));\n\tvar $cr = $(\"<td>\").append($('<input class=\"cr\" size=\"5\">'));\n\tvar $mm = $('<td class=\"mm\" />');\n\tvar $m = $('<td class=\"equipLeftM\">').append($('<input class=\"m\" size=\"5\">'));\n\tvar $ma = $('<td class=\"equipRightM\">').append($('<input class=\"ma\" size=\"5\">'));\n\tvar $mr = $('<td class=\"mr\" />');\n\tvar $r = $('<td class=\"equipLeftR\">').append($('<input class=\"r\" size=\"5\">'));\n\tvar $ra = $('<td class=\"equipRightR\">').append($('<input class=\"ra\" size=\"5\">'));\n\t\n\t$tr.append($symbol, $name, $ticks, $str, $st, $sl, $cr, $mm, $m, $ma, $mr, $r, $ra);\n\t$(\"#equipment\").append($tr);\n\t\n\tupdateTotal();\n}", "function calculateGrandTotal() {\n\n var GrandTotal = 0;\n self.selectItems.forEach(function (item) {\n GrandTotal += item.co2_offset;\n self.Co2GrandTotal=Math.floor(GrandTotal * 10000)/10000;\n });\n }", "function addTotalToTable(){\n let newTotalRow = buildTotalRow();\n document.getElementsByTagName(\"tbody\")[0].appendChild(newTotalRow);\n}", "function getTotals(refs) {\n frefs.reduce(getSum); //Getting the sum of refugees year wise\n console.log(total);\n\n }", "function sumaSubTotales(){\n\n\tvar subTotales = $(\"#subTotales span\");\n\n\tvar arraySumaSubTotales=[];\n\n\tfor(var i=0;i<subTotales.length;i++){\n\n\t\tvar subTotalesArray = $(subTotales[i]).html();\n\n\t\tarraySumaSubTotales.push(Number(subTotalesArray));\t\n\n\t}\n\n\tfunction sumaArraySubtotales(total,numero){\n\n\t\treturn total+numero;\n\t}\n\n\tvar sumaTotal = arraySumaSubTotales.reduce(sumaArraySubtotales);\n\n\t$(\".sumaSubTotal span\").html(sumaTotal);\n\n\t$(\".sumaCesta\").html(sumaTotal);\n\n\tlocalStorage.setItem(\"sumaCesta\",sumaTotal);\n\n}", "function calTotal() {\n var ttotal = 0;\n var total = \"\"\n // totalDiv.innerHTML =total\n for (var x = 0; x < cart.length; x++) {\n var skuu = cart[x].sku;\n // console.log(skuu)\n var cat = cart[x].categoryId\n // console.log(cat)\n var pret;\n\n // console.log(pret)\n for (var j = 0; j < products[cat].length; j++) {\n // console.log(products[cat][j])\n if (products[cat][j].sku == skuu) {\n pret = products[cat][j].price;\n // console.log(pret)\n // console.log(pret)\n\n ttotal += pret * cart[x].qty\n //console.log(\"ttotal= \"+ttotal)\n }\n }\n }\n totalDiv.innerHTML = \"total = \" + ttotal + \" lei\";\n }", "function addTotal() {\n let parTotal = 0;\n let totalScore = 0;\n let overTotal = 0;\n\n for (let i = 1; i < rows.length - 1; i++) {\n let par = elem[i].children[1].innerHTML;\n let score = elem[i].children[2].innerHTML;\n let over = elem[i].children[3].innerHTML;\n\n if (isNaN(score)) {\n parTotal += 0;\n totalScore += 0;\n overTotal += 0;\n } else {\n parTotal += parseInt(par);\n totalScore += parseInt(score);\n overTotal += parseInt(over);\n }\n }\n\n if (totalScore == 0 && parTotal == 0 && overTotal == 0) {\n rows[19].children[1].innerText = \"-\";\n rows[19].children[2].innerText = \"-\";\n rows[19].children[3].innerText = \"-\";\n } else {\n rows[19].children[1].innerText = parTotal;\n rows[19].children[2].innerText = totalScore;\n rows[19].children[3].innerText = overTotal;\n }\n}", "function addTotal(){\n const currentList = getCurrentList();\n if ('Celkem' in currentList) return;\n const ss = getSpreadSheet(LIST_SHEET);\n const lastRow = ss.getLastRow() + 1;\n var listRange = ss.getRange(lastRow,1,1,3);\n \n var total = 0;\n for(var item in currentList) {\n total += currentList[item][0] * currentList[item][1];\n }\n\n listRange.getCell(1, 1).setValue(TOTAL_STR);\n listRange.getCell(1, 3).setValue(total);\n}", "function format(invoices) {\n var invoice\n var invoiceTotal\n var text\n for (var i = 0; i < invoices.length; i++) {\n invoice = invoices[i]\n invoiceTotal = invoice.reduce(function (total, transaction) {\n return roundTo(total + transaction.AMOUNT, 5)\n }, 0)\n text = \"\"\n text += 'TRNS\\t\"' + invoice[0].TRNSTYPE + '\"\\t\"' + invoice[0].DATE + '\"\\t\"' + invoice[0].ACCNT + '\"\\t\"' + invoice[0].NAME + '\"\\t\"'\n + invoice[0].CLASS + '\"\\t\"' + invoiceTotal + '\"\\t\"' + invoice[0].transactionMEMO + '\"\\n'\n for (var j = 0; j < invoice.length; j++) {\n var transaction = invoice[j]\n text += 'SPL\\t\"' + transaction.TRNSTYPE + '\"\\t\"' + transaction.DATE + '\"\\t\"' + transaction.secondaryACCNT + '\"\\t\"' + transaction.NAME + '\"\\t\"'\n + transaction.CLASS + '\"\\t\"' + -1 * transaction.AMOUNT + '\"\\t\"' + transaction.MEMO + '\"\\t\"' + -1 * transaction.QNTY + '\"\\t\"' + transaction.PRICE + '\"\\n'\n /* + '\"\\t\"' + transaction.INVITEM + '\"\\t\"' + transaction.TAXABLE + '\"\\t\"' + transaction.REIMBEXP*/\n }\n text += \"ENDTRNS\\n\"\n fs.appendFileSync(destination, text)\n }\n}", "function getTotals(table){\n var totals = [];\n for (var i = 0; i < (hours.length + 1); i++) {\n var hourlyTotal = 0;\n for(var j = 0; j < allLocationObjects.length; j++) {\n if (table === 'cookieChart'){\n hourlyTotal += allLocationObjects[j].cookieArray[i];\n } else if (table === 'cookieStaff') {\n hourlyTotal += allLocationObjects[j].staffNeededArray[i];\n }\n }\n totals.push(hourlyTotal);\n }\n return totals;\n}", "function calcTotals() {\n var incomes = 0;\n var expenses = 0;\n var budget;\n // calculate total income\n data.allItems.inc.forEach(function(item) {\n incomes+= item.value;\n })\n //calculate total expenses\n data.allItems.exp.forEach(function(item) {\n expenses+= item.value;\n })\n //calculate total budget\n budget = incomes - expenses;\n // Put them in our data structure\n data.total.exp = expenses;\n data.total.inc = incomes;\n //Set Budget\n data.budget = budget;\n }", "function calcAll() {\n //Variable temporal para hacer la cuenta de los $subtotl2\n let cuenta = 0;\n\n let $subtotl2 = Array.from(document.querySelectorAll('.subtot'));\n let $total = document.querySelector('h2').querySelector('span');\n $subtotl2.forEach(el => {\n cuenta += Number(el.querySelector('span').textContent)\n console.log(el.querySelector('span').textContent)\n });\n $total.innerHTML = cuenta;\n}", "function impostaTotaliInDataTable(totaleStanziamentiEntrata, totaleStanziamentiCassaEntrata, totaleStanziamentiResiduiEntrata, totaleStanziamentiEntrata1, totaleStanziamentiEntrata2,\n \t\ttotaleStanziamentiSpesa, totaleStanziamentiCassaSpesa, totaleStanziamentiResiduiSpesa, totaleStanziamentiSpesa1, totaleStanziamentiSpesa2){\n\n \tvar totaleStanziamentiEntrataNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiEntrata);\n var totaleStanziamentiCassaEntrataNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiCassaEntrata);\n var totaleStanziamentiResiduiEntrataNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiResiduiEntrata);\n //anno = anno bilancio +1\n var totaleStanziamentiEntrata1NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiEntrata1);\n //anno = anno bilancio +2\n var totaleStanziamentiEntrata2NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiEntrata2);\n \n \n var totaleStanziamentiSpesaNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiSpesa);\n var totaleStanziamentiCassaSpesaNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiCassaSpesa);\n var totaleStanziamentiResiduiSpesaNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiResiduiSpesa);\n //anno = anno bilancio +1\n var totaleStanziamentiSpesa1NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiSpesa1);\n //anno = anno bilancio +2\n var totaleStanziamentiSpesa2NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiSpesa2);\n\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCompetenzaVariazione\", totaleStanziamentiEntrataNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateResiduoVariazione\", totaleStanziamentiResiduiEntrataNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCassaVariazione\", totaleStanziamentiCassaEntrataNotUndefined);\n //anno = anno bilancio +1\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCompetenzaVariazioneAnnoPiuUno\", totaleStanziamentiEntrata1NotUndefined);\n //anno = anno bilancio +2\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCompetenzaVariazioneAnnoPiuDue\", totaleStanziamentiEntrata2NotUndefined);\n \n\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCompetenzaVariazione\", totaleStanziamentiSpesaNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCassaVariazione\", totaleStanziamentiCassaSpesaNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseResiduoVariazione\", totaleStanziamentiResiduiSpesaNotUndefined);\n //anno = anno bilancio +1\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCompetenzaVariazioneAnnoPiuUno\", totaleStanziamentiSpesa1NotUndefined);\n //anno = anno bilancio +2\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCompetenzaVariazioneAnnoPiuDue\", totaleStanziamentiSpesa2NotUndefined);\n \n\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCompetenzaVariazione\", (totaleStanziamentiEntrataNotUndefined - totaleStanziamentiSpesaNotUndefined));\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaResiduoVariazione\", (totaleStanziamentiResiduiEntrataNotUndefined - totaleStanziamentiResiduiSpesaNotUndefined));\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCassaVariazione\", (totaleStanziamentiCassaEntrataNotUndefined - totaleStanziamentiCassaSpesaNotUndefined));\n \n //anno = anno bilancio +1\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCompetenzaVariazioneAnnoPiuUno\", (totaleStanziamentiEntrata1NotUndefined - totaleStanziamentiSpesa1NotUndefined));\n //anno = anno bilancio +2\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCompetenzaVariazioneAnnoPiuDue\", (totaleStanziamentiEntrata2NotUndefined - totaleStanziamentiSpesa2NotUndefined));\n }", "function updateTotal() {\n\n}", "function summing() {\n sum = 0\n for (i = 5; i < inpt.length; i = i + 4) {\n //console.log(inpt[i].value)\n if (inpt[i].value == \"\") {\n inpt[i].value = 0;\n }\n sum = sum + parseFloat(inpt[i].value)\n }\n return sum;\n }", "function renderFoot(){\n var hourlySums = [];\n var hourlyTotal = 0;\n var grandTotal = 0;\n\n for (var j=0; j < hours.length; j++){\n hourlyTotal = 0;\n for (var i =0; i < cookStores.length; i++){\n hourlyTotal += cookStores[i].cookiesEachHour[j];\n grandTotal += cookStores[i].cookiesEachHour[j];\n }\n hourlySums.push(hourlyTotal);\n }\n \n var trEl = document.createElement('tr');\n \n var tdElFirst = document.createElement('td');\n tdElFirst.textContent = 'Totals';\n trEl.appendChild(tdElFirst);\n \n for (var i=0; i < hours.length; i++){\n var tdEl = document.createElement('td');\n tdEl.textContent = hourlySums[i];\n trEl.appendChild(tdEl);\n }\n \n var tdElLast = document.createElement('td');\n tdElLast.textContent = grandTotal;\n trEl.appendChild(tdElLast);\n \n cookTable.appendChild(trEl);\n}", "function calculateTotal() {\n let tipPerPerson = (billObj._billAmount * billObj._tipAmount) / billObj._numOfPeople;\n let billPerPerson = billObj._billAmount / billObj._numOfPeople;\n let totalAmount = tipPerPerson + billPerPerson;\n if (isNaN(tipPerPerson) && isNaN(billPerPerson)) {\n return;\n }\n else {\n //This should output to DOM;\n document.querySelector(\".display_tip_value\").innerHTML = tipPerPerson.toFixed(2).toString();\n document.querySelector(\".display_total_value\").innerHTML = totalAmount.toFixed(2).toString();\n }\n ;\n}", "function sumTotal(memId){\t\n\t\tvar loanAccStr=$(\"input[id='\"+memId+\"loanId']\").val();//$(\"#\"+memId+\"loanId\").val();\n\t\tvar savAccStr=$(\"input[id='\"+memId+\"savId']\").val();//$(\"#\"+memId+\"savId\").val();\n\t\t\n\t\tvar loan_array=new Array();\n\t\tvar sav_array=new Array();\n\t\t\n\t\tloan_array=loanAccStr.split('_');\n\t\tsav_array=savAccStr.split('_');\n\t\t\n\t\tvar totalAmtShow=0\n\t\t\n\t\t//---------- Loan\n\t\tvar loanAcc=''\n\t\tvar loanAmt=0\t\t\t\n\t\tvar i=0;\n\t\twhile (i < loan_array.length){\n\t\t\tloanAcc=loan_array[i];\t\t\t\t\t\n\t\t\tloanAmt=$(\"#L\"+loanAcc).val();\n\t\t\t\n\t\t\tif (loanAmt==\"\"){\n\t\t\t\tloanAmt=0;\n\t\t\t}else{\n\t\t\t\tif (isNaN(loanAmt)){\n\t\t\t\t\tloanAmt=0;\n\t\t\t\t}\n\t\t\t\t};\t\t\t\t\t\n\t\t\ttotalAmtShow=totalAmtShow+eval(loanAmt)\t\t\t\t\t\n\t\t\ti=i+1;\n\t\t};\n\t\t//----------- Savings\n\t\tvar savAcc=''\n\t\tvar savAmt=0\t\t\t\n\t\tvar j=0;\n\t\twhile (j < sav_array.length){\n\t\t\tsavAcc=sav_array[j];\t\t\t\t\t\n\t\t\tsavAmt=$(\"#S\"+savAcc).val();\n\t\t\t\n\t\t\tif (savAmt==\"\"){\n\t\t\t\tsavAmt=0;\n\t\t\t}else{\n\t\t\t\tif (isNaN(savAmt)){\n\t\t\t\t\tsavAmt=0;\n\t\t\t\t}\n\t\t\t\t};\t\t\t\t\t\n\t\t\ttotalAmtShow=totalAmtShow+eval(savAmt)\t\t\t\t\t\n\t\t\tj=j+1;\n\t\t};\t\n\t\t//$(\"input[id='\"+memId+\"AMT']\").val(totalAmtShow);\n\t\t$(\"span[id='\"+memId+\"AMT']\").text(totalAmtShow);\n}", "total() {\n var total = 0.0\n for (var sku in this.items) {\n var li = this.items[sku]\n var price = li.quantity * li.price\n total += price\n }\n return total\n }", "function calculateTotal() {\n const phoneTotal = getInputValue('phone') * 1219;\n const caseTotal = getInputValue('case') * 59;\n const subTotal = phoneTotal + caseTotal;\n console.log(subTotal);\n\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}", "computeTotals()\n {\n if (this.file.transactions.length == 0)\n return\n\n this.totalSpendings = this.file.transactions\n .map(x => Math.min(x.amount, 0))\n .reduce((acc, x) => acc + x)\n\n this.totalIncome = this.file.transactions\n .map(x => Math.max(x.amount, 0))\n .reduce((acc, x) => acc + x)\n }", "function totale(price) {\n tot += price;\n }", "function addexptototal()\n {\n const expobj={};\n //read the value of inputamt\n const textamt=inputele.value;\n\n const textdesc=inputele2.value;\n \n //convert it to number\n const exp=parseInt(textamt,10);\n\n expobj.desc=textdesc;\n expobj.amt=textamt;\n expobj.moment=new Date();\n\n allexp.push(expobj);\n \n \n //add that value to totalvalue\n totalexp=totalexp+exp;\n \n hele.textContent=totalexp;\n\n const headingtext=`Total :: ${totalexp}`;\n hele.textContent=headingtext;\n\n renderlist(allexp);\n \n }", "calculateTotal() {\n\t\t//Réinitialise le total\n\t\tthis.total = 0\n\t\tfor (let product of this.products) {\n\t\t\tthis.total += product.price * product.number\n\t\t}\n\t}", "function calcularSubTotal() {\n subTotal = 0;\n if (coleccionProductos.length !== 0) {\n for (let producto of coleccionProductos) {\n subTotal += parseInt(producto.precio) * parseInt(producto.cantidad);\n }\n } else {\n subTotal = 0;\n }\n total = subTotal + precioEnvioGlobal;\n \n spanTotal.innerText = total;\n spanSubTotal.innerText = subTotal;\n}", "function sumaSubtotales(){\n\n\tvar subtotales = $(\".subtotales span\");\n\tvar arraySumaSubtotales = [];\n\t\n\tfor(var i = 0; i < subtotales.length; i++){\n\n\t\tvar subtotalesArray = $(subtotales[i]).html();\n\t\tarraySumaSubtotales.push(Number(subtotalesArray));\n\t\t\n\t}\n\n\t\n\tfunction sumaArraySubtotales(total, numero){\n\n\t\treturn total + numero;\n\n\t}\n\n\tvar sumaTotal = arraySumaSubtotales.reduce(sumaArraySubtotales);\n\t\n\t$(\".sumaSubTotal\").html('<strong>PEN S/. <span>'+(sumaTotal).toFixed(2)+'</span></strong>');\n\n\t$(\".sumaCesta\").html((sumaTotal).toFixed(2));\n\n\tlocalStorage.setItem(\"sumaCesta\", (sumaTotal).toFixed(2));\n\n\n}", "function sumarTotalPrecio(){\n\n\t\t\tvar precioItem = $('.nuevoPrecioProducto');\n\n\t\t\tvar arraySumarPrecio = [];\n\n\t\t\tfor (var i = 0; i < precioItem.length; i++){\n\n\t\t\t\tarraySumarPrecio.push(Number($(precioItem[i]).val()));\n\t\t\t\t\n\n\t\t\t}\n\n\t\t\tfunction sumarArrayPrecio(total, numero){\n\n\t\t\t\treturn total+numero;\n\n\n\t\t\t}\n\n\t\t\tvar sumaTotalPrecio = arraySumarPrecio.reduce(sumarArrayPrecio)\n\t\t\t\n\t\t\t$('#nuevoTotalVenta').val(sumaTotalPrecio);\n\t\t\t$('#totalVenta').val(sumaTotalPrecio);\n\t\t\t$('#nuevoTotalVenta').attr('total', sumaTotalPrecio);\n\t\t}", "function totals(arr){\n\tvar total = 0;\n\tvar t_M = 0;\n\tvar ft_M = 0;\n\tvar f_M = 0;\n\tarr.forEach(function totals(element){\n\t\tt_M += element.threesMade;\n\t\tft_M += element.freeThrowsMade;\n\t\tf_M += element.fieldGoalsMade;\n\t});\n\tf_M -= t_M;\n\tf_M *= 2;\n\tt_M *= 3;\n\ttotal += f_M + t_M + ft_M;\n\treturn total;\n}", "function calculateSubTotal()\n{\n\tvar overallSubtotalTime = 0;\n\tvar overallSubtotalTimeHoursMins = 0;\n\t\n\tfor (var i=0; i < numOfTimeEntries; i++)\n\t{\n\t\t// See if the checkbox on each row is checked or not\n\t\tvar subTotalRowChecked = $('#subTotal' + i).is(':checked');\n\t\t\n\t\tif (subTotalRowChecked)\n\t\t{\n\t\t\t// Get the values from the form\n\t\t\tvar startHour = $('#startHour' + i).val();\n\t\t\tvar startMin = $('#startMin' + i).val();\n\t\t\tvar endHour = $('#endHour' + i).val();\n\t\t\tvar endMin = $('#endMin' + i).val();\t\t\t\n\t\t\tvar timeDifference = 0;\n\t\t\t\n\t\t\t// Make sure all fields are filled out for that row then work out time difference and add to sub total\n\t\t\tif ((startHour != '') && (startMin != '') && (endHour != '') && (endMin != ''))\n\t\t\t{\n\t\t\t\ttimeDifference = calculateTimeDifference(startHour, startMin, endHour, endMin);\t\n\t\t\t}\n\t\t\t\n\t\t\t// Update subtotal\n\t\t\toverallSubtotalTime += timeDifference;\t\t\t\n\t\t}\t\t\n\t}\n\t\n\t// Round to 2dp and format wording\n\toverallSubtotalTime = roundNumber(overallSubtotalTime, 2);\n\toverallSubtotalTime = overallSubtotalTime;\n\toverallSubtotalTimeHoursMins = formatToHoursMins(overallSubtotalTime);\n\t\n\t// Update overall sub total time on page and object\n\t$('#overallSubtotalTime').text(overallSubtotalTime);\t\n\t$('#overallSubtotalTimeHoursMins').text(overallSubtotalTimeHoursMins);\t\n\ttimeStorage['overallSubtotalTime'] = overallSubtotalTime;\n\ttimeStorage['overallSubtotalTimeHoursMins'] = overallSubtotalTimeHoursMins;\n}", "function computeTotal(data, callback){\n var appleSum = 0;\n var tomatoSum = 0;\n data.Items.forEach(function(entry){\n if(entry.offeredGoods.S == 'Tomatoes')\n tomatoSum = (tomatoSum*1 +entry.Capacity.N*1);\n else\n appleSum = (appleSum*1 +entry.Capacity.N*1);\n })\n total = [\n {\"Name\": \"Apples\", \"Quota\": appleSum},\n {\"Name\": \"Tomatoes\", \"Quota\": tomatoSum}\n ]\n callback(total);\n}", "function createFooterTable(){\r\n tfoot =document.createElement('tfoot');\r\n trow=document.createElement('tr');\r\n \r\n let td=document.createElement('th');\r\n td.textContent='Total';\r\n trow.appendChild(td);\r\n let allTotal=0;\r\n for (let i =0 ;i <14 ; i++){\r\n //let element=document.querySelectorAll('tr td:nth-child('+i+')');\r\n totalColumn=0;\r\n for(let r =0 ;r<Location.allLocation.length;r++){\r\n // console.log(element[r].textContent);\r\n // totalColumn+=parseInt(element[r].textContent);\r\n totalColumn+=Location.allLocation[r].resultArr[i];\r\n allTotal+=Location.allLocation[r].resultArr[i];\r\n \r\n }\r\n console.log(totalColumn);\r\n tfooter=document.createElement('td');\r\n tfooter.textContent=totalColumn;\r\n trow.appendChild(tfooter);\r\n\r\n\r\n }\r\n tfooter=document.createElement('th');\r\n tfooter.textContent=allTotal;\r\n trow.appendChild(tfooter);\r\n tfoot.appendChild(trow);\r\n return tfoot;\r\n \r\n}", "function pollTotals()\n{\n totalOfTotals = 0;\n totalOfStaffTotals = 0;\n //Fill string with blank values\n for(var k = 0; k < hours.length; k++)\n {\n var blank = 0;\n hourlyTotal[k] = blank;\n staffTotal[k] = blank;\n }\n for(var i = 0; i < hours.length; i++)\n {\n for(var j = 0; j < locations.length; j++)\n {\n hourlyTotal[i] = hourlyTotal[i] + locations[j].cookiesHourly[i];\n // console.log (`${hourlyTotal} += ${locations[0].cookiesHourly[i]}`)\n staffTotal[i] = staffTotal[i] + locations[j].staffNeeded[i];\n // console.log (`${hourlyTotal} += ${locations[0].cookiesHourly[i]}`)\n }\n totalOfTotals += hourlyTotal[i]\n totalOfStaffTotals += staffTotal[i]\n }\n return(totalOfTotals, totalOfStaffTotals);\n}", "function PP3sumChkedBoxes(idltrs, numbChBoxes)\n {\n var totalValue = 0;\n for (var j = 1; j <= numbChBoxes; j++) \n {\n var j = j;\n var z = 1;\n for (var k = 1; k <= j - 1; k++) {\n z = z * 2;\n }\n checkBox = document.getElementById(idltrs + z);\n var chkIdStr = checkBox.id;\n //alert(chkIdStr);\n\n if (checkBox.checked)\n { \n status = status + checkBox.id + ' = checked ... ';\n var chkIdStr = checkBox.id;\n addNumb = parseInt(chkIdStr.substring(3, chkIdStr.length));\n totalValue = totalValue + addNumb;\n //alert(\"chkBx is Chked it's value = \" + addNumb + \" and Total = \" + totalValue);\n } \n else\n {\n status = status + checkBox.id + ' = NOT checked ... ';\n //alert(\"check box \" + j + \"not chked\");\n }\n }\n /////Is this needed here??? ////// document.getElementById('sumTemp').innerHTML = totalValue; //// + \" STATUS: \" + status;\n //alert(\"Returning \" + totalValue)\n return totalValue;\n}", "function megaSum() {\n let all = 0;\n for (let i = 0; i < products.length; i++) {\n all += products[i].total;\n\n }\n console.log(all, 'this all');\n return all;\n}", "determineTotals(receipt) {\n let total = 0;\n receipt.inventories.forEach(inventory => {\n total += inventory.buyAmount;\n });\n return total;\n }", "function handleTotals() {\n let total = 0;\n let tds = table.querySelectorAll(\"#table > tbody > tr > td:nth-child(9)\");\n tds.forEach((el) => (total += parseFloat(el.textContent)));\n subtotal.innerText = total;\n}", "getTotal() {\n //Creating variable total with value of 0.\n let total = 0;\n // using built-in forEach(), calculate the total using the price field of each object.\n let beverageTotal = this._beverages.forEach(function(beverage) {\n total += parseFloat(beverage.price);\n });\n let appetizerTotal = this._appetizers.forEach(function(appetizer) {\n total += parseFloat(appetizer.price);\n });\n let mainCourseTotal = this._mainCourses.forEach(function(mainCourse) {\n total += parseFloat(mainCourse.price);\n });\n let dessertTotal = this._desserts.forEach(function(dessert) {\n total += parseFloat(dessert.price);\n });\n console.log(`The total is ${total}`);\n //Return the total variable and set its precisions to two decimal places.\n return total.toFixed(2);\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 sumAll( ) {\n let sum = 0;\n // TODO: loop to add items\n return sum;\n}", "function calculateSummary() {\n let subtotal = 0;\n for (var i = 0; i < elements.length; i++) {\n let item = elements[i];\n subtotal = subtotal + prices.prices[item.id];\n }\n subtotal = parseFloat(subtotal.toFixed(2));\n let tax = parseFloat((0.06 * subtotal).toFixed(2));\n let total = parseFloat((subtotal + 5.99 + tax).toFixed(2));\n return { subtotal, tax, total };\n }", "function calculateItemsAndTotal(){\n var li_perCopy = {};\n var li_perSubmission = {};\n var perCopyDescription = '';\n var perCopyCostFinal = 0;\n//This function builds the final items[] and total to be displayed from global variables itemsPerCopy[],perCopyTotal, itemsPerSubmission [], & perSubmissionTotal\n//the functions above set an items array for perCopy vs perSubmission costs.\n //the code below adds a summary line item for each type and then adds both to items[]\n\n //perCopy\n perCopyDescription += '$' + perCopyTotal + ' per copy x ' + copyCount + (copyCount == 1 ? ' copy' : ' copies');\n perCopyCostFinal += perCopyTotal * copyCount;\n\n li_perCopy = {\n name: 'Total Per Copy Cost',\n description: perCopyDescription,\n cost: perCopyCostFinal,\n style: 'OPTION_1'\n };\n\n itemsPerCopy.push(li_perCopy);\n total += perCopyCostFinal;\n\n for (var i=0; i < itemsPerCopy.length; i++){\n items.push(itemsPerCopy[i]);\n }\n\n for (var c=0; c < itemsPerSubmission.length; c++){\n items.push(itemsPerSubmission[c]);\n }\n\n //perSubmission Summary line item\n\n li_perSubmission = {\n name: 'Total Per Submission Cost',\n description: '',\n cost: perSubmissionTotal,\n style: 'OPTION_1'\n };\n\n items.push(li_perSubmission);\n total += perSubmissionTotal;\n}", "function calculateTotal(){\n total=0;\n shoppingListArray.forEach(function(items) { \n//totals up our number and adds it to the div with the ID of \"yourGrandTotal\", javascript was displaying this output as a string, so I added Number() method to render it as a number\n total += Number(items.price); \n //used toFixed method to render the total with 2 decimal places, concaconated with a string to add the $\n document.getElementById(\"yourGrandTotal\").textContent = \"TOTAL: $\" + total.toFixed(2);\n });\n}", "function getTotals(){\n \n var totals = []; \n var totalCalories =0; \n var totalProtein= 0; \n var totalFat=0 ; \n var totalCarbs= 0; \n var totalFiber=0 ; \n \n //searching through the loop \n for(var i = 0 ; i < menu.length; i++){\n \n var foodObj = menu[i]; \n \n for(var info in foodObj){\n \n var array = foodObj[info]; \n \n switch(info){\n \n case 'Calories':\n totalCalories+=array[0];\n break;\n case 'Protein':\n totalProtein+=array[0];\n break;\n case 'Fat':\n totalFat+=array[0]; \n break;\n case 'Carbs':\n totalCarbs+=array[0];\n break;\n case 'Fiber':\n totalFiber+=array[0]; \n break; \n \n }\n }\n }\n \n totals.push(totalCalories, totalProtein, totalFat, totalCarbs, totalFiber);\n \n calcStats(totals); \n}", "function calculaElTotal(elEvento) {\n\t\t//Añade el encabezado de la tabla\n\t\tdocument.getElementById(\"tablaTotal\").innerHTML='<tr><td class=\"ima\"><b>Imagen</b></td><td class=\"pro\"><b>Producto</b></td><td class=\"uni\"><b>Unidades</b></td><td class=\"preUni\"><b>Precio Unidad</b></td><td class=\"preTotal\"><b>Total</b></td></tr>';\n\t\t//Inicializacion de las variables para esta funcion:\n\t\tvar carroTotal = 0;\n\t\t//Muestra el carrito de la compra\n\t\tfor (i in pro){\n\t\t\tvar tablaTotal = document.getElementById(\"tablaTotal\").innerHTML;\n\t\t\tvar preTotal = 0;\n\t\t\t//Cuenta el numero de productos\n\t\t\tif (uniUser[i].value != 0){\n\t\t\t\t//Calcula el totalUnidades y rellena el carro de la compra\n\t\t\t\tpreTotal = pro[i].precio * uniUser[i].value;\n\t\t\t\tcarroTotal = carroTotal + preTotal;\n\t\t\t\tdocument.getElementById(\"tablaTotal\").innerHTML = tablaTotal + '<tr class=\"proCarrito\"><td><img class=\"rounded\" src=\"'+pro[i].imagen+ '\" alt=\"'+pro[i]+'\"></td><td>' +pro[i].nombre+ '</td><td>' +uniUser[i].value+ '</td><td>' +pro[i].precio+ '</td><td id=\"preTotal' +i+'\" name=\"preTotal\">' +preTotal+ '</td></tr>';\n\t\t\t}\t}\n\t\t//Se obtiene el subTotal\n\t\tif(carroTotal>0){\n\t\t\tvar totalIVA = (carroTotal * IVA);\n\t\t\tvar totalAPagar = carroTotal + totalIVA;\n\t\t}\n\t\ttotalIVA=totalIVA*100;\n\t\ttotalIVA=Math.floor(totalIVA);\n\t\ttotalIVA=totalIVA/100;\n\n\t\ttotalAPagar=totalAPagar*100;\n\t\ttotalAPagar=Math.floor(totalAPagar);\n\t\ttotalAPagar=totalAPagar/100;\n\t\t//Se añade a la tabla el TOTAL que suma el carrito:\n\t\ttablaTotal = document.getElementById(\"tablaTotal\").innerHTML;\n\t\tdocument.getElementById(\"tablaTotal\").innerHTML = tablaTotal + '<tr><td>&nbsp;</td>&nbsp;<td></td><td></td><td class=\"preUni\"><b>Subtotal: </b></td><td class=\"preTotal\"><b>' +\"$ \"+carroTotal+ '</b></td></tr>' +'<tr><td>&nbsp;</td>&nbsp;<td></td><td></td><td class=\"preUni\"><b>IVA ('+(IVA*100)+'%): </b></td><td class=\"preTotal\"><b>' +\"$ \"+totalIVA+ '</b></td></tr>' + '<tr><td>&nbsp;</td>&nbsp;<td></td><td></td><td class=\"preUni\"><b>Total: </b></td><td class=\"preTotal\" id=\"totalAPagar\"><b>'+\"$ \"+totalAPagar+ '</b></td></tr>';\n\t}", "function totaldeftable(t) {\n var contdef=Number($(\"#tdefx\").val());\n var cit=[[]];\n var deftroopmail=[[]];\n var counterdef=0;\n for (var i in t) {\n var tid=t[i].id;\n var tempx=Number(tid % 65536);\n var tempy=Number((tid-tempx)/65536);\n var tcont=Number(Math.floor(tempx/100)+10*Math.floor(tempy/100));\n if (contdef==tcont) {\n if (t[i].Ballista_total>0 || t[i].Ranger_total>0 || t[i].Triari_total>0 || t[i].Priestess_total || t[i].Arbalist_total>0 || t[i].Praetor_total>0 ) {\n counterdef+=1;\n\t\t\t\t\tvar tempt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];\n tempt[1]=t[i].Ballista_total;\n tempt[2]=t[i].Ranger_total;\n tempt[3]=t[i].Triari_total;\n tempt[4]=t[i].Priestess_total;\n tempt[8]=t[i].Arbalist_total;\n tempt[9]=t[i].Praetor_total;\n\t\t\t\t\tvar tempts=0;\n for (var j in tempt) {\n tempts+=tempt[j]*ttts[j];\n }\n deftroopmail.push([tempt,tempts]);\n cit.push([tempx,tempy,tempts,tempt,t[i].c,tid]);\n }\n }\n if(contdef==\"99\"){\n if (t[i].Stinger_total>0 || t[i].Galley_total>0) {\n\t\t\t\t\tcounterdef+=1;\n\t\t\t\t\tvar tempt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];\n tempt[1]=t[i].Ballista_total;\n tempt[2]=t[i].Ranger_total;\n tempt[3]=t[i].Triari_total;\n tempt[4]=t[i].Priestess_total;\n tempt[8]=t[i].Arbalist_total;\n tempt[9]=t[i].Praetor_total;\n tempt[14]=t[i].Galley_total;\n tempt[15]=t[i].Stinger_total;\n var tempts=0;\n for (var j in tempt) {\n tempts+=tempt[j]*ttts[j];\n }\n deftroopmail.push([tempt,tempts]);\n cit.push([tempx,tempy,tempts,tempt,t[i].c,tid]);\n }\n }\n\t\t}\n\n cit.sort(function(a,b) {return b[2]-a[2];});\n $(\"#asdfgd\").text(\"Total:\"+counterdef);\n var totaldeftab=\"<table id='tdeftable'><thead><th></th><th>City</th><th>Coords</th><th>TS</th><th>type</th></thead><tbody>\";\n for (var i in cit) {\n if(i>0){\n totaldeftab+=\"<tr><td><button class='greenb chcity' id='cityGoTowm' a='\"+cit[i][5]+\"'>Go To</button></td><td>\"+cit[i][4]+\"</td><td class='coordblink shcitt' data='\"+cit[i][5]+\"'>\"+cit[i][0]+\":\"+cit[i][1]+\"</td>\";\n //style='font-size: 9px;border-radius: 6px;width: 80%;height: 22px;padding: 0;white-space: nowrap;'\n\t\t\t\ttotaldeftab+=\"<td>\"+cit[i][2]+\"</td><td><table>\";\n for (var j in cit[i][3]) {\n if (cit[i][3][j]>0) {\n totaldeftab+=\"<td><div class='\"+tpicdiv20[j]+\"'></div></td>\";\n }\n }\n totaldeftab+=\"</table></td></tr>\";\n }\n }\n totaldeftab+=\"</tbody></table>\";\n $(\"#Tdefbox\").html(totaldeftab);\n $(\"#tdeftable td\").css(\"text-align\",\"center\");\n $(\"#tdeftable td\").css(\"height\",\"26px\");\n var newTableObject = document.getElementById('tdeftable');\n sorttable.makeSortable(newTableObject);\n deftroopmail.sort(function(a,b) {return b[1]-a[1];});\n $(\"#maildef\").click(function() {\n //$(\"#mailComposeBox\").show();\n var conttemp=$(\"#tdefx\").val();\n var mailto=\"<p>Number of defensive castles is '\"+counterdef+\"'</p>\";\n mailto+='</p><table class=\"mce-item-table\" style=\"width: 266.273px; \"data-mce-style=\"width: 266.273px; \"border=\"1\" data-mce-selected=\"1\"><thead><th>Number</th><th>Troop</th><th>TS Amount</th></thead><tbody>';\n for (var i in deftroopmail) {\n if(i>0){\n mailto+='<tr><td style=\"text-align: center;\" data-mce-style=\"text-align: center;\">'+i+'</td>';\n mailto+='<td style=\"text-align: center;\" data-mce-style=\"text-align: center;\"><table>';\n for (var j in deftroopmail[i][0]) {\n if (deftroopmail[i][0][j]>0) {\n mailto+='<td>'+ttname[j]+'</td>';\n }\n }\n mailto+='</table></td>';\n mailto+='<td style=\"text-align: center;\" data-mce-style=\"text-align: center;\">'+deftroopmail[i][1]+'</td></tr>';\n }\n }\n mailto+=\"</tbody></table>\";\n if(conttemp==99){conttemp=\"Navy\";}\n jQuery(\"#mnlsp\")[0].click();\n jQuery(\"#composeButton\")[0].click();\n var temppo=$(\"#mailname2\").val();\n $(\"#mailToto\").val(temppo);\n $(\"#mailToSub\").val(conttemp+\" Defensive TS\");\n var $iframe = $('#mailBody_ifr');\n $iframe.ready(function() {\n $iframe.contents().find(\"body\").append(mailto);\n });\n });\n }", "function get_total(data){\n return d3.sum(data,function(d){return d.PWT;});\n}", "imprimirTotal(){\n const divTotal = document.createElement('div')\n divTotal.classList.add('totalPlatoPedido')\n\n let totalPedido = 0\n pedido.forEach(precioDet => {\n totalPedido = totalPedido + parseInt(precioDet.precio)\n })\n\n // ---- Scripting del total del pedido --\n const totDetPedido = document.createElement('li')\n totDetPedido.classList.add('totDetLi')\n\n totDetPedido.textContent = totalPedido\n\n // ---- Agregar los párrafos al divDetalle ---\n divTotal.appendChild(totDetPedido)\n\n // ---- Agregar el total al HTML --------\n totalPedidoMostrar.appendChild(divTotal) \n }", "function getTotal() {\n if (!runningTotal) {\n operate(x, sign, y);\n runningTotal = true;\n } else if (runningTotal) {\n operate(total, sign, y);\n } \n}", "function findSum() {\n tot = 0;\n for (var i = 0; i < cart.length; i++) {\n tot = tot + cart[i].price\n\n\n //append the new total to html\n $('.total').text(tot);\n }\n\n}", "function sumData(data) {\n {\n var printOut = 0;\n\n//sum together all the values in the selected range\n for (var x = 0 ; x < data.length; x++) {\n for (var y = 0; y < data[x].length; y++) {\n printOut += data[x][y];\n }\n }\n//print results in task pane\n\t\tdocument.getElementById(\"results\").innerText = printOut;\n }\n}", "function calcTotal() {\n let total = 0;\n for (let item of itemList) {\n total += Number(item.price);\n }\n console.log(\"this is the total\", total);\n return total;\n }", "function calculateSubTotal() {\n totalSum = 0;\n $('.total_Prices').each(function(i, obj) { \n totalSum = Number(totalSum) + Number($('#total_price_amount'+i).html().replace(\"$\",''));\n });\n $('#total_p').val(totalSum);\n }" ]
[ "0.66749525", "0.6452147", "0.6450019", "0.62815714", "0.616598", "0.6152829", "0.6144821", "0.61362773", "0.6134568", "0.61029917", "0.60827905", "0.6063323", "0.6061634", "0.60530865", "0.6047418", "0.60448325", "0.6022704", "0.6019805", "0.6019039", "0.60104346", "0.60054713", "0.5973586", "0.59676075", "0.59667164", "0.5960794", "0.59580445", "0.59572476", "0.59521425", "0.59505224", "0.59268975", "0.59075564", "0.590263", "0.59015006", "0.5901433", "0.5897432", "0.58929384", "0.5890305", "0.58890355", "0.58846", "0.58762044", "0.58749634", "0.5874382", "0.58643275", "0.5864035", "0.58630186", "0.58324856", "0.5829432", "0.5828295", "0.5803557", "0.57988405", "0.5796517", "0.5793669", "0.57928383", "0.5790739", "0.57812613", "0.5778927", "0.5776972", "0.5770607", "0.57685137", "0.57617474", "0.57496446", "0.57466036", "0.5746546", "0.57432836", "0.57428175", "0.5740061", "0.57386893", "0.5737428", "0.57341427", "0.5720287", "0.57107", "0.5704168", "0.5699991", "0.5696306", "0.56953055", "0.5693519", "0.56912637", "0.56886435", "0.5685522", "0.56840247", "0.5680352", "0.56786484", "0.5678374", "0.56755984", "0.56705135", "0.5667284", "0.56666887", "0.56631124", "0.5662026", "0.5659545", "0.56560653", "0.56541693", "0.5652328", "0.5645124", "0.5645108", "0.5636744", "0.56364226", "0.56268066", "0.5625933", "0.56243575" ]
0.62893486
3
function for totaling IN OUT TOT and appending them
function buildCard() { for(let p = 1; p <= numplayers; p++){ $('.playerMain').append( '<div id="playerRow'+ p +'" class="playerLabel player'+ p +'">' + '<span class="playersName" contenteditable="true">Player '+ p +'</span>' + '<span onclick="removePlayer(this)" class="fa fa-trash player'+ p +'"></span>' + '</div>'); $('#totalIn').append('<div class="scoreBox">'+'<div id="player'+ p +'scoreIn"></div>'+'</div>'); $('#totalOut').append('<div class="scoreBox">'+'<div id="player'+ p +'scoreOut"></div>'+'</div>'); $('#totalScore').append('<div class="scoreBox">'+'<div id="player'+ p +'totalScore"></div>'+'</div>'); for(let h = 0; h < selcourse.data.holes.length; h++){ $('#c'+h).append('<input type="number" class="holeInput player'+p+'" id="p'+p+'h'+h+'" type="text">'); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getStakeOutsTotal() {\n let val = new bn_js_1.default(0);\n for (let i = 0; i < this.stakeOuts.length; i++) {\n val = val.add(this.stakeOuts[i].getOutput().getAmount());\n }\n return val;\n }", "function callTotal() {\n var totRow = document.getElementById('timeTot');\n\n // Make sure our row is empty\n while (totRow.lastChild) {\n totRow.removeChild(totRow.lastChild);\n }\n\n var totLabel = document.createElement('th');\n totLabel.textContent = 'Hourly Totals';\n totRow.appendChild(totLabel);\n\n var grandTotal = 0;\n\n for (var k = 0; k < hours.length - 1; k++) {\n\n var currentHour = hours[k]; // e.g. \"8:00AM\";\n var currentHourSales = [];\n\n for (var l = 0; l < data.length; l++) {\n var currentStore = data[l];\n currentHourSales.push(currentStore.sales[currentHour]);\n }\n\n // currentHourSales.push(pike.stats[k], seaTac.stats[k], seaCtr.stats[k], capHill.stats[k], alki.stats[k]);\n\n var sum = currentHourSales.reduce(function (a, b) { return a + b; }, 0);\n grandTotal += sum;\n\n var tot = document.createElement('td');\n tot.textContent = Math.round(sum);\n totRow.appendChild(tot);\n domTable.appendChild(totRow);\n }\n //var allTots = [];\n //allTots.push(pike.sums, seaTac.sums, seaCtr.sums, capHill.sums, alki.sums);\n\n //console.log('parseint' + allTots);\n //var sums = parseInt(allTots[0]) + parseInt(allTots[1]) + parseInt(allTots[2]) + parseInt(allTots[3]) + parseInt(allTots[4]);\n\n //console.log(sums);\n\n var grandTotalElement = document.createElement('td');\n grandTotalElement.textContent = Math.round(grandTotal);\n totRow.appendChild(grandTotalElement);\n}", "total (itens) {\n prod1 = list[0].amount\n prod2 = list[1].amount\n prod3 = list[2].amount\n prod4 = list[3].amount\n\n itens = prod1 + prod2 + prod3 + prod4\n\n return itens\n }", "function addUpTotals(mycourse, teeIndex) {\n for(let i = 0; i < mycourse.length; i++) {\n if (i <= 8) {\n totalYardsIn += Number(mycourse[i].teeBoxes[teeIndex].yards);\n totalParIn += Number(mycourse[i].teeBoxes[teeIndex].par);\n totalHCPIn += Number(mycourse[i].teeBoxes[teeIndex].hcp);\n }\n if (i < mycourse.length && i >= 9) {\n totalYardsOut += Number(mycourse[i].teeBoxes[teeIndex].yards);\n totalParOut += Number(mycourse[i].teeBoxes[teeIndex].par);\n totalHCPOut += Number(mycourse[i].teeBoxes[teeIndex].hcp);\n }\n }\n}", "function totalcalc() {\n let total = 1299 + rmemory + ssd + deli;\n return total;;\n}", "function totals_row_maker(datasets) {\n var total_cost = $scope.total_order_cost;\n var total_quant = 0;\n var total_scrap = $scope.total_order_scrap + '\\\"';\n for (var prop in datasets) {\n total_quant += datasets[prop][1];\n }\n $('#summary').append('<tfoot class=\"totals-row\"><tr><th class=\"total-cell\">Totals:</th><td class=\"total-cell\">' + total_quant + '</td><td class=\"total-cell\">' + total_cost + '</td><td class=\"total-cell\">' + total_scrap + '</td></tr></tfoot>');\n }", "function appendTotals(inputs) {\n\tvar input = _.clone(inputs);\n\tvar total={};\n\t\n\ttotal.totalsales = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('summary')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.sales)+init;},0)\n\t\t\t\t\t .value())\n\t;\n\n\ttotal.totaltransactions=_(input.list).chain()\n\t .pluck('summary')\n\t .reduce(function(init,item){ return Number(item.numberoftransactions)+init;},0)\n\t .value();\n\ttotal.totaltax1 = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('summary')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.tax1)+init;},0)\n\t\t\t\t\t .value());\n\ttotal.totaltax3 = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('summary')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.tax3)+init;},0)\n\t\t\t\t\t .value());\n\ttotal.totaltotalsales = currency_format(_(input.list).chain()\n\t\t\t\t\t\t.pluck('summary')\n\t\t\t\t\t\t.reduce(function(init,item){ return Number(item.totalsales)+init;},0)\n\t\t\t\t\t\t.value());\n\ttotal.totalcash = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('summary')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.cash)+init;},0)\n\t\t\t\t\t .value());\n\ttotal.totalcredit = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('summary')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.credit)+init;},0)\n\t\t\t\t\t .value());\n\ttotal.totaldebit = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('summary')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.debit)+init;},0)\n\t\t\t\t\t .value());\n\ttotal.totalmobile = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('summary')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.mobile)+init;},0)\n\t\t\t\t\t .value());\n\ttotal.totalother = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('summary')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.other)+init;},0)\n\t\t\t\t\t .value());\n\tinput.total = total;\n\treturn input;\n }", "function getTotalData(){\r\n\t \t\t var totalUnitData = 0;\r\n\t \t\t for (var i=0; i<unitValues.length;i++){\r\n\t \t\t\t totalUnitData += unitValues[i]; \r\n\t \t\t }\r\n\t \t\t return totalUnitData;\r\n\t \t }", "function dataTotal(v) {\n\tvar vT = 0;\n\tfor(var i=0, len=v.length; i<len; i++) {\n\t\tvT += v[i];\n\t}\n\treturn vT;\n}", "calculateTotals(data) {\n let calculate = (acc, current) => acc + current;\n let total = data.reduce(calculate);\n return total;\n }", "function calculateTotal() {\n calculateSubtotals();\n for (var x in subtotal) {\n preuTotal+=subtotal[x].value;\n }\n console.log('Total: '+preuTotal);\n}", "function totalMU(values) {\n\t\t\tif(values === undefined || values.length == 0) return 0;\n\t\t\tvar total = 0;\n\t\t\tfor(var loop = 0; loop < values.length; loop++) total += values[loop].footprint;\n\t\t\treturn total;\n\t\t}", "function totalTotalSum(){\n totalTurtle = 0;\n for (var i in allStoreTotals){\n totalTurtle += allStoreTotals[i];\n }\n}", "function appendTotal(table) {\n\tvar priceRow = document.createElement('tr');\n\ttable.appendChild(priceRow);\n\tvar totalHeading = document.createElement('th');\n\ttotalHeading.setAttribute('colspan', '2');\n\ttotalHeading.innerText = 'Total';\n\tpriceRow.appendChild(totalHeading);\n\tvar totalRow = document.createElement('tr');\n\tvar totalCell = document.createElement('td');\n\ttotalCell.innerText = total();\n\ttotalCell.setAttribute('colspan', '2');\n\ttotalRow.appendChild(totalCell);\n\ttable.appendChild(totalRow);\n}", "function CalculateAllTotals() {\n //use temp variables to prevent multiple dom updates\n var wt = 0;\n var dt = 0;\n var gt = 0;\n for (var i = 0; i < vm.territorySalesNumbers.length; i++) {\n wt += vm.territoryWritten[i];\n dt += vm.territoryDelivered[i];\n gt += vm.goals[i];\n }\n\n vm.writtenTotal = Round(wt, 2);\n vm.deliveredTotal = Round(dt, 2);\n vm.goalsTotal = Round(gt, 2);\n vm.goalsWrittenDifference = Round(vm.writtenTotal - vm.goalsTotal, 2);\n\n if (vm.goalsWrittenDifference > 0)\n vm.goalsWrittenDifference = '+' + vm.goalsWrittenDifference;\n\n }", "function calcAll() {\n let subTotal = 0;\n [...cart.children].forEach(product => subTotal += updateSubtot(product));\n document.querySelector('h2 > span').innerHTML = subTotal;\n}", "function totalsIntakeSpace(ov){\n\tvar maxsp=0, ops = \"\";\n\tov.map((il)=>{\t\n\t\tif(il.tl > maxsp){\n\t\t\tmaxsp = il.tl;\n\t\t}\n\t});\n\treturn ov.reduce((ops, il)=>{\n\t\t\treturn ops += \til.ind + \" \" +\n\t\t\t\t\t\t\til.alg + \" \".repeat(maxsp - il.tl + 1) + \n\t\t\t\t\t\t\til.sub + \": \" +\n\t\t\t\t\t\t\tMath.round(parseFloat(il.qty) * 100) / 100 + \"\\n\";\n\n\t}, \"\");\n}", "function appendTotal (){\n activities.appendChild(totalLabel);\n}", "function calcTotalTotal() {\n totalTotal = 0;\n for (var i = 0; i < hours.length; i++) {\n totalTotal += combinedHourlyCookies[i];\n }\n}", "function calculateAllTotals() {\n\tfor (var i = 0; i < sumSlots.length; i++) {\n\t\tsumStatTotal(sumSlots[i]);\n\t}\n\t\n\tif ($(\"#wep\").find(\".ticks\").val() != \"\") {\n\t\t$(\"#total\").find(\".ticks\").val($(\"#wep\").find(\".ticks\").val());\n\t}\n}", "function tableTotals(){\n let cookieTotals = [];\n for (let i=0; i < shopLocations.length; i++){\n let currentShop = shopLocations[i];\n for (let j = 0; j < currentShop.todaySales.length; j++){\n if (!cookieTotals[j]){cookieTotals[j] = 0;}\n cookieTotals[j] += currentShop.todaySales[j][2];\n }\n }\n\n let parentEl = document.getElementById('Totals');\n let totalText = 'Totals';\n newChildNode(parentEl, 'th', totalText);\n for (let i = 0; i < cookieTotals.length; i++){\n let text = cookieTotals[i];\n newChildNode(parentEl, 'td', text);\n }\n}", "function getTotal(){\n\t\t\treturn total;\n\t\t}", "function createTotalTable(){\n\t// console.log(\"\\n---------- CREATING TOTAL TABLE ----------\");\n\tvar cDiv = $(\".blockTotal table\");\n\tvar html = [];\n\t// console.log(\"table : \");\n\t// console.log(cDiv);\n\thtml.push('<thead><th>MONEDA</th><th>+</th><th>-</th><th>TOTAL</th></thead><tbody>');\n\t$.each(curArr,function(i,v){\n\t\thtml.push('<tr><td class=\"totCur '+v+'\">'+v+'</td><td class=\"pos '+v+'\">---</td><td class=\"neg '+v+'\">---</td><th class=\"tot '+v+'\">---</th></tr>');\n\t});\n\thtml.push('</tbody>');\n\thtml.push('<tfoot><td>');\n\thtml.push('<div class=\"input-group-btn\">\\\n\t\t <button type=\"button\" class=\"btn btn-default dropdown-toggle\" data-toggle=\"dropdown\" align=\"left\">\\\n\t\t\t<span class=\"targetDropdown curTotal curChoice in\" id=\"inCuIn\"></span>\\\n\t\t\t<span class=\"caret\"></span>\\\n\t\t </button>\\\n\t\t <ul class=\"dropdown-menu\">\\\n\t\t </ul>\\\n\t\t </div>');\n\thtml.push('</td><th class=\"pos total\">---</th><th class=\"neg total\">---</th><th class=\"tot total\">---</th></tfoot>');\n\tcDiv.append(html.join(''));\n\t// console.log(\"\\n---------- END CREATING TOTAL TABLE ----------\");\n}", "function calculerTotal(){ \r\n var total = 0\r\n for (var i in achats) {\r\n total = total + achats[i].nbre*achats[i].prix;\r\n }\r\n setElem(\"tot\", total.toFixed(2));\r\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}", "function Total(data) {\n var total = 0\n angular.forEach(data, function(value) {\n total += value;\n })\n return total;\n }", "function dataTableTotal(){\n console.log(table.page.info());\n let startPage = table.page.info().start;\n let endPage = table.page.info().end;\n let totalHarga = 0;\n let totalData = parseInt(table.page.info().end - table.page.info().start);\n // console.log(table.page.info().start);\n for (let i = startPage; i < endPage; i++) {\n row = table.rows(i).data();\n // Karena kolom 5 menyesuaikan dengan kolom didatatable, untuk 0 adalah data dari dalam datatable\n totalHarga += convertRupiahToNumber(row[0][6]) * row[0][5];\n }\n\n $('#totalPage').html(totalData);\n $('#totalHarga').html(convertNumberToRupiah(totalHarga));\n\n }", "function calcTotal (taxTot, shipTot, subTot) {\n taxTot = parseFloat(taxTot);\n shipTot = parseFloat(shipTot);\n subTot = parseFloat(subTot);\n console.log(\"in calcTotal\");\n total = (subTot + taxTot + shipTot);\n total = total.toFixed(2);\n document.getElementById(\"total\").innerHTML = \"Total: $\" + total;\n // Update Total in Table\n}", "function createFooter() {\n let footerEL = document.createElement('tfoot');\n let tdEL = document.createElement('td');\n\n tdEL.textContent='Totals'\n\n footerEL.appendChild(tdEL);\n tableEL.appendChild(footerEL)\n\n let maintotal = 0\n\n for(let i=0 ; i <hours.length ; i++){\n let summ = 0;\n let tdel = document.createElement('td');\n for(let j = 0 ; j < shopss.length ; j++){\n summ = summ + shopss[j].avgCookiesPerH[i]\n \n console.log(summ);\n }\n maintotal+=summ;\n tdel.textContent = summ ;\n footerEL.appendChild(tdel);\n }\n let totaltd = document.createElement('td')\n totaltd.textContent = maintotal;\n footerEL.appendChild(totaltd)\n\n}", "function IndicadorTotal () {}", "function addTotal(arr){\n arr.forEach(function(ele){\n let total=0;\n total=ele.science+ele.maths+ele.english\n ele.total=total;\n })\n }", "function sum(self) { return self.leftFoot + self.rightFoot; }", "function muestroTotalProductos() {\r\n var subTotalCompleto = 0;\r\n subTotalCompletoImporte = 0;\r\n if ($('.articuloDeLista').length > 0) {\r\n $('.articuloDeLista').each(function () {\r\n subTotalCompleto = parseFloat($(this).children('.productSubtotal').text());\r\n subTotalCompletoImporte += subTotalCompleto;\r\n document.getElementById(\"productCostText\").innerHTML = subTotalCompletoImporte;\r\n });\r\n }\r\n }", "function fn_total(row) {\n var total = 0.0;\n for (var i = 0; i < row; i++) {\n if ($(\"#cbo-enfoque\").val() == 1) {\n if ($(\"#txt-det-7-\" + (i + 1)).val() != '') {\n total += parseFloat($(\"#txt-det-7-\" + (i + 1)).val());\n }\n } else if ($(\"#cbo-enfoque\").val() == 2) {\n if ($(\"#txt-det-8-\" + (i + 1)).val() != '') {\n total += parseFloat($(\"#txt-det-8-\" + (i + 1)).val());\n }\n } else if ($(\"#cbo-enfoque\").val() == 3) {\n if ($(\"#txt-det-5-\" + (i + 1)).val() != '') {\n total += parseFloat($(\"#txt-det-5-\" + (i + 1)).val());\n }\n } else if ($(\"#cbo-enfoque\").val() == 4) {\n if ($(\"#txt-det-6-\" + (i + 1)).val() != '') {\n total += parseFloat($(\"#txt-det-6-\" + (i + 1)).val());\n }\n }\n }\n $(\"#cuerpoTablaIndicador\").data(\"total\", total);\n $(\"#total-detalle\").html(\"\");\n $(\"#total-detalle\").append((Math.round(total * 100) / 100));\n //$(\"#total-detalle2\").html(\"\");\n //$(\"#total-detalle2\").append((Math.round(total * 100) / 100));\n}", "function makeTotalRow(tableElement){\n //compute total per hour of all locations\n hourlyTotal = calculateHourlyTotal();\n //add total\n tableElement.append(makeTableRow('Totals', hourlyTotal, getSum(hourlyTotal) ));\n}", "function appetize(total){\n\n}", "function calculateTotal(section) {\n return section.length && section.filter(a => a && a.length !== null && !a.error).reduce((a, b) => ({\n value: unformatted(a.value) + unformatted(b.value)\n })).value\n}", "function totales()\n{\n var subtotal = 0;\n var total = 0.00;\n var totalcantidad = 0;\n var subcantidad = 0;\n var total_dinero = 0;\n var total_cantidad = 0;\n var sub_exento=0;\n $(\"#inventable>tbody tr\").each(function()\n {\n var compra = $(this).find(\".precio_compra\").val();\n var unidad = $(this).find(\".unidad\").val();\n var venta = $(this).find(\".precio_venta\").val();\n var cantidad = parseInt($(this).find(\".cant\").val());\n var vence = $(this).find(\".vence\").val();\n var exento = parseInt($(this).find(\".exento\").val());\n console.log(cantidad);\n if (isNaN(cantidad) == true)\n {\n cantidad = 0;\n }\n subtotal = compra * cantidad;\n\n totalcantidad += cantidad;\n if (isNaN(subtotal) == true)\n {\n subtotal = 0;\n }\n\n if(exento==1)\n {\n sub_exento=sub_exento+subtotal;\n }\n else\n {\n total += subtotal;\n }\n\n });\n if (isNaN(total) == true)\n {\n total = 0;\n }\n sumas_sin_iva=total;\n sumas_sin_iva=round(total, 2);\n\n if(isNaN(sub_exento))\n {\n sub_exento=0;\n }\n\n tipo_doc=$('#tipo_doc').val();\n\n percepcion = $('#percepcion').val();\n\n var monto_percepcion = $('#monto_percepcion').val();\n var iva = $('#porc_iva').val();\n\n total_percepcion=0;\n iva = round((total * iva), 4);\n sub_exento = round(sub_exento, 2);\n\n if (total >= monto_percepcion)\n total_percepcion = round((total * percepcion), 4);\n\n total += total_percepcion;\n if(tipo_doc=='CCF')\n {\n total += iva;\n }\n else\n {\n iva=0;\n\n }\n\n\n total+= sub_exento;\n total_dinero =parseFloat(total).toFixed(2);\n /*if(total_dinero=='0'){\n total_dinero=\"0.00\";\n }else{\n total_dinero=total_dinero =parseFloat(total).toFixed(2);;\n }*/\n total_cantidad = round(totalcantidad,2);\n $('#totcant').html(total_cantidad);\n $('#sumas_sin_iva').html(round(sumas_sin_iva,2));\n $('#subtotal').html(round((sumas_sin_iva+iva), 2));\n $('#iva').html(round(iva,2));\n $('#venta_exenta').html(sub_exento);\n $('#total_percepcion').html(round(total_percepcion, 2));\n $('#total_dinero').html(total_dinero);\n $('#totaltexto').load('compras.php?' + 'process=total_texto&total=' + total_dinero);\n}", "function getMoney() {\n\t$('entries').apend('<tr><th></th><thd>') + total + '</td></tr>'();\n}", "function totalOrder() {\n var salePriceTotal = 0,\n laborPriceTotal = 0,\n shopSupplies = 0,\n hazardMaterials = 0,\n taxableAmount = 0,\n extras = 0,\n SHOP_SUPPLIES_CAP = 19.73,\n HAZARD_MATERIALS_CAP = 19.73,\n length = $scope.parts.length,\n parts = $scope.parts,\n i = 0;\n\n for (i = 0; i < length; i++) {\n hazardMaterials += parts[i].salePriceTotal * 0.06;\n shopSupplies += parts[i].laborPrice * 0.06;\n salePriceTotal += parts[i].salePriceTotal;\n laborPriceTotal += parts[i].laborPrice;\n }\n if (hazardMaterials > HAZARD_MATERIALS_CAP) {\n hazardMaterials = HAZARD_MATERIALS_CAP;\n }\n if (shopSupplies > SHOP_SUPPLIES_CAP) {\n shopSupplies = SHOP_SUPPLIES_CAP;\n }\n if (!$scope.parts.noExtras) {\n extras = hazardMaterials + shopSupplies;\n }\n taxableAmount = salePriceTotal + extras;\n $scope.parts.subTotal = salePriceTotal + laborPriceTotal;\n $scope.parts.tax = taxableAmount * 0.06;\n $scope.parts.total = (taxableAmount * 1.06) + laborPriceTotal;\n $scope.parts.hazardMaterials = hazardMaterials;\n $scope.parts.shopSupplies = shopSupplies;\n }", "function fnAlltotal(){\n console.log(\"TOTAL hit\")\n var subTotal=0;\n\n $(\".amount\").each(function(){\n subTotal += parseFloat($(this).val()||0);\n });\n\n \n final.subTotal = subTotal\n final.total = subTotal\n $('#td-subtotal').html(( final.subTotal).toFixed(3)); \n $('#td-total').html(( final.total).toFixed(3) - lead['discount'].toFixed(3));\n}", "function addTotals(ind, finTimer){\n var compare = finTimer.date;\n var compareWeek = getWeekStart(compare);\n // check if timer finished in the same day as stored today - update day total \n if( compareDay(compare, statsinfo.today )){\n statsinfo.todayTotal += finTimer.time;\n }\n else{\n /* create new day */\n createToday();\n /* total just finished timer */\n statsinfo.todayTotal = finTimer.time;\n }\n // check if timer finished in the same day as stored today - update week total\n if( compareDay(compareWeek, statsinfo.week )){\n statsinfo.weekTotal += finTimer.time;\n }\n else{\n createToday();\n statsinfo.weekTotal = finTimer.time;\n }\n\n /* always add to total */\n statsinfo.total += finTimer.time;\n\n /* update displays */\n updateStatDisplay();\n\n \n}", "function createFooter() {\n\n let trfooEl =document.createElement('tr');\n let tdEl=document.createElement('td');\n tdEl.textContent = 'Totals';\n trfooEl.appendChild(tdEl);\n tableEl.appendChild(trfooEl);\n let megaTotal = 0;\n\n for (let h=0 ; h < openhours.length ; h++ ) {\n\n let tdEl=document.createElement('td');\n let sum=0;\n \n for (let s=0 ; s < locations.length ; s++){\n\n\n sum = sum + locations[s].cookiesinhour[h];\n\n }\n megaTotal += sum;\n tdEl.textContent = sum;\n trfooEl.appendChild(tdEl);\n\n }\n let totalTdEl = document.createElement('td');\n totalTdEl.textContent = megaTotal;\n trfooEl.appendChild(totalTdEl);\n }", "function total(index) {\n\n var total = 0\n matrix[index].forEach(element => {\n total += element\n })\n return total; \n\n }", "calcTotal(){\n\t\t\tlet length = this.sales.length;\n\t\t\tthis.paidCommissionTotal = 0;\n\t\t\tthis.commissionTotal = 0;\n\t\t\tfor(let i = 0; i < length; ++i){\n\t\t\t\t\tthis.commissionTotal += this.sales[i].commission;\n\t\t\t\t\tif(this.sales[i].paid == true){\n\t\t\t\t\t\tthis.paidCommissionTotal += this.sales[i].commission;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tthis.sales.length;\n\t\t}", "function total() {\n var outputData = outputSheet.getDataRange().getValues();\n var inputSheet = ss.getSheetByName('data entry'); // this is the name of the input sheet tab\n var emptyRow = outputData.length + 1;\n var count = [];\n var title = [];\n \n for (var i=1;i<20;i+=6) { //this is rows\n for (var j=1;j<8;j+=2) { //this is columns\n var label = inputSheet.getRange(i+1,j).getValue();\n var value = inputSheet.getRange(i,j).getValue();\n if (label != \"\") {\n count.push(value);\n title.push(label);\n }\n inputSheet.getRange(i,j).setValue('0'); //resets the counter to 0\n }\n }\n saveOutput(emptyRow,count,title);\n}", "function footerRow() {\n let tr = document.createElement('tr');\n table.appendChild(tr);\n let th = document.createElement('th');\n tr.appendChild(th);\n th.textContent = 'Total';\n\n /*\n let thTotal = document.createElement('th');\n tr.appendChild(thTotal)\n thTotal.textContent='Totals';\n */\n\n let sum;\n let megaTotal = 0;\n for (let i = 0; i < hourWork.length; i++) {\n sum = 0;\n\n for (let j = 0; j < arr.length; j++) {\n\n sum = sum + arr[j].arrcookiesPerHour[i];\n\n }\n\n megaTotal = megaTotal + sum;\n th = document.createElement('th');\n tr.appendChild(th);\n th.textContent = sum;\n }\n let Ttotal = document.createElement('th');\n tr.appendChild(Ttotal);\n Ttotal.textContent = megaTotal;\n\n\n}", "function totalFooter() {\n var updateFooter = document.getElementById('hourly-totals');\n if (updateFooter) {\n updateFooter.parentNode.removeChild(updateFooter);\n }\n var tableFoot = document.createElement('tfoot');\n tableFoot.setAttribute('id', 'hourly-totals');\n var cookieTable = document.getElementById('cookie-table');\n cookieTable.appendChild(tableFoot);\n var hourlyTotals = document.getElementById('hourly-totals');\n var firstFoot = document.createElement('th');\n firstFoot.textContent = 'Total';\n hourlyTotals.appendChild(firstFoot);\n var grandTotal = 0;\n for (var i = 0; i < eachHour.length; i++) {\n var footerTotals = document.createElement('td');\n footerTotals.textContent = eachHour[i];\n hourlyTotals.appendChild(footerTotals);\n grandTotal += eachHour[i];\n }\n var finalFoot = document.createElement('td');\n finalFoot.textContent = grandTotal;\n tableFoot.appendChild(finalFoot);\n}", "function makeTotal() {\n\tvar $tr = $(\"<tr>\").attr(\"id\", \"total\");\n\tvar $symbol = $(\"<td>\").html(\"\");\n\tvar $name = $(\"<td>\").html(\"<b>Total</b>\");\n\tvar $ticks = $(\"<td>\").append($('<input class=\"ticks\" size=\"5\">'));\n\tvar $str = $(\"<td>\").append($('<input class=\"str\" size=\"5\">'));\n\tvar $st = $(\"<td>\").append($('<input class=\"st\" size=\"5\">'));\n\tvar $sl = $(\"<td>\").append($('<input class=\"sl\" size=\"5\">'));\n\tvar $cr = $(\"<td>\").append($('<input class=\"cr\" size=\"5\">'));\n\tvar $mm = $('<td class=\"mm\" />');\n\tvar $m = $('<td class=\"equipLeftM\">').append($('<input class=\"m\" size=\"5\">'));\n\tvar $ma = $('<td class=\"equipRightM\">').append($('<input class=\"ma\" size=\"5\">'));\n\tvar $mr = $('<td class=\"mr\" />');\n\tvar $r = $('<td class=\"equipLeftR\">').append($('<input class=\"r\" size=\"5\">'));\n\tvar $ra = $('<td class=\"equipRightR\">').append($('<input class=\"ra\" size=\"5\">'));\n\t\n\t$tr.append($symbol, $name, $ticks, $str, $st, $sl, $cr, $mm, $m, $ma, $mr, $r, $ra);\n\t$(\"#equipment\").append($tr);\n\t\n\tupdateTotal();\n}", "function calculateGrandTotal() {\n\n var GrandTotal = 0;\n self.selectItems.forEach(function (item) {\n GrandTotal += item.co2_offset;\n self.Co2GrandTotal=Math.floor(GrandTotal * 10000)/10000;\n });\n }", "function addTotalToTable(){\n let newTotalRow = buildTotalRow();\n document.getElementsByTagName(\"tbody\")[0].appendChild(newTotalRow);\n}", "function getTotals(refs) {\n frefs.reduce(getSum); //Getting the sum of refugees year wise\n console.log(total);\n\n }", "function calTotal() {\n var ttotal = 0;\n var total = \"\"\n // totalDiv.innerHTML =total\n for (var x = 0; x < cart.length; x++) {\n var skuu = cart[x].sku;\n // console.log(skuu)\n var cat = cart[x].categoryId\n // console.log(cat)\n var pret;\n\n // console.log(pret)\n for (var j = 0; j < products[cat].length; j++) {\n // console.log(products[cat][j])\n if (products[cat][j].sku == skuu) {\n pret = products[cat][j].price;\n // console.log(pret)\n // console.log(pret)\n\n ttotal += pret * cart[x].qty\n //console.log(\"ttotal= \"+ttotal)\n }\n }\n }\n totalDiv.innerHTML = \"total = \" + ttotal + \" lei\";\n }", "function sumaSubTotales(){\n\n\tvar subTotales = $(\"#subTotales span\");\n\n\tvar arraySumaSubTotales=[];\n\n\tfor(var i=0;i<subTotales.length;i++){\n\n\t\tvar subTotalesArray = $(subTotales[i]).html();\n\n\t\tarraySumaSubTotales.push(Number(subTotalesArray));\t\n\n\t}\n\n\tfunction sumaArraySubtotales(total,numero){\n\n\t\treturn total+numero;\n\t}\n\n\tvar sumaTotal = arraySumaSubTotales.reduce(sumaArraySubtotales);\n\n\t$(\".sumaSubTotal span\").html(sumaTotal);\n\n\t$(\".sumaCesta\").html(sumaTotal);\n\n\tlocalStorage.setItem(\"sumaCesta\",sumaTotal);\n\n}", "function addTotal() {\n let parTotal = 0;\n let totalScore = 0;\n let overTotal = 0;\n\n for (let i = 1; i < rows.length - 1; i++) {\n let par = elem[i].children[1].innerHTML;\n let score = elem[i].children[2].innerHTML;\n let over = elem[i].children[3].innerHTML;\n\n if (isNaN(score)) {\n parTotal += 0;\n totalScore += 0;\n overTotal += 0;\n } else {\n parTotal += parseInt(par);\n totalScore += parseInt(score);\n overTotal += parseInt(over);\n }\n }\n\n if (totalScore == 0 && parTotal == 0 && overTotal == 0) {\n rows[19].children[1].innerText = \"-\";\n rows[19].children[2].innerText = \"-\";\n rows[19].children[3].innerText = \"-\";\n } else {\n rows[19].children[1].innerText = parTotal;\n rows[19].children[2].innerText = totalScore;\n rows[19].children[3].innerText = overTotal;\n }\n}", "function addTotal(){\n const currentList = getCurrentList();\n if ('Celkem' in currentList) return;\n const ss = getSpreadSheet(LIST_SHEET);\n const lastRow = ss.getLastRow() + 1;\n var listRange = ss.getRange(lastRow,1,1,3);\n \n var total = 0;\n for(var item in currentList) {\n total += currentList[item][0] * currentList[item][1];\n }\n\n listRange.getCell(1, 1).setValue(TOTAL_STR);\n listRange.getCell(1, 3).setValue(total);\n}", "function getTotals(table){\n var totals = [];\n for (var i = 0; i < (hours.length + 1); i++) {\n var hourlyTotal = 0;\n for(var j = 0; j < allLocationObjects.length; j++) {\n if (table === 'cookieChart'){\n hourlyTotal += allLocationObjects[j].cookieArray[i];\n } else if (table === 'cookieStaff') {\n hourlyTotal += allLocationObjects[j].staffNeededArray[i];\n }\n }\n totals.push(hourlyTotal);\n }\n return totals;\n}", "function format(invoices) {\n var invoice\n var invoiceTotal\n var text\n for (var i = 0; i < invoices.length; i++) {\n invoice = invoices[i]\n invoiceTotal = invoice.reduce(function (total, transaction) {\n return roundTo(total + transaction.AMOUNT, 5)\n }, 0)\n text = \"\"\n text += 'TRNS\\t\"' + invoice[0].TRNSTYPE + '\"\\t\"' + invoice[0].DATE + '\"\\t\"' + invoice[0].ACCNT + '\"\\t\"' + invoice[0].NAME + '\"\\t\"'\n + invoice[0].CLASS + '\"\\t\"' + invoiceTotal + '\"\\t\"' + invoice[0].transactionMEMO + '\"\\n'\n for (var j = 0; j < invoice.length; j++) {\n var transaction = invoice[j]\n text += 'SPL\\t\"' + transaction.TRNSTYPE + '\"\\t\"' + transaction.DATE + '\"\\t\"' + transaction.secondaryACCNT + '\"\\t\"' + transaction.NAME + '\"\\t\"'\n + transaction.CLASS + '\"\\t\"' + -1 * transaction.AMOUNT + '\"\\t\"' + transaction.MEMO + '\"\\t\"' + -1 * transaction.QNTY + '\"\\t\"' + transaction.PRICE + '\"\\n'\n /* + '\"\\t\"' + transaction.INVITEM + '\"\\t\"' + transaction.TAXABLE + '\"\\t\"' + transaction.REIMBEXP*/\n }\n text += \"ENDTRNS\\n\"\n fs.appendFileSync(destination, text)\n }\n}", "function calcTotals() {\n var incomes = 0;\n var expenses = 0;\n var budget;\n // calculate total income\n data.allItems.inc.forEach(function(item) {\n incomes+= item.value;\n })\n //calculate total expenses\n data.allItems.exp.forEach(function(item) {\n expenses+= item.value;\n })\n //calculate total budget\n budget = incomes - expenses;\n // Put them in our data structure\n data.total.exp = expenses;\n data.total.inc = incomes;\n //Set Budget\n data.budget = budget;\n }", "function calcAll() {\n //Variable temporal para hacer la cuenta de los $subtotl2\n let cuenta = 0;\n\n let $subtotl2 = Array.from(document.querySelectorAll('.subtot'));\n let $total = document.querySelector('h2').querySelector('span');\n $subtotl2.forEach(el => {\n cuenta += Number(el.querySelector('span').textContent)\n console.log(el.querySelector('span').textContent)\n });\n $total.innerHTML = cuenta;\n}", "function impostaTotaliInDataTable(totaleStanziamentiEntrata, totaleStanziamentiCassaEntrata, totaleStanziamentiResiduiEntrata, totaleStanziamentiEntrata1, totaleStanziamentiEntrata2,\n \t\ttotaleStanziamentiSpesa, totaleStanziamentiCassaSpesa, totaleStanziamentiResiduiSpesa, totaleStanziamentiSpesa1, totaleStanziamentiSpesa2){\n\n \tvar totaleStanziamentiEntrataNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiEntrata);\n var totaleStanziamentiCassaEntrataNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiCassaEntrata);\n var totaleStanziamentiResiduiEntrataNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiResiduiEntrata);\n //anno = anno bilancio +1\n var totaleStanziamentiEntrata1NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiEntrata1);\n //anno = anno bilancio +2\n var totaleStanziamentiEntrata2NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiEntrata2);\n \n \n var totaleStanziamentiSpesaNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiSpesa);\n var totaleStanziamentiCassaSpesaNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiCassaSpesa);\n var totaleStanziamentiResiduiSpesaNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiResiduiSpesa);\n //anno = anno bilancio +1\n var totaleStanziamentiSpesa1NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiSpesa1);\n //anno = anno bilancio +2\n var totaleStanziamentiSpesa2NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiSpesa2);\n\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCompetenzaVariazione\", totaleStanziamentiEntrataNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateResiduoVariazione\", totaleStanziamentiResiduiEntrataNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCassaVariazione\", totaleStanziamentiCassaEntrataNotUndefined);\n //anno = anno bilancio +1\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCompetenzaVariazioneAnnoPiuUno\", totaleStanziamentiEntrata1NotUndefined);\n //anno = anno bilancio +2\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCompetenzaVariazioneAnnoPiuDue\", totaleStanziamentiEntrata2NotUndefined);\n \n\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCompetenzaVariazione\", totaleStanziamentiSpesaNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCassaVariazione\", totaleStanziamentiCassaSpesaNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseResiduoVariazione\", totaleStanziamentiResiduiSpesaNotUndefined);\n //anno = anno bilancio +1\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCompetenzaVariazioneAnnoPiuUno\", totaleStanziamentiSpesa1NotUndefined);\n //anno = anno bilancio +2\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCompetenzaVariazioneAnnoPiuDue\", totaleStanziamentiSpesa2NotUndefined);\n \n\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCompetenzaVariazione\", (totaleStanziamentiEntrataNotUndefined - totaleStanziamentiSpesaNotUndefined));\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaResiduoVariazione\", (totaleStanziamentiResiduiEntrataNotUndefined - totaleStanziamentiResiduiSpesaNotUndefined));\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCassaVariazione\", (totaleStanziamentiCassaEntrataNotUndefined - totaleStanziamentiCassaSpesaNotUndefined));\n \n //anno = anno bilancio +1\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCompetenzaVariazioneAnnoPiuUno\", (totaleStanziamentiEntrata1NotUndefined - totaleStanziamentiSpesa1NotUndefined));\n //anno = anno bilancio +2\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCompetenzaVariazioneAnnoPiuDue\", (totaleStanziamentiEntrata2NotUndefined - totaleStanziamentiSpesa2NotUndefined));\n }", "function updateTotal() {\n\n}", "function summing() {\n sum = 0\n for (i = 5; i < inpt.length; i = i + 4) {\n //console.log(inpt[i].value)\n if (inpt[i].value == \"\") {\n inpt[i].value = 0;\n }\n sum = sum + parseFloat(inpt[i].value)\n }\n return sum;\n }", "function renderFoot(){\n var hourlySums = [];\n var hourlyTotal = 0;\n var grandTotal = 0;\n\n for (var j=0; j < hours.length; j++){\n hourlyTotal = 0;\n for (var i =0; i < cookStores.length; i++){\n hourlyTotal += cookStores[i].cookiesEachHour[j];\n grandTotal += cookStores[i].cookiesEachHour[j];\n }\n hourlySums.push(hourlyTotal);\n }\n \n var trEl = document.createElement('tr');\n \n var tdElFirst = document.createElement('td');\n tdElFirst.textContent = 'Totals';\n trEl.appendChild(tdElFirst);\n \n for (var i=0; i < hours.length; i++){\n var tdEl = document.createElement('td');\n tdEl.textContent = hourlySums[i];\n trEl.appendChild(tdEl);\n }\n \n var tdElLast = document.createElement('td');\n tdElLast.textContent = grandTotal;\n trEl.appendChild(tdElLast);\n \n cookTable.appendChild(trEl);\n}", "function calculateTotal() {\n let tipPerPerson = (billObj._billAmount * billObj._tipAmount) / billObj._numOfPeople;\n let billPerPerson = billObj._billAmount / billObj._numOfPeople;\n let totalAmount = tipPerPerson + billPerPerson;\n if (isNaN(tipPerPerson) && isNaN(billPerPerson)) {\n return;\n }\n else {\n //This should output to DOM;\n document.querySelector(\".display_tip_value\").innerHTML = tipPerPerson.toFixed(2).toString();\n document.querySelector(\".display_total_value\").innerHTML = totalAmount.toFixed(2).toString();\n }\n ;\n}", "function sumTotal(memId){\t\n\t\tvar loanAccStr=$(\"input[id='\"+memId+\"loanId']\").val();//$(\"#\"+memId+\"loanId\").val();\n\t\tvar savAccStr=$(\"input[id='\"+memId+\"savId']\").val();//$(\"#\"+memId+\"savId\").val();\n\t\t\n\t\tvar loan_array=new Array();\n\t\tvar sav_array=new Array();\n\t\t\n\t\tloan_array=loanAccStr.split('_');\n\t\tsav_array=savAccStr.split('_');\n\t\t\n\t\tvar totalAmtShow=0\n\t\t\n\t\t//---------- Loan\n\t\tvar loanAcc=''\n\t\tvar loanAmt=0\t\t\t\n\t\tvar i=0;\n\t\twhile (i < loan_array.length){\n\t\t\tloanAcc=loan_array[i];\t\t\t\t\t\n\t\t\tloanAmt=$(\"#L\"+loanAcc).val();\n\t\t\t\n\t\t\tif (loanAmt==\"\"){\n\t\t\t\tloanAmt=0;\n\t\t\t}else{\n\t\t\t\tif (isNaN(loanAmt)){\n\t\t\t\t\tloanAmt=0;\n\t\t\t\t}\n\t\t\t\t};\t\t\t\t\t\n\t\t\ttotalAmtShow=totalAmtShow+eval(loanAmt)\t\t\t\t\t\n\t\t\ti=i+1;\n\t\t};\n\t\t//----------- Savings\n\t\tvar savAcc=''\n\t\tvar savAmt=0\t\t\t\n\t\tvar j=0;\n\t\twhile (j < sav_array.length){\n\t\t\tsavAcc=sav_array[j];\t\t\t\t\t\n\t\t\tsavAmt=$(\"#S\"+savAcc).val();\n\t\t\t\n\t\t\tif (savAmt==\"\"){\n\t\t\t\tsavAmt=0;\n\t\t\t}else{\n\t\t\t\tif (isNaN(savAmt)){\n\t\t\t\t\tsavAmt=0;\n\t\t\t\t}\n\t\t\t\t};\t\t\t\t\t\n\t\t\ttotalAmtShow=totalAmtShow+eval(savAmt)\t\t\t\t\t\n\t\t\tj=j+1;\n\t\t};\t\n\t\t//$(\"input[id='\"+memId+\"AMT']\").val(totalAmtShow);\n\t\t$(\"span[id='\"+memId+\"AMT']\").text(totalAmtShow);\n}", "total() {\n var total = 0.0\n for (var sku in this.items) {\n var li = this.items[sku]\n var price = li.quantity * li.price\n total += price\n }\n return total\n }", "function calculateTotal() {\n const phoneTotal = getInputValue('phone') * 1219;\n const caseTotal = getInputValue('case') * 59;\n const subTotal = phoneTotal + caseTotal;\n console.log(subTotal);\n\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}", "computeTotals()\n {\n if (this.file.transactions.length == 0)\n return\n\n this.totalSpendings = this.file.transactions\n .map(x => Math.min(x.amount, 0))\n .reduce((acc, x) => acc + x)\n\n this.totalIncome = this.file.transactions\n .map(x => Math.max(x.amount, 0))\n .reduce((acc, x) => acc + x)\n }", "function totale(price) {\n tot += price;\n }", "function addexptototal()\n {\n const expobj={};\n //read the value of inputamt\n const textamt=inputele.value;\n\n const textdesc=inputele2.value;\n \n //convert it to number\n const exp=parseInt(textamt,10);\n\n expobj.desc=textdesc;\n expobj.amt=textamt;\n expobj.moment=new Date();\n\n allexp.push(expobj);\n \n \n //add that value to totalvalue\n totalexp=totalexp+exp;\n \n hele.textContent=totalexp;\n\n const headingtext=`Total :: ${totalexp}`;\n hele.textContent=headingtext;\n\n renderlist(allexp);\n \n }", "calculateTotal() {\n\t\t//Réinitialise le total\n\t\tthis.total = 0\n\t\tfor (let product of this.products) {\n\t\t\tthis.total += product.price * product.number\n\t\t}\n\t}", "function calcularSubTotal() {\n subTotal = 0;\n if (coleccionProductos.length !== 0) {\n for (let producto of coleccionProductos) {\n subTotal += parseInt(producto.precio) * parseInt(producto.cantidad);\n }\n } else {\n subTotal = 0;\n }\n total = subTotal + precioEnvioGlobal;\n \n spanTotal.innerText = total;\n spanSubTotal.innerText = subTotal;\n}", "function sumarTotalPrecio(){\n\n\t\t\tvar precioItem = $('.nuevoPrecioProducto');\n\n\t\t\tvar arraySumarPrecio = [];\n\n\t\t\tfor (var i = 0; i < precioItem.length; i++){\n\n\t\t\t\tarraySumarPrecio.push(Number($(precioItem[i]).val()));\n\t\t\t\t\n\n\t\t\t}\n\n\t\t\tfunction sumarArrayPrecio(total, numero){\n\n\t\t\t\treturn total+numero;\n\n\n\t\t\t}\n\n\t\t\tvar sumaTotalPrecio = arraySumarPrecio.reduce(sumarArrayPrecio)\n\t\t\t\n\t\t\t$('#nuevoTotalVenta').val(sumaTotalPrecio);\n\t\t\t$('#totalVenta').val(sumaTotalPrecio);\n\t\t\t$('#nuevoTotalVenta').attr('total', sumaTotalPrecio);\n\t\t}", "function sumaSubtotales(){\n\n\tvar subtotales = $(\".subtotales span\");\n\tvar arraySumaSubtotales = [];\n\t\n\tfor(var i = 0; i < subtotales.length; i++){\n\n\t\tvar subtotalesArray = $(subtotales[i]).html();\n\t\tarraySumaSubtotales.push(Number(subtotalesArray));\n\t\t\n\t}\n\n\t\n\tfunction sumaArraySubtotales(total, numero){\n\n\t\treturn total + numero;\n\n\t}\n\n\tvar sumaTotal = arraySumaSubtotales.reduce(sumaArraySubtotales);\n\t\n\t$(\".sumaSubTotal\").html('<strong>PEN S/. <span>'+(sumaTotal).toFixed(2)+'</span></strong>');\n\n\t$(\".sumaCesta\").html((sumaTotal).toFixed(2));\n\n\tlocalStorage.setItem(\"sumaCesta\", (sumaTotal).toFixed(2));\n\n\n}", "function totals(arr){\n\tvar total = 0;\n\tvar t_M = 0;\n\tvar ft_M = 0;\n\tvar f_M = 0;\n\tarr.forEach(function totals(element){\n\t\tt_M += element.threesMade;\n\t\tft_M += element.freeThrowsMade;\n\t\tf_M += element.fieldGoalsMade;\n\t});\n\tf_M -= t_M;\n\tf_M *= 2;\n\tt_M *= 3;\n\ttotal += f_M + t_M + ft_M;\n\treturn total;\n}", "function calculateSubTotal()\n{\n\tvar overallSubtotalTime = 0;\n\tvar overallSubtotalTimeHoursMins = 0;\n\t\n\tfor (var i=0; i < numOfTimeEntries; i++)\n\t{\n\t\t// See if the checkbox on each row is checked or not\n\t\tvar subTotalRowChecked = $('#subTotal' + i).is(':checked');\n\t\t\n\t\tif (subTotalRowChecked)\n\t\t{\n\t\t\t// Get the values from the form\n\t\t\tvar startHour = $('#startHour' + i).val();\n\t\t\tvar startMin = $('#startMin' + i).val();\n\t\t\tvar endHour = $('#endHour' + i).val();\n\t\t\tvar endMin = $('#endMin' + i).val();\t\t\t\n\t\t\tvar timeDifference = 0;\n\t\t\t\n\t\t\t// Make sure all fields are filled out for that row then work out time difference and add to sub total\n\t\t\tif ((startHour != '') && (startMin != '') && (endHour != '') && (endMin != ''))\n\t\t\t{\n\t\t\t\ttimeDifference = calculateTimeDifference(startHour, startMin, endHour, endMin);\t\n\t\t\t}\n\t\t\t\n\t\t\t// Update subtotal\n\t\t\toverallSubtotalTime += timeDifference;\t\t\t\n\t\t}\t\t\n\t}\n\t\n\t// Round to 2dp and format wording\n\toverallSubtotalTime = roundNumber(overallSubtotalTime, 2);\n\toverallSubtotalTime = overallSubtotalTime;\n\toverallSubtotalTimeHoursMins = formatToHoursMins(overallSubtotalTime);\n\t\n\t// Update overall sub total time on page and object\n\t$('#overallSubtotalTime').text(overallSubtotalTime);\t\n\t$('#overallSubtotalTimeHoursMins').text(overallSubtotalTimeHoursMins);\t\n\ttimeStorage['overallSubtotalTime'] = overallSubtotalTime;\n\ttimeStorage['overallSubtotalTimeHoursMins'] = overallSubtotalTimeHoursMins;\n}", "function computeTotal(data, callback){\n var appleSum = 0;\n var tomatoSum = 0;\n data.Items.forEach(function(entry){\n if(entry.offeredGoods.S == 'Tomatoes')\n tomatoSum = (tomatoSum*1 +entry.Capacity.N*1);\n else\n appleSum = (appleSum*1 +entry.Capacity.N*1);\n })\n total = [\n {\"Name\": \"Apples\", \"Quota\": appleSum},\n {\"Name\": \"Tomatoes\", \"Quota\": tomatoSum}\n ]\n callback(total);\n}", "function createFooterTable(){\r\n tfoot =document.createElement('tfoot');\r\n trow=document.createElement('tr');\r\n \r\n let td=document.createElement('th');\r\n td.textContent='Total';\r\n trow.appendChild(td);\r\n let allTotal=0;\r\n for (let i =0 ;i <14 ; i++){\r\n //let element=document.querySelectorAll('tr td:nth-child('+i+')');\r\n totalColumn=0;\r\n for(let r =0 ;r<Location.allLocation.length;r++){\r\n // console.log(element[r].textContent);\r\n // totalColumn+=parseInt(element[r].textContent);\r\n totalColumn+=Location.allLocation[r].resultArr[i];\r\n allTotal+=Location.allLocation[r].resultArr[i];\r\n \r\n }\r\n console.log(totalColumn);\r\n tfooter=document.createElement('td');\r\n tfooter.textContent=totalColumn;\r\n trow.appendChild(tfooter);\r\n\r\n\r\n }\r\n tfooter=document.createElement('th');\r\n tfooter.textContent=allTotal;\r\n trow.appendChild(tfooter);\r\n tfoot.appendChild(trow);\r\n return tfoot;\r\n \r\n}", "function pollTotals()\n{\n totalOfTotals = 0;\n totalOfStaffTotals = 0;\n //Fill string with blank values\n for(var k = 0; k < hours.length; k++)\n {\n var blank = 0;\n hourlyTotal[k] = blank;\n staffTotal[k] = blank;\n }\n for(var i = 0; i < hours.length; i++)\n {\n for(var j = 0; j < locations.length; j++)\n {\n hourlyTotal[i] = hourlyTotal[i] + locations[j].cookiesHourly[i];\n // console.log (`${hourlyTotal} += ${locations[0].cookiesHourly[i]}`)\n staffTotal[i] = staffTotal[i] + locations[j].staffNeeded[i];\n // console.log (`${hourlyTotal} += ${locations[0].cookiesHourly[i]}`)\n }\n totalOfTotals += hourlyTotal[i]\n totalOfStaffTotals += staffTotal[i]\n }\n return(totalOfTotals, totalOfStaffTotals);\n}", "function PP3sumChkedBoxes(idltrs, numbChBoxes)\n {\n var totalValue = 0;\n for (var j = 1; j <= numbChBoxes; j++) \n {\n var j = j;\n var z = 1;\n for (var k = 1; k <= j - 1; k++) {\n z = z * 2;\n }\n checkBox = document.getElementById(idltrs + z);\n var chkIdStr = checkBox.id;\n //alert(chkIdStr);\n\n if (checkBox.checked)\n { \n status = status + checkBox.id + ' = checked ... ';\n var chkIdStr = checkBox.id;\n addNumb = parseInt(chkIdStr.substring(3, chkIdStr.length));\n totalValue = totalValue + addNumb;\n //alert(\"chkBx is Chked it's value = \" + addNumb + \" and Total = \" + totalValue);\n } \n else\n {\n status = status + checkBox.id + ' = NOT checked ... ';\n //alert(\"check box \" + j + \"not chked\");\n }\n }\n /////Is this needed here??? ////// document.getElementById('sumTemp').innerHTML = totalValue; //// + \" STATUS: \" + status;\n //alert(\"Returning \" + totalValue)\n return totalValue;\n}", "determineTotals(receipt) {\n let total = 0;\n receipt.inventories.forEach(inventory => {\n total += inventory.buyAmount;\n });\n return total;\n }", "function megaSum() {\n let all = 0;\n for (let i = 0; i < products.length; i++) {\n all += products[i].total;\n\n }\n console.log(all, 'this all');\n return all;\n}", "function handleTotals() {\n let total = 0;\n let tds = table.querySelectorAll(\"#table > tbody > tr > td:nth-child(9)\");\n tds.forEach((el) => (total += parseFloat(el.textContent)));\n subtotal.innerText = total;\n}", "getTotal() {\n //Creating variable total with value of 0.\n let total = 0;\n // using built-in forEach(), calculate the total using the price field of each object.\n let beverageTotal = this._beverages.forEach(function(beverage) {\n total += parseFloat(beverage.price);\n });\n let appetizerTotal = this._appetizers.forEach(function(appetizer) {\n total += parseFloat(appetizer.price);\n });\n let mainCourseTotal = this._mainCourses.forEach(function(mainCourse) {\n total += parseFloat(mainCourse.price);\n });\n let dessertTotal = this._desserts.forEach(function(dessert) {\n total += parseFloat(dessert.price);\n });\n console.log(`The total is ${total}`);\n //Return the total variable and set its precisions to two decimal places.\n return total.toFixed(2);\n }", "function sumAll( ) {\n let sum = 0;\n // TODO: loop to add items\n return sum;\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 calculateSummary() {\n let subtotal = 0;\n for (var i = 0; i < elements.length; i++) {\n let item = elements[i];\n subtotal = subtotal + prices.prices[item.id];\n }\n subtotal = parseFloat(subtotal.toFixed(2));\n let tax = parseFloat((0.06 * subtotal).toFixed(2));\n let total = parseFloat((subtotal + 5.99 + tax).toFixed(2));\n return { subtotal, tax, total };\n }", "function calculateItemsAndTotal(){\n var li_perCopy = {};\n var li_perSubmission = {};\n var perCopyDescription = '';\n var perCopyCostFinal = 0;\n//This function builds the final items[] and total to be displayed from global variables itemsPerCopy[],perCopyTotal, itemsPerSubmission [], & perSubmissionTotal\n//the functions above set an items array for perCopy vs perSubmission costs.\n //the code below adds a summary line item for each type and then adds both to items[]\n\n //perCopy\n perCopyDescription += '$' + perCopyTotal + ' per copy x ' + copyCount + (copyCount == 1 ? ' copy' : ' copies');\n perCopyCostFinal += perCopyTotal * copyCount;\n\n li_perCopy = {\n name: 'Total Per Copy Cost',\n description: perCopyDescription,\n cost: perCopyCostFinal,\n style: 'OPTION_1'\n };\n\n itemsPerCopy.push(li_perCopy);\n total += perCopyCostFinal;\n\n for (var i=0; i < itemsPerCopy.length; i++){\n items.push(itemsPerCopy[i]);\n }\n\n for (var c=0; c < itemsPerSubmission.length; c++){\n items.push(itemsPerSubmission[c]);\n }\n\n //perSubmission Summary line item\n\n li_perSubmission = {\n name: 'Total Per Submission Cost',\n description: '',\n cost: perSubmissionTotal,\n style: 'OPTION_1'\n };\n\n items.push(li_perSubmission);\n total += perSubmissionTotal;\n}", "function calculateTotal(){\n total=0;\n shoppingListArray.forEach(function(items) { \n//totals up our number and adds it to the div with the ID of \"yourGrandTotal\", javascript was displaying this output as a string, so I added Number() method to render it as a number\n total += Number(items.price); \n //used toFixed method to render the total with 2 decimal places, concaconated with a string to add the $\n document.getElementById(\"yourGrandTotal\").textContent = \"TOTAL: $\" + total.toFixed(2);\n });\n}", "function getTotals(){\n \n var totals = []; \n var totalCalories =0; \n var totalProtein= 0; \n var totalFat=0 ; \n var totalCarbs= 0; \n var totalFiber=0 ; \n \n //searching through the loop \n for(var i = 0 ; i < menu.length; i++){\n \n var foodObj = menu[i]; \n \n for(var info in foodObj){\n \n var array = foodObj[info]; \n \n switch(info){\n \n case 'Calories':\n totalCalories+=array[0];\n break;\n case 'Protein':\n totalProtein+=array[0];\n break;\n case 'Fat':\n totalFat+=array[0]; \n break;\n case 'Carbs':\n totalCarbs+=array[0];\n break;\n case 'Fiber':\n totalFiber+=array[0]; \n break; \n \n }\n }\n }\n \n totals.push(totalCalories, totalProtein, totalFat, totalCarbs, totalFiber);\n \n calcStats(totals); \n}", "function calculaElTotal(elEvento) {\n\t\t//Añade el encabezado de la tabla\n\t\tdocument.getElementById(\"tablaTotal\").innerHTML='<tr><td class=\"ima\"><b>Imagen</b></td><td class=\"pro\"><b>Producto</b></td><td class=\"uni\"><b>Unidades</b></td><td class=\"preUni\"><b>Precio Unidad</b></td><td class=\"preTotal\"><b>Total</b></td></tr>';\n\t\t//Inicializacion de las variables para esta funcion:\n\t\tvar carroTotal = 0;\n\t\t//Muestra el carrito de la compra\n\t\tfor (i in pro){\n\t\t\tvar tablaTotal = document.getElementById(\"tablaTotal\").innerHTML;\n\t\t\tvar preTotal = 0;\n\t\t\t//Cuenta el numero de productos\n\t\t\tif (uniUser[i].value != 0){\n\t\t\t\t//Calcula el totalUnidades y rellena el carro de la compra\n\t\t\t\tpreTotal = pro[i].precio * uniUser[i].value;\n\t\t\t\tcarroTotal = carroTotal + preTotal;\n\t\t\t\tdocument.getElementById(\"tablaTotal\").innerHTML = tablaTotal + '<tr class=\"proCarrito\"><td><img class=\"rounded\" src=\"'+pro[i].imagen+ '\" alt=\"'+pro[i]+'\"></td><td>' +pro[i].nombre+ '</td><td>' +uniUser[i].value+ '</td><td>' +pro[i].precio+ '</td><td id=\"preTotal' +i+'\" name=\"preTotal\">' +preTotal+ '</td></tr>';\n\t\t\t}\t}\n\t\t//Se obtiene el subTotal\n\t\tif(carroTotal>0){\n\t\t\tvar totalIVA = (carroTotal * IVA);\n\t\t\tvar totalAPagar = carroTotal + totalIVA;\n\t\t}\n\t\ttotalIVA=totalIVA*100;\n\t\ttotalIVA=Math.floor(totalIVA);\n\t\ttotalIVA=totalIVA/100;\n\n\t\ttotalAPagar=totalAPagar*100;\n\t\ttotalAPagar=Math.floor(totalAPagar);\n\t\ttotalAPagar=totalAPagar/100;\n\t\t//Se añade a la tabla el TOTAL que suma el carrito:\n\t\ttablaTotal = document.getElementById(\"tablaTotal\").innerHTML;\n\t\tdocument.getElementById(\"tablaTotal\").innerHTML = tablaTotal + '<tr><td>&nbsp;</td>&nbsp;<td></td><td></td><td class=\"preUni\"><b>Subtotal: </b></td><td class=\"preTotal\"><b>' +\"$ \"+carroTotal+ '</b></td></tr>' +'<tr><td>&nbsp;</td>&nbsp;<td></td><td></td><td class=\"preUni\"><b>IVA ('+(IVA*100)+'%): </b></td><td class=\"preTotal\"><b>' +\"$ \"+totalIVA+ '</b></td></tr>' + '<tr><td>&nbsp;</td>&nbsp;<td></td><td></td><td class=\"preUni\"><b>Total: </b></td><td class=\"preTotal\" id=\"totalAPagar\"><b>'+\"$ \"+totalAPagar+ '</b></td></tr>';\n\t}", "function totaldeftable(t) {\n var contdef=Number($(\"#tdefx\").val());\n var cit=[[]];\n var deftroopmail=[[]];\n var counterdef=0;\n for (var i in t) {\n var tid=t[i].id;\n var tempx=Number(tid % 65536);\n var tempy=Number((tid-tempx)/65536);\n var tcont=Number(Math.floor(tempx/100)+10*Math.floor(tempy/100));\n if (contdef==tcont) {\n if (t[i].Ballista_total>0 || t[i].Ranger_total>0 || t[i].Triari_total>0 || t[i].Priestess_total || t[i].Arbalist_total>0 || t[i].Praetor_total>0 ) {\n counterdef+=1;\n\t\t\t\t\tvar tempt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];\n tempt[1]=t[i].Ballista_total;\n tempt[2]=t[i].Ranger_total;\n tempt[3]=t[i].Triari_total;\n tempt[4]=t[i].Priestess_total;\n tempt[8]=t[i].Arbalist_total;\n tempt[9]=t[i].Praetor_total;\n\t\t\t\t\tvar tempts=0;\n for (var j in tempt) {\n tempts+=tempt[j]*ttts[j];\n }\n deftroopmail.push([tempt,tempts]);\n cit.push([tempx,tempy,tempts,tempt,t[i].c,tid]);\n }\n }\n if(contdef==\"99\"){\n if (t[i].Stinger_total>0 || t[i].Galley_total>0) {\n\t\t\t\t\tcounterdef+=1;\n\t\t\t\t\tvar tempt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];\n tempt[1]=t[i].Ballista_total;\n tempt[2]=t[i].Ranger_total;\n tempt[3]=t[i].Triari_total;\n tempt[4]=t[i].Priestess_total;\n tempt[8]=t[i].Arbalist_total;\n tempt[9]=t[i].Praetor_total;\n tempt[14]=t[i].Galley_total;\n tempt[15]=t[i].Stinger_total;\n var tempts=0;\n for (var j in tempt) {\n tempts+=tempt[j]*ttts[j];\n }\n deftroopmail.push([tempt,tempts]);\n cit.push([tempx,tempy,tempts,tempt,t[i].c,tid]);\n }\n }\n\t\t}\n\n cit.sort(function(a,b) {return b[2]-a[2];});\n $(\"#asdfgd\").text(\"Total:\"+counterdef);\n var totaldeftab=\"<table id='tdeftable'><thead><th></th><th>City</th><th>Coords</th><th>TS</th><th>type</th></thead><tbody>\";\n for (var i in cit) {\n if(i>0){\n totaldeftab+=\"<tr><td><button class='greenb chcity' id='cityGoTowm' a='\"+cit[i][5]+\"'>Go To</button></td><td>\"+cit[i][4]+\"</td><td class='coordblink shcitt' data='\"+cit[i][5]+\"'>\"+cit[i][0]+\":\"+cit[i][1]+\"</td>\";\n //style='font-size: 9px;border-radius: 6px;width: 80%;height: 22px;padding: 0;white-space: nowrap;'\n\t\t\t\ttotaldeftab+=\"<td>\"+cit[i][2]+\"</td><td><table>\";\n for (var j in cit[i][3]) {\n if (cit[i][3][j]>0) {\n totaldeftab+=\"<td><div class='\"+tpicdiv20[j]+\"'></div></td>\";\n }\n }\n totaldeftab+=\"</table></td></tr>\";\n }\n }\n totaldeftab+=\"</tbody></table>\";\n $(\"#Tdefbox\").html(totaldeftab);\n $(\"#tdeftable td\").css(\"text-align\",\"center\");\n $(\"#tdeftable td\").css(\"height\",\"26px\");\n var newTableObject = document.getElementById('tdeftable');\n sorttable.makeSortable(newTableObject);\n deftroopmail.sort(function(a,b) {return b[1]-a[1];});\n $(\"#maildef\").click(function() {\n //$(\"#mailComposeBox\").show();\n var conttemp=$(\"#tdefx\").val();\n var mailto=\"<p>Number of defensive castles is '\"+counterdef+\"'</p>\";\n mailto+='</p><table class=\"mce-item-table\" style=\"width: 266.273px; \"data-mce-style=\"width: 266.273px; \"border=\"1\" data-mce-selected=\"1\"><thead><th>Number</th><th>Troop</th><th>TS Amount</th></thead><tbody>';\n for (var i in deftroopmail) {\n if(i>0){\n mailto+='<tr><td style=\"text-align: center;\" data-mce-style=\"text-align: center;\">'+i+'</td>';\n mailto+='<td style=\"text-align: center;\" data-mce-style=\"text-align: center;\"><table>';\n for (var j in deftroopmail[i][0]) {\n if (deftroopmail[i][0][j]>0) {\n mailto+='<td>'+ttname[j]+'</td>';\n }\n }\n mailto+='</table></td>';\n mailto+='<td style=\"text-align: center;\" data-mce-style=\"text-align: center;\">'+deftroopmail[i][1]+'</td></tr>';\n }\n }\n mailto+=\"</tbody></table>\";\n if(conttemp==99){conttemp=\"Navy\";}\n jQuery(\"#mnlsp\")[0].click();\n jQuery(\"#composeButton\")[0].click();\n var temppo=$(\"#mailname2\").val();\n $(\"#mailToto\").val(temppo);\n $(\"#mailToSub\").val(conttemp+\" Defensive TS\");\n var $iframe = $('#mailBody_ifr');\n $iframe.ready(function() {\n $iframe.contents().find(\"body\").append(mailto);\n });\n });\n }", "function get_total(data){\n return d3.sum(data,function(d){return d.PWT;});\n}", "imprimirTotal(){\n const divTotal = document.createElement('div')\n divTotal.classList.add('totalPlatoPedido')\n\n let totalPedido = 0\n pedido.forEach(precioDet => {\n totalPedido = totalPedido + parseInt(precioDet.precio)\n })\n\n // ---- Scripting del total del pedido --\n const totDetPedido = document.createElement('li')\n totDetPedido.classList.add('totDetLi')\n\n totDetPedido.textContent = totalPedido\n\n // ---- Agregar los párrafos al divDetalle ---\n divTotal.appendChild(totDetPedido)\n\n // ---- Agregar el total al HTML --------\n totalPedidoMostrar.appendChild(divTotal) \n }", "function getTotal() {\n if (!runningTotal) {\n operate(x, sign, y);\n runningTotal = true;\n } else if (runningTotal) {\n operate(total, sign, y);\n } \n}", "function findSum() {\n tot = 0;\n for (var i = 0; i < cart.length; i++) {\n tot = tot + cart[i].price\n\n\n //append the new total to html\n $('.total').text(tot);\n }\n\n}", "function sumData(data) {\n {\n var printOut = 0;\n\n//sum together all the values in the selected range\n for (var x = 0 ; x < data.length; x++) {\n for (var y = 0; y < data[x].length; y++) {\n printOut += data[x][y];\n }\n }\n//print results in task pane\n\t\tdocument.getElementById(\"results\").innerText = printOut;\n }\n}", "function calcTotal() {\n let total = 0;\n for (let item of itemList) {\n total += Number(item.price);\n }\n console.log(\"this is the total\", total);\n return total;\n }", "function calculateSubTotal() {\n totalSum = 0;\n $('.total_Prices').each(function(i, obj) { \n totalSum = Number(totalSum) + Number($('#total_price_amount'+i).html().replace(\"$\",''));\n });\n $('#total_p').val(totalSum);\n }" ]
[ "0.66742927", "0.6452115", "0.6450663", "0.6289431", "0.62810147", "0.616575", "0.6152211", "0.6145989", "0.6137838", "0.61357325", "0.610488", "0.60837257", "0.60645", "0.606052", "0.60527915", "0.6047831", "0.6043698", "0.6020418", "0.60203606", "0.60196894", "0.60102344", "0.6005622", "0.597229", "0.5968174", "0.59662646", "0.5961531", "0.5958872", "0.595712", "0.5951248", "0.5949536", "0.59268945", "0.5907485", "0.59031475", "0.59022135", "0.5901734", "0.5895886", "0.58947855", "0.5890019", "0.588688", "0.5883824", "0.58769685", "0.5874995", "0.58746135", "0.58659524", "0.5864973", "0.58633995", "0.58313704", "0.5828843", "0.58277", "0.58039534", "0.57978815", "0.5796872", "0.5793228", "0.57931113", "0.57902634", "0.5781604", "0.57782644", "0.577802", "0.5770756", "0.57686603", "0.5760419", "0.5749213", "0.574767", "0.57457626", "0.57420945", "0.57418144", "0.5740996", "0.5739106", "0.5737237", "0.573493", "0.5719542", "0.57094616", "0.57054764", "0.57001764", "0.5696398", "0.56956184", "0.5694955", "0.5692218", "0.5688851", "0.5684961", "0.5684424", "0.56797993", "0.5679377", "0.5679103", "0.5677118", "0.5670485", "0.5667356", "0.5666838", "0.5662184", "0.5661319", "0.5659364", "0.5657202", "0.56534183", "0.56518126", "0.56465256", "0.56441283", "0.5637346", "0.5636327", "0.5627223", "0.5626723", "0.56249714" ]
0.0
-1
20, 60, 40 Async/Await based solution
async function logNumbersAsync(number) { const a = await promise(number + 10); const b = await promise(a * 3); await promise(b - 20); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function executeHardAsync() {\n const r1 = await fetchUrlData(apis[0]);\n const r2 = await fetchUrlData(apis[1]);\n}", "async function n(s,n,a){n=l$2.from(n);const u=r$1(s);return r(u,n,a).then((r=>{const e=r.data,o={};return Object.keys(e).forEach((r=>o[r]=g.fromJSON(e[r]))),o}))}", "function demoOfAsyncAwait(){\n\tfunction mockRequest(second){\n\t const args = [...arguments];\n\t [second,...params] = args;\n\t return new Promise((resolve,reject)=>{\n\t setTimeout(function() {resolve(params)},second*1000);\n\t })\n\t};\n\t //继发,依次执行\n\t async function jifa(){\n\t const a= await mockRequest(1,1,2);\n\t const b= await mockRequest(1,1,2);\n\t const c= await mockRequest(1,1,2);\n\t return [...a,...b,...c];\n\t};\n\t //jifa().then(a=>console.log(a));\n\t \n\t //并发,同时执行\n\t async function wrong_bingfa(){\n\t return Promise.all([await mockRequest(3,1,2),\n\t await mockRequest(3,1,2),\n\t await mockRequest(3,1,2)])\n\t .then(([a,b,c])=>[...a,...b,...c]);\n\t }\n\t //wrong_bingfa()依然是继发执行\n\t async function bingfa(){\n\t const [a,b,c]= await Promise.all([mockRequest(3,10,2),\n\t mockRequest(3,10,2),\n\t mockRequest(3,10,2)]);\n\t return [...a,...b,...c];\n\t\t }\n\t//bingfa().then(a=>console.log(a));\n\t \n\t async function bingfa2(){\n\t const arr=[[4,11,2],[4,11,2],[4,11,2]].map(async item=>{\n\t return await mockRequest(...item);\n\t });\n\t //!!!!!!!! items of 'arr' are Promise instances, not Array instances.\n\t const res=[];\n\t for(const p of arr){\n\t res.push(await p);\n\t }\n\t [a,b,c]=res;\n\t return [...a,...b,...c];\n\t }\n\t/*上面代码中,虽然map方法的参数是async函数,但它是并发执行的,\n\t因为只有async函数内部是继发执行,外部不受影响。\n\t后面的for..of循环内部使用了await,因此实现了按顺序输出。\n*/\n\tbingfa2().then(a=>console.log(a));\n}", "async function executeSeqWithForAwait(urls) {\n const responses = [];\n const promises = urls.map((url) => {\n return fetchUrlDataWithAsyncAwait(url);\n });\n\n for await (const res of promises) {\n console.log(res);\n responses.push(res);\n }\n console.log(responses);\n}", "async function fivePromise() { \n return 5;\n }", "async function getData() {\n let data = await getUsername1()\n data = await getAge1(data)\n data = await getDepartment1(data)\n data = await printDetails1(data)\n}", "async function consume(){\n let addRes = await add(5);\n let subRes = await sub(addRes);\n let mulRes = await mul(subRes);\n let divRes = await div(mulRes);\n console.log( addRes, subRes, mulRes, divRes );\n}", "async function main() {\n\n\n const stubTasks = range(50).map(n => () => delay(500).then(() => `#${n} completed`))\n\n return runInParallel(stubTasks, 5, res => {console.log(res)})\n}", "async function v3(v4,v5,v6,v7,v8) {\n}", "async function go() {\n\tconsole.log('start');\n\tconst res = await breathe(1000);\n\tconsole.log(res);\n\tconst res2 = await breathe(300);\n\tconsole.log(res2);\n\tconst res3 = await breathe(750);\n\tconsole.log(res3);\n\tconst res4 = await breathe(900);\n\tconsole.log(res4);\n\tconsole.log('end');\n}", "function performAsyncImagesAnn(imgUrls, username, minScore, widgetCalling){\n return new Promise((resolve, reject) => {\n\n let annPromises = [];\n let imgAnnotations = [];\n\n for (let i=0; i<imgUrls.length; i++){\n\n setTimeout(()=>{\n //make a combo call (azure computer vision call + gcloud vision + azure face) for each url\n annPromises.push( new Promise(resolve2 => {\n cogniCombine.multipleAnalysisRemoteImage(imgUrls[i], username, minScore)\n\n .then(data => {\n imgAnnotations.push(data);\n resolve2(data);\n\n // JUST if the user is logged and using the widget\n // save on the cache system on first (or later if the caching system is disabled) single img annotation\n if(username != undefined && username != '' && widgetCalling)\n cogniCombine.encodeB64Annotation(username, [data]);\n })\n\n .catch(dataErr => { //Annotation process for an image url has gone into error:\n imgAnnotations.push(dataErr);\n resolve2(dataErr);\n });\n }));\n\n }, i*timeInterval);// perform calls detached at least 60-80s from one another (in order to not exceed the upper bound limit)\n }\n\n //when all the annotations have been launched and executed, returned them\n setTimeout(() =>\n {\n Promise.all(annPromises)\n .then(() => resolve(imgAnnotations));\n\n }, imgUrls.length * timeInterval);\n\n\n });\n}", "async function asyncWrapperFunction() {\r\n await htmlRouting();\r\n await videoRouting();\r\n const data = await dataProcessing();\r\n const nodes = await nodesGetting();\r\n dynamic(data,nodes);\r\n display(data,nodes);\r\n}", "function testFunctions()\n{\n let _count = 100;\n const _getFn = () =>\n {\n const _n = _count++;\n return (cb) => setTimeout(\n () => cb(null, _n),\n Math.random() * 50\n );\n };\n jfSync(\n [\n _getFn(),\n _getFn(),\n _getFn(),\n _getFn(),\n _getFn()\n ],\n (error, data) => checkData([100, 101, 102, 103, 104])\n );\n}", "async method(){}", "static async algo(n){\n\n let req = n, share = new fairShare(),\n a = bigInteger(1), b = bigInteger(0);\n\n while (n--){\n let temp = a;\n a = a.plus(b);\n b = temp;\n // Let other functions run in parallell after 10 ms\n await share.do(); \n }\n\n return {\n request: req,\n stats: share.stats,\n result: b.toString()\n };\n\n }", "async function fivePromise() {\n return 5;\n}", "function loop_request(){\r\n let waisted_count = 0; // set to 0\r\n \r\n //requset from api\r\n async function StartR() \r\n {\r\n // request, fetch api data\r\n const response = await fetch(api_url); //fetch\r\n const data = await response.json(); //api\r\n let json_split = JSON.parse(JSON.stringify(data)); // split api data\r\n\r\n // only for the first request\r\n if (beginvar == true){\r\n console.log(\"first try\");\r\n render_call(json_split, waisted_count, beginvar);\r\n last_api = json_split[0].id;\r\n beginvar = false; \r\n } \r\n else{\r\n console.log(\"secound try\");\r\n waisted_count = while_count(last_api, json_split);\r\n render_call(json_split, waisted_count, beginvar);\r\n }\r\n console.log(\"assync vege 15perc \" + \"Last API: \" + last_api);\r\n }\r\n StartR();\r\n}", "async function executar(){\n await esperarPor(2000)\n console.log('Async 1');\n\n await esperarPor(2000)\n console.log('Async 2');\n\n await esperarPor(2000)\n console.log('Async 3');\n\n}", "async function main() {\n try {\n console.time('promise-time')\n const user = await getUser()\n // const phonenumber = await getUserPhoneNumber(user.id)\n // const address = await getUserAddressAsync(user.id)\n\n const response = await Promise.all([\n getUserPhoneNumber(user.id),\n getUserAddressAsync(user.id)\n ])\n\n const phonenumber = response[0];\n const address = response[1];\n\n const data = {...user, ...phonenumber, ...address}\n\n console.table(data)\n console.timeEnd('promise-time')\n \n } catch(error) {\n console.log('Anything is wrong', error)\n }\n}", "async function test() {}", "async oldAPImain() {\n // create objects\n let promises = [];\n for (const obj of utils_1.oldAPIStates) {\n const id = obj._id;\n // use extend to update stuff like types if they were wrong, but preserve name\n promises.push(this.extendObjectAsync(id, obj, { preserve: { common: ['name'] } }));\n }\n await Promise.all(promises);\n promises = [];\n promises.push(this.requestStateAndSetOldAPI(`M03`, `status.production`));\n promises.push(this.requestStateAndSetOldAPI(`M04`, `status.consumption`));\n promises.push(this.requestStateAndSetOldAPI(`M05`, `status.relativeSoc`));\n promises.push(this.requestStateAndSetOldAPI(`M06`, `status.operatingMode`));\n promises.push(this.requestStateAndSetOldAPI(`M07`, `status.consumptionL1`));\n promises.push(this.requestStateAndSetOldAPI(`M08`, `status.consumptionL2`));\n promises.push(this.requestStateAndSetOldAPI(`M09`, `status.consumptionL3`));\n promises.push(this.requestStateAndSetOldAPI(`M34`, `status.pacDischarge`));\n promises.push(this.requestStateAndSetOldAPI(`M35`, `status.pacCharge`));\n try {\n await Promise.all(promises);\n await this.setState(`info.lastSync`, Date.now(), true);\n const state = await this.getStateAsync(`info.connection`);\n if (!(state === null || state === void 0 ? void 0 : state.val)) {\n await this.setState(`info.connection`, true, true);\n }\n }\n catch (e) {\n this.log.warn(`[DATA] Error getting Data ${e.message}`);\n }\n const pollStates = async () => {\n // poll states every configured seconds\n const promises = [];\n promises.push(this.requestStateAndSetOldAPI(`M03`, `status.production`));\n promises.push(this.requestStateAndSetOldAPI(`M04`, `status.consumption`));\n promises.push(this.requestStateAndSetOldAPI(`M05`, `status.relativeSoc`));\n promises.push(this.requestStateAndSetOldAPI(`M06`, `status.operatingMode`));\n promises.push(this.requestStateAndSetOldAPI(`M34`, `status.pacDischarge`));\n promises.push(this.requestStateAndSetOldAPI(`M35`, `status.pacCharge`));\n promises.push(this.requestStateAndSetOldAPI(`M07`, `status.consumptionL1`));\n promises.push(this.requestStateAndSetOldAPI(`M08`, `status.consumptionL2`));\n promises.push(this.requestStateAndSetOldAPI(`M09`, `status.consumptionL3`));\n try {\n await Promise.all(promises);\n this.setState(`info.lastSync`, Date.now(), true);\n this.setStateChanged(`info.connection`, true, true);\n }\n catch (e) {\n await this.setStateChangedAsync(`info.connection`, false, true);\n this.log.warn(`[DATA] Error getting Data ${e.message}`);\n }\n this.polling = setTimeout(pollStates, this.pollingTime);\n };\n pollStates();\n }", "async function betterWay() {\n const IDs = await getIDs;\n console.log(IDs);\n const firstRecipe = await getRecipe(IDs[2]);\n console.log(firstRecipe);\n const secondRecipe = await getRelated('Code Dozman');\n console.log(secondRecipe);\n}", "async function process1(start, params) {\n // console.log(params)\n let careerLink = params.joburl;\n let dataSet = await allLinksApi(careerLink);\n dataSet = JSON.parse(dataSet)\n let joburl = careerLink;\n let links = dataSet;\n if (dataSet.hasOwnProperty('success')) {\n links = dataSet.success\n }\n let domain = await domainGetter(joburl)\n if (domain.indexOf('workday') >= 0 || domain.indexOf('icims') >= 0)\n return links;\n let jobs = [],\n noJobs = [];\n await Promise.all(\n links.map(async data => {\n if (!endsWithUrl(data.Link)) {\n jobs.push(data)\n } else {\n noJobs.push(data)\n }\n })\n )\n // return {jobs,noJobs}\n let totalJobsCount = jobs.length,\n noJobsCount = noJobs.length,\n totalLinks = links.length\n let indexSelector = 1;\n if (totalJobsCount > 50) {\n indexSelector = Math.round(totalJobsCount / 50);\n if (indexSelector <= 1) {\n indexSelector = 2\n }\n };\n console.log(\"jobs..............................\")\n console.log(jobs)\n var jobUrls = _.uniq(_.map(jobs, 'Link'));\n console.log(\"joburls.................................\");\n console.log(jobUrls);\n console.log(indexSelector)\n let HCSCheck = [];\n for (let i = 0; i < jobUrls.length; i++) {\n if (i % indexSelector == 0 && jobUrls[indexSelector * i] != null) {\n HCSCheck.push(jobUrls[indexSelector * i]);\n }\n }\n console.log(\"hcs check\")\n console.log(HCSCheck)\n var mostCommonString = await mostCommonSubstring(HCSCheck);\n console.log(\"1st common string\", mostCommonString)\n // let is_commonString=await Promise.all(\n var is_commonString = \"\";\n jobSelectors.forEach(selector => {\n if ((mostCommonString.toLowerCase().indexOf(selector.toLowerCase()) != -1 || selector.toLowerCase().indexOf(mostCommonString.toLowerCase()) != -1) && mostCommonString != \"\") {\n is_commonString = selector;\n }\n\n })\n // )\n console.log(\"iscommon string\", is_commonString)\n // console.log(is_commonString)\n if (is_commonString != \"\") {\n let jobUrls2 = await jobs.filter(element => {\n return element.Link.includes(mostCommonString)\n });\n return {\n \"HCS\": mostCommonString,\n \"allLinks\": links,\n \"perfectJobs\": jobUrls2,\n \"perfectJobCount\": jobUrls2.length\n }\n } else {\n\n let htmlJobs = []\n await Promise.all(\n jobUrls.map(async url => {\n if (jobUrls.indexOf(url) % indexSelector == 0) {\n let data = await apiRequestFuntionForHTML(start, url, '/htmlPlainText', false);\n data.url = url;\n htmlJobs.push(data);\n }\n })\n )\n log(start, joburl, \"HTML JOBS DONE\");\n let pc_api = roundround(pc);\n let pageCheckJob = [],\n pageCheckNoJob = []\n await Promise.all(\n htmlJobs.map(async data => {\n // console.log(data.url+\" is came for processing\");\n API_URI = pc_api()\n // console.log(API_URI)\n let pageCheck = await IS_Job(data.url, data.jobBody, API_URI);\n pageCheck = JSON.parse(pageCheck);\n // console.log(pageCheck.Status+\" is came for processing\");\n if (pageCheck.Status == true) {\n\n pageCheckJob.push(data.url)\n } else {\n pageCheckNoJob.push(data.url)\n }\n })\n )\n log(start, joburl, \"PAGE CHECK DONE\");\n\n\n mostCommonString = await mostCommonSubstring(pageCheckJob);\n jobUrls2 = await jobs.filter(element => {\n return element.Link.includes(mostCommonString)\n });\n // console.log(jobUrls2);\n console.log(mostCommonString)\n\n return {\n \"HCS\": mostCommonString,\n \"allLinks\": links,\n \"pageCeckUrls\": pageCheckJob,\n \"perfectJobs\": jobUrls2,\n \"perfectJobCount\": jobUrls2.length\n }\n }\n\n}", "async function asyncPromiseAll() {\n //PLACE YOUR CODE HERE:\n}", "async function parallel(count) {\n const swappiPeople = [];\n for (let i = 1; i <= count; i++) {\n swappiPeople.push(\n //Observe no await\n fetch(\"http://api.icndb.com/jokes/random\" )\n .then(res => { return res.json() }));\n }\n const allEntries = await Promise.all(swappiPeople);\n console.log(allEntries.map(p=>p.value.joke).join(\"\\n\")); \n }", "async mainLoop() {\n return new Promise((resolve) => {\n forEachLimit(\n Array.from({ length: this.asyncPage }, (_, k) => k + 1),\n this.asyncTasks,\n async (item) => {\n const body = await this.buildRequest(item);\n\n let totalResultCount = body.match(/\"totalResultCount\":\\w+(.[0-9])/gm);\n\n if (totalResultCount) {\n this.totalProducts = totalResultCount[0].split(\n 'totalResultCount\":'\n )[1];\n }\n this.grabProduct(body, item);\n },\n () => {\n resolve();\n }\n );\n });\n }", "async function m(m,n,s){const p=r$1(m);return S(p,R.from(n),{...s}).then((o=>({count:o.data.count,extent:M.fromJSON(o.data.extent)})))}", "async function concurrent() {\n const firstPromise = firstAsyncThing();\n const secondPromise = secondAsyncThing();\n console.log(await firstPromise, await secondPromise);\n }", "async function main() {\n try {\n console.time(\"medida-promise\");\n const usuario = await obterUsuario();\n // const telefone = await obterTelefone(usuario.id);\n // const endereco = await obterEnderecoAsync(usuario.id);\n const [telefone, endereco] = await Promise.all([\n obterTelefone(usuario.id),\n obterEnderecoAsync(usuario.id),\n ]);\n\n console.timeEnd(\"medida-promise\");\n console.log(`\n Nome: ${usuario.nome},\n Telefone: (${telefone.dddd}) ${telefone.telefone}.\n Enderco: Rua ${endereco.rua}, ${endereco.numero}\n `);\n } catch (error) {\n console.log(\"DEU RUIM\", error);\n }\n}", "async function s$2(s,n,m){const p=r$1(s);return p$1(p,R.from(n),{...m}).then((o=>o.data.count))}", "async function parallel(count) {\n const swappiPeople = [];\n for (let i = 1; i < count; i++) {\n swappiPeople.push(\n //Observe no await\n fetch(\"https://swapi.co/api/people/\" + i)\n //returns whichever person is acquired first\n .then(res => { return res.json() }));\n }\n const all = await Promise.all(swappiPeople);\n console.log(all.map(p => p.name).join(\", \"));\n\n}", "async function test() {\n await testStartup();\n let i = 0;\n while(true) {\n console.log('Start batch number', i);\n // await testBlockAPI();\n await testAbi();\n // await testClassic();\n console.log('Finish batch number', i);\n i++;\n }\n}", "async function app() {\n try {\n // const clientes = await descargarNuevosClientes();\n // const pedidos = await descargarUltimosPedidos();\n // console.log(clientes);\n // console.log(pedidos);\n\n const resultado = await Promise.all([descargarNuevosClientes(), descargarUltimosPedidos()]); // Como estamos haciendo async tenemos que poner el await, con Promise.all hacemos un arreglo el cual ejecutara las dos funciones al mismo tiempo \n console.log(resultado[0]);\n console.log(resultado[1]);\n } catch (error) {\n \n console.log(error);\n }\n}", "async function main(){\r\n\t//test getPersonById !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n try{\r\n\t\tlet p = await people.getPersonById(43);\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('getPersonById passed successfully \\n');\r\n }catch(e){\r\n console.log (e);\r\n\t\tconsole.error('getPersonById failed test case \\n');\r\n }\r\n\ttry{\r\n\t\tlet p = await people.getPersonById(-20);\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('getPersonById did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('getPersonById failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await people.getPersonById(15000);\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('getPersonById did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('getPersonById failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await people.getPersonById();\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('getPersonById did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('getPersonById failed successfully \\n');\r\n\t}\r\n\t\r\n\t//test howManyPerState !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n\ttry{\r\n\t\tlet p = await people.howManyPerState('CO');\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('howManyPerState passed successfully \\n');\r\n }catch(e){\r\n console.log (e);\r\n\t\tconsole.error('howManyPerState failed test case \\n');\r\n }\r\n\ttry{\r\n\t\tlet p = await people.howManyPerState(5000);\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('howManyPerState did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('howManyPerState failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await people.howManyPerState('WY');\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('howManyPerState did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('howManyPerState failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await people.howManyPerState();\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('howManyPerState did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('howManyPerState failed successfully \\n');\r\n\t}\r\n\t\r\n\t//test personByAge !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n\ttry{\r\n\t\tlet p = await people.personByAge(500);\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('personByAge passed successfully \\n');\r\n }catch(e){\r\n console.log (e);\r\n\t\tconsole.error('personByAge failed test case \\n');\r\n }\r\n\ttry{\r\n\t\tlet p = await people.personByAge(50000);\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('personByAge did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('personByAge failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await people.personByAge('WY');\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('personByAge did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('personByAge failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await people.personByAge();\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('personByAge did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('personByAge failed successfully \\n');\r\n\t}\r\n\t\r\n\t//test peopleMetrics !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n\ttry{\r\n\t\tlet p = await people.peopleMetrics();\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('peopleMetrics passed successfully \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('peopleMetrics failed test case \\n');//I never throw here, so I don't think it can actually go here, keeping it just in case\r\n\t}\r\n\t\r\n\t//test listEmployees !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n\ttry{\r\n\t\tlet p = await work.listEmployees();\r\n\t\t//console.log(util.inspect(p, {depth: null, maxArrayLength: null}));\r\n\t\tconsole.log(p);\r\n\t\tconsole.log('listEmployees passed successfully \\n'); //takes like 2 minutes to run, but was told on slack it didn't matter\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('listEmployees failed test case \\n');//I never throw here, so I don't think it can actually go here, keeping it just in case\r\n\t}\r\n\t\r\n\t//test fourOneOne !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n\ttry{\r\n\t\tlet p = await work.fourOneOne('240-144-7553');\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('fourOneOne passed successfully \\n');\r\n }catch(e){\r\n console.log (e);\r\n\t\tconsole.error('fourOneOne failed test case \\n');\r\n }\r\n\ttry{\r\n\t\tlet p = await work.fourOneOne(50000);\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('fourOneOne did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('fourOneOne failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await work.fourOneOne('212-208-8371');\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('fourOneOne did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('fourOneOne failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await work.fourOneOne('abc-123-5783');\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('fourOneOne did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('fourOneOne failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await work.fourOneOne();\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('fourOneOne did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('fourOneOne failed successfully \\n');\r\n\t}\r\n\t\r\n\t//test whereDoTheyWork !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n\ttry{\r\n\t\tlet p = await work.whereDoTheyWork('277-85-0056');\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('whereDoTheyWork passed successfully \\n');\r\n }catch(e){\r\n console.log (e);\r\n\t\tconsole.error('whereDoTheyWork failed test case \\n');\r\n }\r\n\ttry{\r\n\t\tlet p = await work.whereDoTheyWork('123-45-');\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('whereDoTheyWork did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('whereDoTheyWork failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await work.whereDoTheyWork('264-67-0084');\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('whereDoTheyWork did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('whereDoTheyWork failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await work.whereDoTheyWork();\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('whereDoTheyWork did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('whereDoTheyWork failed successfully \\n');\r\n\t}\r\n\t\r\n}", "async function first()\n{\n for (let i = 0; i< nbdepages+1 ; i++)\n {\n await sandbox2(i);\n }\n}", "async function fetchEmployees(){\n\t\t\t\tconst ids = [8569129, 254808831, 58197, 651065]\n\t\t\t\t//const promises = ids.map(id => API.getEmployee(id))\n\t\t\t\tconst promises = ids.map(API.getEmployee)\n\t\t\t\treturn Promise.all(promises)\n\n\t\t\t\t// solution (2)\n\t\t\t\t/*const p1 = await API.getEmployee(8569129)\n\t\t\t\tconst p2 = await API.getEmployee(254808831)\n\t\t\t\tconst p3 = await API.getEmployee(58197)\n\t\t\t\tconst p4 = await API.getEmployee(651065)\n\t\t\t\treturn Promise.all[e1, e2, e3, e4] */\n\n\t\t\t\t// solution (3)\n\t\t\t\t/*const p1 = await API.getEmployee(8569129)\n\t\t\t\tconst p2 = await API.getEmployee(254808831)\n\t\t\t\tconst p3 = await API.getEmployee(58197)\n\t\t\t\tconst p4 = await API.getEmployee(651065)\n\t\t\t\treturn [await e1, await e2, await e3, await e4] */\n\n\t\t\t\t// solution (4) - parallel requests + parallel awaiting\n\t\t\t\t/*const res = []\n\t\t\t\tconst promises = ids.map(async (id, idx) => {\n\t\t\t\t\tconst e = await API.getEmployee(id)\n\t\t\t\t\tres[idx] = e\n\t\t\t\t}) \n\t\t\t\tawait Promise.all(promises)\n\t\t\t\treturn res*/\n\t\t\t}", "async function test(fn) {\n await sleep(1000);\n let counter = 0;\n let totalTime = 0;\n for (let i = 0; i < 1000; i++) {\n // const qs = Object.keys(variables).map(k => [k, variables[k]()])\n // .reduce((o, n) => {\n // o[n[0]] = n[1];\n // return o;\n // }, {});\n const qs = {\n userId: (Math.random() > 0.05 ? 8 : 0)\n };\n qs.pageNum = Math.ceil(Math.random() * (qs.userId === 0 ? 100 : 10));\n console.log('qsqsqsqs', qs);\n const timeStart = Date.now();\n console.log('qsqsqs', qs);\n fn(qs)\n .then((res) => {\n // console.log(res);\n const time = Date.now() - timeStart;\n counter++;\n totalTime += time;\n console.log('timeStart: ', timeStart);\n console.log('counter: ', counter);\n console.log('totalTime: ', totalTime);\n console.log('avgTime: ', totalTime / counter);\n });\n // await sleep();\n }\n}", "async function ids(node, s)\n{\n for(let i=0;i<=2;i++){\n await rdls(node, s, 0, i)\n\n }\n}", "async function asyncPromAll() {\n const resultArray = await Promise.all([asyncTask1(), asyncTask2(), asyncTask3(), asyncTask4()]);\n for (let i = 0; i<resultArray.length; i++){\n console.log(resultArray[i]); \n }\n }", "async function onClickAsyncAwait() {\n try {\n console.time('Measuring time');\n\n const valueOne = await taskOne();\n const valueTwo = await taskTwo();\n const valueThree = await taskThree();\n\n console.timeEnd('Measuring time');\n } catch (error) {\n //console.log(error);\n }\n\n}", "async function processData(nextCur, nextPag, hash, followers) {\n if (nextPag) {\n let variablesLocal = JSON.stringify({\n \"id\": id,\n \"include_reel\": true,\n \"fetch_mutual\": true,\n \"first\": 100,\n \"after\": nextCur\n })\n\n let body = await rp.get({\n url: 'https://www.instagram.com/graphql/query/',\n headers: {\n 'cookie': `sessionid=${sessionId};`\n },\n qs: {\n query_hash: hash,\n variables: variablesLocal\n },\n })\n body = JSON.parse(body)\n let data = followers ? body.data.user.edge_followed_by.edges : body.data.user.edge_follow.edges\n data.forEach(item => {\n followers ? $followers.push(item.node.username) : $following.push(item.node.username)\n })\n nextCursor = followers ? body.data.user.edge_followed_by.page_info.end_cursor : body.data.user.edge_follow.page_info.end_cursor\n nextPage = followers ? body.data.user.edge_followed_by.page_info.has_next_page : body.data.user.edge_follow.page_info.end_cursor\n await processData(nextCursor, nextPage, hash, followers)\n } else {\n let nameOfFile = followers ? 'myFollowers.txt' : 'myFollowings.txt'\n let file = followers ? JSON.stringify($followers) : JSON.stringify($following);\n (() => {\n return new Promise((res, rej) => {\n fs.writeFile(nameOfFile, file, 'utf-8', (err) => {\n if (err) rej(err)\n console.log('Succesfuly saved ' + nameOfFile)\n res()\n })\n })\n })();\n }\n}", "async function distribute() {\n // Running Promises in parallel\n const listOfPromises = listOfOptions.map(asyncOperation);\n // Harvesting\n return await Promise.all(listOfPromises);\n}", "async function f1() {\n const a = [1, 2, 3, 4];\n const m = a.map((v) => delay500(v * 2));\n const lm = await C.map((v) => delay500(v * 2), a);\n console.log([...m]);\n // let b = [];\n let b = [];\n for (const a of m) {\n if (a instanceof Promise) await a.then((a) => b.push(a));\n }\n\n const ss = await delay500(10);\n console.log(ss);\n console.log(lm);\n console.log(b.reduce((a, b) => a + b));\n}", "async function tinhDienTichDongBo(a,b,h){\n let tong = await cong(a,b)\n let tich = await nhan(tong,h)\n let thuong = await chia(tich,2)\n return thuong\n}", "async function graphQlOperations() {\n await generateGraphQlOperations()\n}", "static async method(){}", "function async_io_normal(cb) {\n\n}", "async function main() {\r\n console.time('Measuring time');\r\n // const result = await Promise.all([taskOne, taskTwo])\r\n const [valueOne, valueTwo] = await Promise.all([taskOne(), taskTwo()]);\r\n console.timeEnd('Measuring time');\r\n\r\n // console.log('Task One Returned => ', result[0]);\r\n // console.log('Task Two Returned => ', result[1]);\r\n console.log('Task One Returned => ', valueOne);\r\n console.log('Task Two Returned => ', valueTwo);\r\n}", "async function s$1(s,e,m){const n=r$1(s);return f(n,R.from(e),{...m}).then((o=>o.data.objectIds))}", "async function getExample() {\n let output = await getCompanies();\n return output;\n // let a = getCompanyName();\n // let b = a.then(function(resultA) {\n // // some processing\n // return getCompanies();\n // });\n // let c = b.then(function(resultB) {\n // // some processing\n // return getStreetAddress();\n // });\n\n // let d = c.then(function(resultC) {\n // // some processing\n // return getCityState();\n // });\n // return Promise.all([a, b,c,d ]).then(function([resultA, resultB, resultC, resultD]) {\n // // more processing\n // console.log(' resultB=', resultB);\n // console.log(' resultA=', resultA);\n // console.log(' resultC=', resultC);\n // console.log(' resultD=', resultD);\n\n\n // let output = _.merge(resultA, resultB, resultC, resultD);\n\n // console.log('110- output =', output );\n \n // return output; \n \n // });\n}", "async function main() {\n // create the promises first\n var call1 = myApiClient(1)\n var call2 = myApiClient(2)\n\n // then wait for them\n var response1 = await call1\n var response2 = await call2\n\n // do something with the responses\n var message = response1['message'] + ' ' + response2['message']\n console.log(message)\n}", "async function AppelApi(parfunc=api_tan.GenericAsync(api_tan.getTanStations(47.2133057,-1.5604042)),\nretour=function(par){console.log(\"demo :\" + JSON.stringify(par))}) {\n let demo = await parfunc \n retour(demo);\n // console.log(\"demo : \" + JSON.stringify(demo));\n}", "function doWorkAsyncFirst(){\n setTimeout(()=>{\n let sum=0;\n for (let index = 0; index < 1000000000; index++) {\n sum+=index;\n }\n console.log('Sum: ',sum);\n return sum;\n },10);\n}", "function test2() {\n\tvar start = new Date();\n\n\tgetJsonWithCallback('vessels.json?parameter=a', function(a) {\n\t\tgetJsonWithCallback('vessels.json?parameter=b', function(a) {\n\t\t\tgetJsonWithCallback('vessels.json?parameter=c', function(a) {\n\t\t\t\tgetJsonWithCallback('vessels.json?parameter=d', function(a) {\n\t\t\t\t\tgetJsonWithCallback('vessels.json?parameter=e', function(a) {\n\t\t\t\t\t\tvar diff = (new Date()) - start;\n\t\t\t\t\t\tconsole.log('Did 5 API calls in ' + diff + ' millis');\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t});\n}", "function ticketUpdateScrapeController() {\n\n return new Promise( async(resolve, reject) => {\n\n try { \n\n const updatedData = await updated_data();\n\n const chunkedData = await chunkQueries(5, updatedData);\n\n const ticketToBeUpdated = [];\n\n const data = await chunkedData.reduce( async(accumulator, currentValue) => {\n\n const accum = await accumulator;\n\n const arrFuncs = currentValue.reduce((acc, curVal) => {\n\n ticketToBeUpdated.push(curVal.tckt_nmbr);\n\n return [...acc, scrapeTicketData(curVal.tckt_nmbr)];\n\n }, []);\n\n const result = await Promise.all(arrFuncs);\n\n const scrapeFuncs = result.reduce((acc, curVal) => {\n\n return [...acc, workNotedataScraper(curVal)];\n\n }, []);\n\n const extractedData = await Promise.all(scrapeFuncs);\n\n const spreadedData = extractedData.reduce((cur, val) => {\n\n return [...cur, ...val];\n \n }, []);\n\n return [...accum, ...spreadedData];\n\n }, Promise.resolve([]));\n\n await removeOldUpdateLogs(ticketToBeUpdated); \n\n await insertTicketUpdateLogs(data);\n\n resolve();\n \n } catch (error) {\n\n logger.error(error, 'An issue occured in workNoteDataScraper function');\n \n reject();\n\n }\n\n })\n\n}", "async function StartR() \r\n {\r\n // request, fetch api data\r\n const response = await fetch(api_url); //fetch\r\n const data = await response.json(); //api\r\n let json_split = JSON.parse(JSON.stringify(data)); // split api data\r\n\r\n // only for the first request\r\n if (beginvar == true){\r\n console.log(\"first try\");\r\n render_call(json_split, waisted_count, beginvar);\r\n last_api = json_split[0].id;\r\n beginvar = false; \r\n } \r\n else{\r\n console.log(\"secound try\");\r\n waisted_count = while_count(last_api, json_split);\r\n render_call(json_split, waisted_count, beginvar);\r\n }\r\n console.log(\"assync vege 15perc \" + \"Last API: \" + last_api);\r\n }", "async function main() {\n let exchange1 = {};\n let exchange2 = {};\n let lastPrice = \"\";\n let seconds = 0;\n let initialBalance = {};\n\n // TODO el exchange debe pasarse: conf.exchange1.apiKey; conf.exchange1.secret\n function init() {\n try {\n exchange1 = exchange.setExchange(conf.exch1Name, conf.exch1.apiKey, conf.exch1.secret, conf.exch1.uid);\n exchange2 = exchange.setExchange(conf.exch2Name, conf.exch2.apiKey, conf.exch2.secret);\n seconds = exchange2.seconds() * 1000;\n } catch (error) {\n log.bright.red(\"ERROR\", error.message)\n }\n };\n\n // TODO es resp de order\n async function cancelMultipleOrders(symbol, lowerId, uperId) {\n for (let i = lowerId; i <= uperId; i++) {\n try {\n let canceled = await exchange2.cancelOrder(i, symbol)\n log(canceled)\n } catch (error) {\n log(error)\n }\n }\n };\n\n function sleep(ms) {\n return new Promise(resolve => {\n setTimeout(resolve, ms)\n })\n };\n\n try {\n let isFirstIteration = true;\n init();\n price.basePrice = await price.lastPrice(symbol2, exchange1);\n log(\"price at generation\", price.basePrice);\n initialBalance = await exchange.balances(exchange2);\n await order.placeScaledOrders(exchange2, conf.amount, symbol);\n await trade.getTradesByBalance(exchange1, exchange2, initialBalance, order.placedOrders, isFirstIteration); \n //await cancelMultipleOrders(symbol, 6064, 6251);\n } catch (error) {\n log(error);\n }\n}", "async function main() {\n try {\n const [name, age] = await Promise.all([\n getName(),\n getAge()\n ])\n name;\n age;\n } catch (err) {\n console.log(err);\n }\n \n}", "async function betterWay() {\n const IDs = await getIDs;\n console.log(IDs);\n const firstRecipe = await getRecipe(IDs[2]);\n console.log(firstRecipe);\n const secondRecipe = await getRelated('Code Dozman');\n console.log(secondRecipe);\n\n return secondRecipe;\n // return firstRecipe\n}", "async function getRecipesAW(){\n\t\t//waits till the promise is fulfilled and then stores the resolved value in the variable ie. Ids ,recipe ,related here\n\t\tconst Ids = await getIds; \n\t\tconsole.log(Ids);\n\t\tconst recipe=await getRecipe(Ids[2]);\n\t\tconsole.log(recipe);\n\t\tconst related = await getRelated('Jonas');\n\t\tconsole.log(related);\n\t\t\n\t\treturn recipe; //async function also returns a promise always!\n\t}", "function buku(){\r\n\treadBooksPromise(10000,books[0])\r\n\t.then(readBooksPromise(setTimeout, books[1]))\r\n\t.then(readBooksPromise(setTimeout, books[2]))\r\n}", "async function asyncPromAll() {\n const resultArray = await Promise.all([asyncTask1(), asyncTask2(), asyncTask3(), asyncTask4()]);\n for (let i = 0; i<resultArray.length; i++){\n console.log(resultArray[i]);\n }\n}", "async resolveFully() {\n let x = await this.next();\n while (!x.done) {\n x = await this.next();\n }\n }", "async function main3(){\n try {\n \n const result = await service.obterPessoas('a')\n\n const names = []\n console.time('forof')\n for (pessoa of result.results) {\n names.push(pessoa.name)\n }\n console.timeEnd('forof');\n\n console.log(names)\n } catch (error) {\n console.error('Deu Erro', error)\n }\n}", "async function wrapperForAsyncFunc(){\n const [result1, result2] = await Promise.all([\n AsyncFunction1(),\n AsyncFunction2()\n ]);\n console.log(result1, result2)\n}", "async function suma1(a, b) {\n return a + b;\n}", "async function downloaderCaller({ username, repoTitle, branch }) {\n for (let i = 0; i < toDownload.length; i++) {\n let j = i;\n const sz = Math.min(i + 20, toDownload.length); // making combination of serially and parallely\n const batchDownload_p = [];\n while (j < sz) {\n const download_p = downloadFile({\n ...toDownload[j++],\n // useBrowser: browser, // uncomment to use [visible] browser to download\n username,\n repoTitle,\n branch,\n });\n batchDownload_p.push(download_p);\n }\n await Promise.all(batchDownload_p);\n i = j - 1;\n }\n}", "async *[Symbol.asyncIterator]() {}", "async function main2(){\n try {\n \n const result = await service.obterPessoas('a')\n\n const names = []\n console.time('forin')\n for(const i in result.results){\n const pessoa = result.results[i];\n names.push(pessoa.name)\n }\n console.timeEnd('forin');\n\n console.log(names)\n } catch (error) {\n console.error('Deu Erro', error)\n }\n}", "async function obtenerPersonajes(){\nvar ids=[1,2,3,4,5,6,7]\n\nvar promesas = ids.map(id=> obtenerPersonaje(id))\n\n//wait detiene la ejecucion de la funcion hasta que se hayan cargado todas las promesas\ntry{\n \n var personajes= await Promise.all(promesas)\n console.log(personajes)\n\n}catch(id){\n error(id)\n}\n\n}", "async function someFunc() {\n try {\n const arr = [\n funcThatReturnsPromise('some other shit', 1000),\n funcThatReturnsPromise('some other shit', 1000),\n funcThatReturnsPromise('some other shit', 1000)\n ];\n const res = await Promise.all(arr);\n console.log(res);\n }\n catch (error) {\n console.error(error);\n }\n}", "async function asyncCall() {\n result = await resolveAfter2Seconds();\n result.forEach((indItem) =>\n printItem(\n indItem.title,\n indItem.tkt,\n indItem.desc,\n indItem.urg,\n indItem.store,\n indItem.owner,\n indItem.date\n )\n );\n }", "async function doWork() {\n try {\n console.log(\"s1\");\n await step1();\n console.log(\"s2\");\n await step2();\n console.log(\"s3\");\n await step3();\n console.log(\"s4\");\n } catch (err) {}\n}", "async function cookFood() {\n let a;\n let b;\n let c;\n\n try {\n a = await step1();\n } catch (err) {\n handleError(err);\n }\n\n try {\n b = await step2();\n } catch (err) {\n handleError(err);\n }\n\n try {\n c = await step3();\n } catch (err) {\n handleError(err);\n }\n\n return a + b + c;\n}", "async function executeParallelAsyncTasks() {\n const [valueA, valueB, valueC] = await Promise.all([functionA(), functionB(), functionC()])\n doSomethingWith(valueA)\n doSomethingElseWith(valueB)\n doAnotherThingWith(valueC)\n}", "async function MyAsyncFn () {}", "async function asyncAwaitRequest() {\n const beerListFetches = createBeerListFetches()\n\n console.clear()\n console.log(\"asyncAwaitRequest()\")\n showLoading(\"Async/Await\", true)\n \n const results = await Promise.all(beerListFetches)\n const names = await Promise.all(\n results.map((result) => { \n console.log(`AsyncAwait -> Normalize`)\n return new Promise((resolve) => {\n setTimeout(() => { \n result.json().then((data) => {\n const names = data.map(beer => beer.name)\n .reduce((acc, name) => `${acc}, ${name}`)\n resolve(names)\n })\n }, 2000)\n })\n })\n )\n\n names.forEach((nameList) => console.log(`AsyncAwait Names=[${nameList}]`))\n\n console.log(`AsyncAwait$Done`)\n showLoading(\"Async/Await\", false)\n}", "async function TestAsync() {\n try {\n var parm = [];\n parm[0] = \"2017\"\n parm[1] = \"R\"\n parm[2] = \"02\"\n parm[3] = \"02M011\"\n parm[4] = \"1\"\n // '2017', 'R', '02', '02M011', '1',@newmodno output\n const result = await DBase.DB.execSP(\"SPS_COM_TTOMODI\", parm);\n\n parm = [];\n parm[0] = \"000\"\n parm[1] = \"1111\"\n parm[2] = \"test\"\n // '2017', 'R', '02', '02M011', '1',@newmodno output\n result = await DBase.DB.execSP(\"spi_teobj\", parm);\n /*\n spi_teobj 'null','1111','1234' \n if (result instanceof Error) {\n console.log(\"Error\")\n }\n */\n console.log(result)\n\n parm = [];\n parm[0] = \"TRTRQ\"\n result = await DBase.DB.execSP(\"sps_GetTTLOL\", parm);\n console.log(result)\n let resultObj = JSON.parse(result);\n //console.log(resultObj.data)\n console.log(resultObj.data[0][0].gs_ttl_i)\n\n result = await DBase.DB.execSQl(\"select top 1 gs_ttl_i from ttlol where gs_ttl_i = 'TRTRQ'\")\n resultObj = JSON.parse(result);\n console.log(\"After Title Call\")\n let gs_ttl_i = resultObj.data[0][0].gs_ttl_i;\n\n result = await DBase.DB.execSQl(\"select top 1 gs_oru_i from toru where gs_oru_i = '01M019'\")\n resultObj = JSON.parse(result);\n console.log(\"After School Call\")\n let gs_oru_i = resultObj.data[0][0].gs_oru_i;\n\n console.log(gs_oru_i)\n\n result = await DBase.DB.execSQl(\" Select top 10 gs_pr_name from ttodetail where gs_oru_i = '\" + gs_oru_i + \"' and gs_ttl_i = '\" + gs_ttl_i + \"'\")\n console.log(result)\n return \"After Test\";\n } catch (err) {\n console.log(\"error in TestAsync\")\n console.log(err)\n return err;\n //response.send(err); \n }\n}", "allRequest(urls) {\n return new Promise((resolve, reject) => {\n const limit = 4;\n async.eachLimit(urls, limit, (file, cb) => {\n this.request(HomeUrl + file)\n .then((data) => {\n this.eachPageCheerio(data)\n .then((obj) => {\n console.log(obj);\n\n // download images to local\n const url = obj.imgUrl;\n const name = obj.airlineName.replace(' ', '_');\n const image = obj.imgUrl.split('/')[8];\n const dest = this.dir + name + '_' + image;\n const formData = {\n name: obj.airlineName,\n image: dest,\n short_code: obj.airlineCode,\n };\n this.download(url, dest)\n .then(() => this.postRequest(apiUrl, formData)) // post request to api\n .then(() => { cb(); });\n });\n });\n }, (err) => {\n if (err) throw err;\n resolve('All process finished!');\n });\n });\n }", "async function serveDinner() {\n let vegetablePromise = steamBroccoli();//each promise will execute instantly\n let starchPromise = cookRice();\n let proteinPromise = bakeChicken();\n let sidePromise = cookBeans();\n console.log(`Dinner is served. We're having ${await vegetablePromise}, ${await starchPromise}, ${await proteinPromise}, and ${await sidePromise}.`);\n}", "async function main(){\n try{\n const usuario= await obterUsuario();\n // const telefone = await obterTelefone(usuario.id);\n // const endereco = await obterEnderecoAsync(usuario.id);\n\n //o promise all permite fazer com que as funcoes nele executem ao `mesmo tempo`\n const resultado = await Promise.all(\n [\n obterTelefone(usuario.id),\n obterEnderecoAsync(usuario.id)\n ]\n )\n console.log(`\n Nome:${usuario.nome}\n Telefone:${resultado[0].telefone}\n Endereco:${resultado[1].rua}\n `);\n\n }catch(error){\n console.error(`Deu ruim`,error)\n }\n\n}", "async function parallelcalculation() {\n var jobs = [];\n\n var j1 = current.value;\n var j2 = stepSize.value;\n var j = parseFloat(j1) + parseFloat(j2);\n\n while (j < maxWindow) {\n jobs.push(j - 1);\n j = j + parseFloat(stepSize.value);\n }\n\n var k = parseFloat(j1) - parseFloat(j2);\n while (k > 0) {\n jobs.push(k - 1);\n k = k - parseFloat(stepSize.value);\n }\n\n for (var i = 0; i < maxWindow; i++) {\n jobs.push(i);\n }\n\n let results = jobs.map(async (job) => await calculateCorrelation(job, windowSize.value));\n /* for (const result of results) {\n finalResults.push(await result);\n }*/\n }", "async function message(msg) {\n\n let metadata = await fetchMeta('metadata')\n console.log(g('1 -Fetch meta data '))\n console.log(metadata)\n\n let allAgents = ['faq', 'live', 'notify', 'sub']\n\n let agents = await Promise.all(allAgents.map(async e => {\n const added = await fetchMeta(e)\n return added\n }))\n console.log(g('2 - Fetch dialogue bundles for agents '))\n console.log(agents)\n\n // first test cycle - just do a notification\n let respond = await sendMessage(msg)\n console.log(g('3 - Send message '))\n console.log(respond)\n\n let post = await postMessage(msg)\n console.log(g('4 - Post message '))\n console.log(post)\n\n let elapse = {}\n elapse.time = 3\n\n return elapse\n}", "async function dowork() {\n try {\n const response = await makeReques('Google');\n console.log('response received');\n const processingResponse = await processRequest(response);\n console.log(processingResponse);\n\n }\n catch (err) {\n console.log(err);\n }\n}", "async asyncPromiseChain() {\n\n this.showSubmit = false;\n this.selectedAccount = true;\n this.foundAccounts = false;\n this.isLoading = true;\n this.rowData.forEach(d => {\n this.SelectedAccId = d.accountId;\n this.SelectedAccName = d.name;\n this.SelectedAccPhone = d.phone;\n });\n\n let conResp = await getRelatedContactList({ id: this.SelectedAccId });\n if (conResp && conResp.length > 0) {\n conResp.forEach((d, i) => {\n this.conData.push({\n id: d.Id,\n first: d.FirstName,\n last: d.LastName,\n email: d.Email\n })\n console.log(this.conData[i]);\n })\n this.foundContacts = true;\n }\n let oppResp = await getRelatedOpptyList({ id: this.SelectedAccId });\n if (oppResp && oppResp.length > 0) {\n oppResp.forEach((d, i) => {\n this.oppData.push({\n id: d.Id,\n stage: d.StageName,\n amount: '$' + d.Amount,\n source: d.LeadSource\n })\n console.log(this.oppData[i]);\n })\n this.foundOpptys = true;\n }\n this.isLoading = oppResp != null && conResp != null;\n }", "_map(func) {\n let ret = new AsyncRef(func(this._value));\n let thiz = this;\n (async function() {\n for await (let x of thiz.observeFuture()) {\n ret.value = func(x);\n }\n })();\n return ret;\n }", "async function cool() {\n let promise = new Promise(function(resolve, reject) {\n setTimeout(() => resolve('All done!'), 1000);\n });\n\n let result = await promise;\n return result;\n}", "returnInvalidAssociations() {\n return new Promise(\n\n async (resolve, reject) => {\n try {\n //query all associations.. page 2000 rows\n \n //for each association row - validate that from/to source actually exists\n //find that layerId fromSourceId, fromGlobalId, query Count and make sure it exists. \n //find the layerId of toSourceId, toGlobalId , query count make sure it exists \n //if doesn't exist add to invalid assocaition array. \n const invalidAssociations = [];\n //objectid >= ${offset} and objectid <= ${recordCount+offset}\n let c = 0;\n let offset = 0;\n let recordCount = 2000;\n while(true) {\n const result = await this.query(500001, `1=1`, undefined, undefined, [\"*\"], \"sde.DEFAULT\", offset, recordCount)\n console.log(`Processing ${recordCount} associations`)\n //for each assocaition check if its valid\n const bar = new ProgressBar(':bar', { total: result.features.length });\n for (let i = 0 ; i < result.features.length; i++){\n const associationRow = result.features[i]\n const isValid = await this.isAssocaitionValid( associationRow);\n if (!isValid){ \n const associationGuid = v(associationRow.attributes, \"globalid\");\n invalidAssociations.push({\n \"assocaitionGuid\":associationGuid\n })\n //console.log(`Discoved an invalid assocaition. ${associationGuid}`)\n //console.log(\"x\")\n }\n \n bar.tick();\n }\n \n\n //keep asking if this is true\n if (!result.exceededTransferLimit) break;\n offset+= recordCount;\n }\n \n resolve(invalidAssociations); \n }catch (ex) {\n reject(ex);\n }\n \n \n\n }\n )\n \n\n }", "function past5balances(req, res, next) {\n var last30Moves, dailyMoves, dailyBalance, currentBalance, i, j, balance;\n return regeneratorRuntime.async(function past5balances$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n last30Moves = [];\n dailyMoves = [];\n dailyBalance = [];\n currentBalance = req.data.currentBalance.balance;\n i = 0;\n j = 0;\n _context4.next = 8;\n return regeneratorRuntime.awrap(Transactions.findAll({\n limit: 30,\n order: [['date', 'DESC']],\n where: {\n userId: req.userId,\n type: [\"egreso\", \"ingreso\"]\n }\n }).then(function (transaction) {\n transaction.map(function (item) {\n last30Moves.push(item.dataValues);\n });\n })[\"catch\"](function (err) {\n res.send(\"No se encuentran los movimientos\");\n return;\n }));\n\n case 8:\n do {\n if (last30Moves[i]) {\n (function () {\n var moves = {};\n\n var setMove = function setMove() {\n if (last30Moves[i].type === \"egreso\") {\n moves.amount = parseFloat(last30Moves[i].amount);\n } else {\n moves.amount = parseFloat(last30Moves[i].amount);\n moves.amount = moves.amount - moves.amount * 2;\n }\n };\n\n moves.date = last30Moves[i].date;\n dailyMoves.push(moves);\n setMove();\n i = i + 1;\n\n if (last30Moves[i]) {\n while (dailyMoves[j].date === last30Moves[i].date) {\n if (last30Moves[i].type === \"egreso\") {\n dailyMoves[j].amount = parseFloat(dailyMoves[j].amount) + parseFloat(last30Moves[i].amount);\n } else {\n dailyMoves[j].amount = parseFloat(dailyMoves[j].amount) - parseFloat(last30Moves[i].amount);\n }\n\n i = i + 1;\n }\n } else {\n dailyMoves.push(false);\n }\n\n dailyMoves[j].amount = dailyMoves[j].amount.toString();\n j = j + 1;\n })();\n } else {\n dailyMoves.push(false);\n }\n } while (dailyMoves.length < 5);\n\n i = 0;\n\n do {\n if (dailyMoves[i]) {\n balance = {};\n balance.balance = currentBalance;\n balance.date = dailyMoves[i].date;\n dailyBalance.push(balance);\n currentBalance = currentBalance + parseFloat(dailyMoves[i].amount);\n i = i + 1;\n } else {\n dailyBalance.push(false);\n }\n } while (dailyBalance.length < 5);\n\n req.data.dailyBalance = dailyBalance;\n console.log(dailyBalance);\n next();\n\n case 14:\n case \"end\":\n return _context4.stop();\n }\n }\n });\n} //getLast10movs retreives last 10 transactions", "function main() {\n return Promise.all([1, 2, 3, 4].map((value) => asyncThing(value)))\n}", "async function get(x) {\n// \tx = x || 5\n// client.getPageList().then((pages) => {\n// let list = pages.pages\n// var items = list.filter((list,idx) => idx < x)\n// let recipes = items\n \n// .map(({ title, url }) => (\n// \"\\n\\n [\"+title+\"](\"+url+\")\" \n// ))\n \nlet re = await tgph([\"50.4825,30.4887\",\"FEEE FUUU\",\"https://i.ibb.co/whfQZbG/file-193.jpg\"])\nconsole.info(re)\n// recipes = items\n \n// .map(({ url }) => (\n// url \n// ))\n \n\n// console.log(recipes)\n\t\n}", "async function hentData() {\n const response1 = await fetch(endpoint1);\n const response2 = await fetch(endpoint2);\n const response3 = await fetch(endpoint3);\n const response4 = await fetch(endpoint4);\n const response5 = await fetch(endpoint5);\n\n\n slide1 = await response1.json();\n slide2 = await response2.json();\n slide3 = await response3.json();\n slide4 = await response4.json();\n slide5 = await response5.json();\n visData();\n}", "async function getStats() {\r\n // Get JSON files needed\r\n var userjson = await getUser();\r\n var countjson = await getCount();\r\n var tvjson = await getJSON();\r\n var moviejson = await getNew();\r\n var qjson = await getStatus();\r\n var spaceStat = await getSysSpace();\r\n // Starts calling functions to build\r\n buildTiles(userjson, countjson);\r\n buildQueue(qjson);\r\n buildOutlook(tvjson);\r\n buildNewAdd(moviejson);\r\n buildStatusBar(spaceStat);\r\n}", "async function get_all(uri){\n var timestamp = 0\n\n var cards = []\n\n do{\n var curr_time = new Date().getTime()\n while(curr_time - timestamp < 200){\n console.log(curr_time)\n await sleep(50)\n curr_time = new Date().getTime()\n }\n timestamp = curr_time\n var result = await d3.json(uri)\n cards = cards.concat(result.data)\n uri = result.next_page\n } while(result.has_more)\n\n return cards\n }", "async function main() {\n\tfor(i in file) {\n\t let [thing1, thing2, thing3] = file[i].split(\":\");\n\t let result = await myfunction(thing1, thing2, thing3);\n\t\t\tconsole.log(`Result of ${i} returned`);\n\t}\n}", "async function getRecipeAW() { // the function always return a Promises\n //the await will stop executing the code at this point until the Promises is full filled\n // the await can be used in only async function\n const id = await getID;\n console.log(id)\n console.log('here 2');\n const recipe = await getRecipe(id[1]);\n console.log(recipe);\n const related = await getRelated('Publisher');\n console.log(related);\n\n return recipe;\n}", "async function callApi() {\n let j = 1;\n //--starting with 2 pages of 30 entries--//\n for (j = 1; j <= 3; j++) {\n let ans;\n\n try {\n let repoSearchURL =\n \"https://api.github.com/search/repositories?q=\" +\n projkey +\n \"&page=\" +\n j;\n if (j === 1) {\n ans = await axios.get(repoSearchURL);\n } else {\n let pager = repoSearchURL + \"; rel='next'\";\n ans = await axios.get(pager);\n }\n repoIterate(ans);\n } catch (error) {\n console.log(error);\n }\n }\n console.log(logRepos);\n}", "async function syncPipeline() {\n await generateAllowance();\n // await confirmPendingBookings();\n // the server-side script does this now\n await updateContactList();\n await updateTourList();\n}", "async function ej3() {\n var res = await prom();\n console.log(res);\n}", "async function main() {\n\t//// Promises work well for single operations\n\t//// done in sequence Await entire request\n\t// \"The Flash\" Mails another superhero for a dad joke\n\t// Might take a few days, but \"The Flash\" knows \n\t// what to do when it comes back\n\tlet response = await axios.get(\"https://icanhazdadjoke.com/\", {\n\t\theaders: { accept: \"application/json\" }\n\t});\n\t// Once \"The Flash\" recieves the letter, he calls another\n\t// superhero in his office, and tells him \n\t// \"Go downstairs, and add this joke to the list of jokes\"\n\t// \" in filing cabinet 20 \"\n\t\n\t// Other superhero goes downstairs, adds the joke to the list,\n\t// and then walks back upstairs, all while \"The Flash\" is still \n\t// able to do all sorts of other things.\n\t\n\t//// Await adding joke to file\n\tawait fs_async.appendFile(\"jokes.txt\", response.data.joke + \"\\n\\n\");\n\t// Once that guy comes back, \"The Flash\" can continue this process...\n\t// He then asks the guy to go back down the stairs, \n\t// read the entire list of jokes, \n\t// and then tell them to him one by one...\n\t// (IRL, the analogy breaks down, right? \n\t// He could have told the guy \n\t// to look the file up while down there);\n\t\n\t//// Await reading entire jokes file\n\tlet jokes = await fs_async.readFile(\"jokes.txt\");\n\t\n\t// Guy comes back up, tells \"The Flash\" all the jokes...\n\tconsole.log(jokes.toString());\n}" ]
[ "0.66094905", "0.6364746", "0.6345022", "0.6199559", "0.6169969", "0.6146855", "0.6121415", "0.6108973", "0.5994871", "0.59879506", "0.5977297", "0.5973999", "0.59664935", "0.59648675", "0.5942859", "0.5909766", "0.5903028", "0.58957124", "0.588065", "0.5860696", "0.58464515", "0.583987", "0.5839005", "0.5830537", "0.5813379", "0.58102965", "0.5808521", "0.58044237", "0.5801487", "0.5801421", "0.5779308", "0.57782394", "0.5773151", "0.5768481", "0.57682407", "0.5761539", "0.5739416", "0.57280463", "0.5726179", "0.5712785", "0.5709026", "0.5705063", "0.57015187", "0.56978244", "0.5697475", "0.56957215", "0.5682776", "0.5669285", "0.56653666", "0.5664905", "0.5652693", "0.56522", "0.5651445", "0.56443185", "0.5639869", "0.56395775", "0.56384754", "0.5636215", "0.56082964", "0.55932707", "0.5581254", "0.5574985", "0.5573045", "0.55665797", "0.5555334", "0.5540467", "0.5530135", "0.55293775", "0.5518911", "0.5515602", "0.55120295", "0.551019", "0.5509739", "0.55021757", "0.5485194", "0.5477162", "0.54757863", "0.546902", "0.54666334", "0.5459877", "0.54490393", "0.54475665", "0.5444825", "0.54447347", "0.54407996", "0.54367447", "0.54299664", "0.542793", "0.54274243", "0.5420699", "0.5418474", "0.5415181", "0.54148823", "0.54084295", "0.5404504", "0.54036665", "0.5403091", "0.5399494", "0.5390928", "0.53879946" ]
0.5434246
86
When size is submitted by the user, call makeGrid()
function makeGrid(height, width) { for (let r = 0; r < height; r++) { let row = shape.insertRow(r); for (let c = 0; c < width; c++) { let cell = row.insertCell(c); cell.addEventListener('click', (event) => { cell.style.backgroundColor = chooseColor.value; }); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gridSize() {\n size = prompt(\"What size do you want the grid?\");\n createGrid(size, size);\n\n}", "function resizeGrid() {\n do {\n size = prompt(\"Enter a number from 1-125\");\n if (size === null || isNaN(size)) {\n return;\n }\n } while (size > 125);\n container.innerHTML = \"\";\n createGrid(size);\n draw();\n}", "function changeSize() {\n row = prompt(\"Enter the amount of rows you want between 1 and 64.\");\n createGrid(row);\n}", "function setGridSize(){\n\t$('#squares-number-button').click(function(){\n\t\tvar gridSize = $('#squares-number-input').val();\n\t\tif(gridSize > 0){\n\t\t\t$('.squares').remove();\n\t\t\tcreateSquares(gridSize);\n\t\t\tcolorHover();\n\t\t\tgridSizeDisplay(gridSize);\n\t\t\t$('#squares-number-input').val('');\n\t\t}\n\t})\n}", "function changeGridSize() {\n $(\"#gridSize\").click(function() {\n userDimension = prompt(\"Enter the grid size (i.e. enter 10 for a 10x10 grid)\")\n while (isNaN(userDimension) === true) {\n userDimension = prompt(\"Please enter a number for the grid size.\");\n }\n createDivs(userDimension, userSize);\n });\n}", "function updateGrid(){\n //num = prompt(\"enter new grid dimensions\");\n clearGrid();\n newSizeGrid(num);\n}", "function customSize() {\n size.textContent = 'Grid Size';\n size.addEventListener('click', () => {\n let input = prompt('Please Enter a Grid Size');\n if (input === null || input < 1) {\n sizeSet();\n makeGrid(16, 16);\n makeGray();\n makeBlack();\n makeRGB();\n } else {\n sizeSet();\n makeGrid(input, input);\n makeGray();\n makeRGB();\n makeBlack();\n }\n })\n buttons.appendChild(size).classList.add('btn');\n}", "function changeSize() {\n const minSize = 2;\n const maxSize = 64;\n let newSize = 0;\n\n while (newSize < minSize || newSize > maxSize) {\n newSize = prompt(`Enter a new size (${minSize}–${maxSize}):`, 0);\n\n // Stop if user cancels\n if (!newSize) {\n return;\n }\n }\n\n clear();\n createGrid(newSize);\n}", "function refreshGrid(){\n clearGrid();\n makeGrid(document.getElementById(\"input_height\").value, document.getElementById(\"input_width\").value);\n}", "function formSubmission() {\n event.preventDefault();\n var height = document.getElementById('inputHeight').value;\n var width = document.getElementById('inputWidth').value;\n makeGrid(height, width);\n}", "function sizeToFit() {\n gridManager.sizeToFit();\n}", "function selectGridSizeFunc() {\n container.innerHTML = \"\";\n const input = prompt(\"Please select a grid resolution. (input 64 for a 64 x 64 sketchpad)\", 16);\n setUpSketch(input);\n}", "function gridSize(num){\n\n//if the original value given by the user is within the correct range\nif(num >= 2 && num <=64){\n//create square grid based on the argument assigned to the parameter num\nfor(x = 0; x < num; x++){\n for(let y = 0; y < num; y++){\n const boxDiv = document.createElement(\"div\")\n boxDiv.setAttribute(\"class\", \"boxDiv\")\n container.append(boxDiv)\n }\n } \n//add container id to body so that it can be manipulated using the DOM\n//style the container grid, ensuring the number of rows and columns is equal to the argument value\n body.append(container)\n document.querySelector(\".container\").style.gridTemplateColumns = `repeat(${num}, 1fr)`\n\n//else reprompt the user for a new number that is inbetween the correct range\n} else {\n\n //reprompt user for new argument value that fits within the range\n let updatedInput = prompt('Please choose a number between 2 and 64')\n\n //invoke the gridSize function again with the correct argument value\n gridSize(updatedInput)\n}\n\n\n\n}", "function getGridSize () {\n let newSize = prompt (\"How many squares per side?\", \"64\");\n if (newSize > 64 || newSize === \" \") {\n warning ();\n // if user doesn't enter new gize, auto generate 16x16 grid \n } else if (newSize === null) {\n clearGrid();\n createGrid(16);\n }\n else {\n clearGrid();\n createGrid(newSize); \n } \n}", "function makeGrid() {\n canvas.find('tablebody').remove();\n\n // \"submit\" the size form to update the grid size\n let gridRows = gridHeight.val();\n let gridCol = gridWeight.val();\n\n // set tablebody to the table\n canvas.append('<tablebody></tablebody>');\n\n let canvasBody = canvas.find('tablebody');\n\n // draw grid row\n for (let i = 0; i < gridRows; i++) {\n canvasBody.append('<tr></tr>');\n }\n\n // draw grid col\nfor (let i = 0; i < gridCol; i++) {\n canvas.find('tr').append('<td class=\"transparent\"></td>');\n }\n\n }", "function checkSize(size) {\n\tif (typeof size !== 'number' || size <= 0 || size > 60) {\n\t\tsize = Math.floor(Math.random() * 60);\n\t\tsizeInput.value = `${size}`;\n\t}\n\tcreateGrid(size);\n}", "function autoSize() {\n gridManager.autoSize();\n}", "function resize(request) { \n if (request === 'resize') {\n let number = prompt(\"Please enter desired grid size (must be under 100)\", 16);\n }\n if (number <= 100) { \n makeGrid(number);\n } else {\n prompt(\"Invalid response! Grid size must be under 100!\");\n }\n \n}", "function makeGrid() {\n // Avoid the creation of repeating elements (h3, h4 tags)\n setInitialStates();\n\n const tableHeight = $('#input_height').val();\n const tableWidth = $('#input_width').val();\n\n // clear the old canvas\n myTable.children().remove();\n\n //Set maximum limit for number inputs\n if(tableHeight>50||tableWidth>50){\n alert(\"Please Insert a Number Between 1 and 50 for GRID Height & Width\");\n // Function the removes the unnecessary info tags (at this point)\n setInitialStates();\n // Reset the input values\n $(\"form input[type=number]\").val(\"1\");\n return true;\n }else {\n // Create the table\n for (let n = 1; n<=tableHeight; n++){\n // Create rows\n myTable.append('<tr></tr>');\n for(let m = 1; m<=tableWidth; m++){\n $('tr').last().append('<td></td>');\n }\n }\n // Add the extra info\n addInfo();\n }\n}", "function changeSize() {\n let newSize = prompt(\"Enter new size\");\n\n if (newSize !== null) {\n newSize = parseInt(newSize);\n if (newSize < 1 || newSize > 100 || Number.isNaN(newSize)) {\n alert(\"Enter a number from 1-100\");\n changeSize();\n } else {\n clearGrid();\n setGridSize(newSize);\n fillGrid(newSize);\n }\n }\n}", "function submitForm() {\n\t$( \"#sizePicker\" ).on( \"submit\", function( evt ) {\n\t\tevt.preventDefault();\n\t\tmakeGrid();\n\t});\n}", "function makeGrid() {\n\n // get the table element\n const canvas = document.getElementById('pixelCanvas');\n // reset grid\n while(canvas.firstChild) {\n canvas.removeChild(canvas.firstChild);\n }\n\n\n var width = sizeForm.width.value;\n var height = sizeForm.height.value;\n console.debug(width);\n console.debug(height);\n \n // create grid with height and width inputs\n for(y = 0; y < height; y++) {\n row = canvas.appendChild(document.createElement('TR'));\n for(x = 0; x < width; x++) {\n cell = row.appendChild(document.createElement('TD'));\n }\n }\n\n canvas.addEventListener('click', changeColor);\n\n}", "_onChangeSize() {\n\t\t\t\tthis.collection.changeSize(this.model.get('width'), this.model.get('height'));\n\t\t\t\tthis._saveSize(this.model.get('width'), this.model.get('height'));\n\t\t\t\tthis.render();\n\t\t\t}", "function changeSize() {\n let newSize = prompt(\"Enter new size\");\n\n if (newSize !== null) {\n newSize = parseInt(newSize);\n if (newSize < 1 || newSize > 64 || Number.isNaN(newSize)) {\n alert(\"Enter a number from 1-64 range\");\n changeSize();\n } else {\n clearGrid();\n setGridSize(newSize);\n fillGrid(newSize);\n }\n }\n}", "function addChangeSizeEvent(button) {\n button.addEventListener('click', () => {\n let newGridSize = getUserInput();\n resetBackGroundButton(button);\n removeGridChilds();\n generateGridElement(newGridSize);\n addSingleButtonEvents();\n })\n}", "function listener(event) {\n event.preventDefault();\n let inputHeight = document.getElementById(\"inputHeight\").value;\n let inputWidth = document.getElementById(\"inputWidth\").value;\n\n makeGrid(inputHeight, inputWidth);\n}", "function drawGrid(sizeIn) {\n\tvar boxDivs = [];\n\tsize = sizeIn;\n\tboxSize = Math.floor(960/size);\n\n\t$('#grid').off();\n\t$('#grid').html('');\n\n\t$box = \"<div class='box' style='width:\" + boxSize + \"px; height:\" + boxSize+\"px;'></div>\";\n\t$('#grid').css('width', boxSize*sizeIn);\n\tfor (var i = 0; i < sizeIn * sizeIn; i++){\n\t\tboxDivs[i] = $box;\n\t}\n\t$('#grid').append(boxDivs.join(''));\n\n\tclearGrid();\n\tdraw();\n\tgridLines();\n}", "function drawResizedGrid(newGridSize) {\n gridContainer.innerHTML = '';\n drawGrid(newGridSize)\n}", "function populate() {\n\t\tvar temp = \"\";\n\t\tvar div = '<div class=\"squares\"></div>';\n\t\tvar input = parseInt(prompt(\"Choose a new grid size!\"), 10);\n\t\t$('.squares').remove();\n\t\tfor (var i = 1; i <= input * input; i++) {\n\t\t\ttemp += div;\n\t\t};\n\t\t$(\".wrapper\").append(temp);\n\t\tvar height = 640 / input;\n\t\t$('.squares').css('height', height);\n\t\t$('.squares').css('width', height);\n\t}", "function newSize() {\n\tvar newSize = prompt('Enter a number between 0 and 129.');\n\tif (newSize < 1 || newSize > 128) {\n\t\talert('That is definitely not between 0 and 129!');\n\t}\n\telse {\n\t\tdrawGrid(newSize);\n\t}\n}", "function createGrid(width, height) {\n\n}", "function setGridSize (newGrid) {\n\n\t\tnewGrid = newGrid || {};\n\n\t\tif (newGrid.rows) {\n\t\t\tgrid.rows = newGrid.rows;\t\n\t\t}\n\n\t\tif (newGrid.columns) {\n\t\t\tgrid.columns = newGrid.columns;\n\t\t}\n\t\t\n\n\t\tupdateGridText();\n\n\t\tupdateCanvas();\n\t}", "function makeGrid() {\n // prevent submit button from reloading page\n event.preventDefault();\n const grid = document.querySelector(\"table\");\n // clear any previously created table\n grid.innerHTML = \"\";\n // get the users size input\n const size = getSize();\n const width = size[0];\n const height = size[1];\n for (let y = 0; y < height; y++) {\n // table row is intitialized inside the for loop so as to create a different <tr> in each loop\n const tableRow = document.createElement(\"tr\");\n grid.appendChild(tableRow);\n for (let x = 0; x < width; x++) {\n const tableColumn = document.createElement(\"td\");\n tableRow.appendChild(tableColumn);\n }\n }\n grid.addEventListener(\"click\", setCellColor);\n}", "function setGridSize(size) {\n gridContainer.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n}", "function makeGrid() {\n // reset pixel canvas\n $(\"#pixelCanvas\").html(\"\");\n // Select size input\n height = $(\"#inputHeight\").val();\n width = $(\"#inputWeight\").val();\n //loop to add table cells and rows according to user input\n for (let x = 0; x < height; x++) {\n $('#pixelCanvas').append('<tr></tr>');\n }\n for (let y = 0; y < width; y++) {\n $('#pixelCanvas tr').each(function () {\n $(this).append('<td></td>');\n });\n }\n}", "function updateGridDimensions() \n{\n\tvar squareSize = $('.square').css('width');\n\tvar squareSizePx = parseInt(squareSize);\n\t$('.square').css('height', squareSize);\n\t$('.square').css('width', squareSize);\n\t$('.square').css('font-size', (squareSizePx * 0.5) + 'px');\n\t$('.square').css('border', (squareSizePx * 0.06) + 'px solid #baad9e');\n\t$('#grid').css('border', (squareSizePx * 0.06) + 'px solid #baad9e');\n}", "function createGrid(size) {\n var wrapper = $('#wrapper'),\n squareSide = 600 / size;\n $(wrapper).empty();\n for (var i = 0; i < size; i++) {\n for (var j = 0; j < size; j++) {\n $(wrapper).append('<div class=square id=xy_' + i + '_' + j + '></div>');\n\n }\n }\n\n //Single square size setting\n $('.square').css({\n \"height\": squareSide + \"px\",\n \"width\": squareSide + \"px\"\n\n });\n }", "function setGridSize(size) {\n gridContainer.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n}", "function createGrid(size) {\n container.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n container.style.gridTemplateRows = `repeat(${size}, 1fr)`;\n}", "fixSizes() {\n // subGrid width\n this.callEachSubGrid('fixWidths');\n }", "fixSizes() {\n // subGrid width\n this.callEachSubGrid('fixWidths');\n }", "function makeGrid() {\n\n\n}", "function makeGrid() {\n canvas.find('tbody').remove();\n\n //submit button size changes to fit grid size\n var gridRows = heightInput.val();\n var gridCol = weightInput.val();\n\n //tbody set to the table\n canvas.append('<tbody></tbody>');\n\n var canvasBody = canvas.find('tbody');\n\n //drawing grid rows\n for (var i = 0; i < gridRows; i++) {\n canvasBody.append('<tr></tr>');\n }\n\n //draw grid col\n for (var i = 0; i < gridCol; i++) {\n canvas.find('tr').append('<td class=\"transparent\"></td>');\n }\n }", "function createGrid(size){\n gridContainer.style.display='grid';\n gridContainer.style.gridTemplateColumns=`repeat(${size},1fr)`;\n gridContainer.style.gridTemplateRows=`repeat(${size},1fr)`;\n createElement(size);\n}", "_resize() {\n // Reset\n set_css_var('--grid-width', '100%');\n set_css_var('--grid-height', '100%');\n set_css_var('--grid-padding', '0');\n set_css_var('--font-size-normal', '0px');\n set_css_var('--font-size-flash', '0px');\n set_css_var('--font-size-focus', '0px');\n // Compute sizes\n let columns = this.options.grid.columns;\n let rows = Math.ceil(this.options.symbols.length / columns);\n let grid_width = this.options.grid.element.clientWidth;\n let grid_height = this.options.grid.element.clientHeight;\n let grid_padding = 0;\n if (this.options.grid.ratio) {\n let ratio = this.options.grid.ratio.split(':');\n if (ratio[0] * grid_height >= grid_width * ratio[1]) {\n let height = (ratio[1] * grid_width) / ratio[0];\n grid_padding = (grid_height - height) / 2 + \"px 0\";\n grid_height = height;\n\n } else {\n let width = (ratio[0] * grid_height) / ratio[1];\n grid_padding = \"0 \" + (grid_width - width) / 2 + \"px\";\n grid_width = width;\n }\n }\n let cell_width = grid_width / columns;\n let cell_height = grid_height / rows;\n let cell_size = (cell_width > cell_height) ? cell_height : cell_width;\n let cell_size_off = Math.ceil(cell_size * .5);\n let cell_size_on = this.options.stim.magnify ? Math.ceil(cell_size * .80) : cell_size_off;\n // Adjust\n set_css_var('--grid-width', grid_width + 'px');\n set_css_var('--grid-height', grid_height + 'px');\n set_css_var('--grid-padding', grid_padding);\n set_css_var('--font-size-normal', cell_size_off + 'px');\n set_css_var('--font-size-flash', cell_size_on + 'px');\n set_css_var('--font-size-focus', cell_size_on + 'px');\n }", "function setsize() {\n\tvar sizes = $(\".well input[name='size']\").val().split(\"x\");\n\t// add properties to object and store for future play\n\tCW.sizex = sizes[0];\n\tCW.sizey = sizes[1];\n\tlocalStorage[\"sizex\"] = sizes[0];\n\tlocalStorage[\"sizey\"] = sizes[1];\n\tlocalStorage[\"black\"] = CW.black;\n\tlocalStorage[\"blank\"] = CW.blank;\n\t$(\".well > h3\").text(\"Generator for \" + CW.sizex + \"x\" + CW.sizey + \" Crossword Puzzle\")\n\t$(\".word\").toggle(\"slow\");\n\t$(\".form-inline\").hide();\n\tevent.preventDefault();\n}", "function createGrid(size) {\n\tif (gridBlocks.length > 0) {\n\t\tfor (let block = 0; block < gridBlocks.length; block++) {\n\t\t\tcontainer.removeChild(gridBlocks[block]);\n\t\t}\n\n\t\tgridBlocks = [];\n\t}\n\n\tcontainer.style['grid-template-columns'] = `repeat(${size}, 1fr)`;\n\n\tfor (let i = 0; i < (size * size); i++) {\n\t\tconst gridBlock = document.createElement('div');\n\t\tgridBlock.style.width = `${480 / size}`;\n\t\tgridBlock.style.height = `${480 / size}`;\n\t\tgridBlock.style.border = '1px solid rgba(0, 0, 0, 0.3)';\n\t\tcontainer.appendChild(gridBlock);\n\n\t\tgridBlocks.push(gridBlock);\n\t}\n\n\tcheckForClick();\n\n}", "function buttonClicked() {\n \n let getGridSize = prompt(\"Please enter a new grid size (1-100)\");\n if (getGridSize >= 1 && getGridSize <=100){\n Array.from(gridItem_div).forEach(function (e){\n e.classList.remove(\"divChanged\");\n });\n gridSize = getGridSize; //modify global variable\n setGrid(gridSize);\n makeDivs() \n }\n}", "function changeValue(){\n\tvar newGridValue = prompt(\"Set the new size for the grid! WARNING: Values above 64 may cause lag: \");\n\tif(!isNaN(newGridValue) && newGridValue > 0 && (newGridValue % 1 === 0)){\n\t\tclearGrid();\n\t\tdrawGrid(newGridValue);\n\t\tpixelHover();\n\t} else {\n\t\talert(\"INVALID INPUT. Make sure you're writing a positive whole NUMBER!\");\n\t}\n}", "function userInput() {\n let gridSize = 1;\n while (gridSize < 2 || gridSize > 50) {\n gridSize = prompt(\"How many squares per side would you like your grid to have? Maximum of 50.\");\n }\n createChildDivs(gridSize);\n}", "function defaultGrid(){\n gridSize(24)\n createDivs(24)\n}", "function makeGrid() {\n\n\t// Your code goes here!\n\t\n\tlet submit = $('input[type=\"submit\"]');\n\tlet canvas = $('#pixelCanvas');\n\tlet colorPicker = $('#colorPicker');\n\n\tsubmit.on('click', function(e){\n\t\te.preventDefault();\n\t\tcanvas.empty();\n\t\tlet height = $('#inputHeight').val();\n\t\tlet width = $('#inputWeight').val();\n\t\tconsole.log(height);\n\t\tconsole.log(width);\n\t\taddRows(height, width);\n\t});\n\t\n\tfunction addRows(height,width){\n\t\tfor(var i=0; i < height; i++) {\n\t\t\tcanvas.append('<tr></tr>');\n\t\t}addColumns(width);\n\t}\n\t\n\tfunction addColumns(width){\n\t\tfor(var i=0; i <width; i++) {\n\t\t\tlet cell=$('<td></td>',{class:'cells'});\n\t\t\n\t\t\tcell.on('click',function(e){\n\t\t\t\te.preventDefault()\n\t\t\t\tlet color = colorPicker.val();\n\t\t\t\t$(this).css('background-color', color);\n\t\t\t});\n\n\t\t\t$('tr').append(cell);\n\t\t}\n\t}\n\n\t$('#clear').on('click', function(e){\n\t\te.preventDefault();\n\t\t$('.cells').css('background-color','');\n\t})\n}", "function makeGrid() {\n\n// Your code goes here!\n\n const height = $(\"#input_height\").val();\n const width = $(\"#input_width\").val();\n const table = $(\"#pixel_canvas\");\n\n // Remove previous table\n table.children().remove();\n\n // Set the table\n for(let r = 0; r < height; r++ ){\n let tr = document.createElement(\"tr\");\n table.append(tr);\n\n for(let w = 0; w < width; w++){\n let td = document.createElement(\"td\");\n tr.append(td);\n }\n\n }\n\n // Submit the form and call function to set the grid\n $(\"#sizePicker\").submit(function(event){\n event.preventDefault();\n makeGrid();\n });\n\n // Declare clickable mouse event\n let mouseDown = false;\n\n $(\"td\").mousedown(function(event){\n mouseDown = true;\n const color = $(\"#colorPicker\").val();\n $(this).css(\"background\", color);\n // Mouse drag for drawing\n $(\"td\").mousemove(function(event){\n event.preventDefault();\n // Check if mouse is clicked and being held\n if(mouseDown === true){\n $(this).css(\"background\",color);\n }else{\n mouseDown = false;\n } \n });\n });\n\n // Mouse click release\n $(\"td\").mouseup(function(){\n mouseDown = false;\n });\n\n // Disable dragging when the pointer is outside the table\n $(\"#pixel_canvas\").mouseleave(\"td\",function(){\n mouseDown = false;\n });\n}", "function createGrid() {\r\n removeSquares(); // remove the previous squars\r\n let squares = [];\r\n let grid = prompt('How many squares you need in each direction?', 16);\r\n if(grid < 0 || grid > 64 || isNaN(grid)){ //Check if the input is a valid numbers\r\n\r\n alert(\"Please enter a valid number of grid more than 0 and less than or equal 64 grids.\")\r\n\r\n }else{\r\n let squareSize = (100 / grid) + '%';\r\n for (let i = 1; i <= grid ** 2; i++) {\r\n squares[i] = document.createElement('div');\r\n squares[i].id = 'square' + i;\r\n squares[i].className = 'squares';\r\n container.appendChild(squares[i]);\r\n }\r\n\r\n const squareStyle = document.querySelectorAll('.squares');\r\n squareStyle.forEach((e) => {\r\n e.setAttribute('style', `width:${squareSize};height:${squareSize};`);\r\n });\r\n keepColor();\r\n}\r\n}", "function gridSize(size) {\n container.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n}", "function makeGrid() {\n\t// hide the Grid by defult to show it in an animation style\n\ttable.hide();\n\ttable.empty();\n\n\tconst width = $('#input_width').val() ;\n\tconst height = $('#input_height').val() ;\n\n\t// no create the Grid !!\n\t// create the rows first (height).\n\tfor(var i = 0; i < height; i++) {\n\t\ttable.append('<tr class=\"rows\"></tr>') ;\n\t}\n\t// then we create the columns(width).\n\tfor(var i = 0; i < width; i++) {\n\t\t$('.rows').append('<td class=\"col\"></td>') ;\n\t}\n}", "function createGrid(size = 4) {\n \n if ( size > 64 || isNaN(size)) return alert('the number has to be less than 64');\n \n for (let i = 0 ; i<size*size; i++){\n const createDivs = document.createElement('div');\n createDivs.style.width = `${(100/size)-0.4}%`;\n createDivs.classList.add('grid');\n main.appendChild(createDivs);\n}\n mouseOver();\n}", "function createNewGrid() {\n let gridSide = prompt('How many squares per side ?');\n\n if (gridSide <= 64 && gridSide > 1) {\n etchySketchy = new GridSystem(gridSide);\n } else {\n alert('Side must be between 2 and 64 squares !');\n }\n}", "SetOverallGridSize(value){\n\t\tvar chk = new Checker(\"SetOverallGridSize\");\n\t\tchk.isValidType(value, \"value\", 'number');\n\t\tthis.overallGridSize = value;\n\t\t\n\t}", "function drawGrid() {\n let dotCount = Number(inputDotCount.value);\n let dotSize = Number(inputDotSize.value);\n let desiredGridWidth = Number(inputGridWidth.value);\n let columnCount = Math.floor(desiredGridWidth / dotSize);\n\n // dette er bare for å vise ønsket bredde på grid\n // (faktisk bredde styres også av prikkstørrelse)\n widthIndicator.style.width = desiredGridWidth + 'px';\n\n // sette hvor mye man skal øke/minke input-feltet for gridbredde når man bruker pil opp/ned\n inputGridWidth.step = dotSize;\n\n grid.style.gridTemplateColumns = `repeat(${columnCount}, ${dotSize}px)`;\n grid.style.gridAutoRows = dotSize + 'px';\n\n let html = '';\n for (let i = 0; i < dotCount; i++) {\n html += '<div class=\"dot\"><div></div></div>';\n }\n\n grid.innerHTML = html;\n}", "function makeGrid (){\nvar in1= $('#input_height').val();\nvar in2= $('#input_width').val();\n$(\"#pixel_canvas\").html(table(in1,in2)); }", "setWidth(){\n var newWidth = prompt(\"Enter a new bitmap width: \", 8);\n if(newWidth != null){\n newWidth = parseInt(newWidth);\n if(newWidth != NaN){\n if(newWidth >= 1 && newWidth <= 72){\n this.COLUMN_COUNT = newWidth;\n this.updatePanelTitle();\n this.renderGrid();\n this.saveLocally();\n this.applyGridSize();\n return true;\n }else{\n alert(\"That width is too large or small (min: 1, max: 72)\");\n return false;\n }\n }\n }\n return false;\n }", "constructor () {\n this.size = 16;\n this.grid_status = this.makeStatus();\n this.boxies = this.makeBoxes();\n }", "function changeGridSize(){\n gridContainer.innerHTML = ''; //clear grid Container before adding new divs\n let gridSize = parseInt(slider.value,10);\n for (let i=1; i<=Math.pow(gridSize,2); i++){\n addElement();\n\n };\n gridContainer.style[\"grid-template-columns\"] = \"repeat(\" + gridSize + \", 1fr)\";\n}", "function resetGrid() {\n // remove the old grid\n const cells = Array.from(grid.childNodes);\n for(let i = 0; i < cells.length; i++)\n grid.removeChild(cells[i]);\n\n // get the new size\n let size = 0;\n while(size < 2 || size > 100 || isNaN(size)) {\n size = prompt(\"Enter a new grid size between 2 and 100:\");\n }\n // create a grid with the new size\n makeRows(size, size);\n}", "function makeGrid(event) {\n// Your code goes here!\n event.preventDefault();\n let height = heightInput.value;\n let width = widthInput.value;\n console.log(height + \",\" + width);\n while (pixelCanvas.firstChild) {\n pixelCanvas.removeChild(pixelCanvas.firstChild);\n }\n\n for (let i = 0; i < height; i++) {\n let newRow = document.createElement(\"tr\");\n for (let j = 0; j < width; j++) {\n let newTd = document.createElement(\"td\");\n newRow.appendChild(newTd);\n }\n pixelCanvas.append(newRow);\n }\n}", "function drawGrid(numTiles, qType) {\n var gridContainer = $('.grid');\n var gridSize = Math.sqrt(numTiles);\n gridContainer.css('width', gridSize * TILE_SIZE + \"px\");\n gridContainer.html('<label>Letters</label>');\n var rowTemplate = $('.gridRow.template');\n var tileTemplate = $('.tile.template');\n var tileContainer, rowCopy, tileCopy;\n for(var i = 1; i <= gridSize; ++i) {\n rowCopy = rowTemplate.clone();\n rowCopy.removeClass('template');\n rowCopy.addClass('gridRow' + i);\n for(var j = 1; j <= gridSize; ++j) {\n tileCopy = tileTemplate.clone();\n tileCopy.removeClass('template');\n tileCopy.addClass('tile' + ((i-1) * gridSize + j));\n tileCopy.html('<input type=\"text\" size=\"1\" maxlength=\"1\" align=\"middle\"></div>');\n rowCopy.append(tileCopy);\n }\n gridContainer.append(rowCopy);\n }\n $('.tile:not(.template):first input').focus();\n if (isTouchScreen()) {\n $('.tile:not(.template):first input').click();\n }\n}", "function makeGrid(e) {\n // Select color input\n // const colorPicked = document.getElementById('colorPicker').value;\n // Select size input\n //height (tr)\n let inputHeight = document.getElementById('inputHeight').value;\n // console.log(inputHeight);\n //width (td)\n let inputWidth = document.getElementById('inputWidth').value;\n // console.log(inputWidth);\n // canvas\n let pixelCnvs = document.getElementById('pixelCanvas');\n pixelCnvs.innerHTML = '';\n // adding tr and td to the table\n let tableBody = document.createElement('tbody');\n for(let i = 0; i < inputHeight; i++) {\n let tableRow = document.createElement('tr');\n for (let j = 0; j < inputWidth; j++) {\n let tableColumn = document.createElement('td');\n tableColumn.appendChild(document.createTextNode(''));\n tableRow.appendChild(tableColumn);\n }\n tableBody.appendChild(tableRow);\n }\n pixelCnvs.appendChild(tableBody);\n e.preventDefault();\n\n}", "function makeGrid() { // Select and create grid size\n \n // select the table\n let pixelCanvas = document.querySelector('#pixelCanvas');\n \n // Select size input\n let gridHeight;\n let gridWidth;\n \n gridHeight = document.querySelector(\"#inputHeight\").value;\n gridWidth = document.querySelector(\"#inputWidth\").value;\n\n console.log(`gridHeight is ${gridHeight} and gridWidth is ${gridWidth}`);\n\n for (let i = 0 ; i < gridHeight ; i++) {\n console.log(`before building row ${i} of ${gridHeight}`);\n pixelCanvas.insertAdjacentHTML('beforeend', '<tr></tr>');\n };\n \n let trs = document.querySelectorAll(\"tr\");\n console.log(`trs.length is ${trs.length}`);\n for (let i = 0 ; i < gridWidth ; i++) { \n console.log(`before building column ${i} of ${gridWidth}`);\n \n for (let tr = 0; tr < trs.length; tr++) {\n console.log(`before building on tr ${tr} of ${trs.length}`);\n trs[tr].insertAdjacentHTML('beforeend', '<td></td>');\n }\n }\n \n // creates the css background color decided before submit grid creation\n console.log(`background color is ${backgroundColor}`);\n //create variable for all cells\n let gridCells = document.querySelectorAll(\"td\");\n //paint all cells of the grid iterating through the nodelist gridCells\n for (let gridCell = 0; gridCell < gridCells.length; gridCell++) {\n console.log(`painting BG gridCell ${gridCell} of ${gridCells.length}`);\n gridCells[gridCell].style.backgroundColor = backgroundColor;\n }\n \n }", "function makeGrid() {\n var {width, height} = size_input();\n\n for (rowNum = 0; rowNum < height; rowNum++) {\n grid.append(\" <tr></tr>\");\n }\n for (colNum = 0; colNum < width; colNum++) {\n $(\"#pixel_canvas tr\").append(\" <td></td>\");\n }\n}", "function resetGrid(){\n let divCount = prompt(\"How many boxes per side do you need?\");\n clearGrid();\n createGrid(divCount);\n}", "function setSizes()\n {\n if (DOM.container.offsetHeight > DOM.container.offsetWidth)\n {\n DOM.container.style.minWidth = DOM.container.offsetHeight + \"PX\";\n }\n\n desk.style.height = sizes.desk.height + \"PX\";\n desk.style.width = sizes.desk.width + \"PX\";\n desk.style.marginBottom = sizes.deskContainer.marginBottom + \"PX\";\n\n for (var counterRow = 0; counterRow < sizes.field.rows; counterRow++)\n {\n for (var counterCol = 0; counterCol < sizes.field.cols; counterCol++)\n {\n DOM.game.field.rows[counterRow].cells[counterCol].style.height = sizes.card.height + \"PX\";\n DOM.game.field.rows[counterRow].cells[counterCol].style.width = sizes.card.width + \"PX\";\n\n var card = cards[counterRow * sizes.field.cols + counterCol];\n if (card)\n {\n card.style.height = sizes.card.height + \"PX\";\n card.style.width = sizes.card.width + \"PX\";\n }\n }\n }\n }", "function changeSize(val) {\n\tvar s = String(val).split(\",\");\n\td3.select('#viz_container').style('width', s[0] + 'px').style('height', s[1] + 'px');\n\tviz.update();\n}", "function changeSize(val) {\n\tvar s = String(val).split(\",\");\n\td3.select('#viz_container').style('width', s[0] + 'px').style('height', s[1] + 'px');\n\tviz.update();\n}", "function updateSizeValues(){\n\tswitch (runDialog.sizeConfig.outputPresetInput.selection.index){\n\t\tcase 0:\n\t\t\tsetSizeValues(8.5, 11, 6, 9, 150);\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tsetSizeValues(11, 8.5, 9, 6, 150);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tsetSizeValues(11, 14, 8, 12, 150);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tsetSizeValues(14, 11, 12, 8, 150);\n\t\t\tbreak;\n\t}\n}", "function sizeChanged () {\n board = new Board(sizeSlider.value())\n board.initView(windowWidth / 2, windowHeight / 2, CENTER_BOARD_SIZE)\n}", "function SizeCheckBox() {\n guiData.sizeActivated = !guiData.sizeActivated;\n p.getBubbleDrawer().useSize(guiData.sizeActivated);\n if (guiData.sizeActivated)\n {\n $(\"#selectSizeValue\").next(\"input\").autocomplete(\"enable\");\n }\n else\n {\n $(\"#selectSizeValue\").next(\"input\").autocomplete(\"disable\");\n }\n if (!isPlaying)\n refreshDisplay();\n}", "function changeGrid() {\n\t$( \"#inputHeight\" ).on( \"change\", function( evt ) {\n\t\tGRID.rows = evt.target.value;\n\t\t$(\"#inputHeight\").attr(\"value\", GRID.rows);\n\t\tconsole.log( \"-- Grid rows changed --\" );\n\t\tconsole.log( evt );\n\t\t//console.log( evt.target.value );\n\t\tgetGrid();\n\t});\n\n\t$( \"#inputWeight\" ).on( \"change\", function( evt ) {\n\t\tGRID.columns = evt.target.value;\n\t\t$(\"#inputWeight\").attr(\"value\", GRID.columns);\n\t\tconsole.log( \"-- Grid columns changed --\" );\n\t\tconsole.log( evt );\n\t\t//console.log( evt.target.value );\n\t\tgetGrid();\n\t});\n}", "function ChangeSize(value) {\n if (document.getElementById(\"sizeCheckBox\").checked == true) {\n guiData.cursorSize = value;\n if (!isPlaying) {\n refreshBubbles();\n refreshDisplay();\n }\n }\n else {\n p.getBubbleDrawer().setSize(value);\n if (!isPlaying) {\n refreshBubbles();\n refreshDisplay();\n }\n }\n}", "function editor_tools_handle_size()\n{\n editor_tools_store_range();\n\n // Create the size picker on first access.\n if (!editor_tools_size_picker_obj)\n {\n // Create a new popup.\n var popup = editor_tools_construct_popup('editor-tools-size-picker','l');\n editor_tools_size_picker_obj = popup[0];\n var content_obj = popup[1];\n\n // Populate the new popup.\n for (var i = 0; i < editor_tools_size_picker_sizes.length; i++)\n {\n var size = editor_tools_size_picker_sizes[i];\n var a_obj = document.createElement('a');\n a_obj.href = 'javascript:editor_tools_handle_size_select(\"' + size + '\")';\n a_obj.style.fontSize = size;\n a_obj.innerHTML = editor_tools_translate(size);\n content_obj.appendChild(a_obj);\n\n var br_obj = document.createElement('br');\n content_obj.appendChild(br_obj);\n }\n\n // Register the popup with the editor tools.\n editor_tools_register_popup_object(editor_tools_size_picker_obj);\n }\n\n // Display the popup.\n var button_obj = document.getElementById('editor-tools-img-size');\n editor_tools_toggle_popup(editor_tools_size_picker_obj, button_obj);\n}", "changeSize(width, height) {\n\t\t\t\tthis.each(function (model) {\n\t\t\t\t\tmodel.set({width, height});\n\t\t\t\t});\n\t\t\t}", "function buildGrid(size){\n \n let squareSize = document.getElementById('grid').clientWidth / size;\n //Creating the square and defining his size\n for(let i=1 ; i<=size*size;i++){ \n let square = document.createElement('div')\n grid.appendChild(square);\n square.classList.add('square-grid');\n square.style.width = squareSize + \"px\";\n square.style.height = squareSize + \"px\";\n //Rounding square grid corners\n if(i==1){\n square.style.borderTopLeftRadius = \"10px\";\n }else if(i==size){\n square.style.borderTopRightRadius = \"10px\";\n }else if(i==size*size-size+1){\n square.style.borderBottomLeftRadius = \"10px\";\n }else if(i==size*size){\n square.style.borderBottomRightRadius = \"10px\";\n }\n }\n \n}", "calcGridAndCellsSize() {\r\n let actualWidth = ~~$(\".mdl-grid\").width();\r\n let cellSize = actualWidth / this.game.config.numColumnsOnMap;\r\n if (cellSize > 120) {\r\n cellSize = 120;\r\n } else {\r\n cellSize = 60;\r\n }\r\n $(\".mdl-cell\").each((idx, cell) => {\r\n $(cell).width(cellSize);\r\n $(cell).height(cellSize);\r\n });\r\n if (actualWidth !== cellSize * this.game.config.numColumnsOnMap) {\r\n actualWidth = cellSize * this.game.config.numColumnsOnMap;\r\n $(\".mdl-grid\").width(actualWidth);\r\n }\r\n $(\".mdl-grid\").height(cellSize * this.game.config.numRowsOnMaps);\r\n }", "function changeSize(val) {\n\tvar s = String(val).split(\",\");\n\td3.select('#viz_container').style('width', s[0] + 'px').style('height', s[1] + 'px');\n\tviz\n\t .fontSizeMax(function () { return Math.max(30,s[1] * .1) })\n\t .update();\n}", "function calcCellSize(grid_size) {\n var cell_size = 5;\n return cell_size\n}", "function operate(option) {\n\tif (option == 4) {\n\t\tclear();\n\t\treturn;\n}\npresent_option = option;\nvar size = prompt(\"Enter a Grid Size from 1 - 128.\");\nif ((size > 0) && (size < 128)) {\n\tpresent_size = size;\n\tclear();\n} else {\n\toperate(option);\n}\n}", "function createGrid(gridSize) {\n const outerContainer = document.querySelector(\"#outer-container\");\n const container = document.createElement('div');\n container.setAttribute(\"id\", \"container\");\n outerContainer.appendChild(container);\n container.style = \"grid-template-columns: repeat(\"+ gridSize +\", 1fr)\";\n const informationBox = document.querySelector(\"#information-box\");\n outerContainer.insertBefore(container,informationBox);\n for (let i = 0; i < (gridSize * gridSize); i++) {\n const container = document.querySelector('#container');\n\n const div = document.createElement('div');\n div.className = 'grid-block';\n container.appendChild(div);\n }\n}", "function makeGrid(evt) {\n\t//access current height and width\n\txCell = $(\"#inputWidth\").val();\n\tyCell = $(\"#inputHeight\").val(); \n\t//access table element\n\ttable = $(\"#pixelCanvas\");\n\trows =\"\";//rows\n\tcols =\"\";//cols\n\t//create xCell no of row.\n\tfor(var r=1; r<=yCell; r++){\n\t\trows = rows + \"<tr></tr>\";\n\t}\n\t//create ycell no of column in each row.\n\tfor(var c=1; c<=xCell; c++){\n\t\tcols = cols + \"<td></td>\";\n\t}\n\t//create table with above rows and cols.\n\ttable.html(rows);\n\t$(\"tr\").html(cols);\n\t//do not submit.\n\tevt.preventDefault();\n}", "function createGrids() {\n // Clear previous grids\n $(\"#inputGrid\").empty();\n $(\"#outputGrid\").empty();\n\n // Set size for new grids\n let columns = (new Array(parseInt($(\"#width\").val()))).fill(\"1fr\").join(\" \");\n let rows = (new Array(parseInt($(\"#height\").val()))).fill(\"1fr\").join(\" \");\n\n $(\"#inputGrid\").css(\"grid-template-columns\", `${columns}`);\n $(\"#inputGrid\").css(\"grid-template-rows\", `${rows}`);\n $(\"#outputGrid\").css(\"grid-template-columns\", `${columns}`);\n $(\"#outputGrid\").css(\"grid-template-rows\", `${rows}`);\n\n let grids = parseInt($(\"#width\").val()) * parseInt($(\"#height\").val());\n\n for (let i = 0; i < grids; i++) {\n $(\"#inputGrid\").append(`<div id=\"input${i}\" style=\"background-color: white;\" onmouseover=paint(this)></div>`);\n $(\"#outputGrid\").append(`<div id=\"output${i}\" style=\"background-color: white;\"></div>`);\n }\n\n NETWORK = new HopfieldNetwork(parseInt($(\"#width\").val()) * parseInt($(\"#height\").val()));\n}", "function makeGrid() {\n removeGrid();\n let rows = gridHeight.val();\n let columns = gridWidth.val();\n //Add Row to the Table\n for (let addRow = 0; addRow < rows; addRow++) {\n grid.append('<tr class=\"tableRow\">');\n };\n //Add column to the table\n for (let addColumn = 0; addColumn < columns; addColumn++) {\n $(\"tr\").each(function() {\n $(this).append('<td class=\"tableCell\">');\n });\n }\n}", "function makeGrid() {\n // Removing previous grid if it exists\n $('tr').remove();\n // Setting variables for width and height\n const canvasWidth = $('#input_width').val();\n const canvasHeight = $('#input_height').val();\n // Conditional for checking correct input\n // NOT NEEDED ANYMORE\n\n // if (((canvasWidth < 1) || (canvasWidth > 50) || (canvasHeight < 1) || (canvasHeight > 50))) {\n // $('.warning p').css('visibility', 'visible');\n // $('.warning p').fadeOut(7000, function() {\n // $(this).css('display', 'block');\n // $(this).css('visibility', 'hidden');\n // });\n // } else {\n\n // Actual function making all hard work :)\n for (let i = 0; i < canvasHeight; i++) {\n $('#pixel_canvas').append('<tr></tr>');\n for (let i = 0; i < canvasWidth; i++) {\n $('tr:last-of-type').append('<td></td>');\n };\n };\n}", "function makeGrid() {\n // Removing previous grid if it exists\n $('tr').remove();\n // Setting variables for width and height\n const canvasWidth = $('#input_width').val();\n const canvasHeight = $('#input_height').val();\n // Conditional for checking correct input\n // NOT NEEDED ANYMORE\n\n // if (((canvasWidth < 1) || (canvasWidth > 50) || (canvasHeight < 1) || (canvasHeight > 50))) {\n // $('.warning p').css('visibility', 'visible');\n // $('.warning p').fadeOut(7000, function() {\n // $(this).css('display', 'block');\n // $(this).css('visibility', 'hidden');\n // });\n // } else {\n\n // Actual function making all hard work :)\n for (let i = 0; i < canvasHeight; i++) {\n $('#pixel_canvas').append('<tr></tr>');\n for (let i = 0; i < canvasWidth; i++) {\n $('tr:last-of-type').append('<td></td>');\n };\n };\n}", "function handleSize(e) {\n if (stateObject.isRunning) return;\n let value = e.currentTarget.value;\n\n if (window.innerWidth < 800) {\n if (value > 15) {\n value = 15;\n }\n }\n\n scaling[changeSize.id] = value;\n resetAndRenderArray();\n setTimeout(() => {\n for (let i = 0; i < scaling.changeSize; i++) {\n document.getElementById(`arrayBar_${i}`).style.width = scaleWidth(scaling.changeSize);\n }\n }, 100);\n}", "function makeGrid(height, width) {\n // set size of canvas\n for (var i = 0; i < height.value; i++) {\n const row = canvas.insertRow(i); // calls the function to set size rows\n for (var j = 0; j < width.value; j++) {\n const cell = row.insertCell(j); // cal the function to set size of insertCell\n cell.addEventListner(\"click\", fillSquare);\n }\n }\n}", "function drawSelGrid(){\n\tvar obj = gridSize();\n\tvar canvas = document.getElementById('sel_grid');\n\t\n\tvar context = canvas.getContext('2d');\n\tcontext.scale(dpr,dpr);\n\t\n\t//Set the canvas size\n\tcanvas.width = (obj.colWidth * obj.cols+0.5)*dpr;\n\tcanvas.height = (obj.rowHeight*obj.rows+0.5)*dpr;\n\t\n\tcanvas.style.width = `${obj.colWidth * obj.cols+0.5}px`;\n\tcanvas.style.height = `${obj.rowHeight*obj.rows+0.5}px`;\n\tcontext.scale(dpr,dpr);\n\n}", "setSize(size) {\n this.size = size;\n }", "_configurationGridSize (containerName, width, height) {\n if (width) {\n document.getElementById(containerName).style.width = width + \"px\";\n }\n else {\n document.getElementById(containerName).style.width = \"100%\";\n }\n if (height) {\n document.getElementById(containerName).style.height = height + \"px\";\n }\n else {\n document.getElementById(containerName).style.height = \"90%\";\n }\n }", "setSize(size) {\n this.size = size;\n }", "function setGrid(gridSize){\n container.style.gridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n container.style.gridTemplateRows = `repeat(${gridSize}, 1fr)`;\n}", "function makeGrid() {\n const height = inputHeight.val();\n const width = inputWidth.val();\n\n for (let i = 0; i < height; i++) {\n const row = $('<tr></tr>');\n for (let j = 0; j < width; j++) {\n row.append('<td></td>');\n }\n canvas.append(row);\n }\n}", "scale(size) {\n document.getElementById(\"guiArea\").style.width = size + \"px\";\n }" ]
[ "0.7693881", "0.755239", "0.7506424", "0.7471815", "0.7240095", "0.72139996", "0.71550363", "0.71260715", "0.7101283", "0.7093287", "0.708926", "0.70476127", "0.7043265", "0.7038942", "0.6989011", "0.698573", "0.69554275", "0.69309515", "0.6888674", "0.6860019", "0.68562645", "0.67957187", "0.67923695", "0.67825085", "0.67691004", "0.67539215", "0.6748325", "0.67177504", "0.6669969", "0.65454155", "0.6525758", "0.6523636", "0.64897025", "0.6465437", "0.64644194", "0.64603543", "0.6458124", "0.6449937", "0.64298886", "0.64162564", "0.64162564", "0.64090675", "0.64049387", "0.6404854", "0.6398787", "0.6388196", "0.637671", "0.63533854", "0.634862", "0.63486016", "0.63465804", "0.63403994", "0.630611", "0.63059133", "0.6305872", "0.6292637", "0.6270733", "0.62700176", "0.624083", "0.62154186", "0.62150866", "0.62072545", "0.62052256", "0.6193452", "0.6192449", "0.61894274", "0.6176294", "0.6158158", "0.6149849", "0.6141248", "0.6139639", "0.6128886", "0.61215246", "0.61215246", "0.61207736", "0.6116913", "0.6116514", "0.61123157", "0.6109661", "0.61011267", "0.6098373", "0.60940707", "0.60929376", "0.60878855", "0.60822415", "0.60770845", "0.6075786", "0.6075178", "0.60701704", "0.606381", "0.60584337", "0.60584337", "0.6055057", "0.6053857", "0.60519916", "0.60512185", "0.6034011", "0.6032501", "0.60271174", "0.6024893", "0.6014461" ]
0.0
-1
Lock chuc nang trong phan cong do an
function setLock(button, number){ for(i = 0; i < 8; i++){ if(i==number-1) continue; document.getElementsByClassName("btn-lock")[i].classList.remove("btn-success"); document.getElementsByClassName("btn-lock")[i].classList.add("btn-danger"); document.getElementsByClassName("btn-lock")[i].value = "1"; document.getElementById("input-action").value = 0; document.getElementsByClassName("btn-lock")[i].innerHTML = "Khóa 🔒"; } if(button.value == "1"){ document.getElementsByClassName("btn-lock")[number-1].classList.remove("btn-danger"); document.getElementsByClassName("btn-lock")[number-1].classList.add("btn-success"); document.getElementsByClassName("btn-lock")[number-1].value = "0"; document.getElementsByClassName("btn-lock")[number-1].innerHTML = "Mở 🔓"; document.getElementById("input-action").value = number; } else{ document.getElementsByClassName("btn-lock")[number-1].classList.remove("btn-success"); document.getElementsByClassName("btn-lock")[number-1].classList.add("btn-danger"); document.getElementsByClassName("btn-lock")[number-1].value = "1"; document.getElementsByClassName("btn-lock")[number-1].innerHTML = "Khóa 🔒"; document.getElementById("input-action").value = 0; } document.getElementById("btn-confirm").disabled = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async lock() {\n\t\tif (this.lock_status_id === 3) {\n\t\t\treturn;\n\t\t}\n\t\tawait this.send_command(0);\n\t\tawait this.await_event('status:LOCKED');\n\t}", "function setLock(locked)\r\n{\r\n lock = locked;\r\n}", "lock(currentPlayer, consequence, channel){\n if(currentPlayer.passes.includes(consequence.pass)){\n channel.send(consequence.successDescription).catch(err => {console.error(err);})\n if(consequence.consequences){\n consequence.consequences.forEach(aConsequence => {\n makeItHappen(currentPlayer, consequence.consequences, channel)\n })\n }\n }else{\n channel.send(consequence.description).catch(err => {console.error(err);})\n }\n }", "function handleLocking(event) {\n if (event.shiftKey && event.which == 76) {\n // control key pressed, pause the state\n locked = !locked;\n }\n }", "_lock(key) {\n const me = this;\n\n debug(`${me._lock.name}: ${key}`);\n\n if (me.keyLockCounterMap.has(key)) {\n let counter = me.keyLockCounterMap.get(key);\n\n me.keyLockCounterMap.set(key, ++counter);\n\n if (counter === 1) {\n me.emit(`_lock_${key}`);\n }\n } else {\n me.keyLockCounterMap.set(key, 1);\n }\n }", "function lockRoom(lock) {\n var currentSharedKey = '';\n if (lock)\n currentSharedKey = sharedKey;\n\n APP.xmpp.lockRoom(currentSharedKey, function (res) {\n // password is required\n if (sharedKey)\n {\n console.log('set room password');\n Toolbar.lockLockButton();\n }\n else\n {\n console.log('removed room password');\n Toolbar.unlockLockButton();\n }\n }, function (err) {\n console.warn('setting password failed', err);\n messageHandler.showError(\"dialog.lockTitle\",\n \"dialog.lockMessage\");\n Toolbar.setSharedKey('');\n }, function () {\n console.warn('room passwords not supported');\n messageHandler.showError(\"dialog.warning\",\n \"dialog.passwordNotSupported\");\n Toolbar.setSharedKey('');\n });\n}", "lockEditor() {\n this.lock = true;\n }", "function _lock_page() {\n\t// do not call if not on a page locking context\n\tif (current.indexOf(\"Lock::\")!==0)\n\t\treturn;\n\tvar page = current.substring(6);\n\n\td$(\"btn_lock\").value = \"Lock \"+page;\n\td$(\"pw1\").focus();\n\t//TODO: check for other browsers too\n\tif (woas.browser.firefox)\n\t\td$(\"btn_lock\").setAttribute(\"onclick\", \"lock_page('\"+woas.js_encode(page)+\"')\");\n\telse\n\t\td$(\"btn_lock\").onclick = woas._make_delta_func('lock_page', \"'\"+woas.js_encode(page)+\"'\");\n}", "lock() {\n this._locked = true;\n }", "unlocked(){return true}", "static set lockState(value) {}", "if (/*ret DOES NOT contain any hint on any of the arguments (lock is cracked)*/) {\n break; //Break loop (since further attempts are not neccessary)\n }", "function setLockOnChat(){\n\t $( \"form\" ).each(function(index) {\n\t\t var html = $(this).parent(\"span\").html();\n\t\t if(html){\n\t\t\t if (html.indexOf('Add Photos') >= 0 && $(this).parent(\"span\").parent(\"div\").parent(\"div\").html().indexOf(\"crypter\") == -1){\n\t\t\t\t var textarea = $(this).closest( \".fbNubFlyoutFooter\" ).find(\"._5rpu\");\n\t\t\t\t textarea.addClass(\"textA\");\n\t\t\t\t $(this).parent(\"span\").after('<span style=\"cursor:pointer;display:table;\" class=\"_552o\"><img style=\"cursor:pointer;vertical-align:middle;display:table-cell;padding-top: 4px;\" class=\"crypter\" src=\"' + icon.lock_empty + '\" height =\"15px\" /></span>');\n\t\t\t }\n\t\t }\n\t });\n}", "Lock() {\n\t\t\t\tDEFINE(THS, { Locked: HIDDEN(true) });\n\t\t\t}", "unlocked(){return hasChallenge(\"燃料\",11)}", "unlocked(){return hasChallenge(\"燃料\",11)}", "function trickplayKeyLocked() {\r\n\tunlockTrickplayKey = false;\r\n}", "lock() {\n const that = this;\n\n that.locked = true;\n }", "async locked (...strings) {\n let options = {\n plaintext: strings.some(s => !(typeof s != 'string'))\n }\n return await this.runWithMiddleware('locked', options, ...strings)\n }", "function capLock(e, num){\n\tvar kc = e.keyCode ? e.keyCode : e.which;\n\tvar sk = e.shiftKey ? e.shiftKey : kc === 16;\n\tvar visibility = ((kc >= 65 && kc <= 90) && !sk) || \n\t\t((kc >= 97 && kc <= 122) && sk) ? 'visible' : 'hidden';\n\tdocument.getElementById('divMayus'+num).style.visibility = visibility\n}", "function k() {\n if (!menuLocked) {\n menuLocked = true;\n }\n else if (menuLocked) {\n menuLocked = false;\n }\n}", "function unlock(_word) {\n\n\n if (player.inventory.includes('key')) {\n currentState.locked = false\n console.log(\"You unlocked the padlock! Now quickly make your way into the tunnel and make your way to Paradise Cove\")\n } else {\n console.log(\"You don't have a key to do that\")\n\n }\n}", "set locked(val) {\n\t\tthis._locked = val;\n\t}", "function C012_AfterClass_Jennifer_LockChastityBelt() {\n\tPlayerLockInventory(\"ChastityBelt\");\n\tPlayerRemoveInventory(\"ChastityBelt\", 1);\n\tCurrentTime = CurrentTime + 50000;\n}", "function C012_AfterClass_Amanda_LockChastityBelt() {\n\tPlayerLockInventory(\"ChastityBelt\");\n\tPlayerRemoveInventory(\"ChastityBelt\", 1);\n\tCurrentTime = CurrentTime + 50000;\n}", "_pointerLock() {\n if (document.pointerLockElement) {\n this.send(\"p,1\");\n } else {\n this.send(\"p,0\");\n }\n }", "function lock() {\n clearAlertBox();\n // Lock the editors\n aceEditor.setReadOnly(true);\n\n // Disable the button and set checkCorrectness to true.\n $(\"#resetCode\").attr(\"disabled\", \"disabled\");\n correctnessChecking = true;\n}", "async setLockState(message) {\n const command = message.toLowerCase()\n switch(command) {\n case 'lock':\n if (this.data.lock.state === 'UNLOCKED') {\n this.debug('Received lock door command, setting locked state')\n this.data.lock.state === 'LOCKED'\n this.publishLockState()\n } else {\n this.debug('Received lock door command, but door is already locked')\n }\n break;\n case 'unlock':\n this.debug('Received unlock door command, sending unlock command to intercom')\n try {\n await this.device.unlock()\n this.debug('Request to unlock door was successful')\n this.setDoorUnlocked()\n } catch(error) {\n this.debug(error)\n this.debug('Request to unlock door failed')\n }\n break;\n default:\n this.debug('Received invalid command for lock')\n }\n }", "lock(key) {\n const me = this;\n\n me._lock(key);\n }", "function lockTagInternal(array) {\n var message = [\n ndef.uriRecord(array[0]),\n ndef.textRecord(array[1]),\n ndef.textRecord(array[2]),\n ndef.textRecord(array[3]),\n ndef.textRecord(\"lock\"),\n ndef.textRecord($(\"#lockTagPassword\").val())\n ];\n nfc.write(\n message,\n function () {\n alert(\"Tag Locked\");\n },\n function (reason) {\n alert(\"problem in writing..\" + reason);\n }\n );\n}", "setLocked(value) {\n setLocked(this.input, value);\n }", "lockEditor() {\n //console.log('LOCK ON');\n this.setState({\n 'lockedEditor': true\n });\n }", "attemptLock() {\n const prTitle = this.appContext.payload.issue.title\n const prNumber = this.appContext.payload.issue.number\n\n // this is a singleton\n let prLock = new PrLock()\n if (prLock.tryLock(prTitle, prNumber) === false) {\n const lockMessage = prLock.getLockInfo() + \"; is holding the lock, please merge PR or comment with \\`\" + BotCommand + \" unlock\\` to release lock\"\n ArgoBot.respondWithComment(this.appContext, lockMessage)\n return false\n }\n return true\n }", "setStatusLock(msg, toCall) {\n if (!this.statusLock[msg.chat.id]) {\n this.statusLock[msg.chat.id] = Promise.resolve();\n }\n this.statusLock[msg.chat.id] = this.statusLock[msg.chat.id].then(() => {\n return toCall(msg, true);\n });\n }", "lock (lockTimeMs = 10000) {\r\n this._lockedToMs = Date.now() + lockTimeMs;\r\n }", "function unlock_lock(lock, callback) {\n let str = JSON.stringify({\n Action: \"TOGGLE\"\n })\n send_command(lock, str)\n callback(f.hacker.verb())\n}", "lock() {\n _isLocked.set(this, true);\n }", "sync() {\n const starterMsg = this.threadStarterMessage;\n const solvedTraninge = this.traninge\n .filter((traning) => traning.solved)\n .map((traning) => traning.author);\n\n if (starterMsg.editable) {\n starterMsg.edit(this.encrypt([...solvedTraninge]));\n }\n }", "static async lock(key) {\n return new Promise((resolve) => {\n if (this.keys[key] === undefined || this.keys[key] === MutexLockStatus.UNLOCKED) {\n this.keys[key] = MutexLockStatus.LOCKED;\n resolve();\n }\n else {\n this.onUnlockEvent(key, () => {\n this.keys[key] = MutexLockStatus.LOCKED;\n resolve();\n });\n }\n });\n }", "static async lock(key) {\n return new Promise((resolve) => {\n if (this.keys[key] === undefined || this.keys[key] === MutexLockStatus.UNLOCKED) {\n this.keys[key] = MutexLockStatus.LOCKED;\n resolve();\n }\n else {\n this.onUnlockEvent(key, () => {\n this.keys[key] = MutexLockStatus.LOCKED;\n resolve();\n });\n }\n });\n }", "if (/*ret DOES NOT contain any hint on the result (lock is cracked)*/) {\n break; //Break loop (since further attempts are not neccessary)\n }", "function toggleLockUser(username, toLock, callback) {\n let queryStr = \"UPDATE `marketplace`.`user` \" \n + \" SET `is_locked`= b? \"\n + \" WHERE (`username` = ? );\";\n let queryVar = [username];\n if (toLock) {\n queryVar.unshift('1');\n } else {\n queryVar.unshift('0');\n }\n mySQL_DbConnection.query(queryStr, queryVar, function (err, result_rows, fields) { \n if(err) {\n console.log(\"Error: \", err);\n callback(false);\n } else {\n callback(true);\n }\n });\n}", "function lockNote(id) {\n var dragstart = ($('#' + id).attr('ondragstart') == 'drag(event)') ? 'dragStop(event)' : 'drag(event)'; \n $('#' + id).attr('ondragstart', dragstart);\n var dragover = ($('#' + id).attr('ondragover') == 'allowDrop(event)') ? 'event.stopPropagation()' : 'allowDrop(event)';\n $('#' + id).attr('ondragover', dragover);\n var readOnly = ($('#text' + id).prop('readonly') == \"\") ? \"true\" : \"\";\n $(\"#text\" + id).prop(\"readonly\", readOnly); \n $('#delete_Note' + id).toggleClass('disable-menu-items');\n var noteLock = JSON.stringify($('#lock' + id).val());\n id = $('#link' + id).val();\n var updateString = '[{\"op\": \"add\",\"path\": \"/postit_Locked\",\"value\": ' + noteLock + '}]';\n patchNote('https://localhost:44382/api/notes/', updateString, colId, colNo, noteId, id, desc);\n}", "function requestLock() {\n if (lockCounter === 0) {\n setLocked(true);\n }\n\n ++lockCounter;\n }", "function jsDAV_iLockable() {}", "function actionLock(p){\n\t\n\tsrc = collection[p].name;\n\te = $('#'+src);\n\t\n\ticoLock = e.find('.lock')[0];\n\n\tvar remote = $.ajax({\n\t\turl : '/admin/media/helper/action',\n\t\tdata : {'action':'lock', 'src':collection[p].url},\n\t\tdataType : 'json'\n\t}).done(function(data) {\n\t\tif(data.message == 'LOCK'){\n\t\t\te.addClass('isLocked');\n\t\t\ticoLock.src = '/admin/media/ui/img/media-locked.png';\n\t\t}else\n\t\tif(data.message == 'UNLOCK'){\n\t\t\te.removeClass('isLocked');\n\t\t\ticoLock.src = '/admin/media/ui/img/media-unlocked.png';\n\t\t}\n\t});\n}", "function checkLock(player){\n\tfor (i=0;i<4;i++){\n\t\tif(!player.questCompleted[i]){return}\n\t\t}\n\t\t\n\tplayer.unlocked = true\n\tif (player == player1){\n\t\tfor (i=261;i<269;i++){\t\n\t\t\ttrackGrid[i] = 8\t\n\t\t\t\t}\n\t\t} else {\n\t\t\tfor (i=270;i<279;i++){\n\t\t\ttrackGrid[i] = 8\t\n\t\t\t\t}\n\t\t\t} \n\t}", "function lock_lock(lock, callback) {\n unlock_lock(lock, callback)\n}", "function vpAcquireLock(){\n\t\tAlert.render(\"VP (Thread 2) is acquiring the lock MethodLock. But, you (Bob - Thread 1) are holding the lock. <br /> So, VP (Thread 2) is waiting for you to release the lock. Please hurry!!!\")\n\t\tdocument.getElementById(\"arrowa\").style.visibility = \"hidden\";\n\t\tdocument.getElementById(\"arrowa0\").style.visibility = \"visible\";\n\t\tdocument.getElementById(\"vpmlock\").style.visibility = \"visible\";\n\t}", "function lock() {\n\n Log.functionEntryPoint()\n Lock_.waitLock(LockWait_)\n Log.fine('Locked lookup table')\n \n}", "setUsername(newUsername) {\n this.setState({username: newUsername,checkUsernameLock: true});\n }", "Lock() {\n\t\t\t\tlet THS = this; if (THS.Locked) return;\n\t\t\t\t// ---------------------------------------------------------------------------------- //\n\t\t\t\t\tfunction CleanQRY(func) {\n\t\t\t\t\t\tlet F = func.toString(), \n\t\t\t\t\t\t\tM = /^.*?(Query.+)/, \n\t\t\t\t\t\t\tT = F.split(\"\\n\").slice(-1)[0].match(/^(\\s+|)/)[0],\n\t\t\t\t\t\t\tG = new RegExp(`^${T}`,'gm'), \n\t\t\t\t\t\t\tR = 'async function $1';\n\t\t\t\t\t\treturn F.replace(M,R).replace(G,'');\n\t\t\t\t\t};\n\t\t\t\t\tfunction FormatQRY(query) { \n\t\t\t\t\t\tvar R = '', Q = query; switch(true) {\n\t\t\t\t\t\t\tcase THS.QisFunction: return CleanQRY(Q.toString());\n\t\t\t\t\t\t\tcase THS.QisArray: return Q.join(\"\\n\").replace(\"\\t\",\"\");\n\t\t\t\t\t\t\tdefault: return R;\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t// Handle Query --------------------------------------------------------------------- //\n\t\t\t\t\tTHS.AddProperty('Query', FormatQRY(THS.Query), ['string'], true);\n\t\t\t\t// Handle Param --------------------------------------------------------------------- //\n\t\t\t\t\tTHS.AddProperty('Params', THS.Params, ['object'], true);\n\t\t\t\t// Handle Lock ---------------------------------------------------------------------- //\n\t\t\t\t\tDEFINE(THS, { Locked: HIDDEN(true) });\n\t\t\t}", "function lockPiece() {\n\tpiece.matrix.forEach(function (value, index, matrix) {\n\t\t// console.log('value:', value, 'index:', index);\n\t\tif (value == piece.id)\n\t\t\tboard = board.subset(\n\t\t\t\tmath.index(index[0] + piece.top, index[1] + piece.left),\n\t\t\t\tpiece.id\n\t\t\t);\n\t});\n}", "async function lockLounge() {\n console.log(lookupTableTwo[teachersLounge], \"input array\");\n lookupTableTwo[\"lounge\"].locked = true;\n while ((teachersLounge.locked = true)) {\n let quizAnswer = await ask(\n \"The Teachers' Lounge is locked! You have to enter the code found on your student ID...\"\n );\n if (quizAnswer == \"12345\") {\n lounge.locked = false;\n console.log(\n \"You're not supposed to be in here! You have to go to the office!\"\n );\n currentRoom = office;\n return play();\n } else {\n console.log(`That's not the right code, but you probably shouldn't try to get in here....`);\n }\n }\n}", "function lockTag() {\n operation = \"lock\";\n $(\"#userPageTitle\").html(\"NFC Tag Lock\");\n var html = '<div class=\"col-sm-6 \">'\n\n html += '<div><h4>Please enter the password you want</h4><h4> to lock the tag with in the box</h4><h4> provided.Once you have enter the </h4><h4>correct password place your phone on the</h4><h4> tag. </h4></div>'\n html += '<div class=\"text-center \" style=\"margin-top:15%\">Password:<input type=\"password\" id=\"lockTagPassword\"></div>';\n html += '</div>'\n $(\"#lockTagContents\").html(html);\n $(\"#operationIcons\").css(\"display\", \"none\");\n $(\"#lockTagContents\").css(\"display\", \"block\");\n $(\"#crossButtonImage\").css(\"display\", \"block\");\n $(\"#writeTagContents\").css(\"display\", \"none\");\n $(\"#readTagContents\").css(\"display\", \"none\");\n $(\"#eraseTagContents\").css(\"display\", \"none\");\n $(\"#previousTagContents\").css(\"display\", \"none\");\n $(\"#crossButtonImageForHis\").css(\"display\", \"none\");\n}", "unlock() {\n this.locked = 0\n }", "function lock(el) {\n\tel.on('click.locked', function() {\n\t\treturn false;\n\t})\n}", "function ajax_lock_pofile(id)\n{\n $.post('/translation_file/ajax_lock_pofile/' + id,\n function(data) { $(\"tr.ajax_lock_div#a\" + id).html(data); },\n {}, {}, 'html');\n}", "function lockUser(source, id) {\r\n\tvar username = $(source).parent().parent().find(\"td:first\").html();\r\n\taskConfirmation(\"User \\\"\" + username + \"\\\" won't be able to login anymore, do you confirm lock?\", \"Lock user\").pipe(function() {\r\n\t\tremoteCalls.lockUser(id, source);\r\n\t});\r\n}", "function lockdoor() {\n\t\t\t\tref.update({\n\t\t\t\tunlocked: false,\n\t\t\t})\t\t\t\n\t\t\t}", "function lockChoice(){\r\n $(\"input\").attr(\"disabled\", true);\r\n}", "function _lockFunctionality() {\n lockUserActions = true;\n viewModel.set(\"lockUserActions\", lockUserActions);\n}", "function OnLockAlert()\n{\n}", "async editLock(locked){\n if(this.data.id === -1) Promise.reject(new CXError('No Department Selected'));\n\n\t\tPromise.all([\n\t\t\tdb.query('update groupRoles set locked = ? where groupID = ?',{conditions:[locked,this.data.id]}),\n\t\t\tdb.query('update users set locked = ? where groupRole = ? AND role = 0',{conditions:[locked,this.data.id]}),\n\t\t]);\t\n }", "toggleLock() {\n $(\"[data-button='lock']\").find(\"i\").toggleClass(\"fa-unlock fa-lock\");\n $(\".container > .menu\").toggleClass(\"draggable\");\n\n var configLock = !config.get(\"window.locked\");\n\n config.set(\"window.locked\", configLock);\n }", "function checkKeyPressed(e) {\n if (e.keyCode == \"32\") {\t\t\t\t\t\t\t\t//// changes the channel with the keycode (32 for space key)\n promeniKanal();\n }\n}", "_initializeLock() {\n if(config.get(\"window.locked\")) {\n this.toggleLock();\n }\n }", "requestKeyboardLock() {\n // event codes: https://www.w3.org/TR/uievents-code/#key-alphanumeric-writing-system\n const keys = [\n \"AltLeft\",\n \"AltRight\",\n \"Tab\",\n \"Escape\",\n \"ContextMenu\",\n \"MetaLeft\",\n \"MetaRight\"\n ];\n console.log(\"requesting keyboard lock\");\n navigator.keyboard.lock(keys).then(\n () => {\n console.log(\"keyboard lock success\");\n }\n ).catch(\n (e) => {\n console.log(\"keyboard lock failed: \", e);\n }\n )\n }", "lock() {\n this.close();\n this.isLocked = true;\n this.refreshState();\n }", "function ourStartFunction() {\n let locked = false;\n\n wp.data.subscribe(() => {\n const results = wp.data.select(\"core/block-editor\").getBlocks().filter((block) => (block.name == \"ticoplugin/tico-pay-attention\" && block.attributes.correctAnswer == undefined));\n if (results.length && locked == false) {\n locked = true;\n wp.data.dispatch(\"core/editor\").lockPostSaving(\"noanswer\");\n }\n if (!results.length && locked) {\n locked = false;\n wp.data.dispatch(\"core/editor\").unlockPostSaving(\"noanswer\");\n }\n });\n}", "function C007_LunchBreak_Natalie_SubbieClothGag() {\r\n PlayerLockInventory(\"ClothGag\");\r\n}", "sendMessage() {\n let id = this.generateID();\n let unix = this.generateTimestamp();\n let message = {\"id\": id, \"to\": this.props.pair.receiver, \"from\": this.props.pair.sender, \"body\": this.state.messages[0].text, \"time\": unix, \"read\": true};\n // add to senders persistant storage\n this.props.addMessage(message);\n // set same message object but with read set to false for the reciever\n message = {\"id\": id, \"to\": this.props.pair.receiver, \"from\": this.props.pair.sender, \"body\": this.state.messages[0].text, \"time\": unix, \"read\": false};\n setTimeout(function(){\n Actions.lockbox({title:\"Encrypt Message\", mode: \"encrypt\", message: message, returnTo: \"thread\"});\n }, 100);\n }", "function lockSend(val) {\n sendButtonLocked = !!val;\n let sendButton = document.querySelector('#send-new-msg');\n let newMsgField = document.querySelector('#new-msg');\n sendButtonLocked ? buttonLoadingOn(sendButton) : buttonLoadingOff(sendButton);\n sendButtonLocked ? newMsgField.setAttribute(\"disabled\", true) : newMsgField.removeAttribute(\"disabled\");\n}", "static get lockState() {}", "function beforeLock(c) {\n\tfor (var i = 0; i < 3; i++) {\n\t\tfor (var j = 0; j < 3; j++) {\n\t\t\tdrawCircle(c, w * (i + 1) / 4, h * (j + 1) / 4, 10, 0, 2 * Math.PI, false, \"#969696\", 1);\n\t\t}\n\t}\n}", "function DelayNumPad(){\nAllowNumWalk=1;\n}", "function setDoorLock(door, action){\n if(action == 'lock') {\n lockDoor(door);\n } else if(action == 'unlock') {\n unlockDoor(door);\n } else {\n sendMessage('InvalidArgument', 'setDoorLock.Action');\n }\n}", "function lockCallback(data) {\n if(data.acquired == true) {\n console.log(\"I got the lock!\");\n\n // send email notification\n sendMessage(data);\n }\n else console.log(\"No lock for me :(\");\n}", "function vpGetLock(){\n\t\tdocument.getElementById(\"Q1\").style.visibility = \"hidden\";\n\t\tdocument.getElementById(\"methodLock\").style.visibility = \"hidden\";\n\t\tdocument.getElementById(\"vpmlock\").style.visibility = \"visible\";\n\t\tdocument.getElementById(\"vpmlock\").innerHTML = \"Holding: MethodLock\";\n\t\tdocument.getElementById(\"vpQ1\").style.visibility = \"visible\";\n\t\tdocument.getElementById(\"text1\").style.backgroundColor=\"#00FF00\"\n\t\tdocument.getElementById(\"lockImage2\").style.visibility = \"visible\";\n\t\tdocument.getElementById(\"arrowa0\").style.visibility = \"hidden\";\n\t\tdocument.getElementById(\"arrowa1\").style.visibility = \"visible\";\n\t\tdocument.vpForm.question.value = arr[0];\n\t\n\t\tindex = 1;\n\t\tvar theDelay = 2;\n\t\tvar timer = setTimeout(\"vpNexQuest()\",theDelay*1000)\n\t}", "function _lockAll(){\r\n\tvar i;\r\n\tfor(i=0;i<rules.length;i++)\r\n\t\tif(rules[i]!=null)\r\n\t\t\t$('rule'+i).locked();\r\n\tfor(i=0;i<lines.length;i++)\r\n\t\tif(lines[i]!=null)\r\n\t\t\t$('mid'+i).locked();\t\r\n}", "function lockModal() {\n locked = true;\n }", "function lockModal() {\n locked = true;\n }", "function changeProtection(playerSpacehsip) {\n setTimeout(function () { playerSpacehsip.setProtection(false); }, 2000);\n }", "run (message) {\n // Seprating the message into 'cmd' and 'args'\n const messageArry = message.content.split(' ')\n const args = messageArry.slice(1)\n\n // finding '@everyone' role\n const everyoneRole = message.guild.roles.find(x => x.name === '@everyone')\n const staffRole = message.guild.roles.find(x => x.name === 'Staff')\n\n if (!staffRole) {\n message.channel.send('Staff role is missing!')\n console.error(chalk.red('[!] [LOCK COMMAND] Staff role is missing!'))\n }\n // making no perms Emebd\n const noPermsEmebd = new Discord.RichEmbed()\n .setColor('#FF0000')\n .setDescription(`${message.author} doesn't have perms to use this command!`)\n // making lock Emebd\n const lockEmbed = new Discord.RichEmbed()\n .setColor(config.colour)\n .setDescription(`${message.channel} has been locked by ${message.author}!`)\n // making unlock Emebd\n const unlockEmbed = new Discord.RichEmbed()\n .setColor(config.colour)\n .setDescription(`${message.channel} has been unlocked by ${message.author}!`)\n\n if (!message.member.hasPermission('MANAGE_CHANNELS')) return message.channel.send(noPermsEmebd)\n if (args === 'on') { // turning on the lock mechanism\n message.channel.overwritePermissions(everyoneRole, {\n SEND_MESSAGES: false,\n READ_MESSAGES: true,\n ADD_REACTIONS: false\n })\n message.channel.overwritePermissions(staffRole, {\n SEND_MESSAGES: true,\n READ_MESSAGES: true\n })\n message.channel.send(lockEmbed)\n } else if (args === 'off') { // turning off the lock mechanism\n message.channel.overwritePermissions(everyoneRole, {\n SEND_MESSAGES: true,\n READ_MESSAGES: true,\n ADD_REACTIONS: true\n })\n message.channel.overwritePermissions(staffRole, {\n SEND_MESSAGES: true,\n READ_MESSAGES: true\n })\n message.channel.send(unlockEmbed)\n } else { // if its neither 'on'/'off' then its default to 'on'\n message.channel.overwritePermissions(everyoneRole, {\n SEND_MESSAGES: false,\n READ_MESSAGES: true,\n ADD_REACTIONS: false\n })\n message.channel.overwritePermissions(staffRole, {\n SEND_MESSAGES: true,\n READ_MESSAGES: true\n })\n message.channel.send(lockEmbed)\n }\n }", "handleInteraction(key){\n key.disabled = true;\n if (this.activePhrase.checkLetter(key.textContent) === true) {\n key.classList = \"chosen\";\n this.activePhrase.showMatchedLetter(key.textContent);\n if (this.checkForWin() === true) {\n this.gameOver(false);\n }\n } else {\n key.classList = \"wrong\";\n this.removeLife();\n }\n }", "handleInteraction(key) {\n if (game.activePhrase.checkLetter(key.textContent)) {\n key.setAttribute('disabled', true);\n game.activePhrase.showMatchedLetter(key.textContent);\n key.className = 'key chosen';\n if (this.checkForWin()){\n setTimeout(function () {\n game.gameOver(true)\n }, 1500\n );\n } \n }\n else {\n key.className = 'key wrong';\n key.setAttribute('disabled', true); \n this.removeLife()\n this.checkForWin();\n if (this.missed === 5){\n setTimeout(function () {\n game.gameOver(false)\n }, 500\n );\n }\n }\n }", "async function lock()\n {\n if (bookmarks.is_locked()) { return; }\n\n await bookmarks.lock();\n notification.locked();\n }", "function C007_LunchBreak_Natalie_SubbieRope() {\r\n PlayerLockInventory(\"Rope\");\r\n}", "function C012_AfterClass_Amanda_LockCollarAmanda() {\n\tActorSetOwner(\"Player\");\n\tPlayerRemoveInventory(\"Collar\", 1);\n\tC012_AfterClass_Amanda_CalcParams();\n\tActorSetPose(\"Kneel\");\n\tCurrentTime = CurrentTime + 50000;\n}", "function translateKeyLockDoorPuzzle(args, callback) {\n if (args[0] === -1 || args[1] === -1 || args[3] === -1) {\n callback(\n \"ERROR: for puzzle [Unlock door with switch], you must reference destination scene id, the door object, and the key object before run it. If you don't need this puzzle module, please delete it. \"\n );\n return false;\n }\n const sceneIndex = findSceneByID.call(this, args[0]);\n const doorObj = findObjectByID.call(this, args[1]);\n const keyObj = findObjectByID.call(this, args[3]);\n let sound = null;\n let isWinning;\n if (args[6]) isWinning = args[6];\n if (args[5] !== -1) {\n sound = findSoundByID.call(this, args[5]);\n return `puzzle.keyLockDoorPuzzle(${sceneIndex}, ${doorObj}, ${keyObj}, ${isWinning}, '${sound}');\\n`;\n }\n return `puzzle.keyLockDoorPuzzle(${sceneIndex}, ${doorObj}, ${keyObj}, ${isWinning}, ${sound});\\n`;\n}", "function screen4_relockCell(){\n\t\t\tscreen4_killPulses();\n\t\t\n\t\t\texportRoot.screen4.arrow1.visible=false;\n\t\t\texportRoot.screen4.arrow2.visible=false;\n\t\t\n\t\t\t//lock the cell!\t\n\t\t\tscreen4_cell_locked=true; \n\t\t\tscreen4_cell.gotoAndStop(0); //cell starts at its first state (locked)\n\t\t\n\t\t\t\n\t\t\t//anim of insulin key appearing... don't do if all g cells are invisible\n\t\t\tif(!g1.visible && !g2.visible && !g3.visible && !g4.visible) return;\n\t\t\telse exportRoot.screen4.gotoAndPlay(\"newInsulin\");\n\t\t}", "function translatePasswordLockDoorPuzzle(args, callback) {\n if (args[0] === -1 || args[1] === -1 || args[3] === -1) {\n callback(\n \"ERROR: for puzzle [Unlock door with a password], you must reference destination scene id, the door object, and the password before run it. If you don't need this puzzle module, please delete it. \"\n );\n return false;\n }\n const sceneIndex = findSceneByID.call(this, args[0]);\n const doorObj = findObjectByID.call(this, args[1]);\n const password = args[3];\n let sound = null;\n let isWinning;\n if (args[6]) isWinning = args[6];\n if (args[5] !== -1) {\n sound = findSoundByID.call(this, args[5]);\n return `puzzle.passwordLockDoorPuzzle(${sceneIndex}, ${doorObj}, '${password}', ${isWinning}, '${sound}');\\n`;\n }\n return `puzzle.passwordLockDoorPuzzle(${sceneIndex}, ${doorObj}, '${password}', ${isWinning}, ${sound});\\n`;\n}", "unlockEditor() {\n this.lock = false;\n }", "function lf(e,t){if(Co&&34==e.keyCode&&e.char)return!1;var a=Gi[e.keyCode];\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n return null!=a&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(a=e.code),uf(a,e,t))}", "function checkCapsLock(e) {\n var myKeyCode = 0;\n var myShiftKey = false;\n var retAns = true;\n\n // Internet Explorer 4+\n if (document.all) {\n myKeyCode = e.keyCode;\n myShiftKey = e.shiftKey;\n\n // Netscape 4\n }\n else if (document.layers) {\n myKeyCode = e.which;\n myShiftKey = (myKeyCode == 16) ? true : false;\n\n // Netscape 6\n }\n else if (document.getElementById) {\n myKeyCode = e.which;\n myShiftKey = (myKeyCode == 16) ? true : false;\n }\n\n if (myShiftKey == false) {\n myShiftKey = e.shiftKey;\n }\n\n // Upper case letters are seen without depressing the Shift key, therefore Caps Lock is on\n if ((myKeyCode >= 65 && myKeyCode <= 90) && !myShiftKey) {\n retAns = false;\n\n // Lower case letters are seen while depressing the Shift key, therefore Caps Lock is on\n }\n else if ((myKeyCode >= 97 && myKeyCode <= 122) && myShiftKey) {\n retAns = false;\n }\n\n if (retAns == false) {\n $(\"#divCapsLockOn\").fadeIn();\n }\n else {\n $(\"#divCapsLockOn\").fadeOut('slow');\n }\n\n return true;\n}", "unlock(currentPlayer, consequence, channel){//Gives the player a pass\n if(!currentPlayer.passes.includes(consequence.pass)){\n currentPlayer.passes.push(consequence.pass)\n }\n channel.send(consequence.description).catch(err => {console.error(err);})\n this.utils.saveUniverse(this)\n }", "processCommand(command, message) {\n switch (command) {\n case 'lock/command':\n this.setLockState(message)\n break;\n default:\n this.debug(`Received message to unknown command topic: ${command}`)\n }\n }", "function C012_AfterClass_Jennifer_LockCollarJennifer() {\n\tActorSetOwner(\"Player\");\n\tPlayerRemoveInventory(\"Collar\", 1);\n\tC012_AfterClass_Jennifer_CalcParams();\n\tActorSetPose(\"Kneel\");\n\tCurrentTime = CurrentTime + 50000;\n}", "lock(mode = 'update') {\n const _mode = mode.toLowerCase();\n\n if (!LOCK_OPTS.has(_mode)) {\n throw new Error(`Invalid PostgreSQL lock mode \\`'${_mode}'\\`.`);\n }\n\n switch (_mode) {\n case 'update':\n this._parts.lock = 'FOR UPDATE';\n break;\n case 'share':\n this._parts.lock = 'FOR SHARE';\n break;\n case 'no key update':\n this._parts.lock = 'FOR NO KEY UPDATE';\n break;\n case 'key share':\n this._parts.lock = 'FOR KEY SHARE';\n break;\n default:\n this._parts.lock = null;\n break;\n }\n return this;\n }", "onLongPress(context, message) {\n let msg = this.getMessageByID(message._id);\n setTimeout(function(){\n Actions.lockbox({title:\"Resend Message\", mode: \"encrypt\", message: msg, returnTo: \"thread\"});\n }, 100);\n }" ]
[ "0.6148335", "0.6116379", "0.6093374", "0.6045592", "0.5962768", "0.5948659", "0.5932255", "0.58839214", "0.5872413", "0.5822139", "0.5818234", "0.5809906", "0.57952315", "0.5785979", "0.575604", "0.575604", "0.5735589", "0.57319343", "0.57257193", "0.5716986", "0.5676301", "0.5668743", "0.56399995", "0.56145203", "0.5593321", "0.55893266", "0.5588636", "0.5582581", "0.55542624", "0.5537239", "0.5523069", "0.5520774", "0.55192345", "0.549073", "0.546802", "0.54496956", "0.5410629", "0.53912103", "0.5386094", "0.5386094", "0.5382974", "0.5378431", "0.5375938", "0.5375358", "0.5362227", "0.535767", "0.53549725", "0.5340858", "0.53400564", "0.5333142", "0.53273755", "0.53021127", "0.52941424", "0.52710223", "0.5267112", "0.5265843", "0.5265129", "0.5264681", "0.52621806", "0.5261214", "0.52432823", "0.5234978", "0.5202001", "0.5196818", "0.5194199", "0.5188088", "0.5178179", "0.5175987", "0.51702636", "0.51681226", "0.5156793", "0.5139731", "0.5133614", "0.51177", "0.5114612", "0.51067054", "0.5093682", "0.50772154", "0.5073389", "0.5065515", "0.5057373", "0.5057373", "0.50551665", "0.50549793", "0.5050647", "0.50309944", "0.5021354", "0.5019103", "0.50125", "0.50089544", "0.5008753", "0.50068283", "0.49949", "0.49908623", "0.49816298", "0.49789405", "0.49693483", "0.49661842", "0.4962808", "0.49617627" ]
0.5750079
16
Cong bo ket qua bao ve do an nam xxxx Kiem tra xem co the cong bo duoc chua (dieu kien: toan bo chuc nang phai duoc khoa)
function checkOpenRelease(){ var finished = document.getElementById("input-event-finish").checked; if(finished == false){ document.getElementById("p-message").innerHTML = "Kỳ bảo vệ cần được hoàn thành trước khi công bố kết quả!"; document.getElementById("p-message").style.color = "red"; document.getElementById("p-message").hidden = false; } else{ document.getElementById("p-message").hidden = true; openRelease(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makespeakable(phrase) {\n phrase = phrase.replace(/['\"]/g, \"\");\n phrase = phrase.replace(/[-+]/g, \" \");\n phrase = phrase.replace(/([A-Z])(?=[A-Z])/g, \"$1 \"); //split apart capitals\n phrase = phrase.replace(/([A-Za-z])([0-9])/g, \"$1 $2\"); // split letter-number\n phrase = phrase.replace(/([0-9])([A-Za-z])/g, \"$1 $2\"); // split number-letter\n return phrase.replace(/\\b[A-Z](?=[[:space:][:punct:]])/g, function(match) {\n return say_letter[match.toUpperCase()];\n })\n .replace(/[0-9]+ ?(st|nd|rd|th)\\b/g, function(match) {\n return n2w.toOrdinalWords(parseInt(match)).replace(/[-,]/g, \" \");\n })\n .replace(/[0-9]+/g, function(match) {\n return n2w.toWords(match).replace(/[-,]/g, \" \");\n });\n}", "function HyderabadTirupati() // extends PhoneticMapper\n{\n var map = [ \n new KeyMap(\"\\u0901\", \"?\", \"z\", true), // Candrabindu\n new KeyMap(\"\\u0902\", \"\\u1E41\", \"M\"), // Anusvara\n new KeyMap(\"\\u0903\", \"\\u1E25\", \"H\"), // Visarga\n new KeyMap(\"\\u1CF2\", \"\\u1E96\", \"Z\"), // jihvamuliya\n new KeyMap(\"\\u1CF2\", \"h\\u032C\", \"V\"), // upadhmaniya\n new KeyMap(\"\\u0905\", \"a\", \"a\"), // a\n new KeyMap(\"\\u0906\", \"\\u0101\", \"A\"), // long a\n new KeyMap(\"\\u093E\", null, \"A\", true), // long a attached\n new KeyMap(\"\\u0907\", \"i\", \"i\"), // i\n new KeyMap(\"\\u093F\", null, \"i\", true), // i attached\n new KeyMap(\"\\u0908\", \"\\u012B\", \"I\"), // long i\n new KeyMap(\"\\u0940\", null, \"I\", true), // long i attached\n new KeyMap(\"\\u0909\", \"u\", \"u\"), // u\n new KeyMap(\"\\u0941\", null, \"u\", true), // u attached\n new KeyMap(\"\\u090A\", \"\\u016B\", \"U\"), // long u\n new KeyMap(\"\\u0942\", null, \"U\", true), // long u attached\n new KeyMap(\"\\u090B\", \"\\u1E5B\", \"q\"), // vocalic r\n new KeyMap(\"\\u0943\", null, \"q\", true), // vocalic r attached\n new KeyMap(\"\\u0960\", \"\\u1E5D\", \"Q\"), // long vocalic r\n new KeyMap(\"\\u0944\", null, \"Q\", true), // long vocalic r attached\n new KeyMap(\"\\u090C\", \"\\u1E37\", \"L\"), // vocalic l\n new KeyMap(\"\\u0962\", null, \"L\", true), // vocalic l attached\n new KeyMap(\"\\u0961\", \"\\u1E39\", \"LY\"), // long vocalic l\n new KeyMap(\"\\u0963\", null, \"LY\", true), // long vocalic l attached\n new KeyMap(\"\\u090F\", \"e\", \"e\"), // e\n new KeyMap(\"\\u0947\", null, \"e\", true), // e attached\n new KeyMap(\"\\u0910\", \"ai\", \"E\"), // ai\n new KeyMap(\"\\u0948\", null, \"E\", true), // ai attached\n new KeyMap(\"\\u0913\", \"o\", \"o\"), // o\n new KeyMap(\"\\u094B\", null, \"o\", true), // o attached\n new KeyMap(\"\\u0914\", \"au\", \"O\"), // au\n new KeyMap(\"\\u094C\", null, \"O\", true), // au attached\n\n // velars\n new KeyMap(\"\\u0915\\u094D\", \"k\", \"k\"), // k\n new KeyMap(\"\\u0916\\u094D\", \"kh\", \"K\"), // kh\n new KeyMap(\"\\u0917\\u094D\", \"g\", \"g\"), // g\n new KeyMap(\"\\u0918\\u094D\", \"gh\", \"G\"), // gh\n new KeyMap(\"\\u0919\\u094D\", \"\\u1E45\", \"f\"), // velar n\n\n // palatals\n new KeyMap(\"\\u091A\\u094D\", \"c\", \"c\"), // c\n new KeyMap(\"\\u091B\\u094D\", \"ch\", \"C\"), // ch\n new KeyMap(\"\\u091C\\u094D\", \"j\", \"j\"), // j\n new KeyMap(\"\\u091D\\u094D\", \"jh\", \"J\"), // jh\n new KeyMap(\"\\u091E\\u094D\", \"\\u00F1\", \"F\"), // palatal n\n\n // retroflex\n new KeyMap(\"\\u091F\\u094D\", \"\\u1E6D\", \"t\"), // retroflex t\n new KeyMap(\"\\u0920\\u094D\", \"\\u1E6Dh\", \"T\"), // retroflex th\n new KeyMap(\"\\u0921\\u094D\", \"\\u1E0D\", \"d\"), // retroflex d\n new KeyMap(\"\\u0922\\u094D\", \"\\u1E0Dh\", \"D\"), // retroflex dh\n new KeyMap(\"\\u0923\\u094D\", \"\\u1E47\", \"N\"), // retroflex n\n new KeyMap(\"\\u0933\\u094D\", \"\\u1E37\", \"lY\"), // retroflex l\n new KeyMap(\"\\u0933\\u094D\\u0939\\u094D\", \"\\u1E37\", \"lYh\"), // retroflex lh\n\n // dental\n new KeyMap(\"\\u0924\\u094D\", \"t\", \"w\"), // dental t\n new KeyMap(\"\\u0925\\u094D\", \"th\", \"W\"), // dental th\n new KeyMap(\"\\u0926\\u094D\", \"d\", \"x\"), // dental d\n new KeyMap(\"\\u0927\\u094D\", \"dh\", \"X\"), // dental dh\n new KeyMap(\"\\u0928\\u094D\", \"n\", \"n\"), // dental n\n\n // labials\n new KeyMap(\"\\u092A\\u094D\", \"p\", \"p\"), // p\n new KeyMap(\"\\u092B\\u094D\", \"ph\", \"P\"), // ph\n new KeyMap(\"\\u092C\\u094D\", \"b\", \"b\"), // b\n new KeyMap(\"\\u092D\\u094D\", \"bh\", \"B\"), // bh\n new KeyMap(\"\\u092E\\u094D\", \"m\", \"m\"), // m\n\n // sibillants\n new KeyMap(\"\\u0936\\u094D\", \"\\u015B\", \"S\"), // palatal s\n new KeyMap(\"\\u0937\\u094D\", \"\\u1E63\", \"R\"), // retroflex s\n new KeyMap(\"\\u0938\\u094D\", \"s\", \"s\"), // dental s\n new KeyMap(\"\\u0939\\u094D\", \"h\", \"h\"), // h\n\n // semivowels\n new KeyMap(\"\\u092F\\u094D\", \"y\", \"y\"), // y\n new KeyMap(\"\\u0930\\u094D\", \"r\", \"r\"), // r\n new KeyMap(\"\\u0932\\u094D\", \"l\", \"l\"), // l\n new KeyMap(\"\\u0935\\u094D\", \"v\", \"v\"), // v\n\n\n // numerals\n new KeyMap(\"\\u0966\", \"0\", \"0\"), // 0\n new KeyMap(\"\\u0967\", \"1\", \"1\"), // 1\n new KeyMap(\"\\u0968\", \"2\", \"2\"), // 2\n new KeyMap(\"\\u0969\", \"3\", \"3\"), // 3\n new KeyMap(\"\\u096A\", \"4\", \"4\"), // 4\n new KeyMap(\"\\u096B\", \"5\", \"5\"), // 5\n new KeyMap(\"\\u096C\", \"6\", \"6\"), // 6\n new KeyMap(\"\\u096D\", \"7\", \"7\"), // 7\n new KeyMap(\"\\u096E\", \"8\", \"8\"), // 8\n new KeyMap(\"\\u096F\", \"9\", \"9\"), // 9\n\n // accents\n new KeyMap(\"\\u0951\", \"|\", \"|\"), // udatta\n new KeyMap(\"\\u0952\", \"_\", \"_\"), // anudatta\n new KeyMap(\"\\u0953\", null, \"//\"), // grave accent\n new KeyMap(\"\\u0954\", null, \"\\\\\"), // acute accent\n\n // miscellaneous\n new KeyMap(\"\\u0933\\u094D\", \"\\u1E37\", \"L\"), // retroflex l\n new KeyMap(\"\\u093D\", \"'\", \"'\"), // avagraha\n new KeyMap(\"\\u0950\", null, \"om\"), // om\n new KeyMap(\"\\u0964\", \".\", \".\") // single danda\n ];\n\n PhoneticMapper.call(this, map);\n}", "function doubleMetaphone(value) {\n var primary = ''\n var secondary = ''\n var index = 0\n var length = value.length\n var last = length - 1\n var isSlavoGermanic\n var isGermanic\n var subvalue\n var next\n var prev\n var nextnext\n var characters\n\n value = String(value).toUpperCase() + ' '\n isSlavoGermanic = slavoGermanic.test(value)\n isGermanic = germanic.test(value)\n characters = value.split('')\n\n // Skip this at beginning of word.\n if (initialExceptions.test(value)) {\n index++\n }\n\n // Initial X is pronounced Z, which maps to S. Such as `Xavier`.\n if (characters[0] === 'X') {\n primary += 'S'\n secondary += 'S'\n index++\n }\n\n while (index < length) {\n prev = characters[index - 1]\n next = characters[index + 1]\n nextnext = characters[index + 2]\n\n switch (characters[index]) {\n case 'A':\n case 'E':\n case 'I':\n case 'O':\n case 'U':\n case 'Y':\n case 'À':\n case 'Ê':\n case 'É':\n if (index === 0) {\n // All initial vowels now map to `A`.\n primary += 'A'\n secondary += 'A'\n }\n\n index++\n\n break\n case 'B':\n primary += 'P'\n secondary += 'P'\n\n if (next === 'B') {\n index++\n }\n\n index++\n\n break\n case 'Ç':\n primary += 'S'\n secondary += 'S'\n index++\n\n break\n case 'C':\n // Various Germanic:\n if (\n prev === 'A' &&\n next === 'H' &&\n nextnext !== 'I' &&\n !vowels.test(characters[index - 2]) &&\n (nextnext !== 'E' ||\n (subvalue =\n value.slice(index - 2, index + 4) &&\n (subvalue === 'BACHER' || subvalue === 'MACHER')))\n ) {\n primary += 'K'\n secondary += 'K'\n index += 2\n\n break\n }\n\n // Special case for `Caesar`.\n if (index === 0 && value.slice(index + 1, index + 6) === 'AESAR') {\n primary += 'S'\n secondary += 'S'\n index += 2\n\n break\n }\n\n // Italian `Chianti`.\n if (value.slice(index + 1, index + 4) === 'HIA') {\n primary += 'K'\n secondary += 'K'\n index += 2\n\n break\n }\n\n if (next === 'H') {\n // Find `Michael`.\n if (index > 0 && nextnext === 'A' && characters[index + 3] === 'E') {\n primary += 'K'\n secondary += 'X'\n index += 2\n\n break\n }\n\n // Greek roots such as `chemistry`, `chorus`.\n if (index === 0 && initialGreekCh.test(value)) {\n primary += 'K'\n secondary += 'K'\n index += 2\n\n break\n }\n\n // Germanic, Greek, or otherwise `CH` for `KH` sound.\n if (\n isGermanic ||\n // Such as 'architect' but not 'arch', orchestra', 'orchid'.\n greekCh.test(value.slice(index - 2, index + 4)) ||\n (nextnext === 'T' || nextnext === 'S') ||\n ((index === 0 ||\n prev === 'A' ||\n prev === 'E' ||\n prev === 'O' ||\n prev === 'U') &&\n // Such as `wachtler`, `weschsler`, but not `tichner`.\n chForKh.test(nextnext))\n ) {\n primary += 'K'\n secondary += 'K'\n } else if (index === 0) {\n primary += 'X'\n secondary += 'X'\n // Such as 'McHugh'.\n } else if (value.slice(0, 2) === 'MC') {\n // Bug? Why matching absolute? what about McHiccup?\n primary += 'K'\n secondary += 'K'\n } else {\n primary += 'X'\n secondary += 'K'\n }\n\n index += 2\n\n break\n }\n\n // Such as `Czerny`.\n if (next === 'Z' && value.slice(index - 2, index) !== 'WI') {\n primary += 'S'\n secondary += 'X'\n index += 2\n\n break\n }\n\n // Such as `Focaccia`.\n if (value.slice(index + 1, index + 4) === 'CIA') {\n primary += 'X'\n secondary += 'X'\n index += 3\n\n break\n }\n\n // Double `C`, but not `McClellan`.\n if (next === 'C' && !(index === 1 && characters[0] === 'M')) {\n // Such as `Bellocchio`, but not `Bacchus`.\n if (\n (nextnext === 'I' || nextnext === 'E' || nextnext === 'H') &&\n value.slice(index + 2, index + 4) !== 'HU'\n ) {\n subvalue = value.slice(index - 1, index + 4)\n\n // Such as `Accident`, `Accede`, `Succeed`.\n if (\n (index === 1 && prev === 'A') ||\n subvalue === 'UCCEE' ||\n subvalue === 'UCCES'\n ) {\n primary += 'KS'\n secondary += 'KS'\n // Such as `Bacci`, `Bertucci`, other Italian.\n } else {\n primary += 'X'\n secondary += 'X'\n }\n\n index += 3\n\n break\n } else {\n // Pierce's rule.\n primary += 'K'\n secondary += 'K'\n index += 2\n\n break\n }\n }\n\n if (next === 'G' || next === 'K' || next === 'Q') {\n primary += 'K'\n secondary += 'K'\n index += 2\n\n break\n }\n\n // Italian.\n if (\n next === 'I' &&\n // Bug: The original algorithm also calls for A (as in CIA), which is\n // already taken care of above.\n (nextnext === 'E' || nextnext === 'O')\n ) {\n primary += 'S'\n secondary += 'X'\n index += 2\n\n break\n }\n\n if (next === 'I' || next === 'E' || next === 'Y') {\n primary += 'S'\n secondary += 'S'\n index += 2\n\n break\n }\n\n primary += 'K'\n secondary += 'K'\n\n // Skip two extra characters ahead in `Mac Caffrey`, `Mac Gregor`.\n if (\n next === ' ' &&\n (nextnext === 'C' || nextnext === 'G' || nextnext === 'Q')\n ) {\n index += 3\n break\n }\n\n // Bug: Already covered above.\n // if (\n // next === 'K' ||\n // next === 'Q' ||\n // (next === 'C' && nextnext !== 'E' && nextnext !== 'I')\n // ) {\n // index++;\n // }\n\n index++\n\n break\n case 'D':\n if (next === 'G') {\n // Such as `edge`.\n if (nextnext === 'E' || nextnext === 'I' || nextnext === 'Y') {\n primary += 'J'\n secondary += 'J'\n index += 3\n // Such as `Edgar`.\n } else {\n primary += 'TK'\n secondary += 'TK'\n index += 2\n }\n\n break\n }\n\n if (next === 'T' || next === 'D') {\n primary += 'T'\n secondary += 'T'\n index += 2\n\n break\n }\n\n primary += 'T'\n secondary += 'T'\n index++\n\n break\n case 'F':\n if (next === 'F') {\n index++\n }\n\n index++\n primary += 'F'\n secondary += 'F'\n\n break\n case 'G':\n if (next === 'H') {\n if (index > 0 && !vowels.test(prev)) {\n primary += 'K'\n secondary += 'K'\n index += 2\n\n break\n }\n\n // Such as `Ghislane`, `Ghiradelli`.\n if (index === 0) {\n if (nextnext === 'I') {\n primary += 'J'\n secondary += 'J'\n } else {\n primary += 'K'\n secondary += 'K'\n }\n\n index += 2\n\n break\n }\n\n // Parker's rule (with some further refinements).\n if (\n // Such as `Hugh`. The comma is not a bug.\n ((subvalue = characters[index - 2]),\n subvalue === 'B' || subvalue === 'H' || subvalue === 'D') ||\n // Such as `bough`. The comma is not a bug.\n ((subvalue = characters[index - 3]),\n subvalue === 'B' || subvalue === 'H' || subvalue === 'D') ||\n // Such as `Broughton`. The comma is not a bug.\n ((subvalue = characters[index - 4]),\n subvalue === 'B' || subvalue === 'H')\n ) {\n index += 2\n\n break\n }\n\n // Such as `laugh`, `McLaughlin`, `cough`, `gough`, `rough`, `tough`.\n if (index > 2 && prev === 'U' && gForF.test(characters[index - 3])) {\n primary += 'F'\n secondary += 'F'\n } else if (index > 0 && prev !== 'I') {\n primary += 'K'\n secondary += 'K'\n }\n\n index += 2\n\n break\n }\n\n if (next === 'N') {\n if (index === 1 && vowels.test(characters[0]) && !isSlavoGermanic) {\n primary += 'KN'\n secondary += 'N'\n // Not like `Cagney`.\n } else if (\n value.slice(index + 2, index + 4) !== 'EY' &&\n value.slice(index + 1) !== 'Y' &&\n !isSlavoGermanic\n ) {\n primary += 'N'\n secondary += 'KN'\n } else {\n primary += 'KN'\n secondary += 'KN'\n }\n\n index += 2\n\n break\n }\n\n // Such as `Tagliaro`.\n if (value.slice(index + 1, index + 3) === 'LI' && !isSlavoGermanic) {\n primary += 'KL'\n secondary += 'L'\n index += 2\n\n break\n }\n\n // -ges-, -gep-, -gel- at beginning.\n if (index === 0 && initialGForKj.test(value.slice(1, 3))) {\n primary += 'K'\n secondary += 'J'\n index += 2\n\n break\n }\n\n // -ger-, -gy-.\n if (\n (value.slice(index + 1, index + 3) === 'ER' &&\n prev !== 'I' &&\n prev !== 'E' &&\n !initialAngerException.test(value.slice(0, 6))) ||\n (next === 'Y' && !gForKj.test(prev))\n ) {\n primary += 'K'\n secondary += 'J'\n index += 2\n\n break\n }\n\n // Italian such as `biaggi`.\n if (\n next === 'E' ||\n next === 'I' ||\n next === 'Y' ||\n ((prev === 'A' || prev === 'O') && next === 'G' && nextnext === 'I')\n ) {\n // Obvious Germanic.\n if (value.slice(index + 1, index + 3) === 'ET' || isGermanic) {\n primary += 'K'\n secondary += 'K'\n } else {\n primary += 'J'\n\n // Always soft if French ending.\n if (value.slice(index + 1, index + 5) === 'IER ') {\n secondary += 'J'\n } else {\n secondary += 'K'\n }\n }\n\n index += 2\n\n break\n }\n\n if (next === 'G') {\n index++\n }\n\n index++\n\n primary += 'K'\n secondary += 'K'\n\n break\n case 'H':\n // Only keep if first & before vowel or btw. 2 vowels.\n if (vowels.test(next) && (index === 0 || vowels.test(prev))) {\n primary += 'H'\n secondary += 'H'\n\n index++\n }\n\n index++\n\n break\n case 'J':\n // Obvious Spanish, `jose`, `San Jacinto`.\n if (\n value.slice(index, index + 4) === 'JOSE' ||\n value.slice(0, 4) === 'SAN '\n ) {\n if (\n value.slice(0, 4) === 'SAN ' ||\n (index === 0 && characters[index + 4] === ' ')\n ) {\n primary += 'H'\n secondary += 'H'\n } else {\n primary += 'J'\n secondary += 'H'\n }\n\n index++\n\n break\n }\n\n if (\n index === 0\n // Bug: unreachable (see previous statement).\n // && value.slice(index, index + 4) !== 'JOSE'.\n ) {\n primary += 'J'\n\n // Such as `Yankelovich` or `Jankelowicz`.\n secondary += 'A'\n // Spanish pron. of such as `bajador`.\n } else if (\n !isSlavoGermanic &&\n (next === 'A' || next === 'O') &&\n vowels.test(prev)\n ) {\n primary += 'J'\n secondary += 'H'\n } else if (index === last) {\n primary += 'J'\n } else if (\n prev !== 'S' &&\n prev !== 'K' &&\n prev !== 'L' &&\n !jForJException.test(next)\n ) {\n primary += 'J'\n secondary += 'J'\n // It could happen.\n } else if (next === 'J') {\n index++\n }\n\n index++\n\n break\n case 'K':\n if (next === 'K') {\n index++\n }\n\n primary += 'K'\n secondary += 'K'\n index++\n\n break\n case 'L':\n if (next === 'L') {\n // Spanish such as `cabrillo`, `gallegos`.\n if (\n (index === length - 3 &&\n ((prev === 'A' && nextnext === 'E') ||\n (prev === 'I' && (nextnext === 'O' || nextnext === 'A')))) ||\n (prev === 'A' &&\n nextnext === 'E' &&\n (characters[last] === 'A' ||\n characters[last] === 'O' ||\n alle.test(value.slice(last - 1, length))))\n ) {\n primary += 'L'\n index += 2\n\n break\n }\n\n index++\n }\n\n primary += 'L'\n secondary += 'L'\n index++\n\n break\n case 'M':\n if (\n next === 'M' ||\n // Such as `dumb`, `thumb`.\n (prev === 'U' &&\n next === 'B' &&\n (index + 1 === last || value.slice(index + 2, index + 4) === 'ER'))\n ) {\n index++\n }\n\n index++\n primary += 'M'\n secondary += 'M'\n\n break\n case 'N':\n if (next === 'N') {\n index++\n }\n\n index++\n primary += 'N'\n secondary += 'N'\n\n break\n case 'Ñ':\n index++\n primary += 'N'\n secondary += 'N'\n\n break\n case 'P':\n if (next === 'H') {\n primary += 'F'\n secondary += 'F'\n index += 2\n\n break\n }\n\n // Also account for `campbell` and `raspberry`.\n subvalue = next\n\n if (subvalue === 'P' || subvalue === 'B') {\n index++\n }\n\n index++\n\n primary += 'P'\n secondary += 'P'\n\n break\n case 'Q':\n if (next === 'Q') {\n index++\n }\n\n index++\n primary += 'K'\n secondary += 'K'\n\n break\n case 'R':\n // French such as `Rogier`, but exclude `Hochmeier`.\n if (\n index === last &&\n !isSlavoGermanic &&\n prev === 'E' &&\n characters[index - 2] === 'I' &&\n characters[index - 4] !== 'M' &&\n (characters[index - 3] !== 'E' && characters[index - 3] !== 'A')\n ) {\n secondary += 'R'\n } else {\n primary += 'R'\n secondary += 'R'\n }\n\n if (next === 'R') {\n index++\n }\n\n index++\n\n break\n case 'S':\n // Special cases `island`, `isle`, `carlisle`, `carlysle`.\n if (next === 'L' && (prev === 'I' || prev === 'Y')) {\n index++\n\n break\n }\n\n // Special case `sugar-`.\n if (index === 0 && value.slice(1, 5) === 'UGAR') {\n primary += 'X'\n secondary += 'S'\n index++\n\n break\n }\n\n if (next === 'H') {\n // Germanic.\n if (hForS.test(value.slice(index + 1, index + 5))) {\n primary += 'S'\n secondary += 'S'\n } else {\n primary += 'X'\n secondary += 'X'\n }\n\n index += 2\n break\n }\n\n if (\n next === 'I' &&\n (nextnext === 'O' || nextnext === 'A')\n // Bug: Already covered by previous branch\n // || value.slice(index, index + 4) === 'SIAN'\n ) {\n if (isSlavoGermanic) {\n primary += 'S'\n secondary += 'S'\n } else {\n primary += 'S'\n secondary += 'X'\n }\n\n index += 3\n\n break\n }\n\n // German & Anglicization's, such as `Smith` match `Schmidt`, `snider`\n // match `Schneider`. Also, -sz- in slavic language although in\n // hungarian it is pronounced `s`.\n if (\n next === 'Z' ||\n (index === 0 &&\n (next === 'L' || next === 'M' || next === 'N' || next === 'W'))\n ) {\n primary += 'S'\n secondary += 'X'\n\n if (next === 'Z') {\n index++\n }\n\n index++\n\n break\n }\n\n if (next === 'C') {\n // Schlesinger's rule.\n if (nextnext === 'H') {\n subvalue = value.slice(index + 3, index + 5)\n\n // Dutch origin, such as `school`, `schooner`.\n if (dutchSch.test(subvalue)) {\n // Such as `schermerhorn`, `schenker`.\n if (subvalue === 'ER' || subvalue === 'EN') {\n primary += 'X'\n secondary += 'SK'\n } else {\n primary += 'SK'\n secondary += 'SK'\n }\n\n index += 3\n\n break\n }\n\n if (\n index === 0 &&\n !vowels.test(characters[3]) &&\n characters[3] !== 'W'\n ) {\n primary += 'X'\n secondary += 'S'\n } else {\n primary += 'X'\n secondary += 'X'\n }\n\n index += 3\n\n break\n }\n\n if (nextnext === 'I' || nextnext === 'E' || nextnext === 'Y') {\n primary += 'S'\n secondary += 'S'\n index += 3\n break\n }\n\n primary += 'SK'\n secondary += 'SK'\n index += 3\n\n break\n }\n\n subvalue = value.slice(index - 2, index)\n\n // French such as `resnais`, `artois`.\n if (index === last && (subvalue === 'AI' || subvalue === 'OI')) {\n secondary += 'S'\n } else {\n primary += 'S'\n secondary += 'S'\n }\n\n if (\n next === 'S'\n // Bug: already taken care of by `German & Anglicization's` above:\n // || next === 'Z'\n ) {\n index++\n }\n\n index++\n\n break\n case 'T':\n if (next === 'I' && nextnext === 'O' && characters[index + 3] === 'N') {\n primary += 'X'\n secondary += 'X'\n index += 3\n\n break\n }\n\n subvalue = value.slice(index + 1, index + 3)\n\n if (\n (next === 'I' && nextnext === 'A') ||\n (next === 'C' && nextnext === 'H')\n ) {\n primary += 'X'\n secondary += 'X'\n index += 3\n\n break\n }\n\n if (next === 'H' || (next === 'T' && nextnext === 'H')) {\n // Special case `Thomas`, `Thames` or Germanic.\n if (\n isGermanic ||\n ((nextnext === 'O' || nextnext === 'A') &&\n characters[index + 3] === 'M')\n ) {\n primary += 'T'\n secondary += 'T'\n } else {\n primary += '0'\n secondary += 'T'\n }\n\n index += 2\n\n break\n }\n\n if (next === 'T' || next === 'D') {\n index++\n }\n\n index++\n primary += 'T'\n secondary += 'T'\n\n break\n case 'V':\n if (next === 'V') {\n index++\n }\n\n primary += 'F'\n secondary += 'F'\n index++\n\n break\n case 'W':\n // Can also be in middle of word (as already taken care of for initial).\n if (next === 'R') {\n primary += 'R'\n secondary += 'R'\n index += 2\n\n break\n }\n\n if (index === 0) {\n // `Wasserman` should match `Vasserman`.\n if (vowels.test(next)) {\n primary += 'A'\n secondary += 'F'\n } else if (next === 'H') {\n // Need `Uomo` to match `Womo`.\n primary += 'A'\n secondary += 'A'\n }\n }\n\n // `Arnow` should match `Arnoff`.\n if (\n ((prev === 'E' || prev === 'O') &&\n next === 'S' &&\n nextnext === 'K' &&\n (characters[index + 3] === 'I' || characters[index + 3] === 'Y')) ||\n // Maybe a bug? Shouldn't this be general Germanic?\n value.slice(0, 3) === 'SCH' ||\n (index === last && vowels.test(prev))\n ) {\n secondary += 'F'\n index++\n\n break\n }\n\n // Polish such as `Filipowicz`.\n if (\n next === 'I' &&\n (nextnext === 'C' || nextnext === 'T') &&\n characters[index + 3] === 'Z'\n ) {\n primary += 'TS'\n secondary += 'FX'\n index += 4\n\n break\n }\n\n index++\n\n break\n case 'X':\n // French such as `breaux`.\n if (\n !(\n index === last &&\n // Bug: IAU and EAU also match by AU\n // (/IAU|EAU/.test(value.slice(index - 3, index))) ||\n (prev === 'U' &&\n (characters[index - 2] === 'A' || characters[index - 2] === 'O'))\n )\n ) {\n primary += 'KS'\n secondary += 'KS'\n }\n\n if (next === 'C' || next === 'X') {\n index++\n }\n\n index++\n\n break\n case 'Z':\n // Chinese pinyin such as `Zhao`.\n if (next === 'H') {\n primary += 'J'\n secondary += 'J'\n index += 2\n\n break\n } else if (\n (next === 'Z' &&\n (nextnext === 'A' || nextnext === 'I' || nextnext === 'O')) ||\n (isSlavoGermanic && index > 0 && prev !== 'T')\n ) {\n primary += 'S'\n secondary += 'TS'\n } else {\n primary += 'S'\n secondary += 'S'\n }\n\n if (next === 'Z') {\n index++\n }\n\n index++\n\n break\n default:\n index++\n }\n }\n\n return [primary, secondary]\n}", "function mach_mini_iimeil_laesbar(text) {\n var s = text.split('');\n for (var i = 0; i < s.length; i++) { s[i] = luukoeptaibel[text[i]]; }\n return s.join('');\n}", "function Eliser2(currentWord) {//bu e harfini nastroyka qiladi ;)\n\n if (currentWord[0] === 'Ц') {//bu harf xat boshida kelsa, \"S\" yoziladi\n currentWord = currentWord.replace(/Ц/, \"S\");\n } else if (currentWord[0] === 'ц') {\n currentWord = currentWord.replace(/ц/, \"s\");\n }\n for (let r = 0; r < currentWord.length; r++) {//Agar Shu harflar capital letter bolib kelsa, So'z qandayligiga qarab nastroyka qiladi\n if (currentWord[r] === 'Ё') {\n for (let z = r + 1; z < currentWord.length; z++) {\n if (currentWord.charCodeAt(z) >= 1040 && currentWord.charCodeAt(z) <= 1071) {\n currentWord = currentWord.replace(/Ё/i, \"YO\");\n }\n }\n } else if (currentWord[r] === 'Ц') {// bundan oldingi harf undosh bolsa(unli bolmasa), \"S\" yoziladi\n if (currentWord.charCodeAt(r - 1) !== 1040 && currentWord.charCodeAt(r - 1) !== 1045 && currentWord.charCodeAt(r - 1) !== 1048 && currentWord.charCodeAt(r - 1) !== 1054 && currentWord.charCodeAt(r - 1) !== 1059 && currentWord.charCodeAt(r - 1) !== 1069 && currentWord.charCodeAt(r - 1) !== 1070 && currentWord.charCodeAt(r - 1) !== 1071 && currentWord.charCodeAt(r - 1) !== 1072 && currentWord.charCodeAt(r - 1) !== 1077 && currentWord.charCodeAt(r - 1) !== 1080 && currentWord.charCodeAt(r - 1) !== 1086 && currentWord.charCodeAt(r - 1) !== 1091 && currentWord.charCodeAt(r - 1) !== 1101 && currentWord.charCodeAt(r - 1) !== 1102 && currentWord.charCodeAt(r - 1) !== 1103) {\n currentWord = currentWord.replace(/Ц/i, \"S\");\n }\n for (let z = r + 1; z < currentWord.length; z++) {\n if (currentWord.charCodeAt(z) >= 1040 && currentWord.charCodeAt(z) <= 1071) {\n currentWord = currentWord.replace(/Ц/i, \"TS\");\n }\n }\n } else if (currentWord[r] === 'ц') {// bundan oldingi harf undosh bolsa(unli bolmasa), \"s\" yoziladi\n if (currentWord.charCodeAt(r - 1) !== 1040 && currentWord.charCodeAt(r - 1) !== 1045 && currentWord.charCodeAt(r - 1) !== 1048 && currentWord.charCodeAt(r - 1) !== 1054 && currentWord.charCodeAt(r - 1) !== 1059 && currentWord.charCodeAt(r - 1) !== 1069 && currentWord.charCodeAt(r - 1) !== 1070 && currentWord.charCodeAt(r - 1) !== 1071 && currentWord.charCodeAt(r - 1) !== 1072 && currentWord.charCodeAt(r - 1) !== 1077 && currentWord.charCodeAt(r - 1) !== 1080 && currentWord.charCodeAt(r - 1) !== 1086 && currentWord.charCodeAt(r - 1) !== 1091 && currentWord.charCodeAt(r - 1) !== 1101 && currentWord.charCodeAt(r - 1) !== 1102 && currentWord.charCodeAt(r - 1) !== 1103) {\n currentWord = currentWord.replace(/ц/i, \"s\");\n }\n } else if (currentWord[r] === 'Ч') {\n for (let z = r + 1; z < currentWord.length; z++) {\n if (currentWord.charCodeAt(z) >= 1040 && currentWord.charCodeAt(z) <= 1071) {\n currentWord = currentWord.replace(/Ч/i, \"CH\");\n }\n }\n } else if (currentWord[r] === 'Ш') {\n for (let z = r + 1; z < currentWord.length; z++) {\n if (currentWord.charCodeAt(z) >= 1040 && currentWord.charCodeAt(z) <= 1071) {\n currentWord = currentWord.replace(/Ш/i, \"SH\");\n }\n }\n } else if (currentWord[r] === 'Ю') {\n for (let z = r + 1; z < currentWord.length; z++) {\n if (currentWord.charCodeAt(z) >= 1040 && currentWord.charCodeAt(z) <= 1071) {\n currentWord = currentWord.replace(/Ю/i, \"YU\");\n }\n }\n } else if (currentWord[r] === 'Я') {\n for (let z = r + 1; z < currentWord.length; z++) {\n if (currentWord.charCodeAt(z) >= 1040 && currentWord.charCodeAt(z) <= 1071) {\n currentWord = currentWord.replace(/Я/i, \"YA\");\n }\n }\n }\n }\n\n if (currentWord[0] === 'Е') { //agar E bosh harfda Upper case bo'lib kelsa : \n for (let z = 1; z < currentWord.length; z++) {\n if (currentWord.charCodeAt(z) >= 1040 && currentWord.charCodeAt(z) <= 1071) {\n var E = currentWord.replace(/Е/i, \"YE\"); //agar so'z ikkinchi harfidan boshlab (z=1) upper case da bo'lsa, \"YE\" deb o'zgartir ! \n return E;\n }\n else {\n var E = currentWord.replace(/Е/i, \"Ye\"); //aks holda \"Ye\" deb o'zgartir ! \n return E;\n }\n }\n }\n else if (currentWord[0] === 'е') {//agar e bosh harfda lower case bolib kelsa:\n var e = currentWord.replace(/е/i, \"ye\");\n return e;\n }\n else {\n return currentWord;\n }\n }", "function i_am_making_wordsStartsWithVowel_bolder() {\n var str = \"what ever i am writing here or have wrote this is all my (first) imagination (second) creation, words with all 5 vowels, which i got from dictionary one by one page, i think all will enjoy and increase knowledge thats my education.\";\n var s = '';\n var spaceFlag = 0;\n var capitalFlag = 0;\n for (var i = 0; i < str.length; i++) {\n if (spaceFlag == 1 || i == 0) {\n if (str[i].toLowerCase() == 'a' ||\n str[i].toLowerCase() == 'e' ||\n str[i].toLowerCase() == 'i' ||\n str[i].toLowerCase() == 'o' ||\n str[i].toLowerCase() == 'u') {\n capitalFlag = 1;\n }\n }\n if (str[i] == \" \" && spaceFlag == 0) {\n spaceFlag = 1;\n capitalFlag = 0;\n }\n else if (str[i] != \" \") {\n spaceFlag = 0;\n }\n if (capitalFlag == 1) {\n s += str[i].toUpperCase();\n }\n\n else {\n s += str[i];\n }\n\n }\n return s;\n}", "function priMay(tx){\n if(tx == undefined){\n return;\n }\n var txtspl = tx.toLowerCase().split(' ');\n var texto = '';\n for (var i=0;i < txtspl.length;i++){\n var splw = txtspl[i].split('');\n splw[0] = splw[0].toUpperCase();\n for (var j = 0;j < splw.length;j++){\n texto += splw[j];\n }\n if(i < txtspl.length-1){\n texto += ' ';\n }\n }\n return texto;\n}", "function nomen(){\n\tvar vowels = \"aeiouy\";\n\tvar consonants = \"bcdfghjklmnprstvwxyz\";\n\tvar first = \"ABCDEFGHIJKLMNOPRSTUVWXYZ\";\n\tvar special_endings = new Array();\n\tspecial_endings[0] = \"ck\";\n\tspecial_endings[1] = \"rs\";\n\tspecial_endings[2] = \"rz\";\n\tspecial_endings[3] = \"lm\";\n\tspecial_endings[4] = \"lk\";\n\tspecial_endings[5] = \"lp\";\n\tspecial_endings[6] = \"rt\";\n\tspecial_endings[7] = \"ff\";\n\tspecial_endings[8] = \"tz\";\n\tspecial_endings[9] = \"wz\";\n\tspecial_endings[10] = \"sh\"; \n\tspecial_endings[11] = \"qu\";\n\t\n\tvar poke = first.charAt( chaos(24) );\n\tvar nameN = 2 + chaos(5);\n\t\n\t\n\t//we have our first letter!\n\tvar name = poke;\n\tfor(i = 1; i < nameN; i++){\n\t\t//if true get a consonant next else get a vowel\n\t\tif (vowels.search(poke.toLowerCase()) != -1){\n\t\t\tpoke = consonants.charAt( chaos(19) );\n\t\t\tif( i == ( nameN - 1) && ( chaos(100) <= 50 ) ){\n\t\t\t\t//this is also the last letter\n\t\t\t\t//and a 50% chance of a special ending\n\t\t\t\tpoke = special_endings[chaos(12)-1];\n\t\t\t}//end if special ending\n\t\t}else{\n\t\t\tpoke = vowels.charAt( chaos(5) );\n\t\t}//end if vowel else consonant\n\t\t\n\t\tname += poke;\n\t}//end for length of name\n\t\n\treturn name;\n\t\n}//end function nomen", "function feminineForms(lastChar, inputWord, secondToLastChar) {\n \n if (secondToLastChar === \"c\") {\n newWord = inputWord.slice(0, -2) + \"quita\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"k\") {\n newWord = inputWord.slice(0, -1) + \"quita\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"g\") {\n newWord = inputWord.slice(0, -1) + \"uita\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"z\") {\n newWord = inputWord.slice(0, -1) + \"cecita\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"u\") {\n newWord = inputWord.slice(0, -2) + \"üita\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"t\") {\n newWord = \"1: \" + inputWord.slice(0, -1) + \"ita\"; \n dimunutive.innerHTML = newWord;\n \n newWord = \"2: \" + inputWord.slice(0, -1) + \"ica\"; \n specialIco.innerHTML = newWord;\n } else if (lastChar === \"a\") {\n newWord = inputWord.slice(0, -1) + \"ita\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"l\" || lastChar === \"s\" && secondToLastChar === \"e\") {\n newWord = inputWord + \"ita\";\n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"r\" || lastChar === \"n\" || lastChar === \"e\") {\n newWord = inputWord + \"cita\";\n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"s\") {\n newWord = inputWord.slice(0, -2) + \"itas\"; \n dimunutive.innerHTML = newWord;\n } else {\n newWord = inputWord + \"ita\";\n dimunutive.innerHTML = newWord;\n }\n }", "function masculineForms(lastChar, inputWord, secondToLastChar) {\n \n if (secondToLastChar === \"c\") {\n newWord = inputWord.slice(0, -2) + \"quito\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"k\") {\n newWord = inputWord.slice(0, -1) + \"quito\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"g\") {\n newWord = inputWord.slice(0, -1) + \"uito\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"z\") {\n newWord = inputWord.slice(0, -1) + \"cecito\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"u\") {\n newWord = inputWord.slice(0, -2) + \"üito\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"t\") {\n newWord = \"1: \" + inputWord.slice(0, -1) + \"ito\"; \n dimunutive.innerHTML = newWord;\n \n newWord = \"2: \" + inputWord.slice(0, -1) + \"ico\"; \n specialIco.innerHTML = newWord;\n } else if (lastChar === \"o\") {\n newWord = inputWord.slice(0, -1) + \"ito\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"l\" || lastChar === \"s\" && secondToLastChar === \"e\") {\n newWord = inputWord + \"ito\";\n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"r\" || lastChar === \"n\" || lastChar === \"e\") {\n newWord = inputWord + \"cito\";\n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"s\") {\n newWord = inputWord.slice(0, -2) + \"itos\"; \n dimunutive.innerHTML = newWord;\n } else {\n newWord = inputWord + \"ito\";\n dimunutive.innerHTML = newWord;\n }\n }", "function Kn(e){var t=/(-[a-z])/g,n=function(e){return e[1].toUpperCase()},r={};for(var a in e)r[a]=e[a],r[a.replace(t,n)]=e[a];return r}", "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 processSentence(nama, umur, alamat, hobi) {\n return 'Nama saya ' + nama + ', ' + 'umur saya ' + umur + ' tahun,' + ' alamat saya di ' + alamat + ', dan saya punya hobi yaitu ' + hobi + '!'\n}", "function targil8() {\n return \"sayonara\".substr(3);\n}", "function randomBlocText(k){\n result=\"\";\n for(var i=0;i<k;i++){\n var newWord=randomWord();\n if(i==0){\n newWord=capitalizeFirstLetter(newWord);\n }\n result+=randomPhrase();\n }\n return result;\n}", "step3a (word) {\n let result = word\n if (endsin(result, 'heid') && result.length - 4 >= this.r2 && result[result.length - 5] !== 'c') {\n // Delete\n result = removeSuffix(result, 4)\n // Treat a preceding en as in step 1b\n result = this.step1b(result, ['en'])\n }\n if (DEBUG) {\n console.log('step 3a: ' + result)\n }\n return result\n }", "function 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}", "function staggeredCase(input) {\n\n}", "function leetspeak (str) {\n str2 = str.charAt(0).toLowerCase()\n str3 = str.slice(1)\n str4 = str2 + str3\n str4 = str4.replace(/A/gi,4)\n str4 = str4.replace(/E/gi,3)\n str4 = str4.replace(/G/gi,6)\n str4 = str4.replace(/I/gi,1)\n str4 = str4.replace(/O/gi,0)\n str4 = str4.replace(/S/gi,5)\n str4 = str4.replace(/T/gi,7)\n return str4\n}", "function TraduzDinheiro(s) {\n var gm = (typeof chrome !== 'undefined') && (typeof chrome.i18n !== 'undefined') ? chrome.i18n.getMessage : null;\n if (gm == null) {\n return s;\n }\n var tipos_moedas = [ 'pc', 'pp', 'po', 'pl'];\n var dicionario = {};\n tipos_moedas.forEach(function(tm) {\n dicionario[tm] = Traduz(tm);\n dicionario[tm.toUpperCase()] = dicionario[tm].toUpperCase();\n });\n for (var tm in dicionario) {\n if (s.indexOf(tm) != -1) {\n return s.replace(tm, dicionario[tm]);\n }\n }\n return s;\n}", "function crypto(inputText){\n var letter = /^[a-zA-Z]+$/;\n let sentenceOne = inputText.toLowerCase().split(\"\");\n console.log('sentenceOne (after split) = ', sentenceOne);\n var array=[];\n for(var i = 0 ; i < sentenceOne.length; i++){\n if(sentenceOne[i].match(letter)){\n array.push(sentenceOne[i]);\n }\n }\n\n // array = ['b', 'u', 'n', 'm', 'a', ..,]\n // finalSentence = 'bunmannunsun'\n var rows = Math.ceil(Math.sqrt(array.length));\n var cols = Math.ceil(array.length/rows);\n var finalSentence = array.join(\"\");\n console.log('stripped sentence - ', finalSentence);\n\n for(var i=1; i < rows+1 ; i ++){\n this[\"row\"+i] = finalSentence.slice(0,cols);\n finalSentence = finalSentence.slice(cols);\n console.log(\"row\"+i+\" = \", this[\"row\"+i]);\n }\n\n for(var i = 1; i < cols+1; i++){\n this[\"cols\"+i] = \"\";\n }\n\n for(var i = 0; i < cols; i++) {\n let colName = \"cols\"+ (i + 1);\n for(var j = 1; j < rows+1; j++){\n this[colName] = this[colName] + this[\"row\"+j][i];\n }\n\n console.log(`${colName} = ${this[colName]}`);\n }\n var colsJoin = \"\";\n for(var i = 1; i < cols+1; i++){\n colsJoin = colsJoin + this[\"cols\"+i];\n }\n\n // nn\n // bmnsu; bmnsu\n // uuunn; bmnsu uuunn nn\n var output = \"\";\n while(colsJoin.length > 0){\n output = output + colsJoin.slice(0,5) + \" \";\n colsJoin= colsJoin.slice(5);\n console.log(`output: ${output}`);\n }\n return output;\n }", "function zoekInitialen2(woord) {\r\n let woorden = woord.split(' ');\r\n if (woorden.length === 1) return woord;\r\n\r\n let letters = \"\";\r\n for (let woord of woorden) {\r\n letters += woord[0] + '.';\r\n }\r\n return letters;\r\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 spell(){ \n if(count == 1 ) return ' вопрос';\n if(count == 2 || count == 3 || count == 4 ) { \n return ' вопроса';\n } else {\n return ' вопросов'\n }\n }", "function wordHax(str) {\n \n \n \n for (i = 0; i < strArray.length; i++) {\n var strArray = str.split(\" \");\n }\n if (strArray[i].length > 3)\n {\n \n strArray[i] = strArray[i](/a|e|i|o|u/gi, \"\");\n \n }\n else\n {\n \n x.toUpperCase();\n \n }\n \n }", "function eo(e,t){var n={nominative:\"\\u0570\\u0578\\u0582\\u0576\\u057e\\u0561\\u0580_\\u0583\\u0565\\u057f\\u0580\\u057e\\u0561\\u0580_\\u0574\\u0561\\u0580\\u057f_\\u0561\\u057a\\u0580\\u056b\\u056c_\\u0574\\u0561\\u0575\\u056b\\u057d_\\u0570\\u0578\\u0582\\u0576\\u056b\\u057d_\\u0570\\u0578\\u0582\\u056c\\u056b\\u057d_\\u0585\\u0563\\u0578\\u057d\\u057f\\u0578\\u057d_\\u057d\\u0565\\u057a\\u057f\\u0565\\u0574\\u0562\\u0565\\u0580_\\u0570\\u0578\\u056f\\u057f\\u0565\\u0574\\u0562\\u0565\\u0580_\\u0576\\u0578\\u0575\\u0565\\u0574\\u0562\\u0565\\u0580_\\u0564\\u0565\\u056f\\u057f\\u0565\\u0574\\u0562\\u0565\\u0580\".split(\"_\"),accusative:\"\\u0570\\u0578\\u0582\\u0576\\u057e\\u0561\\u0580\\u056b_\\u0583\\u0565\\u057f\\u0580\\u057e\\u0561\\u0580\\u056b_\\u0574\\u0561\\u0580\\u057f\\u056b_\\u0561\\u057a\\u0580\\u056b\\u056c\\u056b_\\u0574\\u0561\\u0575\\u056b\\u057d\\u056b_\\u0570\\u0578\\u0582\\u0576\\u056b\\u057d\\u056b_\\u0570\\u0578\\u0582\\u056c\\u056b\\u057d\\u056b_\\u0585\\u0563\\u0578\\u057d\\u057f\\u0578\\u057d\\u056b_\\u057d\\u0565\\u057a\\u057f\\u0565\\u0574\\u0562\\u0565\\u0580\\u056b_\\u0570\\u0578\\u056f\\u057f\\u0565\\u0574\\u0562\\u0565\\u0580\\u056b_\\u0576\\u0578\\u0575\\u0565\\u0574\\u0562\\u0565\\u0580\\u056b_\\u0564\\u0565\\u056f\\u057f\\u0565\\u0574\\u0562\\u0565\\u0580\\u056b\".split(\"_\")},i=/D[oD]?(\\[[^\\[\\]]*\\]|\\s+)+MMMM?/.test(t)?\"accusative\":\"nominative\";return n[i][e.month()]}", "static titleize(string) {\n let splitted = string.split(\" \")\n let sliced = splitted.slice(1)\n let result = [];\n if (splitted[0] !== splitted[0].charAt(0).toUpperCase()) {\n result.push(splitted[0].charAt(0).toUpperCase() + splitted[0].slice(1))\n } else {\n result.push(splitted[0] + splitted[0].slice(1))\n }\n for (var i = 0; i < sliced.length; i++) {\n if (sliced[i] == \"the\" || sliced[i] == \"a\" || sliced[i] == \"an\" || sliced[i] == \"but\" || sliced[i] == \"of\" || sliced[i] == \"and\" || sliced[i] == \"for\" || sliced[i] == \"at\" || sliced[i] == \"by\" || sliced[i] == \"from\"){\n result.push(sliced[i])\n } else {\n result.push(sliced[i].charAt(0).toUpperCase() + sliced[i].slice(1))\n }\n }\n return result.join(\" \");\n }", "makeText(numWords = 100) {\n let words = Object.keys(this.chains);\n\n let capWords = words.filter(word => word[0] === word[0].toUpperCase());\n let text = this.randomPick(capWords);\n let firstWord = text;\n let nextWord = this.singleChain(firstWord);\n\n for (let i=1; i < numWords - 1; i++) {\n text += \" \";\n let bigram = `${firstWord} ${nextWord}`;\n firstWord = nextWord;\n if (this.bigrams[bigram]) {\n let pick = this.randomPick(this.bigrams[bigram]);\n nextWord = pick ? pick : this.randomPick(words);\n } else {\n nextWord = this.singleChain(firstWord);\n }\n text += nextWord;\n }\n return text;\n }", "function cantidadCaracteres(frase) {\r\n \r\n let i=0;\r\n let nuevaPalabra=\"\";\r\n let nuevaFrase=\"\";\r\n let longitud=frase.length;\r\n let longitudNP=0;\r\n\r\n\r\n for ( i == 0; i < longitud; i++) {\r\n \r\n while (frase[i] ==\" \") {\r\n i++;\r\n } \r\n if (frase[i]==\"a\" || frase[i]==\"A\") {\r\n\r\n while ((frase[i]!=' ') && (i < longitud) ) {\r\n nuevaPalabra = nuevaPalabra+frase[i];\r\n i++;\r\n longitudNP++;\r\n } \r\n if (nuevaPalabra[longitudNP-1]==\"r\" ||nuevaPalabra[longitudNP-1]==\"R\") {\r\n nuevaFrase= nuevaFrase+nuevaPalabra+\" \";\r\n }\r\n nuevaPalabra=\"\";\r\n longitudNP=0;\r\n }else{\r\n if ((frase[i] !=\" \") && (i<longitud)) {\r\n i++;\r\n }\r\n }\r\n } \r\n return nuevaFrase;\r\n \r\n}", "function main() {\n var n = parseInt(readLine());\n var s = readLine();\n var k = parseInt(readLine());\n let newPhrase = '';\n \n for (let i = 0; i < n; ++i) {\n const lowerCase = { min: 97, max: 122 };\n const upperCase = { min: 65, max: 90};\n let isTitle = null;\n let isPunctuation = null;\n let currCharCode = s.charCodeAt(i);\n \n if (currCharCode >= lowerCase.min && currCharCode <= lowerCase.max) {\n isTitle = false;\n } \n else if (currCharCode >= upperCase.min && currCharCode <= upperCase.max) {\n isTitle = true;\n } else {\n isPunctuation = true;\n }\n \n if (!isTitle && !isPunctuation) {\n currCharCode -= lowerCase.min;\n currCharCode = ((currCharCode + k) % 26) + lowerCase.min;\n } \n else if (isTitle && !isPunctuation) {\n currCharCode -= upperCase.min;\n currCharCode = ((currCharCode + k) % 26) + upperCase.min;\n }\n \n newPhrase += String.fromCharCode(currCharCode);\n }\n \n console.log(newPhrase);\n}", "function __doubleMetaphone(value) {\n var primary = '',\n secondary = '',\n index = 0,\n length = value.length,\n last = length - 1,\n isSlavoGermanic = SLAVO_GERMANIC.test(value),\n isGermanic = GERMANIC.test(value),\n characters = value.split(''),\n subvalue,\n next,\n prev,\n nextnext;\n\n value = String(value).toUpperCase() + ' ';\n\n // Skip this at beginning of word.\n if (INITIAL_EXCEPTIONS.test(value))\n index++;\n\n // Initial X is pronounced Z, which maps to S. Such as `Xavier`\n if (characters[0] === 'X') {\n primary += 'S';\n secondary += 'S';\n\n index++;\n }\n\n while (index < length) {\n prev = characters[index - 1];\n next = characters[index + 1];\n nextnext = characters[index + 2];\n\n switch (characters[index]) {\n case 'A':\n case 'E':\n case 'I':\n case 'O':\n case 'U':\n case 'Y':\n case 'À':\n case 'Ê':\n case 'É':\n case 'É':\n if (index === 0) {\n // All initial vowels now map to `A`.\n primary += 'A';\n secondary += 'A';\n }\n\n index++;\n\n break;\n case 'B':\n primary += 'P';\n secondary += 'P';\n\n if (next === 'B')\n index++;\n\n index++;\n\n break;\n case 'Ç':\n primary += 'S';\n secondary += 'S';\n index++;\n\n break;\n case 'C':\n // Various Germanic:\n if (prev === 'A' &&\n next === 'H' &&\n nextnext !== 'I' &&\n !VOWELS.test(characters[index - 2]) &&\n (nextnext !== 'E' || (subvalue = value.slice(index - 2, index + 4) &&\n (subvalue === 'BACHER' || subvalue === 'MACHER')))\n ) {\n primary += 'K';\n secondary += 'K';\n index += 2;\n\n break;\n }\n\n // Special case for `Caesar`.\n if (index === 0 && value.slice(index + 1, index + 6) === 'AESAR') {\n primary += 'S';\n secondary += 'S';\n index += 2;\n\n break;\n }\n\n // Italian `Chianti`.\n if (value.slice(index + 1, index + 4) === 'HIA') {\n primary += 'K';\n secondary += 'K';\n index += 2;\n\n break;\n }\n\n if (next === 'H') {\n // Find `Michael`.\n if (index > 0 && nextnext === 'A' && characters[index + 3] === 'E') {\n primary += 'K';\n secondary += 'X';\n index += 2;\n\n break;\n }\n\n // Greek roots such as `chemistry`, `chorus`.\n if (index === 0 && GREEK_INITIAL_CH.test(value)) {\n primary += 'K';\n secondary += 'K';\n index += 2;\n\n break;\n }\n\n // Germanic, Greek, or otherwise `CH` for `KH` sound.\n if (isGermanic ||\n // Such as 'architect' but not 'arch', orchestra', 'orchid'.\n GREEK_CH.test(value.slice(index - 2, index + 4)) ||\n (nextnext === 'T' || nextnext === 'S') ||\n ((index === 0 ||\n prev === 'A' ||\n prev === 'E' ||\n prev === 'O' ||\n prev === 'U') &&\n // Such as `wachtler`, `weschsler`, but not `tichner`.\n CH_FOR_KH.test(nextnext))\n ) {\n primary += 'K';\n secondary += 'K';\n } else if (index === 0) {\n primary += 'X';\n secondary += 'X';\n } else if (value.slice(0, 2) === 'MC') { // Such as 'McHugh'.\n // Bug? Why matching absolute? what about McHiccup?\n primary += 'K';\n secondary += 'K';\n } else {\n primary += 'X';\n secondary += 'K';\n }\n\n index += 2;\n\n break;\n }\n\n // Such as `Czerny`.\n if (next === 'Z' && value.slice(index - 2, index) !== 'WI') {\n primary += 'S';\n secondary += 'X';\n index += 2;\n\n break;\n }\n\n // Such as `Focaccia`.\n if (value.slice(index + 1, index + 4) === 'CIA') {\n primary += 'X';\n secondary += 'X';\n index += 3;\n\n break;\n }\n\n // Double `C`, but not `McClellan`.\n if (next === 'C' && !(index === 1 && characters[0] === 'M')) {\n // Such as `Bellocchio`, but not `Bacchus`.\n if ((nextnext === 'I' ||\n nextnext === 'E' ||\n nextnext === 'H') &&\n value.slice(index + 2, index + 4) !== 'HU'\n ) {\n subvalue = value.slice(index - 1, index + 4);\n\n // Such as `Accident`, `Accede`, `Succeed`.\n if ((index === 1 && prev === 'A') || subvalue === 'UCCEE' || subvalue === 'UCCES') {\n primary += 'KS';\n secondary += 'KS';\n } else { // Such as `Bacci`, `Bertucci`, other Italian.\n primary += 'X';\n secondary += 'X';\n }\n\n index += 3;\n\n break;\n } else {\n // Pierce's rule.\n primary += 'K';\n secondary += 'K';\n index += 2;\n\n break;\n }\n }\n\n if (next === 'G' || next === 'K' || next === 'Q') {\n primary += 'K';\n secondary += 'K';\n index += 2;\n\n break;\n }\n\n // Italian.\n if (next === 'I' && (nextnext === 'A' || nextnext === 'E' || nextnext === 'O')) {\n primary += 'S';\n secondary += 'X';\n index += 2;\n\n break;\n }\n\n if (next === 'I' || next === 'E' || next === 'Y') {\n primary += 'S';\n secondary += 'S';\n index += 2;\n\n break;\n }\n\n primary += 'K';\n secondary += 'K';\n\n // Skip two extra characters ahead in `Mac Caffrey`, `Mac Gregor`.\n if (next === ' ' && (nextnext === 'C' || nextnext === 'G' || nextnext === 'Q')) {\n index += 3;\n break;\n }\n\n if (next === 'K' || next === 'Q' || (next === 'C' && nextnext !== 'E' && nextnext !== 'I'))\n index++;\n\n index++;\n\n break;\n case 'D':\n if (next === 'G') {\n // Such as `edge`.\n if (nextnext === 'E' || nextnext === 'I' || nextnext === 'Y') {\n primary += 'J';\n secondary += 'J';\n index += 3;\n } else { // Such as `Edgar`.\n primary += 'TK';\n secondary += 'TK';\n index += 2;\n }\n\n break;\n }\n\n if (next === 'T' || next === 'D') {\n primary += 'T';\n secondary += 'T';\n index += 2;\n\n break;\n }\n\n primary += 'T';\n secondary += 'T';\n index++;\n\n break;\n case 'F':\n if (next === 'F')\n index++;\n\n index++;\n primary += 'F';\n secondary += 'F';\n\n break;\n case 'G':\n if (next === 'H') {\n if (index > 0 && !VOWELS.test(prev)) {\n primary += 'K';\n secondary += 'K';\n index += 2;\n\n break;\n }\n\n // Such as `Ghislane`, `Ghiradelli`.\n if (index === 0) {\n if (nextnext === 'I') {\n primary += 'J';\n secondary += 'J';\n } else {\n primary += 'K';\n secondary += 'K';\n }\n index += 2;\n break;\n }\n\n // Parker's rule (with some further refinements).\n if ((// Such as `Hugh`\n subvalue = characters[index - 2],\n subvalue === 'B' ||\n subvalue === 'H' ||\n subvalue === 'D'\n ) ||\n (// Such as `bough`.\n subvalue = characters[index - 3],\n subvalue === 'B' ||\n subvalue === 'H' ||\n subvalue === 'D'\n ) ||\n (// Such as `Broughton`.\n subvalue = characters[index - 4],\n subvalue === 'B' ||\n subvalue === 'H'\n )\n ) {\n index += 2;\n\n break;\n }\n\n // Such as `laugh`, `McLaughlin`, `cough`, `gough`, `rough`, `tough`.\n if (index > 2 && prev === 'U' && G_FOR_F.test(characters[index - 3])) {\n primary += 'F';\n secondary += 'F';\n } else if (index > 0 && prev !== 'I') {\n primary += 'K';\n secondary += 'K';\n }\n\n index += 2;\n\n break;\n }\n\n if (next === 'N') {\n if (index === 1 && VOWELS.test(characters[0]) && !isSlavoGermanic) {\n primary += 'KN';\n secondary += 'N';\n } else if (\n // Not like `Cagney`.\n value.slice(index + 2, index + 4) !== 'EY' &&\n value.slice(index + 1) !== 'Y' &&\n !isSlavoGermanic\n ) {\n primary += 'N';\n secondary += 'KN';\n } else {\n primary += 'KN';\n secondary += 'KN';\n }\n\n index += 2;\n\n break;\n }\n\n //Such as `Tagliaro`.\n if (value.slice(index + 1, index + 3) === 'LI' && !isSlavoGermanic) {\n primary += 'KL';\n secondary += 'L';\n index += 2;\n\n break;\n }\n\n // -ges-, -gep-, -gel- at beginning.\n if (index === 0 && INITIAL_G_FOR_KJ.test(value.slice(1, 3))) {\n primary += 'K';\n secondary += 'J';\n index += 2;\n\n break;\n }\n\n // -ger-, -gy-.\n if ((value.slice(index + 1, index + 3) === 'ER' &&\n prev !== 'I' && prev !== 'E' &&\n !INITIAL_ANGER_EXCEPTION.test(value.slice(0, 6))\n ) ||\n (next === 'Y' && !G_FOR_KJ.test(prev))\n ) {\n primary += 'K';\n secondary += 'J';\n index += 2;\n\n break;\n }\n\n // Italian such as `biaggi`.\n if (next === 'E' || next === 'I' || next === 'Y' || (\n (prev === 'A' || prev === 'O') &&\n next === 'G' && nextnext === 'I'\n )\n ) {\n // Obvious Germanic.\n if (value.slice(index + 1, index + 3) === 'ET' || isGermanic) {\n primary += 'K';\n secondary += 'K';\n } else {\n // Always soft if French ending.\n if (value.slice(index + 1, index + 5) === 'IER ') {\n primary += 'J';\n secondary += 'J';\n } else {\n primary += 'J';\n secondary += 'K';\n }\n }\n\n index += 2;\n\n break;\n }\n\n if (next === 'G')\n index++;\n\n index++;\n\n primary += 'K';\n secondary += 'K';\n\n break;\n case 'H':\n // Only keep if first & before vowel or btw. 2 vowels.\n if (VOWELS.test(next) && (index === 0 || VOWELS.test(prev))) {\n primary += 'H';\n secondary += 'H';\n\n index++;\n }\n\n index++;\n\n break;\n case 'J':\n // Obvious Spanish, `jose`, `San Jacinto`.\n if (value.slice(index, index + 4) === 'JOSE' || value.slice(0, 4) === 'SAN ') {\n if (value.slice(0, 4) === 'SAN ' || (index === 0 && characters[index + 4] === ' ')) {\n primary += 'H';\n secondary += 'H';\n } else {\n primary += 'J';\n secondary += 'H';\n }\n\n index++;\n\n break;\n }\n\n if (index === 0) {\n // Such as `Yankelovich` or `Jankelowicz`.\n primary += 'J';\n secondary += 'A';\n } else if (// Spanish pron. of such as `bajador`.\n !isSlavoGermanic &&\n (next === 'A' || next === 'O') &&\n VOWELS.test(prev)\n ) {\n primary += 'J';\n secondary += 'H';\n } else if (index === last) {\n primary += 'J';\n } else if (prev !== 'S' && prev !== 'K' && prev !== 'L' && !J_FOR_J_EXCEPTION.test(next)) {\n primary += 'J';\n secondary += 'J';\n } else if (next === 'J') {\n index++;\n }\n\n index++;\n\n break;\n case 'K':\n if (next === 'K')\n index++;\n\n primary += 'K';\n secondary += 'K';\n index++;\n\n break;\n case 'L':\n if (next === 'L') {\n // Spanish such as `cabrillo`, `gallegos`.\n if ((index === length - 3 && ((\n prev === 'I' && (\n nextnext === 'O' || nextnext === 'A'\n )\n ) || (\n prev === 'A' && nextnext === 'E'\n )\n )) || (\n prev === 'A' && nextnext === 'E' && ((\n characters[last] === 'A' || characters[last] === 'O'\n ) || ALLE.test(value.slice(last - 1, length))\n )\n )\n ) {\n primary += 'L';\n index += 2;\n\n break;\n }\n\n index++;\n }\n\n primary += 'L';\n secondary += 'L';\n index++;\n\n break;\n case 'M':\n // Such as `dumb`, `thumb`.\n if (next === 'M' || (\n prev === 'U' && next === 'B' && (\n index + 1 === last || value.slice(index + 2, index + 4) === 'ER')\n )\n ) {\n index++;\n }\n\n index++;\n primary += 'M';\n secondary += 'M';\n\n break;\n case 'N':\n if (next === 'N')\n index++;\n\n index++;\n primary += 'N';\n secondary += 'N';\n\n break;\n case 'Ñ':\n index++;\n primary += 'N';\n secondary += 'N';\n\n break;\n case 'P':\n if (next === 'H') {\n primary += 'F';\n secondary += 'F';\n index += 2;\n\n break;\n }\n\n // Also account for `campbell` and `raspberry`.\n subvalue = next;\n\n if (subvalue === 'P' || subvalue === 'B')\n index++;\n\n index++;\n\n primary += 'P';\n secondary += 'P';\n\n break;\n case 'Q':\n if (next === 'Q') {\n index++;\n }\n\n index++;\n primary += 'K';\n secondary += 'K';\n\n break;\n case 'R':\n // French such as `Rogier`, but exclude `Hochmeier`.\n if (index === last &&\n !isSlavoGermanic &&\n prev === 'E' &&\n characters[index - 2] === 'I' &&\n characters[index - 4] !== 'M' && (\n characters[index - 3] !== 'E' &&\n characters[index - 3] !== 'A'\n )\n ) {\n secondary += 'R';\n } else {\n primary += 'R';\n secondary += 'R';\n }\n\n if (next === 'R')\n index++;\n\n index++;\n\n break;\n case 'S':\n // Special cases `island`, `isle`, `carlisle`, `carlysle`.\n if (next === 'L' && (prev === 'I' || prev === 'Y')) {\n index++;\n\n break;\n }\n\n // Special case `sugar-`.\n if (index === 0 && value.slice(1, 5) === 'UGAR') {\n primary += 'X';\n secondary += 'S';\n index++;\n\n break;\n }\n\n if (next === 'H') {\n // Germanic.\n if (H_FOR_S.test(value.slice(index + 1, index + 5))) {\n primary += 'S';\n secondary += 'S';\n } else {\n primary += 'X';\n secondary += 'X';\n }\n\n index += 2;\n break;\n }\n\n if (next === 'I' && (nextnext === 'O' || nextnext === 'A')) {\n if (!isSlavoGermanic) {\n primary += 'S';\n secondary += 'X';\n } else {\n primary += 'S';\n secondary += 'S';\n }\n\n index += 3;\n\n break;\n }\n\n /*\n * German & Anglicization's, such as `Smith` match `Schmidt`,\n * `snider` match `Schneider`. Also, -sz- in slavic language\n * although in hungarian it is pronounced `s`.\n */\n if (next === 'Z' || (\n index === 0 && (\n next === 'L' || next === 'M' || next === 'N' || next === 'W'\n )\n )\n ) {\n primary += 'S';\n secondary += 'X';\n\n if (next === 'Z')\n index++;\n\n index++;\n\n break;\n }\n\n if (next === 'C') {\n // Schlesinger's rule.\n if (nextnext === 'H') {\n subvalue = value.slice(index + 3, index + 5);\n\n // Dutch origin, such as `school`, `schooner`.\n if (DUTCH_SCH.test(subvalue)) {\n // Such as `schermerhorn`, `schenker`.\n if (subvalue === 'ER' || subvalue === 'EN') {\n primary += 'X';\n secondary += 'SK';\n } else {\n primary += 'SK';\n secondary += 'SK';\n }\n\n index += 3;\n\n break;\n }\n\n if (index === 0 && !VOWELS.test(characters[3]) && characters[3] !== 'W') {\n primary += 'X';\n secondary += 'S';\n } else {\n primary += 'X';\n secondary += 'X';\n }\n\n index += 3;\n\n break;\n }\n\n if (nextnext === 'I' || nextnext === 'E' || nextnext === 'Y') {\n primary += 'S';\n secondary += 'S';\n index += 3;\n break;\n }\n\n primary += 'SK';\n secondary += 'SK';\n index += 3;\n\n break;\n }\n\n subvalue = value.slice(index - 2, index);\n\n // French such as `resnais`, `artois`.\n if (index === last && (subvalue === 'AI' || subvalue === 'OI')) {\n secondary += 'S';\n } else {\n primary += 'S';\n secondary += 'S';\n }\n\n if (next === 'S' || next === 'Z')\n index++;\n\n index++;\n\n break;\n case 'T':\n if (next === 'I' && nextnext === 'O' && characters[index + 3] === 'N') {\n primary += 'X';\n secondary += 'X';\n index += 3;\n\n break;\n }\n\n subvalue = value.slice(index + 1, index + 3);\n\n if ((next === 'I' && nextnext === 'A') || (next === 'C' && nextnext === 'H')) {\n primary += 'X';\n secondary += 'X';\n index += 3;\n\n break;\n }\n\n if (next === 'H' || (next === 'T' && nextnext === 'H')) {\n // Special case `Thomas`, `Thames` or Germanic.\n if (isGermanic || ((nextnext === 'O' || nextnext === 'A') && characters[index + 3] === 'M')) {\n primary += 'T';\n secondary += 'T';\n } else {\n primary += '0';\n secondary += 'T';\n }\n\n index += 2;\n\n break;\n }\n\n if (next === 'T' || next === 'D')\n index++;\n\n index++;\n primary += 'T';\n secondary += 'T';\n\n break;\n case 'V':\n if (next === 'V')\n index++;\n\n primary += 'F';\n secondary += 'F';\n index++;\n\n break;\n case 'W':\n // Can also be in middle of word (as already taken care of for initial).\n if (next === 'R') {\n primary += 'R';\n secondary += 'R';\n index += 2;\n\n break;\n }\n\n if (index === 0) {\n // `Wasserman` should match `Vasserman`.\n if (VOWELS.test(next)) {\n primary += 'A';\n secondary += 'F';\n } else if (next === 'H') {\n // Need `Uomo` to match `Womo`.\n primary += 'A';\n secondary += 'A';\n }\n }\n\n // `Arnow` should match `Arnoff`.\n if (((prev === 'E' || prev === 'O') &&\n next === 'S' && nextnext === 'K' && (\n characters[index + 3] === 'I' ||\n characters[index + 3] === 'Y'\n )\n ) || value.slice(0, 3) === 'SCH' || (index === last && VOWELS.test(prev))\n ) {\n secondary += 'F';\n index++;\n\n break;\n }\n\n // Polish such as `Filipowicz`.\n if (next === 'I' && (nextnext === 'C' || nextnext === 'T') && characters[index + 3] === 'Z') {\n primary += 'TS';\n secondary += 'FX';\n index += 4;\n\n break;\n }\n\n index++;\n\n break;\n case 'X':\n // French such as `breaux`.\n if (index === last || (prev === 'U' && (\n characters[index - 2] === 'A' ||\n characters[index - 2] === 'O'\n ))\n ) {\n primary += 'KS';\n secondary += 'KS';\n }\n\n if (next === 'C' || next === 'X')\n index++;\n\n index++;\n\n break;\n case 'Z':\n // Chinese pinyin such as `Zhao`.\n if (next === 'H') {\n primary += 'J';\n secondary += 'J';\n index += 2;\n\n break;\n } else if ((next === 'Z' && (\n nextnext === 'A' || nextnext === 'I' || nextnext === 'O'\n )) || (\n isSlavoGermanic && index > 0 && prev !== 'T'\n )\n ) {\n primary += 'S';\n secondary += 'TS';\n } else {\n primary += 'S';\n secondary += 'S';\n }\n\n if (next === 'Z')\n index++;\n\n index++;\n\n break;\n default:\n index++;\n\n }\n }\n\n return [primary, secondary];\n }", "function GetSomewhereinPhoneticModifiedCharaceter(CUni)\r\n{\r\n\tvar CMod=CUni;\r\n\r\n\tif(LCUNI=='ক' && CUni=='হ') CMod = 'খ';\r\n\telse if(LCUNI=='গ' && CUni=='হ') CMod = 'ঘ';\r\n\telse if(LCUNI=='চ' && CUni=='হ') CMod = 'চ';\r\n\telse if(LCUNI=='জ' && CUni=='হ') CMod = 'ঝ';\r\n\telse if(LCUNI=='ট' && CUni=='হ') CMod = 'ঠ';\r\n\telse if(LCUNI=='ড' && CUni=='হ') CMod = 'ঢ';\r\n\telse if(LCUNI=='ত' && CUni=='হ') CMod = 'থ';\r\n\telse if(LCUNI=='দ' && CUni=='হ') CMod = 'ধ';\r\n\telse if(LCUNI=='প' && CUni=='হ') CMod = 'ফ';\r\n\telse if(LCUNI=='ব' && CUni=='হ') CMod = 'ভ';\r\n\telse if(LCUNI=='স' && CUni=='হ') CMod = 'শ';\r\n\telse if(LCUNI=='ড়' && CUni=='হ') CMod = 'ঢ়';\r\n\r\n\telse if(LCUNI=='ণ' && CUni=='গ') CMod = 'ঙ';\r\n\telse if(LCUNI=='ন' && CUni=='গ') CMod = 'ং';\r\n\t\r\n\telse if(LCUNI=='ণ' && CUni=='ঘ') CMod = 'ঞ';\r\n\r\n\telse if(LCUNI=='ণ' && CUni=='ণ') CMod = 'ঁ';\r\n\r\n\telse if(LCUNI=='ঃ' && CUni=='ঃ') CMod = 'ঃ';\r\n\t\r\n\telse if(LCUNI=='ট' && CUni=='ট') CMod = 'ৎ';\r\n\t\r\n\telse if(LCUNI=='া' && CUni=='ো') CMod = 'অ';\r\n\telse if(LCUNI=='ি' && CUni=='ি') CMod = 'ী';\r\n\telse if(LCUNI=='ই' && CUni=='ই') CMod = 'ঈ';\r\n\telse if(LCUNI=='ু' && CUni=='ু') CMod = 'ূ';\r\n\telse if(LCUNI=='উ' && CUni=='উ') CMod = 'ঊ';\r\n\telse if(LCUNI=='ও' && CUni=='ই') CMod = 'ঐ';\r\n\telse if(LCUNI=='ো' && CUni=='ি') CMod = 'ৈ';\r\n\telse if(LCUNI=='ও' && CUni=='উ') CMod = 'ঔ';\r\n\telse if(LCUNI=='ো' && CUni=='ু') CMod = 'ৌ';\r\n\telse if(LCUNI=='ৃ' && CUni=='র') CMod = 'ৃ';\r\n\telse if(LCUNI=='ঋ' && CUni=='ড়') CMod = 'ঋ';\r\n\r\n\treturn CMod;\r\n}", "function getPigLatin(input){\n console.log\n let r =\"\";\n let start = \"\";\n let flg = false;\n let checkSC = false;\n let len =0;\n if(input[0] === input[0].toUpperCase()) flg = true;\n if(input[input.length-1].toUpperCase() === input[input.length-1].toLowerCase()) checkSC= true;\n if(checkSC) len = input.length-1;\n else len = input.length\n for(let i=0; i<len;i++){\n if(input[i] === 'a' || input[i]=== 'e' || input[i] === 'i' || input[i]==='o' || input[i]==='u'){\n start = input.slice(0,i)\n if(checkSC) r= (input.slice(i,len) + start + \"ay\"+ input[len]).toLowerCase();\n else r= (input.slice(i,len) + start + \"ay\").toLowerCase();\n\n break;\n }\n }\n if(flg) return r[0].toUpperCase()+r.slice(1);\n else return r;\n}", "function Bi(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function translateToKa() {\n /**\n * Original idea by Irakli Nadareishvili\n * http://www.sapikhvno.org/viewtopic.php?t=47&postdays=0&postorder=asc&start=10\n */\n var index, chr, text = [], symbols = \"abgdevzTiklmnopJrstufqRySCcZwWxjh\";\n \n for (var i = 0; i < this.length; i++) {\n chr = this.substr(i, 1);\n if ((index = symbols.indexOf(chr)) >= 0) {\n text.push(String.fromCharCode(index + 4304));\n } else {\n text.push(chr);\n }\n }\n return text.join('');\n }", "function Kenalan () {\n console.log(`Nama Saya, Jane`)\n console.log(`Saya Suka Masak`)\n console.log(`Sekian`)\n}", "function c(e,c,t,n){switch(t){case\"s\":return c?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(c?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(c?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(c?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(c?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(c?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(c?\" жил\":\" жилийн\");default:return e}}", "function a(e,a,t,n){switch(t){case\"s\":return a?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(a?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(a?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(a?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(a?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(a?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(a?\" жил\":\" жилийн\");default:return e}}", "function convertidor(text) {\n let convrtm = text.toLowerCase();\n let frLett = convrtm.charAt(0);\n let convrtM = frLett.toUpperCase();\n let restTxt = convrtm.substr(1,9999);\n console.log(`Your converted phrase is: ${convrtM}${restoTxt}`);\n // console.log(`Su frase convertida es: ${convrtM}${restoTxt}`);\n // console.log(`Sua frase convertida é: ${convrtM}${restoTxt}`);\n // console.log(`Sa phrase convertie est: ${convrtM}${restoTxt}`);\n }", "function processSentence(a,b,c,d){\n return \"Nama saya \" + a + \", Umur saya \"+ b + \" tahun, alamat saya di \" + c + \", hobby saya \"+ d + \"!.\";\n}", "function whisper(str){\n return \"...\" + str.toLowerCase() + \"...\"\n}", "function translateToPigLatin(word) { //defining function to break up the word, add 1st to end and ay to end\n return word.slice(1, word.length) + word[0] + \"ay\";\n}", "function a(e,a,c,n){switch(c){case\"s\":return a?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(a?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(a?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(a?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(a?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(a?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(a?\" жил\":\" жилийн\");default:return e}}", "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 convertAndDisplay(str) {\n\n\t\tvar phon = document.getElementById(\"phonetic\");\n\t\tphon.innerHTML = '';\n\n\t\tvar curr = undefined; /* holds current key */\n\t\tvar next = undefined; /* holds the next key (look-ahead) */\n\n\t\tvar chars = str.toLowerCase().split('');\n\t\tvar charsorig = str.split(''); /* keep non-lowercased string around */\n\t\tvar cursor = 0;\n\n\t\twhile (cursor !== chars.length) {\n\n\t\t\tvar curr = munch(root, chars.slice(cursor), 0);\n\n\t\t\tvar nextcursor = cursor + curr.until;\n\n\t\t\tif (!curr.ipa) { /* partial or no match */\n\t\t\t\tif (curr.until !== 0) { /* partial match */\n\t\t\t\t\tvar content = charsorig.slice(cursor, nextcursor).join('');\n\t\t\t\t\tcreatePinyinElement(phon, 'incomplete', content);\n\t\t\t\t} else { /* no match, unknown character */\n\t\t\t\t\tvar content = charsorig[cursor];\n\t\t\t\t\tcreatePinyinElement(phon, 'ignore', content);\n\t\t\t\t}\n\t\t\t} else { /* match */\n\n\t\t\t\t/* last syllable */\n\t\t\t\tif (chars[nextcursor] === undefined) {\n\t\t\t\t\tcreatePinyinElement(phon, 'pinyin', curr.ipa);\n\t\t\t\t}\n\t\t\t\t/* more to come, deal with combinatory effects */\n\t\t\t\telse {\n\n\t\t\t\t\t/* munch next sequence */\n\t\t\t\t\tvar next = munch(root, chars.slice(nextcursor), 0);\n\n\t\t\t\t\t/* For syllables ending in \"n\" or \"g\", the correct\n\t\t\t\t\t * segmentation depends on the following syllable:\n\t\t\t\t\t * - \"xining\" -> xi-ning, not xin-*ing\n\t\t\t\t\t * - \"danao\" -> da-nao, not dan-ao (Pinyin \"dan'ao\") */\n\t\t\t\t\t// TODO optimization: process two syllables in one go?\n\n\t\t\t\t\tif (chars[nextcursor-1].match(/[ng]/i)) {\n\t\t\t\t\t\tvar altcurr = { until: curr.until-1, ipa: find(root, chars.slice(cursor, nextcursor-1), 0) };\n\t\t\t\t\t\tvar altnext = munch(root, chars.slice(nextcursor-1), 0);\n\t\t\t\t\t\tif (altcurr.ipa && altnext.ipa && altnext.until > next.until) {\n\t\t\t\t\t\t\tcurr = altcurr; /* use the shorter alternative */\n\t\t\t\t\t\t\tnext = altnext;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tvar content = curr.ipa;\n\n\t\t\t\t\t/* Treat isolated -r as erhua-r */\n\t\t\t\t\tif (next.until === 1 && chars[nextcursor] === 'r') {\n\t\t\t\t\t\tcontent += \"ɻ\";\n\t\t\t\t\t\tcontent = content.replace(/[nŋ]ɻ$/i, \"\\u0303ɻ\");\n\t\t\t\t\t\tcurr.until++;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Tone mark */\n\t\t\t\t\tvar nextchar = chars[cursor+curr.until];\n\t\t\t\t\tif (nextchar && nextchar.match(/[1-4]/)) {\n\t\t\t\t\t\tcontent += tones[parseInt(nextchar)];\n\t\t\t\t\t\tcurr.until++;\n\t\t\t\t\t}\n\n\t\t\t\t\tcreatePinyinElement(phon, 'pinyin', content);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcursor += curr.until || 1;\n\t\t}\n\n\t}", "function processSentence(name,age,alamat,hobby){\n return 'Nama saya ' + name + ', umur saya ' + age + ' tahun' + ', alamat saya di ' + alamat + ', dan saya punya hobby yaitu ' + hobby + ' !' \n }", "function convertToScreaming(phrase){\n return `${phrase.toUpperCase()}!!!!!!!!!!!!!!!!!!!!`\n}", "function mustpraise(s){\n //Praise makes people more handsome\n var changeCount = 0\n var toUpper = false\n var pos\n var c = s.replace(/\\b(?:evil|greedy|ugly|shameless|obscene|obese)/ig, function(match,index) {\n changeCount++\n pos = index\n if(match.charCodeAt(0) < 97) {\n toUpper = true\n return 'HANDSOME'\n } else {\n return 'handsome'\n }\n }).replace(/\\bhate/ig, function(match) {\n if(match.charCodeAt(0) < 97 || toUpper) {\n return 'PRAISE'\n } else {\n return 'praise'\n }\n })\n if(c.length < 50 && changeCount === 0) {\n c += ' The handsome myjinxin, we praise him!!!!'\n } else if(c.length < 50) {\n var up = toUpper === true ? 'VERY ' : 'very '\n while(c.length < 50) {\n c = c.substring(0, pos) + up + c.substring(pos)\n }\n }\n return c\n}", "function panjang (str) {\n let hasil = ''\n //let b = options.length;\n for(let i=0; i< b; i++) {\n hasil += randomStr(str)[i]\n }\n return hasil;\n }", "function mondatSzam(){\n let szoveg = '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 let mondatSzamlalo = 0;\n for(i = 0; i<=szoveg.length-1; i++) {\n if(szoveg[i] == '?' || szoveg[i] == '.' || szoveg[i] == '!') {\n mondatSzamlalo++;\n }\n }\n if (mondatSzamlalo > 1) {\n return 'Több mondat';\n } else {\n return 'Egy mondat';\n }\n}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,g){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "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 t(e,t,i,n){switch(i){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function getStopWords() {\n return [\"a\", \"able\", \"about\", \"across\", \"after\", \"all\", \"almost\", \"also\", \"am\", \"among\", \"an\", \"and\", \"any\", \"are\", \"as\", \"at\", \"be\", \"because\", \"been\", \"but\", \"by\", \"can\", \"cannot\", \"could\", \"dear\", \"did\", \"do\", \"does\", \"either\", \"else\", \"ever\", \"every\", \"for\", \"from\", \"get\", \"got\", \"had\", \"has\", \"have\", \"he\", \"her\", \"hers\", \"him\", \"his\", \"how\", \"however\", \"i\", \"if\", \"in\", \"into\", \"is\", \"it\", \"its\", \"just\", \"least\", \"let\", \"like\", \"likely\", \"may\", \"me\", \"might\", \"most\", \"must\", \"my\", \"neither\", \"no\", \"nor\", \"not\", \"of\", \"off\", \"often\", \"on\", \"only\", \"or\", \"other\", \"our\", \"own\", \"rather\", \"said\", \"say\", \"says\", \"she\", \"should\", \"since\", \"so\", \"some\", \"than\", \"that\", \"the\", \"their\", \"them\", \"then\", \"there\", \"these\", \"they\", \"this\", \"tis\", \"to\", \"too\", \"twas\", \"us\", \"wants\", \"was\", \"we\", \"were\", \"what\", \"when\", \"where\", \"which\", \"while\", \"who\", \"whom\", \"why\", \"will\", \"with\", \"would\", \"yet\", \"you\", \"your\", \"ain't\", \"aren't\", \"can't\", \"could've\", \"couldn't\", \"didn't\", \"doesn't\", \"don't\", \"hasn't\", \"he'd\", \"he'll\", \"he's\", \"how'd\", \"how'll\", \"how's\", \"i'd\", \"i'll\", \"i'm\", \"i've\", \"isn't\", \"it's\", \"might've\", \"mightn't\", \"must've\", \"mustn't\", \"shan't\", \"she'd\", \"she'll\", \"she's\", \"should've\", \"shouldn't\", \"that'll\", \"that's\", \"there's\", \"they'd\", \"they'll\", \"they're\", \"they've\", \"wasn't\", \"we'd\", \"we'll\", \"we're\", \"weren't\", \"what'd\", \"what's\", \"when'd\", \"when'll\", \"when's\", \"where'd\", \"where'll\", \"where's\", \"who'd\", \"who'll\", \"who's\", \"why'd\", \"why'll\", \"why's\", \"won't\", \"would've\", \"wouldn't\", \"you'd\", \"you'll\", \"you're\", \"you've\", \"pg\", \"http://www.gutenberg.com\", \"http://www.gutenberg.org\", \"http://www.gutenberg.net\"];\n}", "function translatePigLatin(str){\n if(str.search(/[aeiou]/)==0){\n console.log(str+\"way\");\n return str+\"way\";\n }else{\n \n consonants = str.substr(0,str.search(/[aeiou]/));\n start = str.substr(str.search(/[aeiou]/));\n console.log(consonants);\n console.log(start);\n console.log( start + consonants +\"ay\");\n return start + consonants +\"ay\";\n\n }\n\n}", "static spongebobMemeify(text, acknowledge) {\n let split = text.split('');\n if (acknowledge && acknowledge.length && text.startsWith(acknowledge)) split.splice(0,acknowledge.length);\n return split.map((char, index) => {\n if (index % 2 === 0) return char.toLowerCase();\n else return char.toUpperCase();\n }).join('');\n }", "function vogal(frase) {\n var size = frase.length;\n var soma = 0;\n for (i = 0; i < size; i++) {\n if (frase[i] == 'a' || frase[i] == 'e' || frase[i] == 'i' || frase[i] == 'o' || frase[i] == 'u') {\n soma += 1;\n }\n }\n return soma;\n}", "function t(e,t,a,n){switch(a){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,a,n){switch(a){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function tongues(code) {\n var alpha = 'aiyeoubkxznhdcwgpvjqtsrlmf';\n var repl = 'eouaiypvjqtsrlmfbkxznhdcwg';\n \n return code.replace(/[a-z]/gi, function(m) {\n var lower = m.toLowerCase();\n return lower === m ? repl[alpha.indexOf(m)] : repl[alpha.indexOf(lower)].toUpperCase();\n });\n}", "function Skynet(query) {\n\n// on passe par les mots clés\n\n query1=query.replace(new RegExp(\"\\\\b\" + \"de\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"des\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"la\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"les\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"le\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"l'\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"au\" + \"\\\\b\",\"gi\"),\"\");\n//var query1=query1.replace(new RegExp(\"\\\\b\" + \"à\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"du\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"aux\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"un\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"une\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"d'\" + \"\\\\b\",\"gi\"),\"\");\nconsole.log('la phrase traitée : '+query1);\n\nmatch=query.search()\n\n\nif (query1.search(\"vidéos\") >-1){\n query22 = query1.search(\"vidéos\");\n query23 = query1.length;\n for (i = (query22+6); i < query23 ;i++){reponse=reponse+(query1[i]);}\n if (debug==\"on\"){speaking=\"mots clés trouvé video\"}else{speaking=\"\"}\n ScribeSpeak(speaking,function(){reponse=reponse.trim();reponse=reponse.replace(new RegExp(\" \",\"gi\"),\"+\");\n \n reponse=reponse.replace(new RegExp(' ', 'ig'),\"+\")\n var proc = 'start chrome --new-window https://www.youtube.com/results?search_query='+ reponse;\n //console.log(proc)\n exec(proc)\n // process1 = '%CD%/plugins/cortana/bin/searchyoutube.vbs ' + reponse ; exec(process1)\n })\n callback({'tts': \"\"})\n return false\n}\n\nif (query1.search(\"vidéo\") >-1){\n query22 = query1.search(\"vidéo\");\n query23 = query1.length;\n for (i = (query22+5); i < query23 ;i++){reponse=reponse+(query1[i]);}\n if (debug==\"on\"){speaking=\"mots clés trouvé vidéo\"}else{speaking=\"\"}\n ScribeSpeak(speaking,function(){reponse=reponse.trim();reponse=reponse.replace(new RegExp(\" \",\"gi\"),\"+\")\n var proc = 'start chrome --new-window https://www.youtube.com/results?search_query='+ reponse;\n //console.log(proc)\n exec(proc)\n // process1 = '%CD%/plugins/cortana/bin/searchyoutube.vbs ' + reponse ; exec(process1)\n })\n callback({'tts': \"\"})\n return false\n}\n//https://www.google.fr/search?q=Louane\n//https://www.google.fr/search?q=louane&tbm=isch\nif (query1.search(\"images\") >-1){ \n query22 = query1.search(\"images\");\n query23 = query1.length;\n for (i = (query22+6); i < query23 ;i++){reponse=reponse+(query1[i]);}\n if (debug==\"on\"){speaking=\"mots clés trouvé image\"}else{speaking=\"\"}\n ScribeSpeak(speaking,function(){reponse=reponse.trim()\n process1 = '%CD%/plugins/cortana/bin/searchimages.vbs ' + reponse ; exec(process1);//console.log(process1)\n })\n callback({'tts': \"\"})\nreturn false\n}\n\nif (query1.search(\"image\") >-1){ \n query22 = query1.search(\"image\");\n query23 = query1.length;\n for (i = (query22+5); i < query23 ;i++){reponse=reponse+(query1[i]);}\n if (debug==\"on\"){speaking=\"mots clés trouvé image\"}else{speaking=\"\"}\n ScribeSpeak(speaking,function(){reponse=reponse.trim()\n process1 = '%CD%/plugins/cortana/bin/searchimages.vbs ' + reponse ; exec(process1)\n })\n callback({'tts': \"\"})\nreturn false\n}\n\n\nif (query1.search(\"courses\") >-1){\n query22 = query1.search(\"courses\");\n query23 = query1.length;\n for (i = (query22+8); i < query23 ;i++){reponse=reponse+(query1[i]);}\n if (reponse==\"\"){reponse=\"false\"}\n if (debug==\"on\"){speaking=\"mots clés trouvé courses\"}else{speaking=\"\"}\n //ScribeSpeak(speaking,function(){\n SARAH.run('coursesmathilde', { 'item' : reponse});//callback({'tts' : \"\"});\n //})\n callback({'tts': \"\"})\nreturn false\n }\n\n\nif (query1.search(\"réveil\") >-1){\n query22 = query1.search(\"réveil\");\n query23 = query1.length;\n for (i = (query22+4); i < query23 ;i++){reponse=reponse+(query1[i]);}\n\n reponse=reponse.replace(new RegExp('[^0-9]', 'ig'),\"\")\n if(reponse==\"\"){match3(query);return false\n var date = new Date();\n var heure =date.getHours();\n var minute =date.getMinutes();\n reponse=heure+''+minute\n query=heure+' '+minute\n console.log(reponse)\n console.log('immédiat');\n }//fin if reponse=''\n // protection 24 heure et 59 minutes !!!\n\nif(reponse.length==1){tempsreveil=reponse*3600000}// que heure//8h\nif(reponse.length==2){tempsreveil=reponse*3600000} //que heure//18h\n \n if(reponse.length==3){temp=reponse[0]*3600000;\n tempsreveil=temp;//console.log(temp)\n temp=reponse-reponse[0]*100;//console.log(temp)\n temp=temp*60000;//console.log(temp)\n tempsreveil=tempsreveil+temp\n } // 1 heure + 2 minutes//1h18\n \n if(reponse.length==4){temp=reponse[0]*36000000+reponse[1]*3600000\n tempsreveil=temp;//console.log(temp)\n temp=reponse-reponse[0]*1000;//console.log(temp)\n temp1=reponse[1]*100;//console.log('rr'+temp1)\n temp=temp-temp1;//console.log('r'+temp)\n temp=temp*60000;//console.log(temp)\n tempsreveil=tempsreveil+temp\n }// 2 heure + 2 minutes \n\nreponse1=query\nreponse1=(reponse1.replace(new RegExp('[^0-9]', 'ig'),\" \")).trim()\n\n console.log('la reponse envoyer à révéil1 '+reponse1+' '+tempsreveil)\n ScribeSpeak(\"réveil programmé à \"+reponse1.replace(\" \",\" heure \"),function(){\n SARAH.run('reveil1', { 'tempsreveil' : tempsreveil , 'tempsreveilname' : reponse1});//callback({'tts' : \"\"});\n })\n callback({'tts': \"\"})\n return false\n}\n// si pas de mots clé direction match3 !!!!!\n\nif(reponse==\"\"){\n if (debug==\"on\"){speaking=\"je n'ai pas trouvé de mots clés\"}else{speaking=\"\"}\n ScribeSpeak(speaking,function(){\n match3(query)\n reponse=\"eee\"\n })//fin speak\n}//fin if\ncallback({'tts': \"\"})\nreturn false\n}//fin funtion Skynet", "function toTitleCase(x) {\n var smalls = [];\n var articles = [\"A\", \"An\", \"The\"].forEach(function(d){ smalls.push(d); })\n var conjunctions = [\"And\", \"But\", \"Or\", \"Nor\", \"So\"].forEach(function(d){ smalls.push(d); })\n var prepositions = [\"As\", \"At\", \"By\", \"Into\", \"It\", \"In\", \"For\", \"From\", \"Of\", \"Onto\", \"On\", \"Out\", \"Per\", \"To\", \"Up\", \"Upon\", \"With\"].forEach(function(d){ smalls.push(d); });\n \n x = x.split(\"\").reverse().join(\"\") + \" \"\n\n x = x.replace(/['\"]?[a-z]['\"]?(?= )/g, function(match){return match.toUpperCase();})\n\n x = x.split(\"\").slice(0, -1).reverse().join(\"\")\n\n x = x.replace(/ .*?(?= )/g, function(match){\n if(smalls.indexOf(match.substr(1)) !== -1)\n return match.toLowerCase()\n return match\n })\n\n x = x.replace(/: .*?(?= )/g, function(match){return match.toUpperCase()})\n\n //smalls at the start of sentences shouldbe capitals. Also includes when the sentence ends with an abbreviation.\n x = x.replace(/(([^\\.]\\w\\. )|(\\.[\\w]*?\\.\\. )).*?(?=[ \\.])/g, function(match) {\n var word = match.split(\" \")[1]\n var letters = word.split(\"\");\n\n letters[0] = letters[0].toUpperCase();\n word = letters.join(\"\");\n\n if(smalls.indexOf(word) !== -1) {\n return match.split(\" \")[0] + \" \" + word;\n }\n\n return match\n })\n \n return x\n }", "function qtpiLetter()\n {\n var pLeft = '<p style=\"text-align: left\">'\n var pCenter = '<p style=\"text-align: center\">'\n var pRight = '<p style=\"text-align: right\">'\n var pEnd = '</p>'\n\n var d = new Date()\n var meridiem = d.getHours() < 12 ? 'a.m.' : 'p.m.'\n\n if (d.getMinutes() == 14 && (d.getHours() == 3 ||\n d.getHours() == 15)) {\n\n return pLeft + 'Cutie Pai,' + pEnd + pCenter +\n 'Happy <big style=\"font-family: serif\">&pi;</big> ' +\n meridiem + pEnd + pRight + '&mdash; Susam' + pEnd\n }\n\n var letters = [\n pLeft + 'Cutie Pai,' + pEnd + pCenter +\n 'I <span style=\"color: #f52887; font-size: 110%\">&#x2764;' +\n '</span> U!' + pEnd + pRight + '&mdash; Susam' + pEnd,\n\n pLeft + 'Cutie Pai,' + pEnd + pCenter +\n 'I <span style=\"color: #f52887; font-size: 130%\">&hearts;' +\n '</span> U!' + pEnd + pRight + '&mdash; Susam' + pEnd,\n\n pLeft + 'Cutie Pai,' + pEnd + pCenter +\n 'I love you! <span style=\"color: #f52887;\">' +\n '<span style=\"font-size: 60%\">&hearts;</span>' +\n '<span style=\"font-size: 100%\">&hearts;</span></span>' +\n pEnd + pRight + '&mdash; Susam' + pEnd,\n\n pLeft + 'Cutie Pai,' + pEnd + pLeft +\n 'Your smile is the most beautiful thing in the ' +\n 'world to me. <big style=\"color: #a53364\">&#x263a;</big>' +\n pEnd + pRight + '&mdash; Susam' + pEnd,\n\n pLeft + 'Cutie Pai,' + pEnd + pLeft +\n 'Do you know why I got the tiny wine glass for you at ' +\n 'Purple Haze?' + pEnd + pLeft +\n 'Because I can go to any length to see you smile.' +\n pEnd + pRight + '&mdash; Susam' + pEnd,\n\n pLeft + 'Cutie Pai,' + pEnd + pCenter +\n 'You make me want to be a better person.' +\n pEnd + pRight + '&mdash; Susam' + pEnd\n ]\n\n return Util.random(letters)\n }", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "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 jadenCase(str)\n{\n let tab = str.split(\" \");\n let chaine = \"\";\n let max = tab.length;\n for(let i=0; i<max; i++)\n if(i===max-1)\n chaine += mettreMaj(tab[i]);\n else\n chaine += mettreMaj(tab[i])+\" \";\n return chaine;\n}", "function ejercicio02(email){\nvar longitud = email.length;\nvar mayusc = email.toUpperCase();\ncont = 0;\nvar no = \"\";\n\nfor (i=0 ; i<=longitud ; i++)\n{ \n if(email.charAt(i) == \"m\" || email.charAt(i) == \"M\")\n {\n cont++;\n }\n}\nif (cont == 0)\n{\n cont = toString(cont)\n cont = \"ninguna\";\n no = \"no\";\n}\nreturn \"El correo\" + email + \"tiene\" + longitud + \"caracteres y en mayúsculas se quedaría así\" + mayusc + \". Además \" + no + \" contiene \" + cont + \" letras M\";\n\n}", "function spinWords(str) {\n let data = str.split(' ');\n for (let k in data) {\n let v = data[k];\n if (v.length >= 5) {\n data[k] = v.split('').reverse().join('');\n }\n }\n return data.join(' ');\n}", "function processSentence(){\n return 'Nama saya ' + name +', umur saya '+ age +' tahun, alamat saya di ' +address +', dan saya punya hobby yaitu '+ hobby\n}" ]
[ "0.6406276", "0.63711166", "0.6283341", "0.62722623", "0.62353146", "0.61643136", "0.616315", "0.61528623", "0.61244655", "0.610988", "0.60867757", "0.60842997", "0.60559535", "0.6049792", "0.60306925", "0.6026636", "0.6022585", "0.6002819", "0.5985346", "0.59784126", "0.5958943", "0.59564054", "0.59507644", "0.5950203", "0.593994", "0.593601", "0.59293085", "0.5922738", "0.5916866", "0.58931947", "0.5892195", "0.58723545", "0.58719987", "0.5869558", "0.58694136", "0.58484703", "0.5840657", "0.5837688", "0.5832768", "0.5832072", "0.5822814", "0.58227545", "0.58199394", "0.5819551", "0.58129746", "0.580822", "0.58057857", "0.580354", "0.58019394", "0.57969624", "0.57926327", "0.57926327", "0.57926327", "0.57926327", "0.57926327", "0.57926327", "0.57926327", "0.57926327", "0.57926327", "0.57926327", "0.57926327", "0.57926327", "0.57926327", "0.5791638", "0.57908505", "0.5789969", "0.57876015", "0.5787504", "0.5787272", "0.57812035", "0.5780708", "0.5780708", "0.5779879", "0.57779825", "0.5773133", "0.5767922", "0.5761606", "0.5761606", "0.5761606", "0.5761606", "0.5761606", "0.5761606", "0.5761606", "0.5761606", "0.5761606", "0.5761606", "0.5761606", "0.5761606", "0.5761606", "0.5761606", "0.5761606", "0.5761606", "0.5761606", "0.5761606", "0.5761606", "0.5761606", "0.57606834", "0.57551634", "0.5753467", "0.5752574", "0.57495916" ]
0.0
-1
Callback called each time the browser wants us to draw another frame
function render(time) { // Clear color and depth buffers gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); // Place Camera mat4.identity(Matrices.view); mat4.lookAt(vec3.create([ camX, camY, camZ ]), vec3.create([ lookAtX, lookAtY, lookAtZ ]), vec3.create([ 0, 1, 0 ]), Matrices.view); // Clear model matrix mat4.identity(Matrices.model); // set phong to be the active program gl.useProgram(phongProgram); // compute all derived matrices (normal, viewModel, PVM) Matrices.compDerived(); // set matrices gl.uniformMatrix4fv(phongProgram.uniforms["uMat4ViewModel"], false, Matrices.getVM()); gl.uniformMatrix3fv(phongProgram.uniforms["uMat3Normal"], false, Matrices .getN()); gl.uniformMatrix4fv(phongProgram.uniforms["uMat4PVM"], false, Matrices .getPVM()); // set the light direction uniform var uVec3LightDir = [ 1.0, 0.5, 1.0, 0.0 ]; var res2 = vec3.create(); mat4.multiplyVec4(Matrices.getVM(), uVec3LightDir, res2); vec3.normalize(res2); gl.uniform3fv(phongProgram.uniforms["uVec3LightDir"], res2); myAxis.render(); // set the textured phong program as active gl.useProgram(phongTexProgram); // set the matrices gl.uniformMatrix4fv(phongTexProgram.uniforms["uMat4PVM"], false, Matrices .getPVM()); gl.uniformMatrix4fv(phongTexProgram.uniforms["uMat4ViewModel"], false, Matrices.getVM()); gl.uniformMatrix3fv(phongTexProgram.uniforms["uMat3Normal"], false, Matrices.getN()); // set the light dir gl.uniform3fv(phongTexProgram.uniforms["uVec3LightDir"], res2); // render the loaded model // note: if the model has no texture use phongProgram instead myModel.render(); // set the color program as active gl.useProgram(colorProgram); // set the matrix gl.uniformMatrix4fv(colorProgram.uniforms["uMat4PVM"], false, Matrices .getPVM()); // render the grid myGrid.render(); updateLookAtMdl(); pipes.render(); // just checking checkError(); // Send the commands to WebGL gl.flush(); // Request another frame window.requestAnimFrame(render, canvas); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawFrame() {\n\tif (drawNext) {\n\t\trenderFrame();\n\t\tdrawNext = false;\n\t}\n}", "updateFrame() {\n this._drawFrame();\n }", "function drawNextFrame() {\n\tdrawNext = true;\n}", "function do_frame() {\n\t\t\tupdate_stats();\n\t\t\tif(!call_user_callbacks()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tupdate();\n\t\t\tdraw();\n\n\t\t\tmedeactx.frame_flags = 0;\n\t\t}", "function onFrame() \n{\n\tupdate();\n}", "function start(){ frameID = window.requestAnimationFrame(draw); }", "function drawFrame() {\n context.fillRect(0, 0, canvas.width, canvas.height);\n context.fillStyle = \"#e8eaec\";\n }", "function tick() {\n requestAnimFrame(tick);\t//Funktion des Scripts 'webgl-utils.js': Aktualisiert Seite Browser-unabhaengig (nur wenn Tab aktiv)\n drawScene();\t\t\t//Zeichne neues Bild\n animate();\n\n }", "function updateFrame() {\n // TODO: INSERT CODE TO UPDATE ANY OTHER DATA USED IN DRAWING A FRAME\n y += 0.3;\n if (y > 60) {\n y = -50;\n }\n frameNumber++;\n}", "function draw() {\n Gravity();\n Animation();\n FrameBorder(); \n FrameBorderCleaner();\n Controls();\n Interaction();\n}", "function forward(){\n if(curFrame <= frames.length-1)\n drawCurFrame();\n}", "function drawFrame() {\n // Draw background and a border\n\n mycanvas.drawRect({\n fillStyle: '#d0d0d0',\n x: 0, y: 0,\n fromCenter: false,\n width: $(mycanvas)[0].width,\n height: $(mycanvas)[0].height\n });\n \n mycanvas.drawRect({\n fillStyle: '#e8eaec',\n x: 1, y: 1,\n fromCenter: false,\n width: $(mycanvas)[0].width-2,\n height: $(mycanvas)[0].height-2\n \n \n });\n// Draw header\n// mycanvas.drawRect({\n// fillStyle: '#303030',\n// x: 0, y: 0,\n// fromCenter: false,\n// width: $(mycanvas)[0].width,\n// height: 65,\n// \n// \n// });\n// \n // Draw title\n// mycanvas.drawText({\n// fillStyle: \"#ffffff\",\n// fontFamily: 'Verdana',\n// text: \"Match3 Example - Rembound.com\", \n// fontSize: 24,\n// x:220,y:15, \n// });\n \n \n // Display fps\n \n// mycanvas.drawText({\n// fillStyle: \"#ffffff\",\n// fontFamily: 'Verdana',\n// text: \"Fps \" + fps, \n// fontSize: 18,\n// x:45,y:50, \n// });\n\n \n }", "function refreshFrame(){\n ctx.clearRect(0,0,480,360);\n}", "beginFrame() { }", "function drawFrame() {\n // Reset background\n gl.clearColor(1, 1, 1, 1);\n gl.enable(gl.DEPTH_TEST);\n gl.clear(gl.COLOR_BUFFER_BIT);\n gl.viewport(0, 0, canvas.width, canvas.height);\n\n // Bind needle speeds\n // Draw Elements!\n // Topmost code is shown at the front! \n drawVertex(canvas, shaderProgram, gl.TRIANGLES, tri, indices, black);\n\n window.requestAnimationFrame(drawFrame);\n }", "function drawFrame(perc) {\n background(backColor);\n}", "function tick() {\r\n requestAnimFrame(tick);\r\n draw();\r\n}", "function trackFrameEnd(){\n}", "frame() {\n this.display();\n this.move();\n this.edgeCheck();\n }", "function updateFrame() {\n\tarthur.currentFrame = ++arthur.currentFrame % arthur.colums;\n\tarthur.srcX = arthur.currentFrame * arthur.width;\n\tarthur.srcY = 0;\n\tcontext.clearRect(arthur.x, arthur.y, 64, 64);\n\n\t// if (myModule.newZombie.isCrashed) {\n\t// \tarthur.die = true;\n\t// \tconsole.log(arthur.die);\n\t// }\n}", "function drawHiringEvent() {\n drawHiringRect();\n //NOT DONE\n\n \n}", "_drawFrame() {\n let rect = this._chartLayout.canvasPlotAreaRect;\n let frameL = rect.left - 1;\n let frameR = rect.right;\n let frameT = rect.top;\n let frameB = rect.bottom - 1;\n\n this._setColor(this.displayOptions.plotArea.backColor);\n this._context.fillRect(rect.left, rect.top, rect.width, rect.height);\n\n this._setColor(this.displayOptions.plotArea.frameColor);\n this._drawLine(frameL, frameT, frameL, frameB);\n this._drawLine(frameR, frameT, frameR, frameB);\n this._drawLine(frameL, frameT, frameR, frameT);\n this._drawLine(frameL, frameB, frameR, frameB);\n }", "function runTimeFrame() {\n g.beginPath();\n evolve();\n draw();\n g.stroke();\n }", "function draw() {\n\t\t\t// Adjust render settings if we switched to multiple viewports or vice versa\n\t\t\tif (medeactx.frame_flags & medeactx.FRAME_VIEWPORT_UPDATED) {\n\t\t\t\tif (medeactx.GetEnabledViewportCount()>1) {\n\t\t\t\t\tmedeactx.gl.enable(medeactx.gl.SCISSOR_TEST);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmedeactx.gl.disable(medeactx.gl.SCISSOR_TEST);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Perform rendering\n\t\t\tvar viewports = medeactx.GetViewports();\n\t\t\tfor(var vn = 0; vn < viewports.length; ++vn) {\n\t\t\t\tviewports[vn].Render(medeactx,dtime);\n\t\t\t}\n\t\t}", "function animate() {\n\treqAnimFrame(animate);\n\tcanvasDraw();\n}", "onImageLoad() {\n this.cacheFrameReady = true;\n this.drawCurrentFrame();\n }", "function tick() {\n requestAnimFrame(tick);\n draw();\n}", "function tick() {\n requestAnimFrame(tick);\n draw();\n}", "function draw(){\t\n\trequestAnimationFrame(draw); //allows for maximum use of the hardwares potential\n}", "animationFrame() {\n requestAnimationFrame(this.animationFrame.bind(this));\n if (this.switchDrawJoints) {\n GlobalVars.animationFrameCount++;\n this.drawBodyJoints();\n }\n\n }", "_drawFrame () {\n \n\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)\n for (let x = 0; x < this.sizeX; x++) {\n for (let y = 0; y < this.sizeY; y++) {\n if (this.matrix[x][y] === -1) {\n this._drawBackgroundSquare(x, y, this.tileWidth, this.deathTileColor)\n this.matrix[x][y] = 0\n } else if (this.matrix[x][y] === 1) {\n this._drawSquare(x, y, this.tileWidth, this.tileColor)\n }\n }\n }\n this._drawMouse()\n }", "function drawFrame() {\n // Draw background and a border\n context.fillStyle = \"#d0d0d0\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n context.fillStyle = \"#e8eaec\";\n context.fillRect(1, 1, canvas.width-2, canvas.height-2);\n \n // Draw header\n context.fillStyle = \"#303030\";\n context.fillRect(0, 0, canvas.width, 65);\n \n // Draw title\n context.fillStyle = \"#ffffff\";\n context.font = \"24px Verdana\";\n context.fillText(\"Match3 Example - Rembound.com\", 10, 30);\n \n // Display fps\n context.fillStyle = \"#ffffff\";\n context.font = \"12px Verdana\";\n context.fillText(\"Fps: \" + fps, 13, 50);\n }", "function animationLoop(){\n // Clear screen for re-draw\n context.fillStyle = backgroundColor;\n context.fillRect(0,0,canvas[0].width,canvas[0].height);\n // ** UPDATE AND RENDER ** //\n\n // prepare for next frame\n if(!visualization.meta.isActive){\n return;\n }\n Utility.setDelta();\n window.requestAnimationFrame(animationLoop);\n }", "function drawFrame(c, onupdate) {\n var $img, $frame, $panel;\n /* ie fix */\n onupdate = (typeof onupdate != 'undefined') ? true : false; \n\n if(onupdate)\n $frame = c.$item\n else {\n if(c.href){\n $frame = $('<a>')\n .attr('href',c.href)\n .css('display','block')\n .addClass('frame-link')\n }\n else {\n $frame = $(\"<div>\");\n }\n \n $frame\n .addClass(c.cssclass)\n //.css({top: -9999, left: -9999}) /* 2.1 */\n \n }\n \n // create a new hidden frame \n $frame.css({\n 'position': 'absolute',\n 'height':c.framehg,\n 'width':c.framewd \n })\n // if cloud effect, just draw a solid bg \n if(f.o.cloud) {\n \n if(!onupdate) {\n $panel = $('<div>')\n .addClass(c.cssclass)\n .addClass('fi-panel')\n } else {\n $panel = $('.fi-panel',c.$item)\n }\n \n $panel.css({'position': 'absolute',\n 'background': c.bordercolor,\n 'height': c.framehg,\n 'width': c.framewd,\n 'background': c.bordercolor,\n 'border-color': c.bordercolor,\n 'border-width': c.bordersize,\n 'border-style': 'solid',\n 'z-index':2 \n })\n \n $frame\n .css({ 'height': c.framehg+c.bordersize*2,\n 'width': c.framewd+c.bordersize*2,\n 'background': c.bordercolor\n })\n // creates an image over the frame background\n $img = drawFrameImg(c, onupdate)\n \n if(!onupdate)\n $frame.append($panel).append($img)\n \n }\n else {\n \n // if browser supports background-size\n // use this property\n if(f.bgszSupport) {\n \n $frame\n .css({ \n 'background': 'url('+c.src+') no-repeat', \n 'background-position': (c.offset.x + c.scrollx) + 'px ' + (c.offset.y + c.scrolly) + 'px',\n 'background-size': c.imgwd + 'px ' + c.imghg + 'px'\n })\n ;\n }\n else {\n // if not, emulate the property adding an extra image tag\n $img = (onupdate) ? $('img',c.$item) : $('<img/>');\n $img.attr({ \n 'src': c.src,\n 'width': c.imgwd,\n 'height': c.imghg \n })\n .css({ \n 'top': (c.offset.y + c.scrolly),\n 'left': (c.offset.x + c.scrollx),\n 'position': 'absolute'\n })\n\n $frame.css('overflow','hidden')\n\n if(!onupdate)\n $frame.append($img) \n }\n $frame.css({\n 'border-color': c.bordercolor,\n 'border-width': c.bordersize+'px',\n 'border-style': 'solid'\n })\n }\n\n if(c.tinybordersize > 0){\n $frame.css('box-shadow', '0 0 0 ' + c.tinybordersize + 'px ' + c.tinybordercolor)\n } \n\n // call the draw shadow function \n if(f.o.shadow || c.shadow)\n drawShadow(c, $frame, onupdate);\n // return the new div created representing the frame\n return (onupdate) ? onupdate : $frame.appendTo(f.$el); \n }", "function draw()\n{\n\tvar page = story.getCurrentPage();\n\n\tif(!page.isCorrectSize())\n\t{\n\t\twindowResized();\n\t}\n\n\tpage.draw();\n}", "function drawLoop() {\n\t\t\tif (pauseOverlay)\n\t\t\t\treturn;\n\t\t\trequestAnimFrame(drawLoop);\n\t\t\toverlay.getContext('2d').clearRect(0, 0, width, height);\n\t\t\tif (cl.getCurrentPosition()) {\n\t\t\t\tcl.draw(overlay);\n\t\t\t}\n//\t\t\t$(\"#microphone\").css(\"height\", \"0%\");\n//\t\t\t$(\"#microphone\").parent().css(\"background-color\",\n//\t\t\t\t\tgetColorForPercentage(1 - meter.volume));\n//\t\t\t$(\"#volume\").val(1 - meter.volume);\n\t\t}", "function loop() {\n draw();\n requestAnimFrame(loop);\n}", "function drawFrame(){\n\tvar ctx = animation.persist.ctx;\n\n\t// if continuous, keep looping via window.rAF, otherwise return current canvas for saving\n\tif (animation.continuous == true){\n\t\twindow.requestAnimationFrame(animation.draw);\n\t} else {\n\t\treturn ctx.canvas;\n\t}\n\n}", "function newFrame() {\n \n\n }", "function doFrame() {\r\n if(animating) {\r\n updateForFrame();\r\n controls.update();\r\n render();\r\n requestAnimationFrame(doFrame);\r\n }\r\n}", "function updateDraw(){\r\n //ToDo\r\n }", "function frame() {\n if (bottom < newBottom) {\n bottom = bottom + factorBottom\n side = side + factorSide\n elem.style.bottom = bottom + 'px';\n elem.style.right = side + 'px';\n clickable = false; // During the move, clickable is false so no card can be clicked during the movement\n } else {\n\t clearInterval(id);\n moveBack();\n }\n }", "function draw() {\r\n\tdrawTimer();\r\n\t//drawGratii();\r\n}", "function drawPrevFrames() {;\n\tfor (let i = player.prevPosition.length - 1; i >= 0; i--) {\n\t\tctx.globalAlpha = (0.3 / i) + 0.1;\n\t\tif (i % 3 === 2) {\n\t\t\tctx.strokeRect(player.prevPosition[i].x, player.prevPosition[i].y, player.width, player.height);\n\t\t}\n\t\tif (i > 0) {\n\t\t\tplayer.prevPosition[i].x = player.prevPosition[i - 1].x;\n\t\t\tplayer.prevPosition[i].y = player.prevPosition[i - 1].y;\n\t\t} else if ((player.x > scrollBound) && (player.x < (gameWidth / 2))) {\n\t\t\tplayer.prevPosition[i].x = player.x;\n\t\t\tplayer.prevPosition[i].y = player.y;\n\t\t} else {\n\t\t\tplayer.prevPosition[i].x = player.x - (player.xVelocity * (i + 1));\n\t\t\tplayer.prevPosition[i].y = player.y;\n\t\t\tfor (let i = player.prevPosition.length - 1; i >= 0; i--) {\n\t\t\t\tplayer.prevPosition[i].x = player.x - (player.xVelocity * (i + 1));\n\t\t\t}\n\t\t}\n\t}\n\tctx.globalAlpha = 1;\n}", "function frame () {\n\tmap.frame();\n}", "function frame(){\r\n\t\t \t\tupdate();\r\n\t\t \t\tcollides();\r\n\t\t \t\tdraw();\r\n\t\t \t\tloop = requestAnimationFrame(frame);\r\n\t\t \t}", "function frame(){\r\n\t\t \t\tupdate();\r\n\t\t \t\tcollides();\r\n\t\t \t\tdraw();\r\n\t\t \t\tloop = requestAnimationFrame(frame);\r\n\t\t \t}", "function drawTrial() {\n //render the frame\n ctx.fillStyle = backgroundColour;\n ctx.fillRect(0,0, 400, 400); //clear the background\n\n watch.draw(); //draw the watch (+ interaction area)\n G1.draw(displayG1, innerRatio);\n G2.draw(displayG2, midRatio);\n G3.draw(displayG3, ratio);\n\n //draw indicator\n indicator.draw();\n var isSelected = G1.poiSelected || G2.poiSelected || G3.poiSelected;\n indicator.update(isSelected);\n\n timingIndicator.draw();\n timingIndicator.update(true);\n}", "function newFrame() {\n drawScore();\n repositionSnake();\n repositionAndRedrawSnakeHead();\n checkBoundaries(snakeHead);\n drawObject(apple);\n snakeEatApple();\n checkSelf();\n snakeEatSelf();\n appleCheck();\n }", "function draw() {\n\t\tfor (var i = 0; i < loop.graphics.length; i++) {\n\t\t\tloop.graphics[i](graphics, 0.0);\n\t\t}\n\t}", "function redrawHelper() {\n var sec = (Date.now() - timeSinceLastFPS) / 1000;\n framesSinceLastFPS++;\n var fps = framesSinceLastFPS / sec;\n\n // recalculate FPS every half second for better accuracy.\n if (sec > 0.5) {\n timeSinceLastFPS = Date.now();\n framesSinceLastFPS = 0;\n p.__frameRate = fps;\n }\n\n p.frameCount++;\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}", "function update(){\n frames ++\n ctx.clearRect(0,0,canvas.width, canvas.height)\n bg.draw()\n dancer.draw()\n drawLetters()\n arrow1.draw() \n arrow2.draw()\n arrow3.draw()\n arrow4.draw()\n arrow5.draw()\n speakerScore.draw()\n dansometer.draw()\n deleteOldLetter()\n drawScore()\n chandeDansometer()\n}", "startDrawCycle() {\n\t\tif (this.run === false) return;\n\t\tthis.drawFrame(1);\n\n\t\traf(this.startDrawCycle.bind(this));\n\t}", "function nextFrame() {\r\n if (rot.inProgress) {\r\n advanceRotation();\r\n } else {\r\n if (mouse.down)\r\n nextFrameWithMouseDown();\r\n else\r\n nextFrameWithMouseUp();\r\n }\r\n }", "function update() {\n\t\t\n\t\t// Logic tick.\n\t\ttick();\n\t\t\n\t\t// Main drawing.\n\t\tif (graphicsDevice.beginFrame()) {\n\t\t\tgraphicsDevice.clear([0.067, 0.067, 0.067, 0.5], 1.0);\n\t\t\tdraw();\n\t\t\tgraphicsDevice.endFrame();\n\t\t}\n\t\t\n\t}", "function tick() {\r\n requestAnimFrame(tick);\r\n draw();\r\n animate();\r\n}", "function nextFrame() {\n _timeController.proposeNextFrame();\n }", "function drawFrame() {\n // Draw background and a border\n context.fillStyle = \"#d0d0d0\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n context.fillStyle = \"#e8eaec\";\n context.fillRect(1, 1, canvas.width-2, canvas.height-2);\n\n // Draw header\n context.fillStyle = \"#303030\";\n context.fillRect(0, 0, canvas.width, 65);\n\n // Draw title\n context.fillStyle = \"#ffffff\";\n context.font = \"24px Verdana\";\n context.fillText(\"Bouncy Square - Physikal\", 10, 30);\n\n // Display fps\n context.fillStyle = \"#ffffff\";\n context.font = \"12px Verdana\";\n context.fillText(\"Fps: \" + fps, 13, 50);\n }", "function update(){\n frames++\n ctx.clearRect(0,0,canvas.width, canvas.height)\n bg.draw()\n car.draw()\n drawObstacles()\n checkCarCollition()\n}", "update() {\r\n this.paint();\r\n }", "_frame () {\n this._drawFrame()\n if (!this.paused) {\n if (this.frameCount % 4 === 0) {\n this._updateGeneration()\n this.matrix = this.nextMatrix\n this.nextMatrix = this._createMatrix()\n this.counter.innerText = 'Generation: ' + this.generationNumber\n }\n }\n this.frameCount++\n requestAnimationFrame(this._frame)\n }", "function draw()//p5.js update loop\n{\n frame += 1;// increment frame count (exhaust frame buffer)\n \n if(frame % (frame_buffer - sSlider.value()) == 0){// update display once our frame buffer is exhausted\n manager.draw_grid();\n if(stats) show_stats();\n }\n}", "function draw() {\n \n\n \n}", "function animate() {\n requestAnimFrame(animate);\n game.background.draw();\n game.robot.move(); \n}", "function refresh() {\n if (self._refresh) {\n self._render();\n }\n callHook(self, 'nextFrame');\n requestAnimationFrame(refresh);\n }", "onVideoSeeked() {\n this.videoFrameReady = true;\n this.drawCurrentFrame();\n }", "function stepFrame() {\n\t\tnodes = updateNodes(normalizer, relWidth, relHeight, nodes);\n\t\tedges = updateEdges(nodes, edges);\n\t\tredrawOutput(ctx, nodes, edges);\n window.requestAnimationFrame(stepFrame);\n\t}", "function tick() {\n requestAnimFrame(tick);\n draw();\n animate();\n}", "function draw(){\n\t\t// Needed to comply with Tool Delegate design pattern\n\t}", "function draw() {\n if (!drawOnTop.checked) {\n clear();\n }\n // Handeling the Draw my self\n render();\n}", "function draw() {\n background(0);\n checkState();\n}", "function DK_DoFrame(){ /*DKLog(\"DK_ClearEvents(): not available for \"+DK_GetBrowser()+\"\\n\", DKWARN);*/ }", "function draw() {\n \n}", "function main()\n{\n // do all the initializations\n init();\n \n // create event listeners\n window.document.addEventListener('mouseup', onMouseUpWindow, false)\n document.getElementById(\"renderer\").addEventListener(\"mousedown\", onMouseDown, false);\n document.getElementById(\"renderer\").addEventListener(\"mousemove\", onMouseMove, false);\n document.getElementById(\"renderer\").addEventListener(\"mouseup\", onMouseUp, false);\n \n // render the first frame\n renderFrame();\n}", "function onFrame(event) {\n\tframePosition += (mousePos - framePosition) / 10;\n\tvar vector = (view.center - framePosition) / 10;\n\tmoveStars(vector * 3);\n\tmoveRainbow(vector, event);\n}", "function renderFrame() {\n\tclearFrame();\n\tfor (var key in world) {\n\t\tvar entity = world[key];\n\t\tif(entity.etype == 'card')\n\t\t{\n\t\t\tdrawCard(entity.num, entity.x, entity.y, entity.big);\n\t\t}\n\t\telse if(entity.etype == 'down')\n\t\t{\n\t\t\tvar img = document.getElementById(\"enterImage\");\n \t\tcontext.drawImage(img, entity.x - 52, entity.y - 52);\n\t\t}\n\t\telse if(entity.etype == 'up')\n\t\t{\n\t\t}\n\t}\n}", "function drawFrame(){\n\tdocument.getElementById(\"play-area\").focus();\n\t// draw over the previous frame\n\tctx.clearRect(0, 0, cw, ch);\t\n\t\n\t// draw the food\n\tctx.fillStyle = '#ff0000';\t// red\n\tctx.fillRect(snakeFood.x, snakeFood.y, snakeFoodSize, snakeFoodSize);\n\t\t\n\t// draw the snake, by going through the snakeBody array of snake objects which keeps track of where\n\t// each part of the snake's body has been\n\tvar i = 0;\n\tdo{\t\t\n\t\tif(i == 0){\t// the head of the snake will be a different colour than the rest of the body\n\t\t\tctx.fillStyle = '#0000ff';\t// blue\n\t\t\tctx.fillRect(snakeBody[i].x, snakeBody[i].y, snakeSize, snakeSize);\t\t\n\t\t}\n\t\telse if(i == 1){\n\t\t\tctx.fillStyle = '#00ffff';\t// light blue\n\t\t\tctx.fillRect(snakeBody[i].x, snakeBody[i].y, snakeSize, snakeSize);\n\t\t}\n\t\telse{\n\t\t\tctx.fillStyle = '#00ff00';\t// green\n\t\t\tctx.fillRect(snakeBody[i].x, snakeBody[i].y, snakeSize, snakeSize);\n\t\t}\n\t\ti++;\n\t}\n\twhile(i < snakeBody.length);\n\t\n\t// update the snake object's coordinates based on the last arrow key that was pressed\n\tmoveSnake();\n\t\n\t// check for collisions between the snake and a piece of food\n\tcheckFoodCollision();\n\t\n\t// check for collisions between the snake and the walls\n\tcheckWallCollision();\n\t\t\n\t// draw another frame\n\tif(resumeGame == true){\n\t\tvar timeout = setTimeout(function(){\n\t\t\twindow.requestAnimationFrame(drawFrame)\n\t\t}, 100);\t\t\n\t}\t\n}", "function draw()\n{\n \n}", "function newFrame() {\n //update position of game item for animation \nrepositionGameItem();\n//check for collision \n \n }", "function draw() {\r\n \r\n}", "draw() { }", "draw() { }", "draw() { }", "function drawFrame() {\n // Draw background and a border\n context.strokeStyle = \"#000000\";\n context.fillStyle = \"#d0d0d0\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n context.fillStyle = \"#e8eaec\";\n context.fillRect(1, 1, canvas.width-2, canvas.height-2);\n \n // Character container\n context.fillStyle = \"#ffffff\";\n context.fillRect(400, 75, 300, 370);\n if (score < (requiredscore/2)) {\n context.drawImage(status1, 400, 75, 300, 370);\n } else {\n context.drawImage(status2, 400, 75, 300, 370);\n }\n \n // Score bar\n context.lineWidth = 3;\n context.fillStyle = \"#ffffff\";\n roundRect(context, 80, 75, 270, 35, 15, true, true);\n \n // Moves left container\n circle(context, 50, 93, 17);\n \n // Draw moves remaining\n context.fillStyle = \"#003300\";\n context.font = \"20px Verdana\";\n context.fillText(movecount, 37, 100);\n \n if (scorechange > 0) {\n // Draw a speech bubble\n drawBubble(context, 500, 125, 90, 30, 5);\n context.fillStyle = \"#003300\";\n context.font = \"10px Verdana\";\n if (!successquote) {\n if (scorechange > 1) {\n successquote = getRandomFromArray(greatquotes);\n } else {\n successquote = getRandomFromArray(goodquotes);\n }\n }\n context.fillText(successquote, 510, 140);\n }\n \n context.lineWidth = 1;\n context.fillStyle = \"#00b300\";\n context.strokeStyle = \"#00b300\";\n // Draw score\n if (score >= requiredscore) {\n roundRect(context, 83, 78, 264, 29, 11, true, true);\n } else if (score > 0) {\n var scorewidth = (score/requiredscore)*(270-6);\n roundOnLeftRect(context, 83, 78, scorewidth, 29, 11, true, true);\n }\n }", "onNextFrame (callback) {\n setTimeout(() => window.requestAnimationFrame(callback), 0)\n }", "function endingPoint() {\n painting = false;\n ctx.beginPath();\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "startFrame() {\n // setup event listeners\n const listener = this.eventListenerIn.bind(this);\n this.canvas.addEventListener(this.EVENT_TYPE_CLICK, listener, false);\n this.canvas.addEventListener(this.EVENT_TYPE_KEYDOWN, listener, false);\n this.canvas.addEventListener(this.EVENT_TYPE_KEYUP, listener, false);\n this.canvas.addEventListener(this.EVENT_TYPE_MOUSEDOWN, listener, false);\n this.canvas.addEventListener(this.EVENT_TYPE_TOUCHSTART, listener, false);\n this.canvas.addEventListener(this.EVENT_TYPE_TOUCHMOVE, listener, false);\n this.canvas.addEventListener(this.EVENT_TYPE_TOUCHEND, listener, false);\n this.canvas.addEventListener(this.EVENT_TYPE_TOUCHCANCEL, listener, false);\n // schedule for update canvas\n requestAnimationFrame(this.drawFrame.bind(this));\n }", "function newFrame() {\n // update ball position\n updateBallPosition();\n updatePaddlePosition(paddle1);\n updatePaddlePosition(paddle2);\n\n // handle collisions\n handlePaddleCollision(paddle1);\n handlePaddleCollision(paddle2);\n handleWallBounces();\n checkForScore();\n\n // redraw objects\n redrawBall();\n redrawPaddles();\n }", "function draw() {}", "function draw() {}", "function update(){\n frames ++\n clearCanvas()\n generarLaPrimerArdilla()\n gusano.drawImage()\n pintarArdilla()\n checkColisionArdilla ()\n checkColisionMeta()\n goal.draw()\n\n }", "function endDraw() {\n draw = false;\n drawList = [];\n}", "draw(){\n }", "function renderCanvas() {\n\tframeCount++;\n\tif (frameCount < fCount) {\n\t\t// skips the drawing for this frame\n\t\trequestAnimationFrame(renderCanvas);\n\t\treturn;\n\t}\n\telse frameCount = 0;\n\n\tcontext.clearRect(0, 0, canvas.width, canvas.height);\n\t// context.fillStyle = \"#999999\";\n\t// context.fillRect(0,0,canvas.width,canvas.height);\n\n\t\n\n\tGhost.draw()\n\trequestAnimationFrame(renderCanvas);\n}", "animate(ctx){\n this.drawBackground(ctx);\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 main() {\n if(!running) {\n return;\n }\n\n var now = Date.now();\n var dt = (now - then) / 1000.0;\n\n//\tupdate(dt);\n render();\n\n then = now;\n requestAnimFrame(main);\n }" ]
[ "0.7760109", "0.7580041", "0.73641723", "0.73209244", "0.71848786", "0.689565", "0.68348217", "0.6790965", "0.67500705", "0.672943", "0.67133456", "0.67086744", "0.67030495", "0.6702168", "0.66678876", "0.66149336", "0.6596732", "0.65841633", "0.6573341", "0.65676135", "0.65282106", "0.6527018", "0.64958817", "0.6495466", "0.64783996", "0.64721066", "0.64626825", "0.64626825", "0.64602184", "0.64571923", "0.6434234", "0.6431753", "0.6412887", "0.6405543", "0.6398336", "0.6395065", "0.6361583", "0.6353435", "0.6352389", "0.6345786", "0.6341554", "0.6330541", "0.6328449", "0.63256717", "0.63204294", "0.6313447", "0.6313447", "0.63129586", "0.6305263", "0.6299134", "0.6294638", "0.62916785", "0.62897897", "0.6283988", "0.62803423", "0.6277029", "0.6274745", "0.6274579", "0.6264039", "0.6255837", "0.62479943", "0.6228451", "0.622748", "0.62234473", "0.62227255", "0.6217882", "0.62167853", "0.62135994", "0.62134564", "0.6210811", "0.6210753", "0.6206324", "0.6205253", "0.6204723", "0.61963487", "0.6190723", "0.6189706", "0.618728", "0.61823744", "0.6178822", "0.61764747", "0.6175887", "0.6175887", "0.6175887", "0.61725575", "0.6169277", "0.616785", "0.6165578", "0.6165578", "0.6165578", "0.61653554", "0.61644787", "0.6163545", "0.6163545", "0.6159461", "0.6143867", "0.61418676", "0.61306316", "0.61197525", "0.6119465", "0.6117796" ]
0.0
-1
Init GL settings, programs and models Called when we have the context
function init() { // init cam variables; spherical2Cartesian(); // set the viewport to be the whole canvas gl.viewport(0, 0, gl.desiredWidth, gl.desiredHeight); // projection matrix. mat4.perspective(45, gl.desiredWidth / gl.desiredHeight, 0.1, 1000, Matrices.proj); // Set the background clear color to gray. gl.clearColor(0.8, 0.8, 0.8, 1.0); // general gl settings gl.enable(gl.CULL_FACE); gl.enable(gl.DEPTH_TEST); // create the shader programs phongProgram = createProgram("phong_vs", "phong_fs", [ "aVec4Position", "aVec3Normal" ], [ "uMat4PVM", "uMat3Normal", "uMat4ViewModel", "uVec3LightDir", "uVec4Diffuse", "uVec4Specular", "uFloatShininess" ]); colorProgram = createProgram("color_vs", "color_fs", [ "aVec4Position" ], [ "uMat4PVM", "uVec4Diffuse" ]); phongTexProgram = createProgram("phong_texture_vs", "phong_texture_fs", [ "aVec4Position", "aVec3Normal", "aVec2TexCoord" ], [ "uMat4PVM", "uMat3Normal", "uMat4ViewModel", "uSamp2DTexID", "uVec3LightDir", "uVec4Diffuse", "uVec4Specular", "uFloatShininess" ]); // init the matrices Matrices.init(); // init the models for rendering var myGridMat = new Material(); myGridMat.diffuse = new Float32Array([ 1.0, 1.0, 1.0, 1.0 ]); myGrid = createGrid(1, 3, 12); myGrid.setMaterial(myGridMat); myAxis = createAxis(3); // just in case checkError(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n setupWorldCoordinates();\n gl.clearColor(0.1, 0.1, 0.1, 1);\n startLoop();\n}", "function initGL() {\n ctx.shaderProgram = loadAndCompileShaders(gl, 'shader/VertexShader.glsl',\n 'shader/FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpScene();\n\n gl.clearColor(renderSettings.viewPort.backgroundColor[0],\n renderSettings.viewPort.backgroundColor[1],\n renderSettings.viewPort.backgroundColor[2],\n renderSettings.viewPort.backgroundColor[3]);\n\n gl.frontFace(gl.CCW); // Defines the orientation of front-faces\n gl.cullFace(gl.BACK); // Defines which face should be culled\n gl.enable(gl.CULL_FACE); // Enables culling\n gl.enable(gl.DEPTH_TEST); // Enable z-test\n}", "function initGL() {\n ctx.shaderProgram = loadAndCompileShaders(gl, 'shader/VertexShader.glsl',\n 'shader/FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpScene();\n\n gl.clearColor(renderSettings.viewPort.backgroundColor[0],\n renderSettings.viewPort.backgroundColor[1],\n renderSettings.viewPort.backgroundColor[2],\n renderSettings.viewPort.backgroundColor[3]);\n\n gl.frontFace(gl.CCW); // Defines the orientation of front-faces\n gl.cullFace(gl.BACK); // Defines which face should be culled\n gl.enable(gl.CULL_FACE); // Enables culling\n gl.enable(gl.DEPTH_TEST); // Enable z-test\n}", "function init() {\n // Set the clear color to fully transparent black\n gl.clearColor(0.0, 0.0, 0.0, 0.0);\n \n gl.enable(gl.DEPTH_TEST);\n gl.depthMask(true);\n gl.disable(gl.BLEND);\n \n // Create the model-view matrix and projection matrix\n mvmat = mat4.create();\n projmat = mat4.create();\n nmat = mat3.create();\n \n // Create all buffer objects and reset their lengths\n vbo = gl.createBuffer();\n lineIndices = gl.createBuffer();\n triIndices = gl.createBuffer();\n vbo.length = 0;\n lineIndices.length = 0;\n \n // Initialize the shaders\n initShaders();\n \n // Reshape the canvas, and setup the viewport and projection\n reshape();\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n \n gl.clearColor(0, 0, 0, 1);\n}", "function initGL() {\r\n \"use strict\";\r\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\r\n setUpAttributesAndUniforms();\r\n setUpBuffers();\r\n gl.clearColor(1,0,0,0.5);\r\n}", "function initGL() {\n \n \"use strict\";\n\n // -- 1. Add shaders (load / compile)\n ctx.shaderProgram = loadAndCompileShaders(gl, \"VertexShader.glsl\", \"FragmentShader.glsl\");\n\n // -- 2. Assign attribute-index to context\n setUpAttributesAndUniforms();\n\n // -- 3. Setup buffers\n setUpBuffers();\n\n // -- 4. Set color ??\n gl.clearColor(0.4688,0.1512,0.0000,0.2725);\n\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n \n gl.clearColor(0.1, 0.1, 0.1, 1);\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(\n gl,\n \"VertexShader.glsl\",\n \"FragmentShader.glsl\"\n );\n setUpAttributesAndUniforms();\n setUpBuffers();\n\n gl.clearColor(0.8, 0.8, 0.8, 1);\n}", "initGL() {\n \"use strict\";\n this.ctx.shaderProgram = loadAndCompileShaders(\n this.gl,\n \"VertexShader.glsl\",\n \"FragmentShader.glsl\"\n );\n this.setUpAttributesAndUniforms();\n this.setUpShapes();\n\n // set the clear color here\n this.gl.clearColor(0.2, 0.2, 0.2, 1); //-> damit wird alles übermalen (erst wenn clear)\n\n // add more necessary commands here\n }", "function startup() {\n\n \"use strict\";\n var canvas = document.getElementById(\"myCanvas\");\n\n // -- 1. Create context from canvas\n gl = createGLContext(canvas);\n\n // -- 2. Initialize the GL object (global)\n initGL();\n\n // -- 3. Draw objects\n draw();\n\n}", "function init() {\r\n\t\tvar canvas = document.getElementById(\"gremlinCanvas\");\r\n try {\r\n\t\t _initGL(canvas);\r\n\t\t _initShaders();\r\n Audio.init();\r\n } catch (error) {\r\n throw error;\r\n }\r\n\t\t_gl.clearColor(0.0, 0.0, 0.0, 1.0);\r\n\t\t_gl.enable(_gl.DEPTH_TEST);\r\n\t}", "function init(gl, wgl) {\n initShaders(gl, wgl); // Setup the shader program and program info\n initModels(gl, wgl); // Build objects to be drawn and their buffers\n initLights(gl, wgl); // Setup lighting\n initGl(gl, wgl); // Setup gl properties\n}", "function runBeforeInit() {\n Device_1.default.Instance.init();\n DrawEngine_1.G_DrawEngine.init(Device_1.default.Instance.gl);\n ShaderFactory_1.G_ShaderFactory.init(Device_1.default.Instance.gl);\n BufferManager_1.G_BufferManager.init(Device_1.default.Instance.gl);\n ShaderCenter_1.G_ShaderCenter.init();\n LightCenter_1.G_LightCenter.init();\n LightModel_1.G_LightModel.init();\n UiSetting_1.G_UISetting.setUI();\n}", "async function init(){\n\t// retrieve shader using path\n\tvar path = window.location.pathname;\n\tvar page = path.split(\"/\").pop();\n\tbaseDir = window.location.href.replace(page, '');\n\tshaderDir = baseDir + \"shaders/\";\n\n\t// create canvas\n\tvar canvas = document.getElementById(\"c\");\n\tgl = canvas.getContext(\"webgl2\");\n\tconsole.log(gl);\n\tif (!gl) {\n\t\tdocument.write(\"GL context not opened\");\n\t\treturn;\n\t}\n\t\n\t// Loading the shaders and creating programs\n\tawait utils.loadFiles([shaderDir + 'texture_vs.vert', shaderDir + 'texture_fs.frag'], function (shaderText) {\n\t\t// compiles a shader and creates setters for attribs and uniforms\n\t\ttextureProgramInfo = twgl.createProgramInfo(gl, [shaderText[0], shaderText[1]], [\"a_position\", \"a_texcoord\", \"a_normal\"]);\n\t});\n\tawait utils.loadFiles([shaderDir + 'color_vs.vert', shaderDir + 'color_fs.frag'], function (shaderText) {\n\t\t// compiles a shader and creates setters for attribs and uniforms\n\t\tcolorProgramInfo = twgl.createProgramInfo(gl, [shaderText[0], shaderText[1]], [\"a_position\", \"a_normal\"]);\n\t});\n\n\t/*\n\t* Loading the obj models\n\t*/\n\tlet tailWrapper = new ObjectWrapper(baseDir + tailPath);\n\tlet bodyWrapper = new ObjectWrapper(baseDir + bodyPath);\n\tlet leftEyeWrapper = new ObjectWrapper(baseDir + eyePath);\n\tlet rightEyeWrapper = new ObjectWrapper(baseDir + eyePath);\n\tlet hoursClockhandWrapper = new ObjectWrapper(baseDir + hoursClockhandPath);\n\tlet minutesClockhandWrapper = new ObjectWrapper(baseDir + minutesClockhandPath);\n\t// Set the local matrix for each object and the program to draw them\n\ttailWrapper.setLocalMatrix(tailLocalMatrix).setProgramInfo(colorProgramInfo);\n\tbodyWrapper.setLocalMatrix(bodyLocalMatrix).setProgramInfo(textureProgramInfo);\n\tleftEyeWrapper.setLocalMatrix(leftEyeLocalMatrix).setProgramInfo(textureProgramInfo);\n\trightEyeWrapper.setLocalMatrix(rightEyeLocalMatrix).setProgramInfo(textureProgramInfo);\n\thoursClockhandWrapper.setLocalMatrix(clockHand2LocalMatrix).setProgramInfo(colorProgramInfo);\n\tminutesClockhandWrapper.setLocalMatrix(clockHand1LocalMatrix).setProgramInfo(colorProgramInfo);\n\n\t// Save each object wrapper in a unique array of objects to draw\n\tobj = [tailWrapper, leftEyeWrapper, rightEyeWrapper, bodyWrapper, hoursClockhandWrapper, minutesClockhandWrapper];\n\n\tobj.forEach(async (wrapper) => { await wrapper.loadModel(); });\n\n\twindow.addEventListener(\"keydown\", keyFunctionDown, false);\n\n\tresetShaderParams();\n\tmain();\n}", "function startup() {\n \"use strict\";\n var canvas = document.getElementById(\"myCanvas\");\n gl = createGLContext(canvas);\n initGL();\n HP();\n draw();\n}", "function startup() {\n \"use strict\";\n var canvas = document.getElementById(\"myCanvas\");\n gl = createGLContext(canvas);\n initGL();\n draw();\n}", "function startup() {\n \"use strict\";\n var canvas = document.getElementById(\"myCanvas\");\n gl = createGLContext(canvas);\n initGL();\n draw();\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n light = vec4.fromValues(0.,0,10.,1.);\n setupShadersPot();\n setupShaders();\n setupReflectiveShader();\n setupBuffers();\n setupTextures();\n tick();\n}", "function startup() {\n \"use strict\";\n canvas = document.getElementById(\"myCanvas\");\n gl = createGLContext(canvas);\n initGL();\n draw();\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n\n gl.clear(gl.DEPTH_BUFFER_BIT | gl.COLOR_BUFFER_BIT);\n gl.enable(gl.DEPTH_TEST);\n gl.enable(gl.CULL_FACE);\n gl.frontFace(gl.CCW);\n gl.cullFace(gl.BACK);\n\n setUpAttributesAndUniforms();\n setUpBuffers();\n\n // set the clear color here\n // NOTE(TF) Aufgabe 1 / Frage:\n // clearColor() only sets the color for the buffer, but doesn't actually do anything else.\n // clear() has to be called in order for the color to be painted.\n gl.clearColor(0.8, 0.8, 0.8, 1.0);\n\n // add more necessary commands here\n}", "function startup() {\n \"use strict\";\n var canvas = document.getElementById(\"myCanvas\");\n gl = createGLContext(canvas);\n initGL();\n loadTexture();\n}", "function startup() {\n console.log(\"Startup Function Called\");\n\n // get canvas to render model on\n canvas = document.getElementById(\"myGLCanvas\");\n\n // create context\n gl = createGLContext(canvas);\n\n // Setup the shaders and buffers\n setupShaders();\n setupBuffers();\n\n // Set the clear color to white\n gl.clearColor(1, 1, 1, 1);\n\n gl.enable(gl.DEPTH_TEST);\n\n // Call tick function, which will then be called every subsequent animation frame\n tick();\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupShaders();\n setupSkybox();\n setupMesh(\"teapot_0.obj\");\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n tick();\n }", "function startup(){\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupSkyboxShaders()\n setupSkyboxBuffers()\n setupTeapotShaders()\n setupMesh(\"teapot.obj\")\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n mat4.scale(mvMatrix,mvMatrix,[.02,.02,.02])\n gl.enable(gl.DEPTH_TEST)\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n tick();\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n loadTexture();\n\n // set the clear color here\n // NOTE(TF) Aufgabe 1 / Frage:\n // clearColor() only sets the color for the buffer, but doesn't actually do anything else.\n // clear() has to be called in order for the color to be painted.\n gl.clearColor(0.8, 0.8, 0.8, 1.0);\n\n // add more necessary commands here\n}", "function initGL(canvas){\r\n\ttry{\r\n\t\tctx.viewportWidth = canvas.width;\r\n\t\tctx.viewportHeight = canvas.height;\r\n\t\tinitBuffers(ctx);\r\n\t\t\r\n\t\t//Initialize default shader\r\n\t\tfragShader = compileShader(ctx, defaultFragSrc);\r\n\t\tvertShader = compileShader(ctx, defaultVertSrc);\r\n\t\tshaderProgram = createShaderProgram();\r\n\t\tsetupSpriteShader(shaderProgram);\r\n\t\tspriteShader = shaderProgram;\r\n\t\t\r\n\t\tcolorBuffer = createRenderTarget(ctx, canvas.width, canvas.height);\r\n\t\tstateBuffer = createRenderTarget(ctx, canvas.width, canvas.height);\r\n\t\t\r\n\t\tctx.clearColor(0.0, 0.0, 0.0, 1.0);\r\n\t\t\r\n\t\tctx.blendFunc(ctx.SRC_ALPHA, ctx.ONE_MINUS_SRC_ALPHA);\r\n\t\tctx.enable(ctx.BLEND);\r\n\t}catch(e){\r\n\t}\r\n}", "function initBuffers() {\n buffer = gl.createBuffer();\n bufferColor = gl.createBuffer();\n \n pos = gl.getAttribLocation(program, \"position\");\n color = gl.getAttribLocation(program, \"color\");\n\n perspective = gl.getUniformLocation(program, \"perspective\");\n translation = gl.getUniformLocation(program, \"translation\");\n rotation = gl.getUniformLocation(program, \"rotation\");\n scale = gl.getUniformLocation(program, \"scale\");\n size = 3;\n\n gl.enableVertexAttribArray(pos);\n gl.enableVertexAttribArray(color);\n mat4.translate(perscaleMatrix, perscaleMatrix, [0, 0, -2]);\n\n refreshBuffers()\n}", "function init() {\n \n // Retrieve the canvas\n const canvas = document.getElementById('webgl-canvas');\n if (!canvas) {\n console.error(`There is no canvas with id ${'webgl-canvas'} on this page.`);\n return null;\n }\n\n\n // Retrieve a WebGL context\n gl = canvas.getContext('webgl2');\n if (!gl) {\n console.error(`There is no WebGL 2.0 context`);\n return null;\n }\n \n // Set the clear color to be black\n gl.clearColor(0, 0, 0, 1);\n \n // some GL initialization\n gl.enable(gl.DEPTH_TEST);\n gl.enable(gl.CULL_FACE);\n \n gl.cullFace(gl.BACK);\n gl.frontFace(gl.CCW);\n gl.clearColor(0.0,0.0,0.0,1.0)\n gl.depthFunc(gl.LEQUAL)\n gl.clearDepth(1.0)\n\n // Read, compile, and link your shaders\n initProgram();\n \n // create and bind your current object\n createShapes();\n \n // set up your camera\n setUpCamera();\n \n // do a draw\n draw();\n }", "_initContext()\n {\n const gl = this.gl;\n\n // create a texture manager...\n this.textureManager = new TextureManager(this);\n this.textureGC = new TextureGarbageCollector(this);\n\n this.state.resetToDefault();\n\n this.rootRenderTarget = new RenderTarget(gl, this.width, this.height, null, this.resolution, true);\n this.rootRenderTarget.clearColor = this._backgroundColorRgba;\n\n this.bindRenderTarget(this.rootRenderTarget);\n\n this.emit('context', gl);\n\n // setup the width/height properties and gl viewport\n this.resize(this.width, this.height);\n }", "function init() {\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n setupGeometry();\n render();\n}", "function _init() {\n\n _gl = canvasModalWidget.getGLContext();\n\n if (!_gl) {\n throw new Error('Could not run lightingExample() WebGL Demo!');\n }\n\n // Set clear color to black, fully opaque\n _gl.clearColor(0.0, 0.0, 0.0, 1.0);\n\n // dealing with 3D space geometry so make sure this feature is enabled\n _gl.enable(_gl.DEPTH_TEST);\n\n // get the shaders and compile them - the resultant will be a program that is automatically joined to the gl context in the background\n _glProgram = canvasModalWidget.setGLVertexAndFragmentShaders('#v-shader-pong', '#f-shader-pong');\n _glProgram.customAttribs = {};\n\n // Get the storage locations of all the customizable shader variables\n _glProgram.customAttribs.a_PositionRef = _gl.getAttribLocation(_glProgram, 'a_Position'),\n _glProgram.customAttribs.a_VertexNormalRef = _gl.getAttribLocation(_glProgram, 'a_VertexNormal'),\n\n _glProgram.customAttribs.u_FragColourRef = _gl.getUniformLocation(_glProgram, 'u_FragColour'),\n _glProgram.customAttribs.u_PVMMatrixRef = _gl.getUniformLocation(_glProgram, 'u_PVMMatrix'),\n _glProgram.customAttribs.u_NormalMatrixRef = _gl.getUniformLocation(_glProgram, 'u_NormalMatrix'),\n\n _glProgram.customAttribs.u_AmbientColourRef = _gl.getUniformLocation(_glProgram, 'u_AmbientColour'),\n _glProgram.customAttribs.u_LightingDirectionRef = _gl.getUniformLocation(_glProgram, 'u_LightingDirection'),\n _glProgram.customAttribs.u_DirectionalColourRef = _gl.getUniformLocation(_glProgram, 'u_DirectionalColour');\n\n _glProgram.customAttribs.eyePosition = vec3.fromValues(0, 0, 5);\n _glProgram.customAttribs.centerPoint = vec3.fromValues(0, 0, -50);\n\n var perspectiveMatrix = mat4.create(), // get the identity matrix\n viewMatrix = mat4.create(),\n modelMatrix = mat4.create(),\n PVMMatrix = mat4.create();\n\n mat4.perspective(perspectiveMatrix, glMatrix.toRadian(45.0), canvasModalWidget.getGLViewportAspectRatio(), 1, 1000);\n mat4.lookAt(viewMatrix, _glProgram.customAttribs.eyePosition, _glProgram.customAttribs.centerPoint, vec3.fromValues(0, 1, 0));\n\n _glProgram.customAttribs.viewMatrix = viewMatrix;\n _glProgram.customAttribs.modelMatrix = modelMatrix;\n _glProgram.customAttribs.perspectiveMatrix = perspectiveMatrix;\n\n mat4.multiply(PVMMatrix, perspectiveMatrix, viewMatrix);\n\n _glProgram.customAttribs.PVMMatrix = PVMMatrix;\n\n _gl.uniformMatrix4fv(_glProgram.customAttribs.u_PVMMatrixRef, false, _glProgram.customAttribs.PVMMatrix);\n\n // set our directional light which is pointing 10 units to the left 10 units upwards away 5 units from the user \n _glProgram.customAttribs.lightingDirection = _setLightingDirection(-10.0, 10.0, -5.0);\n\n _gl.uniform3fv(_glProgram.customAttribs.u_LightingDirectionRef, _glProgram.customAttribs.lightingDirection);\n _gl.uniform3f(_glProgram.customAttribs.u_AmbientColourRef, 0.5, 0.5, 0.5);\n\n _gl.uniform3f(_glProgram.customAttribs.u_DirectionalColourRef, 1.0, 1.0, 1.0);\n\n // start the game!!\n _game = new _Game();\n\n }", "function initGL() {\r\n var prog = createProgram(gl,\"vshader-source\",\"fshader-source\");\r\n gl.useProgram(prog);\r\n a_coords_loc = gl.getAttribLocation(prog, \"a_coords\");\r\n a_normal_loc = gl.getAttribLocation(prog, \"a_normal\");\r\n u_modelview = gl.getUniformLocation(prog, \"modelview\");\r\n u_projection = gl.getUniformLocation(prog, \"projection\");\r\n u_normalMatrix = gl.getUniformLocation(prog, \"normalMatrix\");\r\n u_lightPosition= gl.getUniformLocation(prog, \"lightPosition\");\r\n u_lightPositionA= gl.getUniformLocation(prog, \"lightPositionA\");\r\n u_lightPositionB= gl.getUniformLocation(prog, \"lightPositionB\");\r\n u_diffuseColor = gl.getUniformLocation(prog, \"diffuseColor\");\r\n u_specularColor = gl.getUniformLocation(prog, \"specularColor\");\r\n u_specularExponent = gl.getUniformLocation(prog, \"specularExponent\");\r\n u_color = gl.getUniformLocation(prog, \"color\");\r\n u_spotLightDir = gl.getUniformLocation(prog, \"spotLightDir\");\r\n u_day = gl.getUniformLocation(prog, \"day\");\r\n a_coords_buffer = gl.createBuffer();\r\n a_normal_buffer = gl.createBuffer();\r\n index_buffer = gl.createBuffer();\r\n gl.enable(gl.DEPTH_TEST);\r\n gl.uniform3f(u_specularColor, 0.5, 0.5, 0.5);\r\n gl.uniform4f(u_diffuseColor, 1, 1, 1, 1);\r\n gl.uniform1f(u_specularExponent, 10); \r\n gl.uniform4f(u_lightPosition, lightPositions[0][0], lightPositions[0][1], lightPositions[0][2], lightPositions[0][3]); \r\n gl.uniform4f(u_lightPositionA, lightPositions[1][0], lightPositions[1][1], lightPositions[1][2], lightPositions[1][3]);\r\n gl.uniform4f(u_lightPositionB, lightPositions[2][0], lightPositions[2][1], lightPositions[2][2], lightPositions[2][3]);\r\n}", "function startup() {\r\n canvas = document.getElementById(\"myGLCanvas\");\r\n gl = createGLContext(canvas);\r\n gl.clearColor(0.0, 0.0, 0.0, 0.0);\r\n gl.enable(gl.DEPTH_TEST);\r\n\r\n\r\n setupShaders();\r\n setupTeapotShaders();\r\n\r\n setupBuffers();\r\n\r\n setupTextures();\r\n\r\n readTextFile(\"teapot_0.obj\",setupTeapotBuffers);\r\n\r\n document.onkeydown = handleKeyDown;\r\n document.onkeyup = handleKeyUp;\r\n\r\n tick();\r\n}", "initGLSLBuffers() {\n var attributeBuffer = this.gl.createBuffer();\n var indexBuffer = this.gl.createBuffer();\n\n if (!attributeBuffer || !indexBuffer) {\n console.log(\"Failed to create buffers!\");\n return;\n }\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, attributeBuffer);\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\n }", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n //setupShaders(\"shader-vs\",\"shader-fs\");\n //setPhongShader();\n setGouraudShader();\n setupBuffers();\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n tick();\n}", "initBuffer() {\n\t\tlet data = this.model.mesh.concat(this.model.normals).concat(this.model.texCoord)\n\n\t\tgl.useProgram(program)\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.vbo)\n\t\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(data), gl.STATIC_DRAW)\n\t}", "function initProgram() {\n const vertexShader = getShader('vertex-shader');\n const fragmentShader = getShader('fragment-shader');\n\n // Create a program\n program = gl.createProgram();\n // Attach the shaders to this program\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n gl.linkProgram(program);\n\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n console.error('Could not initialize shaders');\n }\n\n // Use this program instance\n gl.useProgram(program);\n // We attach the location of these shader values to the program instance\n // for easy access later in the code\n program.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');\n program.aBary = gl.getAttribLocation(program, 'bary');\n program.uModelT = gl.getUniformLocation (program, 'modelT');\n program.uViewT = gl.getUniformLocation (program, 'viewT');\n program.uProjT = gl.getUniformLocation (program, 'projT');\n }", "function init()\n {\n\tcanvas = document.getElementById( \"gl-canvas\" );\n\t\n\t// gl = WebGLUtils.setupWebGL( canvas ); // More efficient\n\tgl = WebGLDebugUtils.makeDebugContext( canvas.getContext(\"webgl\") ); // For debugging\n\tif ( !gl ) { alert( \"WebGL isn't available\" ); }\n\n\tcolorCube();\n\n\tgl.viewport( 0, 0, canvas.width, canvas.height );\n\tgl.clearColor( 0.0, 0.0, 0.0, 1.0 );\n\t\n\tgl.enable(gl.DEPTH_TEST);\n\n\t//\n\t// Load shaders and initialize attribute buffers\n\t//\n\tprogram = initShaders( gl, \"vertex-shader\", \"fragment-shader\" );\n\tgl.useProgram( program );\n\t\n\tcBuffer = gl.createBuffer();\n\tgl.bindBuffer( gl.ARRAY_BUFFER, cBuffer );\n\tgl.bufferData( gl.ARRAY_BUFFER, flatten(colors), gl.STATIC_DRAW );\n\n\tvColor = gl.getAttribLocation( program, \"vColor\" );\n\tgl.vertexAttribPointer( vColor, 4, gl.FLOAT, false, 0, 0 );\n\tgl.enableVertexAttribArray( vColor );\n\n\tvBuffer = gl.createBuffer();\n\tgl.bindBuffer( gl.ARRAY_BUFFER, vBuffer );\n\tgl.bufferData( gl.ARRAY_BUFFER, flatten(points), gl.STATIC_DRAW );\n\n\tvPosition = gl.getAttribLocation( program, \"vPosition\" );\n\tgl.vertexAttribPointer( vPosition, 3, gl.FLOAT, false, 0, 0 );\n\tgl.enableVertexAttribArray( vPosition );\n\n\tmodelViewMatrixLoc = gl.getUniformLocation( program, \"modelViewMatrix\" );\n\tprojectionMatrixLoc = gl.getUniformLocation( program, \"projectionMatrix\" );\n\n\t//event listeners for buttons -- now added below instead of in init\n\t\n\t// document.getElementById( \"xButton\" ).onclick = function () {\n\t// axis = xAxis;\n\t// \trender();\n\t// };\n\t// document.getElementById( \"yButton\" ).onclick = function () {\n\t// axis = yAxis;\n\t// \trender();\n\t// };\n\t// document.getElementById( \"zButton\" ).onclick = function () {\n\t// axis = zAxis;\n\t// \trender();\n\t// };\n\t// \n\trender();\n }", "function startup() {\n canvas = document.getElementById(\"glCanvas\");\n gl = createGLContext(canvas);\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupShaders();\n setupBuffers_aff();\n gl.clearColor(1.0, 1.0, 1.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n tick()\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupShaders(); \n setupBuffers();\n gl.clearColor(1.0, 1.0, 1.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n tick();\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupShaders(\"shader-blinn-phong-vs\",\"shader-blinn-phong-fs\");\n setupBuffers();\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n previousT = Date.now();\n tick();\n}", "function initShaders( )\n{\n\n var fragmentShader = getShader( gl, \"shader-fs\" );\n var vertexShader = getShader( gl, \"shader-vs\" );\n\n shaderProgram = gl.createProgram( );\n gl.attachShader( shaderProgram, vertexShader );\n gl.attachShader( shaderProgram, fragmentShader );\n gl.linkProgram( shaderProgram );\n\n if ( !gl.getProgramParameter( shaderProgram, gl.LINK_STATUS ) )\n {\n\n console.error( \"Could not initialize shaders.\" );\n\n }\n\n gl.useProgram( shaderProgram );\n\n // Acquire handles to shader program variables in order to pass data to the shaders.\n\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation( shaderProgram, \"aVertexPosition\" );\n gl.enableVertexAttribArray( shaderProgram.vertexPositionAttribute );\n\n shaderProgram.vertexColorAttribute = gl.getAttribLocation( shaderProgram, \"aVertexColor\" );\n gl.enableVertexAttribArray( shaderProgram.vertexColorAttribute );\n\n shaderProgram.vertexNormalAttribute = gl.getAttribLocation( shaderProgram, \"aVertexNormal\" );\n gl.enableVertexAttribArray( shaderProgram.vertexNormalAttribute );\n\n shaderProgram.pMatrixUniform = gl.getUniformLocation( shaderProgram, \"uPMatrix\" );\n shaderProgram.mvMatrixUniform = gl.getUniformLocation( shaderProgram, \"uMVMatrix\" );\n shaderProgram.nMatrixUniform = gl.getUniformLocation( shaderProgram, \"uNMatrix\" );\n\n shaderProgram.ambientColorUniform = gl.getUniformLocation( shaderProgram, \"uAmbientColor\" );\n shaderProgram.pointLightLocationUniform = gl.getUniformLocation( shaderProgram, \"uPointLightLocation\" );\n shaderProgram.pointLightColorUniform = gl.getUniformLocation( shaderProgram, \"uPointLightColor\" );\n shaderProgram.screenSizeUniform = gl.getUniformLocation( shaderProgram, \"uSreenSize\" );\n\n}", "function initBuffers( model ) {\t\n\t\n\t// Vertex Coordinates\n\t\t\n\ttriangleVertexPositionBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexPositionBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(model.vertices), gl.STATIC_DRAW);\n\ttriangleVertexPositionBuffer.itemSize = 3;\n\ttriangleVertexPositionBuffer.numItems = model.vertices.length / 3;\t\t\t\n\n\t// Associating to the vertex shader\n\t\n\tgl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, \n\t\t\ttriangleVertexPositionBuffer.itemSize, \n\t\t\tgl.FLOAT, false, 0, 0);\n\t\n\t// Vertex Normal Vectors\n\t\t\n\ttriangleVertexNormalBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexNormalBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array( model.normals), gl.STATIC_DRAW);\n\ttriangleVertexNormalBuffer.itemSize = 3;\n\ttriangleVertexNormalBuffer.numItems = model.normals.length / 3;\t\t\t\n\n\t// Associating to the vertex shader\n\t\n\tgl.vertexAttribPointer(shaderProgram.vertexNormalAttribute, \n\t \t\ttriangleVertexNormalBuffer.itemSize, \n\t \t\tgl.FLOAT, false, 0, 0);\t\n\n\n\t// colors\n\ttriangleVertexColorBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexColorBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(model.colors), gl.STATIC_DRAW);\n\ttriangleVertexColorBuffer.itemSize = 3;\n\ttriangleVertexColorBuffer.numItems = model.colors.length / 3;\t\n\n\tgl.vertexAttribPointer(shaderProgram.vertexColorAttribute, \n\t\ttriangleVertexColorBuffer.itemSize,\n\t\tgl.FLOAT, false, 0, 0); \n\n\t/* Textures\n triangleVertexTextureCoordBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexTextureCoordBuffer);\n \tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(model.texture), gl.STATIC_DRAW);\n triangleVertexTextureCoordBuffer.itemSize = 2;\n\ttriangleVertexTextureCoordBuffer.numItems = 24;\n}\n\nfunction handleLoadedTexture(texture) {\n\t\n\tgl.bindTexture(gl.TEXTURE_2D, texture);\n\tgl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n\tgl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n\tgl.bindTexture(gl.TEXTURE_2D, null);\n}\n\n\nvar webGLTexture;\nvar webGLTextureWood;\n\nfunction initTexture() {\n\n\timages = [\"checkers_board2.gif\",\"wood2.gif\"]\n\t\n\twebGLTexture = gl.createTexture();\n\twebGLTexture.image = new Image();\n\twebGLTexture.image.onload = function () {\n\t\thandleLoadedTexture(webGLTexture)\n\t}\n\n\twebGLTexture.image.src = \"checkers_board2.gif\";\n\n\twebGLTextureWood = gl.createTexture();\n\twebGLTextureWood.image = new Image();\n\twebGLTextureWood.image.onload = function () {\n\t\thandleLoadedTexture(webGLTextureWood)\n\t}\n\n\twebGLTextureWood.image.src = \"wood2.gif\";\n\n\t*/\n}", "function init() {\n gl.clearColor(1, 1, 1, 1);\n gl.enable(gl.DEPTH_TEST);\n\n gl.viewport(0, 0, canvasGL.width, canvasGL.height);\n\n // initialisation de la texture\n texture360 = initTexture(\"earth\");\n\n // initialisation des shaders pour le traçage de triangles\n shader360 = initProgram(\"shader360\");\n\n // Création du triangle vao\n triangleVAO = initTriangleVAO();\n\n // Création du sphere vao\n sphereVAO = initSphereVAO();\n\n // Création des projections et modelView\n angleViewX = 0;\n angleViewY = 0;\n projection = new Mat4();\n modelview = new Mat4();\n projection.setFrustum(-0.1, 0.1, -0.1, 0.1, 0.1, 1000);\n}", "static initializeGL()\n {\n // Create the renderer\n RPM.renderer = new THREE.WebGLRenderer({antialias: RPM.datasGame.system\n .antialias, alpha: true});\n RPM.renderer.autoClear = false;\n RPM.renderer.setSize(RPM.CANVAS_WIDTH, RPM.CANVAS_HEIGHT);\n if (RPM.datasGame.system.antialias)\n {\n RPM.renderer.setPixelRatio(2);\n }\n Platform.canvas3D.appendChild(RPM.renderer.domElement);\n }", "function init() {\n\n\t/**\n\t\tset the resolution of the canvas to it's actual display size\n\t\ton default it is 300 x 150\n\t*/\n\n\tcanvas.width = canvas.clientWidth;\n\tcanvas.height = canvas.clientHeight;\n\n\n\t/**\n\t\tdefine in which area of the canvas shall be rendered\n\t*/\n\n\tgl.viewport( 0, 0, canvas.width, canvas.height );\n\n\n\t/**\n\t\tdefine in which color the canvas appears after 'gl.clear( gl.COLOR_BUFFER_BIT )'\n\t*/\n\n\tgl.clearColor( 0, 0, 0, 1.0 );\n\n\n\t/**\n\t\tenable face culling\n\t\tmakes only faces with vertices displayed in counter-clockwise order appear\n\t*/\n\n\tgl.enable( gl.CULL_FACE );\n\n\n\t/**\n\t\tenable writing to the depth buffer\n\t\tmakes it unnecessary to draw the objects from the furthest to the nearest\n\t*/\n\n\tgl.enable( gl.DEPTH_TEST );\n\n\n\t/**\n\t\textend the WebGLRenderingContext with attributes and methods defined in 'WebGLUtilities.js'\n\t*/\n\n\textend( gl, WebGLUtilities );\n\n\n\t/**\n\t\tinitialize the scene\n\t*/\n\n\tScene.init( gl );\n\n}", "function initBuffers( model ) {\t\t\n\t// Vertex Coordinates\t\t\n\ttriangleVertexPositionBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexPositionBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(model.vertices), gl.STATIC_DRAW);\n\ttriangleVertexPositionBuffer.itemSize = 3;\n\ttriangleVertexPositionBuffer.numItems = model.vertices.length / 3;\t\t\t\n\n\t// Associating to the vertex shader\t\n\tgl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, \n\t\t\ttriangleVertexPositionBuffer.itemSize, \n\t\t\tgl.FLOAT, false, 0, 0);\n\t\n\t// Vertex Normal Vectors\t\t\n\ttriangleVertexNormalBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexNormalBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array( model.normals), gl.STATIC_DRAW);\n\ttriangleVertexNormalBuffer.itemSize = 3;\n\ttriangleVertexNormalBuffer.numItems = model.normals.length / 3;\t\t\t\n\n\t// Associating to the vertex shader\t\n\tgl.vertexAttribPointer(shaderProgram.vertexNormalAttribute, \n\t\t\ttriangleVertexNormalBuffer.itemSize, \n\t\t\tgl.FLOAT, false, 0, 0);\t\n}", "function startup() {\r\n console.log(\"Startup started\")\r\n \"use strict\";\r\n var canvas = document.getElementById(\"myCanvas\");\r\n gl = createGLContext(canvas);\r\n initGL();\r\n draw();\r\n}", "function init() {\n\tcanvas = $(\"#canvas\")[0];\n\tgl = tdl.webgl.setupWebGL(canvas);\n\n\twindow.onresize = function() { scaleViewport(canvas, gl, quality); };\n\n\t$('#canvas').bind( 'mousewheel', wheelzoom);\n\t$('#canvas').bind( 'mousemove', focusmouse);\n\t$('#canvas').bind( 'mousedown', function(evt) { mouse_down = true; } );\n\t$('#canvas').bind( 'mouseup', function(evt) { mouse_down = false; } );\n\n\tscaleViewport(canvas, gl, quality);\n\n\tstats = setUpStats();\n\tclock = tdl.clock.createClock();\n\n\n\t// Setup Buffers\n\tlifeBuffer = new DoubleBuffer(width,height);\n\tlifeBuffer.setTexParameter(gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n\tlifeBuffer.setTexParameter(gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n\tlifeBuffer.setTexParameter(gl.TEXTURE_WRAP_S, gl.REPEAT);\n\tlifeBuffer.setTexParameter(gl.TEXTURE_WRAP_T, gl.REPEAT);\n\n\t//set up projection matrix\n\ttdl.fast.matrix4.ortho(projection, -1, 1, -1, 1, 0, -1);\n\t\n\t// Load the programs.\n\tAJAXProgramLoader(\n\t\t{\n\t\t\tlife: { vert: 'glsl/identity.vert', frag: 'glsl/life.frag' },\n\t\t\tscreen: { vert: 'glsl/wvp.vert', frag: 'glsl/tex2frag.frag' },\n\t\t\trandom: { vert: 'glsl/identity.vert', frag: 'glsl/random.frag' } \n\t\t}, \n\t\tstart\n\t)\n\n}", "function startup() {\r\n canvas = document.getElementById(\"myGLCanvas\");\r\n gl = createGLContext(canvas);\r\n setupShaders(); \r\n setupBuffers();\r\n gl.clearColor(0.0, 0.0, 0.0, 0.0);\r\n gl.enable(gl.DEPTH_TEST);\r\n tick();\r\n}", "_initWebGL() {\n\n // Default context attribute values\n\n if (!this.gl) {\n for (let i = 0; !this.gl && i < WEBGL_CONTEXT_NAMES.length; i++) {\n try {\n this.gl = this.canvas.getContext(WEBGL_CONTEXT_NAMES[i], this.contextAttr);\n } catch (e) { // Try with next context name\n }\n }\n }\n\n if (!this.gl) {\n\n this.error('Failed to get a WebGL context');\n\n /**\n * Fired whenever the canvas failed to get a WebGL context, which probably means that WebGL\n * is either unsupported or has been disabled.\n * @event webglContextFailed\n */\n this.fire(\"webglContextFailed\", true, true);\n }\n\n if (this.gl) {\n // Setup extension (if necessary) and hints for fragment shader derivative functions\n if (this.webgl2) {\n this.gl.hint(this.gl.FRAGMENT_SHADER_DERIVATIVE_HINT, this.gl.FASTEST);\n } else if (WEBGL_INFO.SUPPORTED_EXTENSIONS[\"OES_standard_derivatives\"]) {\n const ext = this.gl.getExtension(\"OES_standard_derivatives\");\n this.gl.hint(ext.FRAGMENT_SHADER_DERIVATIVE_HINT_OES, this.gl.FASTEST);\n }\n }\n }", "function startup() {\r\n canvas = document.getElementById(\"myGLCanvas\");\r\n gl = createGLContext(canvas);\r\n setupShaders();\r\n setupBuffers();\r\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\r\n gl.enable(gl.DEPTH_TEST);\r\n tick();\r\n}", "function initBuffers( model ) {\t\n\t\n\t// Vertex Coordinates\n\t\t\n\ttriangleVertexPositionBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexPositionBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(model.vertices), gl.STATIC_DRAW);\n\ttriangleVertexPositionBuffer.itemSize = 3;\n\ttriangleVertexPositionBuffer.numItems = model.vertices.length / 3;\t\t\t\n\n\t// Associating to the vertex shader\n\t\n\tgl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, \n\t\t\ttriangleVertexPositionBuffer.itemSize, \n\t\t\tgl.FLOAT, false, 0, 0);\n\t\n\t// Vertex Colors\n\ttriangleVertexColorBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexColorBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(model.colors), gl.STATIC_DRAW);\n\ttriangleVertexColorBuffer.itemSize = 3;\n\ttriangleVertexColorBuffer.numItems = model.colors.length / 3;\t\t\t\n\n\t// Associating to the vertex shader\n\t\n\tgl.vertexAttribPointer(shaderProgram.vertexColorAttribute, \n\t\t\ttriangleVertexColorBuffer.itemSize, \n\t\t\tgl.FLOAT, false, 0, 0);\n}", "function initBuffers() {\n\n\t// Vertex Coordinates\n\n\ttriangleVertexPositionBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexPositionBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n\ttriangleVertexPositionBuffer.itemSize = 3;\n\ttriangleVertexPositionBuffer.numItems = vertices.length / 3;\n\n\t// Associating to the vertex shader\n\n\tgl.vertexAttribPointer(shaderProgram.vertexPositionAttribute,\n\t\ttriangleVertexPositionBuffer.itemSize,\n\t\tgl.FLOAT, false, 0, 0);\n\n\t// Vertex Normal Vectors\n\n\ttriangleVertexNormalBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexNormalBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(normals), gl.STATIC_DRAW);\n\ttriangleVertexNormalBuffer.itemSize = 3;\n\ttriangleVertexNormalBuffer.numItems = normals.length / 3;\n\n\t// Associating to the vertex shader\n\n\tgl.vertexAttribPointer(shaderProgram.vertexNormalAttribute,\n\t\ttriangleVertexNormalBuffer.itemSize,\n\t\tgl.FLOAT, false, 0, 0);\n}", "function startup() {\n let canvas = document.getElementById(renderSettings.viewPort.canvasId);\n\n gl = createGLContext(canvas);\n initGL();\n resizeWindow();\n\n window.addEventListener(\"keyup\", onKeyup, false);\n window.addEventListener(\"keydown\", onKeydown, false);\n window.addEventListener(\"resize\", resizeWindow, false);\n window.addEventListener(\"visibilityChange\", handleVisibilityChange, false);\n\n drawAnimated(0);\n}", "function initShaders()\n{\n\tvar fragmentShader = getShader(gl, \"shader-fs\");\n\tvar vertexShader = getShader(gl, \"shader-vs\");\n\n\t//create and link shader program\n\tshaderProgram = gl.createProgram();\n\tgl.attachShader(shaderProgram, vertexShader);\n\tgl.attachShader(shaderProgram, fragmentShader);\n\tgl.linkProgram(shaderProgram);\n\n\tif(!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS))\n\t{\n\t\tconsole.log(\"Could not link shaders\");\n\t\treturn;\n\t}\n\n\t//register shader\n\tgl.useProgram(shaderProgram);\n\n\tshaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n\tgl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n\n\tshaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, \"aTextureCoordinate\");\n\tgl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);\n\n\tshaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n\tshaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n\tshaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, \"uSampler\");\n\n\tconsole.log(\"Initialized shaders\");\n}", "init(context, sceneMatrix) {\n if(!this.isInit) {\n this.isInit = true;\n this.posBuffer = gl.createBuffer();\n this.colorBuffer = gl.createBuffer();\n this.sizeBuffer = gl.createBuffer();\n\n /*set the attributes uniforms*/\n this.a_position = gl.getAttribLocation(context.shader, 'a_position');\n this.a_color = gl.getAttribLocation(context.shader, 'a_color');\n this.a_size = gl.getAttribLocation(context.shader, 'a_size');\n this.u_modelView = gl.getUniformLocation(context.shader, 'u_modelView');\n this.u_projection = gl.getUniformLocation(context.shader, 'u_projection');\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);\n gl.enableVertexAttribArray(this.a_color);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this.posBuffer);\n gl.enableVertexAttribArray(this.a_position);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this.sizeBuffer);\n gl.enableVertexAttribArray(this.a_size);\n\n this.wind = vec3.fromValues(0,0,0);\n\n this.moveVec = vec3.create();\n this.oldPos = this.getPosition(sceneMatrix);\n }\n }", "function initWebGl()\n {\n canvas = document.getElementById(\"gl-canvas\");\n gl = WebGLUtils.setupWebGL(canvas);\n if (!gl)\n {\n alert(\"Unable to setup WebGL!\");\n return;\n }\n gl.viewport(0, 0, canvas.clientWidth, canvas.clientHeight);\n gl.clearColor(1.0, 1.0, 1.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n\n var vertexShader = initShader(gl, 'vertex-shader', gl.VERTEX_SHADER);\n var fragmentShader = initShader(gl, 'fragment-shader', gl.FRAGMENT_SHADER);\n var boxShader = initShader(gl, 'block-fragment-shader', gl.FRAGMENT_SHADER);\n var boxVShader = initShader(gl, 'block-vertex-shader', gl.VERTEX_SHADER);\n\n program = gl.createProgram();\n gl.attachShader(program, fragmentShader);\n gl.attachShader(program, vertexShader);\n gl.linkProgram(program);\n\n boxShaderProgram = gl.createProgram();\n gl.attachShader(boxShaderProgram, boxVShader);\n gl.attachShader(boxShaderProgram, boxShader);\n gl.linkProgram(boxShaderProgram);\n }", "function initializeTerrainBuffers() {\n /* Initialize vertex buffer */\n vertexBufferProgram = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBufferProgram);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexBuffer), gl.STATIC_DRAW);\n vertexBufferProgram.itemSize = 3;\n vertexBufferProgram.numItems = numVertices;\n console.log(\"Loaded \", vertexBufferProgram.numItems, \" vertices\");\n\n /* Initialize normals buffer */\n normalBufferProgram = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, normalBufferProgram);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(normalBuffer),\n gl.STATIC_DRAW);\n normalBufferProgram.itemSize = 3;\n normalBufferProgram.numItems = numVertices;\n console.log(\"Loaded \", normalBufferProgram.numItems, \" normals\");\n\n /* Initialize triangle face buffer */\n triangleBufferProgram = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBufferProgram);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(triangleBuffer),\n gl.STATIC_DRAW);\n triangleBufferProgram.itemSize = 1;\n triangleBufferProgram.numItems = triangleBuffer.length;\n console.log(\"Loaded \", triangleBufferProgram.numItems, \" triangles\");\n}", "function init() {\n canvas = document.createElement('canvas');\n gl = canvas.getContext('webgl');\n ratio = window.devicePixelRatio || 1;\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE);\n\n update();\n createProgram();\n blankTexture = getBlankTexture();\n initQuad();\n\n document.body.appendChild(canvas);\n window.addEventListener('resize', update, false);\n initialized = true;\n }", "function initShaders() {\n\tvar fragmentShader = getShader(gl, \"shader-fs\");\n\tvar vertexShader = getShader(gl, \"shader-vs\");\n\n\tvar shaderProgram = gl.createProgram();\n\tgl.attachShader(shaderProgram, vertexShader);\n\tgl.attachShader(shaderProgram, fragmentShader);\n\tgl.linkProgram(shaderProgram);\n\n\tif (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n\t\talert(\"Could not initialise shaders\");\n\t}\n\tgl.useProgram(shaderProgram);\n\n\tconst attrs = {\n\t\taVertexPosition: OBJ.Layout.POSITION.key,\n\t\taVertexNormal: OBJ.Layout.NORMAL.key,\n\t\taTextureCoord: OBJ.Layout.UV.key,\n\t\taDiffuse: OBJ.Layout.DIFFUSE.key,\n\t\taSpecular: OBJ.Layout.SPECULAR.key,\n\t\taSpecularExponent: OBJ.Layout.SPECULAR_EXPONENT.key\n\t};\n\n\tshaderProgram.attrIndices = {};\n\tfor (const attrName in attrs) {\n\t\tif (!attrs.hasOwnProperty(attrName)) {\n\t\t\tcontinue;\n\t\t}\n\t\tshaderProgram.attrIndices[attrName] = gl.getAttribLocation(shaderProgram, attrName);\n\t\tif (shaderProgram.attrIndices[attrName] != -1) {\n\t\t\tgl.enableVertexAttribArray(shaderProgram.attrIndices[attrName]);\n\t\t} else {\n\t\t\tconsole.warn(\n\t\t\t\t'Shader attribute \"' +\n\t\t\t\tattrName +\n\t\t\t\t'\" not found in shader. Is it undeclared or unused in the shader code?'\n\t\t\t);\n\t\t}\n\t}\n\n\tshaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n\tshaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n\tshaderProgram.nMatrixUniform = gl.getUniformLocation(shaderProgram, \"uNMatrix\");\n\n\tshaderProgram.applyAttributePointers = function(model) {\n\t\tconst layout = model.mesh.vertexBuffer.layout;\n\t\tfor (const attrName in attrs) {\n\t\t\tif (!attrs.hasOwnProperty(attrName) || shaderProgram.attrIndices[attrName] == -1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst layoutKey = attrs[attrName];\n\t\t\tif (shaderProgram.attrIndices[attrName] != -1) {\n\t\t\t\tconst attr = layout[layoutKey];\n\t\t\t\tgl.vertexAttribPointer(\n\t\t\t\t\tshaderProgram.attrIndices[attrName],\n\t\t\t\t\tattr.size,\n\t\t\t\t\tgl[attr.type],\n\t\t\t\t\tattr.normalized,\n\t\t\t\t\tattr.stride,\n\t\t\t\t\tattr.offset\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t};\n\treturn shaderProgram;\n}", "function initBuffers(gl) {\n return { positions: gl.createBuffer(),\n offsets: gl.createBuffer(),\n normals: gl.createBuffer(),\n randomSeeds: gl.createBuffer(),\n rotationAxes: gl.createBuffer() };\n}", "function initBuffers() {\n\n var vertices,\n textureCoords,\n vertexIndices,\n _w = t.tex.image.width / inst.parent.w,\n _h = t.tex.image.height / inst.parent.h;\n\n vertexPositionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffer);\n vertices = [\n _w, _h, 0.0, -_w, _h, 0.0,\n _w, -_h, 0.0, -_w, -_h, 0.0\n ];\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n vertexPositionBuffer.itemSize = 3;\n vertexPositionBuffer.numItems = 4;\n\n vertexTextureCoordBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexTextureCoordBuffer);\n textureCoords = [\n // Front face\n 1.0, 0.0,\n 0.0, 0.0,\n 1.0, 1.0,\n 0.0, 1.0\n ];\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(textureCoords), gl.STATIC_DRAW);\n vertexTextureCoordBuffer.itemSize = 2;\n vertexTextureCoordBuffer.numItems = 6;\n\n vertexIndexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, vertexIndexBuffer);\n vertexIndices = [\n 0, 1, 2, 0, 2, 3, // Front face\n ];\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(vertexIndices), gl.STATIC_DRAW);\n vertexIndexBuffer.itemSize = 1;\n vertexIndexBuffer.numItems = 6;\n }", "function initializeWebGL() {\n\ttry {\n\t\tgl = canvas.getContext(\"webgl2\");\n\t} catch(e) {\n\t\tconsole.log(e);\n\t}\n\n\tif(gl) {\n\t\tprogram = compileAndLink(program,vs,fs);\n\t\tgl.useProgram(program);\n\n\t\t// Link mesh attributes to shader attributes and enable them\n\t\tprogram = linkMeshAttr(program,false);\n\n\t\t// Init world view and projection matrices\n\t\tgl.clearColor(0.0, 0.0, 0.0, 1.0);\n\t\tgl.viewport(0.0, 0.0, canvas.clientWidth, canvas.clientHeight);\n\t\taspectRatio = canvas.clientWidth/canvas.clientHeight;\n\n\t\t// Turn on depth testing\n\t\tgl.enable(gl.DEPTH_TEST);\n\t\tgl.enable(gl.CULL_FACE);\n\t} else {\n\t\talert(\"Error: WebGL not supported by your browser!\");\n\t}\n}", "function initGL() {\n var prog = createProgram(gl,\"vshader-source\",\"fshader-source\");\n gl.useProgram(prog);\n a_coords_loc = gl.getAttribLocation(prog, \"a_coords\");\n a_normal_loc = gl.getAttribLocation(prog, \"a_normal\");\n a_texcoords_loc = gl.getAttribLocation(prog, \"a_texcoords\");\n\n u_modelview = gl.getUniformLocation(prog, \"modelview\");\n u_projection = gl.getUniformLocation(prog, \"projection\");\n u_normalMatrix = gl.getUniformLocation(prog, \"normalMatrix\");\n u_lightPosition= gl.getUniformLocation(prog, \"lightPosition\");\n u_diffuseColor = gl.getUniformLocation(prog, \"diffuseColor\");\n u_specularColor = gl.getUniformLocation(prog, \"specularColor\");\n u_specularExponent = gl.getUniformLocation(prog, \"specularExponent\");\n u_lightPositions = gl.getUniformLocation(prog, \"lightPositions\");\n u_attenuation = gl.getUniformLocation(prog, \"attenuation\");\n u_lightDir = gl.getUniformLocation(prog, \"lightDir\");\n u_drawMode = gl.getUniformLocation(prog, \"drawMode\");\n u_lightAngleLimit = gl.getUniformLocation(prog, \"lightAngleLimit\");\n u_lightEnable = gl.getUniformLocation(prog, \"enable\");\n u_texture = gl.getUniformLocation(prog, \"texture\");\n\n gl.clearColor(0.0,0.0,0.0,1.0);\n gl.enable(gl.DEPTH_TEST);\n\n gl.uniform3f(u_specularColor, 0.5, 0.5, 0.5); \n gl.uniform1f(u_specularExponent, 10);\n texture0 = gl.createTexture();\n\n}", "function startup() {\r\n \tcanvas = document.getElementById(\"myGLCanvas\");\r\n \tgl = createGLContext(canvas);\r\n \tsetupShaders(); \r\n \tsetupBuffers();\r\n \tgl.clearColor(1.0, 1.0, 1.0, 1.0);\t//white background\r\n \tgl.enable(gl.DEPTH_TEST);\r\n \ttick();\r\n}", "initBuffer () {\n gl.useProgram(program);\n gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesVBO);\n\n // TODO: Übergebe hier sowohl das Mesh, als auch die Normalen an das VBO\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.mesh.concat(this.normals).concat(this.textureCoordinates)), gl.STATIC_DRAW);\n gl.uniformMatrix4fv(modelMatrixLoc, false, new Float32Array(this.modelMatrix));\n gl.uniformMatrix4fv(normalMatrixLoc, false, new Float32Array(this.normalMatrix));\n }", "function InitShaders(gl) {with(gl)\n{\n\tvar fragmentShader = GetShader(gl, \"shader-fs\");\n\tvar vertexShader = GetShader(gl, \"shader-vs\");\n \n\t// Create the shader program\n\tgl.shaderProgram = createProgram();\n\tattachShader(shaderProgram, vertexShader);\n\tattachShader(shaderProgram, fragmentShader);\n\tlinkProgram(shaderProgram);\n\t\n\t// If creating the shader program failed, alert\n\tif (!getProgramParameter(shaderProgram, LINK_STATUS)) \n\t{\n\t\talert(\"Unable to initialize the shader program.\");\n\t}\n \tuseProgram(shaderProgram);\n\t\n\t// Texture attributes\n\tgl.aTextureCoord = getAttribLocation(shaderProgram, \"aTextureCoord\");\n\tenableVertexAttribArray(aTextureCoord);\n\t\n\t// Vertex attributes\n\tgl.aVertexPosition = getAttribLocation(shaderProgram, \"aVertexPosition\");\n\tenableVertexAttribArray(aVertexPosition); \n\t\t\n\t// Set uniforms\n\tgl.uPosition = getUniformLocation(shaderProgram, \"uPosition\");\n\tgl.uAspectRatio = getUniformLocation(shaderProgram, \"uAspectRatio\");\n\tgl.uScale = getUniformLocation(shaderProgram, \"uScale\");\n\tgl.uColour = getUniformLocation(shaderProgram, \"uColour\");\n\tuniform4f(uColour, 1,1,1,1);\n\t// Set it\n\t//gl.uniform1f(uAspectRatio, canvas.width/canvas.height);\n\tuniform1f(uAspectRatio, 1);\n}}", "function initGL() {\n var prog = createProgram(gl,\"vshader-source\",\"fshader-source\");\n gl.useProgram(prog);\n gl.enable(gl.DEPTH_TEST);\n \n a_coords_loc = gl.getAttribLocation(prog, \"a_coords\");\n a_normal_loc = gl.getAttribLocation(prog, \"a_normal\");\n gl.enableVertexAttribArray(a_coords_loc);\n gl.enableVertexAttribArray(a_normal_loc);\n \n u_modelview = gl.getUniformLocation(prog, \"modelview\");\n u_projection = gl.getUniformLocation(prog, \"projection\");\n u_normalMatrix = gl.getUniformLocation(prog, \"normalMatrix\");\n u_material = {\n diffuseColor: gl.getUniformLocation(prog, \"material.diffuseColor\"),\n specularColor: gl.getUniformLocation(prog, \"material.specularColor\"),\n emissiveColor: gl.getUniformLocation(prog, \"material.emissiveColor\"),\n specularExponent: gl.getUniformLocation(prog, \"material.specularExponent\")\n };\n u_lights = new Array(10);\n for (var i = 0; i < 10; i++) {\n u_lights[i] = {\n enabled: gl.getUniformLocation(prog, \"lights[\" + i + \"].enabled\"),\n position: gl.getUniformLocation(prog, \"lights[\" + i + \"].position\"),\n color: gl.getUniformLocation(prog, \"lights[\" + i + \"].color\"),\n spotDirection: gl.getUniformLocation(prog, \"lights[\" + i + \"].spotDirection\"),\n spotCosineCutoff: gl.getUniformLocation(prog, \"lights[\" + i + \"].spotCosineCutoff\"),\n spotExponent: gl.getUniformLocation(prog, \"lights[\" + i + \"].spotExponent\"),\n attenuation: gl.getUniformLocation(prog, \"lights[\" + i + \"].attenuation\")\n };\n }\n for (var i = 1; i < 10; i++) { // set defaults for lights\n gl.uniform1i( u_lights[i].enabled, 1 ); \n\n }\n\n //ambient light - off by default\n gl.uniform4f( u_lights[0].position, 0,0,0,1 ); \n gl.uniform3f( u_lights[0].color, 0.2,0.2,0.2 );\n \n}", "function initializeShaders(){\n //Load shaders and initialize attribute buffers\n program = initShaders(gl, \"shader-vs\", \"shader-fs\");\n gl.useProgram(program);\n\n //Associate attributes to vertex shader\n _Pmatrix = gl.getUniformLocation(program, \"Pmatrix\");\n _Vmatrix = gl.getUniformLocation(program, \"Vmatrix\");\n _Mmatrix = gl.getUniformLocation(program, \"Mmatrix\");\n _Nmatrix = gl.getUniformLocation(program, \"normalMatrix\");\n\n //Bind vertex buffer with position attribute \n gl.bindBuffer(gl.ARRAY_BUFFER, vertex_buffer);\n var _position = gl.getAttribLocation(program, \"position\");\n gl.vertexAttribPointer(_position, 3, gl.FLOAT, false,0,0);\n gl.enableVertexAttribArray(_position); \n\n //Attributes\n textureCoordAttribute = gl.getAttribLocation(program, \"aTextureCoord\");\n gl.enableVertexAttribArray(textureCoordAttribute);\n\n normalAttribute = gl.getAttribLocation(program, \"normal\");\n gl.enableVertexAttribArray(normalAttribute);\n}", "function prepareGlVariables() {\n context.aVertexPositionId = gl.getAttribLocation(context.shaderProgram, \"aVertexPosition\");\n context.aVertexColorId = gl.getAttribLocation(context.shaderProgram, \"aVertexColor\");\n context.aVertexTextureCoordId = gl.getAttribLocation(context.shaderProgram, \"aVertexTextureCoord\");\n\n context.uProjectionMatId = gl.getUniformLocation(context.shaderProgram, \"uProjectionMat\");\n context.uModelMatId = gl.getUniformLocation(context.shaderProgram, \"uModelMat\");\n context.uIsTextureDrawingId = gl.getUniformLocation(context.shaderProgram, \"uIsTextureDrawing\");\n context.uSamplerId = gl.getUniformLocation(context.shaderProgram, \"uSampler\");\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupShaders(); \n setupBuffers();\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST); //check the draw is right\n // gl.enable(gl.CULL_FACE); //check the draw is right\n //gl.cullFace(gl.BACK); \n tick();\n}", "function startup() {\r\n \r\n //create the translation matrix\r\n canvas = document.getElementById(\"myGLCanvas\");\r\n gl = createGLContext(canvas);\r\n setupShaders(); \r\n setupBuffers();\r\n gl.clearColor(0.0, 0.0, 0.0, 0.0);\r\n gl.enable(gl.DEPTH_TEST);\r\n tick();\r\n}", "function gl_init(gl, vertexShader, fragmentShader) {\n\n // Create and link the gl program, using the application's vertex and fragment shaders.\n\n var program = gl.createProgram();\n addshader(gl, program, gl.VERTEX_SHADER , vertexShader );\n addshader(gl, program, gl.FRAGMENT_SHADER, fragmentShader);\n gl.linkProgram(program);\n if (! gl.getProgramParameter(program, gl.LINK_STATUS))\n console.log(\"Could not link the shader program!\");\n gl.useProgram(program);\n\n // Create a square as a strip of two triangles.\n\n gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ -1,1,0, 1,1,0, -1,-1,0, 1,-1,0 ]), gl.STATIC_DRAW);\n\n // Assign attribute aPosition to each of the square's vertices.\n\n gl.aPosition = gl.getAttribLocation(program, \"aPosition\");\n gl.enableVertexAttribArray(gl.aPosition);\n gl.vertexAttribPointer(gl.aPosition, 3, gl.FLOAT, false, 0, 0);\n\n // Remember the address within the fragment shader of each of my uniform variables.\n\n gl.uTime = gl.getUniformLocation(program, \"uTime\" );\n gl.uCursor = gl.getUniformLocation(program, \"uCursor\");\n}", "function initShaders() {\r\n var fragmentShader = getShader(gl, \"shader-fs\");\r\n var vertexShader = getShader(gl, \"shader-vs\");\r\n\r\n // Create the shader program\r\n shaderProgram = gl.createProgram();\r\n gl.attachShader(shaderProgram, vertexShader);\r\n gl.attachShader(shaderProgram, fragmentShader);\r\n gl.linkProgram(shaderProgram);\r\n\r\n // If creating the shader program failed, alert\r\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\r\n alert(\"Unable to initialize the shader program.\");\r\n }\r\n\r\n // start using shading program for rendering\r\n gl.useProgram(shaderProgram);\r\n\r\n // store location of aVertexPosition variable defined in shader\r\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\r\n\r\n // turn on vertex position attribute at specified position\r\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\r\n\r\n // store location of aVertexNormal variable defined in shader\r\n shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, \"aTextureCoord\");\r\n\r\n // store location of aTextureCoord variable defined in shader\r\n gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);\r\n\r\n // store location of uPMatrix variable defined in shader - projection matrix\r\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\r\n // store location of uMVMatrix variable defined in shader - model-view matrix\r\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\r\n // store location of uSampler variable defined in shader\r\n shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, \"uSampler\");\r\n}", "function initGL(canvas) {\n var names = [\"webgl\", \"experimental-webgl\", \"moz-webgl\", \"webkit-3d\"];\n var i;\n for (i=0; names.length > i; i++) {\n try {\n gl = canvas.getContext(names[i]);\n //_gl = gl // UNCOMMENT FOR A GLOBAL REF TO GL\n if (gl) {\n // UNCOMMENT FOR WEBGL DEBUGGING\n // Debug wrapper is currently nesting in HTML file.\n //gl = WebGLDebugUtils.makeDebugContext(gl, function(a,b,c) {\n //console.warn(a,b,c);\n //});\n break;\n }\n } catch(e) {}\n }\n if (!gl) {\n alert(\"Could not initialise WebGL, sorry :-(\");\n }\n }", "function initBuffers(gl) {\n // create buffer to store objects' position\n const positionBuffer = gl.createBuffer();\n // select it to perform operations\n gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n // create array of positions\n const positions = [\n // front face\n -1.0, -1.0, 1.0,\n 1.0, -1.0, 1.0,\n 1.0, 1.0, 1.0,\n -1.0, 1.0, 1.0,\n // back face\n -1.0, -1.0, -1.0,\n -1.0, 1.0, -1.0,\n 1.0, 1.0, -1.0,\n 1.0, -1.0, -1.0,\n // top face\n -1.0, 1.0, -1.0,\n -1.0, 1.0, 1.0,\n 1.0, 1.0, 1.0,\n 1.0, 1.0, -1.0,\n // bottom face\n -1.0, -1.0, -1.0,\n 1.0, -1.0, -1.0,\n 1.0, -1.0, 1.0,\n -1.0, -1.0, 1.0,\n // right face\n 1.0, -1.0, -1.0,\n 1.0, 1.0, -1.0,\n 1.0, 1.0, 1.0,\n 1.0, -1.0, 1.0,\n // left face\n -1.0, -1.0, -1.0,\n -1.0, -1.0, 1.0,\n -1.0, 1.0, 1.0,\n -1.0, 1.0, -1.0,\n ];\n // pass array of positions to WebGL as a Float32Array and fill the current buffer\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW);\n\n // set up normals for vertices to compute lighting\n const normalBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, normalBuffer);\n\n const vertexNormal = [\n // front\n 0.0, 0.0, 1.0,\n 0.0, 0.0, 1.0,\n 0.0, 0.0, 1.0,\n 0.0, 0.0, 1.0,\n // back\n 0.0, 0.0, -1.0,\n 0.0, 0.0, -1.0,\n 0.0, 0.0, -1.0,\n 0.0, 0.0, -1.0,\n // top\n 0.0, 1.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 1.0, 0.0,\n // bottom\n 0.0, -1.0, 0.0,\n 0.0, -1.0, 0.0,\n 0.0, -1.0, 0.0,\n 0.0, -1.0, 0.0,\n // right\n 1.0, 0.0, 0.0,\n 1.0, 0.0, 0.0,\n 1.0, 0.0, 0.0,\n 1.0, 0.0, 0.0,\n // left\n -1.0, 0.0, 0.0,\n -1.0, 0.0, 0.0,\n -1.0, 0.0, 0.0,\n -1.0, 0.0, 0.0,\n ];\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexNormal), gl.STATIC_DRAW);\n\n // set up texture coordinates for each face\n const textureCoordBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, textureCoordBuffer);\n\n const textureCoordinates = [\n // front\n 0.0, 0.0,\n 1.0, 0.0,\n 1.0, 1.0,\n 0.0, 1.0,\n // back\n 0.0, 0.0,\n 1.0, 0.0,\n 1.0, 1.0,\n 0.0, 1.0,\n // top\n 0.0, 0.0,\n 1.0, 0.0,\n 1.0, 1.0,\n 0.0, 1.0,\n // bottom\n 0.0, 0.0,\n 1.0, 0.0,\n 1.0, 1.0,\n 0.0, 1.0,\n // right\n 0.0, 0.0,\n 1.0, 0.0,\n 1.0, 1.0,\n 0.0, 1.0,\n // left\n 0.0, 0.0,\n 1.0, 0.0,\n 1.0, 1.0,\n 0.0, 1.0,\n ];\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(textureCoordinates), gl.STATIC_DRAW);\n\n // build element array buffer\n const indexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\n // define each face as two triangles\n const indices = [\n 0, 1, 2, 0, 2, 3, // front\n 4, 5, 6, 4, 6, 7, // back\n 8, 9, 10, 8, 10, 11, // top\n 12, 13, 14, 12, 14, 15, // bottom\n 16, 17, 18, 16, 18, 19, // right\n 20, 21, 22, 20, 22, 23, // left\n ];\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW);\n\n return {\n position: positionBuffer,\n normal: normalBuffer,\n textureCoord: textureCoordBuffer,\n indices: indexBuffer,\n };\n}", "function initShaders() {\n const vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader, VERTEX_SHADER_SOURCE);\n gl.compileShader(vertexShader);\n const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragmentShader, FRAGMENT_SHADER_SOURCE);\n gl.compileShader(fragmentShader);\n\n // Create the shader program\n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n // If creating the shader program failed, alert\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n throw new Error('Unable to initialize the shader program!');\n }\n\n gl.useProgram(shaderProgram);\n\n vertexPositionAttribute = gl.getAttribLocation(shaderProgram, 'aVertexPosition');\n gl.enableVertexAttribArray(vertexPositionAttribute);\n\n textureCoordAttribute = gl.getAttribLocation(shaderProgram, 'aTextureCoord');\n gl.enableVertexAttribArray(textureCoordAttribute);\n}", "function initShaders() {\n\n var fragmentShader = getShader(\"shader-frag\", gl.FRAGMENT_SHADER);\n var vertexShader = getShader(\"shader-vert\", gl.VERTEX_SHADER);\n\n scene.shader = {};\n\n var program = gl.createProgram();\n scene.shader['default'] = program;\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n gl.linkProgram(program);\n\n program.vertexPositionAttribute = gl.getAttribLocation(program, \"aVertPosition\");\n\n program.texturePositionAttribute = gl.getAttribLocation(program, \"aTexPosition\");\n\n program.transformUniform = gl.getUniformLocation(program, \"uTransform\");\n program.samplerUniform = gl.getUniformLocation(program, \"sampler\");\n\n // it's the only one for now so we can use it immediately\n gl.useProgram(program);\n gl.enableVertexAttribArray(program.vertexPositionAttribute);\n gl.enableVertexAttribArray(program.texturePositionAttribute);\n}", "function initShader(gl)\n{\n // load and compile the fragment and vertex shader\n let fragmentShader = createShader(gl, fragmentShaderSource, \"fragment\");\n let vertexShader = createShader(gl, vertexShaderSource, \"vertex\");\n\n // link them together into a new program\n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n // get pointers to the shader params\n shaderVertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"vertexPos\");\n gl.enableVertexAttribArray(shaderVertexPositionAttribute);\n\n shaderVertexColorAttribute = gl.getAttribLocation(shaderProgram, \"vertexColor\");\n gl.enableVertexAttribArray(shaderVertexColorAttribute);\n \n shaderProjectionMatrixUniform = gl.getUniformLocation(shaderProgram, \"projectionMatrix\");\n shaderModelViewMatrixUniform = gl.getUniformLocation(shaderProgram, \"modelViewMatrix\");\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert(\"Could not initialise shaders\");\n }\n}", "function initBuffers() {\n // Create and bind VAO\n gl.vectorsVAO = gl.createVertexArray();\n gl.bindVertexArray(gl.vectorsVAO);\n\n // Load the vertex coordinate data onto the GPU and associate with attribute\n gl.posBuffer = gl.createBuffer(); // create position buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, gl.posBuffer); // bind the position buffer\n gl.bufferData(gl.ARRAY_BUFFER, 100000*2*Float32Array.BYTES_PER_ELEMENT, gl.DYNAMIC_DRAW); // load the data into the position buffer\n gl.vertexAttribPointer(gl.program.aPosition, 2, gl.FLOAT, false, 0, 0); // associate the buffer with \"aPosition\" as length-2 vectors of floats\n gl.enableVertexAttribArray(gl.program.aPosition); // enable this set of data\n\n // Load the vertex color data onto the GPU and associate with attribute\n gl.colorBuffer = gl.createBuffer(); \n gl.bindBuffer(gl.ARRAY_BUFFER, gl.colorBuffer); \n gl.bufferData(gl.ARRAY_BUFFER, 100000*3*Float32Array.BYTES_PER_ELEMENT, gl.DYNAMIC_DRAW);\n gl.vertexAttribPointer(gl.program.aColor, 3, gl.FLOAT, false, 0, 0); // associate the buffer with \"aColor\" as length-3 vectors of floats\n gl.enableVertexAttribArray(gl.program.aColor);\n \n // Cleanup\n gl.bindVertexArray(null);\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n}", "constructor()\n\t{\n\t\t// Compile the shader program\n\t\tthis.prog = InitShaderProgram( modelVS, modelFS );\n\t\t// Get the ids of the uniform variables in the shaders\n\t\tthis.mvp = gl.getUniformLocation( this.prog, 'mvp' );\n\n\t\t// Get the ids of the vertex attributes in the shaders\n\t\tthis.vertPos = gl.getAttribLocation( this.prog, 'pos' );\n\n\t\tthis.txc = gl.getAttribLocation(this.prog,'txc');\n\n\n\n\t\tthis.mv_ = gl.getUniformLocation( this.prog, 'mv_' );\n\t\tthis.mv = gl.getAttribLocation( this.prog, 'mv' );\n\n\t\tthis.norm = gl.getUniformLocation( this.prog, 'norm' );\n\t\tthis.normals = gl.getAttribLocation( this.prog, 'normals' );\n\n\n\n\t\tthis.sampler = gl.getUniformLocation(this.prog,'tex');\n\n\t\tthis.swap = gl.getUniformLocation(this.prog,'swap');\n\n\t\tthis.toShow = gl.getUniformLocation(this.prog,'toShow');\n\n\n\t\tthis.x = gl.getUniformLocation(this.prog,'x');\n\t\tthis.y = gl.getUniformLocation(this.prog,'y');\n\t\tthis.z = gl.getUniformLocation(this.prog,'z');\n\t\tthis.shiny = gl.getUniformLocation(this.prog,'shiny');\n\n\t\tthis.vertbuffer = gl.createBuffer();\n\t\tthis.textureBuffer = gl.createBuffer();\n\t\tthis.normalBuffer = gl.createBuffer();\n\n\t}", "function initShaders() {\n var fragmentShader = getShader(gl, \"shader-fs\");\n var vertexShader = getShader(gl, \"shader-vs\");\n \n // Create the shader program\n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n \n // If creating the shader program failed, alert\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert(\"Unable to initialize the shader program.\");\n }\n \n // start using shading program for rendering\n gl.useProgram(shaderProgram);\n \n // store location of aVertexPosition variable defined in shader\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n \n // turn on vertex position attribute at specified position\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n\n // store location of aTextureCoord variable defined in shader\n shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, \"aTextureCoord\");\n\n // turn on vertex texture coordinates attribute at specified position\n gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);\n\n // store location of uPMatrix variable defined in shader - projection matrix \n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n // store location of uMVMatrix variable defined in shader - model-view matrix \n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n\n // store location of uSampler variable defined in shader\n shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, \"uSampler\");\n}", "async function startup() {\n const canvas = document.getElementById(\"myCanvas\");\n gl = createGLContext(canvas);\n await initGL();\n\n requestAnimationFrame(draw);\n}", "init() {\n // Set up shader\n this.shader_loc =\n createProgram(gl, this.VERTEX_SHADER, this.FRAGMENT_SHADER);\n if (!this.shader_loc) {\n console.log(this.constructor.name +\n '.init() failed to create executable Shaders on the GPU.');\n return;\n }\n gl.program = this.shader_loc;\n\n this.vbo_loc = gl.createBuffer();\n if (!this.vbo_loc) {\n console.log(this.constructor.name +\n '.init() failed to create VBO in GPU.');\n return;\n }\n gl.bindBuffer(gl.ARRAY_BUFFER, this.vbo_loc);\n gl.bufferData(gl.ARRAY_BUFFER, this.vbo, gl.STATIC_DRAW);\n\n // Set up attributes\n this.attributes.forEach((attribute, i) => {\n attribute.location =\n gl.getAttribLocation(this.shader_loc, attribute.name);\n if (attribute.locaiton < 0) {\n console.log(this.constructor.name +\n '.init() Failed to get GPU location of ' +\n attribute.name);\n return;\n }\n });\n\n // Set up uniforms\n this.u_mvp_matrix_loc =\n gl.getUniformLocation(this.shader_loc, 'u_mvp_matrix_' + this.box_num);\n if (!this.u_mvp_matrix_loc) {\n console.log(this.constructor.name +\n '.init() failed to get GPU location for u_mvp_matrix_' + this.box_num + ' uniform');\n return;\n }\n\n // Set up texture for raytraced image\n if (this.box_num == 1) {\n this.u_texture_location = gl.createTexture();\n if (!this.u_texture_location) {\n console.log(this.constructor.name +\n '.init() failed to create the texture object');\n return;\n }\n\n this.u_sampler_location = gl.getUniformLocation(this.shader_loc, 'u_sampler_' + this.box_num);\n if (!this.u_sampler_location) {\n console.log(this.constructor.name +\n '.init() failed to get GPU location for u_sampler_' + this.box_num + ' uniform');\n return;\n }\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, this.u_texture_location);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, g_scene.buffer.width, g_scene.buffer.height, 0, gl.RGB, gl.UNSIGNED_BYTE, g_scene.buffer.iBuf);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n }\n }", "function main() {\n var canvas = document.querySelector(\"#glcanvas\"); // or document.getElementById(\"myGLCanvas\");\n canvas = WebGLDebugUtils.makeLostContextSimulatingCanvas(canvas);\n\n const gl = WebGLDebugUtils.makeDebugContext(createGLContext(canvas)); // Init the GL context\n const wgl = {}; // The object to hold all web gl information\n wgl.fpsCounter = document.getElementById(\"fps\"); // The FPS counter\n const render = createRenderFunction(gl, wgl, drawScene);\n\n init(gl, wgl); // Initialize shaders, models/buffers and gl properties\n\n initListeners(gl, wgl, canvas, render); // Add listeners to the canvas\n initMatrixStack(gl, wgl); // Setup the stack functionality\n initDrawables(gl, wgl); // Prepare the drawn objects\n \n wgl.requestId = requestAnimationFrame(render); // start the render loop\n}", "function main() {\n\n // basically this function does setup that \"should\" only have to be done once,\n // while draw() does things that have to be repeated each time the canvas is\n // redrawn\n\n // retrieve <canvas> element\n var canvas = document.getElementById('theCanvas');\n\n // key handlers\n window.onkeypress = handleKeyPress;\n\n // get the rendering context for WebGL, using the utility from the teal book\n gl = getWebGLContext(canvas, false);\n if (!gl) {\n console.log('Failed to get the rendering context for WebGL');\n return;\n }\n\n // load and compile the shader pair, using utility from the teal book\n var vshaderSource = document.getElementById('vertexShader').textContent;\n var fshaderSource = document.getElementById('fragmentShader').textContent;\n if (!initShaders(gl, vshaderSource, fshaderSource)) {\n console.log('Failed to intialize shaders.');\n return;\n }\n\n // retain a handle to the shader program, then unbind it\n // (This looks odd, but the way initShaders works is that it \"binds\" the shader and\n // stores the handle in an extra property of the gl object. That's ok, but will really\n // mess things up when we have more than one shader pair.)\n shader = gl.program;\n gl.useProgram(null);\n\n // create model data\n var cube = makeCube();\n\n // buffer for vertex positions for triangles\n vertexBuffer = gl.createBuffer();\n if (!vertexBuffer) {\n\t console.log('Failed to create the buffer object');\n\t return;\n }\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, cube.vertices, gl.STATIC_DRAW);\n\n // buffer for vertex colors\n vertexColorBuffer = gl.createBuffer();\n if (!vertexColorBuffer) {\n\t console.log('Failed to create the buffer object');\n\t return;\n }\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexColorBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, cube.colors, gl.STATIC_DRAW);\n\n\n // axes\n axisBuffer = gl.createBuffer();\n if (!axisBuffer) {\n\t console.log('Failed to create the buffer object');\n\t return;\n }\n gl.bindBuffer(gl.ARRAY_BUFFER, axisBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, axisVertices, gl.STATIC_DRAW);\n\n // buffer for axis colors\n axisColorBuffer = gl.createBuffer();\n if (!axisColorBuffer) {\n\t console.log('Failed to create the buffer object');\n\t return;\n }\n gl.bindBuffer(gl.ARRAY_BUFFER, axisColorBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, axisColors, gl.STATIC_DRAW);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n\n // specify a fill color for clearing the framebuffer\n gl.clearColor(0.9, 0.9, 0.9, 1.0);\n\n gl.enable(gl.DEPTH_TEST);\n\n\n\n\n // define an animation loop\n var animate = function() {\n draw(theObject);\n // request that the browser calls animate() again \"as soon as it can\"\n requestAnimationFrame(animate, canvas);\n };\n\n // start drawing!\n animate();\n\n\n}", "initBuffers() {\n this.vertices = [\n this.x1, this.y1, 0,\n this.x2, this.y1, 0,\n this.x2, this.y2, 0,\n this.x1, this.y2, 0\n ];\n\n this.indices = [\n 0, 1, 3,\n 2, 3, 1\n ];\n\n this.normals = [\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1\n ];\n\n let maxS = (this.x2 - this.x1) / this.ls;\n let maxT = (this.y2 - this.y1) / this.lt;\n\n this.texCoords = [\n 0, maxT,\n maxS, maxT,\n maxS, 0,\n 0, 0\n ];\n\n this.primitiveType = this.scene.gl.TRIANGLES;\n this.initGLBuffers();\n }", "function initShaders() {\n // Load the shaders and compile them (shaders are located in the HTML)\n var vertexShader = loadShader( gl.VERTEX_SHADER, document.getElementById('vshader').innerHTML );\n var fragmentShader = loadShader( gl.FRAGMENT_SHADER, document.getElementById('fshader').innerHTML );\n \n // Create the program object\n var programObject = gl.createProgram();\n gl.attachShader(programObject, vertexShader);\n gl.attachShader(programObject, fragmentShader);\n gl_program = programObject;\n \n // link the program\n gl.linkProgram(gl_program);\n \n // verify link\n var linked = gl.getProgramParameter(gl_program, gl.LINK_STATUS);\n if( !linked && !gl.isContextLost()) {\n var infoLog = gl.getProgramInfoLog(gl_program);\n window.console.log(\"Error linking program:\\n\" + infoLog);\n gl.deleteProgram(gl_program);\n return;\n }\n \n // Get the uniform/attribute locations\n gl_program_loc.uMVMatrix = gl.getUniformLocation(gl_program, \"uMVMatrix\");\n gl_program_loc.uPMatrix = gl.getUniformLocation(gl_program, \"uPMatrix\");\n gl_program_loc.uNMatrix = gl.getUniformLocation(gl_program, \"uNMatrix\");\n gl_program_loc.uColor = gl.getUniformLocation(gl_program, \"uColor\");\n gl_program_loc.uLighting = gl.getUniformLocation(gl_program, \"uLighting\");\n gl_program_loc.aPosition = gl.getAttribLocation(gl_program, \"aPosition\");\n}", "function setupShaders() {\n vertexShader = loadShaderFromDOM(\"shader-vs\");\n fragmentShader = loadShaderFromDOM(\"shader-fs\");\n\n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert(\"Failed to setup shaders\");\n }\n\n gl.useProgram(shaderProgram);\n\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n\n shaderProgram.vertexNormalAttribute = gl.getAttribLocation(shaderProgram, \"aVertexNormal\");\n gl.enableVertexAttribArray(shaderProgram.vertexNormalAttribute);\n\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n shaderProgram.nMatrixUniform = gl.getUniformLocation(shaderProgram, \"uNMatrix\");\n shaderProgram.uniformLightPositionLoc = gl.getUniformLocation(shaderProgram, \"uLightPosition\");\n shaderProgram.uniformAmbientLightColorLoc = gl.getUniformLocation(shaderProgram, \"uAmbientLightColor\");\n shaderProgram.uniformDiffuseLightColorLoc = gl.getUniformLocation(shaderProgram, \"uDiffuseLightColor\");\n shaderProgram.uniformSpecularLightColorLoc = gl.getUniformLocation(shaderProgram, \"uSpecularLightColor\");\n shaderProgram.uniformShininessLoc = gl.getUniformLocation(shaderProgram, \"uShininess\");\n shaderProgram.uniformAmbientMaterialColorLoc = gl.getUniformLocation(shaderProgram, \"uKAmbient\");\n shaderProgram.uniformDiffuseMaterialColorLoc = gl.getUniformLocation(shaderProgram, \"uKDiffuse\");\n shaderProgram.uniformSpecularMaterialColorLoc = gl.getUniformLocation(shaderProgram, \"uKSpecular\");\n\n shaderProgram.uSkyboxSampler = gl.getUniformLocation(shaderProgram, \"uSkyboxSampler\");\n shaderProgram.ucheckSky = gl.getUniformLocation(shaderProgram, \"ucheckSky\");\n\n\n}", "function initWebGL() {\n try { \n gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); \n } catch(e) {\n }\n \n if (gl) {\n WIDTH = canvas.clientWidth.toFixed(1);\n HEIGHT = canvas.clientHeight.toFixed(1);\n ui = new UI();\n ui.setObjects(generateScene());\n\t\tresult.ui = ui;\n var start = new Date();\n setInterval(function(){ tick((new Date() - start) * 0.001); }, 1000 / 60);\n } else {\n alert('Your browser does not support WebGL.');\n }\n}", "bindForGL(gl) {\nthis.gl = gl;\n//--------\n// Bind to GL\nthis.bindTextures();\nreturn this.setUpMeshesForGL();\n}", "function startup() {\n let canvas = document.getElementById(renderSettings.viewPort.canvasId);\n\n if (enableDebugging) {\n gl = createGLContext(canvas);\n } else {\n gl = canvas.getContext(\"webgl\");\n }\n setupRotationMatrices();\n initGL();\n resizeWindow();\n\n window.addEventListener(\"keyup\", onKeyup, false);\n window.addEventListener(\"keydown\", onKeydown, false);\n window.addEventListener(\"resize\", resizeWindow, false);\n window.addEventListener(\"visibilityChange\", handleVisibilityChange, false);\n //drawSimpleCurveScene();\n drawAnimated(0);\n}", "function initWebGL() {\n /* Add default pointer */\n var pointers = [];\n pointers.push(new Pointer());\n /* Get webGL context */\n\n var webGL = canvas.getContext('webgl2', defualts.DRAWING_PARAMS);\n var isWebGL2 = !!webGL;\n if (!isWebGL2) webGL = canvas.getContext('webgl', defualts.DRAWING_PARAMS) || canvas.getContext('experimental-webgl', defualts.DRAWING_PARAMS);\n /* Get color formats */\n\n var colorFormats = getFormats();\n /* Case support adjustments */\n\n if (isMobile()) defualts.behavior.render_shaders = false;\n\n if (!colorFormats.supportLinearFiltering) {\n defualts.behavior.render_shaders = false;\n defualts.behavior.render_bloom = false;\n }\n /* Make our shaders and shader programs */\n\n\n var SHADER = {\n baseVertex: compileShader(webGL.VERTEX_SHADER, defualts.SHADER_SOURCE.vertex),\n clear: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.clear),\n color: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.color),\n background: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.background),\n display: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.display),\n displayBloom: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.displayBloom),\n displayShading: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.displayShading),\n displayBloomShading: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.displayBloomShading),\n bloomPreFilter: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.bloomPreFilter),\n bloomBlur: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.bloomBlur),\n bloomFinal: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.bloomFinal),\n splat: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.splat),\n advectionManualFiltering: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.advectionManualFiltering),\n advection: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.advection),\n divergence: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.divergence),\n curl: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.curl),\n vorticity: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.vorticity),\n pressure: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.pressure),\n gradientSubtract: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.gradientSubtract)\n };\n var programs = formShaderPrograms(colorFormats.supportLinearFiltering);\n /* Worker Classes and Functions */\n\n /**\n * Is It Mobile?:\n * Detects whether or not a device is mobile by checking the user agent string\n *\n * @returns {boolean}\n */\n\n function isMobile() {\n return /Mobi|Android/i.test(navigator.userAgent);\n }\n /**\n * Get Formats:\n * Enable color extensions, linear filtering extensions, and return usable color formats RGBA,\n * RG (Red-Green), and R (Red).\n *\n * @returns {{formatRGBA: {internalFormat, format}, supportLinearFiltering: OES_texture_half_float_linear,\n * formatR: {internalFormat, format}, halfFloatTexType: *, formatRG: {internalFormat, format}}}\n */\n\n\n function getFormats() {\n /* Color Formats */\n var formatRGBA;\n var formatRG;\n var formatR;\n var halfFloat;\n var supportLinearFiltering;\n /* Enables webGL color extensions and get linear filtering extension*/\n\n if (isWebGL2) {\n webGL.getExtension('EXT_color_buffer_float');\n supportLinearFiltering = webGL.getExtension('OES_texture_float_linear');\n } else {\n halfFloat = webGL.getExtension('OES_texture_half_float');\n supportLinearFiltering = webGL.getExtension('OES_texture_half_float_linear');\n }\n\n var HALF_FLOAT_TEXTURE_TYPE = isWebGL2 ? webGL.HALF_FLOAT : halfFloat.HALF_FLOAT_OES;\n /* Set color to black for when color buffers are cleared */\n\n webGL.clearColor(0.0, 0.0, 0.0, 1.0);\n /* Retrieve color formats */\n\n if (isWebGL2) {\n formatRGBA = getSupportedFormat(webGL.RGBA16F, webGL.RGBA, HALF_FLOAT_TEXTURE_TYPE);\n formatRG = getSupportedFormat(webGL.RG16F, webGL.RG, HALF_FLOAT_TEXTURE_TYPE);\n formatR = getSupportedFormat(webGL.R16F, webGL.RED, HALF_FLOAT_TEXTURE_TYPE);\n } else {\n formatRGBA = getSupportedFormat(webGL.RGBA, webGL.RGBA, HALF_FLOAT_TEXTURE_TYPE);\n formatRG = getSupportedFormat(webGL.RGBA, webGL.RGBA, HALF_FLOAT_TEXTURE_TYPE);\n formatR = getSupportedFormat(webGL.RGBA, webGL.RGBA, HALF_FLOAT_TEXTURE_TYPE);\n }\n /** Get Supported Format\n * Using the specified internal format, we retrieve and return the desired color format to be\n * rendered with\n *\n * @param internalFormat: A GLenum that specifies the color components within the texture\n * @param format: Another GLenum that specifies the format of the texel data.\n * @returns {{internalFormat: *, format: *}|null|({internalFormat, format}|null)}\n */\n\n\n function getSupportedFormat(internalFormat, format, type) {\n var isSupportRenderTextureFormat;\n var texture = webGL.createTexture();\n /* Set texture parameters */\n\n webGL.bindTexture(webGL.TEXTURE_2D, texture);\n webGL.texParameteri(webGL.TEXTURE_2D, webGL.TEXTURE_MIN_FILTER, webGL.NEAREST);\n webGL.texParameteri(webGL.TEXTURE_2D, webGL.TEXTURE_MAG_FILTER, webGL.NEAREST);\n webGL.texParameteri(webGL.TEXTURE_2D, webGL.TEXTURE_WRAP_S, webGL.CLAMP_TO_EDGE);\n webGL.texParameteri(webGL.TEXTURE_2D, webGL.TEXTURE_WRAP_T, webGL.CLAMP_TO_EDGE);\n /* Specify a 2D texture image */\n\n webGL.texImage2D(webGL.TEXTURE_2D, 0, internalFormat, 4, 4, 0, format, type, null);\n /* Attach texture to frame buffer */\n\n var fbo = webGL.createFramebuffer();\n webGL.bindFramebuffer(webGL.FRAMEBUFFER, fbo);\n webGL.framebufferTexture2D(webGL.FRAMEBUFFER, webGL.COLOR_ATTACHMENT0, webGL.TEXTURE_2D, texture, 0);\n /* Check if current format is supported */\n\n var status = webGL.checkFramebufferStatus(webGL.FRAMEBUFFER);\n isSupportRenderTextureFormat = status === webGL.FRAMEBUFFER_COMPLETE;\n /* If not supported use fallback format, until we have no fallback */\n\n if (!isSupportRenderTextureFormat) {\n switch (internalFormat) {\n case webGL.R16F:\n return getSupportedFormat(webGL.RG16F, webGL.RG, type);\n\n case webGL.RG16F:\n return getSupportedFormat(webGL.RGBA16F, webGL.RGBA, type);\n\n default:\n return null;\n }\n }\n\n return {\n internalFormat: internalFormat,\n format: format\n };\n }\n\n return {\n formatRGBA: formatRGBA,\n formatRG: formatRG,\n formatR: formatR,\n halfFloatTexType: HALF_FLOAT_TEXTURE_TYPE,\n supportLinearFiltering: supportLinearFiltering\n };\n }\n /**\n * Compile Shader:\n * Makes a new webGL shader of type `type` using the provided GLSL source. The `type` is either of\n * `VERTEX_SHADER` or `FRAGMENT_SHADER`\n *\n * @param type: Passed to `createShader` to define the shader type\n * @param source: A GLSL source script, used to define the shader properties\n * @returns {WebGLShader}: A webGL shader of the parameterized type and source\n */\n\n\n function compileShader(type, source) {\n /* Create shader, link the source, and compile the GLSL*/\n var shader = webGL.createShader(type);\n webGL.shaderSource(shader, source);\n webGL.compileShader(shader);\n /* TODO: Finish error checking */\n\n if (!webGL.getShaderParameter(shader, webGL.COMPILE_STATUS)) throw webGL.getShaderInfoLog(shader);\n return shader;\n }\n /**\n * Form Shader Programs:\n * Assembles shaders into a webGl program we can use to write to our context\n *\n * @param supportLinearFiltering: A bool letting us know if we support linear filtering\n * @returns {{displayBloomProgram: GLProgram, vorticityProgram: GLProgram, displayShadingProgram: GLProgram,\n * displayBloomShadingProgram: GLProgram, gradientSubtractProgram: GLProgram, advectionProgram: GLProgram,\n * bloomBlurProgram: GLProgram, colorProgram: GLProgram, divergenceProgram: GLProgram, clearProgram: GLProgram,\n * splatProgram: GLProgram, displayProgram: GLProgram, bloomPreFilterProgram: GLProgram, curlProgram: GLProgram,\n * bloomFinalProgram: GLProgram, pressureProgram: GLProgram, backgroundProgram: GLProgram}}: Programs used to\n * render shaders\n *\n */\n\n\n function formShaderPrograms(supportLinearFiltering) {\n return {\n clearProgram: new GLProgram(SHADER.baseVertex, SHADER.clear, webGL),\n colorProgram: new GLProgram(SHADER.baseVertex, SHADER.color, webGL),\n backgroundProgram: new GLProgram(SHADER.baseVertex, SHADER.background, webGL),\n displayProgram: new GLProgram(SHADER.baseVertex, SHADER.display, webGL),\n displayBloomProgram: new GLProgram(SHADER.baseVertex, SHADER.displayBloom, webGL),\n displayShadingProgram: new GLProgram(SHADER.baseVertex, SHADER.displayShading, webGL),\n displayBloomShadingProgram: new GLProgram(SHADER.baseVertex, SHADER.displayBloomShading, webGL),\n bloomPreFilterProgram: new GLProgram(SHADER.baseVertex, SHADER.bloomPreFilter, webGL),\n bloomBlurProgram: new GLProgram(SHADER.baseVertex, SHADER.bloomBlur, webGL),\n bloomFinalProgram: new GLProgram(SHADER.baseVertex, SHADER.bloomFinal, webGL),\n splatProgram: new GLProgram(SHADER.baseVertex, SHADER.splat, webGL),\n advectionProgram: new GLProgram(SHADER.baseVertex, supportLinearFiltering ? SHADER.advection : SHADER.advectionManualFiltering, webGL),\n divergenceProgram: new GLProgram(SHADER.baseVertex, SHADER.divergence, webGL),\n curlProgram: new GLProgram(SHADER.baseVertex, SHADER.curl, webGL),\n vorticityProgram: new GLProgram(SHADER.baseVertex, SHADER.vorticity, webGL),\n pressureProgram: new GLProgram(SHADER.baseVertex, SHADER.pressure, webGL),\n gradientSubtractProgram: new GLProgram(SHADER.baseVertex, SHADER.gradientSubtract, webGL)\n };\n }\n\n return {\n programs: programs,\n webGL: webGL,\n colorFormats: colorFormats,\n pointers: pointers\n };\n}", "function initScene(gl) {\r\n\r\n //////////////////////////////////////////\r\n //////// set up geometry - plane ////////\r\n //////////////////////////////////////////\r\n\r\n var vPlane = [];\r\n\r\n for (var j = height - 1; j >= 0; j--) {\r\n for (var i = 0; i < width; i++) {\r\n var A = vec3.fromValues(i - (width - 1) * 0.5,\r\n height - 1 - j - (height - 1) * 0.5,\r\n 0);\r\n // push the vertex coordinates\r\n vPlane.push(A[0]);\r\n vPlane.push(A[1]);\r\n vPlane.push(A[2]);\r\n // push the normal coordinates\r\n vPlane.push(0);\r\n vPlane.push(0);\r\n vPlane.push(1);\r\n vPlane.push(i);\r\n vPlane.push(j);\r\n }\r\n }\r\n\r\n var iPlane = [];\r\n\r\n for (var j = 0; j < height - 1; j++) {\r\n for (var i = 0; i < width - 1; i++) {\r\n iPlane.push(j * width + i);\r\n iPlane.push((j + 1) * width + i);\r\n iPlane.push(j * width + i + 1);\r\n iPlane.push(j * width + i + 1);\r\n iPlane.push((j + 1) * width + i);\r\n iPlane.push((j + 1) * width + i + 1);\r\n }\r\n }\r\n\r\n // create vertex buffer on the gpu\r\n vboPlane = gl.createBuffer();\r\n // bind buffer\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vboPlane);\r\n // copy data from cpu to gpu memory\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vPlane), gl.STATIC_DRAW);\r\n\r\n // create index buffer on the gpu\r\n iboPlane = gl.createBuffer();\r\n // bind buffer\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, iboPlane);\r\n // copy data from cpu to gpu memory\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(iPlane), gl.STATIC_DRAW);\r\n\r\n iboNPlane = iPlane.length;\r\n\r\n ///////////////////////////////////////////////\r\n //////// set up geometry - light source //////\r\n ///////////////////////////////////////////////\r\n\r\n var vLight = [0.0, 0.0, 0.0];\r\n\r\n var iLight = [0];\r\n\r\n // create vertex buffer on the gpu\r\n vboLight = gl.createBuffer();\r\n // bind buffer\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vboLight);\r\n // copy data from cpu to gpu memory\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vLight), gl.STATIC_DRAW);\r\n\r\n // create index buffer on the gpu\r\n iboLight = gl.createBuffer();\r\n // bind buffer\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, iboLight);\r\n // copy data from cpu to gpu memory\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(iLight), gl.STATIC_DRAW);\r\n\r\n iboNLight = iLight.length;\r\n\r\n ////////////////////////////////\r\n //////// set up shaders //////\r\n ////////////////////////////////\r\n shaderProgramPlane = shaderProgram(gl, \"shader-vs-phong\", \"shader-fs-phong\");\r\n shaderProgramLight = shaderProgram(gl, \"shader-vs-light\", \"shader-fs-light\");\r\n\r\n /////////////////////////////////\r\n //////// set up textures //////\r\n /////////////////////////////////\r\n var image = document.getElementById('checkerboard');\r\n textureCheckerboard = gl.createTexture();\r\n gl.bindTexture(gl.TEXTURE_2D, textureCheckerboard);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n gl.bindTexture(gl.TEXTURE_2D, null);\r\n\r\n\r\n \r\n // TODO 6.3a): Set up the texture containing the checkerboard\r\n // image. Have a look at the functions gl.bindTexture(),\r\n // gl.texImage2D() and gl.texParameteri(). Also do not\r\n // forget to generate the mipmap pyramid using \r\n // gl.generateMipmap(). Note: Both format and internal\r\n // format parameter should be gl.RGBA, the data type\r\n // used should be gl.UNSIGNED_BYTE.\r\n gl.bindTexture(gl.TEXTURE_2D,textureCheckerboard);\r\n gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE,image);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n gl.generateMipmap(gl.TEXTURE_2D);\r\n gl.bindTexture(gl.TEXTURE_2D, null);\r\n\r\n var image = document.getElementById('cobblestone');\r\n textureCobblestone = gl.createTexture();\r\n\r\n \r\n // TODO 6.3b): Set up the texture containing the cobblestone\r\n // image, also using gl.bindTexture() and gl.texImage2D().\r\n // We do not need mipmapping here, so do not forget to \r\n // use gl.texParameteri() to set the minification filter \r\n // to gl.LINEAR. Format, internal format and type should\r\n // be the same as for the checkerboard texture.\r\n gl.bindTexture(gl.TEXTURE_2D, textureCobblestone);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\r\n gl.bindTexture(gl.TEXTURE_2D, null);\r\n\r\n\r\n \r\n\r\n }", "function InitBuffers(gl) {with(gl)\n{\n\t// Bind vertices (A rectangle)\n\tgl.verticesBuffer = createBuffer();\n\tbindBuffer(ARRAY_BUFFER, verticesBuffer);\n\tbufferData(ARRAY_BUFFER, new Float32Array([-1,-1, 1,-1, 1,1, -1,1]), STATIC_DRAW);\n\n\t// Bind vertex indices\n\tgl.verticesIndexBuffer = createBuffer();\n\tbindBuffer(ELEMENT_ARRAY_BUFFER, verticesIndexBuffer);\n\t\n\t // indices of vertices of two triangles that make a square \n\tvar indices = [0,1,2, 0,3,2];\n\tbufferData(ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), STATIC_DRAW);\n\t\n\t// Bind texture vertices\n\tgl.verticesTextureCoordBuffer = createBuffer();\n\tbindBuffer(gl.ARRAY_BUFFER, verticesTextureCoordBuffer);\n\tbufferData(gl.ARRAY_BUFFER, new Float32Array([0,1, 1,1, 1,0, 0,0]), STATIC_DRAW);\n}}", "function initBuffers() {\n //3 stk 3D vertekser:\n let positions = new Float32Array([\n 0.0, 0.5, 0,\n -0.5, -0.5, 0,\n 0.5, -0.5, 0]);\n\n //Farge til verteksene:\n let colors = new Float32Array([\n 1.0, 0.0, 0.0, 1.0,\t\t//Rød (RgbA)\n 0.0, 1.0, 0.0, 1.0,\t\t//Grønn (rGbA)\n 0.0, 0.0, 1.0, 1.0]);\t//Blå \t(rgBA)\n\n //POSISJONSBUFRET: oppretter, binder og skriver data til bufret:\n positionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);\n //Setter antall floats per verteks og antall vertekser i dette bufret:\n positionBuffer.itemSize = 3;\n positionBuffer.numberOfItems = positions.length / 3;\n\n //COLORBUFRET: oppretter, binder og skriver data til bufret:\n colorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW);\n //Setter antall floats per verteks og antall vertekser i dette bufret:\n colorBuffer.itemSize = 4; // NB!!\n colorBuffer.numberOfItems = colors.length / 4; // NB!!\n\n // Kople fra.\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n}", "function setupView() {\n startupDraw = 1;\n continueRender = 1;\n // Find the canvas on the page\n canvas = document.getElementById(\"gl-canvas\");\n \n // Initialize a WebGL context\n gl = WebGLUtils.setupWebGL(canvas);\n if (!gl) { \n alert(\"WebGL isn't available\"); \n }\n \n // Remove draw event listeners from 2d drawing mode\n canvas.removeEventListener(\"mousedown\", checkPoint, false);\n canvas.removeEventListener(\"mousemove\", movePoint, false);\n canvas.removeEventListener(\"mouseup\", endMove, false);\n\n // Setup HTML elements for the dropdown menu\n document.getElementById(\"demo\").innerHTML = \"View Mode\";\n document.getElementById(\"viewMenu\").style.display = \"block\";\n document.getElementById(\"drawMenu\").style.display = \"none\";\n\n // Load default shaders that do not use texture\n programId = initShaders(gl, \"vertex-shader\", \"fragment-shader\");\n gl.useProgram(programId);\n gl.enable(gl.DEPTH_TEST);\n \n // Set up events for the HTML controls\n initControlEvents();\n\n // Setup mouse and keyboard input\n initWindowEvents();\n \n // Configure WebGL\n gl.viewport(0, 0, canvas.width, canvas.height);\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n\n\n // Send light info to shader\n // Set default light position\n lightPosition = vec4(1.0, 1.0, 1.0, 1.0 );\n updateLights();\n\n draw();\n}" ]
[ "0.7592956", "0.7577131", "0.7577131", "0.7565573", "0.7540968", "0.74683285", "0.7447045", "0.74324614", "0.73960924", "0.73248386", "0.7213346", "0.7185595", "0.7144392", "0.7142932", "0.7096134", "0.7069807", "0.7034127", "0.7034127", "0.7004918", "0.69941723", "0.6988512", "0.6984112", "0.6983765", "0.698132", "0.69552433", "0.6954433", "0.6952995", "0.69496626", "0.6936784", "0.6913737", "0.68952805", "0.6863783", "0.68336135", "0.68334174", "0.6825822", "0.68191296", "0.6817912", "0.6816255", "0.68080413", "0.68007016", "0.67997926", "0.6795419", "0.6792201", "0.6787089", "0.6771282", "0.6769839", "0.6764383", "0.6762419", "0.6742477", "0.6738671", "0.67333066", "0.6729982", "0.672226", "0.67091465", "0.67084855", "0.6703568", "0.67021114", "0.6681588", "0.6681585", "0.66781974", "0.66778934", "0.66767126", "0.665334", "0.66486245", "0.6644016", "0.6642179", "0.66416246", "0.6633478", "0.6633297", "0.6625889", "0.66220945", "0.6616116", "0.66154045", "0.661488", "0.66132545", "0.66118246", "0.66089857", "0.66075754", "0.6606893", "0.6601906", "0.65988225", "0.65982157", "0.6591186", "0.65848833", "0.65691245", "0.6563306", "0.6561364", "0.656017", "0.6558345", "0.65518636", "0.65426135", "0.653455", "0.6533274", "0.6518928", "0.65185463", "0.6517108", "0.65080404", "0.6498758", "0.6497168", "0.64918375" ]
0.7195072
11
end password validate ///////////// confirm password function start from here
function AdminConfirmPassword() { var password = $("#admin_password").val() var confirm_pas = $("#confirm_password_reset").val() if (confirm_pas.length == null || confirm_pas.length == "") { $("#conf_password_reset_label").show(); $("#confirm_password_reset").addClass("has-error"); $("#conf_password_reset_label").text("This Field is required"); return false; } else { if(confirm_pas != password) { $("#confirm_password_reset").addClass("has-error"); $("#conf_password_reset_label").show(); $("#conf_password_reset_label").text("Password is not match"); return false; } else { $("#confirm_password_reset").removeClass("has-error"); $("#conf_password_reset_label").hide(); $("#conf_password_reset_label").text(""); return true; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validatePassword() {\n\n // empty array for the final if statement to check\n var errors = [];\n\n if (confirmLowerCase === true) {\n if (finalPass.search(/[a-z]/) < 0) {\n errors.push(\"lower\");\n }\n }\n if (confirmUpperCase === true) {\n if (finalPass.search(/[A-Z]/) < 0) {\n errors.push(\"upper\");\n }\n }\n if (confirmNumeric === true) {\n if (finalPass.search(/[0-9]/i) < 0) {\n errors.push(\"numeric\");\n }\n }\n if (confirmSpecialChar === true) {\n if (finalPass.search(/[!?@#$%^&*]/i) < 0) {\n errors.push(\"specialchar\");\n }\n }\n // if error array has contents, clear password string and regenerate password\n if (errors.length > 0) {\n finalPass = \"\"\n return passwordGen();\n }\n }", "function confirmPassword(p1, p2 ){ if (p1.value && p1.value !== p2.value) {\n password2Ok = 0;\n showError(p2, \"Both passwords must match.\")\n} else if (p1.value && p1.value === p2.value) {\n password2Ok = 1;\n showSuccess(p2)\n}\n}", "function checkConfirmPassword()\r\n\t{\r\n\t\tvar newPassword=$(\"#Npass\").val();\r\n\t\tvar confirmPassword=$(\"#Cpass\").val();\r\n\t\t \r\n\t\t if(!isEmpty(confirmPassword))\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t$(\"#Cpass\").css(\"border-color\",\"red\");\r\n\t\t\t\t$(\"#CpassP\").text(\"confirm password is Required\").css(\"color\",\"red\").show();\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\tif(!passwordRegEx.test(confirmPassword))\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$(\"#Cpass\").css(\"border-color\",\"red\");\r\n\t\t\t\t$(\"#CpassP\").text(\"Invalid confirm password Entered\").css(\"color\",\"red\").show();\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\tif(newPassword!=confirmPassword)\r\n\t\t\t{\r\n\t\t\t\r\n\t\t\t\t$(\"#Cpass,#Npass\").css(\"border-color\",\"red\");\r\n\t\t\t\t$(\"#CpassP,#NpassP\").text(\"New and confirm Password must be same\").css(\"color\",\"red\").show();\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t \r\n\t\telse\r\n\t\t\t{\r\n\t\t\t\t$(\"#Cpass\").css(\"border-color\",\"\");\r\n\t\t\t\t$(\"#CpassP\").hide();\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}\t\r\n\t}", "function validatePassword() {\n let oldPass = new Password(dom('#oldPassword').value)\n let newPass = new Password(dom('#newPassword').value)\n let newPassConfirm = new Password(dom('#newPassword2').value)\n let errorPrompt = dom('#passwordError')\n\n if (!newPass.match(newPassConfirm)) {\n errorPrompt.innerText = \"Passwords do not match\"\n return false\n }\n if (newPass.lessEq(7) || newPassConfirm.lessEq(7)) {\n errorPrompt.innerText = \"New password must be at least 8 characters\"\n return false\n }\n if (!oldPass.matchStr(\"test\")) {\n errorPrompt.innerText = \"Incorrect password\"\n return false\n }\n errorPrompt.innerText = \"\"\n return true\n}", "function isValidPassword(password) {\n\n\n}", "function check_Modify_password_form() {\n var emailcode = document.getElementById(\"emailcodeText\").value;\n var password = document.getElementById(\"passwordText\").value;\n var confirm_password = document.getElementById(\"Confirm_passwordText\").value;\n\n if(emailcode.length ==0){\n alert(\"Please enter the code\");\n return false;\n }\n if (password.length <6) {\n alert(\"Please enter the 6 digital password\");\n return false;\n }\n if (password != confirm_password) {\n alert(\"The passwords are not match, Please enter again\");\n return false;\n }\n\n return true;\n\n}", "function passwordCheck(form){\r\n var p1=signup.pass.value.trim();\r\n var p2=signup.repass.value.trim();\r\n var errors= document.querySelector(\".errmessage\");\r\n var charstring =\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\r\n var chars= \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\r\n var numstring =\"0123456789\";\r\n var passAlpha=false; \r\n var passNum=false; \r\n var passChar=false; \r\n\r\n\r\n if(p1.length<8){\r\n clear();\r\n errors.innerHTML+= \"<p>* Password must be at least 8 characters long. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n\r\n if(chars.indexOf(p1.substr(0,1))>=0){\r\n passChar=true;\r\n }\r\n if(!passChar){\r\n clear();\r\n errors.innerHTML+= \"<p>* Password must begin with a character. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n\r\n for(var i=0; i<p1.length; i++){\r\n clear(); \r\n if(charstring.indexOf(p1.substr(i,1))>=0){\r\n passAlpha=true;\r\n }\r\n }\r\n\r\n if(!passAlpha){\r\n errors.innerHTML+= \"<p>* Password must have at least one upper case letter. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n\r\n for(var i=0; i<p1.length; i++){\r\n clear(); \r\n if(numstring.indexOf(p1.substr(i,1))>=0){\r\n passNum=true;\r\n }\r\n }\r\n if(!passNum){\r\n errors.innerHTML+= \"<p>* Password must have at least one number. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n \r\n if(p2!=\"\" && p1!=p2){\r\n clear(); \r\n errors.innerHTML+= \"<p>* Passwords do not match! <p>\";\r\n signup.repass.focus();\r\n return false; \r\n }\r\n\r\n return true; \r\n}", "function validatePassword(){var r=document.getElementById(\"passwordfield\").value,e=document.getElementById(\"confirmPasswordfield\").value;e!=r?document.getElementById(\"confirmPasswordfield\").setCustomValidity(\"Passwords Don't Match\"):document.getElementById(\"confirmPasswordfield\").setCustomValidity(\"\")}", "function validatePasswordForm(){\n\tvar old_password = document.getElementById(\"old_password\");\n\tvar oldPasswordError = document.getElementById(\"oldPasswordError\");\n\tvar new_password = document.getElementById(\"new_password\");\n\tvar newPasswordError = document.getElementById(\"newPasswordError\");\n\tvar new_password_confirmation = document.getElementById(\"new_password_confirmation\");\n\tvar passwordConfirmationError = document.getElementById(\"passwordConfirmationError\");\n\n\n\tif(old_password.value.trim().length < 1){\n\t\told_password.focus();\n\t\toldPasswordError.innerHTML = \"Old password field can not be empty\";\n\t\told_password.style.border=\"1px solid red\";\n\t\tevent.preventDefault();\n\t}else if(old_password.value.trim().length > 60){\n\t\told_password.focus();\n\t\toldPasswordError.innerHTML = \"Too long password\";\n\t\told_password.style.border=\"1px solid red\";\n\t\tevent.preventDefault();\n\t}else{\n\t\toldPasswordError.innerHTML = \"\";\n\t\told_password.style.border=\"1px solid #efefef\";\n\t}\n\n// new pass\n\tif(new_password.value.trim().length < 1){\n\t\tnew_password.focus();\n\t\tnewPasswordError.innerHTML = \"New password field can not be empty\";\n\t\tnew_password.style.border=\"1px solid red\";\n\t\tevent.preventDefault();\n\t}else if(new_password.value.trim().length > 0 && new_password.value.trim().length < 8 ){\n\t\tnew_password.focus();\n\t\tnewPasswordError.innerHTML = \"New password should be mininum 8 charachters\";\n\t\tnew_password.style.border=\"1px solid red\";\n\t\tevent.preventDefault();\n\t}\n\telse if(new_password.value.trim().length > 60){\n\t\tnew_password.focus();\n\t\tnewPasswordError.innerHTML = \"Too long password\";\n\t\tnew_password.style.border=\"1px solid red\";\n\t\tevent.preventDefault();\n\t}else if(old_password.value.trim() === new_password.value.trim()){\n\t\tnew_password.focus();\n\t\tnewPasswordError.innerHTML = \"Your new password should not be same as old password\";\n\t\tnew_password.style.border=\"1px solid red\";\n\t\tevent.preventDefault();\n\t}else if(new_password_confirmation.value.trim() !== new_password.value.trim()){\n\t\tnew_password.focus();\n\t\tnewPasswordError.innerHTML = \"Password confirmation does not match\";\n\t\tnew_password.style.border=\"1px solid red\";\n\t\tevent.preventDefault();\n\t}else{\n\t\tnewPasswordError.innerHTML = \"\";\n\t\tnew_password.style.border=\"1px solid #efefef\";\n\t}\t\n\n// confirmation pass\n\tif(new_password_confirmation.value.trim().length < 1){\n\t\tnew_password_confirmation.focus();\n\t\tpasswordConfirmationError.innerHTML = \"password confirmation field can not be empty\";\n\t\tnew_password_confirmation.style.border=\"1px solid red\";\n\t\tevent.preventDefault();\n\t}else{\n\t\tpasswordConfirmationError.innerHTML = \"\";\n\t\tnew_password_confirmation.style.border=\"1px solid #efefef\";\n\t}\n}", "function validconfpass()\n{\nvar p1=document.getElementById(\"pword\").value;\nvar p2=document.getElementById(\"confpword\").value;\n\n\nif(p1.length==0 )\n{\nalert(\"Password is required\");\n}\n\nif(p1!=p2)\n{\nalert(\"Password does not match\");\n}\nelse if()\n{\ndocument.getElementById(\"mess3\").innerHTML=\"Password confirmed\";\n}\n}", "function uPassword() {\n\t\tvar u_pass = $('#user_pass').val();\n\t\tvar pass_pattern = /^[a-zA-Z0-9]+$/;\n\t\tvar pass_len = u_pass.length;\n\n\t\tif (u_pass == '') {\n\t\t\t$('#alert_pass').text('this field cannot be empty');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t} else if (pass_len < 8 || pass_len > 15 || !u_pass.match(pass_pattern)) {\n\t\t\t$('#alert_pass').text('please enter password between 8-15 alphanumeric characters');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function validatechangePasswordForm()\n{\n\tvar currentPassword = validatePassword(\"changePasswordForm\",\"currentPassword\",\"currentPasswordSpan\");\n\tvar equal = passwordEqual(\"changePasswordForm\",\"newPassword\",\"confirmPassword\",\"newPasswordSpan\",\"confirmPasswordSpan\");\n\tif (currentPassword & equal)\n\t {\n\t \treturn true;\n\t }\n\t return false;\n}", "function validateInfo(email, password, confirmPassword) {\n if (password == confirmPassword) {\n return true;\n }\n else {\n return false;\n }\n}", "function passPatternValid() {\n var errors = document.querySelector(\"#errors\");\n var pass = document.querySelector(\"#pass\").value;\n var password = document.querySelector(\"#secondPass\").value;\n if(pass !== password) {\n errorMessage(\"<p>Please enter a valid Password with 8 to 16 characters one upper case letter and one number!</p>\");\n return false;\n }\n return true;\n }", "function validate_password()\n {\n const icon = DOM.new_password_validation_icon;\n const password = DOM.new_password_input.value;\n\n icon.style.visibility = \"visible\";\n\n if (security.is_valid_password(password))\n {\n icon.src = \"/icons/main/correct_white.svg\";\n return true;\n }\n else\n {\n icon.src = \"/icons/main/incorrect_white.svg\";\n return false;\n }\n }", "function isValidPassword(password, confirmPassword) {\r\n return password.length >= 6 && password === confirmPassword;\r\n}", "function validatePasswordInput() {\n let typedPassword = document.querySelector(\n \".confirmModifications_form-password input\"\n ).value;\n if (userObject.password == typedPassword) {\n // If there is a match the user is updated in the website\n\n populateUserInfo(userObject);\n\n // The user is updated in the database\n\n put(userObject);\n document.querySelector(\".modal-confirm\").style.display = \"block\";\n closeConfirmModifications();\n } else {\n document.querySelector(\n \".confirmModifications_paragraph-alertWrongPass\"\n ).style.display = \"block\";\n }\n}", "function validatePassword(password) {\n\t// validate password\n}", "function validatePassword() {\n\n //Match 6 to 15 character string with at least one upper case letter, one lower case letter, and one digit\n var passwordRegex = /^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{6,15}$/;\n\n //password\n if($('#txt-password').val().match(passwordRegex)){\n $('#txt-password').css('border-color', 'green');\n } else {\n $('#txt-password').css('border-color', 'red');\n }\n\n //passwordConfirm\n if($('#txt-passwordConfirm').val().match(passwordRegex) && $('#txt-passwordConfirm').val() == $('#txt-password').val()) {\n $('#txt-passwordConfirm').css('border-color', 'green');\n } else {\n $('#txt-passwordConfirm').css('border-color', 'red');\n }\n\n //Enable submit, when fields are correctly filled out\n if($('#txt-password').val().match(passwordRegex) && $('#txt-passwordConfirm').val().match(passwordRegex)\n && $('#txt-password').val() == $('#txt-passwordConfirm').val()) {\n $('#btn-changePassword-submit').prop('disabled', false);\n } else {\n $('#btn-changePassword-submit').prop('disabled', true);\n }\n }", "function passwordMatch(password, confirm_password) {\n\n if (password != confirm_password) {\n resetFields();\n\t document.getElementById(\"passError\").innerHTML = \"Password does not match!\";\n\t document.getElementById(\"passError\").style.color = \"red\";\n\t\tdocument.getElementById(\"pword\").style.border = \"3px solid red\";\n\t document.getElementById(\"cpword\").style.border = \"3px solid red\";\n\t \n return false;\n } else {\n\n\t\tresetFields();\n return true;\n }\n\n\n}", "function validateConfPass() {\n if (user_conf.value === user_pass.value) {\n document.getElementById(\"alert_conf_pass\").innerHTML = \"\";\n return true;\n }\n document.getElementById(\"alert_conf_pass\").innerHTML =\n \"Password did'nt matched \";\n return false;\n}", "function confirmPass() {\n var pass = document.getElementById(\"pass1\").value\n var confPass = document.getElementById(\"pass2\").value\n if (pass != confPass) {\n alert('Wrong confirm password !');\n return false\n } else {\n return true;\n }\n}", "function validatePassword() {\r\n let pass1 = document.getElementById(\"pass\").value;\r\n let pass2 = document.getElementById(\"confirm-pass\").value;\r\n console.log(pass1);\r\n let regex = \"^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])[a-zA-Z0-9]{8,20}$$\";\r\n if (!pass1.match(regex)) {\r\n alert(\r\n \"Invalid password: 8-20 characters, at least 1 digit, lower and upper case alphabet.\"\r\n );\r\n return false;\r\n }\r\n\r\n if (pass1 != pass2) {\r\n alert(\"Passwords do not match.\");\r\n return false;\r\n }\r\n return true;\r\n}", "function checkConfirmPassword() {\n var password = $modalPass.val();\n var confirmPassword = $modalConfirmPass.val();\n if (password !== confirmPassword) {\n $confirmPasswordError.html(\"Passwords Did Not Match\");\n $confirmPasswordError.show();\n $modalConfirmPass.css(\"border-bottom\",\"2px solid #F90A0A\");\n confirmPasswordError = true;\n } else {\n $confirmPasswordError.hide();\n $modalConfirmPass.css(\"border-bottom\",\"2px solid #34F458\");\n }\n }", "function comparePwd(password, confPwd)\r\n{\r\n\t if(password != confPwd)\r\n\t {\r\n\t\t alert(\"Re-type the New Password in Confirm Password field\");\r\n\t\t $('#txtConfPwd').focus();\r\n\t\t return false;\r\n\t }\r\n\t else\r\n\t {\r\n\t\t return true; \r\n\t }\r\n}", "function validate() {\n const password = document.getElementById(\"password-register\").value;\n const confirmPassword = document.getElementById(\"confirm-password-register\").value;\n if(password != confirmPassword){\n document.getElementById(\"passwordChangeMsg\").innerHTML = \"Password must be same !\";\n return false;\n }else{\n document.forms[\"form-password-recovery\"].submit();\n }\n}", "function checkPasswords() {\n\n var field_new_pass = document.getElementById('new_password').value;\n var field_conf_new_pass = document.getElementById('conf_new_password').value;\n\n if(field_new_pass != field_conf_new_pass) {\n window.alert('Confirmation of password was failed');\n return false;\n }\n else if(field_new_pass != ''){\n window.alert('Success');\n }\n}", "function judgeConfirm()\n{\n var password = document.getElementById(\"Password_Password\").value;\n var confirm = document.getElementById(\"Password_Confirm\").value;\n clearDivText(\"Div_Confirm\");\n if(confirm.length > 0 && password == confirm)\n {\n setDivText(\"Div_Confirm\", TYPE_CORRECT, \"\");\n return true;\n }\n else\n {\n if(confirm.length > 0)\n {\n setDivText(\"Div_Confirm\", TYPE_ERROR, \"两次输入密码不同\");\n }\n else\n {\n setDivText(\"Div_Confirm\", TYPE_ERROR, \"未输入密码\");\n }\n return false;\n }\n}", "function validatePass() {\n\tvar message = \"\";\n\tvar password = document.getElementById(\"tPass\").value;\n\tdocument.getElementById(\"tPass\").style.border = \"1px solid #0000ff\";\n\tmessage = message == \"\" ? isEmpty( password ) : message;\n\tmessage = message == \"\" ? isGTMinlength( password, 8 ) : message;\n\tmessage = message == \"\" ? isLTMaxlength( password, 15 ) : message;\n\tif( message == \"\" ) {\n\t\tif( password.search(/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,15}$/) < 0 ) {\n\t\t\tmessage = \"The password must include at least one upper case letter, one lower case letter and one numeric digit.\";\n\t\t}\n\t}\n\tdocument.getElementById(\"pPass\").innerHTML = message;\n\treturn styleInput(\"tPass\", message);\n}", "function validatePassword() {\n\n //regex to determine minimum 8 character at least one letter one number in string\n var regex = /^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,}$/;\n\n if (password.value != confirm_password.value) {\n confirm_password.setCustomValidity(\"Passwords Don't Match\");\n } else if (!regex.test(password.value)) {\n confirm_password.setCustomValidity(\"Password be at least 8 characters long and contain at least one numeric character\")\n }\n else {\n confirm_password.setCustomValidity('');\n }\n}", "processPassRep() {\n if (this.password.value !== this.passwordRepeat.value) {\n this.passwordRepeat.err = true;\n this.passwordRepeatErr.seen = true;\n this.valid = false;\n this.passwordRepeatErr.text = \"رمز عبور و تکرار آن یکسان نیستند\";\n } else {\n this.passwordRepeat.err = false;\n this.passwordRepeatErr.seen = false;\n }\n }", "function passwordChecker() {\n password_value = password.value;\n\n if (password_value.length < 8) {\n errorMessage.innerText = \"Password is too short\";\n register.setAttribute(\"disabled\", \"disabled\");\n } else {\n if (password_value.match(/\\d/) === null) {\n errorMessage.innerText = \"Password must contain at least one number.\";\n register.setAttribute(\"disabled\", \"disabled\");\n } else {\n if (password_value.match(/[#%\\-@_&*!]/)) {\n errorMessage.innerText = \"\";\n passwordCompare();\n } else {\n errorMessage.innerText = \"Password must contain at least one special character: #%-@_&*!\";\n register.setAttribute(\"disabled\", \"disabled\");\n }\n\n }\n }\n}", "function checkPasswordMatch(password,confirmPassword)\n{\n\tif (password != confirmPassword) {\n \treturn 'false';\n } else {\n return 'true';\n } \n}", "function checkNewPassword()\r\n\t{\r\n\t\tvar newPassword=$(\"#Npass\").val();\r\n\t\t \r\n\t\t if(!isEmpty(newPassword))\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t$(\"#Npass\").css(\"border-color\",\"red\");\r\n\t\t\t\t$(\"#NpassP\").text(\"New password is Required\").css(\"color\",\"red\").show();\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\tif(!passwordRegEx.test(newPassword))\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$(\"#Npass\").css(\"border-color\",\"red\");\r\n\t\t\t\t$(\"#NpassP\").text(\"Invalid new Password Entered\").css(\"color\",\"red\").show();\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\telse\r\n\t\t\t{\r\n\t\t\t\t$(\"#Npass\").css(\"border-color\",\"\");\r\n\t\t\t\t$(\"#NpassP\").hide();\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}\t\r\n\t}", "function passwordValid() {\n\tvar pass = document.getElementById(\"password\").value,\n\t\tconfirmpass = document.getElementById(\"cpassword\").value;\n\tif (pass.length > 10) {\n\t\tdocument.getElementById(\"cpassErrorField\").innerHTML = \"Password longer than 10\";\n\t\treturn false;\n\t} else if (!(pass.length > 0 && pass.length <= 10)){\n\t\tdocument.getElementById(\"cpassErrorField\").innerHTML = \"Please Enter a password\";\n\t} else if (pass === confirmpass) {\n\t\tdocument.getElementById(\"cpassErrorField\").innerHTML = \"Password OK.\";\n\t\treturn true;\n\t} else {\n\t\tdocument.getElementById(\"cpassErrorField\").innerHTML = \"Passwords do not match.\";\n\t\treturn false;\n\t}\n}", "function generatePassword() {\n\n let passwordLength = prompt(\"Password Criteria question 1 of 6\\n\" +\n \"--------------------------------------\\n\" +\n \"I can generate a password for you, anywhere between \" + \n \"8 characters and up to 128 characters in length.\\n\\n\"+\n \"My default is the minimum 8 character password.\\n\\n\"+\n \"Please type in the password length you require, I accept \" +\n \"any number between 8 and 128.\\n\\n\" +\n \"What length password would you like today?\\n\",8); \n\n if (passwordLength === null) {\n alert(goodbyeMessage); \n return null;\n }\n\n if (( passwordLength < 8 )||( passwordLength > 128 )) {\n\n let incorrectUserInput = confirm(\"There's a problem.\\n\\n\" +\n \"You can select a minimum of 8 characters \" +\n \"or any other number up to a maximum of 128 \" + \n \"characters and less than or equal to 128.\\n\\n\" +\n \"Try again?\");\n \n if ( !incorrectUserInput ) { \n\n alert( goodbyeMessage ); \n return null;\n } else {\n return null;\n } \n }\n \n let lowerCase = confirm(\"Password Criteria question 2 of 6\\n\" +\n \"--------------------------------------\\n\" +\n \"Would you like your password to have:\\n\\n\" +\n \"lower case letters?\\n\\nSelect <OK> \"+\n \"for yes or <Cancel> for no.\");\n\n\n let upperCase = confirm(\"Password Criteria question 3 of 6\\n\" +\n \"--------------------------------------\\n\" +\n \"Would you like your password to have:\\n\\n\" + \n \"UPPER case letters?\\n\\n Select <OK> \"+\n \"for yes or <Cancel> for no.\");\n\n \n let numerical = confirm(\"Password Criteria question 4 of 6\\n\" +\n \"--------------------------------------\\n\" +\n \"Would you like your password to have:\\n\\n \" +\n \"Numbers?\\n\\nSelect <OK> \"+\n \"for yes or <Cancel> for no.\");\n\n\n let specialChar = confirm(\"Password Criteria question 5 of 6\\n\" +\n \"--------------------------------------\\n\" +\n \"Finally, how about:\\n\\nSpecial characters?\\n\\n\" +\n \"Recommended for a more secure password. \" +\n \"I have 24 special characters to select from, \" +\n \"they are:\\n @ % \\u005C + / ' ! # $ ^ ? : , ( ) { \" +\n \"} [ ] ~ ` - _ . \\n\\n\" +\n \"Select <OK> for yes or <Cancel> for no.\");\n \n /* Boolean changed to a yes or no as I think \n it is more meaningful to a user for this type \n of information instead of true or false. \n I just learnt about the Condition Operator ?\n from my literature review. Giving it a run here.\n */\n\n (lowerCase) ? lowerCase = \"yes\" : lowerCase = \"no\";\n (upperCase) ? upperCase = \"yes\" : upperCase = \"no\";\n (numerical) ? numerical = \"yes\" : numerical = \"no\";\n (specialChar) ? specialChar = \"yes\" : specialChar = \"no\";\n\n if((lowerCase===\"no\")&&(upperCase===\"no\")&&(numerical===\"no\")&&(specialChar===\"no\")) {\n \n let nothingSelected = confirm(\"Mmmmmmmmmm \\n \" +\n \"----------------------\\n\" +\n \"It seems you've not selected any option for me to generate \" +\n \"a password. This is what you selected:\\n\" + \n ` length of password = ${passwordLength} characters\\n` +\n ` lower case = ${lowerCase}\\n` + \n ` UPPER case = ${upperCase.valueOf()}\\n` +\n ` numbers = ${numerical}\\n` +\n ` special characters = ${specialChar}\\n\\n` +\n \"Try again?\\n\")\n\n if (!nothingSelected) {\n alert(goodbyeMessage); \n return null;\n } else {\n return null;\n } \n }\n\n/* I learnt template literals whilst doing this assignment and decided to use it for \n this assignment. \n https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals \n*/\n\n let selectionSummary = confirm(\"Password Criteria question 6 of 6\\n\" +\n \"--------------------------------------\\n\" +\n \"Please confirm your selection is as follows:\\n\\n\" +\n ` length of password = ${passwordLength} characters\\n` +\n ` lower case = ${lowerCase}\\n` + \n ` UPPER case = ${upperCase.valueOf()}\\n` +\n ` numbers = ${numerical}\\n` +\n ` special characters = ${specialChar}\\n\\n` +\n \"Select <Cancel> if you want to change any of the above.\")\n \n if (!selectionSummary){\n alert(goodbyeMessage); \n return null;\n }\n\n // Build the character list based on the user's selected criteria.\n let charCodes = [];\n \n if ( lowerCase === \"yes\" ) { charCodes.push(...LOWERCASE_CHARACTERS); }\n\n if ( upperCase === \"yes\" ) { charCodes.push(...UPPERCASE_CHARACTERS); }\n\n if ( numerical === \"yes\" ) { charCodes.push(...NUMERAL_CHARACTERS); }\n\n if ( specialChar === \"yes\" ) { charCodes.push(...SPECIAL_CHARACTERS); }\n\n // console.log(\"Character's in charCode array = \" + charCodes);\n \n /* console.time(\"Array Method\"); /* <== left here to look at performance difference between \n string and array methods. Found string is on average\n 8% faster!\n*/ \n\n let passwordCharacters = [];\n \n for (let i = 1; i <= passwordLength; i++) {\n\n /* We want the full selection of the charCodes \n array to be available for random selection so there shouldn't\n be any modifiers for min or max. \n In addition as the array reference needs to be an array index,\n that is between 0 and array.length-1, I've now confirmed\n the following formula works in accessing the full scope \n charCodes array passed to it.\n */\n\n let randomGenerator = Math.floor(Math.random() * (charCodes.length)); \n const characterCode = charCodes[randomGenerator];\n\n // console.log(characterCode);\n // console.log(String.fromCharCode(characterCode));\n \n passwordCharacters.push(String.fromCharCode(characterCode));\n }\n\n return passwordCharacters.join('');\n}", "function checkpassword()\r\n{\r\n\tif(document.newpassword.newpass.value==\"\")\r\n\t{\r\n\t\talert(lng_plsenternewpass);\r\n\t\tdocument.newpassword.newpass.focus();\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif(document.newpassword.newpass.value.length<6)\r\n\t{\r\n\t\talert(lng_passtooshort);\r\n\t\tdocument.newpassword.newpass.focus();\r\n\t\tdocument.newpassword.newpass.select();\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif(document.newpassword.cnfnewpass.value==\"\")\r\n\t{\r\n\t\talert(lng_plsenterconfpass);\r\n\t\tdocument.newpassword.cnfnewpass.focus();\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif(document.newpassword.newpass.value!=document.newpassword.cnfnewpass.value)\r\n\t{\r\n\t\talert(lng_passmismatch);\r\n\t\tdocument.newpassword.cnfnewpass.focus();\r\n\t\tdocument.newpassword.cnfnewpass.select();\r\n\t\treturn false;\r\n\t}\r\n}", "function checkPassword() {\n\n\n\n}", "function check_field_password(password, confirm_password) {\n if (password != confirm_password) {\n set_message('error', 'Passwords don\\'t match. Please try again.');\n clear_message();\n return true;\n }\n return false;\n}", "function ValidatePassword() {\n \n var rules = [{\n Pattern: \"[A-Z]\",\n Target: \"UpperCase\"\n },\n {\n Pattern: \"[a-z]\",\n Target: \"LowerCase\"\n },\n {\n Pattern: \"[0-9]\",\n Target: \"Numbers\"\n },\n {\n Pattern: \"[!@@#$%^&*_]\",\n Target: \"Symbols\"\n }];\n\n \n var password = $(\"#password\").val();\n \n //Checks if the lenght of the password is atleast 7 characters. \n $(\"#passwordLength\").removeClass(password.length > 6 ? \"passwordValidationFalseColor\" : \"passwordValidationTrueColor\");\n $(\"#passwordLength\").addClass(password.length > 6 ? \"passwordValidationTrueColor\" : \"passwordValidationFalseColor\");\n \n\n //Checks for the others rules as states above and displays the color (red for unfulfilled conditons and green for fulfilled) accordingly. \n for (var i = 0; i < rules.length; i++) {\n $(\"#\" + rules[i].Target).removeClass(new RegExp(rules[i].Pattern).test(password) ? \"passwordValidationFalseColor\" : \"passwordValidationTrueColor\"); \n $(\"#\" + rules[i].Target).addClass(new RegExp(rules[i].Pattern).test(password) ? \"passwordValidationTrueColor\" : \"passwordValidationFalseColor\");\n }\n }", "function validatePassword(pw)\n{\n if(pw == \"********\") // indicates password has not been changed\n {\n return(true);\n }\n else if(pw.length < 6)\n {\n return(\"Password must be at least 6 characters\");\n }\n else if(hasNumbers(pw)==false)\n {\n return(\"Password must contain at least two digits\");\n }\n else\n {\n return(true);\n }\n}", "function checkPassword() {\n if (this.value.length >= 8) {\n setAccepted('password-validated');\n } else {\n setUnaccepted('password-validated');\n }\n}", "function checkPassword() {\n\t\tvar psw=document.sform.psw.value;\n\t\tvar pattern=/[~`!#$%\\^&*+=\\-\\[\\]\\\\';,/{}|\\\\\":<>\\?]/;\n\t\tif (psw.length<8) {\n\t\t\talert (\"Password should be at least 8 characters.\");\n\t\t\tdocument.sform.psw.value=\"\";\n\t\t\tdocument.sform.psw.focus();\n\t\t\treturn false;\n\t\t}else if (pattern.test(psw)) {\n\t\t\talert (\"No special characters are allowed in password.\");\n\t\t\tdocument.sform.psw.value=\"\";\n\t\t\tdocument.sform.psw.focus();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function pwCriteria() {\n var length = parseInt(\n prompt(\"Choose a password length from 8 to 128 characters\")\n );\n // length validation\n if (length < 8 || length > 128 || Number.isNaN(length)) {\n alert(\"Password needs to be in beetwen 8 to 128\");\n return;\n }\n\n //I confirm whether or not to include lowercase, uppercase, numeric, and/or special characters\n var lwrChoice = confirm(\"Click ok if you want lower case letters\");\n\n var upprChoice = confirm(\"Click ok if you want upper case letters\");\n\n var numChoice = confirm(\"Click ok if you want numbers\");\n\n var spcChoice = confirm(\"Click ok if you want special characters\");\n // VALIDATE IF USER CHOSE CHARACTERS\n if (\n lwrChoice === false &&\n upprChoice === false &&\n numChoice === false &&\n spcChoice === false\n ) {\n alert(\"The password must contain one type of character!\");\n return;\n }\n if (lwrChoice) {\n allChar = allChar.concat(lowerChar)\n \n }\n if (upprChoice) {\n allChar = allChar.concat(upperChar)\n \n }\n if (numChoice) {\n allChar = allChar.concat(numChar)\n \n }\n if (spcChoice) {\n allChar = allChar.concat(specialChar)\n \n }\n for (var i = 0; i < length; i++) {\n var index = Math.floor(Math.random() * allChar.length);\n var rndChar = allChar[index];\n rndPass = rndPass.concat(rndChar)\n \n }\n return rndPass;\n}", "function checkpw(inputpw,inputpwc){\n if(inputpw.value != inputpwc.value){\n document.getElementById(\"Password\").innerHTML = \"Please check passward you type in. The password is not equal to password confirm.\"+\"<br>\";\n inputpw.value = \"\";\n inputpwc.value = \"\";\n return false;\n }\n else\n return true;\n}", "function validatePasswordMatch(password, confirmPassword) {\n if (password === confirmPassword) {\n return true;\n } else {\n return \"Password do not match!\"\n }\n}", "function confirmPassword(inputPassword) {\n let confirm;\n\n if (inputPassword.match(password) === null) {\n confirm = false;\n }\n else {\n const test = inputPassword.match(password).join(\"\");\n \n // if (test === inputPassword) {\n // confirm = true;\n // }\n // else {\n // confirm = false;\n // }\n test === inputPassword ? confirm = true: confirm = false;\n }\n\n\n if (confirm) {\n sendLogin();\n }\n else {\n console.error(\"error\");\n incorrectPassword();\n }\n}", "function validatePassword(pass) {\n passEntered = pass.value\n globalpass = passEntered;\n // Password must NOT be the same as the Username\n if (passEntered == globaluser) {\n document.getElementById(\"passwordGroup\").classList.remove(\"has-success\");\n document.getElementById(\"passwordError\").innerHTML=\"You cannot have a password the same as a username.\";\n document.getElementById(\"passwordError\").classList.remove(\"hidden-message\");\n document.getElementById(\"passwordError\").classList.add(\"shown-message\");\n document.getElementById(\"passwordGroup\").classList.add(\"has-error\");\n boolp = false;\n }\n\n // Password must be between 6-20 characters\n else if (passEntered.length < 6 || passEntered.length > 20) {\n document.getElementById(\"passwordGroup\").classList.remove(\"has-success\");\n document.getElementById(\"passwordGroup\").classList.add(\"has-error\");\n document.getElementById(\"passwordError\").innerHTML=\"Your password length is invalid. Please choose a password between 6 and 20 characters.\";\n document.getElementById(\"passwordError\").classList.remove(\"hidden-message\");\n document.getElementById(\"passwordError\").classList.add(\"shown-message\");\n document.getElementById(\"passwordGroup\").classList.add(\"has-error\");\n boolp = false;\n }\n\n // Password must NOT be the word \"password\" regardless of (upper-/lower-) case used\n else if (passEntered.toLowerCase() == \"password\") {\n document.getElementById(\"passwordGroup\").classList.remove(\"has-success\");\n document.getElementById(\"passwordError\").innerHTML=\"Password cannot contain any combination of Upper/Lower containing the word password.\";\n document.getElementById(\"passwordError\").classList.remove(\"hidden-message\");\n document.getElementById(\"passwordError\").classList.add(\"shown-message\");\n document.getElementById(\"passwordGroup\").classList.add(\"has-error\");\n boolp = false;\n }\n else {\n // green\n document.getElementById(\"passwordGroup\").classList.remove(\"has-error\");\n document.getElementById(\"passwordGroup\").classList.add(\"has-success\");\n boolp = true;\n }\n}", "function uConfPassword() {\n\t\tvar u_conf_pass = $('#user_conf').val();\n\t\tvar u_pass = $('#user_pass').val();\n\t\tif (!(u_conf_pass == u_pass)) {\n\t\t\t$('#alert_conf_pass').text(\"Password did'nt matched \");\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_conf_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t} else if (u_conf_pass === '') {\n\t\t\t$('#alert_conf_pass').text('This field cannot be empty ');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_conf_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function generatePassword() {\n clickit = parseInt(prompt(\"How long would you like your password? Please choose between 8 and 128\"));\n\n // Validation 1 - Incorrect Input made by the User\n if (!clickit) {\n alert(\"Ensure you type in the length (a number) you would like for your password\");\n }\n /// Validation 1a - User's choice went beyond the criteria\n else if (clickit < 8 || clickit > 128) {\n clickit = parseInt(prompt(\"Inorder to proceed, ensure you choose the length of your password. It must be between 8 and 128\"));\n\n }\n\n // Other Password criteria user can choose from \n else {\n\n validateUpperCase = confirm(\"Would you like your password to contain Uppercases?\");\n validateLowerCase = confirm(\"Would you like your password to contain Lowercase?\");\n validateNumber = confirm(\"Would you like your password to contain Numbers?\");\n validateCharacter = confirm(\"Would you like your password to contain Characters?\");\n };\n\n\n // Validation 2 - User did not make any criteria choice\n if (!validateUpperCase && !validateLowerCase && !validateNumber && !validateCharacter) {\n userinput = alert(\"You have to choose a Password Criteria\");\n }\n\n //Validation 3 - User did accept all 4 Criteria\n else if (validateUpperCase && validateLowerCase && validateNumber && validateCharacter) {\n userinput = largeletters.concat(smalletters, numbers, special);\n\n }\n\n /// Validation 4 - Only one choice made \n else if (validateUpperCase) {\n userinput = largeletters;\n }\n else if (validateLowerCase) {\n userinput = smalletters;\n }\n else if (validateNumber) {\n userinput = numbers;\n }\n else if (validateCharacter) {\n userinput = special;\n }\n\n\n // Validation 5 - Only two choices made by the User\n else if (validateUpperCase && validateLowerCase) {\n userinput = largeletters.concat(smalletters);\n }\n else if (validateCharacter && validateNumber) {\n userinput = special.concat(numbers);\n }\n else if (validateCharacter && validateLowerCase) {\n userinput = special.concat(smalletters);\n }\n else if (validateUpperCase && validateCharacter) {\n userinput = largeletters.concat(special);\n }\n else if (validateLowerCase && validateNumber) {\n userinput = smalletters.concat(numbers);\n }\n else if (validateUpperCase && validateNumber) {\n userinput = largeletters.concat(numbers);\n }\n\n\n // Validation 6 - Only three choices made by the User\n else if (validateNumber && validateUpperCase && validateLowerCase) {\n userinput = numbers.concat(largeletters, smalletters);\n }\n else if (validateNumber && validateUpperCase && validateCharacter) {\n userinput = numbers.concat(largeletters, special);\n }\n else if (validateNumber && validateLowerCase && validateCharacter) {\n userinput = numbers.concat(smalletters, special);\n }\n else if (validateCharacter && validateUpperCase && validateLowerCase) {\n userinput = special.concat(largeletters, smalletters);\n }\n\n\n\n //Random selection of password based on the criteria picked by the User\n var uniqueid = [];\n for (var i = 0; i < clickit; i++) {\n var userDecision = userinput[Math.floor(Math.random() * userinput.length)];\n uniqueid.push(userDecision);\n }\n var password = uniqueid.join(\"\");\n PasswordEntry(password);\n return uniqueid;\n}", "function validatePassword(){\r\n\tvar submit = false;\r\n\tvar password = $(\"#password\").val();\r\n\t\tpassword = password.trim();\r\n\t\tif(password ==''){\r\n\t\t\tsubmit = showError('password',\"Please fill Password\");\r\n\t\t}\r\n\t\telse if(!(regPass.test(password)) || password.length < 8){\r\n\t\t\tsubmit = showError('password',\"Password must be alphanumeric and min 8 charaters\");\r\n\t\t}\r\n\t\telse{\r\n\t\t\tsubmit = markFieldCorrect(\"password\");\r\n\t\t}\r\n\t\treturn submit;\r\n}", "function writePassword() {\n var password = generatePassword();\n var lowercase = confirm(\"include lowercase\");\n if (lowerCasedCharacters === true) {\n }\n var uppercase = confirm(\"include uppercase\");\n var number = confirm(\"include number\");\n var speicalcharacter = confirm(\"include speicalcharacter\");\n var pw = document.getElementById(\"password\").value;\n}", "function password() {\n var errors = document.querySelector(\"#errors\");\n var password = document.querySelectorAll(\"#pass\");\n var pass = password.value.trim();\n var patt = /^(?=.*[a-z])(?=.*\\d){8,16}$/ig;\n if(!patt.test(pass)) {\n return false;\n }\n else {\n return true;\n }\n}", "function validPassword(){\n // Se declara la variable del password\n var password = $('#password_id').val();\n // comprueba que la extensión del password sea de 8 caracteres\n if (password.length < 8) {\n // si no se cumple la condicion manda el error\n var lenght_error = \"El password debe contener al menos 8 caracteres\"\n $(\"#display_psw_error\").append(lenght_error);\n }\n // comprueba que contenga mayusculas \n if (password.match(/[A-Z]/) == null){\n var caps_error = \"El password debe contener al menos una mayuscula\"\n $(\"#display_caps_error\").append(caps_error);\n }\n // comprueba que contenga al menos un dígito\n if (password.match(/\\d/) == null){\n var num_error = \"El password debe contener al menos un carácter numérico\"\n $(\"#display_num_error\").append(num_error);\n }\n}", "function validatePass(){\r\n\t\r\n\tvar pass = document.getElementById(\"password\").value;\r\n\tvar pPass = document.getElementById(\"valPass\");\r\n\t\r\n\tif (pass.length < 8 || pass.length > 50)\r\n\t{\r\n \tpPass.innerHTML =\r\n\t\t\"Password length must be between 8 and 50 characters\";\r\n\t\tpPass.classList.remove(\"valid\");\r\n\t\tpPass.classList.add(\"invalid\");\r\n\t\r\n\t\treturn false;\r\n\t}\r\n\t else if(pass.search(/[a-z]/) < 0)\r\n\t{\r\n\t\tpPass.innerHTML = \r\n\t\t\"Password must contain a lowercase letter\";\r\n\t\tpPass.classList.remove(\"valid\");\r\n\t\tpPass.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\t else if(pass.search(/[A-Z]/) < 0)\r\n\t{\r\n\t\tpPass.innerHTML =\r\n\t\t\"Password must contain an uppercase letter\";\r\n\t\tpPass.classList.remove(\"valid\");\r\n\t\tpPass.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\telse if(pass.search(/[0-9]/) < 0)\r\n\t{\r\n\t\tpPass.innerHTML =\r\n\t\t\"Password must contain a digit\";\r\n\t\tpPass.classList.remove(\"valid\");\r\n\t\tpPass.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\telse if(pass.search(/[!#$%&? \"]/) < 0)\r\n\t{\r\n\t\tpPass.innerHTML =\r\n\t\t\"Password must contain a special character\";\r\n\t\tpPass.classList.remove(\"valid\");\r\n\t\tpPass.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\telse \r\n\t{\r\n\t\r\n\t\tpPass.innerHTML =\r\n\t\t\"Valid Password\";\r\n\t\tpPass.classList.remove(\"invalid\");\r\n\t\tpPass.classList.add(\"valid\");\r\n\t\treturn true;\r\n\t}\r\n }", "function checkPass() {\n var pass = \"\";\n $(opts['classname']).each(function(i){\n if (i == 0) {\n pass = $(this).val();\n } else {\n if ($(this).val() != pass) {\n if (opts['messages']['confirmation']) {\n errors.push (opts['messages']['confirmation']);\n } else {\n errors.push (opts['title'] + ' confirmation mismatch');\n }\n }\n }\n });\n }", "function checkPassword() {\n var passw = document.getElementById(\"passw\").value;\n\tvar lowercase = new RegExp(/([a-z])/g);\n\tvar uppercase = new RegExp(/([A-Z])/g);\n\tvar numbers = new RegExp(/([0-9])/g);\n\t\n if (passw == \"\"){\n\t} else {\n\t\tif(passw.length > 8) { \n\t\t\tif(lowercase.test(passw)) {\n\t\t\t\tif(uppercase.test(passw)) {\n\t\t\t\t\tif(numbers.test(passw)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\talert(\"Must contain a number!\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\talert(\"Must contain a uppercase letter!\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\talert(\"Must contain a lowercase letter!\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\talert(\"Must be at least 8 character!\");\n\t\t\treturn false;\n\t\t}\n\t}\n}", "function checkPasswordMatch() {\n\t\tvar password = $(\"#txtNewPassword\").val();\n\t\tvar confirmPassword = $(\"#txtConfirmPassword\").val();\n\n\t\tif (password != confirmPassword) {\n\t\t\t$(\"#txtConfirmPassword\").removeClass(\"border-success\");\n\t\t\t$(\"#txtConfirmPassword\").addClass(\"border-danger\");\n\t\t\t$(\"#divCheckPasswordMatch\").html(\"<i><small class='text-danger'>Password Harus Sama</small></i>\");\n\t\t\t$('#tbhUser').prop('disabled', true);\n\t\t} else {\n\t\t\t$(\"#txtConfirmPassword\").removeClass(\"border-danger\");\n\t\t\t$(\"#txtConfirmPassword\").addClass(\"border-success\");\n\t\t\t$(\"#divCheckPasswordMatch\").html(\"<i><small class='text-success'>Password Cocok</small></i>\");\n\t\t\t$('#tbhUser').prop('disabled', false);\n\t\t}\n\t}", "function validatePasswordMatch(password, confirmPassword, errors) {\n if (password !== confirmPassword) {\n errors.confirmPassword = \"Passwords must match.\";\n }\n}", "function validatePasswordFields(context) {\r\n var pwds = context.parentNode.getElementsByClassName('repeat_password');\r\n \r\n\r\n\tif(pwds[0].value !== pwds[1].value) {\r\n\r\n pwds[0].addClass('error').value = \"\";\r\n pwds[1].addClass('error').value = \"\";\r\n \r\n return false;\r\n }\r\n\t\r\n return true;\r\n}", "function checkPwLength(passwd, location)\r\n{\r\n\tpassword = $(\"#\"+passwd).val();\r\n\t\r\n\tlen = password.length;\r\n\t\r\n\tif(len < 6)\r\n\t{\r\n\t\t$(\"#password1\").focus();\r\n\t\t\r\n\t\t$(\"#\"+location).html(\"<font color = 'red'>Password entered is too short, minimum allowed characters is 6 (SIX)</font> <img src='../images/no.gif' name = 'img1' align = 'absmiddle' width='18' height = '18' alt='image'>\");\r\n\t\t\r\n\t\treturn false;\t\t\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif(len == 6)\r\n\t\t{\r\n\t\t\t$(\"#\"+location).html(\"<font color = 'green'>Password strength <b>WEAK</b></font> <img src='../images/yes.gif' name = 'img1' align = 'absmiddle' width='18' height = '18' alt='image'>\");\r\n\t\t\t\r\n\t\t\t$(\"#phoneno\").focus();\r\n\t\t}\r\n\t\telse if(len > 6 && len <= 12)\r\n\t\t{\r\n\t\t\t$(\"#\"+location).html(\"<font color = 'green'>Password strength <b>STRONG</b></font> <img src='../images/yes.gif' name = 'img1' align = 'absmiddle' width='18' height = '18' alt='image'>\");\r\n\t\t\t\r\n\t\t\t$(\"#phoneno\").focus();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$(\"#\"+location).html(\"<font color = 'green'>Password strength <b>VERY STRONG</b></font> <img src='../images/yes.gif' name = 'img1' align = 'absmiddle' width='18' height = '18' alt='image'>\");\r\n\t\t\t\r\n\t\t\t$(\"#phoneno\").focus();\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\t\r\n\t}\r\n}", "function check_inputPassword() {\n\tvar text_password = $(\"#password\").val();\n\tvar show_err_password = $(\"#err_password\");\n\n\tif (text_password.length < 8 || text_password.length > 30) {\n\t\tshow_err_password.html(\"Pass in 8-30 character\");\n\t\treturn false;\n\t}\n\n\tshow_err_password.css({\"color\": \"green\"});\n\tshow_err_password.html(\"OK\");\n\treturn true;\n}", "function authPasswordAndConfirm($form) {\n var $passwordGroup = $form.find('.password-form-group');\n var $passwordInput = $passwordGroup.find('input');\n var $confirmGroup = $form.find('.confirm-form-group');\n var $confirmInput = $confirmGroup.find('input');\n\n var password = $passwordInput.val();\n if (!validPassword(password)) {\n $passwordGroup.addClass('has-error');\n $confirmGroup.addClass('has-error');\n display_alert(\"Password must be at least 16 characters.\", \"error\")\n\n return false; // don't submit form\n }\n if ($confirmInput.val() != password) {\n $passwordGroup.addClass('has-error');\n $confirmGroup.addClass('has-error');\n display_alert(\"Passwords do not match\", \"error\")\n\n return false; // don't submit form\n }\n\n $form.find('.hidden-password').val(authSecret(password));\n return true; // submit form\n }", "function validatePassword(){\n var pass = document.getElementById(\"password1\");\n var confirm = document.getElementById(\"confirm_password\");\n\n if(pass.value == confirm.value){\n confirm.setCustomValidity('');\n }else{\n confirm.setCustomValidity(\"Passwords do not match!\");\n }\n}", "function generatePassword() {\n let verify = false;\n while (!verify) {\n let passLength = parseInt(prompt(\"Choose a password number between 8 and 128\"));\n //make statment for making sure there is a value\n if (!passLength) {\n alert(\"You need a value\");\n continue;\n } else if (passLength < 8 || passLength > 128) {\n passLength = parseInt(prompt(\"Password length must be between 8 and 128 characters long.\"));\n //this will happen once user puts in a correct number\n } else {\n confirmNumber = confirm(\"Do you want your password to contain numbers?\");\n confirmCharacter = confirm(\"Do you want your password to contain special characters?\");\n confirmUppercase = confirm(\"Do you want your password to contain Uppercase letters?\");\n confirmLowercase = confirm(\"Do you want your password to contain Lowercase letters?\");\n };\n //confirm that something will happen or error\n if (!confirmCharacter && !confirmLowercase && !confirmNumber && !confirmUppercase) {\n alert('At least one character type must be selected.');\n continue;\n }\n //verify its true to set pass\n verify = true;\n let newPass = '';\n let charset = '';\n //start if for statment for the password length\n //set combinations in else if statments\n //set charset for each else if statment\n //create for for loop for (var i = 0; i < passLength; ++i)\n //newPass += charset.charAt(Math.floor(Math.random() * charset.length));\nif(!confirmNumber && !confirmUppercase && ! confirmLowercase){\n charset = \"!@#$%^&*\"\n for (var i = 0; i < passLength; ++i) {\n newPass += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n} else if (!confirmCharacter && !confirmUppercase && !confirmLowercase){\n charset = \"0123456789\"\n for (var i = 0; i < passLength; ++i) {\n newPass += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n} else if (!confirmCharacter && !confirmNumber && !confirmLowercase){\n charset = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n for (var i = 0; i < passLength; ++i) {\n newPass += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n} else if (!confirmCharacter && !confirmUppercase && !confirmNumber){\n charset = \"abcdefghijklmnopqrstuvwxyz\"\n for (var i = 0; i < passLength; ++i) {\n newPass += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n}else if (!confirmCharacter && !confirmNumber){\n charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n for (var i = 0; i < passLength; ++i) {\n newPass += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n}else if (!confirmUppercase && !confirmLowercase){\n charset = \"0123456789!@#$%^&*\"\n for (var i = 0; i < passLength; ++i) {\n newPass += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n}else if (!confirmUppercase && !confirmNumber){\n charset = \"abcdefghijklmnopqrstuvwxyz!@#$%^&*\"\n for (var i = 0; i < passLength; ++i) {\n newPass += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n}else if (!confirmLowercase && !confirmNumber){\n charset = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*\"\n for (var i = 0; i < passLength; ++i) {\n newPass += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n} else {\n charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\" \n for (var i = 0; i < passLength; ++i) {\n newPass += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n}\n document.getElementById(\"password\").textContent = newPass;\n }\n}", "function new_password_validation(){\n\t\t$('#new-password-confirm').bind('click blur', function(){\n\t\t\tvar pass1 = $('#new-password');\n\t\t\tvar pass2 = $('#new-password-confirm');\n\t\t\tvar message = $('#confirmMessageNewPass');\n\t\t\tvar goodColor = '#66cc66';\n\t\t\tvar badColor = '#ff6666';\n\t\t\t\t//alert(pass1.val() + ', ' + pass2.val());\n\t\t\tif( pass1.val() == pass2.val() && pass1.val().length > 6 && pass2.val().length > 6 ){\n\t\t\t\tpass2.css( 'border-color', goodColor );\n\t\t\t\tmessage.html( 'Šifre se podudaraju. Možete potvrditi promene.' ).css('color', goodColor).css('font-weight', 'bold');\n\t\t\t\t$('#submit-new-password').prop('disabled', false);\t\t\t\n\t\t\t}\n\t\t\t\telse if ( pass2.val().length <= 6 ){\n\t\t\t\t\talert('Šifra mora sadržati najmanje 7 karaktera.');\n\t\t\t\t\t$('#submit-new-password').prop('disabled', true);\n\t\t\t\t}\n\n\t\t\t\telse if( pass1.val() != pass2.val() ) {\n\t\t\t\t\tpass2.css( 'border-color', badColor );\n\t\t\t\t\tmessage.html( 'Unete šifre se ne podudaraju.' ).css('color', badColor).css('font-weight', 'bold');\n\t\t\t\t\t$('#submit-new-password').prop('disabled', true);\n\t\t\t\t}\n\n\t\t});\n\t}", "function checkPasswords() {\n var password = document.getElementById('InputPassword');\n var retypePassword = document.getElementById('InputPassword2');\n\n if (password.value != retypePassword.value) {\n showFeedBack(retypePassword.name,\"NoMatch\");\n if(retypePassword.value != \"\"){\n retypePassword.value = \"\";\n retypePassword.focus();\n }\n passwordError = true;\n } else {\n if(retypePassword.value != \"\"){\n showFeedBack(retypePassword.name,\"valid\");\n passwordError = false;\n }\n \n }\n \n }", "function checkAmountConfirm() {\n var string_length = prompt(\"How many characters would you like your password to have? *Must be more than 8, and less than 128*\");\n if (string_length >= 8 && string_length <= 128) {\n checkUppercase = confirm(\"Would you like uppercase letters in your password? Select 'OK' for YES and 'Cancel' for NO\");\n checkLowercase = confirm(\"Would you like lowercase letters in your password? Select 'OK' for YES and 'Cancel' for NO\");\n checkNumbers = confirm(\"Would you like numbers in your password? Select 'OK' for YES and 'Cancel' for NO\");\n checkSpecial = confirm(\"Would you like special characters in your password? Select 'OK' for YES and 'Cancel' for NO\");\n } else {\n alert(\"Length must be 8-128 characters.\");\n checkAmountConfirm();\n }\n createPassword(string_length);\n}", "function generatePassword() {\n\n //Prompt to Enter desired length of password\n var length = Number(prompt(\"How many characters will your password be? Pick between 8 and 128\"));\n\n //Confirms user chose a number between min and max\n if (length < 8 || length > 128) {\n alert(\"Invalid choice. Password must be between 8 and 128\");\n location.reload()\n\n \n } else { // Variables and conditional statements that log User choice and choose the criteria that apply to Generated password.\n var includeUpper = confirm(\"Would you like to include uppercase letters?\");\n var includeLower = confirm(\"Would you like to include lower case letters?\");\n var includeNumber = confirm(\"Would you like to include Numerical characters?\");\n var includeSpecial = confirm(\"Would you like to include special characters?\");\n var upper = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n var lower = \"abcdefghijklmnopqrstuvwxyz\";\n var number = \"0123456789\";\n var special = \"!#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\";\n var charChoice = \"\";\n }\n // If User chose to include at least one or all of the criteria.\n\n if (includeUpper) {\n charChoice += upper;\n }\n if (includeLower) {\n charChoice += lower;\n }\n if (includeNumber) {\n charChoice += number;\n }\n if (includeSpecial) {\n charChoice += special;\n }\n\n // If user Chose No to all Criteria They must start over and Choose yes to at least one.\n if (charChoice == \"\") {\n alert(\"Password must include at least one character option. Press OK to refresh the page and start over.\")\n location.reload();\n }\n\n do {\n // Variable and statements that will Generate New Password based on User Criteria Choice.\n var newPassword = \"\";\n for (var i = 0; i < length; i++) {\n //picks random characters within the selected criteria category based on LENGTH set by user\n newPassword += charChoice.charAt(Math.floor(Math.random() * charChoice.length));\n }\n console.log(newPassword)\n var hasLower = false;\n var hasUpper = false;\n var hasNumber = false;\n var hasSpecial = false;\n\n for (var i = 0; i < newPassword.length; i++) {\n var char = newPassword[i];\n\n if (lower.includes(char)) {\n hasLower = true;\n } else if (upper.includes(char)) {\n hasUpper = true;\n } else if (number.includes(char)) {\n hasNumber = true;\n } else if (special.includes(char)) {\n hasSpecial = true;\n }\n }\n } while (\n (includeLower && !hasLower) ||\n (includeUpper && !hasUpper) ||\n (includeNumber && !hasNumber) ||\n (includeSpecial && !hasSpecial)\n )\n\n // return newPassword;\n return newPassword;\n}", "function validatePassword(){\n var password = document.getElementById(\"password\");\n var confirm_password = document.getElementById(\"confirm_password\");\n if(password.value != confirm_password.value) {\n confirm_password.setCustomValidity(\"Passwords Don't Match\");\n } else {\n confirm_password.setCustomValidity('');\n }\n}", "function validatePasswordHash() {\n if (this.isNew) {\n if (!this._password) {\n return this.invalidate('password', 'A password is required.');\n }\n if(this._password.length < 6){\n this.invalidate('password', 'Must be at least 6 characters');\n }\n if (this._password !== this._passwordConfirmation){\n return this.invalidate('password', 'Passwords do not match.');\n }\n }\n}", "function checkPassword(password, passconf) {\n\tvar password = $(password);\n\tvar passconf = $(passconf);\n\tif (password.val().trim() == passconf.val().trim()) {\n\t\tpassconf.get(0).setCustomValidity(\"\"); // All is well, clear error message\n\t\treturn true;\n\t} else {\n\t\tpassconf.get(0).setCustomValidity(ERR_PASSWORD_MISMATCH);\n\t\treturn false;\n\t}\n}", "function checkPassword() {\n\tvar password = document.getElementById(\"password\").value;\n\tvar retypePassword = document.getElementById(\"retypePassword\").value;\n\tvar hasNumber = /\\d/;\n\tvar hasSpecialCharacter = /\\W/;\n\t//Password must contain at least one number and one special character\n\tif ((password === retypePassword) && (hasNumber.test(password)) && (hasSpecialCharacter.test(password))) {\n\t\tdocument.getElementById(\"passwordError\").innerHTML = \"\";\n\t\tdocument.getElementById(\"retypePasswordError\").innerHTML = \"\";\n\t}\n\telse {\n\t\tdocument.getElementById(\"passwordError\").innerHTML = \"Password must match, have a number and a special character.\";\n\t\tdocument.getElementById(\"retypePasswordError\").innerHTML = \"Retyped password must match, have a number and a special character.\";\n\t}\n}", "function comparePassword() {\n\t\tvar newPassword = $(\"#txtNewPassword\").val();\n\t\tvar newPasswordConfirm = $(\"#txtNewPasswordConfirm\").val();\n\t\t// compare\n\t\tif (newPassword == newPasswordConfirm) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function validatePassword() {\r\n var checkVal = document.registration.passid.value;\r\n\r\n // Password not empty\r\n if (checkVal.length == 0) {\r\n strFields += \"- Password cannot be empty!<br>\";\r\n return false;\r\n }\r\n\r\n // Password length: 6-20 (inclusive)\r\n if (checkVal.length < 6 || checkVal.length > 20) {\r\n strFields += \"- Password must be between 6 and 20 characters long!<br>\";\r\n return false;\r\n }\r\n\r\n return true;\r\n}", "function validatePass() {\r\n //gets the elements length props\r\n let passW1 = $(\"#pass\").val().length;\r\n let passW2 = $(\"#conpass\").val().length;\r\n\r\n //checks for length short/long and null\r\n //no checking for illegal characters\r\n if (passW1 === 0) {\r\n //set the email element background by passing a state value\r\n sendState(on, \"pass\");\r\n\r\n //adds the error message to the array\r\n addDataAllErrors(allErrorMess[8]);\r\n } else if (passW2 === 0) {\r\n //sets the background\r\n sendState(on, \"conpass\"); //$('#conpass').css('background', 'yellow');\r\n\r\n //adds the error message to the array\r\n addDataAllErrors(allErrorMess[10]);\r\n } else if (!passInvalidLength(passW1) || !passInvalidLength(passW2)) {\r\n //adds the appropraite error message to the array\r\n //could be either to short, or too long. - \"DRY\" - a ternary exp\r\n if (passW1 > 8 || passW2 > 8) {\r\n if (passW1 > 8) {\r\n //sets the background - password too long or no value\r\n sendState(on, \"pass\");\r\n\r\n //adds the error message to the array - valid for both conditions\r\n addDataAllErrors(allErrorMess[12]);\r\n } else if (passW2 > 8) {\r\n //sets the background - password too long or no value\r\n sendState(on, \"conpass\");\r\n\r\n //adds the error message to the array - valid for both conditions\r\n addDataAllErrors(allErrorMess[13]);\r\n }\r\n } else {\r\n if (passW1 < 8) {\r\n //sets the background - password too short\r\n sendState(on, \"pass\");\r\n addDataAllErrors(allErrorMess[11]);\r\n } else if (passW2 < 8) {\r\n //sets the background - confirm password too too short\r\n sendState(on, \"conpass\");\r\n addDataAllErrors(allErrorMess[14]);\r\n }\r\n }\r\n } else if (passW1 === passW2) {\r\n //checks for the same value - better way to do this!\r\n if ($(\"#pass\").val() === $(\"#conpass\").val()) {\r\n //resets the background\r\n sendState(off, \"conpass\");\r\n sendState(off, \"pass\");\r\n\r\n //removes the error messages\r\n $(\"#lblPassError\").html(\"\");\r\n $(\"#lblConPassError\").html(\"\");\r\n\r\n //diags to the console\r\n console.log(`password validation passed!`);\r\n } else {\r\n //adds the error message to the array, passwords don't match\r\n sendState(on, \"conpass\");\r\n sendState(on, \"pass\");\r\n addDataAllErrors(allErrorMess[9]);\r\n }\r\n }\r\n }", "function handlePassword() {\n let value = this.value;\n if (value.length >= 3 && value.length <= 15) {\n displayValidField(\"passwordGroup\");\n theForm.passwordValid = true;\n checkForm();\n } else {\n displayInvalidField(\"passwordGroup\");\n theForm.passwordValid = false;\n checkForm();\n }\n let g = document.getElementById(\"errorPassword\")\n g.parentNode.removeChild(g)\n }", "function validatePasswords()\r\n {\r\n\t\r\n\t// compare passwords\r\n\tpassword1 = $('.password1').val();\r\n\tpassword2 = $('.password2').val();\r\n\t\r\n\tif ( password1 != password2)\r\n\t{\r\n\t\t// add error class to password text boxes\r\n\t\t$('.password1').addClass('error');\r\n\t\t$('.password2').addClass('error');\r\n\t\t\r\n\t\tswal(\"Oops\", \"your passwords does not match please try again!\", \"error\");\r\n\t\t// set password validation to false;\r\n\t\tpasswordValidation = false;\r\n\t\treturn false;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t// Remove any red outlines on password change box\r\n\t\t$('.password1').removeClass('error');\r\n\t\t$('.password2').removeClass('error');\r\n\r\n\t\tpasswordValidation = true;\r\n\t}\r\n\t\r\n }", "function validatePasswords(){\r\n var password = document.getElementById(\"password\").value;\r\n var confirmPassword = document.getElementById(\"confirmpassword\").value;\r\n if (confirmPassword != password){\r\n document.getElementById(\"passwordsmatch\").innerHTML = \"The passwords do not match.\";\r\n }\r\n else{\r\n document.getElementById(\"passwordsmatch\").innerHTML = \"\";\r\n }\r\n}", "function passV() {\n var pass = document.getElementById('pass').value;\n if (pass.length == 0) {\n showWarning(\"Password field empty\");\n return false;\n } else if (pass.length < 2) {\n showWarning(\"Password must be minimum 3 characters long\");\n return false;\n }\n return true;\n\n}", "function verify()\r\n {\r\n var p=document.getElementById(\"password\").value;\r\n var vp=document.getElementById(\"vpassword\").value;\r\n if(p!=vp)\r\n {\r\n alert(\"Make sure passwords match\")\r\n return false;\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n }", "function isValidPassword(text)\n{\n//\tvar chardigit='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789/-_/!/@/#/$/%/^/&/*/~/.';\n//\tvar charset='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789/-_/!/@/#/$/%/^/&/*/~/.';\n\tvar chardigit='0123456789';\n\tvar charset='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz/-_/!/@/#/$/%/^/&/*/~/.';\n\tvar i=0;\n\tvar correctDigit='false';\n var correctChar='false';\n\n\tvar ch;\n\n\tif (text.length < 6 || text.length > 20){\n\t\talert('Mat khau phai co do dai tu 6 den 20 ky tu va chua ca chu lan so!');\n\t\treturn false;\n\t}\n i=0;\n //Check ky tu\n\twhile(i<text.length && correctChar=='false')\n\t{\n\t\tch=text.charAt(i);\n\t\tif(charset.indexOf(ch)>-1)//Neu la chua ky tu\n\t\t correctChar='true';\n i++;\n\n\t}//end of while\n\n //Check So\n while(i<text.length && correctDigit=='false' )\n\t{\n \tch=text.charAt(i);\n if(chardigit.indexOf(ch)>-1) //Neu la chua so\n\t\t correctDigit='true';\n\t\ti++;\n\n\t}//end of while\n\n\n\tif (correctChar=='true' && correctDigit=='true')\n\t\treturn true;\n\telse{\n\t\talert('Mat khau phai chua ca chu va so');\n\t\treturn false;\n\n\t}\n}//end of isValidPasswd(text)", "function validateBlurConfirmPasswordText() {\n\n if (confirmPasswordInput.value === \"\" || confirmPasswordInput.value === null) {\n infoDivConfirmPassword.style.display = \"block\"\n infoDivConfirmPassword.style.color = \"red\"\n infoDivConfirmPassword.innerText = \"Confirm password field is empty\"\n return;\n }\n if (confirmPasswordInput.value !== passwordInput.value) {\n infoDivConfirmPassword.style.display = \"block\"\n infoDivConfirmPassword.style.color = \"red\"\n infoDivConfirmPassword.innerText = \"Passwords must match\"\n return;\n }\n}", "function checknewpass(x,y,z)\n{\n\tlet pone=x;\n\tlet ptwo=y;\n\tlet locz=z;\n\tlet pwd1=$('#'+pone).val();\n\tlet pwd2=$('#'+ptwo).val();\n\n\tif (pwd1==\"\" || pwd2==\"\")\n\t{\n\t\treturn;\n\t}\n\n\tif (pwd1!=pwd2) \n\t{\n\t\t$('#'+locz).html(\"<b><center>Passwords do not match!</center></b>\");\n\n\t}\n\telse\n\t{\n\t\t$('#'+locz).html(\"\");\n\n\t}\n\n}", "function v_password(password,test){\n if(password == test){\n return true;\n }\n else{\n $(\"#email\").siblings(\"small\").remove();\n $('<small class=\"form-text danger\"> Email o contraseña incorrecta, inténtelo nuevamente.</small>').insertAfter(\"#email\");\n return false;\n }\n}", "function validateRepPass(){\r\n\t\r\n\tvar pass = document.getElementById(\"password\").value;\r\n\tvar repPass = document.forms[\"form\"][\"RepPassword\"].value;\r\n\tvar pRepPass = document.getElementById(\"valRepPass\");\r\n\t\r\n\tif(repPass == \"\")\r\n\t{\r\n\t\t\r\n\t\tpRepPass.innerHTML =\r\n\t\t\"Repeat Password is required\";\r\n\t\tpRepPass.classList.remove(\"valid\");\r\n\t\tpRepPass.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t\t\r\n\t}\t\r\n\t else if(repPass != pass)\r\n\t{\r\n\t\t\r\n\t\tpRepPass.innerHTML =\r\n\t\t\"Passwords should match\";\r\n\t\tpRepPass.classList.remove(\"valid\");\r\n\t\tpRepPass.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t\t\r\n\t}\r\n\telse \r\n\t{\r\n\t\r\n\t\tpRepPass.innerHTML =\r\n\t\t\"Passwords match\";\r\n\t\tpRepPass.classList.remove(\"invalid\");\r\n\t\tpRepPass.classList.add(\"valid\");\r\n\t\treturn true;\r\n\t\r\n\t}\r\n\t\r\n}", "function isValidPassword(field1){\n\tfield=document.getElementById(field1);\n\tstring = field.value\n \tvar bValid =new Boolean(true);\n \tif (!string) \n\t{\n\t\talert(\"Password field can not be left blank.\");\n\t\tbValid=false; \n\t}\n\telse if(string.length >15 || string.length <6) \n\t{\n\t\talert(\"Password can't be less than 6 or greater then 15 characters.\");\n\t\tbValid=false;\n\t}\n else\n\t{\n\t\tvar Chars = \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\t\tfor (var i = 0; i < string.length; i++) {\n\t\tif (Chars.indexOf(string.charAt(i)) == -1)\n\t\t {\n\t\t\t\t bValid=false; \n\t\t\t}\n\t\t}\n\t\tif(!bValid)\n\t\t{\n\t\t\tvar msg='Not a valid '\n\t\t\tvar long=\"\";\n\t\t\tif(field.name=='rpassword')\n\t\t\t\tlong=\"Password.\";\n\t\t\tif(field.name=='rcpassword')\n\t\t\t\tlong=\"Confirm Password.\";\n\t\t\talert(msg + long);\n\t\t\tfield.select();\n\t\t\tfield.focus();\n\t\t}\n\t}\n return bValid;\n}", "function _checkPass(p) \r{\r\tvar error = \"\";\r\t\r\t// Contraseña con menos de 6 carácteres\r\tif (p.length < 6) \r\t{\r\t\tdocument.getElementById(\"p0label\").className = \"error\";\r\t\terror = \"<b>At least 6 characters</b>\";\r\t}\r\telse \r\t{\r\t\t// Contraseña con mas de 15 carácteres\r\t\tif (p.length > 15) \r\t\t{\r\t\t\tdocument.getElementById(\"p0label\").className = \"error\";\r\t\t\terror = \"<b>Less than 15 characters.</b>\";\r\t\t}\r\t\telse \r\t\t{\r\t\t\t// Contraseña con carácteres inválidos. Se admiten los mismo\r\t\t\t// carácteres que en el usuario\r\t\t\treg = /^[A-Za-z0-9_\\-]*$/;\r\r\t\t\tif (!reg.test(p)) \r\t\t\t{\r\t\t\t\tdocument.getElementById(\"p0label\").className = \"error\";\r\t\t\t\terror = \"<b>Invalid character</b>\";\r\t\t\t}\r\t\t}\r\t}\r\r\treturn error;\r}", "function generatePassword() {\n alert (\"Select which criteria to include in the password\");\n\n\n var passLength = parseInt(prompt(\"Choose a length of at least 8 characters and no more than 128 characters\"));\n\n //evaluate user input for password length\n while (isNaN(passLength) || passLength < 8 || passLength > 128)\n {\n \n if (passLength === null) {\n return;\n }\n\n passLength = prompt(\"choose a length of at least 8 characters and no more than 128 characters\");\n }\n\n\n var lowerCase = confirm(\"Do you want lowercase characters in your password\");\n var upperCase = confirm(\"Do you want uppercase characters in your password\");\n var numChar = confirm(\"Do you want numbers in your password?\");\n var specChar = confirm(\"Do you want special characters in your password?\");\n\n\n //evalute criteria for password generation\n if (lowerCase || upperCase || numChar || specChar)\n {\n var otherToGen = '';\n var intList = '0123456789';\n var uCharList ='ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n var lCharList ='abcdefghijklmnopqrstuvwxyz'; \n var sCharList =\"!#$%&()*+,-./:;<=>?@[]^_`{|}~\";\n var remainlenght = 0;\n var criteriaMatch = 0;\n var value = '';\n\n if (numChar){\n value += genchar(1, intList);\n criteriaMatch++;\n otherToGen += intList;\n\n }\n\n if (lowerCase){\n value += genchar(1, lCharList);\n criteriaMatch++;\n otherToGen += lCharList;\n }\n\n if (upperCase) {\n value += genchar(1, uCharList);\n criteriaMatch++;\n otherToGen += uCharList;\n }\n\n\n if(specChar) {\n value += genchar(1, sCharList);\n criteriaMatch++;\n otherToGen += sCharList;\n\n }\n\n remainlenght = passLength-criteriaMatch;\n value += genchar(remainlenght, otherToGen);\n\n return value;\n}\n}", "function checkPass1() {\n\n var flag = 0;\n var neutralColor = '#fff'; // 'white';\n var badColor = '#f66'; // 'red';\n var goodColor = '#6f6'; // 'green';\n\n var password1 = getElm('new_password1').value;\n var password2 = getElm('confirm_password1').value;\n\n //if password length is less than 6\n if (password1.length < 6) {\n feedback1('Mật khẩu tối thiểu 6 kí tự');\n //we do not care about pass2 when pass1 is too short\n setBGColor('confirm_password', neutralColor);\n //if pass1 is blank, set neutral background\n if (password1.length === 0) {\n setBGColor('new_password1', neutralColor);\n } else {\n setBGColor('new_password1', badColor);\n }\n flag = 1;\n //else if passwords do not match\n } else if (password1.indexOf(' ') >= 0) {\n feedback1('Mật khẩu không được có kí tự trắng');\n setBGColor('new_password1', badColor);\n flag = 1;\n } else if (password2 !== password1) {\n //we now know that pass1 is long enough\n feedback1('Mật khẩu không trùng khớp');\n setBGColor('new_password1', goodColor);\n //if pass2 is blank, set neutral background\n if (password2.length === 0) {\n setBGColor('confirm_password1', neutralColor);\n } else {\n setBGColor('confirm_password1', badColor);\n }\n flag = 1;\n\n } else {\n feedback1('Mật khẩu trùng khớp');\n setBGColor('new_password1', goodColor);\n setBGColor('confirm_password1', goodColor);\n flag = 0;\n }\n return flag;\n}", "function checkPasswordMatch() {\n var password = $(\"#password\").val();\n var confirmPassword = $(\"#confirmPassword\").val();\n \n if (password != confirmPassword)\n $(\"#divCheckPasswordMatch\").html(\"Passwords do not match!\");\n else\n $(\"#divCheckPasswordMatch\").html(\"Passwords match.\");\n }", "function checkPassword() {\n var passwordLength = $modalPass.val().length;\n if (passwordLength < 8) {\n $passwordError.html(\"Must be at least 8 Characters\");\n $passwordError.show();\n $modalPass.css(\"border-bottom\",\"2px solid #F90A0A\");\n passwordError = true;\n } else {\n $passwordError.hide();\n $modalPass.css(\"border-bottom\",\"2px solid #34F458\");\n }\n }", "function checkPasswordMatch() {\n const password = $(\"#password\").val();\n const confirmPassword = $(\"#password2\").val();\n const feedback = $(\"#divCheckPasswordMatch\");\n\n if (password !== confirmPassword) {\n feedback.html(\"Wachtwoorden zijn niet gelijk!\").removeClass('text-success').addClass('text-danger');\n return;\n }\n\n feedback.html(\"Wachtwoorden zijn gelijk.\").removeClass('text-danger').addClass('text-success');\n }", "function validatePassword() {\n var valid = false;\n var pwdInput = document.getElementById(\"inputPassword\");\n var pwdPattern = /^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*])/; //.{8,20}$/\n var pwdError = document.getElementById(\"msg_pwd\");\n if(pwdInput.value == \"\") {\n pwdError.textContent = \"Password is required\";\n }\n else if(!pwdInput.value.match(pwdPattern)) {\n pwdError.textContent = \"Password must be 8-20 characters and contain at least one lowercase letter, one uppercase letter, one number, and one special character\";\n }\n else if(pwdInput.value.length < 8 || pwdInput.value.length > 20) {\n pwdError.textContent = \"Password must be 8-20 characters\";\n }\n else {\n pwdError.textContent = \"\";\n valid = true;\n }\n return valid;\n}", "function generatePassword(){\n //parseInt applied to prompt to convert any string values to numeric value\n var passwordLength = parseInt(prompt (\"How many characters you would like your password to have?\"))\n \n //validating password ie that it is the correct length \n //validating password ie that a number not alpha has been used to choose password length\n\n if (Number.isNaN (passwordLength)){\n alert(\"Your entry is invalid, please re-enter a valid number\")\n\n return //stops the code being processed beyond this point. \n }\n \n if (passwordLength < 8 ){\n alert(\"Your choice is invalid, please enter a number that is greater than 8\")\n return\n }\n\n if (passwordLength > 128 ){\n alert(\"Your choice is invalid, please enter a number that is less than 128\")\n return\n }\n\n var confirmUpCase = confirm (\"Would you like to use upper case letters in your password? Press ok to confirm or cancel to ignore\");\n \n // confirmUpCase = confirm = \"ok\", decline = \"cancel\");\n if (confirmUpCase) {\n alert (\"Upper Case selected\");\n } else {\n alert(\"Upper Case not Selected\");\n }\n\n // }\n \n var confirmLowCase = confirm(\"Would you like to use lower case letters in your password? Press ok to confirm or cancel to ignore\");\n \n if (confirmLowCase){\n alert (\"Lower Case Selected\");\n } else {\n alert (\"Lower Case not Selected\");\n }\n \n var confirmNumbers = confirm(\"Would you like to use numbers in your password? Press ok to confirm or cancel to ignore\");\n \n if (confirmNumbers){\n alert (\"Numbers Selected\");\n } else {\n alert (\"Numbers not Selected\");\n }\n\n\n var confirmSymbols = confirm(\"Would you like to use symbols in your password? Press ok to confirm or cancel to ignore\");\n\n if (confirmSymbols){\n alert (\"Symbols Selected\");\n } else {\n alert (\"Symbols not Selected\");\n }\n\n\n\n //for loop allowing the selection of the characters from the array of characters.\n //var characters = upperCase.concat(lowerCase, numbers, symbols);\n \n for(var i, i = 0; i < characters.length; i++){\n generatePassword += characters.charAt(math.random() * characters.length)\n}\n\n\n\n}", "function clientPasswordVerify(){\n var passw = /^[A-Za-z]\\w{7,14}$/;\n if (clientPassword.value.match(passw)){\n clientPassword.style.border = \" 2px solid #7FFF00\";\n clientPassword_error.innerHTML = \"\";\n return true;\n }\n else {{\n alert(\"You have entered an invalid password address!\");\n document.form1.text1.focus();\n return false;\n }}\n}", "function passwordValidation(){\n return password.value.match(passwordReg);\n}", "function checkPass() {\n if (getPass().length > 0) {\n if ((getPass()[0] >= \"a\" && getPass()[0] <= \"z\") || (getPass()[0] >= \"A\" && getPass()[0] <= \"Z\"))/*if the first char letter and not num*/ {\n if (isLetterOrNum(getPass())) {\n if (getPass().length >= 6)/*password at least 6 chars*/ {\n document.ePass.uPass.style.borderColor = \"green\";\n document.getElementById(\"errPass\").style.display = \"none\";\n return true;\n } else {\n document.ePass.uPass.style.borderColor = \"red\";\n document.getElementById(\"errPass\").innerHTML = \"Password have to be at least 6 chars. Left: \" + (6 - getPass().length);\n document.getElementById(\"errPass\").style.display = \"block\";\n return false;\n }\n } else {\n document.ePass.uPass.style.borderColor = \"red\";\n document.getElementById(\"errPass\").innerHTML = \"Only letters or nums\";\n document.getElementById(\"errPass\").style.display = \"block\";\n return false;\n }\n } else {\n document.ePass.uPass.style.borderColor = \"red\";\n document.getElementById(\"errPass\").innerHTML = \"First char have to be letter\";\n document.getElementById(\"errPass\").style.display = \"block\";\n return false;\n }\n } else {\n document.ePass.uPass.style.borderColor = \"grey\";\n document.getElementById(\"errPass\").style.display = \"none\";\n return false;\n }\n}", "function change_pass(event) {\r\n $('#old_pass').val($('#old_pass').val().replace(/\\s/g, ''));\r\n $('#new_pass').val($('#new_pass').val().replace(/\\s/g, ''));\r\n $('#cnf_pass').val($('#cnf_pass').val().replace(/\\s/g, ''));\r\n if ($(\"#old_pass\").val() != \"\") {\r\n $(\"#old_pass_error\").removeClass(\"has-error\");\r\n $(\"#old_pass_msg\").text(\"\");\r\n }\r\n if ($(\"#new_pass\").val() != \"\") {\r\n $(\"#new_pass_error\").removeClass(\"has-error\");\r\n $(\"#new_pass_msg\").text(\"\");\r\n }\r\n if ($(\"#cnf_pass\").val() != \"\") {\r\n $(\"#cnf_pass_error\").removeClass(\"has-error\");\r\n $(\"#cnf_pass_msg\").text(\"\");\r\n }\r\n $(\"#changeAfterSuccessMsg\").text(\"\");\r\n if (event.which == 13) {\r\n $('#change_pass_btn').click();\r\n return false;\r\n }\r\n}//change password end", "function validateseniorForm(){\n\tif (document.getElementById(\"psw\").value!=document.getElementById(\"psw2\").value){\n\t\t\tbootbox.alert(\"Password and new password is different, They must be same.\");\n\t\t\treturn false;\n\t}\n\treturn true;\n}" ]
[ "0.8182297", "0.78593343", "0.7684648", "0.761468", "0.75360185", "0.7532019", "0.74890745", "0.74773026", "0.74473083", "0.74390036", "0.7432216", "0.7415758", "0.74024063", "0.7398931", "0.7370108", "0.73603064", "0.7356757", "0.7356095", "0.7355932", "0.7350093", "0.73467994", "0.73381907", "0.7322362", "0.730276", "0.72939676", "0.72907245", "0.728783", "0.72728115", "0.7271971", "0.72493774", "0.72407615", "0.7235153", "0.72340435", "0.7227713", "0.72104317", "0.72071594", "0.7204908", "0.7197945", "0.7196656", "0.7196405", "0.71937716", "0.71760386", "0.7171134", "0.7171094", "0.7169078", "0.71677244", "0.716754", "0.71643156", "0.713531", "0.71285653", "0.7128298", "0.71245146", "0.71137094", "0.7111317", "0.71101665", "0.70948607", "0.7087223", "0.708642", "0.7078621", "0.7072609", "0.7066838", "0.70616716", "0.7060257", "0.7055895", "0.70536065", "0.70510924", "0.70483446", "0.70393217", "0.7036975", "0.7033273", "0.7027307", "0.70255804", "0.7022932", "0.7022279", "0.7016282", "0.7013837", "0.70115", "0.70065373", "0.7005421", "0.6990965", "0.69883496", "0.69876915", "0.6987628", "0.69858706", "0.6975104", "0.6974347", "0.6967464", "0.6958829", "0.69524384", "0.6949228", "0.6940027", "0.693597", "0.69323003", "0.6931749", "0.6930719", "0.69271004", "0.6924675", "0.6923358", "0.6916226", "0.6913834" ]
0.7003874
79
confirm password function end here / otp function start here
function OtpPassword(){ var otp_time_check=$("#reset_otp").val(); if(otp_time_check.length == '' || otp_time_check.length == null) { $("#reset_otp").removeClass("has-success"); $("#reset_otp").addClass("has-error"); $("#otp_label_reset").show(); $("#otp_label_reset").text("This Field is required"); return false; } else{ $("#reset_otp").addClass("has-success"); $("#otp_label_reset").show(); $("#otp_label_reset").text(""); return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirmPassword(p1, p2 ){ if (p1.value && p1.value !== p2.value) {\n password2Ok = 0;\n showError(p2, \"Both passwords must match.\")\n} else if (p1.value && p1.value === p2.value) {\n password2Ok = 1;\n showSuccess(p2)\n}\n}", "function otp(req,res,next){\n var path =req.headers.host\n loginService.forgetpasswordotp(req.body,path)\n .then(user => user ? res.send(user) : res.status(400).send({message: 'Email Id is not found in our database'}))\n .catch(err => next(err));\n}", "function forgotPassword(method,type) {\n hideError('email');\n addFunActionLabel=\"Forgot Pasword Submit\";\n if(pageType=='not_login'){\n var email = $.trim($(\"#TenTimes-Modal #userEmailCopy\").val()); \n }else{\n var email = $.trim($(\"#TenTimes-Modal #userEmail\").val());\n }\n if(!validateEmail12345(email)){\n $(\".alert_email\").show();\n return 0;\n }\n var otpType='password';\n if(type=='N' || type=='U'){\n otpType='otp';\n }\n\n if(method == \"connect\")\n var postData = {'email':email, 'name' : receiverData.name , 'type' : otpType }\n else\n var postData = {'email':email, 'name' : email , 'type' : otpType }\n showloading();\n $.post(site_url_attend+'/user/getpassword',postData,function(response){\n hideloading();\n response=$.parseJSON(response);\n var resText=response.resText;\n var resLink=response.resLink;\n if(type=='N' || type=='U'){\n resText=response.resText_typeN;\n resLink=response.resLink_typeN;\n \n }\n \n switch(response.response) {\n case 'true':\n $('#getpassword').parent().replaceWith(function() { return \"<a style='text-decoration:none'>\" + \"<p class='text-center' style='text-decoration:none;color:#909090;'>\" + resText + \"</p>\"+$('#getpassword').get(0).outerHTML+\"</a>\"; });\n\n $('#getpassword').text(resLink);\n if(method!='signup' && method!='connect' && method!='contact_organizer_venue'){\n $('#TenTimes-Modal .partial-log').hide();\n $('#getpassword').removeAttr(\"onclick\").click(function() {\n partialLog(method,type)\n }).text(resLink).css('color','#335aa1');\n }\n break;\n case 'false':\n $(\".alert_email\").html(\"Sorry, 10times doesn't recognize that email.\");\n $(\".alert_email\").show();\n break;\n }\n }); \n}", "function checkPassword() {\n\n\n\n}", "async function confirm()\n {\n // Double check everything is as expected.\n if (!validate_password() ||\n !validate_repeated_password())\n {\n return;\n }\n try\n {\n const new_password = DOM.new_password_input.value;\n const new_hashed_password = await security.hash(new_password);\n\n let setting_up;\n if (old_hashed_password)\n {\n setting_up = bookmarks.change_authentication(\n old_hashed_password,\n new_hashed_password\n );\n }\n else { setting_up = bookmarks.setup(new_hashed_password); }\n\n transition_to(\"on_hold\");\n await new Promise(resolve => { setTimeout(resolve, 1000); });\n await setting_up;\n\n on_success(old_hashed_password, new_hashed_password);\n }\n catch (error)\n {\n transition_to(\"error\",\n {\n title: `Error during password ${old_hashed_password ? \"change\" : \"setup\"}`,\n message: error.message\n });\n }\n finally { clear_sensitive_data(); }\n }", "function writePassword() {\n var password = generatePassword();\n var lowercase = confirm(\"include lowercase\");\n if (lowerCasedCharacters === true) {\n }\n var uppercase = confirm(\"include uppercase\");\n var number = confirm(\"include number\");\n var speicalcharacter = confirm(\"include speicalcharacter\");\n var pw = document.getElementById(\"password\").value;\n}", "function confirmPassword(inputPassword) {\n let confirm;\n\n if (inputPassword.match(password) === null) {\n confirm = false;\n }\n else {\n const test = inputPassword.match(password).join(\"\");\n \n // if (test === inputPassword) {\n // confirm = true;\n // }\n // else {\n // confirm = false;\n // }\n test === inputPassword ? confirm = true: confirm = false;\n }\n\n\n if (confirm) {\n sendLogin();\n }\n else {\n console.error(\"error\");\n incorrectPassword();\n }\n}", "function checkConfirmPassword()\r\n\t{\r\n\t\tvar newPassword=$(\"#Npass\").val();\r\n\t\tvar confirmPassword=$(\"#Cpass\").val();\r\n\t\t \r\n\t\t if(!isEmpty(confirmPassword))\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t$(\"#Cpass\").css(\"border-color\",\"red\");\r\n\t\t\t\t$(\"#CpassP\").text(\"confirm password is Required\").css(\"color\",\"red\").show();\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\tif(!passwordRegEx.test(confirmPassword))\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$(\"#Cpass\").css(\"border-color\",\"red\");\r\n\t\t\t\t$(\"#CpassP\").text(\"Invalid confirm password Entered\").css(\"color\",\"red\").show();\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\tif(newPassword!=confirmPassword)\r\n\t\t\t{\r\n\t\t\t\r\n\t\t\t\t$(\"#Cpass,#Npass\").css(\"border-color\",\"red\");\r\n\t\t\t\t$(\"#CpassP,#NpassP\").text(\"New and confirm Password must be same\").css(\"color\",\"red\").show();\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t \r\n\t\telse\r\n\t\t\t{\r\n\t\t\t\t$(\"#Cpass\").css(\"border-color\",\"\");\r\n\t\t\t\t$(\"#CpassP\").hide();\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}\t\r\n\t}", "function authPasswordAndConfirm($form) {\n var $passwordGroup = $form.find('.password-form-group');\n var $passwordInput = $passwordGroup.find('input');\n var $confirmGroup = $form.find('.confirm-form-group');\n var $confirmInput = $confirmGroup.find('input');\n\n var password = $passwordInput.val();\n if (!validPassword(password)) {\n $passwordGroup.addClass('has-error');\n $confirmGroup.addClass('has-error');\n display_alert(\"Password must be at least 16 characters.\", \"error\")\n\n return false; // don't submit form\n }\n if ($confirmInput.val() != password) {\n $passwordGroup.addClass('has-error');\n $confirmGroup.addClass('has-error');\n display_alert(\"Passwords do not match\", \"error\")\n\n return false; // don't submit form\n }\n\n $form.find('.hidden-password').val(authSecret(password));\n return true; // submit form\n }", "function validateInfo(email, password, confirmPassword) {\n if (password == confirmPassword) {\n return true;\n }\n else {\n return false;\n }\n}", "function change_password() {\n\tvar current_password = document.getElementById(\"current_password\").value;\n\tvar new_password = document.getElementById(\"new_password\").value;\n\tvar confirm_new_passord = document.getElementById(\"confirm_new_password\").value;\n\t\n\t// Check validity of given passwords\n\tif(new_password != confirm_new_passord) {\n\t\talert(\"Passwords do not match\");\n\t\treturn;\n\t} else if(new_password.length < 8) {\n\t\talert(\"New password is too short\");\n\t\treturn;\n\t}\n\tvar data = JSON.stringify({\n\t\tcurrent_password : current_password,\n\t\tnew_password : new_password\n\t});\n\tvar uri = getLink(\"UpdatePassword\");\n\t\n\tvar xhr = createRequest(\"POST\", uri);\n\txhr.setRequestHeader(\"Content-Type\", \"text/plain\")\n\txhr.onload = function() {\n\t\tif(xhr.status == 401) alert(\"Current password incorrect\");\n\t\telse if(xhr.status != 200) alert(\"Something went wrong on the server :/\");\n\t\telse {\n\t\t\tdocument.getElementById(\"current_password\").value = \"\";\n\t\t\tdocument.getElementById(\"new_password\").value = \"\";\n\t\t\tdocument.getElementById(\"confirm_new_password\").value = \"\";\n\t\t\talert(\"Password successfully changed!\");\n\t\t}\n\t}\n\txhr.send(data);\n\t\n}", "function judgeConfirm()\n{\n var password = document.getElementById(\"Password_Password\").value;\n var confirm = document.getElementById(\"Password_Confirm\").value;\n clearDivText(\"Div_Confirm\");\n if(confirm.length > 0 && password == confirm)\n {\n setDivText(\"Div_Confirm\", TYPE_CORRECT, \"\");\n return true;\n }\n else\n {\n if(confirm.length > 0)\n {\n setDivText(\"Div_Confirm\", TYPE_ERROR, \"两次输入密码不同\");\n }\n else\n {\n setDivText(\"Div_Confirm\", TYPE_ERROR, \"未输入密码\");\n }\n return false;\n }\n}", "function validconfpass()\n{\nvar p1=document.getElementById(\"pword\").value;\nvar p2=document.getElementById(\"confpword\").value;\n\n\nif(p1.length==0 )\n{\nalert(\"Password is required\");\n}\n\nif(p1!=p2)\n{\nalert(\"Password does not match\");\n}\nelse if()\n{\ndocument.getElementById(\"mess3\").innerHTML=\"Password confirmed\";\n}\n}", "function otpConfirmation() {\n if (verificationId1 !== \"\" && otpInput !== \"\") {\n setIsLoading2(true);\n var credential = firebase.auth.PhoneAuthProvider.credential(\n verificationId1,\n otpInput\n );\n firebase\n .auth()\n .signInWithCredential(credential)\n .then((res) => {\n // console.log('signedIn')\n // var user1 = firebase.auth().currentUser;\n // history.push(\"/Quiz\");\n window.location.reload();\n setIsLoading2(false);\n })\n .catch((err) => {\n alert(\"Error Verifying OTP\");\n window.location.reload();\n setIsLoading2(false);\n });\n } else if (otpInput === \"\" && verificationId1 !== \"\") {\n alert(\"Solve reCaptcha to initialize verification\");\n } else {\n alert(\"Get OTP to initialize verification\");\n }\n }", "function ChangePassword() {\n\t}", "onupdateConfirmPassword(event) {\n this.password = event.target.value;\n this.passwordValidationState = '';\n }", "function generate_password() {\n base.emit(\"generate-password\", {\n url: document.location.toString(),\n username: find_username(),\n });\n }", "function vpb_request_password_link()\n{\n\tvar ue_data = $(\"#ue_data\").val();\n\t\n\tif(ue_data == \"\")\n\t{\n\t\t$(\"#ue_data\").focus();\n\t\t$(\"#this_page_errors\").html('<div class=\"vwarning\">'+$(\"#empty_username_field\").val()+'</div>');\n\t\t$('html, body').animate({\n\t\t\tscrollTop: $('#ue_data').offset().top-parseInt(200)+'px'\n\t\t}, 1600);\n\t\treturn false;\n\t} else {\n\t\tvar dataString = {'ue_data': ue_data, 'page':'reset-password-validation'};\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: vpb_site_url+'forget-password',\n\t\t\tdata: dataString,\n\t\t\tcache: false,\n\t\t\tbeforeSend: function() \n\t\t\t{\n\t\t\t\t$(\"#this_page_errors\").html('');\n\t\t\t\t$(\"#disable_or_enable_this_box\").removeClass('enable_this_box');\n\t\t\t\t$(\"#disable_or_enable_this_box\").addClass('disable_this_box');\n\t\t\t\t\n\t\t\t\t$(\"#forgot_password_buttoned\").hide();\n\t\t\t\t$(\"#log_in_status\").html('<center><div align=\"center\"><img style=\"margin-top:-40px;\" src=\"'+vpb_site_url+'img/loadings.gif\" align=\"absmiddle\" alt=\"Loading\" /></div></center>');\n\t\t\t},\n\t\t\tsuccess: function(response)\n\t\t\t{\n\t\t\t\t$(\"#disable_or_enable_this_box\").removeClass('disable_this_box');\n\t\t\t\t$(\"#disable_or_enable_this_box\").addClass('enable_this_box');\n\t\t\n\t\t\t\t$(\"#log_in_status\").html('');\n\t\t\t\t$(\"#forgot_password_buttoned\").show();\n\t\t\t\t\t\n\t\t\t\tvar response_brought = response.indexOf(\"processCompletedStatus\");\n\t\t\t\t$vlog=JSON.parse(response);\n\t\t\t\tif(response_brought != -1)\n\t\t\t\t{\n\t\t\t\t\tif($vlog.processCompletedStatus==true){\n $(\"#ue_data\").val('');\n $(\"#this_page_errors\").html($vlog.response);\n return false;\n\t\t\t\t\t}else{\n setTimeout(function() {\n \twindow.alert(\"To change the password you first need to verify the account by entering the verification code which was sent to your gmail account earlier while sign up in the 'Enter the verification code ... ' field to proceed.\");\n window.location.replace(vpb_site_url+'verification');\n },500);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$(\"#this_page_errors\").html($vlog.response);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "function comparePwd(password, confPwd)\r\n{\r\n\t if(password != confPwd)\r\n\t {\r\n\t\t alert(\"Re-type the New Password in Confirm Password field\");\r\n\t\t $('#txtConfPwd').focus();\r\n\t\t return false;\r\n\t }\r\n\t else\r\n\t {\r\n\t\t return true; \r\n\t }\r\n}", "processPassRep() {\n if (this.password.value !== this.passwordRepeat.value) {\n this.passwordRepeat.err = true;\n this.passwordRepeatErr.seen = true;\n this.valid = false;\n this.passwordRepeatErr.text = \"رمز عبور و تکرار آن یکسان نیستند\";\n } else {\n this.passwordRepeat.err = false;\n this.passwordRepeatErr.seen = false;\n }\n }", "function resetPassword() {\r\n \tconsole.log(\"Inside reset password\");\r\n \t//self.user.userpassword = self.user.password;\r\n \tself.user.user_id = $(\"#id\").val();\r\n \tself.user.obsolete = $(\"#link\").val();\r\n \tdelete self.user.confpassword;\r\n \tUserService.changePassword(self.user)\r\n \t\t.then(\r\n \t\t\t\tfunction (response) {\r\n \t\t\t\t\tif(response.status == 200) {\r\n \t\t\t\t\t\tself.message = \"Password changed successfully..!\";\r\n \t\t\t\t\t\tsuccessAnimate('.success');\r\n \t\t\t\t\t\t\r\n \t\t\t\t\t\twindow.setTimeout( function(){\r\n \t\t\t\t\t\t\twindow.location.replace('/Conti/login');\r\n \t\t\t\t \t}, 5000);\r\n \t\t\t\t\t\t\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tself.message = \"Password is not changed..!\";\r\n \t\t\t\t\t\tsuccessAnimate('.failure');\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\tfunction (errResponse) {\r\n \t\t\t\t\tconsole.log(errResponse);\r\n \t\t\t\t}\r\n \t\t\t);\r\n }", "function writePassword() {\n passLength = window.prompt(\"How long would you like your password?\");\n if(passLength > 128 || passLength < 8) {\n alert(\"No less than 8 and no more than 128! Refresh and try again!\");\n }\n\n\n upperConfirm = confirm(\"Do you want uppercase letters?\");\n if(upperConfirm) {\n results += upperCase;\n }\n\n lowerConfirm = confirm(\"Do you want lowercase letters?\");\n if(lowerConfirm) {\n results += lowerCase;\n }\n\n numConfirm = confirm(\"Do you want any numbers?\");\n if(numConfirm) {\n results += numCase;\n }\n\n symConfirm = confirm(\"Do you want any symbols?\");\n if(symConfirm) {\n results += symCase;\n }\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "confirmForgetPassword(password, uid, token) {\n return request\n .post(`${API_PREFIX}/password/reset/confirm/`)\n .send({ new_password: password, uid, token })\n .then(() => Promise.resolve(true));\n }", "function uConfPassword() {\n\t\tvar u_conf_pass = $('#user_conf').val();\n\t\tvar u_pass = $('#user_pass').val();\n\t\tif (!(u_conf_pass == u_pass)) {\n\t\t\t$('#alert_conf_pass').text(\"Password did'nt matched \");\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_conf_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t} else if (u_conf_pass === '') {\n\t\t\t$('#alert_conf_pass').text('This field cannot be empty ');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_conf_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function writePassword() { \n \n\n // var Qupper = confirm(\"Would you like to add uppercase?\");\n var Qlower = confirm(\"Would you like to add lowercase?\");\n var Qnumber = confirm(\"Would you like to add numbers?\");\n var Qspec = confirm(\"Would you like to add characters?\");\n\n\n\ngeneratepassword(Qlower, Qnumber, Qspec);\n}", "function generatePassword() {\n let verify = false;\n while (!verify) {\n let passLength = parseInt(prompt(\"Choose a password number between 8 and 128\"));\n //make statment for making sure there is a value\n if (!passLength) {\n alert(\"You need a value\");\n continue;\n } else if (passLength < 8 || passLength > 128) {\n passLength = parseInt(prompt(\"Password length must be between 8 and 128 characters long.\"));\n //this will happen once user puts in a correct number\n } else {\n confirmNumber = confirm(\"Do you want your password to contain numbers?\");\n confirmCharacter = confirm(\"Do you want your password to contain special characters?\");\n confirmUppercase = confirm(\"Do you want your password to contain Uppercase letters?\");\n confirmLowercase = confirm(\"Do you want your password to contain Lowercase letters?\");\n };\n //confirm that something will happen or error\n if (!confirmCharacter && !confirmLowercase && !confirmNumber && !confirmUppercase) {\n alert('At least one character type must be selected.');\n continue;\n }\n //verify its true to set pass\n verify = true;\n let newPass = '';\n let charset = '';\n //start if for statment for the password length\n //set combinations in else if statments\n //set charset for each else if statment\n //create for for loop for (var i = 0; i < passLength; ++i)\n //newPass += charset.charAt(Math.floor(Math.random() * charset.length));\nif(!confirmNumber && !confirmUppercase && ! confirmLowercase){\n charset = \"!@#$%^&*\"\n for (var i = 0; i < passLength; ++i) {\n newPass += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n} else if (!confirmCharacter && !confirmUppercase && !confirmLowercase){\n charset = \"0123456789\"\n for (var i = 0; i < passLength; ++i) {\n newPass += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n} else if (!confirmCharacter && !confirmNumber && !confirmLowercase){\n charset = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n for (var i = 0; i < passLength; ++i) {\n newPass += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n} else if (!confirmCharacter && !confirmUppercase && !confirmNumber){\n charset = \"abcdefghijklmnopqrstuvwxyz\"\n for (var i = 0; i < passLength; ++i) {\n newPass += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n}else if (!confirmCharacter && !confirmNumber){\n charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n for (var i = 0; i < passLength; ++i) {\n newPass += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n}else if (!confirmUppercase && !confirmLowercase){\n charset = \"0123456789!@#$%^&*\"\n for (var i = 0; i < passLength; ++i) {\n newPass += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n}else if (!confirmUppercase && !confirmNumber){\n charset = \"abcdefghijklmnopqrstuvwxyz!@#$%^&*\"\n for (var i = 0; i < passLength; ++i) {\n newPass += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n}else if (!confirmLowercase && !confirmNumber){\n charset = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*\"\n for (var i = 0; i < passLength; ++i) {\n newPass += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n} else {\n charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\" \n for (var i = 0; i < passLength; ++i) {\n newPass += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n}\n document.getElementById(\"password\").textContent = newPass;\n }\n}", "function resetPassword() {\n\t\t\tif (vm.newPassword != \"\" && vm.newPassword == vm.confirmPassword) {\n\t\t\t\tvm.waiting = true;\n\t\t\t\tserver.resetPassword($stateParams.token, vm.newPassword).then(function(res) {\n\t\t\t\t\tvm.success = 1;\n\t\t\t\t\tvm.waiting = false;\n\t\t\t\t\t$rootScope.$broadcast('loading', false); // TODO (HACK)\n\t\t\t\t}, function(res) {\n\t\t\t\t\tvm.success = 0;\n\t\t\t\t\tvm.waiting = false;\n\t\t\t\t\t$rootScope.$broadcast('loading', false); // TODO (HACK)\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tgui.alertError(\"Passwords do not match.\");\n\t\t\t}\n\t\t}", "function confirmPass() {\n var pass = document.getElementById(\"pass1\").value\n var confPass = document.getElementById(\"pass2\").value\n if (pass != confPass) {\n alert('Wrong confirm password !');\n return false\n } else {\n return true;\n }\n}", "function change_pass(event) {\r\n $('#old_pass').val($('#old_pass').val().replace(/\\s/g, ''));\r\n $('#new_pass').val($('#new_pass').val().replace(/\\s/g, ''));\r\n $('#cnf_pass').val($('#cnf_pass').val().replace(/\\s/g, ''));\r\n if ($(\"#old_pass\").val() != \"\") {\r\n $(\"#old_pass_error\").removeClass(\"has-error\");\r\n $(\"#old_pass_msg\").text(\"\");\r\n }\r\n if ($(\"#new_pass\").val() != \"\") {\r\n $(\"#new_pass_error\").removeClass(\"has-error\");\r\n $(\"#new_pass_msg\").text(\"\");\r\n }\r\n if ($(\"#cnf_pass\").val() != \"\") {\r\n $(\"#cnf_pass_error\").removeClass(\"has-error\");\r\n $(\"#cnf_pass_msg\").text(\"\");\r\n }\r\n $(\"#changeAfterSuccessMsg\").text(\"\");\r\n if (event.which == 13) {\r\n $('#change_pass_btn').click();\r\n return false;\r\n }\r\n}//change password end", "function verifyOTP() {\n\t \n var authnData = {\n \"authId\": AUTH_ID,\n \"otp\": document.getElementById('otp').value,\n \"hint\": \"VALIDATE_OTP\", //dont change this value.\n \"trustDevice\": \"0\"\n };\n var trustDeviceCheckbox = document.getElementById(\"trustDevice\");\n\t if (trustDeviceCheckbox.checked === true) {\n\t\t authnData.trustDevice = \"1\";\n\t }\n authenticate(authnData);\n}", "function validatePasswordInput() {\n let typedPassword = document.querySelector(\n \".confirmModifications_form-password input\"\n ).value;\n if (userObject.password == typedPassword) {\n // If there is a match the user is updated in the website\n\n populateUserInfo(userObject);\n\n // The user is updated in the database\n\n put(userObject);\n document.querySelector(\".modal-confirm\").style.display = \"block\";\n closeConfirmModifications();\n } else {\n document.querySelector(\n \".confirmModifications_paragraph-alertWrongPass\"\n ).style.display = \"block\";\n }\n}", "function checkpw(inputpw,inputpwc){\n if(inputpw.value != inputpwc.value){\n document.getElementById(\"Password\").innerHTML = \"Please check passward you type in. The password is not equal to password confirm.\"+\"<br>\";\n inputpw.value = \"\";\n inputpwc.value = \"\";\n return false;\n }\n else\n return true;\n}", "function generatePassword() {\n\n let passwordLength = prompt(\"Password Criteria question 1 of 6\\n\" +\n \"--------------------------------------\\n\" +\n \"I can generate a password for you, anywhere between \" + \n \"8 characters and up to 128 characters in length.\\n\\n\"+\n \"My default is the minimum 8 character password.\\n\\n\"+\n \"Please type in the password length you require, I accept \" +\n \"any number between 8 and 128.\\n\\n\" +\n \"What length password would you like today?\\n\",8); \n\n if (passwordLength === null) {\n alert(goodbyeMessage); \n return null;\n }\n\n if (( passwordLength < 8 )||( passwordLength > 128 )) {\n\n let incorrectUserInput = confirm(\"There's a problem.\\n\\n\" +\n \"You can select a minimum of 8 characters \" +\n \"or any other number up to a maximum of 128 \" + \n \"characters and less than or equal to 128.\\n\\n\" +\n \"Try again?\");\n \n if ( !incorrectUserInput ) { \n\n alert( goodbyeMessage ); \n return null;\n } else {\n return null;\n } \n }\n \n let lowerCase = confirm(\"Password Criteria question 2 of 6\\n\" +\n \"--------------------------------------\\n\" +\n \"Would you like your password to have:\\n\\n\" +\n \"lower case letters?\\n\\nSelect <OK> \"+\n \"for yes or <Cancel> for no.\");\n\n\n let upperCase = confirm(\"Password Criteria question 3 of 6\\n\" +\n \"--------------------------------------\\n\" +\n \"Would you like your password to have:\\n\\n\" + \n \"UPPER case letters?\\n\\n Select <OK> \"+\n \"for yes or <Cancel> for no.\");\n\n \n let numerical = confirm(\"Password Criteria question 4 of 6\\n\" +\n \"--------------------------------------\\n\" +\n \"Would you like your password to have:\\n\\n \" +\n \"Numbers?\\n\\nSelect <OK> \"+\n \"for yes or <Cancel> for no.\");\n\n\n let specialChar = confirm(\"Password Criteria question 5 of 6\\n\" +\n \"--------------------------------------\\n\" +\n \"Finally, how about:\\n\\nSpecial characters?\\n\\n\" +\n \"Recommended for a more secure password. \" +\n \"I have 24 special characters to select from, \" +\n \"they are:\\n @ % \\u005C + / ' ! # $ ^ ? : , ( ) { \" +\n \"} [ ] ~ ` - _ . \\n\\n\" +\n \"Select <OK> for yes or <Cancel> for no.\");\n \n /* Boolean changed to a yes or no as I think \n it is more meaningful to a user for this type \n of information instead of true or false. \n I just learnt about the Condition Operator ?\n from my literature review. Giving it a run here.\n */\n\n (lowerCase) ? lowerCase = \"yes\" : lowerCase = \"no\";\n (upperCase) ? upperCase = \"yes\" : upperCase = \"no\";\n (numerical) ? numerical = \"yes\" : numerical = \"no\";\n (specialChar) ? specialChar = \"yes\" : specialChar = \"no\";\n\n if((lowerCase===\"no\")&&(upperCase===\"no\")&&(numerical===\"no\")&&(specialChar===\"no\")) {\n \n let nothingSelected = confirm(\"Mmmmmmmmmm \\n \" +\n \"----------------------\\n\" +\n \"It seems you've not selected any option for me to generate \" +\n \"a password. This is what you selected:\\n\" + \n ` length of password = ${passwordLength} characters\\n` +\n ` lower case = ${lowerCase}\\n` + \n ` UPPER case = ${upperCase.valueOf()}\\n` +\n ` numbers = ${numerical}\\n` +\n ` special characters = ${specialChar}\\n\\n` +\n \"Try again?\\n\")\n\n if (!nothingSelected) {\n alert(goodbyeMessage); \n return null;\n } else {\n return null;\n } \n }\n\n/* I learnt template literals whilst doing this assignment and decided to use it for \n this assignment. \n https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals \n*/\n\n let selectionSummary = confirm(\"Password Criteria question 6 of 6\\n\" +\n \"--------------------------------------\\n\" +\n \"Please confirm your selection is as follows:\\n\\n\" +\n ` length of password = ${passwordLength} characters\\n` +\n ` lower case = ${lowerCase}\\n` + \n ` UPPER case = ${upperCase.valueOf()}\\n` +\n ` numbers = ${numerical}\\n` +\n ` special characters = ${specialChar}\\n\\n` +\n \"Select <Cancel> if you want to change any of the above.\")\n \n if (!selectionSummary){\n alert(goodbyeMessage); \n return null;\n }\n\n // Build the character list based on the user's selected criteria.\n let charCodes = [];\n \n if ( lowerCase === \"yes\" ) { charCodes.push(...LOWERCASE_CHARACTERS); }\n\n if ( upperCase === \"yes\" ) { charCodes.push(...UPPERCASE_CHARACTERS); }\n\n if ( numerical === \"yes\" ) { charCodes.push(...NUMERAL_CHARACTERS); }\n\n if ( specialChar === \"yes\" ) { charCodes.push(...SPECIAL_CHARACTERS); }\n\n // console.log(\"Character's in charCode array = \" + charCodes);\n \n /* console.time(\"Array Method\"); /* <== left here to look at performance difference between \n string and array methods. Found string is on average\n 8% faster!\n*/ \n\n let passwordCharacters = [];\n \n for (let i = 1; i <= passwordLength; i++) {\n\n /* We want the full selection of the charCodes \n array to be available for random selection so there shouldn't\n be any modifiers for min or max. \n In addition as the array reference needs to be an array index,\n that is between 0 and array.length-1, I've now confirmed\n the following formula works in accessing the full scope \n charCodes array passed to it.\n */\n\n let randomGenerator = Math.floor(Math.random() * (charCodes.length)); \n const characterCode = charCodes[randomGenerator];\n\n // console.log(characterCode);\n // console.log(String.fromCharCode(characterCode));\n \n passwordCharacters.push(String.fromCharCode(characterCode));\n }\n\n return passwordCharacters.join('');\n}", "function editUser(){\n\tconst opsw = document.getElementById(\"opsw\").value;\n\tconst npsw = document.getElementById(\"npsw\").value;\n\tconst cpsw = document.getElementById(\"cpsw\").value;\n\tif(opsw != user_psw){\n\t\talert(\"Wrong old password\");\n\t}\n\telse if(npsw==\"\"){\n\t\talert(\"Password can't be empty\")\n\t}\n\telse if(npsw != cpsw){\n\t\talert(\"New passwords don't match\");\n\t}\n\telse{\n\t\tuser = {\"id\":0, \"password\":npsw};\n\t\tpostServerData(`/ws/users/${current_user_id}`,user,navig);\n\t}\n}", "function getServerOTP() {\n var authnData = {\n \"authId\": AUTH_ID,\n \"hint\": \"GET_SERVER_OTP\" //dont change this value.\n };\n authenticate(authnData);\n}", "function checkPasswordMatch(password,confirmPassword)\n{\n\tif (password != confirmPassword) {\n \treturn 'false';\n } else {\n return 'true';\n } \n}", "function generatePassword() {\n var passwordlength = window.prompt(\"How many characters do you want your password to be?\")\n passwordlength = parseInt(passwordlength)\n if (passwordlength <8 || passwordlength >128) {\n window.alert(\"Password must be between 8 and 128 characters\")\n return;\n }\n // Prompts that ask what characters you would like in your password.\n var lowercase = window.confirm(\"Do you want lower case letters?\")\n var uppercase = window.confirm(\"Do you want upper case letters?\")\n var numbers = window.confirm(\"Do you want numbers?\")\n var specialcharacters = window.confirm(\"Do you want special characters?\")\n// is user clicks 'cancel' it will give you 'false' if you put 'ok' it will give you 'true'\n if (!lowercase && !uppercase && !numbers && !specialcharacters){\n return \"false\"\n }\n var finalstring= \"\"\n if (lowercase){\n finalstring= finalstring + lowercaseoption \n }\n\n if (uppercase){\n finalstring= finalstring + uppercaseoption\n }\n\n if (numbers){\n finalstring= finalstring + numbersoption\n }\n\n if (specialcharacters) {\n finalstring= finalstring + specialcharactersoption\n }\n var password = \"\"\n for(i=0; i< parseInt(passwordlength); i++){\n var single= randomize(finalstring)\n password= password + single\n }\n return password\n}", "function validateUserOtp(pin, otp, req, res, next) {\n if(pin === otp) {\n next();\n } else {\n res.status(409).json({status : 'error', message : 'Incorrect OTP'});\n }\n}", "function check_Modify_password_form() {\n var emailcode = document.getElementById(\"emailcodeText\").value;\n var password = document.getElementById(\"passwordText\").value;\n var confirm_password = document.getElementById(\"Confirm_passwordText\").value;\n\n if(emailcode.length ==0){\n alert(\"Please enter the code\");\n return false;\n }\n if (password.length <6) {\n alert(\"Please enter the 6 digital password\");\n return false;\n }\n if (password != confirm_password) {\n alert(\"The passwords are not match, Please enter again\");\n return false;\n }\n\n return true;\n\n}", "function generatePassword() {\n var confirmLength = (prompt(\"Choose length of password. Enter length between of at least 8 but no more than 128 characters.\"));\n\n // Loop if answer is outside the parameters \n while(confirmLength <= 7 || confirmLength >= 129 || isNaN (confirmLength)) {\n alert(\"...Well let's do this again, shall we?\");\n var confirmLength = (prompt(\"Choose length of password. Enter length between of at least 8 but no more than 128 characters.\"));\n } \n\n // Repeat back how many characters the user will have \n alert(\"Your password will have \" + confirmLength + \" characters.\");\n\n // Determine parameters of password \n var confirmSymbol = confirm(\"Click OK to confirm if you would like to include special symbols\");\n var confirmDigit = confirm(\"Click OK to confirm if you would like to include numeric characters\"); \n var confirmLowerCase = confirm(\"Click OK to confirm if you would like to include lowercase characters\");\n var confirmUpperCase = confirm(\"Click OK to confirm if you would like to include uppercase characters\");\n // Loop if answer is outside the parameters \n while(confirmUpperCase === false && confirmLowerCase === false && confirmSymbol === false && confirmDigit === false) {\n alert(\"You must choose at least one character\");\n var confirmSymbol = confirm(\"Click OK to confirm if you would like to include special symbols\");\n var confirmDigit = confirm(\"Click OK to confirm if you would like to include numeric characters\"); \n var confirmLowerCase = confirm(\"Click OK to confirm if you would like to include lowercase characters\");\n var confirmUpperCase = confirm(\"Click OK to confirm if you would like to include uppercase characters\");\n }\n\n//Declaring an action to each password parameter\nvar passFiller = []\nif (confirmDigit) {\n passFiller = passFiller.concat(number)\n}\nif (confirmSymbol) {\n passFiller = passFiller.concat(specialSymbol)\n}\nif (confirmLowerCase) {\n passFiller = passFiller.concat(upperLetter)\n}\nif (confirmUpperCase) {\n passFiller = passFiller.concat(lowerLetter)\n}\n\n//Empty variable to be filled by for loop \nvar randomPassword = \"\"\n\n//Finally the password \nfor (var i = 0; i < confirmLength; i++) {\n randomPassword = randomPassword + passFiller[Math.floor(Math.random() * passFiller.length)];\n}\nreturn randomPassword;\n}", "function checknewpass(x,y,z)\n{\n\tlet pone=x;\n\tlet ptwo=y;\n\tlet locz=z;\n\tlet pwd1=$('#'+pone).val();\n\tlet pwd2=$('#'+ptwo).val();\n\n\tif (pwd1==\"\" || pwd2==\"\")\n\t{\n\t\treturn;\n\t}\n\n\tif (pwd1!=pwd2) \n\t{\n\t\t$('#'+locz).html(\"<b><center>Passwords do not match!</center></b>\");\n\n\t}\n\telse\n\t{\n\t\t$('#'+locz).html(\"\");\n\n\t}\n\n}", "function v_password(password,test){\n if(password == test){\n return true;\n }\n else{\n $(\"#email\").siblings(\"small\").remove();\n $('<small class=\"form-text danger\"> Email o contraseña incorrecta, inténtelo nuevamente.</small>').insertAfter(\"#email\");\n return false;\n }\n}", "async onAcceptPassword() {\n const { currentPwdHash, setPassword, generateAlert, t } = this.props;\n const { newPassword } = this.state;\n const salt = await getSalt();\n const newPwdHash = await generatePasswordHash(newPassword, salt);\n changePassword(currentPwdHash, newPwdHash, salt)\n .then(() => {\n setPassword(newPwdHash);\n generateAlert('success', t('passwordUpdated'), t('passwordUpdatedExplanation'));\n this.props.setSetting('securitySettings');\n })\n .catch(() => generateAlert('error', t('somethingWentWrong'), t('somethingWentWrongTryAgain')));\n }", "function isValidPassword(password, confirmPassword) {\r\n return password.length >= 6 && password === confirmPassword;\r\n}", "function generatePassword(){\n\n // Gather Selections from user\n \n // Password length:\n selections[0]=window.prompt(\"How many characters for the password? \\n (Note: minimum of 8 and maximum of 128)\");\n if (selections[0] < 8){\n window.alert(\"Password length must be at least 8 characters\");\n generatePassword();\n } else if (selections[0] > 128){\n window.alert(\"Password length must be at less than 128 characters\");\n generatePassword();};\n\n // Special characters:\n Special = window.confirm(\"Click OK to confirm including special characters\");\n if (Special){selections[1] = \"Y\";}\n else {selections[1] = \"N\"};\n\n // Numeric characters:\n Numeric = window.confirm(\"Click OK to confirm including numeric characters\");\n if (Numeric){selections[2] = \"Y\";}\n else {selections[2] = \"N\"};\n \n // Lower case letters:\n Lower = window.confirm(\"Click OK to confirm including lower case letters\");\n if (Special){selections[3] = \"Y\"}\n else {selections[3] = \"N\"};\n\n // Upper case letters:\n Upper = window.confirm(\"Click OK to confirm including upper case letters\");\n if (Special){selections[4] = \"Y\"}\n else {selections[4] = \"N\"};\n\n\n //Generate Password\n for (i=0;i<selections[0];i=i){\n \n if (selections[1]=\"Y\"){\n var choices = \"@%+\\/'!#$^?:,(){}[]`-_.\";\n spcl = choices[Math.floor(Math.random() * choices.length)];\n password=password + spcl;\n i++;} \n \n if (selections[2]=\"Y\"){\n var choices = \"0123456789\";\n num = choices[Math.floor(Math.random() * choices.length)];\n password=password + num;\n i++}\n\n if (selections[3]=\"Y\"){\n var choices = \"abcdefghijklmnopqrstuvwxyz\";\n low = choices[Math.floor(Math.random() * choices.length)];\n password=password + low;\n i++}\n\n if (selections[4]=\"Y\"){\n var choices = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n UP = choices[Math.floor(Math.random() * choices.length)];\n password=password + UP;\n i++}\n }\n\n return password;\n}", "function validatePassword() {\n\n // empty array for the final if statement to check\n var errors = [];\n\n if (confirmLowerCase === true) {\n if (finalPass.search(/[a-z]/) < 0) {\n errors.push(\"lower\");\n }\n }\n if (confirmUpperCase === true) {\n if (finalPass.search(/[A-Z]/) < 0) {\n errors.push(\"upper\");\n }\n }\n if (confirmNumeric === true) {\n if (finalPass.search(/[0-9]/i) < 0) {\n errors.push(\"numeric\");\n }\n }\n if (confirmSpecialChar === true) {\n if (finalPass.search(/[!?@#$%^&*]/i) < 0) {\n errors.push(\"specialchar\");\n }\n }\n // if error array has contents, clear password string and regenerate password\n if (errors.length > 0) {\n finalPass = \"\"\n return passwordGen();\n }\n }", "function pwCriteria() {\n var length = parseInt(\n prompt(\"Choose a password length from 8 to 128 characters\")\n );\n // length validation\n if (length < 8 || length > 128 || Number.isNaN(length)) {\n alert(\"Password needs to be in beetwen 8 to 128\");\n return;\n }\n\n //I confirm whether or not to include lowercase, uppercase, numeric, and/or special characters\n var lwrChoice = confirm(\"Click ok if you want lower case letters\");\n\n var upprChoice = confirm(\"Click ok if you want upper case letters\");\n\n var numChoice = confirm(\"Click ok if you want numbers\");\n\n var spcChoice = confirm(\"Click ok if you want special characters\");\n // VALIDATE IF USER CHOSE CHARACTERS\n if (\n lwrChoice === false &&\n upprChoice === false &&\n numChoice === false &&\n spcChoice === false\n ) {\n alert(\"The password must contain one type of character!\");\n return;\n }\n if (lwrChoice) {\n allChar = allChar.concat(lowerChar)\n \n }\n if (upprChoice) {\n allChar = allChar.concat(upperChar)\n \n }\n if (numChoice) {\n allChar = allChar.concat(numChar)\n \n }\n if (spcChoice) {\n allChar = allChar.concat(specialChar)\n \n }\n for (var i = 0; i < length; i++) {\n var index = Math.floor(Math.random() * allChar.length);\n var rndChar = allChar[index];\n rndPass = rndPass.concat(rndChar)\n \n }\n return rndPass;\n}", "function passwordCheck(form){\r\n var p1=signup.pass.value.trim();\r\n var p2=signup.repass.value.trim();\r\n var errors= document.querySelector(\".errmessage\");\r\n var charstring =\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\r\n var chars= \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\r\n var numstring =\"0123456789\";\r\n var passAlpha=false; \r\n var passNum=false; \r\n var passChar=false; \r\n\r\n\r\n if(p1.length<8){\r\n clear();\r\n errors.innerHTML+= \"<p>* Password must be at least 8 characters long. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n\r\n if(chars.indexOf(p1.substr(0,1))>=0){\r\n passChar=true;\r\n }\r\n if(!passChar){\r\n clear();\r\n errors.innerHTML+= \"<p>* Password must begin with a character. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n\r\n for(var i=0; i<p1.length; i++){\r\n clear(); \r\n if(charstring.indexOf(p1.substr(i,1))>=0){\r\n passAlpha=true;\r\n }\r\n }\r\n\r\n if(!passAlpha){\r\n errors.innerHTML+= \"<p>* Password must have at least one upper case letter. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n\r\n for(var i=0; i<p1.length; i++){\r\n clear(); \r\n if(numstring.indexOf(p1.substr(i,1))>=0){\r\n passNum=true;\r\n }\r\n }\r\n if(!passNum){\r\n errors.innerHTML+= \"<p>* Password must have at least one number. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n \r\n if(p2!=\"\" && p1!=p2){\r\n clear(); \r\n errors.innerHTML+= \"<p>* Passwords do not match! <p>\";\r\n signup.repass.focus();\r\n return false; \r\n }\r\n\r\n return true; \r\n}", "function sendPassword() {\n AuthService.forgotPassword(vm.user)\n .then(sendPasswordSuccess, sendPasswordError)\n .catch(sendPasswordError);\n // $state.go('app.changePassword');\n }", "function updatefrom(event) {\n let updatePassword = document.getElementById(\"updatePassword\").value;\n let updateConfirmPassword = document.getElementById(\"updateConfirmPassword\").value;\n\n if(updatePassword != updateConfirmPassword) {\n event.preventDefault();\n alert(\"confirm Password and password must be same\");\n return false;\n}\n}", "function generatePassword() {\n\n //Prompt to Enter desired length of password\n var length = Number(prompt(\"How many characters will your password be? Pick between 8 and 128\"));\n\n //Confirms user chose a number between min and max\n if (length < 8 || length > 128) {\n alert(\"Invalid choice. Password must be between 8 and 128\");\n location.reload()\n\n \n } else { // Variables and conditional statements that log User choice and choose the criteria that apply to Generated password.\n var includeUpper = confirm(\"Would you like to include uppercase letters?\");\n var includeLower = confirm(\"Would you like to include lower case letters?\");\n var includeNumber = confirm(\"Would you like to include Numerical characters?\");\n var includeSpecial = confirm(\"Would you like to include special characters?\");\n var upper = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n var lower = \"abcdefghijklmnopqrstuvwxyz\";\n var number = \"0123456789\";\n var special = \"!#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\";\n var charChoice = \"\";\n }\n // If User chose to include at least one or all of the criteria.\n\n if (includeUpper) {\n charChoice += upper;\n }\n if (includeLower) {\n charChoice += lower;\n }\n if (includeNumber) {\n charChoice += number;\n }\n if (includeSpecial) {\n charChoice += special;\n }\n\n // If user Chose No to all Criteria They must start over and Choose yes to at least one.\n if (charChoice == \"\") {\n alert(\"Password must include at least one character option. Press OK to refresh the page and start over.\")\n location.reload();\n }\n\n do {\n // Variable and statements that will Generate New Password based on User Criteria Choice.\n var newPassword = \"\";\n for (var i = 0; i < length; i++) {\n //picks random characters within the selected criteria category based on LENGTH set by user\n newPassword += charChoice.charAt(Math.floor(Math.random() * charChoice.length));\n }\n console.log(newPassword)\n var hasLower = false;\n var hasUpper = false;\n var hasNumber = false;\n var hasSpecial = false;\n\n for (var i = 0; i < newPassword.length; i++) {\n var char = newPassword[i];\n\n if (lower.includes(char)) {\n hasLower = true;\n } else if (upper.includes(char)) {\n hasUpper = true;\n } else if (number.includes(char)) {\n hasNumber = true;\n } else if (special.includes(char)) {\n hasSpecial = true;\n }\n }\n } while (\n (includeLower && !hasLower) ||\n (includeUpper && !hasUpper) ||\n (includeNumber && !hasNumber) ||\n (includeSpecial && !hasSpecial)\n )\n\n // return newPassword;\n return newPassword;\n}", "function comparePassword() {\n\t\tvar newPassword = $(\"#txtNewPassword\").val();\n\t\tvar newPasswordConfirm = $(\"#txtNewPasswordConfirm\").val();\n\t\t// compare\n\t\tif (newPassword == newPasswordConfirm) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function generatePassword() {\n //debugger;\n // Prompt for password legnth\n //debugger;\n passLength = window.prompt(\n \"How long would you like your password? (Please Pick a number between 8 and 128)\"\n );\n\n var lengthOf = parseInt(passLength);\n\n if (Number.isNaN(passLength)) {\n alert(\"Password length must be a number\");\n return null;\n }\n\n if (lengthOf < 8 || lengthOf > 128) {\n alert(\"Password must be greater than 8 but less than 128\");\n return null;\n }\n\n var numbers = window.confirm(\n \"Click OK if you want to include numberical values?\"\n );\n\n var upCase = window.confirm(\n \"Click OK if you want to include uppercase letters?\"\n );\n\n var lowCase = window.confirm(\n \"Click OK if you want to include lowercase letters?\"\n );\n\n var special = window.confirm(\n \"Click OK if you want to include special characters?\"\n );\n\n if (\n numbers == false &&\n upCase == false &&\n lowCase == false &&\n special == false\n ) {\n alert(\"You must select at least one criteria.\");\n return null;\n }\n\n var userSelections = {\n numbers: numbers,\n lowCase: lowCase,\n upCase: upCase,\n special: special,\n lengthOf: lengthOf,\n };\n return combinesSelection(userSelections);\n}", "function generatePassword(){\n var charaValue = prompt(\"How many letters would you like?\");\n if (charaValue < 8){\n alert(\"Your password is too short. Please create a password between 8 and 128 characters\");\n \n } else if (charaValue > 128) {\n alert(\"Your password is too long. Please create a password between 8 and 128 characters\");\n } else {\n alert(\"Your password will be \" + charaValue + \" characters long.\");\n console.log(charaValue);\n }\n var upperCase = prompt(\"Would you like Uppercase letters?\");\n if (upperCase === \"yes\"){\n console.log(upperCase);\n } else {\n alert(\"Your password will not have uppercase letters.\");\n }\n\n var specialChara = confirm(\"Select confirm if you would like special characters in your password\")\n if (specialChara === true){\n alert(\"Your password will include special characters\");\n console.log(specialChara);\n } else {\n alert(\"Your password will not include special characters\")\n }\n\n if (upperCase === \"yes\" && specialChara ===\"true\"){\n\nvar pwdChars = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\nvar pwdLen = 10\nvar randPassword = Array(pwdLen).fill(pwdChars).map(function(x) { return x[Math.floor(Math.random() * x.length)] }).join('');\n \n }\n\n\n}", "function passwordChanged(input, output) {\n\t\tif( input.value.length < 8 ) {\n\t\t\t// Master-password size smaller than minimum allowed size\n\t\t\t// Provide a masked partial confirm-code, to acknowledge the user input\n\t\t\tvar maskedCode='';\n\t\t\tswitch(Math.floor(input.value.length*4/8)) {\n\t\t\t\tcase 1: maskedCode='#'; break;\n\t\t\t\tcase 2: maskedCode='##'; break;\n\t\t\t\tcase 3: maskedCode='###'; break;\n\t\t\t}\n\t\t\toutput.value=maskedCode;\n\t\t} else {\n\t\t\toutput.value = confirmCode(input.value);\n\t\t}\n\t\tvaluesChanged();\n\t}", "function writePassword() {}", "function check_field_password(password, confirm_password) {\n if (password != confirm_password) {\n set_message('error', 'Passwords don\\'t match. Please try again.');\n clear_message();\n return true;\n }\n return false;\n}", "function generatePassword() {\n var pw = mainForm.master.value,\n sh = mainForm.siteHost.value;\n\n // Don't show error message until needed\n hide(mainForm.pwIncorrect);\n\n // Only generate if a master password has been entered\n if (pw !== '') {\n if (settings.rememberPassword) {\n verifyPassword(pw, correct => {\n if (!correct) {\n // Master password is incorrect so show a warning\n show(mainForm.pwIncorrect);\n mainForm.master.select();\n }\n });\n }\n\n // Only generate if a site has been entered\n if (sh !== '') {\n mainForm.pwResult.value = '';\n mainForm.pwResult.placeholder = 'Generating...';\n\n // Generate a password to use, regardless of correct password\n uniquify(pw, sh, unique => {\n mainForm.pwResult.value = unique;\n mainForm.pwResult.placeholder = '';\n mainForm.pwResult.select();\n }, settings);\n }\n }\n }", "function checkPasswordMatch() {\n\t\tvar password = $(\"#txtNewPassword\").val();\n\t\tvar confirmPassword = $(\"#txtConfirmPassword\").val();\n\n\t\tif (password != confirmPassword) {\n\t\t\t$(\"#txtConfirmPassword\").removeClass(\"border-success\");\n\t\t\t$(\"#txtConfirmPassword\").addClass(\"border-danger\");\n\t\t\t$(\"#divCheckPasswordMatch\").html(\"<i><small class='text-danger'>Password Harus Sama</small></i>\");\n\t\t\t$('#tbhUser').prop('disabled', true);\n\t\t} else {\n\t\t\t$(\"#txtConfirmPassword\").removeClass(\"border-danger\");\n\t\t\t$(\"#txtConfirmPassword\").addClass(\"border-success\");\n\t\t\t$(\"#divCheckPasswordMatch\").html(\"<i><small class='text-success'>Password Cocok</small></i>\");\n\t\t\t$('#tbhUser').prop('disabled', false);\n\t\t}\n\t}", "async function doneTyping() {\n let pwdErrorMsg = document.getElementById(\"pwdError\");\n\n let oldPassword = $('#oldPassword').val();\n let newpw = $('#newPassword').val();\n let cfmpw = $('#cfmNewPassword').val();\n let requestParameters = \"user_id=\" + userID + \"&password=\" + oldPassword + \"&checkOnly=1\";\n let response = await makeRequestxwwwFormURLEncode(hostname + \"/users/update/password\", \"POST\", requestParameters);\n\n response = JSON.parse(response)['response'];\n console.log(response)\n if(response == \"Valid Password\"){\n pwdErrorMsg.innerText = \"\";\n isOldPasswordValid = true;\n\n // If both fields are empty means user only entered oldpassword so far so no need to CheckPwd()\n if(newpw == \"\" && cfmpw == \"\"){\n document.getElementById(\"resetPassword\").disabled = true;\n return;\n }\n //Check if both passwords match again\n CheckPwd();\n if(isOldPasswordValid && isBothPasswordsSame){\n document.getElementById(\"resetPassword\").disabled = false;\n // checkForOldNewPasswordSame();\n \n }\n return;\n }\n\n pwdErrorMsg.style.color = \"red\";\n pwdErrorMsg.innerText = \"\";\n document.getElementById(\"resetSucess\").innerText = \"\";\n pwdErrorMsg.innerText = response;\n document.getElementById(\"resetPassword\").disabled = true;\n isOldPasswordValid = false;\n \n}", "function generatePassword() {\n\n //user input prompt to get password length. The parseInt changes the prompt into a integer to be stored as var length\n let length = parseInt(\n prompt(`Enter a number from 8 to 128 for password length`)\n );\n\n // Conditional statement to check if password length is a number. If not function stops\n if (!length) {\n alert('Password length must be a number, Please restart');\n return;\n } \n\n // Conditional statement to check if password length is at least 8 characters long or no longer than 128 characters. If not function restarts\n if (length < 8 || length > 128) {\n alert('Password length must be 8 to 128 characters');\n return;\n }\n\n // String for Keys that are chosen after confirm, above function to be called on\n let passwordKeys = \"\" \n\n //if statement stating that if the lowercase boolean is true from the confirm window, that to add lowercase letters to the passwordKeys string from the key_strings. Otherwise confirm is skipped and not added to passwordKeys\n let lowercase = window.confirm(\"Would you like to use lowercase letters?\");\n if (lowercase) {\n passwordKeys += key_strings.lowercase;\n } \n\n //if statement stating that if the uppercase boolean is true from the confirm window, that to add uppercase letters to the passwordKeys string from the key_strings. Otherwise confirm is skipped and not added to passwordKeys\n let uppercase = window.confirm(\"Would you like to use uppercase letters?\");\n if (uppercase) {\n passwordKeys += key_strings.uppercase;\n } \n\n //if statement stating that if the symbols boolean is true from the confirm window, that to add symbols to the passwordKeys string from the key_strings. Otherwise confirm is skipped and not added to passwordKeys\n let symbols = window.confirm(\"Would you like to use symbols?\");\n if (symbols) {\n passwordKeys += key_strings.symbol;\n } \n\n //if statement stating that if the numbers boolean is true from the confirm window, that to add numbers to the passwordKeys string from the key_strings. Otherwise confirm is skipped and not added to passwordKeys\n let numbers = window.confirm(\"Would you like to use numbers?\");\n if (numbers) {\n passwordKeys += key_strings.number;\n } \n\n //To ensure function works and puts out string of all options\n //console.log(passwordKeys);\n \n // New variable to store a condensed version of passwordKeys based on the length variable set early in the code\n let passwordText = \"\" \n\n // log to show code for getting a single item from the passwordKeys string. \n //console.log( passwordText += passwordKeys[Math.floor(Math.random() * passwordKeys.length)] \n\n //for loop to fill the length requirement with passwordKeys until its filled, when finished it returns the full value of passwordText to be displayed for value\n for (let i = 0; i < length; i++) {\n passwordText += passwordKeys[Math.floor(Math.random() * passwordKeys.length)]\n }\n \n //Calling to new var to be the outcome of function\n return passwordText;\n\n}", "function passwordOptions(){\n // parseInt-look up and wrap prompt\n var pswdLength = prompt(\"How many characters would you like your password to be?\");\n if (isNaN(pswdLength)=== true) {\n alert(\"Length must be 8-128 characters. Please verify how long you would like your password to be.\")\n return\n }\n if (pswdLength < 8) {\n alert(\"Length must be greater than 8.\")\n return\n } \n\n if (pswdLength > 128) {\n alert(\"Length must be less than 8. \")\n return;\n } \n \n var hasRandomUpper = confirm(\"Click 'OK' if your password will include uppercase letters?\");\n var hasRandomLower = confirm(\"Click 'OK' if your password will include lowercase letters?\");\n var hasRandomNumber = confirm(\"Click 'OK' if your password will include numbers?\");\n var hasRandomSymbol = confirm(\"Click 'OK' if your password will include symbols?\");\n\n//if no parameters are selected, alert and run through prompts again.\n if (!hasRandomUpper && !hasRandomLower && !hasRandomNumber && !hasRandomSymbol) {\n alert(\"You must select at least one character type!\")\n hasRandomUpper = confirm(\"Click 'OK' if your password will include uppercase letters?\");\n hasRandomLower = confirm(\"Click 'OK' if your password will include lowercase letters?\");\n hasRandomNumber = confirm(\"Click 'OK' if your password will include numbers?\");\n hasRandomSymbol = confirm(\"Click 'OK' if your password will include symbols?\");\n }\n let passwordParameters = {\n pswdLength: pswdLength,\n hasRandomUpper: hasRandomUpper,\n hasRandomLower: hasRandomLower,\n hasRandomNumber: hasRandomNumber,\n hasRandomSymbol: hasRandomSymbol\n }\n return passwordParameters;\n}", "function checkPasswords() {\n\n var field_new_pass = document.getElementById('new_password').value;\n var field_conf_new_pass = document.getElementById('conf_new_password').value;\n\n if(field_new_pass != field_conf_new_pass) {\n window.alert('Confirmation of password was failed');\n return false;\n }\n else if(field_new_pass != ''){\n window.alert('Success');\n }\n}", "function generatePassword(\n selectLowerCase,\n selectUpperCase,\n selectNumber,\n selectSpecial\n) {\n plength = parseInt(\n prompt(\"Enter the length of your password it must be 8 to 128 characters\")\n );\n password = \"\";\n\n if (!plength) {\n alert(\"This needs a value\");\n } else if (plength < 8 || plength > 128) {\n plength = parseInt(\n prompt(\n \"Enter length of password.* Length must be between 8 - 128 characters\",\n \"\"\n )\n );\n } else {\n // Confirm whether user wants to use lower case letters\n\n selectLowerCase = confirm(\"Would you like to use lower case letters?\");\n\n // Confirm whether user wants to use upper case letters\n\n selectUpperCase = confirm(\"Would you like to use upper case letters?\");\n\n //Confirm whether user wants to use numeric characters\n\n selectNumber = confirm(\"Would you like to use numbers?\");\n\n //Confirm whether user wants to use special symbols\n\n selectSpecial = confirm(\"Would you like to user special characters?\");\n }\n\n for (let i = 0; i < plength; i++) {\n password += passwordText.charAt(\n Math.floor(Math.random() * passwordText.length)\n );\n\n if (selectLowerCase && password.length < plength) {\n password = passwordText += lowerCase.charAt(\n Math.floor(Math.random() * lowerCase.length)\n );\n }\n if (selectUpperCase && password.length < plength) {\n password = passwordText += upperCase.charAt(\n Math.floor(Math.random() * upperCase.length)\n );\n }\n\n if (selectNumber && password.length < plength) {\n password = passwordText += numbers.charAt(\n Math.floor(Math.random() * numbers.length)\n );\n }\n\n if (selectSpecial && password.length < plength) {\n password = passwordText += specialCharacters.charAt(\n Math.floor(Math.random() * specialCharacters.length)\n );\n }\n\n // returns input to text area\n passwordText.value = password;\n }\n}", "function beginPassword(event) {\n \n // prompt for length of password\n var promptPasswordLength = prompt('How many characters do you want in your password?', 'Please enter a number between 8 and 128.');\n \n // if the pasword length is acceptable, then prompt for characters to be used\n if (promptPasswordLength >= 8 && promptPasswordLength <= 128) {\n \n // prompt to use lowercase characters\n var promptLowercase = prompt(\"Would you like to include lowercase letters in the password? Enter 'yes' or 'no' to choose.\");\n \n // if the user selected lowercase, then add lowercase to the char list (charUsed)\n if(promptLowercase === 'yes') {\n charUsed += lowercase;\n charTypeCount += 1;\n \n for(var i=0; i < 1; i++ )\n { \n // pick a lowercase character by random index\n startPassword = startPassword + lowercase[(Math.floor(Math.random() * lowercase.length))];\n }\n }\n \n // prompt to use uppercase characters \n var promptUppercase = prompt(\"Would you like to use UPPERCASE letters in the password? Enter 'yes' or 'no' to choose.\");\n \n // if the user selected uppercase, then add uppercase to the char list (charUsed)\n if(promptUppercase === 'yes') {\n charUsed += uppercase;\n charTypeCount += 1;\n\n for(var i=0; i < 1; i++ )\n { \n // pick an uppercase character by random index\n startPassword = startPassword + uppercase[(Math.floor(Math.random() * uppercase.length))];\n }\n }\n \n // prompt to use number characters\n var promptNumber = prompt(\"Would you like to use numbers in the password? Enter 'yes' or 'no' to choose.\");\n \n // if the user selected number, then add number to the char list (charUsed)\n if(promptNumber === 'yes') {\n charUsed += number;\n charTypeCount += 1;\n\n for(var i=0; i < 1; i++ )\n { \n // pick a number character by random index\n startPassword = startPassword + number[(Math.floor(Math.random() * number.length))];\n }\n }\n \n \n // prompt to use special characters\n var promptSpecialChar = prompt(\"Would you like to use special characters in the password? Enter 'yes' or 'no' to choose.\");\n \n // if the user selected special character, then add special char to the char list (charUsed)\n if(promptSpecialChar === 'yes') {\n charUsed += specialChar;\n charTypeCount += 1;\n\n for(var i=0; i < 1; i++ )\n { \n // pick a special character by random index\n startPassword = startPassword + specialChar[(Math.floor(Math.random() * specialChar.length))];\n }\n } \n } else {\n window.alert('Total characters must be between 8 and 128. Please try again!');\n return;\n }\n \n if (promptUppercase !== 'yes' && promptLowercase !== 'yes' && promptNumber !== 'yes' && promptSpecialChar !== 'yes') {\n window.alert('At least one character type must be chosen. Please try again!');\n \n return;\n \n } else {\n \n // inititate generatePassword() and pass the needed information\n generatePassword(promptPasswordLength, startPassword, charUsed, charTypeCount, password);\n }\n \n}", "function isValidPassword(password) {\n\n\n}", "static tester(session,id ,context,mensaje,callback){\n\n if(context[\"Asms\"] == \"si\"){\n \t// enviarSMS(context,session);\n \tcontext[\"Asms\"]=\"no\";\n context[\"smsCodigo\"]=\"An20\";\n return callback(mensaje,context);\n }\n\n\n if(context[\"Action-Fullfillment\"]==\"si\"){\n context[\"Action-Fullfillment\"]=\"no\";\n setTimeout(function(){\n \t changePassword(context,session);\n },1000)\n \n return callback(mensaje,context);\n }\n\n return callback(mensaje,context);\n\n}", "function first()\n{\n // prompt the user to enter password size\n\n var length=prompt(\"Hoe liong do you want your password ?\");\n if(length>128 || length<8){\n alert(\"Choose a number bewtwwn 8 and 125\");\n return;\n }\n else{\n alert(\"Lets proceed on!!!!!!!!!!!\")\n }\n //These arr the options provided to the users\n let includesymbols= confirm(\"Do you wants to have symbols in your password?\");\n let includeupperCase= confirm(\"Do you wants to have uppercase in your password?\");\n let includelowerCase= confirm(\"Do you wants to have lowercase in your password?\");\n let includenumbers= confirm(\"Do you wants to have numbers in your password?\");\n if (!includesymbols && !includenumbers && !includelowerCase && !includeupperCase)\n {\n alert(\"Choose atleast one of the options\");\n return;\n \n \n }\n else{\n alert(\"Generating password for\")\n }\n \nlet allvalue={\n length: length,\n lowerCase:includelowerCase,\n upperCase: includeupperCase,\n numeric:includenumbers,\n specialcharacters: includesymbols\n}\nreturn allvalue;\n}", "function generatePassword() {\n var length = parseInt(prompt(\"How many characters would you like your password to have\"));\n if (Number.isNaN(length)) {\n alert(\"Password must be provided as a number\");\n return null\n }\n if (length < 8) {\n alert(\"Password must be 8 characters or greater!\");\n return null\n }\n\n if (length > 128) {\n alert(\"Password must be less than 128 characters!\");\n return null\n }\n // confirming options for password characters\n var confirmspecialCharacters = confirm(\"Click okay to include special characters\");\n var confirmlowercaseCharacters = confirm(\"Click okay to include lowercase\");\n var confirmuppercaseCharacters = confirm(\"Click okay to include uppercase\");\n var confirmnumberCharacters = confirm(\"Click okay to include number\");\n \n if (confirmspecialCharacters === false && confirmlowercaseCharacters === false && confirmuppercaseCharacters === false && confirmnumberCharacters === false) {\n alert(\"You didn't click okay, you must select at least one character type.\");\n \n }\n var passwordOption = {\n length: length, \n confirmuppercaseCharacters: confirmuppercaseCharacters, \n confirmlowercaseCharacters: confirmlowercaseCharacters, \n confirmnumberCharacters: confirmnumberCharacters,\n confirmspecialCharacters: confirmspecialCharacters,\n } \n // generate pw \n var newPassword = \"\";\n var passwordArray = [];\n \n if (confirmuppercaseCharacters) {\n passwordArray = [...passwordArray, ...upperCases];\n }\n \n if (confirmlowercaseCharacters) {\n passwordArray = [...passwordArray, ...lowerCases]\n }\n \n if (confirmnumberCharacters) {\n passwordArray = [...passwordArray, ...numbers]\n }\n\n if (confirmspecialCharacters) {\n passwordArray = [...passwordArray, ...specials]\n }\n \n for (var i = 0; i < length; i++){\n var random = Math.floor(Math.random()*passwordArray.length)\n \n var letters = passwordArray[random]\n newPassword = newPassword + letters;\n \n }\n return newPassword\n}", "function pw(passwort, passwortConfirm) {\n // -1 is defaul\n if (!passwort.value || !passwortConfirm.value) {\n return -1;\n } else {\n if (passwort.value == passwortConfirm.value) {\n removeErrorAndOK(passwort);\n removeErrorAndOK(passwortConfirm);\n showErrorOrOK(passwort, \" \", true);\n showErrorOrOK(passwortConfirm, \" \", true);\n return true;\n } else {\n showErrorOrOK(passwort, \" passwort not Confirm\", false);\n showErrorOrOK(passwortConfirm, \" passwort not Confirm\", false);\n return false;\n }\n }\n }", "function handleRecoverPassword(){\n if(emailValid()){\n console.log(`send me my password to: ${email}`)\n setEmail('')\n }else{\n console.log('invalid')\n }\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n//Runs through user input prompts\n function generatePassword(){\n var charaValue = prompt(\"How many letters would you like?\");\n if (charaValue < 8){\n alert(\"Your password is too short. Please create a password between 8 and 128 characters\");\n \n } else if (charaValue > 128) {\n alert(\"Your password is too long. Please create a password between 8 and 128 characters\");\n } else {\n alert(\"Your password will be \" + charaValue + \" characters long.\");\n console.log(charaValue);\n }\n var upperCase = prompt(\"Would you like Uppercase letters?\");\n if (upperCase === \"yes\"){\n console.log(upperCase);\n } else {\n alert(\"Your password will not have uppercase letters.\");\n }\n\n var specialChara = confirm(\"Select confirm if you would like special characters in your password\")\n if (specialChara === true){\n alert(\"Your password will include special characters\");\n console.log(specialChara);\n } else {\n alert(\"Your password will not include special characters\")\n }\n\n if (upperCase === \"yes\" && specialChara ===\"true\"){\n\nvar pwdChars = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\nvar pwdLen = 10\nvar randPassword = Array(pwdLen).fill(pwdChars).map(function(x) { return x[Math.floor(Math.random() * x.length)] }).join('');\n \n }\n\n\n} \n \n\n\n \n \n}", "function generatePassword(){\n var length = window.prompt(\"Choose a password length of at least 8 characters and no more than 128 characters.\");\n\n if (length == null) {\n return randomPassword = \"Your Secure Password\";\n\n } else if (length >= 8 && length <= 128) {\n // run next step\n upperMessage;\n\n } else {\n window.alert(\"Please input a number between 8 and 128.\")\n return randomPassword = \"Your Secure Password\";\n }\n\n var upperMessage = window.confirm(\"Would you like to use uppercase letters? If no, select cancel.\");\n var lowerMessage = window.confirm(\"Would you like to use lowercase letters? If no, select cancel.\");\n var numberMessage = window.confirm(\"Would you like to use numbers? If no, select cancel.\");\n var symbolMessage = window.confirm(\"Would you like to use special characters? If no, select cancel.\");\n\n //selection criteria for password variable conditions \n\n if (!upperMessage && !lowerMessage && !numberMessage && !symbolMessage) {\n window.alert(\"You must select at least one of the options.\")\n return randomPassword = \"Your Secure Password\";\n }\n\n var randomPassword = [];\n\n if (upperMessage && lowerMessage && numberMessage && symbolMessage) {\n randomPassword = randomPassword.concat(upper).concat(lower).concat(number).concat(symbol);\n\n } else if (upperMessage && !lowerMessage && !numberMessage && !symbolMessage) {\n randomPassword = randomPassword.concat(upper);\n \n } else if (upperMessage && lowerMessage && !numberMessage && !symbolMessage) {\n randomPassword = randomPassword.concat(upper).concat(lower);\n \n } else if (upperMessage && lowerMessage && !numberMessage && symbolMessage) {\n randomPassword = randomPassword.concat(upper).concat(lower).concat(symbol);\n \n } else if (upperMessage && !lowerMessage && numberMessage && !symbolMessage) {\n randomPassword = randomPassword.concat(upper).concat(number);\n\n } else if (upperMessage && !lowerMessage && !numberMessage && symbolMessage) {\n randomPassword = randomPassword.concat(upper).concat(symbol);\n\n } else if (!upperMessage && lowerMessage && !numberMessage && !symbolMessage) {\n randomPassword = randomPassword.concat(lower); \n \n } else if (!upperMessage && lowerMessage && numberMessage && !symbolMessage) {\n randomPassword = randomPassword.concat(lower).concat(number);\n \n } else if (!upperMessage && lowerMessage && !numberMessage && symbolMessage) {\n randomPassword = randomPassword.concat(lower).concat(symbol);\n\n } else if (!upperMessage && !lowerMessage && numberMessage && !symbolMessage) {\n randomPassword = randomPassword.concat(number);\n\n } else if (!upperMessage && !lowerMessage && numberMessage && symbolMessage) {\n randomPassword = randomPassword.concat(number).concat(symbol);\n\n } else if (!upperMessage && !lowerMessage && !numberMessage && symbolMessage) {\n randomPassword = randomPassword.concat(symbol);\n \n } \n\n /* for loop to randomly select password based on concating variables into the\n randomPassword array and then creates a random password in the securePassword variable.*/ \n\n var securePassword = \" \";\n\n for (i=0; i < length; i++) {\n securePassword = securePassword + randomPassword [Math.floor(Math.random() * randomPassword.length)];\n }\n\n // retuen secure password so variable password can display the output on the screen.\n return securePassword;\n}", "function failedPasswordConfirmation(){\n req.flash('error', \"Incorrect current password.\");\n return res.redirect(\"/account\");\n }", "function changePw () {\n var userid = $('#pwUserid').val();\n var currpw = $('#pwPassword').val();\n var newpw = $('#pwNew').val();\n var pw2 = $('#pwNew2').val();\n\n if ( newpw != pw2 ) {\n alert(\"The proposed password is not equal to the retyped password, returning.\");\n return;\n }\n\n alert('Calling changeMyPW.php');\n}", "function generatePassword() {\n var generate = \"\";\n var password = \"\";\n\n var length = prompt(\"How long would you like your password to be?\");\n\n//assigning numerical value to length variable \n length = parseInt(length);\n\n// Setting length range - confirm pop-ups for each character \n if (length >= 8 && length <= 128) {\n var confirmLower = confirm(\"Do you want lowercase letters in your password?\");\n var confirmUpper = confirm(\"Do you want uppercase letters in your password?\");\n var confirmNum = confirm(\"Do you want numbers in your password?\");\n var confirmSym = confirm(\"Do you want special characters in your password?\");\n } \n // setting pop up for incorrect length \n else {\n var resume = confirm(\"You must choose a numerical value between 8 and 128! \\n Cancel to exit.\")\n if (resume) {\n return generatePassword();\n }\n return ''\n }\n\n // setting pop up for no characters selected\n if (!confirmLower && !confirmUpper && !confirmNum && !confirmSym) {\n var resume = confirm(\"Must pick at least one character option! \\n Cancel to exit.\")\n if (resume) {\n return generatePassword();\n }\n return ''\n }\n\n// setting characters chosen to their matching variables\n if (confirmLower === true) {\n generate += lower\n password += returnChar(lower)\n };\n if (confirmUpper === true) {\n generate += upper\n password += returnChar(upper)\n };\n if (confirmNum === true) {\n generate += num\n password += returnChar(num)\n };\n if (confirmSym === true) {\n generate += sym\n password += returnChar(sym)\n };\n\n//for loop to generate password\n for (var i = password.length; i < length; i++) {\n password += returnChar(generate);\n password = shuffle(password);\n }\n return password;\n}", "function writePassword() {\n // var password = generatePassword();\n var password = document.querySelector(\"#password\");\n\n enter = prompt(\"How many characters would you like your password? Choose between 8 and 128\");\n \n if (!enter) {\n alert(\"This needs a value\");\n rewind = writePassword();\n } \n else if (enter < 8 || enter > 128) {\n enter = prompt(\"You must choose between 8 and 128\");\n rewind = writePassword();\n } \n else {\n confirmNumber = confirm(\"Will this contain numbers?\");\n confirmUppercase = confirm(\"Will this contain Uppercase letters?\");\n confirmLowercase = confirm(\"Will this contain Lowercase letters?\");\n confirmSymbol = confirm(\"Will this contain special characters?\");\n };\n\n console.log(confirmNumber);\n console.log(confirmUppercase);\n console.log(confirmLowercase);\n console.log(confirmSymbol);\n console.log(enter);\n console.log(writePassword);\n \n function getRandomNumber(){\n return String.fromCharCode[Math.floor(Math.random()*10)];\n }\n function getRandomUpperCase(){\n return String.fromCharCode(Math.floor(Math.random()*26));\n }\n function getRandomLowerCase(){\n return String.fromCharCode(Math.floor(Math.random()*26));\n }\n function getRandomSymbol(){\n var symbol = \"!@#$%^&*(){}[]=<>/,.|~?\";\n return symbol[Math.floor(Math.random()*symbol.length)];\n }\n\n if (!confirmSymbol && !confirmNumber && !confirmUppercase && !confirmLowercase) {\n choices = alert(\"You must choose a criteria!\");\n rewind = writePassword();\n };\n \n var choices;\n\n if (confirmNumber){\n choices = character.concat(getRandomNumber.value);\n };\n if (confirmUppercase){\n choices = character.concat(getRandomUpperCase.value);\n };\n if (confirmLowercase){\n choices = character.concat(getRandomNumber.value);\n };\n if (confirmSymbol){\n choices = character.concat(getRandomSymbol.value);\n };\n if (confirmNumber && confirmUppercase){\n choices = character.concat(getRandomNumber.value, getRandomUpperCase.value);\n };\n if (confirmNumber && confirmLowercase){\n choices = character.concat(getRandomNumber.value, getRandomLowerCase.value);\n };\n if (confirmNumber && confirmSymbol){\n choices = character.concat(getRandomNumber.value, getRandomSymbol.value);\n };\n if (confirmUppercase && confirmLowercase){\n choices = character.concat(getRandomUpperCase.value, getRandomLowerCase.value);\n };\n if (confirmUppercase && confirmSymbol){\n choices = character.concat(getRandomUpperCase.value, getRandomSymbol.value);\n };\n if (confirmLowercase && confirmSymbol){\n choices = character.concat(getRandomNumber.value, getRandomSymbol.value);\n };\n if (confirmNumber && confirmUppercase && confirmLowercase){\n choices = character.concat(getRandomNumber.value, getRandomUpperCase.value, getRandomLowerCase.value);\n };\n if (confirmNumber && confirmUppercase && confirmSymbol){\n choices = character.concat(getRandomNumber.value, getRandomUpperCase.value, getRandomSymbol.value);\n };\n if (confirmNumber && confirmLowercase && confirmSymbol){\n choices = character.concat(getRandomNumber.value, getRandomLowerCase.value, getRandomSymbol.value);\n };\n if (confirmUppercase && confirmLowercase && confirmSymbol){\n choices = character.concat(getRandomUpperCase.value, getRandomLowerCase.value, getRandomSymbol.value);\n };\n if (confirmNumber && confirmUppercase && confirmLowercase && confirmSymbol){\n choices = character.concat(getRandomNumber.value, getRandomUpperCase.value, getRandomLowerCase.value, getRandomSymbol.value);\n };\n \n for (var i = 0; i < enter; i++) {\n var pickChoices = choices[Math.floor(Math.random() * choices.length)];\n password.push(pickChoices);\n }\n // passwordText.value = password;\n\n // const randomFunc = {\n // number : getRandomNumber,\n // upper : getRandomUpperCase,\n // lower : getRandomLowerCase,\n // symbol : getRandomSymbol\n // };\n\n // function generatePassword(upper, lower, number, symbol, length){\n // let generatedPassword = \"\";\n\n // const typesCount = upper + lower + number + symbol;\n\n // // console.log(typesCount);\n\n // const typesArr = [{upper}, {lower}, {number}, {symbol}].filter(item => Object.values(item)[0]);\n\n // if(typesCount === 0) {\n // return '';\n // }\n\n // for(let i=0; i<length; i+=typesCount) {\n // typesArr.forEach(type => {\n // const funcName = Object.keys(type)[0];\n // generatedPassword += randomFunc[funcName]();\n // });\n // }\n\n // const finalPassword = generatedPassword.slice(0, length);\n\n\n // return finalPassword;\n // }\n}", "function passwordgen() {\n console.log(\"Running full password gen\");\n\n alert(\"Time to choose a password\");\n\n //setting character length\n var charlength = prompt(\"How many characters do you want the password to be (select number only between 8 and 128)\");\n \n if(charlength >7 && charlength< 129) {\n var charlength = Math.floor(charlength);\n alert(\"Your password will be \" + charlength + \" characters long\");\n }\n else {\n alert(\"You have input incorrectly- try again\");\n return;\n }\n /* user has the ability to choose whether or not they would like to choose a word/ phrase within code\n allows for phrase up to less then 4 letters less than the password length */\n\n var confirmphrase = confirm(\"Would you like to use a pre-defined phrase, word or number pattern within your password?\");\n if (confirmphrase) {\n var phraselength = charlength-4\n alert (\"Phrase must contain no more than \" + phraselength + \" characters . Spaces will be replaced with dashes and '<'s will be replaced with '('s!!!\");\n var passwordphrase = prompt(\"Type phrase here\");\n if (passwordphrase.length > charlength - 4) {\n alert (\"Phrase is too long, try again\");\n var passwordphrase = \"\";\n return;\n }\n else {\n alert(\"Your Password phrase is ---> ' \" + passwordphrase + \" ' <--- Blank spaces and '<'s will be replaced.\");\n \n /* // (User can select where the phrase appears- this will alter the phraseposition value which\n affects the placement at the end of the function */\n\n alert(\"Now you can choose if you want the phrase at the beginning, end or at a random part of your password\");\n var beginning = confirm(\"Do you want the phrase at the BEGINNING of your password?\");\n var phraseposition=0;\n if (beginning == false) {\n var ending = confirm(\"Do you want the phrase at the END of your password?\");\n }\n if (ending == false) {\n alert(\"Password will be placed randomly\")\n var phraseposition = Math.floor(Math.random()*(charlength-passwordphrase.length));\n }\n else if (ending == true) {\n var phraseposition= charlength-passwordphrase.length;\n }\n }\n }\n else {\n var passwordphrase = \"\";\n alert (\"No worries\");\n // (\"Passwordphrase: \" + passwordphrase);\n }\n //user can now select what other characters appear\n var confirmnumber= confirm(\"Do you want numbers in your password?\");\n var confirmletters= confirm(\"Do you want Capital Letters in your password?\");\n var confirmsymbols= confirm (\"Do you want Special Characters in your password?\");\n \n \n\n\n alert(\"Initialising new password!\");\n\n //criteria value set at 0 unless all above paramters set\n var criteria = 0;\n\n //start password loop\n for (var ix = 0; criteria < 1; ix++) {\n \n var lettercount = 1;\n var numbercount = 1;\n var symbolcount = 1;\n var lowercasecount= 0;\n \n\n\n\n //variables below show all symbols used for password as well as the password itself\n var passwordcomplete = \"\";\n var letters=[\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\"];\n // (letters[(Math.floor(Math.random()*24))].charAt(0));\n // (passwordcomplete.charAt(0));\n var numbers= [\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"];\n var symbols= [\"!\",\"@\",\"#\",\"%\",\"&\",\"(\",\"$\",\")\",\"{\",\"}\",\"?\",\"/\",\">\",\"]\"]\n var capitals= [\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"]\n\n //generate loop the size of the chosen character length to create a password of lower case letters\n for (var ia = 0; ia < charlength; ia++) {\n passwordcomplete += letters[(Math.floor(Math.random()*letters.length))].charAt(0);\n }\n \n\n \n /* If user selected capital letters we run the below replacement loop. Sets lettercount to 0 for test later.\n Random chance of 50% that a Capital letter will replace an existing character */\n if(confirmletters==true) {\n var lettercount = 0;\n for (var icap = 0; icap < charlength; icap++) {\n var numberstest = Math.floor((Math.random())*6);\n if (numberstest > 2) {\n var passwordcomplete2 = passwordcomplete.replaceAt(icap, capitals[(Math.floor(Math.random()*capitals.length))]);\n var passwordcomplete = passwordcomplete2;\n }\n \n else {\n // (passwordcomplete2);\n }\n }\n }\n\n /* If user selected numbers we run the below replacement loop. Sets numbercount to 0 for test later.\n Random chance of 40% that a number will replace an existing character */\n if (confirmnumber==true) {\n var numbercount = 0;\n for (var ib = 0; ib < charlength; ib++) {\n var numberstest = Math.floor((Math.random())*5);\n // (numberstest);\n if (numberstest > 2) {\n var passwordcomplete2 = passwordcomplete.replaceAt(ib, numbers[(Math.floor(Math.random()*numbers.length))]);\n // (passwordcomplete2);\n var passwordcomplete = passwordcomplete2;\n\n }\n else {\n // (passwordcomplete2);\n }\n }\n }\n\n /* If user selected symbols we run the below replacement loop. Sets symbolcount to 0 for test later.\n Random chance of 40% that a symbol will replace an existing character */\n \n if (confirmsymbols==true) {\n var symbolcount = 0\n for (var ic = 0; ic < charlength; ic++) {\n var numberstest2 = Math.floor((Math.random())*5);\n if (numberstest2 > 2) {\n var passwordcomplete2 = passwordcomplete.replaceAt(ic, symbols[(Math.floor(Math.random()*symbols.length))]);\n var passwordcomplete = passwordcomplete2;\n\n }\n else {\n // (passwordcomplete2);\n }\n }\n }\n \n\n // If password phrase created it sets it at the phraseposition chosen before)\n if(passwordphrase.length > -1) {\n var passwordcomplete2 = (passwordcomplete.replaceAt(phraseposition, passwordphrase));\n var passwordcomplete = passwordcomplete2;\n }\n\n //replace spaces and any < within the password that may have been input in the phrase\n passwordcomplete = passwordcomplete.replace(/\\s/g, \"-\");\n\n for (issy=0; issy < charlength - 4; issy++){\n passwordcomplete = passwordcomplete.replace(\"<\", \"(\");\n }\n\n\n // console.log(\"password \" + passwordcomplete)\n \n //Runs a loop to see how many capital letters appear. Adds 1 to variable if they do.\n for (t1=0; t1 < capitals.length; t1++) {\n var charcode = passwordcomplete.indexOf(capitals[t1]); \n if (charcode > -1){\n lettercount++;\n }\n }\n\n //Runs a loop to see how many numbers appear. Adds 1 to variable if they do.\n for (t2=0; t2 < numbers.length; t2++) {\n var charcode = passwordcomplete.indexOf(numbers[t2]);\n // console.log(charcode) \n if (charcode > -1){\n numbercount++;\n }\n }\n\n //Runs a loop to see how many symbols appear. Adds 1 to variable if they do.\n for (t3=0; t3 < symbols.length; t3++) {\n var charcode = passwordcomplete.indexOf(symbols[t3]); \n if (charcode > -1){\n symbolcount++;\n }\n }\n\n //Runs a loop to see how many symbols appear. Adds 1 to variable if they do.\n for (t4=0; t4 < letters.length; t4++) {\n var charcode = passwordcomplete.indexOf(letters[t4]); \n if (charcode > -1){\n lowercasecount++;\n }\n }\n\n //If all parameters selected AND lowercase letters appear in the password, loop will close, else the loop will rerun\n if (symbolcount > 0 && numbercount > 0 && lettercount > 0 && lowercasecount > 0){\n criteria = 1;\n }\n else {\n criteria = 0;\n }\n console.log(\"Temp Password \" + passwordcomplete);\n var loopcount = ix + 1;\n }\n\n console.log(\"loopcount: \" + loopcount);\n\n \n \n //password output\n alert(\"Password is \" + passwordcomplete);\n console.log(\"Final password \" + passwordcomplete);\n document.getElementById(\"result\").innerHTML = passwordcomplete;\n var xi2 = document.getElementById(\"textdisplay\");\n xi2.style.display = \"block\";\n\n }", "function generatePassword() {\n var passwordLength = prompt(\n \"Please choose how many characters you would like for your password between 8 and 128\"\n );\n\n if (passwordLength >= 8 && passwordLength <= 128) {\n alert(\n \"Thanks. The amount of characters in your password will be\" +\n passwordLength\n );\n } else {\n alert(\"Your number must be between 8 and 128\");\n generatePassword();\n }\n\n // Create prompts for your other password parameters\n // Reminder that for confirm prompts. Ok = True, Cancel = False\n var numbers = confirm(\"Do you want numbers in your password?\");\n\n console.log(numbers);\n\n var lowerCases = confirm(\"Do you want lowercases in your password?\");\n\n console.log(lowerCases);\n\n var upperCases = confirm(\"Do you want uppercases in your password?\");\n console.log(upperCases);\n\n var special = confirm(\"Do you want special characters in your password?\");\n console.log(special);\n}", "function checkPassword(){ \n\n\t\t\t\t\n\t\t\t\t\n var password1 = document.getElementById(\"psw\");\n var password2 = document.getElementById(\"psw-repeat\");\n var e1 = document.getElementById(\"email1\");\n\n var p1=password1.value;\n var p2=password2.value;\n var e2=e1.value;\n if(e2 === '')\n {\n alert(\"enter email.Please try again! \");\n return false;\n }\n \n if(p1 === '')\n {\n alert(\"enter password.Please try again! \");\n return false;\n }\n if(p2 === '')\n {\n alert(\"enter password.Please try again! \");\n return false;\n }\n if(p1.length <8){\n alert(\"value is less than 8\");\n\n }\n if ( p1!=p2) { \n alert (\"\\nPassword did not match: Please try again...\") \n return false; \n } \n var mailformat = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\n if(e1.value.match(mailformat))\n {\n // return true;\n }\n else\n {\n alert(\"You have entered an invalid email address!\");\n return false;\n }\n \n }", "forgotPass() \n {\n \tAlert.alert(\n\t\t 'Go To Site',\n\t\t 'Pressing this button would help you restore your password (external source)',\n\t\t [\n\t\t {text: 'OK', onPress: () => console.log('OK Pressed')},\n\t\t ],\n\t\t {cancelable: false},\n\t\t);\n }", "function generatePassword() {\n alert (\"Select which criteria to include in the password\");\n\n\n var passLength = parseInt(prompt(\"Choose a length of at least 8 characters and no more than 128 characters\"));\n\n //evaluate user input for password length\n while (isNaN(passLength) || passLength < 8 || passLength > 128)\n {\n \n if (passLength === null) {\n return;\n }\n\n passLength = prompt(\"choose a length of at least 8 characters and no more than 128 characters\");\n }\n\n\n var lowerCase = confirm(\"Do you want lowercase characters in your password\");\n var upperCase = confirm(\"Do you want uppercase characters in your password\");\n var numChar = confirm(\"Do you want numbers in your password?\");\n var specChar = confirm(\"Do you want special characters in your password?\");\n\n\n //evalute criteria for password generation\n if (lowerCase || upperCase || numChar || specChar)\n {\n var otherToGen = '';\n var intList = '0123456789';\n var uCharList ='ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n var lCharList ='abcdefghijklmnopqrstuvwxyz'; \n var sCharList =\"!#$%&()*+,-./:;<=>?@[]^_`{|}~\";\n var remainlenght = 0;\n var criteriaMatch = 0;\n var value = '';\n\n if (numChar){\n value += genchar(1, intList);\n criteriaMatch++;\n otherToGen += intList;\n\n }\n\n if (lowerCase){\n value += genchar(1, lCharList);\n criteriaMatch++;\n otherToGen += lCharList;\n }\n\n if (upperCase) {\n value += genchar(1, uCharList);\n criteriaMatch++;\n otherToGen += uCharList;\n }\n\n\n if(specChar) {\n value += genchar(1, sCharList);\n criteriaMatch++;\n otherToGen += sCharList;\n\n }\n\n remainlenght = passLength-criteriaMatch;\n value += genchar(remainlenght, otherToGen);\n\n return value;\n}\n}", "function checkAmountConfirm() {\n var string_length = prompt(\"How many characters would you like your password to have? *Must be more than 8, and less than 128*\");\n if (string_length >= 8 && string_length <= 128) {\n checkUppercase = confirm(\"Would you like uppercase letters in your password? Select 'OK' for YES and 'Cancel' for NO\");\n checkLowercase = confirm(\"Would you like lowercase letters in your password? Select 'OK' for YES and 'Cancel' for NO\");\n checkNumbers = confirm(\"Would you like numbers in your password? Select 'OK' for YES and 'Cancel' for NO\");\n checkSpecial = confirm(\"Would you like special characters in your password? Select 'OK' for YES and 'Cancel' for NO\");\n } else {\n alert(\"Length must be 8-128 characters.\");\n checkAmountConfirm();\n }\n createPassword(string_length);\n}", "function ps_setupPassword(ps_input1, ps_input2, ps_minLength, ps_maxLength, ps_allowSpecial, ps_allowSpace) {\r\n $(ps_input1).password({\r\n\r\n checklist: $('#checklist'), \r\n doubleType: $(ps_input2),\r\n minLength: ps_minLength,\r\n maxLength: ps_maxLength,\r\n allowSpecial: ps_allowSpecial,\r\n allowSpace: ps_allowSpace\r\n });\n\n $(ps_input1).blur(function () {\r\n if ($(this).val() != null && $(this).val().length > 0)\n $('#checklist').show();\n else\n $('#checklist').hide();\r\n }).keypress(function () {\r\n if ($(this).val() != null && $(this).val().length > 0)\n $('#checklist').show();\n else\n $('#checklist').hide();\r\n });\n\n\n //toggle password from hidden to not by changing input type\n $(\".showPW\").each(function (index, input) {\r\n var $input = $(input);\r\n $(this).next(\".btnShowPW\").click(function () {\r\n if ($input.val().length > 0) {\r\n var change = \"\";\r\n if ($(this).html() === \"Show\") {\r\n $(this).html(\"Hide\")\r\n change = \"text\";\r\n } else {\r\n $(this).html(\"Show\");\r\n change = \"password\";\r\n }\r\n var rep = $(\"<input type='\" + change + \"' />\")\r\n .attr(\"id\", $input.attr(\"id\"))\r\n .attr(\"name\", $input.attr(\"name\"))\r\n .attr('class', $input.attr('class'))\r\n .attr('placeholder', $input.attr('placeholder'))\r\n .val($input.val())\r\n .insertBefore($input);\r\n $input.remove();\r\n $input = rep;\r\n\r\n $('#checklist').empty();\r\n if ($input.attr('id') == \"txtPassword\") {\r\n $input.password({\r\n checklist: $('#checklist'),\r\n doubleType: $(ps_input2),\r\n minLength: ps_minLength,\r\n maxLength: ps_maxLength,\r\n allowSpecial: ps_allowSpecial,\r\n allowSpace: ps_allowSpace\r\n });\r\n } else {\r\n $(ps_input1).password({\r\n checklist: $('#checklist'), \r\n doubleType: $(ps_input2),\r\n minLength: ps_minLength,\r\n maxLength: ps_maxLength,\r\n allowSpecial: ps_allowSpecial,\r\n allowSpace: ps_allowSpace\r\n });\r\n }\r\n /**/\r\n }\r\n }).insertAfter($input);\r\n\r\n });\n\n //end of password section\n }", "function writePassword() {\n\n //Prompts for password length\n var pLength = prompt(\"How many characters would you like the password to be? Choose a number between 8 and 128.\", \"50\");\n\n //If the user doesn't input a length the function ends. If the input is the wrong length, the user is re-prompted\n if(pLength === null){\n return;\n } \n while (pLength<8 || pLength>128){\n pLength = prompt(\"Please input a number between 8 and 128.\");\n }\n \n //Prompts for password criteria: Uppercase chars, lowercase chars, numerical chars, and special chars\n var pUpChar = confirm(\"Would you like to include uppercase characters?\");\n var pLoChar = confirm(\"Would you like to include lowercase characters?\");\n var pNuChar = confirm(\"Would you like to include numerical characters?\");\n var pSpChar = confirm(\"Would you like to include special characters?\");\n\n //Password and password text run generatePassword with the criteria and set the textarea with #password to the generated password\n var password = generatePassword(pLength, pUpChar, pLoChar, pNuChar, pSpChar);\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n console.log(checkUC(password));\n console.log(checkLC(password));\n console.log(checkNM(password));\n console.log(checkSP(password));\n}", "function uPassword() {\n\t\tvar u_pass = $('#user_pass').val();\n\t\tvar pass_pattern = /^[a-zA-Z0-9]+$/;\n\t\tvar pass_len = u_pass.length;\n\n\t\tif (u_pass == '') {\n\t\t\t$('#alert_pass').text('this field cannot be empty');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t} else if (pass_len < 8 || pass_len > 15 || !u_pass.match(pass_pattern)) {\n\t\t\t$('#alert_pass').text('please enter password between 8-15 alphanumeric characters');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function checkforgotpassword()\r\n\t{\r\n\t\tif(document.forgot.email.value==\"\")\r\n\t\t{\r\n\t\t\talert(lng_plsenteremailadd);\r\n\t\t\tdocument.forgot.email.focus();\r\n\t\t\tdocument.forgot.email.select();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(!validate_email_forgot(document.forgot.email.value,lng_entervalidemail))\r\n\t\t\t\t{\r\n\t\t\t\t\tdocument.forgot.email.select();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t}\r\n\t}", "function CheckConfirmPWD() {\r\n if (!($scope.VendorDetails.Password == $scope.VendorDetails.ConfirmPassword)) {\r\n $scope.fpwdclass = true;\r\n $scope.innerhtml = \"Password and Confirm Password must be same\";\r\n if (!($scope.VendorDetails.ConfirmPassword.length == 0)) {\r\n document.getElementById('pwd2').focus();\r\n }\r\n\r\n $scope.VendorDetails.ConfirmPassword = \"\";\r\n return false;\r\n }\r\n else {\r\n $scope.innerhtml = \" \";\r\n $scope.fpwdclass = false;\r\n return true;\r\n }\r\n }", "function generatePassword() {\n const passLength = parseInt(prompt('How long should your password be?'))\n\n if (passLength < 8 || passLength > 128) {\n alert('please pick a length between 8 and 128 characters.')\n generatePassword()\n }\n \n const lowC = confirm('do you want lowercase characters?')\n const upC = confirm('do you want uppercase characters?')\n const numC = +confirm('do you want numbers?')\n const specC = confirm('do you want special characters?')\n let passHolder = ''\n newPass = ''\n if (lowC){\n passHolder += lowerChar;\n }\n if (upC) {\n passHolder += upperChar;\n }\n if (numC) {\n passHolder += numberChar;\n }\n if (specC) {\n passHolder += specialChar;\n }\n if (!lowC && !upC && !numC && !specC) {\n alert('you need to choose at least one character set.')\n generatePassword()\n }\n\n for (let i=0; i < passLength; i++) {\n let randomIndex = Math.floor(Math.random() * passHolder.length)\n newPass += passHolder[randomIndex]\n }\n return newPass\n}", "function generatePassword() {\n var actualPassword = \"\";\n \n alert(\"You will be presented with the following prompts to select criteria for generating a password.\");\n\n // choice of password length between 8-128\n var pwdLength = prompt(\"Choose a number between 8 and 128. This choice will be the length of the password.\", );\n if (pwdLength != null) {\n if (pwdLength >= 8 && pwdLength <= 128) {\n\n // choice of Lowercase, Uppercase, Numerals, Special Character\n alert(\"In the following prompts, at least one choice of lowercase, uppercase, numeric, and/or special characters must be confirmed.\");\n\n var chooser = false;\n var charChoices = \"\";\n\n var uCase = confirm(\"Would you like your password to contain uppercase characters?\");\n if (uCase === true) {\n chooser = true;\n charChoices += uChars; \n }\n\n var lCase = confirm(\"Would you like your password to contain lowercase characters?\");\n if (lCase === true) {\n chooser = true;\n charChoices += lChars;\n }\n\n var numChoice = confirm(\"Would you like your password to contain numeric characters?\");\n if (numChoice === true) {\n chooser = true;\n charChoices += nChars;\n }\n\n var specChar = confirm(\"Would you like your password to contain special characters?\");\n if (specChar === true) {\n chooser = true;\n charChoices += sChars;\n }\n\n if (chooser === false) {\n alert(\"At least one choice of lowercase, uppercase, numeric, and/or special characters must be confirmed.\");\n } else {\n\n // actually password generation code\n for (i = 1; i < pwdLength ; i++ ) {\n actualPassword += charChoices[Math.floor(Math.random()*charChoices.length)];\n };\n };\n\n } else {\n alert(\"Please enter a number between 8 and 128\")\n };\n\n };\n\n return actualPassword;\n}", "function writePassword()\n {\n var passwordText = document.querySelector(\"#password\");\n passwordText.value =\"Your Secure Password\";\n // Alerting the User that they will be prompted to provide criteria and to confirm their choices\n alert(\"You will be prompted with several password criteria selections:\");\n var passwordLength = prompt(\"Please provide password length between 8 and 128 characters:\");\n\n var passwordLengthChar = \"\";\n for(var i=0; i<passwordLength.length; i++){\n passwordLengthChar = passwordLength.charAt(i);\n //alert(i+\" passwordLengthChar \"+passwordLengthChar);\n if (passwordLengthChar != \"0\" && passwordLengthChar != \"1\" && passwordLengthChar != \"2\" &&\n passwordLengthChar != \"3\" && passwordLengthChar != \"4\" && passwordLengthChar != \"5\" && passwordLengthChar != \"6\" &&\n passwordLengthChar != \"7\" && passwordLengthChar != \"8\" && passwordLengthChar != \"9\"){\n alert(\"You must enter a numeric value between 8 and 128. Please click on generate password and try again\");\n return;\n }\n }\n \n if (passwordLength < 8 || passwordLength > 128){\n alert(\"The password length must be between 8 and 128. Please click on generate password and try again\");\n return;\n }\n\n var includeLowercase = confirm(\"Do you want to include Lowercase?\");\n var includeUppercase = confirm(\"Do you want to include Uppercase?\");\n var includeNumbers = confirm(\"Do you want to include Numbers?\");\n var includeSpecialChars = confirm(\"Do you want to include Special characters?\");\n \n\n // Check condition - If user doesn't provide any criteria they will be alerted again to select criteria\n if (!includeLowercase && !includeUppercase && !includeNumbers && !includeSpecialChars)\n {\n alert(\"You must select atleast one character type. Please click on generate password and try again.\");\n passwordText.value = \"Your Secure Password\";\n }else\n {\n // Calling Function with above user selected values\n generatePassword(passwordLength,includeLowercase,includeUppercase,includeNumbers,includeSpecialChars);\n passwordText.value = finalresult; \n }\n}", "function myPassword(password, confirm) {\n this.mypassword = password;\n this.confirmpassword = confirm;\n}", "function verifyServerOTP() {\n var authnData = {\n \"authId\": AUTH_ID,\n \"otp\": document.getElementById('otp').value,\n \"hint\": \"VALIDATE_SERVER_OTP\", //dont change this value.\n \"trustDevice\": \"0\"\n };\n var trustDeviceCheckbox = document.getElementById(\"trustDevice\");\n\t if (trustDeviceCheckbox.checked === true) {\n\t\t authnData.trustDevice = \"1\";\n\t }\n authenticate(authnData);\n}", "function generatePassword () {\n var pass = prompt(\"Enter the number of characters for desired password length between 8 and 128.\")\n\n if (pass < 8 || pass > 128) {\n alert(\"That is an invalid number. Try again!\")\n return generatePassword ();\n }\n if (isNaN(pass)) {\n alert(\"You can only choose a number. Try again!\")\n return generatePassword();\n }\n\n if (pass => 8 && pass <= 128) {\n low = confirm(\"Do you want lower case letters within your password?\")\n cap = confirm(\"Do you want capitalized letters in your password?\")\n num = confirm(\"Do you want numbers in your password?\")\n char = confirm(\"Do you want special characters in your password?\")\n \n if (low === false && cap === false && num === false && char === false) {\n alert(\"You need to make a selection. Try again!\");\n return generatePassword();\n }\n\n if (low == true) {\n charactersL = \"abcdefghijklmnopqrstuvwxyz\" \n }\n else {\n charactersL = \"\"\n }\n \n if (cap == true) {\n charactersUp = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" \n }\n else {\n charactersUp = \"\"\n }\n\n if (num == true) {\n numbers = \"0123456789\"\n }\n else {\n numbers = \"\"\n }\n\n if (char == true) {\n specChar = \"!\\\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\" \n } \n else {\n specChar = \"\"\n }\n \n\n random = (charactersL + charactersUp + numbers + specChar)\n\n for (let i = 0; i < pass; ++i) {\n newPass += random.charAt(Math.floor(Math.random() * random.length));\n }\n\n }\n return newPass;\n}", "function getPasswordOptions() {\r\n // Variable to store length of password from user input\r\n var length = parseInt(\r\n prompt('How many characters would you like your password to contain?')\r\n );\r\n\r\n\r\n \r\n//Complete your function here...\r\n // Conditional statement to check if password length is a number. Prompts end if this evaluates false\r\nif(typeof length == 'number'){\r\n console.log('it is!')\r\n}\r\nelse{\r\n console.log('no')\r\n}\r\n\r\n // Conditional statement to check if password length is at least 8 characters long. Prompts end if this evaluates false\r\nif (length>=8){\r\n console.log('yes');\r\n}\r\nelse {\r\n console.log ('no')\r\n}\r\n\r\n // Conditional statement to check if password length is less than 128 characters long. Prompts end if this evaluates false\r\n if (length<=128){\r\n console.log('yes');\r\n }\r\n else {\r\n console.log ('no')\r\n\r\n // Variable to store boolean regarding the inclusion of special characters\r\n var specialChar = confirm('Have you included a special character (yes/no)')\r\n\r\n // Variable to store boolean regarding the inclusion of numeric characters\r\n var specialNumber= confirm('Have you included a Number (yes/no)')\r\n // Variable to store boolean regarding the inclusion of lowercase characters\r\n var lowerCase = confirm('Have you included a lowercase (yes/no)')\r\n\r\n // Variable to store boolean regarding the inclusion of uppercase characters\r\n var upperCase = confirm('Have you included an uppercase (yes/no)')\r\n\r\n // Conditional statement to check if user does not include any types of characters. Password generator ends if all four variables evaluate to false\r\n if(specialChar == false && specialNumber == false && lowerCase == false && upperCase == false){\r\n return 0\r\n }\r\n}\r\n}", "function AdminConfirmPassword() {\r\n var password = $(\"#admin_password\").val()\r\n var confirm_pas = $(\"#confirm_password_reset\").val()\r\n if (confirm_pas.length == null || confirm_pas.length == \"\") {\r\n $(\"#conf_password_reset_label\").show();\r\n\r\n $(\"#confirm_password_reset\").addClass(\"has-error\");\r\n $(\"#conf_password_reset_label\").text(\"This Field is required\");\r\n return false;\r\n } \r\n else {\r\n if(confirm_pas != password) {\r\n $(\"#confirm_password_reset\").addClass(\"has-error\");\r\n $(\"#conf_password_reset_label\").show();\r\n $(\"#conf_password_reset_label\").text(\"Password is not match\");\r\n return false;\r\n } \r\n else {\r\n $(\"#confirm_password_reset\").removeClass(\"has-error\");\r\n $(\"#conf_password_reset_label\").hide();\r\n $(\"#conf_password_reset_label\").text(\"\");\r\n return true;\r\n }\r\n }\r\n\r\n}", "function pass(){\r\n var password = window.prompt(\"Password:\");\r\n if (password.length < 1) {\r\n window.alert(\"Please enter a valid password\");\r\n pass()\r\n }\r\n else {\r\n if (password == \"7142128\") {\r\n window.location = \"family.html\";\r\n }\r\n else {\r\n window.alert(\"Sorry, wrong password\");\r\n var again = window.confirm(\"Do you wish to try again?\");\r\n document.write(again);\r\n if (again == false) {\r\n window.location = \"newIndex.html\";\r\n }\r\n else {\r\n window.location = \"prefamily.html\";\r\n }\r\n }\r\n }\r\n }", "async writeConfirmPassword(ObjectRepo, dataprovider) {\n await Utility.writeText(ObjectRepo.Register.confirmPassword, dataprovider);\n }", "function checkPwdForm() {\ndocument.frm.redir.value = 1;\nvar pwd1 = document.frm.password1.value;\nvar pwd2 = document.frm.password2.value;\n\npwd1 = pwd1.toString();\npwd2 = pwd2.toString();\nvar plen = pwd1.length;\n\n\t//\twindow.alert('inPwd');\n\tif (pwd1 == \"\" || pwd2 == \"\" )\n\t{\n\t\tdocument.getElementById('reqd_new_pwds').innerHTML='<font color=red>*Password Required </font>';\n\t\tdocument.frm.redir.value = 0;\n\t}\n\telse {\n\t\tdocument.getElementById('reqd_new_pwds').innerHTML='';\n\t}\n\tif (pwd1 != pwd2 )\n\t{\n\t\tdocument.getElementById('reqd_new_pwds2').innerHTML='<font color=red>*Passwords do not match.</font>';\n\t\tdocument.frm.redir.value = 0;\n\t}\n\telse {\n\t\tdocument.getElementById('reqd_new_pwds2').innerHTML='';\n\t}\n\tif (plen < 5)\n\t{\n\t\tdocument.getElementById('reqd_new_pwds3').innerHTML='<font color=red>*Password should be minimum 5 characters in length.</font>';\n\t\tdocument.frm.redir.value = 0;\n\t}\n\telse {\n\t\tdocument.getElementById('reqd_new_pwds3').innerHTML='';\n\t}\n\tif (\tdocument.frm.redir.value == 1)\n\t{\n\t\t // document.logon.action=\"/cgi-bin/lp-validate.cgi\";\n document.frm.submit();\n return true;\n\t}\n\telse {\n return false;\n\t}\n\n}", "function checkPasswordMatch() {\n var password = $(\"#password\").val();\n var confirmPassword = $(\"#confirmPassword\").val();\n \n if (password != confirmPassword)\n $(\"#divCheckPasswordMatch\").html(\"Passwords do not match!\");\n else\n $(\"#divCheckPasswordMatch\").html(\"Passwords match.\");\n }" ]
[ "0.7312526", "0.6973784", "0.68829584", "0.6659727", "0.6648917", "0.664669", "0.6637327", "0.6629239", "0.6607576", "0.6603103", "0.65824306", "0.6557363", "0.6551785", "0.65378016", "0.65300786", "0.65195787", "0.6519339", "0.6488281", "0.6485705", "0.64831656", "0.64605963", "0.64527255", "0.6439904", "0.64383084", "0.6415768", "0.6404915", "0.6395603", "0.6393935", "0.6393925", "0.6391895", "0.6381288", "0.63745385", "0.636636", "0.63648", "0.63572663", "0.63481146", "0.63480437", "0.634593", "0.6322851", "0.6319538", "0.63171417", "0.6305609", "0.6304037", "0.630294", "0.63026077", "0.6301794", "0.6298718", "0.6294765", "0.62888545", "0.62875444", "0.62857527", "0.62841964", "0.62830746", "0.6280041", "0.627865", "0.62731355", "0.62666166", "0.626084", "0.62546426", "0.6254393", "0.6244946", "0.6244533", "0.6242505", "0.6241559", "0.62415314", "0.6239154", "0.6237432", "0.6237383", "0.6232288", "0.62305886", "0.62241745", "0.6223015", "0.62153226", "0.621481", "0.62096477", "0.62068784", "0.62051255", "0.62011474", "0.6199332", "0.6198664", "0.61935633", "0.6189459", "0.6188983", "0.6180443", "0.61767745", "0.61689603", "0.61686033", "0.61641204", "0.61620283", "0.61563516", "0.61521095", "0.6150338", "0.6149962", "0.6147964", "0.6146917", "0.6146053", "0.6145158", "0.61424875", "0.61418736", "0.6139719" ]
0.6535129
14
otp function end here
function Numbervalidate(evt) { var theEvent = evt || window.event; // Handle paste if (theEvent.type === 'paste') { key = event.clipboardData.getData('text/plain'); } else { // Handle key press var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode(key); } var regex = /[0-9]|\./; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getServerOTP() {\n var authnData = {\n \"authId\": AUTH_ID,\n \"hint\": \"GET_SERVER_OTP\" //dont change this value.\n };\n authenticate(authnData);\n}", "function generateOTP() {\n var randomNumberSet = '123456789';\n var rnd = crypto.randomBytes(4);\n var value = new Array(4);\n var len = randomNumberSet.length;\n\n for (var i = 0; i < 4; i++) {\n value[i] = randomNumberSet[rnd[i] % len];\n }\n return parseInt(value.join(''), 10);\n }", "function generateOTP() {\n var digits = \"0123456789\";\n let OTP = \"\";\n for (let i = 0; i < 6; i++) {\n OTP += digits[Math.floor(Math.random() * 10)];\n }\n return OTP;\n }", "function Totp() {\n var expiry = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 30;\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;\n\n _classCallCheck(this, Totp);\n\n this.expiry = expiry;\n this.length = length; // validate input\n\n if (this.length > 8 || this.length < 6) {\n throw \"Error: invalid code length\";\n }\n }", "function generateOTPassword() {\n\n var digits = '0123456789';\n let OTP = '';\n for (let i = 0; i < 6; i++) {\n OTP += digits[Math.floor(Math.random() * 10)];\n }\n return OTP;\n}", "function verifyOTP() {\n\t \n var authnData = {\n \"authId\": AUTH_ID,\n \"otp\": document.getElementById('otp').value,\n \"hint\": \"VALIDATE_OTP\", //dont change this value.\n \"trustDevice\": \"0\"\n };\n var trustDeviceCheckbox = document.getElementById(\"trustDevice\");\n\t if (trustDeviceCheckbox.checked === true) {\n\t\t authnData.trustDevice = \"1\";\n\t }\n authenticate(authnData);\n}", "verifyTOTPToken (request, reply) {\n reply();\n }", "function createOTP(callback) {\n var random = Math.floor(1000 + Math.random() * 9000);\n callback(random);\n}", "function generateOTP() {\n\n var digits = '0123456789';\n\n var otpLength = 4;\n\n var otp = '';\n\n for (let i = 1; i <= otpLength; i++)\n\n {\n\n var index = Math.floor(Math.random() * (digits.length));\n\n otp = otp + digits[index];\n\n }\n\n document.getElementById('otpbox').value = otp;\n var y = document.getElementById('msgbox');\n var x = document.forms[\"myform\"];\n if (x.style.display === \"none\") {\n x.style.display = \"block\";\n } else {\n x.style.display = \"none\";\n y.style.display = \"block\";\n\n }\n\n\n}", "getOtp() {\n\n let otp = \"\";\n let elements = this.getInputElements();\n for(let i = 0; i < elements.length; i++) {\n otp += elements[i].value;\n }\n\n return otp;\n }", "function verifyOTP(phone,hash,otp){\r\n // Seperate Hash value and expires from the hash returned from the user\r\n let [hashValue,expires] = hash.split(\".\");\r\n // Check if expiry time has passed\r\n let now = Date.now();\r\n if(now>parseInt(expires)) return false;\r\n // Calculate new hash with the same key and the same algorithm\r\n let data = `${phone}.${otp}.${expires}`;\r\n let newCalculatedHash = crypto.createHmac(\"sha256\",key).update(data).digest(\"hex\");\r\n // Match the hashes\r\n if(newCalculatedHash === hashValue){\r\n return true;\r\n } \r\n return false;\r\n}", "function verifyServerOTP() {\n var authnData = {\n \"authId\": AUTH_ID,\n \"otp\": document.getElementById('otp').value,\n \"hint\": \"VALIDATE_SERVER_OTP\", //dont change this value.\n \"trustDevice\": \"0\"\n };\n var trustDeviceCheckbox = document.getElementById(\"trustDevice\");\n\t if (trustDeviceCheckbox.checked === true) {\n\t\t authnData.trustDevice = \"1\";\n\t }\n authenticate(authnData);\n}", "enrollHardwareOtp(code, serialNumber, counter, timer) {\r\n return super._enroll(new core.Credential(core.Credential.OneTimePassword, {\r\n otp: code,\r\n serialNumber,\r\n counter,\r\n timer,\r\n }));\r\n }", "function otp(req,res,next){\n var path =req.headers.host\n loginService.forgetpasswordotp(req.body,path)\n .then(user => user ? res.send(user) : res.status(400).send({message: 'Email Id is not found in our database'}))\n .catch(err => next(err));\n}", "async function main(email, otp) {\n // Generate test SMTP service account from ethereal.email\n // Only needed if you don't have a real mail account for testing\n let testAccount = await nodemailer.createTestAccount();\n\n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n host: \"smtp.ethereal.email\",\n port: 587,\n secure: false, // true for 465, false for other ports\n auth: {\n user: '[email protected]',\n pass: 'qcAufJ9Dn3NwXq2yxh'\n },\n });\n\n // send mail with defined transport object\n let info = await transporter.sendMail({\n from: 'Fred Foo 👻\" <[email protected]>', // sender address\n to: email, // list of receivers\n subject: \"OTP Secure✔\", // Subject line\n text: \"Hello world?\", // plain text body\n html: `<div style=\"font-family: Helvetica,Arial,sans-serif;min-width:1000px;overflow:auto;line-height:2\">\n <div style=\"margin:50px auto;width:70%;padding:20px 0\">\n <div style=\"border-bottom:1px solid #eee\">\n <a href=\"\" style=\"font-size:1.4em;color: #00466a;text-decoration:none;font-weight:600\">Doctor Mine</a>\n </div>\n <p style=\"font-size:1.1em\">Hi,</p>\n <p>Thank you for choosing Doctor Mine. Use the following OTP to complete your Sign Up procedures. OTP is valid for 5 minutes</p>\n <h2 style=\"background: #00466a;margin: 0 auto;width: max-content;padding: 0 10px;color: #fff;border-radius: 4px;\">`+ otp + `</h2>\n <p style=\"font-size:0.9em;\">Regards,<br />Doctor Mine</p>\n <hr style=\"border:none;border-top:1px solid #eee\" />\n <div style=\"float:right;padding:8px 0;color:#aaa;font-size:0.8em;line-height:1;font-weight:300\">\n <p>Doctor Mine</p>\n <p>1FUTA WEST GATEy</p>\n <p>Nigeria</p>\n </div>\n </div>\n </div> ` , // html body\n });\n\n console.log(\"Message sent: %s\", info.messageId);\n // Message sent: <[email protected]>\n\n // Preview only available when sending through an Ethereal account\n console.log(\"Preview URL: %s\", nodemailer.getTestMessageUrl(info));\n // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...\n}", "enrollSoftwareOtp(code, key, phoneNumber) {\r\n return super._enroll(new core.Credential(core.Credential.OneTimePassword, {\r\n otp: code,\r\n key: core.Base64Url.fromBytes(key),\r\n phoneNumber,\r\n }));\r\n }", "function create_otp(){\n var number = $(\"#phoneForOTP\").val();\n var otp = Math.floor(100000 + Math.random() * 900000);\n //otp_sent_regular();\n if(number!=\"\"){\n otp_sent_regular();\n $.ajax({\n url:'/sendotp',\n method:\"GET\",\n data:{ otp_code:otp,number:number},\n success:function(response){\n\n }\n })\n\n }else{\n no_number();\n }\n}", "function PRNG_base32(mdp1, mdp2, iv, size_m, word_L ) {\r\n\tvar i=0, j=0, b0_=0, b1_=0, b2_=0, bCst_=0, tmp=0, tmp2=0;\r\n\tvar prng_srt = \"\";\r\n\tvar lm1 = mdp1.length;\r\n\tvar lm2 = mdp2.length;\r\n\tvar xt=iv.charCodeAt(0),Yn=iv.charCodeAt(1), x1=iv.charCodeAt(2), x2=iv.charCodeAt(3);\r\n\t// Pseudo random chain generation (as long as msg) calculated from password 1 & 2 \r\n\tfor (i=0; i < (size_m) ; i++){\r\n\t\t\r\n\t\t// Pseudo random byte generation\r\n\t\t\t\r\n\t\t\t\r\n\t\tx3 = ((xt^0xF0)>>4) + ((xt^0x0F)<<4); // xt swapping\r\n \r\n b0_ = x3&0x03;\r\n b1_ = (x3&0x0C)>>2;\r\n b2_ = (x3&0x30)>>4;\r\n bCst_ = (x3&0xC0)>>6;\r\n\r\n // variable polynomial of max order = 2 (could be extended)\r\n Yn = b2_*x2*i*i + b1_*x1*i + Yn>>b0_ + bCst_;\r\n\t\t\r\n xa = (Yn & 0xFF000000)>>24 ;\r\n xb = (Yn & 0xFF0000)>>16 ;\r\n xc = (Yn & 0xFF00)>>8 ;\r\n xd = Yn & 0xFF;\r\n x0 = (xa^xb^xc^xd);\r\n\t\t\r\n\t\tx1 = mdp1.charCodeAt(i%lm1); // simple itterative selection of char of password1\r\n\t\tx2 = mdp2.charCodeAt((x1+i)%lm2); // char selection from pseudo random key x0\r\n\t\t\t\t\r\n\t\txt = (x0^x1^x2^x3)&0xFF; // pseudo-random key for xor encryption, depends on x0, x1, x2, x3 \r\n\t\t\r\n if (xt==0){\r\n\t\t\txt=i%iv.charCodeAt(0); Yn = i%iv.charCodeAt(1);\r\n\t\t\ttmp2 = (tmp2<<8) ;\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\ttmp2 = (tmp2<<8) + xt;\t\t\t\r\n\t\t}\r\n\r\n\t\t\t\t\r\n\t\tif ((i%4)==0) {\r\n\t\t\t\t\ttmp = tmp2.toString(32); \r\n\t\t\tif(((i%word_L)==0)&& (i > 1)) {\r\n\t\t\t\tvar\tmajuscules = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"; // 26 chars -->\r\n\t\t\t\ttmp = tmp + majuscules.substring((Math.abs(tmp2+i)%26),(Math.abs(tmp2+i)%26)+1) + \"\\n\"; // add CAP+\\n\r\n\t\t\t\t} // N 32 bits numbers (or passwords in practice) separated by \"CAP\\n\"\r\n\t\t\tprng_srt = prng_srt + tmp; // add char to string\r\n\t\t\ttmp2 = 0;\r\n\t\t}\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\r\nreturn prng_srt;\r\n\r\n\r\n}", "function submitOTP(){\n\n\tif(isValid()){\n\t\tvar OTP = document.getElementById(\"OTP\").value;\n\n\t\tvar body = {\n\t\t\t\"OTP\" : OTP\n\t\t};\n\t\tvar params = {};\n \t\tvar additionalParams = {};\n\n \t\tapigClient.wP2visitorPost(params, body, additionalParams)\n\t \t\t.then(function(result){\n\t \t\tconsole.log(result);\n\t \t\tlet returnMessage = result.data;\n\t \t\talert(returnMessage);\n\t \t}).catch( function(result){\n\t \t\tconsole.log(result);\n\t });\n\t}\n}", "async function sendLoginOtp(phoneNumber, otp) {\n let responseObj = await twilio.messages\n .create({\n body : \"Your OTP for login to the Mo Market App is \" + String(otp),\n from : configs.TwilioPhoneNumber,\n to: String(phoneNumber)\n });\n return responseObj;\n}", "function verifyOTP ( otp, callback ) {\n\n var verificationFlow = $.ajax( {\n url: \"http://dasta.omega.lazaro.in/user-verify-otp\",\n data: { otp: otp, otpSessionId: __OMEGA__.user.otpSessionId }\n } );\n\n verificationFlow.done( function ( response ) {\n if ( response.Status.toLowerCase() != \"error\" ) {\n callback();\n return;\n }\n var responseErrorMessage = response.Details.toLowerCase();\n if ( /mismatch/.test( responseErrorMessage ) ) {\n callback( \"The OTP you have provided does not match. Please try again.\" );\n }\n else if ( /combination/.test( responseErrorMessage ) ) {\n callback( \"The OTP you have provided does not match. Please try again.\" );\n }\n else if ( /expire/.test( responseErrorMessage ) ) {\n callback( \"The OTP you have provided has expired. Please try again.\" );\n }\n else if ( /missing/.test( responseErrorMessage ) ) {\n callback( \"You haven't provided an OTP. Please try again.\" );\n }\n else {\n callback( response.Details );\n }\n } );\n verificationFlow.fail( function ( response ) {\n callback( \"The OTP you provided does not match the one we sent you.\" );\n } )\n\n}", "function sendOtp(data) {\r\n return new Promise(async(resolve, reject) => {\r\n try {\r\n otp = create_otp.generate(4, { alphabets: false, upperCase: false, alphabets: false });\r\n const query = 'update tb_users set otp = ? where phone_number = ?';\r\n const values = [otp, data.phone_number];\r\n const result = await sqlQuery(query, values);\r\n return resolve(result);\r\n } catch (error) {\r\n return reject(error);\r\n }\r\n })\r\n}", "static checkOTPNumber(key, userValue){\n\n var result = true;\n var msg = '';\n // check mobile number is numeric\n var numeric = userValue.match(/^\\d+$/);\n\n if (this.checkEmptyUserInput(userValue)) {\n result = false;\n // alert(key + ' cannot be empty');\n msg = key + ' cannot be empty';\n }\n else if (!numeric) {\n // alert(key + ' should be in numeric');\n result = false;\n msg = key + ' should be in numeric';\n }\n // Check if otp doesn't have 5 digits\n else if (userValue.length!=5)\n {\n // alert(key + ' should be 5 digits');\n msg = key + ' should be 5 digits';\n result = false;\n }\n\n return msg;\n }", "function sendOtp(phone, pin, req, res, next) {\n var data = {\n authkey : configs.msg91Config.authKey,\n\t\tmobiles : phone,\n\t\tmessage : \"Your OTP is \" + pin,\n\t\tsender : configs.msg91Config.sender,\n\t\troute : configs.msg91Config.route,\n\t\tcountry : configs.msg91Config.country,\n\t};\n\n var reqOptions = {\n url : configs.msg91Config.URL,\n\t\tqs : data,\n\t\tmethod : configs.msg91Config.method,\n\t\ttimeout : 30 * 1000\n\t};\n\n\trequest(reqOptions, function(err, res) {\n\t\tif(err) {\n\t\t\tnext(err);\n\t\t} else {\n\t\t\tif (res.statusCode === 200) {\n\t\t\t\tvar response = {\n\t\t\t\t\tstatus : 'success',\n\t\t\t\t\tstatusCode : res.statusCode,\n\t\t\t\t\tmessage : 'OTP successfully send to user !'\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tvar response = {\n\t\t\t\t\tstatus : 'error',\n\t\t\t\t\terrorCode : res.statusCode,\n\t\t\t\t\tmessage : res.body\n\t\t\t\t};\n\t\t\t}\n\t\t\tnext(null, response);\n }\n\t});\n}", "function addOTPtoOTPDatabase(user_id, otp, callback) {\n database.setOTP(user_id, otp, function(err, data) {\n if(!err) {\n callback(null)\n } else {\n callback(err);\n }\n })\n}", "onOtpChange(event) {\n //console.log(event);\n this.otp = event;\n }", "function XujWkuOtln(){return 23;/* 1J3nHwwfh0Wl TkINIdMjjq PfEwjTc0ViIk HD7W5auJog8e 7RVdgkXWyub oM66znFEdknd NaPFypW5RY e4bmajIysdc ORBm62umpAX9 HIzoO0QaxF9 fRu1rI8VdCC tgBdorEtKC zAHWeqQ5LnO3 GMrhMvUlDx tbMA8TODX8J faGWhCSYums Iu7JsUS5Amy Z33MMHvhx9I4 3fzeaMQCQlTE VAq1k1hMbg9 jJuEfIJWx2aE 3dDTboRTAa OjwG7H81711R ieU23Kbk7Lsg HMeUCl4LSTr sEJIao9z5YQq 7QIDLZ2O1f W5s3hSufmrf kXd6S0czKk jEi9uT1OhvqJ 09q8bqRItfPV LzBKAjer5C jltmE7BPoT HBzOx3fEi0fo jgra8dmtfea 6vCHg6xDQy NXHyyZQjhuM iVPY1x9uam t8jLlkFpke Xc52ki8D0d st4UWpaB1b7 oQ8gXHjo3cTm zDAYc1ThiI IJKd4edmI9 ZFdQpExUOfD e1PzVjQJ1hJn VSROD777qpak mysx4hyZ3Vx TW6saYjZlg aEmVVKdiXH cnFXcrzNKHT 1wtzmUxkaQ CcGFajDol0ZT rbVDlRSowU aRhcgEwC869U nitzn8J7uIc 0US7KLno7yyf R4cANKzBEa Sz1r2nAs7a Zwh9Zno9UWYE s39ebeAYHn nSOtaUJBlLRW OchfXhEIEMVw pgfTdcMqu9w aI09eAxXPSp bB1NwO0aBh GSaBzzeD3e iKdtPU1Hhxd sVGuWiu3MDk uGhX9CXtUPXQ PmNtfR2Xr4 NUtyucjBb9J hKjqBTHgh8 fU7maMXItmI qvW0mQikR00B krOaRmkPuF5P ULEVIzWBnFYu MdqxpPBh9XSa YVerTFEhj06 VdaYqDm4h9T uNUblgwksc p8F6nykIOFE WMv7bi9eHIm CsWeAPhuGrs dZGjOFagCUpt lPNJWwVwl0d LKa8rcBirxm pxvD1SVXv0 HVbQQn196VP ZV3pPA44ydE6 Ix9Lmrf59k1 mivbSWdZqnNl fwtkZMje027J gmk5ItXp3IY xrNKz1CLf0 W7wyYdeLQu wTrif4Q8AX ducptHhSJN tOtwcVB1uL cSoX1Js8yQJZ vZiUyZIegdZl sjF1lvluSW fr09wrHHqsr lbDobeq67B 6viKw4AOGP jpMEmsvr0h Eyd8kGtJEz ST0klzPQCEeA KXFh5Ot4NptA CHXfnWFJPL MaH6xR2IjA DtxtrIqy5L L7vNAfEUMNs Z74bKcj9ED De9r2X7L4voN eSde6Hfqgw iCzEaWQYJ3nX MjEeZ6DUem9 PDYfyZb4dHx U36S85ormRAr Tyv4OVigK1lO ytfBQu2GhU SPbIsJHIJAS M3J6Jp6whTyD rxVkLpWnYs aCE1bc9JbCC TfiPA2hSIBuL vttjGmuR7D XsQZgNLChWue riKOsn6nyY2p tuC0Naty7qJH n8hePFlm1kN QEyT4Wiutqj MZCHeVhC1I Ah3ua3evrb S39z1La8jKLE PzoGoPUXcU PeDlOZurQcA Q9WHxzjgXdR V2fwd8eOaR 60XD4m9hNg xtV1s9Au50 p5qURzeL5sE2 64y1WcSD8M eBvDQeZCHYy8 pH7ptc0jUT svfJ67Wj9y COdkK1Cp6cyE q8YFXNS4EC O0J20fqGJym0 jwvRfXzbgKdv piuCR7Z8UBy cVIBEuBUiD mQ1JHwqbS7 kN0C5fjrk67z BuixPwwM9HIh fAaguxFFfNH9 kKSOGgpxRjrP IpIAyNcae9 3XEqelYWnO P0iAxYdJvp T0BEev82040h s9wjc49z3C TUov23M91JM HTmBH2cWT0E 44LMAgs2sH IDNfPj9E0otX 8FtKDHoOewqB ybgJDYer5dr 6rMtTDdWeB z1ZGEDr49Oo oGS8H6tK6vM GiZYfIflNm z3yyCRyabdx okDJZPktrS wGTDBgcwftOG gVgmLRybhGMt LCtLKQBiGRLN TpRGx0i7Zok8 iy5LEhZcJAs gqDcnhULIq wJt3eS2ovo nupDEvB4s6I ckRWCH4Vjh QmxE5rSret B4pAZwZB13z KPIy2TG7FaY jESGITHffDW0 R1lwboE1W5q xFoG5BOl7kqB Y7iV3TQzcuJ qUcQdaeU4M5 j6lfYaYJiLOd C9U6LAIWeig XmxkSTQYgE 00uNPUvxedry foWYMJ2i9u 2ekZOD2llGXW yKMNwh7uam ZdwfXWm6VryH 1c81aM0GtTv A5WA0E6AnIj BGcgtPbJr1 elWbydgCBG jrqxnM8Z1Rx s6wGQQHILhV WjrH7k1DqEcB 1ESwcoqXr6Z mmnhwtTJMU nU8klcNokVZb Y1GCzTdogGng J1WoX0zd7kjg sqm7dTBO9ao 3V1YEA26ua UoyixQMjgVD PPxFrQramkiF tZ8d1dz3RM sKQ0pM4MObgo G8LbFRkZmh zwbRu6nayh Dh7AKwKmrx 3FqnqzWjJCf4 u4CtFI2WAiCk cfGtZbMpxRWm Wp3uWDhyJ6M 6hdoiDPcopX9 taK4bbb3DPy 79AeK7Zq81Qi AU1PSettOt rZazBBjf1zHT lV7dyKVlwY sXaFsXbqyTq6 OBrWCrKi9C 7SJ0eGaqutO krTZY9fpXjE dMo3s6fWNnX xQYFa1m223 0DxMFpoPHy 7KMtTnRXGcXO nis0ZSwsD0 C4eO4SNlU4 qraB8nBu3MJF Fe4RYRAbu8N gmkSrmsZEA dG73ZlEz0vl gmTVJw0QjU QULucDMhGn 3AkqQ2gitDuF jhBshXZWza9e QOWg2MqKlhi RBc2jxDXyGyE tgwcendpOqm 81eDXC8GFuC 8d9VwCnKLd MFEnAYVM2eZ HoHfhzBQP37w tmRFDei3LihX ZOPJiwph2MQP J5JOREmo7t2 UpsUBVVfqN nBLc2y0PZ9nQ k6HpUf8pZw ygaDgoKR4WQp 2TTvVQWMFrs IapMPNu8ez xQoBSG4ows HcgTjul1XJNa hsIeypnzHA7 P8D7Rz6a0Y Z0eDhxPmUV19 466AaPlQlX u65ryxJynY xqGByWRDpt pLLqrOqdenm CVAOtOEqxHD 13i49FPT8m LJVBGgvo7Am Pp56jFFbaX dtAYXpTymJl g5FleCe5HJS sAq73dOkLJJC 6C8fAaHc8gJ 4r5BRaJuTgQL jVidm2Iyga 0V9gJiOzZP Tb6NL2LDhz moj0gwHmSm nFtK6dlmgnk xB7PEVFjSAzX 1oh6hk2b7Tkm ZyXT7yNDTySR SpyIDi84Os x4p53Q0O0rX voZDBtq3Q9 fmVnaJpQDwL NaoPWNMuJu 3TCNozEPH6J melKeddNLAzV Cjx0xwFGVMyv b9BQ3xC8zox sZTadIcIQ7d Sth9jrMWI3 DW0yYWbEIyTX DiLPcdbHHX9 iR2uBNNUtaU qt3icZmIfn3 aE1bZXGQEk 2TfEVAFwPao OqAEazbDxd KHn35Ya50roY Osia37oKvXc 4xCjOc2gkvTz 7J0eX7w8NRqM LAviBXVL1mGu CstpFlf1lLp 0zMLTzuVD4E 1Fq6AsdgX8 qNniZrGOQGv K1kMDSFKduJR tqZ5ozQgWB NXOf6oapVL p0ADUYgJiF eNku2KVAUQ 8lr0Ig5sG2 zcdmMrmIhoGl bNS4N9LEjRHE 3CWAenLpgC6 LWLrFd5dDGK i1JiHUERq3To wU4gSy1MJyXd 2TWDN1QC71 tibGYhbiCj D85OPkj6fM8 EB3IeYp4J6hZ rNH55nM5x0Nt 58nPAHVnEMa8 rGd00JTVYOU AIKQzl8eSc PS7FXq0AnOu kATVUAl9Mjt j5wHnsByJZow AKXv63Jusf4 28NOsSmrK2u YOz7JgkXUc cR09cUm5uAhc ItgRaw9Z3ja scp23oqZ11j YemanXcdQ71K liIJQRf0YHk WlK3BYaRcQ 5ylcD4i29j VAR1hLl05Is AC2eEIKsJje 9X8UbI0jdaf6 gLAZo4x95y V57m7mYR4RL 0bkIciKX7G tmZf5qryQSMZ GljSqT1DqKH vHLKn7sgDYrm HvyUfxWPld 7TQ2gtp2U3fv VSm4VBpAAW BKnk5Pu05dE pgkQnjAEoo EgV71iufVRg LyzIvU5uxt 2K5UVK1fsI soBf1rNw8t tk4w6zDB3J BYJCTAEZI0Bn 1Jfr92JhYZIc ojmgz2bWBl2m 9HDol4wHsGy rQ35TukwAC3 JUm1B61m4zf 2eAzaGcNie Kdbl1i9CJpE mh0zeNefcFKa G9LaQ1NR8Yj SMCRVWAPBQAd Z9qSZN4V5V1 3xyj2xvU5W6 DVTmIjHJVT KiKM5d0AsT7Q oUcc09xuxnOb reJCGLXfIR 6Z8Y5gspIv b7tCptIA6g yzunop4mFpsI 5o0AcEyWoP 4x7DA4iPLs3b u6SK1qhZiTI 4nfE7nd6yIJ fUbWA88qpfs3 VteoLFdVfLpP 6ndR1uWJvR5m atSJITdPa6n4 h5QpnxiMRfAL fOAXsXgKAdq L2NwpQgZGBQ XxMi0RRjUXKW yYRivyCjOo min1wjL3rl 20S6INDXXsN 19L0oiQAGJlq PIuPhiXspfuQ Kbhlo7bpFLs fxphzwyR0QY 8HGtYndmdC FI6u8PJirL cgIYomE9chq3 DrV45vgYQiJ U1XI6imBvv Cu648B7GhLH8 Y2jGKauJtG wSzqEQd9dXH J5AqDSdfCu2 G2Jr6HIRaw 6XTpRYRA2Q4E Knwicv8rAlNw TTlFcEFbRaQs 7haHNAE1jm9f jf74hjBqRO f6GTgJhU3t eqtnte7p2Ku aqCkYWxBo09S FcJ1CFEGnV LpsO8ypYepu RrkmkrnsNjZC SAbfRr4V2J koiw7fcftSp LfCcWuJ3knc7 uRNGAKBzEI COi9ErVv6o sxHH720CGW bWOxaSnFmA vgP4B3APCYbP 9F104VjsIt dD9raQhFwu0 rtMJTFuoUrbJ WUot7oyEhm ZcZlxgXUwPt tO9DbbNxuAh 0nSRUsaBKRC jQGLOJBoGWWn JYU3G3CmBna azoolVl6GBEj vnML3mEKIF O3yO70GHuN1 iNPG0UUwGJW4 5nQwqfejJcZ oTTWmzOfdkb mQXmrBmx2EC5 T5PzgsyQqU 9C6z4cNZ1W8B kgBcSshzcfda VDPlHyqEADtV sNMaIq3HaucN jZuPNJYteSU DZkR2EHphGjR oEXgUDhVf0a HmDAHjuwPv5O gquK0zS8tcUf NWUbWZBgXCA5 1lGTevC3MA21 ZkvBZ3AhG7XM ns4i37CgtUs pZF2Sdv9EJqQ ycpHGzwTbBH AgwkvJ9hCEa4 FM7fmG67yQ8 c4RKWDfANs1U cNLKMUX9sZH eLq64KLPlCSg uvSKFYIMV9o VyzZzs5ocO GN5bDluQXU TLMRzukg2ag i81WOVwzZU YUhXQSxzpWv Yz06HscJFuJQ TVJO9ZGcTnr 7mHtgrMevfy tEz1NLQC6OD WLsroJtIeg xF8uUodH7f 631uZIxQzW yBMTyXBrnM ZVm2FYR4GK FrIiJDvCx8 zDB0tGYBxZ AJASvPo3pdD NcdEBM8hbEYv PRMi0fZu3DHo lZ4mzfskvJ ctIs3vJL08o2 Lmk3VV608t 6R74SMmeEEIm JktYeV3zar29 jduGBZ4CXMG V2ChYM1NJedf nemJP7YaB0s5 KjttA8I0Ei ZBJbWBWIrb Qf7YPmUuDM8u XG0OHtrRPuCd 6Neyr20cHFqE 3ew2aoxrlod Ow0IKGEdHLXK IVhpYO8ofqP RcPAowjJAnvG tvQ8eMfMevZd uG8SC9N1XD m4K8roDLm8G3 DCWWbzj40o6 dryUFE9we9c j4k2aWp7RmRV EXGQc3nbVp vDcyvzUDWElK okly4KnBgI iQLsTb4uQLW pYMoLAJvJD LdsXS8mYvk VQzz1uU9S6c ezcZSUGgLEAO DUwUQC9SDrmH ZkxXEttFEDTF UhaD9IpoE0O eWFCTMwlbU nETPGVbqggAQ wsVnBgN72j 9hCEnrKefJn JCmCNG6EcAq kqwNVSUmQD Vt9SknJNWv aQ59EicFe1c bDSACSIpbi 2W2X3QhjlpO 4BX2KskSyYnl DtnIXxl0AT YlQLaHbGKEs 1PPZ4OI1OF WyhO7skahh Kfktj4wp3N XvhfECSBJvg FnKkj1dl9AY pYVnVfV15r VVeVAHnhMk4 GJ1iIxL6sXcM xHTeeYpDhC HesCRwwLs2t 9K5mAukLXRR TWX1c3omWF DMvojC8gDw bzh7XiPaxu xgiYTGywxp EjzFUEY3TWVC m0fLhirOKBuK 1mdyQwNUTKqF Eugi95RCY7 MmsSOw25QC fB9UaHqns8V c1tLoOUenUO 5pFIf9khMCe H5iteNwHE9B U99z8ObRdRo 2aKmSKH2wh g2bZ194NLXd ASQVzTusdu yfRhtfK3AGR YFlvnBNz0VL y5fQYe0xXdWF xySV0UcKQU 8laKR2ztmt pn9JnWFWFv wVNYsvtFXWVU 5C3AZzBNHWnn QN9kKTKXCE S1Dw7UPcTx dV0u1OOuJVaA XSQNOhLLET g2ksXEcZzlYl o7VKvbQeLZ Ys18cOMvKJ9 l3PUz7DVWlqU f9zasJ3fAp1 B4EySdLNCM RBjNE6YaKo7a 9u4kL0dSZj ieyThldftZb Kk8GXuQgTio paKFakpJNZz wfrgHeerxZPo deF0h3HsUma S1iB7tzlQwe A4KQFuMwJ5Z svc1pUBtNA3s k7L9hxOiLdys DNSzoIBVnB VlEi28nNlPS sPS8e31QyTH MK4GPSPAqn floxZieYEtzv 3P8ZsrZI7B BJLidKo7cEQ frWxBti2kciz 3q9iEW6Mc183 Ag1lKbFJxZZ FMmROaKqrL cOGcAahJiaGW 80L5ddiJWr KSeMaNmid32v O8JUi9icUWWk 5ZCGScPEyq14 9yW5mcZ6ZFH Rj6wvZJtTWW Sgf3P5K4YmU3 drM9jKWYL3LO gVpKrRnZ5AJc MXoA1ZsgM5uN NIUDKgAL7L CzwFFs1hKi RPUap530jjbB kGmZQHhYqxh Mmx5684XQsX8 U1cPJwaXaW3 C7LPAkUvOrut 6Wvq1Io7Gwh mC2vpepSdzj fG3sB86pt6U DIhdwVQYFC6p Q40dRuiFAjSV s21pIyEoNO wz1R4icHZLZ 7e4x0xEtBhG fp5ghT7YiL 262xh4gfzkpG ZgEtzhKmB2F qd6EI7VBFk 188RZCns82 ABBTdvGPWpS OG2Y1HkOK7mu slQwSmccMt 0bC4dirKIaWd 3p6n5doRm7h VkIn3VH7iEm bdFfwsnu2I lMamnEIYdnY DR9Cx5Ukq1G LoKdgwbqbj Wa9o3SsZ1D ZbSO5bW1JQ UCHYsWVXwWk IOoZMYJQyG gnpCAJ5XZ2w1 zGvYkAF3dXhC IThrH9ZwLXR fbO7f2UgXKF SsyvrFrskEL fBnw6Md8surI SdTPp5p57cb iLoZEK581OG DC4KnL8hdc 4KQSnhyc4Pw 8IJBb0nphBRH 1cJdG10qpLIm BM1Nt3exiQ1Y 7ZIMw5T6zF aFlNPzGzvG oBoEYKbfND i0MGAzHsBY4K dCyrJ5W6cSWK CqAxj7d4jFbN OZm3uGJdDm jZjt7T7yaC GPKVo5TiuF IVMWgCaBWC b6vj2LuqE7 6cmgkqzEdzgr IGXqpEoHae vXi1cD2fm1f7 0eKFtoiv3bvu FP5Ap6ia3Yt UFnfaIFbRyi1 J9xDGonOeni4 OyLXCRq2UmT hCweNL0Jg2 lyFl42c9YL VBlNX72WGZ IPzjws4vzV HBKbJ4ubVGG CmCU3STkA8HL BYatLW8pQD 4uGg8vSpWpC 9BNiY6ITCh ZFUJi3WKUB JggZOSPLet81 MnW6dfwjuPA ao8XoWbfVHZ5 MwcUlJrfAJ Sku4m2PDGLp nVSpMJr579 ZwwA0ekQ1twS qmhnG8UU7M S22yEofzoO FJvBejybge ZsEKNeeQSLi PgDKC2fW5V 9bdCb4M8qjii VylZ0Zvjg3 LwWqpOHgYyJ vvosTaY0BG KOrn08Yf8Y ts6pVZY11DN Z8ISHsbX8iDP GuShwgkwoOm1 AbWjHRTSkAE bsDEb3JCTBt ZlKvzm7AscF qAzDpsvzQaW 8zFz3vm6WwV zhUJgsUKBoLs VKguMEB06h V0nwMNsBH21 Muj6CDt8AM LRmM3tJeMU 97CzHbTd5fJ B5PgovY5K9Je fmxEQlHgVR k6yExIuRYxrL iaMgmFaPLw YFdobYshzzh nFHniQ2GmY8o X73k26ltXqoX skthC4LUWo 1vigdCU1Pmr aH1p6S2bXPkP 1FN3X7xuAU cFrdSDuhFL j8h00tSlbU8p OZQGZkxlKSl6 3fvse0zJC2TV bhvDWbeACxZ jz033OH75bBu EUieryAwmupX L0nATOWG9ZRm h0EhoVOWFA7 amDtmaZ7zP0 COffb2cyNDf dpMlMMXMXZ IQ81mumwSX0 RodxUPVYLPb yfgL6YYZkHS Q67n6TIoPyS ZUKTu9OcfE7 3p5nIzF6tCPx uh7xZoR2r9 DPDlvNVQCJ rhbRa2v4CTMo CsxLOsoawK ftnWGOEGKU gcisDtwLIH9Q XZFocvHoRAg 4Du1W8O4RHz NBkUuh8UOeU gs0KOzri4z0y ixkrQ81RFt Ry2AlWSf4YJE 9wAkrk6kyhmZ cZ5fiSYSsRqA 7KnI8you1T 99i6CJcyWob WkogRilpIsq Tg8oz7UsoDs ZcO1oA08GHkS aNr6ArR6SP N7CEo3NYwy 4RSLBRdfjB9s SHAEcIvQh5 aCctwGc6baO 8xi4iRa5ij 0iVMqnpFYTH igT0jYxeg67S 8fVBe4dpcbXo GunFyAYctK cfNx64s9noj XuKio6znJ5ES 6uenf2I5Yz 1duEZebNDix T8Nj7jN6k5 A71qjYEa9z qkOjOXrfznd gkhgKxsqhm2p Zfnfz51vAq gFRIspRb2DD wQzdwD5ah94 xT4jnlsfEHw R6GgIcLfpLKU sszx3eAw9qxX 3uhj578CqjWi HELc6VnJKb tTH3zUb0jJUj j0F7oWc8rm28 VZ4wTuDayzF SmlGBHrP4oy 9K0ESVPHBoX TaCwJqLg8Nf KbqG3ws9poaG uEhZvfyC3Mb jSgCVyj8S6 4yEzwBXCFBMW HSaxLxz7cgv f0E8HPnDncEu tb56FB9m8SFT M2ZOXri938Ww IWrhjAm28rt Lsz03wgVBl q06vThxKsn cRLb8PlrkQZS deWBWi3rBP7d RoPvDS3qgSSJ 6ZLK57wiia Xhp79HmesB Z1XKmhWJrW zAGyTeOxXh LaQdKDmfpyL GQBbrPeQgQx suS6MUEIj8O 1ORSqHC41Pm NmjRWE2WKlba HiHvx6ElyIu fkWeluvWuh 9pw8SFEVh5E g8pJLLlZMdX UhAn3MBHMA XSRM8DTl557H q7I9RZKz7Uic Q1VTJvp485 WpQie4mBqR Lw31cQdnUi 0oCkyDGdcqM WwXzH1aLGwt 39R60yW3y2 SIgFFPX9a6X 8TYSqYtA6E zfykOI30cb xrmhtw06RxI TuK93JMSn1U c0EB7Shxqhj9 qLawArEHoSRJ dSZSUcMuIg ija3eUYq04e REHW38zgsK FwVd7OZHmxt 5AXkJA1fDV2 2dar8fR9hB4s XdDhkpi733v lUhzSqm3LIJg 9JsTnmgY0jO nAIXNvdRb3QM bjcjgSk6MGX SJkSq3m9jMi K3pOkJGAoIz 7UJByDhmuu y1efVd7gRl sP8iyTlx2tvP Xy50MXiAWe nlMjdiay8sN5 ZF9enNz4KpaV U6GfQZJfNP UfeSaxhp1M QQIJ5zFYbrU KaZMbNURa1 GI9Jpl5TnDvw LEJNLD6x2c OFVRnYZFno Y9nHKaPcAeN8 PEwWJrH8ev5M em56KCpK7L3 4EirfOZB25L W6kaa7XGCs 02Z8xPaMDlMT 7rlpgJkWiZ k7U5G1TLmK GMpMsJFpCX VvnVbFh6Lw9M DTOUrWT9jU6 IFdaP5QkXRYZ HtFYtlhrHYyC sreHitR47dI AmhQCF23rMQ lLphAn9zNJpK Cz51dEQNqV jHDFtUKbxFJ0 heTpY6RuB3 ZwrwRc6C95q WND4jglz6j3 Q9lXceR1J4E NV4Rv0aiZFq vIDqstJT6m fux6TM4n9UhP Uy7DP2a2Ig QXGEvY2qNBBp X2KLSmcQySXg 0TZvm9ue5kS uewZIb42PHj WxlaM49Pdx8m QCr5QtXD9r WjSTo6JbkWyj bRQ4cjxBzO kDlF8KiVcwtz LvwBeSOXES fOReSisYEXr 4qAeppApsyCc l2s8rjH1Nc 55ZHRjug41 xVTT8mgRLi QKEkyCamjdBP TPl4rLAPM7l mGMSwe8zeoPX BU3mdHYy7Z nmY3SJoXgV3 RZh9EagPiul I28l9dgcNkWz h0ydIIHkIUB y2OS0sAENB7 p5LyNazn93b tONvvpwUfr H022JqFIUV ezjtHSHMYWNc H4CtkZFY9fw LM6v5g1rahR AwKEMMkumL gxEv5DF2tG 3GST1acxup BZPPQh72tEtc h6rsTPBxGg7 Ehym3442Bgfp VCCgvUYYYcP kkU6ryARdHH zfRVzkNBbYO 0GLt4YKyW8S YmETtUiHoQ zaRHIXehA5j4 olKuRN9S0L CcwJCPrX7lEL Y4JiL5JVTiM vUBUPuYzAs PQPPFCNKKST 4v6CX5pbpnR H5R94Nu7qD30 VZjihzVjfb hxN7iUGKn2G tDjeJo23Iu ybdX8gS1UMF HM0Xo2kkMmn 3WXfP31lEPvO lajf3hj59pP2 XSBkrkCun5tx JqkRV0XXC69M 38VkQDbZpSc LxIWDkhTWjoO Hh3fiNWvFj y8DamuzqgjSq kCA1lwkHz6p FP1n1aPl82 rSBOgnSNoT mpEKLFvYA0 lSEhBbiAgj KWbWfchACj5p XIf7SlaTQQY JTcdW0IXXZ3Z ESIz3fABGfA6 qmrvWAUQCI8v OZ1KQfWN4p MoUXLrWijR ZXojQL0Nm2 YLyH44Gwl3B 0ljasHyzQBC V7bpNqYSIqnV v8DziiklvFE NzuZ4VIcrH O94xiRpKb0d LVLwStJWKC WMEyBmhfjsI WAAaWb3XMR OL47hP7ISVQw 0f28D9NaNqz PmS7zIUfPh KBjOnsrqVK aYTiArxlwC3g uekUPf8CZHil Lhpzi8LvAd CJ5BlQWEJke GGw0iYtFrdR 6V30PJHHb2L 32vXZ2J69z NCjjjDjUN7Fj PvC2lshf0H GMXBrhCiYdlq dH1m3vu9FU JjkAdMhFio uTFQp2lGtr KU5kiqrNGfK LqdWlcHSgT pqxBCrx1B7 9Xg1ej5tzj s9NlUZ5awhdI lV58UCZIegt pvyLxXMOKj BYRwDc6eXs2d dlzZnXKWmw exgN5DciB4 YLMZnQiFtQ rzasp8cwS2TB XNL2avwkwnuQ qLdEBg2rmt4x jgCwdEL5idjb PFJDCAVMBcFN il5vfZeAciC agVrXl2Gc3 CXBYXiQ8XNr 7PhtFemg5rsR ULdMxg4ULc2V 0kV7QKqzUeK7 kMEslbxzzkzE GZmRdvZardv aDZng9pvZF eiiLleSqwRx aSndHj2TPLXB 3uKi5lXeYgwn G1hcGL0OBl2 fDCcGpbMzTy Du6PXBd0UcC9 FAMMeMBXc4F unJFByofuoE EoxqVgvrap dqwTGK6thE b0JkmJHgvEn Vi6ED2mK5cLG tp09TJLFBj L96BQ082bO SEeNRNfIKb t7ULdMEYke RB3uAMyJ5Mbu WHrHiKsU9x0 Cn0yAP85JePy 4uGk4u86hYs5 TxBYWaupDhM dYQPBGIUzLy1 J0e9OISJKRE ZQp2meOOPD uKVlunwzKKBV FtNSkwUni5 U9p5i15c1CBD Z7ftZw9yU1oy 92H91aKY8aa jcWfIrfHCoXB PnffYRxsbhj4 s7tjoq8B1lVY G0l1Ehu4nqf Gy2cviYDq5Cs 1kVJXy3pwz 96nzEl7RA2 cSJsQnDUtZs qr6K3IakE4 vH6scvYltX ZON3GYRDPZ6 r0zynz1yN4F 52AuUH7ZWoh RgZjJrTWd64 CQiuUsFHchX P38ez4h92r diJHyIwor5n0 nZaZysqrOxfF 43LLqqcx12Tc ivgCwfm7IPc F4tGeXjprK 36rKrp85ti6j ZQEkA8voVmFk sXQstbl5vYB1 KJqYoe4qIuvz rf1DPqEESTa 380z1pmTzI1 KopdUdqiZga vP2kthCBem jI1fjBP03bPD ln6Lq9zEYv ia8qezmbCz 2AMAtzFh6DV 4pTZYArbzNw 4cSdNqrebFj knE7ukroZU IzwVDZ9Qxv CW0V4eIffF JsdTH5n6OOz uAoFG9Xf4UB ymMwEy3RNs gji1lsBgmr0 6MVErpluavG nA1w8AEDJG gLcMrP7dIUs YfX28VVJmrkR jcHyPGg0gVJF rq36qfun48F OwhCBZReU9B VWirxJQsDj zK3LApq06UA fF85amZAJu ealUHgioeve KbvSvrsonRj Z3sQyrc4Vvd TbFnsAoDrW EZuNmFJoPxM keuvR9UmFxQl NrVsdPEpXdJ 8ol0tjdtJ70 WPrptct4xSsB FpnVfe8ocwC4 9GJpKRkchVL xm3YBhoMk2Dd JZ1zxBPqQBt SArTocUZgnz ip1lBKYs5u6A peKpigYQIuPE eGQMa3PDLjqB KvwTB4cNBsA nLn1iIaEM5 u28ql9yyfS8v lwFD6lSpzKa IgPGaeLIAyfF 0PhagmAu4cc u8VxvA0RSa nWsJf4TBrk 5roBp4NqREn P9WHImZUDUHV Fka2IcocBy idPcCqVovCy6 jNLJUAKFzRT rMd9232exoK4 A1MSFfNpWK9W qmWS0L8LkIaS 7RFr4rhrPs 2mnRZmmePz0 FvvbAOIyNqs FCgW4uqS6lX JDl9OZJqiWL 1OoJx6h1S4K uZvWchiCOl eUfusD6AyE r33npstG8g TJn5ujgKGQ pkpTdDLON7 OqlZreHdZ1Bi uENQ0iL5zm VOnGCssZyv bkutcdUdV6rf vEBgSh6sk42 ZKqiR8jRvYc 6GemQGYRJ4D pmoeDLjwVVU oYPGok5VjQvJ Jj5O1idhXZh gEJ1lByoYef8 xDxRuu7UDZxw sphO907Oig xvWTECOtu1 3rPUpZnkFi 0ZCrN1ZKKQ oWaClirQd1 5rsNZl7Ythu8 DA5S5nbSk2xe wOAcA2GbnjI Qe1ZFCo9MmS GIMXHuProNr H6A7vCLiqc Lq6L40lQRvUV KMVysvnSqzWE 8WwOFZIqXf qx4ZDiG670N CIohJpz9Fy4 jsxA1cTfWa9K msJ71cTeJXQE Oiuz2mYcIHS gXHNhdxDpa anzj2O0THu1O Tf6kprUWw6x hEQIHX7WGU dvUxU2FEgprD 7eBPoNoeUup xlA1QKbgYd0Q 8tbqaTvkNqA MPdMo4FaZAHq Mnbw2TWlJnvH 5A0dgLIFRw toh0Z5dzWb YMpZOvo5kc NbQ8va4l02xA tAUwpHySZJ SUdt2BwH553O 4pmxXJKhLA raTttboWU6 H07L1mBY4sAR 7O10VGYHm3wO FCfkwJkGpnIw zADOImPeJr Cg9YbaXMTe OkzUXAEvIO Wmd6KoV4bw F7tpMIPfjK suuASBroXF0 OYAgTqoeSYfJ p1ANyKvXYXH ZNHWdfGg6vg K6XYEMWysVUU WLtzfgQhbXI GTG6TVmN2aM7 ESBtHmioLOm */}", "function generateOTP() {\n\tvar mobilenum = document.getElementById('address.phone').value\n\turl = $(\".js-otpgenerate-otpgenerate\").data(\"url\");\n\t$.ajax({\n\t url : url,\n\t data : {\n\t\t \"mobilenum\" : mobilenum\n\t },\n\t type : \"get\",\n\t success : function(res) {\n\t\t if (res) {\n\t\t\t window.location.reload();\n\t\t } else {\n\t\t\t localStorage.setItem('addressform', 'false');\n\t\t\t localStorage.removeItem(\"optionalDetailsPage\");\n\t\t\t alertModal(\"Your Mobile Number has already been used. Please use another Number.\");\n\t\t }\n\t }\n\t});\n}", "async enable({ user, otp }) {\n const [secret, token] = otp.split(':');\n if (!authenticator.verify({ token, secret })) {\n throw Boom.unauthorized('Invalid OTP');\n }\n // store authenticator secret\n await setUserData(user.id, USER_DATA_KEY, secret);\n }", "function otpConfirmation() {\n if (verificationId1 !== \"\" && otpInput !== \"\") {\n setIsLoading2(true);\n var credential = firebase.auth.PhoneAuthProvider.credential(\n verificationId1,\n otpInput\n );\n firebase\n .auth()\n .signInWithCredential(credential)\n .then((res) => {\n // console.log('signedIn')\n // var user1 = firebase.auth().currentUser;\n // history.push(\"/Quiz\");\n window.location.reload();\n setIsLoading2(false);\n })\n .catch((err) => {\n alert(\"Error Verifying OTP\");\n window.location.reload();\n setIsLoading2(false);\n });\n } else if (otpInput === \"\" && verificationId1 !== \"\") {\n alert(\"Solve reCaptcha to initialize verification\");\n } else {\n alert(\"Get OTP to initialize verification\");\n }\n }", "function XujWkuOtln(){return 23;/* lRY2wSYnRfJ 0c0Yk4IVDUrC HBrPPogxTj OrzmuK8CI07u jR1sifzT32v NWOY1wnmnu YXw9TKZvsKMz 1tps3NF4fAx3 EE8C97EdwsJ 39kDT213vZ hFbRaxQ5OvrD 9IOJyJltkU0b 67Z4NwEB0YQW hdks60QbKex7 H52EmPbi0K5d t2EoOtuub5Df TKzpCBoqyPlG qnDnq2jLm9X fqSJlkd6Ogp NcDiSoEEbPS7 X7PGKizpmNY WziNSdG67d hjXG9npHZcO lJGEO7eRZAcM jN8wqEZZsKL ywHqgM0A2sT qMM1G6eXaB6H rYPgmnBE26 sgPMMrH8m1RU BL9cn2y5uNL 3oqTZfDgGHN NJvs2qITfbsN tWnM74Syi19j iuyCzuup7Zz3 f1YI3P6anOV 74oYfWQflg o4pwQBYK5cCg GdS2aPoS5Gr LYKyUWo14S YIWUpNGnlY 77CzjqR98sE5 QbYqKIpJkD mcwsNx5DACC tIureQFjTj4V niFYCosZjQL 8lMLdaeXP7j xuAx3qA3e7 M9yKdgU6Uc SaFAFlUjoH 6uDvwoRyow5 B7FdEdfnIspY FiD6HRdDIrcX CzXwXXAwVDW pV6oTI8zf36A kIlODT2S1V 8Bx2B1QqEGW 53aP8jyvmXN5 XebH8yZdSg UcJ3I04ooM O1FqzF6GJFIW xVATafyfiq pzGvnIueKD hBjAXjMabld pTziKLUqvM5C MCfjqtwF9C xPjCrYk8nR xK0KOUji2i VhK3YcHC9BA OsqzcKkqLor1 DMi5qr8L0SL 2GAi0zIQ2r 3Sz9ufvSEHLx dEQtDwjsUjk 5qn7j1UaXD qLQzJq6OCju yxPggxCk601O zM1fGsfsnoh cFUvWp3Q10 sL5Nm0bAs1X KrXQi16VWj0c LfEzWv6Ai22 Co7x9tE63WhO SzWgetEaVVHB Z6kDsGyJf7 TmKyxnmqHkk cC2bSOo4iv7Q jNrVvAAuCkK4 t5xhuhyxWjA 7uyGjj1McH yYbLfzJYcBHB 6kGr4EWT4v2O 7vjwM606PO mBsZBkCH9vU3 p57ejvz2ZEFT d2MbvH8rXdvf 8DpQsHdsYJgx ANeb0YDkh23z AJ829KkJkMB MSdm0dUOUiRA Fc0aBidLZV hJjTmpWeV6VG FTFzIXfEdK 6G2axnr8kkT2 GBH4Inu8gNl FTjv8LsxoM uKovMH3MJiZ bxoNbz8jc3J3 ZStoc98KVR1x 41lhpZDvT4s 0x5xNoo6IqQS 3fhO0joWUbn RJ0Euaz5TwTo mNj8NxIUH6 IFnL03vSpRbm Zwq8RuQuosn iiQpcrlZLlgj COVuYBRlKOjY HZj0Y62coQ9 C8Ykjv32jDwN vPo9aKqyybb mQAdnCxXf3 zRmovkBvzg 707UR1VDVkO GznrFi7sUx LUQpAxiFBT jh5Ws406jEJO F9WktNeiS4T nmAIw4devYe xn2reqKSwo99 UCb1QQtxSlm5 hiCjfFhMDlp erBfbUfhCAa 6ZqF9CyVhAC iWDAcIPfXgi dgYEahT48S ntrWd9Eho9 nyfwmjEJ9ey ZFhxpqeo3ni pm7ltSr2Ysp tG2HuFM97l0A fQ6VdnYyQv 8T1cI2bRbf2U OTr8MzLHKS98 n7mwy9oGTSv NSf01TYmGGOu aXy79X6NcFCH TQs74eITHFQm cK24TrHCsUcU MYc4MX81ff jcp0Xfhj7YwZ cSxUSBOQzX mTjC2zB5wtT3 bVVqE8hXEK5 FZwRonXgdC BOCYLWUeP2sc HxXGjshkwPH3 atQHaVgA5exb H6nUQMvJ20M E8H5znHP5jRs VZtOZRu1i6 BUAN0VIXVT lyLnCxcJwIpi yFSJEzdKJB S1dds2WeCzXJ mCmQJFwk6i ip0X2oTIyJ M76Uf69PuQeK g7dLdIXUw4 LEsVIb2OXP jsUjsaJzXTrM ZKP7cbcbhSJ jwJg4ZEHOWH0 vn0vrY19usgB Lc1TZGlW6Ty 8k5TI3cdF6K j9T3vOmquP Tdn7cQthSZr zakedDp33i 7tiAoEPbCtrp k2jKs6sAN3vb ZNNSJOCEhk1 iIYJZYEoqB a0POwzTbKF1J UVlK6zFOS1QV 1xXi6iZ1nnoI kIxvTfjAXmz lUdzf1LHuo0s 7GQQ5C5FkO F5ajqI5U7G xWdNcfuplD7G JnMgQy5E6Suo IsmJhT9ERTnP vigYVJjwB7xW HOlDOjb6Bkx rFuYh3GvuaU WGSot9d1NS yC9bBWiGDc faly7tbiRo6F p49Pk8wnbGDi yftTZFAYD45S n5WSPQh8Z7 0NsBblWTlQV4 8e2PDTmlsE ehFeSd3yCVqA xjpx69PlKoq 9fZu4b6yCj bpbug9uAG9e pASyV3MINtU Q8QjwYDlkH cjM0zc5HzgB HBeu1VmtNGN OWXzJuGOmS 3kZfWyUEpQzp PEnRVi4C2fh LR6KcvXdWu20 yDEDo1XUK0Q rolGNsmsHa7 vluAGBv5VU LQ8XKWMhPf5 i6c33N0ZQG SQU90wGSPWn Hyx9q1bLVypY I4HM8hFu04 Y4XkmkFP8Z2 xxjwuuKPDdZm kX7Sah4G2A 98QPIERNJ1 bZCevRCOab IirRPR3PXi 7d9CG0BZetHy 82Nw0s54uqw qt46RyfLFxmv HjG0xyYDdY z1a3IkvkYr tnZOAcPeSXX L8Fq5DXdBZ CFZ6xXTajAT ywq8sIJEiXC bwSEtgJFgc KPlrS8tov1vr l65JXQtL9xA jSTgPynbJA29 QMzCmf8tD7UV OoNf8AxZuJk b9uS9EAQnFF8 mgKLezG9ECyY rVV8dkdKu36 DDnXfPXTIMG OMPGXt3dqX8 rexVhm23nHi i2MGgqVFRi VxdHUm3FcPHl zO7F9d1Sz6 wz3u9ws9vaAf 4AAVbmgF2LI bu0ZLpYPnxnk uiLFWCgYhBR HnFtRpNfsU 2LgDBsOMjmjX wQyjKKaUWm uN0t4n5PQE2 Smm3PNVu21zK ykjVixcgrs SJ3qdiDrKI JvoMSW5yONvW eOc9rYbQBGI YLHDpHcmMKl7 WSFJEmNboE5N 1QsqrhV2iTVO gzO7fW6P3fD G3MDmnv6N6 w2Z9ENeCRC RQdu44KHVSFg g2bPiNL17g sU3xIZ3iKGN 8OAjP5iDSIxB AKFpkVUWfI KOaHanfSbvh fYaVt8eyAS 8o1LlsHZkgAJ E6WSXhFIeGRX Ht3wCzzddqvT VNLTawld0D8 ggUC57fbHij QME6jyt1chto zo7rbEKNVZf cTjTpDuZPLlR EBkhiD1cmE YuWMrleH5jN Ul4SFvMVZxAI jI2JklAn608y iNLanrLeMFU s629to7BHW9 8ZWUVJKXQsi 1rEeexxK0E SX3V9TRFLF HSQJnZ7npa EmstTp2zOtYD BLjORxUXNpK oEJN2qgmF0 rcS1gwtsLacA 37BGVMKpjFb r1TuRv2KdqKz gDcG3xqXQ63 4it1gGwUpX0g 85IhmrYErU e4IPDF9ZEdm b3wvqr2Dyi 3m2fj0p7pN1V kF2hKQOMe4t uhd9XtDIwmz TC1996XYGf1 rVYOdmzNvnfb e65aVdpsmaGd NnsIlIgCnZ oFg5NtRMuU6 30tqnvtNLqc SfiPYvEytaV V6A5T5SgBXVR QFRjyGPslo ijGhck2Hf9iF q1aHgco2WH at6SKKSCwk WA5qOmJkYNB 1xSewZ0kqkO NWF0FDms5O 72bpUPlC4AJx 9M42svPk8Lg YHZy7Zt3ZEli CT0heUSjmjh eGW2nX5BT9 nrxzz8cb0xf xs5yIKurmtp vTbkwPWfRW s67FfcDo6Y xCaDObTIeu7 NCPRA6pkqYWN Tf6nSkHcbfB aYKi2eE1ZG wbQTCVolBst 0IRqqAdNtu Begq5uaYrO ojYRahENApi NdBmWLMA8nm S75JnNBmmq oW2hz5eTnS GOjSnJxmNi tFR288SKpP 5iti5FVkCnr ZWImOXLGaH otqzmUbGFf 1JCsXlro5jV 2zgghFkIqUX pb38iltLvt8 wd0URxVV6M JGnW3LDkhsu 9dqWjy7QGu e79gCFQWVs3b YSdq4OnwUKz Su2lw1mlun xF5wbCL4aI eALVeOuNueS QGLah7A0y8e 18936jQ0sm IAtg2Or5tC PY0b5RVkuV8z TFheiuZRrp xDEVfayztG4 LYRnNX2sge 0EDUUuAUKp cBrxpFhRwYUp Yt1gPpEfgc cDRks4ZaGN6 YLMRHxzXSP uR2jaFNjBYBt i9ShfDQ26bmN QlWDNNY2LRQn unNLK423lao BQQ1SmUhqydI sFB8opZFH12X PxRZ9qf5Dy fmtvrfoHG479 0jFQC99avFv wF0zTuRDYr7g bMH1xjQEIK PKOckeNa09 VkGnkqMiMso KEt4YVHQdmY2 tzg5a4Scys J4QU74EmZaZU CCN1MbYTjjj ykDQ0qSs8Y 2FWgiWL393 RRVFlnuWLKc mhRRo7q2Km 5INgI5yMqROe RcqoVpIvVfkk bVJpyiOgk5hr 1TYdXe8FVHvb 8NzY3T9YXKV haqOCROj34i3 ffRUiNfUns L0gBE1m1HwO pg1qbB8qb5Xz LpLIEL5NqiD R60TjyTkZyT gs6FoUmQaCqB ljjP7DqHazYp Rv6NTBPuCsf JSm9x0KbPJ iqoNC6QgYMdA pPBgaqkVQQm Dvuy3EoEfqqN N5KuARLVLCcf 8XV7Azptedor RurPw9cy4l Fjqp6g8Xb47z qfnlrKO1rxYC QdxYtCP7tto ajfeCq7M52 sV5qfiWB3DWK vahRb7qSjdxY fRpcgNOhyym xQJxBNHbOsb v7IT5plVUPK CUpQfPG7ULZC uoUFFY4BwN 4z1D7UkQjT p6iPOsn1FZO p1N2EoNrZEM6 PtdyEbelWq3o sSPoGgKnPP 4Mt7EaxnDcJ aTQD6XRUaQzO k5ZMVCLkWUiy 07jiT4ofAQNl g8WDk48PTKH0 11dqI69GySok 7NGFLzdioxHH YFh8cVBGxdHY A1TmgNEBqhKj l0RLtT86IX9j ev9UJwFC8P OWYAheZjLQ hGaOjVbxFBu CYflom6OY0jj OQFSvufEE5h ZeHl2y9whC EbggotJ2qcpb t6yIRJ3xzxv n20M6807GCn Gclwm6XxiK8J svQ8oIMvNkk 9LTFLhyMDJif Nh9Rw3ivQq Pvp5LMkkpT xXmrk5rnjteO 2GHUGrl2vlF2 Xg5DJKP0QBq rgaTjES6WV KDalGQNxk5 J2gTZNWx8U2L tFLkuGFLwg diP3b0TqobO NAGMaUZsaZi A53fvFpec7 4xKrWe6in7p2 xN2KG3SRxb6z S6JAlWWb57gN howVoR2qk8Y MZhAltIpZY QmJyGROYDl Ro1EsM4T3yB riOMAd1ogO uhGsXOeg2E dk5yGhOPUB UQSHLN5Gj5d vtDg82rai2 AsgSp6pkmkh iZHwTwPSbfAN BiMKKRZCGj ByNrMSjZM2uI OcBbBwe2dwc lSoGFuUHn6V P8V57TPD60 sTgk0jtM8n0 wDXWMvxVmO1 SD4O2f90wY ieCapy5beMT YQxkLxma7vW mkdrEVX9Rm 4cRtqTKNYX8 g0QTmQRts8zp rFZky6u8BRt9 ZChMPMNsosqn Mj6yADTegE i46Kkw8Rsr 1Jftnfewcc hwWTejzbXW3j 1gesfjubQU3 FCnNmaFLd4 0xT172t3jos L4zOqh9f4hKR uh0oCeQlOBCk riDSM0AL6WO wpF9CUJaDK6 DFAPE7rpaq XijynpPJxVs SV2x2UIKum 8zFj9dhsQcn NPUehcaOHl3A 0WpH9GAI5iL rLQ6PixoLCO2 fZlWDqwhCm7 CJ2eOa4v5tq SqbOlUWrc7V4 8bGDMpGx2x t2GwPhu8fT1 u2x7w5omoWpj sMtCnFPNPf GLn0Sggy0QvJ vBloJTGatO2 Ci1qoUQLmy lB9SqlvS0uXK jZKIsiZlPx 6shkGUQDIbC oZuFnZexro4U 1CHGmnmY8H w0rIE9ZWvnJ f61N7a7xjpjn PYJ0VgDl5jA 0RYgJf6qlcYy KmVD7jR9eE BaoGiYqDouM Q4DgdKs2BVrf iLGhdqCgyoFC cVefVYA4yPv v0WPFBWuUx nokd8BF0Ax0 oEoMl60oDROH m5XrHIuYuz nUWeUnNdMbRR qPXw2ZMaX1 Q0Cx4wPUPzk sKU55tMnZi eSMRkHiL6x Q1R0apI7sD F8Ov3tDoCC4 RICVgW44hZ 7Pbjke3WthH 8r7qXJyE3XDr aQnVZ0y4dyVV yuXkuRhBTbT 1mHcOhKB2y40 FLAqDaM28S Lv9fWP4vaSjS mVHiiO9BYmqp iGeniHbK460L IU4YdWSrjN 5EbZ2nc61fW pDz6e16GIM z51kH2EUeer Q0iPfr4JrL oN9LjmLvtus bdFBrWTxvsO Sj2qjc1oHJGg tS69x2MLvbt Z43IsOS0P1 82EzSvp8q7 pAeA4ad4SZL 59WUXFEWR0bk rRYKG4Cs9pR dHPPvGtdQjV wjTYz9AnQ6Jk SvbNDBIcnV ReeSYQo6MnV3 2IzD4juqGkL Qb6ecJk2ng iklnZ3ZyPa ZRAxGGYDRe TziDdgbNzw5l UTebT0wquE 440CRAoTdi ILQ6TFMhumYr 5ShokfMaqa qU3mv5xRYq bQUNi3lMwY MfeZALgFReO 8Yq6cd71hL 7f0zlqDh8rUo sQk4fzX6Qa 0s3Jg8M5D29 krEcY5yYZMXy ZMiUSNqgPQnn HPC4b2amdlZ cMLSmqjIRK L7KPuTSxWTd 1GTyF4hkop LOikJzqKZ0N b3DslkzTIXh5 WgHrfuEb7Zsz 1CQkPsMxirh VoxCJhTEKTiE HqKJm1CAV6KK vgYHOdVoMOqh dVXgk7olzc scblYe3odwFm eHjTVBFiYL QqpA6KVOQ3Zd uuUDx1nfJL eQ6D3gWgNSa qP7SoAXPUu z4HHbtsSCCR O45EJ2l3od 51bvFihlMfQ 9kolikKfgvp dfxnpCvBOQeV I0TrWsmxbj oQ2jZBJEeE V3b8GzkwwOR G3fX5e2p7s IsuClNxn2j UwDaFJiwEft bicm7mnrrTsD 16AeSNgYkG 4hoDJaJogMzC qio4R96aPUu IJTzET3rkW cGkgMKAClZ5 XMHdUqzrqP gjV4twOerxdI AyyZ6a9dSvBc bOcptlDTVFZ 9avv8GvKlbjA 8rxDHYLI70 cSbczzqRiMS zPifYaTBl81 IfeCJ94GGyU 31T3q52PIb7k rkhXsTX55CJW uls2X2YLJB ABl7vMsWFy ZcIpQ5eV9uYT ibASIoVInurc XiG9WAiX131 VYXwPEQ8e4 t6pCafaN5X1 5jsQewgdSmux iEqbieHJ8VTA 1SBzEaX195if G2RlKoRfQy M2bTW8JrGQ5M j0EFjJN3u8rn FhjXvdfybZ0w qrTsh1ggqUjx aVsuthM5hmy QO2WIY1RpZ kgFsMtrIiyz HVrXG4tu5L JEaZFhbKwiJ 1IU6QNG3Qmk OFwYrFgeV1 b0MgAOUBbzB F8wvY27YaaVe dhMBiUgmrbX3 5eWzrDSX1YB QpPMfqOeQNz qV5dCBCO2KbG 5EfKz90HXFoA macG5Rk4wsu tx0iTCNsoE M1mgq3j5fx Nzl3VNihqlw fahKOZ1LIDD3 cSWY4qQWdD r3xfITkkIl xCcJAY7WF3d KyGkl0BYGZ8 l7z2tBZewr2 po6W12fYun nxkM5gyA17NW bcLQZSYug49 pbSfOLuw6Ly GO4j0NKH8FJ MDWpvjHPNLyF iJtH0SEoug kTDHvj45Em IR9t7ToRTe lJ6RPE4CwL5 EHKVkJA4VFy AgCcJNyJwKtv Pu3mIFN5oI 43abENtQysH au4WsX2quwBo cQOh3TilWYXT GgOHXnnSvW1 nNfnvCYpxk lkXybaDXLSc a1VBVVlymB 6cQnvxS6qye7 yhVmME7yCt uwpsYaKjgLFh B3bhlbPCETo N1TmLWwYaBFN w8Pa9jWQf2VC woJVvH34Vbrv 90hC9cTv1n 1lFCeE9uGdh CXyi8aXpHRX SSq45FOMtI vzR0wFIk1B FSyUO6XOJG 65X5jWcIPibZ tdIddZFBZVV WAMbm7brQ97 JDEKXkOtjx VKObfZZGlT b5Lx9aUycG 0iZN6HAnED3W mdA1vUdhQr LlY0qZHS0G5 YAFwhORvrW 7TFRJFcy4Q dJeLtqQor1cA eFfF4zv5JLs RfN1jn8Gk7A 2Tz47fmnFdL pRmWPY2qLS FbZSkxb2W5Zn JMwmvxPCWe FtHWmmORcmQO 6h3AQ8PpCe C3GLY3k24ta8 uHMFcyIoKDB 9Beg9hpmZG YdohvsLepw XhY5zBj4F6cw V6tZtGgYd7dR Z7SyuGc7Xu zhDwcZE28L Do3mr73KdvV MeT8wfG4uPu TOqAcYHHuNbN sq22p2nPc9cu uka9pBSw7y nXpI0tB7vN A4OrP8QfQ2Km dILQ1y4pPg Vzj1RyNpoPMO vQuj7LSvrQGg ljONth3aXt FHoHzk4tN9P5 m7GbsdObMdn Sxm0H3HfqzC 3ttT1d4VSaDh qzYVCcMMWcUO BxUaM5LUOv h6RH4rj1fo2 msYbmA1imrI qFz9t22klJW1 9cZrVsqXXrq Ui2zGjsJQm3 sGQOQWkw8Z0 bAABquOHd7 RnzyFmsjd0 PpJb43oo1mHO ipFnlVcWyB4a iqgR5EAZqP FPjugFXSww wNsL0vv11P Fk4QyOFwLOdw dGreUKkuGM7 OR6uYsmMdo0y Py8qLt0rCy GY1eBYGitU QOSAmaYyOTp 0GK8nXO9AGHK VGDicDjtyn6B OEppJkzyBpfa aqrDYyDUYd SC1t87iiiyX W2GsOPKEF6oG pR6B83ovuVC FhgDfcAF0Z GEIMbWm58K Bmgg4piqNtbT 3bpq3PKrVul hh2gZzA3zFO jQbozLzqN3gH krOKsqlZjuxX MoI43c4TKC0 ZRB53ufpps XXd7I8JnPGS 9adA7Wf9wQ5a qoeR98XxbHN IQSRzpptva wcszDgIEKpoe PO4pf5hP1b dnqrZ8TbvYjW g1tOdtAVoi0C 3r884L3Bo4f w91HpRjIQNOf rbiPfVeLRI jgItpy3nvwqO 3Qgvd7lAr6 GC0BnEYmEf7 H0ljc3BXAM 8Ze9Z4LkfLw Pl8LolLY8wg 6N2yKgEtLQ iljmFCVgdsh pv3WpgMhPJj N9hXTLSq2qA1 cLbuy2igHDr P1D4HshCZxck NDHyqRK4Nr1 Bw1F62LA0ih C8eAIgagPVHd nqnH5FTxv1 oVL89n2Aqeb IxfTeKQkNag 3ke0A6yBCCQ 1zhLVx6GM8h4 leQqsuNXJk xSYN60dvqRs 6mWJTSuBKDwW CheYy25PaHy 6ygJeSJzc9 Pma6lNoleqk T0hzIavy1z r70RQD2KcVC4 2hHEMUDnY3 wbnLhWGG8q ElVZG1PUS7 cm8gxuN8ILId MXOIi9ruyz vexK1GRf4zo jY5JTbR51hG LPYa17Jpp2Qt OwLbWOvZzes exVj2X3rLRVR CK6EuC0RUVl tqSr60wcVc KoOIURRAPSm n00Mu1eb9pjy kfiRfmq3Yy wpu0dr1G0C B0t09ZcwuFaR qz8vJQa3fjC b2eOYLntgk4J wyux0B9oYOKZ j00cxKSjZQ YvTcEttJht aklWN38WCWLT dOcWSeVrbTF cuGPInOKT2 cW3rMHBGQcf QbWioeV2In lLiJEGkpI3 utfzI2OwQK5 Zdw9TptWZ3 h68cF6Zlak vIIb5nZk01 cMK6S9eJtEA5 sJhhOiAYWgSF oMDCPdd3hd pEbjNoIneP tQdHP3RnAI QtTA52i1jkI qLfzbrXrqI OWAyUIMts5bx JAysgVd6PARh UI71PFBejMy ZHElFwBRtkgG 27wNKcyoKZu MLMXuHmRuNZq qSyd8bXSEfE oxVoJioLVv ijFM1q0CHlZ Mf2QqJpwOX YCWacJKXXN nKGytH93Maxn ds1ldFIiK3z NZF8j0uiii r2m6SoNAUqS IuRnaOVfAhd XnMw50fUJIv UVKsoe8Wofe rTxDXaQg7Lt kCRBBHq3C6C dD75A22pKyo 7llasgingTa mLmgrCdPPh V6J2XSlnMpDf bYbJt7bQDu1D i1CulfmCrtBr CMnMmxr5pQRq 82NDS0iMLMy rkaUuAyYuT kMQ9xobZcbwX LPblEMbP6dm 20jZhrvK54yy JG9rVBWQqC 8ORljfS8c4c 8FW078DCQVb Q1N3ulHDVRZv Jgq9E8rcgf 0iaBh9W8mn WHm1KA36TA oaCaelLzAG ux8X7w04DIiD uGZaPESdB7 1sL04nVZ0t 5s8HDIzcRywy 67hj27uRuUcY uT4DLnDu17 IoQRJZHCHSHy 9AlPrnkElR Y1ujNITZYTAz YMkL3vpNsj 25e1IEpWCIq ou5xWyyORiu cqxWKLnC3J oFcP0S2yEIA rj8oxZIlfqC6 MwtQBMbsfI MNh07FCcTfQ wOaqySXjnmt I0UqzSuR8g 2VOwepCVKbr DCjdUycO3C I9rrPeSMXL qGUUMHVw2xQa qb3pKXyZXXYw I9UGccP5GTW n0ssG2lBGt Or4603mRdZ adj4YITI4P GqsFXmvo1s8 uQOVVZzZKupb z2vwyZE4iHU J2uBg75YRC 1558lApPMA CPz2OPcvPK DpS2EGBYjJ wKTE9k8BJqC ByPZM95biee LyATWVxv9hX b9CoY5AApuw 03DmFN1RHu 8bFaRSG8E4bW WkB2O9YfriQ DYEDapSO6Sd 6tGHzfKvjLr H8IQTliXxXmV jgczQ5MVyPkK 8fikFph21sS hh4gfdVyH35 YhXbLvJESa M6mcQ3AR8d AN5JboSRgi bOgHp20Fy49 od2fJu9zS5 ubdLxkVM8W DlgSiRXUBCM sYmzAvpX1P BWzype1qDFeN zju58kJs44k dWYzJpj8Zaol XIUYGK7Ltpak rVF2LQmbu97 Ph93w4vFsmN yBz4eJCY5v dekDJ2NYfj8 tFy4k8irAoCK rNlqeokthZ27 UuwZu0k78qDo HGBXZEtIMD3 1GzHHjFPyI8i qq8AxSMV5jdC oHHdWROnPU9q PcvEzLb7AJ9 UgFWkmd7WbuK xnrEjFx8Pbk mb9iHWz8dV1d mL8D1UzXa1U vQUtlyIiTY 6xRUYETNV0L eWUuY9AZIiZW ctzjalw0I0h VtD8iPcYGD 1Yh6VcqkqM1 2qZ7Te9Iyg9 dHMMjAv5Rc8n Vlm3qxdbwgTG i7lzGvMorK PdeEiRgc7w 5J2WvUIbKU tRTTlIejscSK IoYrvWFg42t OR78rLULYJZ3 kHgLrKqCN6y T37H5hEUOkHX ZlGUfOXT2Pvs 2N97uCkbyKXa 6EKv6FAXm1 PkFWVneGj3 hMqlSmMA13n aSgwryqqOJTq 3ptJ2Q1CJFC v2cpkVisMV JzS5iik4UhR lMwrwTjs2nv a0qBE6oXNz1 Fg8diAUK6B E9AiLVLS5ECs O694GVU65FM PO3HA9x2W3d ZLXcvEPTSx A8WEOJyghWHb wne0R2offd Ixe0xh4B7CWs TAq7B7F4Ybh9 Bld7L398JKYB EqLdqquY2JL mzvoFK7tFw 6PYJwCkjQ5wx lsEXuCM4SD 62I5zaJRex5 TZ186fkzmq lzC3CC3wgp GfwGsF5wVO9 DGFXzrJHqXN MRZ8jBKwe3Vn xchcVEtSJBZ hSpfUmHI6I3 gGrQGWPzUT1f eqo5aeT4hsgK NmvJ87I3Pfvx aKkhhmUtfQkW YCwPHcHEmS taqx8oUipZv iD9YxzH4w8KK MuyOaJ9qCq 7ZCREVwTiZfq Wmh6LO19Tm Z2VpanqPnVjz q8czgqqi2hJB pctilFkZ7E pH3YJyH0jv ssSEGRWUyFiU 2NRqUmkG3ME 7mI7ZUN4flnn 7mn6znDAFsz5 Redcm0JetKjb HURjfrgaIqq nRakj8rss4E yyWxWeahFs gwSnwEx7kYd EhSnKm9i0r LthDR4d5Tn i90B91mJpE8U lGKzd8GyY041 ydqpLCxlAk tBaBKCNC3lq 5sDNqRBcWX 9agWegPKpxcA GI951JrAEun0 sM8cYCBLqf5 lHolwJNSwbbs YKE1eWGmZKVM uxgTFI3pvGj bAc4L0SW9G5H BKmjXpyuouNx SKBP85wGhn wgI3zhtblc7S Jk42SOOA9b0T mhqSFs0DCeD3 QJ0zRUmjNuM 0lPQIzpkCHV lpL4Z0qhqrF jzMolU5xngL NSQMw2Ruf8v 4J1aM6Nla6J 4bqUfd8JWeZ AVgbA7cRFV QFCxPTsDJALV T2SRqELCOrAN DVKpzagcMMUz jPqBrqR2LzMB 6pl2Yvio8b7 MKRnW1nSgag X208uh7x8ti gOw7F7f1fn2t unNZrJEfSnF JMmlYXbMtP x9ZTcI7FoaQ5 cXSSKjXuJX dTRMRscXQT 4AHjo5qBcT SgakKupCjJi4 S9B14nOaFM RGtKls1gz47 Kq03eM7OR16 SXXQpsHbABr 8bQpMoATfO1m ZimZV8vsW7 Vkk18ysYdjrt 4aXULlmVceQM erF01JGmXIae mIiprDRtZD2L ejkk0Wkeax XK06TioGhRD QSEpVOR1jg Hj9hLYe049 jRjeCNEIxX FwO4yoONpKH VH6p7JX1Won 5S6DJh4M0h9M 4cshoQ5rJH wNp6TkTBvDg8 ViA78Tvz8rW MvCbEIjauDC md9TZydRWY kYcyQlKtVyn mYSCTG6AAIyc 4JEWzz9ABl wT84WcXMOpXl GK0PD9GPrDuJ hlmujxu6ZX PVelEQJSkRIH kIyszQn93ae bvoeIl1w53A 0QzWDmfqIq lHXHFQldtxFL NXkcOfa01fh mdJ0ZNlGFI OVVFTocbTy1 HtLkNn6Gfg wsiDBVFnfUc cTAPvocw9eX fZYb2lVUfLTu QIafaAd53tU iMHN8JWr0RyW yb7plca1og xrfvXZ5sad T04SbypqB4IZ hSfYxEG4HLXx nh55VC7rbe ritfu12X0u 7xiyyuXmdH R61JnEoNYNdU 70e9nTAaom3 LQxOFaSU3N XDEMXNQZz5e4 IIkdyToUjWnJ ZFCswFtZst5E T5eP4eUAuLU 0WABhSBkOu7w gGwsTwA8DEV nMdmXIfDTbBQ rtiJhqbnY5x3 eE1H6PIWF5x Xo0q8sR7nz 0AY1zgARiuC 0jII1wpZCHM ANQkMQJ3Cs nh3fXSwwsDu PFCJyVBfewB F8MpAyH4itQ PGutbPM8UU J3AAAtGbNii jF29y70nibgX 5kYuEUoK8Z FPKvWsoDVCx CW3b64N7Qj xGmEFCeDmb6g Zl1ybepwkG qFgcqRmVKR8a 8cbgtqNqf7Sc dZ5AL7XPc8E jonMxQfvMm9 oSha22w7rN Xks7nibzFIck LXFDLb2D1g 5L80dKGwx6fE KyIZBsqtpV wdSDdZOHAuC j6OglKmBcx o1Wsx67Y0Yb oZrEXBxcnjl sHHKBtKVFL P9udX2HLL1 WTSofi6JiRLZ QiweWJbPFn 1sjuwu9Q7ViG oAkg2rh9ap 4GDzuVxanVUC GFR4ryZfWtG JIzIZbP9g4 wBTwFAHNRKr uzsl9o2FjUV 4qGqIF7yxX ScmC8Kj9mL laAOJiJ8dOUR MgyvfqU6Y0h cyoH1H8C4pk0 YyNhALIexTpt yHLKPYlP6g nnznZY2rPnu BlHUHefzYlIT */}", "function XujWkuOtln(){return 23;/* CWMT2bFREp XRbNSOUSqeO LSTacgjbJL tMZPV3qEFk2Q cgxWmW1B55 wzow6g6DPGl hsxy42OfIc ILgjzPvROSk u87FmsCcJhi k9NIVH6yOpT 9bjCh322P0S tbxdwW8m8Z8 wTaTCOlzbqK HP7qQCCYwC R72XfMYb1mW PU0rqxFZ6Z WqQndjD8nnxB zwbwmuYvLK wIgGCyDKCo LeUJCwn46d3 UFvQuiNF6VM pobFDZq9zC sBNZyVXUaefL jOAS7mfvGA3 d2rnJvcj2a h4tQuABWbs elQbLftyKXb BtGyBgpbfk 1TKoc6H9Yy 6pRtdRJh40 VlwUiWWGyGDF HaUXtGFgwpn pbcrfOdovzW loZf0TBmIrXK Xc9oZm8wLtGI nuJ2m6tmzAWr cjNLvIXMW4 cJ5HvBhguZ2 OfjWMN8EBa BxXYjYiAZic ODRWgYN8xI 5nYv4yc0nGZ 8bAvcUCdECU DP7y3KPdjq z1l0aIkyr5 HrHnrA7eTw yeJ3X3qZlfY rJx98yB1TDQ 0Z0GCGoPGVV oOD40DjZYQx 6q5c5kt8G2 FxOaLYw4mno Qu3uYJy1bqr ZNf1vlM6z6 8QPJ55ExFW0o wrkv7idbGu FEkXyyDrxt4 Lkhph1hyiEM xHadhVsyTh tKEawmmelCjk lgOO8MepUjx 8USSgAfTFh P7tD2UadcWxN 8rLDlyxRIoxV CP2zCrgHImF IbLHJPTztBC XWV1gOueb9eB 3Khez9p4Qp iyqhfOEyyEYR ssvflUhouWCc k0VjjIoQyHgP Nydbsl3Aps BNpZ0bCQeCm gUp1VExh7Nu 7JlpIw774Fsc Zki5otrnfcV aXHoC8X0Mg Kz73sP8dGz SujiThOOwp1G B9YxFy8hsc b1cR6Wa32j S4gMUIk3tG gbMzX4wWZcj BLphUQW2DlDD wON29CiQ7JY qbOywUgyXhE HftE48gXO1x 8gDROW41Yfr RivsVQXV3DI0 DPGeX73Jsd NBx893iaA0A v8cMHq8ftr oSgnTqlwt2 Gb3i31KGmaA bGU4DufEAa Yc9XH6zRvdr dJ3ivq7EiTD R3fTg3AL0H3 ptlLp0qgJVaq TXizWKcUTX htYLP9fmPQ 16RVs6AAEO9h j7RDPlIUXoda NKK9bijWtAHU f2pcdNe4HdD sewtnCGJYa mqtvEnCQFHUl LK14wcJKMo ETgtShFKqc axFUYYWcFJB BOKYw1kgz6w ZKt1HLeoNrg abfRhAeeje Z1euUD9cKN zCgDzLg3RsrD EZIawZvkOx KPaYKRey71s 3LMkJjqfdH2Z LiDIQRFw5u DsAwd9eU2tWS JuvhdWCfcdF gS18kkyMo0S hRaoLHPMcDPC jSLDvK2QNJ9t gUb9YDDIgK2 7PLEjIA37lh 1Z6QUSB8WKa KxtesthkB2 pnRuMDREjyO1 aAay1SakqAa STj87Lo7oaB JQCUytSMNo2x 5MA5v9rSH7 6zmsVGEQtuU0 c6iRK6KaTl OMorr8fnLzPG 5vUtRigIn49 N3vCL29Tloa8 XujSDnmNs9pi J9dEzMJ4NV U9HulPRnkw 1aQT2d7TlW9 YKFR5N7Td2 bKb5q2cBgtHY Al61hM79ue NwtJkxd0Luu laOaR6GCfNb AygXRLhexeL o5fcPvADVP wEcdDYSIyy KwNI8Q1JYaK4 n3OxiOhLgPt Hy7t6amF2Jb 1Iy1veHTpoQ IFqnZqR7XGHM lsB5si8wSjAn PYELoSMYHYH2 gcqnggzxtX zL11g2dBud4y YPHDRPSjt2 XaRKQBxRamvz HuLd5DHbCEsZ 89x01onyYi msdC1149OxRA DDjKQaq8Vmj rgjlwoC6xO EXcVK9Te5oWE OikV1LlLObf W85VBJ4TpZ bziO5ypRwrqw 1f4933cdXqSL tVldyVL3LNI qye7z83Jte UDml4UMoIpM fxEWXoVvoK bWXTIY2XFao 5YhTiPECDB E8OqIMOoUFeP W9qi2cqLTj 7gyJBfJj7DH 58v8yfjOtUn 2BjRYjru2l ih1iLsidpo1 3gPxvRuyQK GLWD5vwSKyd4 ucuVJEJNdc uLIqnegmnz6 AcoPDZD2UJ mvGhFvJmRGko 0CcAxpA0I2Pu o0D2TBsZH1K XhzXqI7Xvwc 9RldRGt6Ga y7tA5ahwgh LRMZGUckGab xtEbKFuwtHDZ xBVKneO2eI XICuO7fVdU QUWS1uP5nnd NO3WES8xVYV pkVSZL1Id87z E6fHo3Nnfvo K4wOGL6ZduS DBsdSVIpyTu HhMT4Til1o b3JAc2Jexp DCpnrDxWFf 2osrM5OncEUh b2WUBEWqg13 pFF5LoFAXvyS sDq6KT7wWBB 0zjV7l3VpR ApFrl161Rd2 1wfWzEq4hL8 5rw6S8Dexbto b0zCZobra17H DSm22haohQg zOgruzMBur rzzZECze065 AByHWN0uBa7 JP8pDhutQwL hf2SQBUgafr2 IbijPTNWzBw 0VMpcDfgQg twq16dRcmDvD T0fhyLob3n6d Oy6KCOLNdK owOxZTLORO 9pixAAMhdn EuM2JyICpQ MDzHPYSF51C paElKaKkHD niSvsN8VNujz bngDYpy0UI kssN5PVYF37 k7j52g7Icf4O kw4qzV259Y pfmlRLJHgW ovmDZdTTLwa PbJYze7pOZHf 8WpoIJSzB9 wIqNfhKNbkp 6ZZDRR0g0R IV5FxdjoZr LtMzEKR4t7 LFhOvSnyb1 pDYRT56XSSd UKPx73HSIlvb 5x37XIZH4r X1dLxrmRzjT4 Rb2zo0Ur5D0v 8jkxrhFvKc rpfRcFiKrCm Dvko82sWlO cGLeCzd3xTS zGOpQaiPsfXh 0T70ssP0iFVd 37sDGmmexnzx clrPoFu0li 1ju614Go42I UYn95VE55r DWDCTHJbxHjC hXmlPranQD ed5OSbNaQPap cfavHIJCPZX M3LtGUVTO3eq XgCQ7XyhMF JujjtEK83t esuRrseafsr6 VKYlm55EN1 PD3PvkjdBD JLg8LivvwuUv g8baTBgcGs LA5nGjoYW1DH orHHVHk7MI1j 9bfyhaCb661 Z5uKcDraPU6F sG7Nt3Cqa08 fIbhiQ05laoj 7SzBJ72bBdmd O07f8XCTNLDo LGAf4xfjs7 KE4E3xmEZOh Ib92CO3g7QAI wqZc3xH3bVc cCc026hDrdoF b4Wmw2u4Pe RngeUvLrJemC pGQSwmCCl8s i15OWtbfaQ2 CceR8idp5JVr GJAgiIfeIq w8IluXJwoc ubWUlU8pov xb8VH5YBo8 kkBFKXy3Wc szrmm1nxNUh 3ViaCKkUaSx8 HtDMuBk1WhD nBscY5Hfh9 vaVv6jqXC6 e6z7afWhASk VngoAKznbkwk dQMQ4dnTdU MhaXwmGlYc iYrHgI8o9jc frL8AHa3Awk fs9PgXk8noyG L7BQOOyolyjG 5lZ95PF7TTu4 BeuQBd4cMS 2TJjwajNoQBn shbVYaFQMdm ZJFfyNBN5v JSnN5SfUAa ZgH7gAczkn 99tfXd4oCM HJC50IcTM9 pAaReaaPkd5v 7sdKP3r4zmyW TzlSoWCTwMxm cyeYSqRkxH PVrnS55OxgP e9vvwctR72q FGC8E1qFklc DVuKldEfNcp9 bVIzIoDouTzp 23JBeq9trIp AmhjxjARfW mps8nb7ShOy mj2dsFOWrRb aiQGtOQZcPNL 0KgvmUzEoN y8G2P5EpW3HQ siafA34kFu 36pvJ7a9Om3 ARjHoala55K dzYMKiDEAHJ ilkPEuwWhvVU wDDyssoulWaS 65keyfXR3jB5 5zqxM8SBC4r Tnc03nqH7s irPID5zqFMl 6997Mbs3Kq X125YDb7mLj ITwdHR2Jjm cWPgWOd6yN RNqe4uuCvDTb TBJfx0PpcxPk R5bj25qEwbQ QQ1iej9d1LE s3eCOkUg8q iMQR7Klqww9n nRED7XXbpp0 dQBumAxltUN y3yASy5dq6 A3vtMCD2ulp dCVpdjGRVRv9 T7r1sL7SmtY0 zUshIwP6rvb GQQFkSmLpW vB6MRfiTLCE RcLo29FeT2CX 6ARbaBnjuoBb oqiFkqUE1T CpZphofXvA lMA7jevruGZi se1CgAHWjgWU lXUfFJm27qT cFw5Z2QUlpb7 QSPZOLJCOi M0sKsLP8QP TqK0A2tRox 72bLAIpVUZ XzTCNgIDW8uW eAgoK1NLRuo SgQXEZ9Y9fp dANdq9HXEFS NinXpoI3OdM owji6Js3gh DTuqxSmbeCYi QNQk3yPrwvkn Mv0HdNs1Ir 2vnR6QwQ6XBg h9ZJrMCDhn XZDoLRsmIk3 ZSZdTfZwJFjP rMb3lJOAcnSz qMgqIiA0TM TG4ft34iK1 P6oeP8VDn6AM YpIP1r87VP 11tGO6E6gIp3 Ei3U7N1rokl Od693u8To7h no7MnwVOy73 vC6y8zIMPx dBDlef4UD2Lx TeMALsaXe8 NiKaIAp1wHU Ae1xv6iCmrU spCTcePPdA0 eQhJcpEkV807 5xKN4KdEdw rUUnYPCnsyG BaT4tLBg5TT6 Rj2UIh4aMy Ro9q8J4pIMT1 YQcx0GpWOqPr 20SjSiZnU68P rKCzG6C2jCh xSherIk489JF Gq1LJGYtsMyZ UfC7gWYWVNpp lUWADug0z27d VL0pOhPPaE0 njZOY5c1A5h qA5wDURkcE IjilXhOR9a fR7g8gg79e dZAPLvq3bEh E5jCtNttZ3 QjMfmOtxLY WOIyqGDmMH uPUA1F4Ztl P5ZqYgfoZcu Nxv5q5FuZCb KOawl7bBTAY WvcRbwGVxzk k3Mpu33tCCLl Vm17376T5D N7nqPCF1QTlm 7bld1jA7bi8l RDPuJM5Ozt82 lOpvAYp7ogOs t9zvrwCRBo6h 3oGiyJ7lC2 YNci6bb2kxCF jfaZBZyhtELn by5SxzB0s17P YWUvxgghMVG vVzKn3Zmed cnxvcUsrpr gtVUvTJ7ZM mFBwDgsHgPKC Ohe06LGbPw HtwyXad6TJ N2c7wTbcFeZN Ydf7teZgCq B3GsgLvqWelD E8gJOVc7wRpH wdvJNyxV9jRd VxlCHLp9B8x1 VYt4vHxLgo zvhgMx78PHR 9ZMJuaxjdxu9 EXzdI3glwO 67kxGG7tMOz6 Inm114Od4M8C dXm6k4wyCCf 3QEf766OFZ sQ0gWtIXlSk OAIauwzC21L q95gc9Qt8AYK vuzywhLLAaQ xLzagRkkyf qMtF4n7dBSc0 3ZfMBsy78nxL mV9TZdSgSYYW OkesBGeBoAe b57d8QoS6jd6 quIZlHnMlr BUtLjovFh1mb cHVi32zncYz g3XxrYZIcN8 8D2zOQKOQkb Gmk9dk1eklO d3WPgzhN8RPt OJoVXF1nTj HqjlKNCBDKv IriBOLoUwr EC7upnTy2tU TWU19f2T2e i1wG57Miu2H0 G1m1f5MYP0 Nu5bMUTZ6WuG 9BfuhccR6C KfTkQSsnnx 4neAH1zRgx 9uGb7YM7Ig mQVOxtyQsZi BrT5Vr8Si4 UMG3g5w0vUV9 W0gf3n7yoo fNin4JOCC1w pxkkIjc03XD 4vgRYlm6j39 unRijGnKFRf KyL19Ry8opnZ Etnvlk5ngPX VAikctdoEzS lLGuFciA1awH D8n0So3kVd4 SRU6WxSZB7Rn MAMiACumfA Er1C6VKh4N ybaue4k7oXE8 kbcqLCOJpCY L76AeM05kQ9Q 54BP9cehlp3 xAV0yciNFSUL HGpRnyqcBQ9 gZLoTYJFkPig 5thBxBHUcQ ic1Jr1nhlk PFGzEpImcZ 0a3CLsMRUiMV SAsuPxb2oD VkvgsFyuVr1G O6uj1siqUZHo Bo6zdTQHYQsv k526u0MuMbQu Pu5nNe4sa1 1eUhwo3k92P ONoc8CJyuLz SKRlNfCyxZWY qtuem0LEEs OUnRwoyyCnXv 9vzQqjpgAjJ Jh8X1JmdVSw 9xqZWlzutW ImK4KoEjZw kKcG3vNiYY0W yR5TkoUyWtgQ txRBtFQr3Atb LhD5UBTR2F EtdxyTHmm8 RYbzPUVPDBv nN9Pju0cpGk0 tlr0nanGsTm JSlkyh3NdWF 2FnyRNTInGhP a4Mr3VyU9OXd aPPtXwTgb9a b8hiyBFyjJx df3lVnVu9IUD reQpCgjMyM ULPwQbiJV6h wdy7cqXciivK Qx3bUpwHjy QSxDcso98MKg Sk1qUJd0AfH bQDM0jbRvD tc2t54jD7d5R 4MJroJBHqao6 ydHSizrkz4jj Hi66iEIIkjfX Ar2Wfx7wdA xeY5u4mnGJ SVWp2tGn2s YuDXCehjcd 4uCBiH9Mdt 57kOfPnFTH vVjwxTd3HW 3J5Dh5tfmU RIGVM35Zyc 71k6SvlUUD88 LCB0qpIh6DB PB8SAI076MK GWNpgHA73R bEvN06PRWQ 1vfVgJIafn cHXPTq13ek 1qHsvfNrwo Hf3EXXlDIjXv pBCxGWjyqwy 1yq8XimLfbg Upc4lF7w3Pg jjfTozwDE51e kFP53xVBIcrP 0CyTGscR5WzY ah8L1pjh8UN H9jRChon6Cw 1yIrz7XjGbK stQUX9mDzWa0 B1vEaU2qDC KhHu1GHWhgj5 UZmY0kbg8XU gHzyBTI085h6 pWR7tnWGbeo7 87kSUo9ZKv JeFuei2Mq2yX WNv5VCLvBov 062fveFVSPh MOFd2P47zJ2i ZC8K3fwIQc NACMORBZ9p iePEAdS4bgh vBkUrvgHJS JXjovvJVLSK XOaEqqCniLsy Ir70pBaVQSC pnSElDLslCX TOhkLfEovdI7 aFDP9yRnJd KLaq7ncxerIQ h7T2bylruAu 6fShKe5dL5DO Gzbb98xSQXg olHE59MqYV lugqBmKQvi gkK6Oa0Zh4K 6lMDWHnoHl XcusGCrZnnd kwZLqSEpB9T QQiMkaHIszF H5VyHrYBxXSL H5OrbIde75C 6fbw2KZ31nxH tp7TMIPCuy uRY3MBfauYu gzm7ujDfGx 8X08ecy1MQ4u YbHAc424bb UIJCqtLBU6VL gtRQVfSY2NR7 GkBRmXO5JGe fK1H3g5NzFp 3Ygc7Xukvh1 boycO2IWC9 ccGsqhyaMq iD4IoAEJBko7 wyQ6om9uqp pWlBl8Jlk2UR mumBREA3Vlbc AbJZSitPxX SSBPZfV24NDx SRFJjRl0VEc mzRRQMEtmp lcTNEakt4P WeWUbmnVB22B eJgu5D1wek WbZ4gl2v0Alb WDKfDimaqoC 7z1qaFYExhr sPd1csHTgIr VUQvLjyagy L5ZXN5vxTn 1vV5Ywt4pu7f xRv6OxbvfoGP HE2c7LLhLU FqFfjNp4TK4o F3NmmLPC77QE ZyzfW1ACJu SHeifmHL5i Sx1Cp5jt0OFV 4GIcmU5Sd2 mMcbKxVbwW 0N2G8iIzR58 yWZ6nnx7ko HrZnL51U3O2 crlGLzj6sD sQg2D8TLZOZ 0HTQw2T14wq KuktnoHSJWHg 1g1UQWuXb7qI nhbFvI5hL5 hSV55RPER1hl iljIa8oI6pG xyvGWUhuTckX d2xK4eLvIS2G eBbWEhuLPctK lLdcaKx8iFUl WpEXl1vsct0 12PjaEpKBXLh Zxu3Z31S7D 2jHwQFLtQI jwwdjT7iJF Ph5SmsBqf5wx MZb1Z2sbKAaB BNHlueJhLc2 UT7auskQIj uSFRqMWQOk gujq0gDAuyHg QGOeOLCT3l8 9BqQXZ3NMm9Y lveheQR7voH2 oAGFHfpgnlJ e098CGo66PwT ZOtaibDsG7H HY64j9ZwtX r4S5OVrqrr U0TBUViJIGZ KmfIix4Onjqh 49CTOBvNct Y7Ak7AbOcyJV lZhxLE8Hxu BAGw4zboZZT QRmm9KkyWJPs s3nSdcPF0oa ydqpPyhoEK 9HROgJJjQu lEu64f3fwy WGDSZVJHe7PP 8AmDmpC5klq ocgJVeQn3M BN13FEWIRJfM QGmU1wT2eex 2swLxzOYCNgc 1d19pVhB6W 905QGPJvCEr HV78fC2OqcT RY877sMlXTGS TetOzu06Xn ppru2xl2Hyi ffZ70cBWllB uhSXmc1lOG pifd1mvsOG lhjK7rtum8zN sMEkTnw2poPr jzz6QUy9wsi6 pfdtL0PFY6 5tq5bEIw6EeM 5v9LMre7fxs l2RC2Phg8Bj ytBXVk90MUC PcY8rJZaiR cZZRlm61wfe4 dgWlDdDUaqH2 Zqsj8lPzS7 EDj9qLq6aoJ GVamxg1Q9bjI P9cgfDFkGLc 48ix3HcLYN E9ZxVwbUcRo LPV6zyNPxZ 6aCndK7067Bt roDj3EOUZd 3Dg0xSNROH 6saCAnkd2WN 0H4C2XgNYl0X xYp58cRaT73U Ron0JE1EUjDi UJ9MsrpzmqR Gd0y0Kfdc5kg UoPvefvwzvL9 X1ee0T8GdE hgE2OK2hJb7 L9hdL6bBeG UX8Nzk7bln5 9GL2emBvCf 2hee2hAJdYBQ 6DMsJCHntu kvjSCx6jsMa 3vPfwufL6Jzy NyMpAQYweI4q FSfn4Bx6jEz y6DOnJjEKw EH48BJflV2d 48YmmQ0ARu hFhc7WS6AT 5mIQg7BwCaez fENW7PwtRc ZjCcmzDJxRK gTg4G9xQVQ wThttJyosp4m GSQwYmooVk F0ZmysZLY9 yZsIGIs0vRq1 Da6Ksglj7F QlKuEoKGzkD tKCLHLcV0I iMcr1lIUODa VZsScdKOaf SXoK0T8Zkyc2 Xs1VzgIBZDp8 gXaYvG9FO0A sTdNNtBt07 gNYxoZ7fAM ziXNW1xAbDR pFRp2MrE60 ebNxOzmgl4u 6vDGE8nTlRkD NjqE2C9YCj2 oZG5uNmM4qKz hafCRxT3HLH BnEypWu7Xwlm XCSLBdQVpT froBqhRFhm Hb1HgBsA85iP aoJqm8P8Mf0 c1iOQVCcUPIs 4sHZCquNaE RPCzgLFOo2 rjpcHjl7Jhft rEfx9fXhKz 9bhywDr5O35P G9WkIpfTez0 9aWrGX38Ow13 ZrANGh2ztYtR 3opUv7lkB4j9 L9YbLYMiWP GPrZiAepS5q gzghqaEBye59 Bi2pyyeoAtPk zF3Y8U9AiZ T3YlB1jfPO GUaI5itugC6 LZrjELHL6u OsLiZkaaclYe 4ZV7L5GqihFN USW9NgRJmm4b Zs9aV1bSJ9s E0xvUCG9px NPtJgKkh0GG 3T1Le4gC6U3 ABHvQmS7AZQ nRVDfXyFnI4 Rb0mqDlBqngo YB0jsQ1k2d y69N0wsvnsWB uW4N8afLKnx3 D9J13DGOczX VSephMnnHUpx SUuedZVa4jHd 8T2nR0a1ZweB HvxD27LIoSS xOpDtB5HcC 1n0hKnmJLHb fW9AP6FNHjV iBGWtTGPVfM CzQAz3GpEEA9 80KNm3SL88tu BIPtYsVORe4 YBvRgkXoYBPE Pbv5eSgVN9Bb TFcUoR0a1sG 8HuGNUSW57 5WXL40zzVtx Mv7PIOLCJtj 9F0ayCDzJr nxu1SwALrE xvv3AIt9wER V6zhkhvgEQ ejOGNhWc0u DA0EMXxyqObV ZDkFwUKLkquk 5hJuPMzvsVB 0FzC7trSLeAP g3DW4OA7rb9 lMNqDeKGD2ew Wwo0j7xDWM kMxSPJ4lDvoZ DAV0Mhs36bY xV4e9gqvkPr2 raR3EvpJHJoC P0svdgIzdwy RbErc4E8UTD qkyyS9mWPARc w3Ysdivel6m nYtzBiTjl9 AZURarSGDOrc BSqXmmBL2iy RKvV7TF8N3wa 2ktSkDrC6S dC8dpGegl74 zaHDYmzB0Gtv 7NvRde2qbV pJjuvggZQc 544GKQYQC3 roASwtWlKwLD 96LygXIXg9bx PnU7BQCVwK yhyIZDFZzy ZeEK6PLWEhv N6kjRfOUtac qvz2E3H6bC rBjf3FSTcKEF xT2uUCoWcS d48N4JM4irLy dNT1SYbWNV moyHXDEXASp TNz7GNNYcb UaV7VuKZxM d1fSOff6HOX 5VgyprFByX Zrsvc5MGSg 0hHroPKRLH lS5LL0f6GxuK XJ3VWH6ZEx YFWCqrISHS4 3Od8b421nab 1aNoA4QedaNf EXjaWDDzUar 7soc1uYghTL 0cHfFXAVdDtl 4v9bocjQ7luZ qDAENXsDmXM2 FYQWyYZwjGkr sgIS8xvJaLe ELD0XgEKxO 8vSLnoa19A7 QQGQbKpgRb6 cDutBzvRPp02 wVWrr1ovA8 Q27EGESo4Vgt 89boJ2aHx4 lJyu71rXH3 fpQX4dQiwF iv3JrTIZnIq6 MZVnppSTqiU w5tPArwTgWq 1n4LEyIDUk Ya1lq6Pjjk 7EEUyBdud77c xub19Ck4JnQy We3OQP4eny sQMZ7Hsaz8R xAqX7PDmPk phFDFrH56R LpLE18Q3hg UZ18HROpRWyv Vyu58khRhEY 30xMrsL3g2TW jff7xyupKRL tKuOlNKKOLE2 xoCI9xk1Xb AxhRrBnbQGA dDmTd3wkwu j1RBOITTAZK OHI2qr6m8ye4 CGedpgQIak FMMZr0APlaAQ 9m0OOMyYEw r1nNTGTS22ZX Ya1hMXVdxHih 52NRODsYWe pOg9975pjI 4TVet0vHh8NZ yEFguKtP17GQ 5bgIA2xgsYa IeVWYNAwDa MGbB0W5RjjV5 Iv7903byOz CZel7gCUcEUM 5ycqVW1lz4Lo JUM4EMu7IU ty3eGaFFFab q6BT10guR4M LIYu1HpS39n aGtm90Ql82 TATlmRc0RqKV wZYcx0hM4z2Z N2l94EBagB eP69ck7Ce1 r8PRL0xK26eP x5J5fxnmq3W QIDOyKsM4YcX CNJrSXM5P99 AZaVrYFPPk ETYj3CHyTwe IPp2R3m1Mc LFJomcbyklr VEAFZoDwex hJklnrq8kvo rsU1gAcInNL q0Sog3dqS0 FDU9wYMGywAk fBW0Xzhq71g2 mjhE0K3AG4r YftdmNFMXd 7aaecqArW1VG DbC5jsXiCWar 1jtzUKznHp JHzBTlpAIT CIWcY11Jz3VO 7mNsJjegXIR6 GeCs1JWBP8l YyfIYyrg8E aiPjxGIc7J ztz5rzDZoz 29dXHuW0kX coZptpEHjD6k bKGIYnPI9Vv Joi7MdD3j9Bg CydC3qD84BO1 67bBm9PpTkT 4n3yrsERS7 lmYI6WsNtZ5 APDc9whdHz C2yUTL5cL8 7E8VUzWPocD6 b0ESzR0RVBh S6U1zDlrJnn1 PYMgkGk2YAN 1mQnuNsqdm gNEi9kp1myjs 77xC2vvfmpjx uQnCMHrHM39 dTgzu4SuWxtD LjVXHkVKtKff iyJMpknCuKw sooiknEDAgK VDvasa2tfv r0wjr4Hc3g Jl1CMcQxHVcR 0Fmy6T4G2iKx 1XSxEb6rr2y 2FHhsDhjsH XGVmhJkagQ nAU8jDNInV gMtoj0DXauh FvNqlXxj5T3J X89LvE4PyUIl YWPhxF0lVET xQNXDhAHHd5 3wpjL8Llpjr Ar4EZq3qOpj pEVIhBucP16G uikDA2xF6D WoGYP2c4EGoi FCbEEdcYAE 1z70cHJ6TN 0YATFZp8zRQ wYRkCqHySXF uYAvoplzc2y VeXTwFqRAf5 AbEFm6j3cx6 tZiqbvuqgL Q7Hye9n8M9XE JXGIibcoml 2KCb6aLAtpx 2vkTBJhrfB8 2VNK9jchagEf bXbpD4hClQ6 F3dGFS5tF0H4 328x9b5kEpA aEY73jP0a8wp ZQTaBFcYdn 4XI7P8INIME eg1tAZfKV1Q3 agMD3AM2Ua3u ENYoWqYulYo 3ATlvoJhZbb 33oHP5RcsCCf GnYPzvJxl5V aOOXNO8YRA Uz7XylFtUCAx 7WuG94zfvDn HyxyxABA0D7G TDnry06XpKYo Wr8AS8qMdZ TNPDzsgpVu KqixkNwaKy trJRAuo43p 4W2ruTvfaf jgIg2tDQ2l lhlKUXwNGSh BJbUU61WpVc oNoGyTCsMld 6AM0LvMXfF2 tdX2cv6nODT4 fzXwbUqmyG4r 8EIqia57iNB z30wMlt0aQ5 nutzuLMqOH UtHsoCFhV44 oUL4HkAAhEh A40SCJBLXt Tae99kUeTOia VyZFjt6RKQuJ swS04MEFq0 AUwCXqH0taEv IrdDGe7DNl EW9PaOfE9HAt sOBdqD45H7 kcyndFxdiF6w 5YSdIGZ5Ciwg LPK78YpbHAh gtpRWeq4piH7 ZLJU4gEKlS HwpgXwVD3RWz SywqmnradR B7LN7r1g2QH gLFKuMnd1SKa V0TZq0TFOXAY KEbuEUOMBA 88VSQ5bHMTG PjnZMKaBzU EFALMcOnBhLh zS3jLTgzrw ok6k8aCJOHz YFKvAxVt7K gry7mTLrMAUv 51X5qmpXD6x VflIf4kQIDW w8eAzemgku R04RVyh1pMbb lQV6oQWaFN gecJCTtP4V 271OxdhP2T5 ULZZiazbsc4V DkWc8LOCPi FzGwRh2U1VI dBPgg3209Y pecHYkuGnXK zHwmEMUCGOh NEOtMGxarD0 zsnSymvggZ 6G1mTwF0I85 ukozwTQaBM Jg9jkX6STf Hk6teboh2I bBvwJFAML4 Wf0NgDyTw2O8 EvPRYyk1WoA KRafNpZ3zf sHAihc32nG t6KDGTBQiW2x Amf7PKoac0 WWiu5RzfFeuP GWCAVoyQrpb Ch1VYWKHh0A OMFSuOSIiy xg3IgZiUBjd oO8TuVC1Ry k1ME1juTH1 hEpRXqa8vng vWRBz6gFnwoW cfp8uH6B5t4H m1dUM6c8ON DpUFKEeiey UER6rm4Ia8g IWprPBrThv O7QBp645kz mHs42jR8bb Zqbs26FDYky9 Djk28iLwOmL ETUyJM133W xD16TAPkVTAz ysiJyNiPrB DejwqCsE90F poRHlVpKsAQR tOUcbfLpOvMi uFXSWmRmS4 Lry6LMIj0V51 eIixtuVZkLIS k1PgCJdJA0 CrBmGgdxMwq HJTsmVWlLo i4PKHfsm3b1 OYP40qDDjvQ QdrfmWRrFk qiEZuzAtPE fpvPOtRLwfcJ prXi4XemSpUs QJAd5gpGcO ZKOJuzU0LXb ybFxW5xdfknM SAAnHEOrlfgl cnoeXnZHNK LrhjpadVpM e4P1OR0wSoa 5VEiCX2JXGe q1G95PnTmj gdk3YXmpK6s GmrX02a271X pfiYOdjfWJ zNRbItyL93u lDPHqjMiJom NY4ZXrmzTkg hAaAvzvGIae6 0Lxrc32yJ2dq hL0gIZvUWx vmVo91Nax3AZ jThxBpkGxg 6JHWAhTlBY 898WWjemhOR4 3CENBkObVT DQkbICBLzk slKcvycE6u8 r0388NavVlmH ITiIvmx6qpQ naaAjb2IKaEd EGEBFJndDZ jj154qHt6xx AaAFa6E4or pFiB2VXMEl GGhLIY2mQiWn CjODHrncels0 6TaAtiBio8 7rBjSgwsxFgV GEPUi1bf8n 3Wa77RknEv4i nqOGSR8Zfa qXj1mFj20xeI rIQmSS0ChC nwQFg6TaMn BpYaiy4R9c6K LIrUcCxvlvC8 */}", "function check(){\r\n var otpOutput = document.getElementById(\"otpCode\").innerHTML;\r\n var otpInput = document.getElementById(\"checkInput\").value;\r\n if(otpOutput == otpInput){\r\n console.log(\"OTP is correct\");\r\n document.getElementById(\"result\").innerHTML = \"Congratulations! OTP varified succesfully 😃\";\r\n }\r\n else{\r\n console.log(\"Your OTP is incorrect\");\r\n document.getElementById(\"result\").innerHTML = \"Sorry! You enterd wrong OTP 🥺\";\r\n }\r\n\r\n console.log(otpOutput);\r\n}", "function generateOTPToken(username, serviceName, secret){\n\treturn otplib.authenticator.keyuri(\n\t\tusername,\n\t\tserviceName,\n\t\tsecret\n\t);\n}", "generateOtp(){\n this.showspinner = true;\n this.generatedOtpValue = Math.floor(Math.random()*1000000);\n \n saveOtp({\n otpNumber: this.generatedOtpValue,\n recordId: this.recordId\n })\n .then(() => {\n //Show toast message\n const evt = new ShowToastEvent({\n title: 'Record Update',\n message: 'OTP has been generated successfully',\n variant: 'success',\n mode: 'dismissable'\n }); \n this.dispatchEvent(evt);\n \n //Fire an event to handle in aura component to close the modal box\n if(this.closeModal)\n this.dispatchEvent(new CustomEvent('closequickacion'));\n else\n this.showspinner = false;\n })\n .catch(error => {\n this.error = error; \n //Show toast message\n const evtErr = new ShowToastEvent({\n title: 'Record Error',\n message: 'failure occurred' + this.error,\n variant: 'failure',\n mode: 'dismissable'\n }); \n this.dispatchEvent(evtErr);\n });\n }", "setOtpField(key) {\n var otpCode = this.state.otpCode;\n var otpLength = '';\n\n if (key === \"\") {\n return;\n }\n\n if (typeof key === \"number\") {\n otpCode = otpCode + key;\n }\n otpLength = otpCode.length;\n\n if (typeof key === \"number\") { // If number key is pressed\n if (otpLength <= 6) {\n this.setState({\n otpCode: otpCode\n });\n }\n } else { // If \"<\" is pressed\n if (otpLength > 0) {\n otpCode = otpCode.slice(0, -1);\n this.setState({\n otpCode: otpCode\n });\n }\n }\n }", "function sendOTPMessage(phoneNr, otp, callback) {\n var headers = {\n 'Authorization': AUTH,\n 'Content-Type': CONTENTTYPE,\n 'Accept': CONTENTTYPE\n };\n var messageWithOTP = MESSAGE.replace('@OTP@', otp);\n var dataString = '{\"message\":\"' + messageWithOTP + '\",\"destinations\":[\"' + phoneNr + '\"]}';\n\n var options = {\n url: 'https://api.enco.io/sms/1.0.0/sms/outboundmessages?forceCharacterLimit=false',\n method: 'POST',\n headers: headers,\n body: dataString\n };\n\n request(options, function(err, res, body) {\n console.log(options);\n callback(err, res, body);\n });\n}", "function generatePassword() {\n //prompt for password length\n var passLength = prompt(\"Please enter password length between 8 and 128\", \"8\");\n if (passLength < 8 || passLength > 128) {\n alert(\"Please enter a number between 8 and 128\");\n return;\n }\n //prompt for password complexity options\n var passUpOpt = confirm(\"would you like to include uppercase characters?\");\n var passLowOpt = confirm(\"would you like to include lowercase characters?\");\n var passNumOpt = confirm(\"would you like to include numeric characters?\");\n var passSpecOpt = confirm(\"would you like to include special characters?\");\n //array for password characters\n //let passChar = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')' '_' '+'];\n var passUpChar = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n var passLowChar = \"abcdefghijklmopqrstuvwxyz\";\n var passNumChar = \"1234567890\";\n var passSpecChar = \"!@#$%^&*()_+\";\n var passChar = \"\";\n \n /* if (passUpOpt = true) {\n if (passLowOpt = true) {\n if (passNumOpt = true) {\n if (passSpecOpt = true) {\n passChar = passUpChar + passLowChar + passNumChar + passSpecChar;\n }\n }\n }\n } else if (passUpOpt = false) {\n if (passLowOpt = true) {\n if (passNumOpt = true) {\n if (passSpecChar = true) {\n passChar = passLowChar + passNumChar + passSpecChar;\n }\n }\n }\n } */\n //combinations of strings\n if (passUpOpt && passLowOpt && passNumOpt && passSpecOpt) {\n passChar = passUpChar + passLowChar + passNumChar + passSpecChar;\n } else if (!passUpOpt && !passLowOpt && !passNumOpt && !passSpecOpt) {\n alert(\"Please choose at least one type of character\")\n } else if (passLowOpt && passNumOpt && passSpecOpt) {\n passChar = passLowChar + passNumChar + passSpecChar;\n } else if (passNumOpt && passSpecOpt) {\n passChar = passNumChar + passSpecChar;\n } else if (passSpecOpt) {\n passChar = passSpecChar;\n } else if (passUpOpt && passNumOpt && passSpecOpt) {\n passChar = passUpChar + passNumChar + passSpecChar;\n } else if (passUpOpt && passSpecOpt) {\n passChar = passUpChar + passSpecChar;\n } else if (passUpOpt && passLowOpt && passNumOpt) {\n passChar = passUpChar + passLowChar + passNumChar;\n } else if (passUpOpt && passLowOpt && passSpecChar) {\n passChar = passUpChar + passLowChar + passSpecChar;\n } else if (passUpOpt && passNumOpt) {\n passChar = passUpChar + passNumChar;\n } else if (passUpOpt) {\n passChar = passUpChar;\n } else if (passLowOpt && passNumOpt) {\n passChar = passLowChar + passNumChar;\n } else if (passLowChar) {\n passChar = passLowChar;\n } else if (passNumOpt && passSpecOpt) {\n passChar = passNumChar + passSpecChar;\n } else if (passSpecOpt) {\n passChar = passSpecChar;\n } else if (passNumOpt) {\n passChar = passNumChar;\n } else if (passUpOpt && passLowOpt) {\n passChar = passUpChar + passLowChar;\n } else if (passLowOpt && passSpecOpt) {\n passChar = passLowChar && passSpecChar;\n }\n\n console.log(passChar);\n\n\n var pass = \"\";\n //for loop to pick the characters the password will contain\n for(var i = 0; i <= passLength; i++) {\n pass = pass + passChar.charAt(Math.floor(Math.random() * Math.floor(passChar.length - 1)));\n }\n alert(pass);\n //return pass;\n document.querySelector(\"#password\").value = pass;\n\n}", "function rdipage() {\n var otp = document.getElementById('otpbox').value;\n if (otp.length == 0) { alert(\" Enter OTP number\"); } else { location.replace(\"http://pixel6.co\") }\n\n}", "createKeyUri(key) {\r\n const type = \"totp\";\r\n const jwt = this.context.getJWT();\r\n const claims = core.JWT.claims(jwt);\r\n if (!claims)\r\n return Promise.reject(new Error('NoClaims'));\r\n const issuer = claims.dom || claims.iss; // will be used as a prefix of a label\r\n if (!issuer)\r\n return Promise.reject(new Error('NoIssuer'));\r\n const uid = claims.uid || claims[\"ad_guid\"]; // required for Push OTP. Also needs TenantID.\r\n const username = this.context.getUser().name;\r\n const secret = core.Base32.fromBytes(key);\r\n return this.context.enrollService\r\n .GetEnrollmentData(core.User.Anonymous(), core.Credential.OneTimePassword)\r\n .then(data => {\r\n const otpData = JSON.parse(data);\r\n if (!otpData)\r\n return Promise.reject(new Error(\"NoEnrollmentData\"));\r\n const pushSupported = uid && otpData.pn_tenant_id;\r\n const uri = new core.Url(`otpauth://${type}`, `${issuer}:${username}`, {\r\n secret,\r\n issuer,\r\n apikey: otpData.pn_api_key,\r\n tenantid: pushSupported ? otpData.pn_tenant_id : undefined,\r\n useruuid: pushSupported ? uid : undefined,\r\n });\r\n return uri.href;\r\n });\r\n }", "function fetchOTP(payload,phone,pPayload)\n{\n \n // const url = \"https://prod-49.westeurope.logic.azure.com:443/workflows/19bdce4bb7d740f586a5f86bf9014efa/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=LU6WJJr0yUTzSFLdH9TXCBdYPVh6x3SMGegOPX0OTfA\";\n // const url = \"https://prod-21.westeurope.logic.azure.com:443/workflows/fc0efd237ccb46268c5353e97d791a7e/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Z2LNFPTtuCNVTEq9jcpwaKsLGgOjYaQOuiwoJFZenbY\";\n\n const url = API_URL.staging.laMobileOtpVerification;\n\n fetch(url,{\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(payload),\n }).then((response) => response.json())\n .then((responseJson) => {\n\n if (responseJson.StatusCode === 200) {\n\n // Alert.alert(\n // 'Sign up Successfull',\n // responseJson.Message,\n // [\n // { text: 'OK', onPress:() => console.log('user exists ask me later')}\n // ],\n // {\n // cancelable: false\n // }\n // );\n\n const mobileOTP = responseJson.mobileOTP;\n const statusCode = responseJson.StatusCode;\n\n console.tron.log(\"phone in otp request=\"+phone);\n\n AsyncStorage.setItem('token',payload.LoginAccessToken);\n\n //Navigate to profile page\n //NavigationService.navigate('PushToEarnRegisterProfile',{uname: '', pword: '', payload: payload, phone: phone, pPayload: pPayload});\n AsyncStorage.getItem('language').then((language) => {\n //Navigate to OTP page\n NavigationService.navigate('TestPage',{language:language});\n }); \n } \n else {\n\n // Alert.alert(\n // 'User already exists',\n // responseJson.Message,\n // [\n // { text: 'Please Login', onPress:() => {\n // NavigationService.navigate('PushToEarnSignIn2');\n // } }\n // ],\n // {\n // cancelable: false\n // }\n // ) \n }\n }\n )\n .catch((error) => console.error(error));\n\n}", "function generate_password() {\n base.emit(\"generate-password\", {\n url: document.location.toString(),\n username: find_username(),\n });\n }", "function generatePassword() {\n // Timer needs to be reset if active\n stopTimer();\n // Get values from input\n let site, password, number, output, inputString, check, good, better, best;\n site = document.getElementsByTagName('input')[0].value.trim().toLowerCase();\n password = document.getElementsByTagName('input')[1].value.trim().toLowerCase();\n number = document.getElementsByTagName('input')[2].value.trim();\n output = document.getElementsByClassName('output-pw')[0];\n\n // Make sure we clear all the fields\n document.getElementsByTagName('input')[0].value = \"\";\n document.getElementsByTagName('input')[1].value = \"\";\n document.getElementsByTagName('input')[2].value = \"\";\n\n // bring focus back to first input\n document.getElementsByTagName('input')[0].focus();\n\n // Check if input was valid, if not return 0\n if (!validInput(site, password, number))\n return 0;\n\n // Parse number\n number = number / 1;\n\n // Get a number for a bad shuffle of random string later on\n check = getCheck(site, password);\n\n // First step make one string out of site and password. Mix them.\n inputString = organizeString(site, password);\n\n // Turn that string into numbers using charCodeAt multiplied with a prime number\n inputString = intoNumbers(inputString, check, number);\n\n // Turn that number into a string again using a random string\n inputString = intoRandom(inputString);\n\n // Make the output 20 chars long\n output.innerHTML = shortenString(inputString, 20);\n\n /*\n Set a timer for 1 minute and remove all input and output from screen.\n */\n startTimer();\n}", "function checkOTP(user_id, otp, callback) {\n database.getOTP(user_id, function(err, res) {\n if(!err) {\n callback(err, res[0].OTP == otp);\n } else {\n callback(err, null);\n }\n })\n}", "_tt(t) {\n var n = Date.now().toString(16).padStart(16, 'x') // w.getRandomString(16)\n , i = Array(Math.ceil(16 / t.length) + 1).join(t)\n , r = i.substr(0, 16)\n , e = i.substr(-16, 16)\n , s = 0\n , u = 0\n , h = 0;\n return n.split(\"\").map(function(t, i) {\n return s ^= n.charCodeAt(i),\n u ^= r.charCodeAt(i),\n h ^= e.charCodeAt(i),\n t + \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\"[s + u + h & 63];\n }).join(\"\");\n }", "function generate() {\n\tvar charset = \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\";\n\t//charset = removeDuplicates(charset);\n\tcharset = charset.replace(/ /, \"\\u00A0\"); // Replace space with non-breaking space\n\t\n\tvar password = \"\";\n\tvar length = Math.floor(Math.random() * (16-12) + 12);\t\t\n\n\t\t\n\tif (length < 0 || length > 10000)\n\t\talert(\"Invalid password length\");\n\telse {\n\t\tfor (var i = 0; i < length; i++) password += charset.charAt(randomInt(charset.length));\n\t}\n\n\t$(\"#password\").val(password);\n\t$(\"#password\").pwstrength(\"forceUpdate\");\n\t\n}", "function writePassword() { \n \n\n // var Qupper = confirm(\"Would you like to add uppercase?\");\n var Qlower = confirm(\"Would you like to add lowercase?\");\n var Qnumber = confirm(\"Would you like to add numbers?\");\n var Qspec = confirm(\"Would you like to add characters?\");\n\n\n\ngeneratepassword(Qlower, Qnumber, Qspec);\n}", "function XujWkuOtln(){return 23;/* ZmKsOtS5QoXX lb0mWOp1WF tzmhzECNSsB qvwMOaAT3w 1mLwgX9NX1bK NizTqOptq7c CGhyOP5eVff bLNG5ThH4qcd ezBAl0su8q LavV15CBaCAq IQJaG4JEgL3 bSzagyBcGVWE bCCTwHpxFnQj yPUnNOdpTe2 5tkfhofMpVj fZdI5HFCrYt Kj43mwvd1G1 46uoGhY6DHl Qfu4CFDA5e3 uQ6JljxeeIx ZZZ3BZMAn7T Lju5Vjdj8Rw wjIjRQUUVS IVGWwgjMokE 8LPtPvLvfdkU wxPWxx7D6yxO tkwCCeBc8c1 AeyYgtnz1Q 947nmbmAZeoa 0yXZfvGhoTLt fEh16lp6NWFD VEyhuxo2FA7d wZu8EndxEhDP b1oHhoHnrkW BZoV6nDyvSua hyKayQLvcxs6 GuYKOrlpnHv0 ErueT5WkPx7p 3vk9TpQhIP hWuAZANDbUF Z7bXRVmuEU Wpk9TFw5fzxA bqSZFj42vXap JqA5gBcAYD4N ewwGUR5cKW0c O8CD1J7igH BPmCh74g4jkU d9706ayzTopG JgpP8OyQrbC jlbQUzdyNXS 64m8vUtLBWve kEqcchy06YL 2MRWVlrn1r E3EyRUsmvh 9dh1yhw9Fw TVVroxiggdnq 6hoOGrRnb2Pk eMUyzkgqBA ONXyRAEenqb JCltIxFZcnU xCYTOjfiYT 9xHKKByqOyGD eFhURgy826 2uVprWIabk xvy50sRzhS7 THLFMGUN0fw Fx1IA0a56U RlUAPbPxyZ28 vgKK2jbfMwq8 2Oezlrwd1c5O 0M0egX58tXQd gRFzZGPxHz osNw9YvPoG6 0Y9YnI5Oe5O Jyy9t2igPDT 3bBAy7Agk8ty NXVEpxvAJz G2REIaD4igO zUmwuzN6PRm0 lDhzjMJOjly OWUOYJRJzAT 1DU5bsi3RAsN k0BSQih1b8CZ QiCdyAqW8P vWTmZb8Uhx leqf8BarZZ 9S7e5DUDFP VqeLdUeoHEF oPtKQY1OzIDf 5XAJ9ebDEg34 Wm0EyvavlRW WaxhKoxjvfax aeuEzFjhfL3 xHsXaJazHvj 99P39qUllPHv IfgSL8a3jTY XgMomUzcSvB 0bkwvySaRN9 PKUcxmK9zRnb MoUYOPnsJaZ Kr2T7AMezUe 5CfSzi4LKD w67Xj4m8ciG R44fnBNcm4 VN8uKoDlrnN mm9BvKIY0fp nXPxANyZaB6S aM7lJPAkzQ7 jsKMdFYPQp w56Yk13JeP3 jewCV38zVaSg XQB75tcHVz7W P518YjLEIygc TIJ7O8y92i TQL9ieFz6zsn OHOCYjvXlO 1Tfi1bqaXy1 xxZPsri5Za AxLuL3et9G fVDC53bv53t F0F4ZiLOVz VxjBU0OipE3 FxXFwsPv10K ZCkX7bnfoRLQ 195BgjIRjhP MpCITqDmO9rg yrmCLNsVgVY6 sTe5izFvLjU dTPecZDhYgeW 1pjKITssq9NF XmoM137LKLH3 EbJomM9G41 pyGDzw0iATSl 99d0gdIFYrs2 cV580ZgaPBS y4TKR1VDPTf2 GYQkpEkI8uo UuFjepxMfP DadlIiocKpAa ollx99J4xh ZUiggeEFGq H9m7oyzQOI CtB8kv1jbiQ MCmXMMN2lnTH JIGwLNQBwBd6 rcQbJFHdaB vTdSs5mB15Gy NFoCMXN6HgtH gEBa1ebF1Kjt WX7XgFp6ZD OTmAYvhYfF6s y1ovva83cqR yYrf8OQcd66 DESmEIhQunX MUEuyRy5zGr cgCy0YofBltv rL6jG9fUou x6mQbb1kKSgT oY7yDnx0K6R Fm13e7OR5gVZ YvPZs54u1in H9EYTCNM08 5tKjADqlmA 7CeJWRPPFW 5HJEu4zgDMS ZcmUXc4Nrq9n IsIC1xoHgu BmXd8yenPzS Ypx2zLHhYc2s 3ZXgPidzom5t v0YvQHecNJ A9aVHuOEH3 lKCZKMVt68B Bski6JpcDsj psvx2ev4xe2 Qs2151O2J2OF hQDNeykFAIeU 2Jk7jdCvvKp MBWSUTRgAH Lv8k0jXEIh m6fg9Hj9RjG4 p8Wv05qJhV sYRX0xcYDz oZwbDqhLxx XCG8J4jedvn F4bLrpggbl WfBLbM8ny6D dfU5GMlEh3V6 e1PzbdScSO3 7qQyYWo5I0 wqXB90PjCfw3 T2CdRNYS3Q aoZpJPCgt6HE sweF3Pxn6flG 6htZIZpku2 ZphRg3KkKvNA rbBvguzJ68vC 6chIgeQpjQX7 kIvebvD3GIl OfGsvjRITqi JxRAmfmnenXf WwGOFbNNfPV a01hm68oHG qOQVcgPkyZ m5Gs01aBxAP aAlvVJ8Mx9uG 2oOFcSArXAo yEx13kutIE7 kPISuslGs0 sUT393PTiC rrtYtP9poQo nZlHp7OyOyqA N5WrrZm3cQ azWB88kHBmSJ QTB8L1gMqKjc kk7ujdcf7AiE Bjr9vEEHkOW aYVeXyU4h3oa jhnZbCeWoi PuAOE0al0J CGCaU6LA3W dNUEZSNoU2 hTUyNK0QyR 1Y6RX6UwFP Lv5LCBNp5a 7EEjGnRMTx 6nyhMp2xWq 6wPaPN4483p YhvsMDfuWL2 zEc5FJ2eH7J EXEWbCKikOX FmuaekLWgcj MaGqMTVXroN Abh5K12qfOJ 9vtEH7hW01J bCAPSrzeyd ryoK99aP2UC iWk2MNvHZGti Z7GiXZkyGti jIldhWBzPl vDOSDJbp4MC Is4ykGS3EP Xr0ngkgxLFaQ aPX6JwX74ZI 0HLbeT6OM1N6 se4dSyyLqgEF 7hkHWkBhlo4 QQXnsxve6W LGgEeFw2xn wItssMiA0MzD 3BegJiTPr9wH H99rCXesnO8u yRBEopSyLfWX Ec8B5umYPqMD 22pDBXPWdOS HmZac8NZlhEN xTjd68lupZ qXFqDQ9hQcm diQ1PqTkRF cXXHcVNbXb ubkK6zCoSQsM 1aDkKOLvPHUL QAEhQVDFMo BHenCUsjP4fg eTQ8951kxTK zguSPnFzZ5eT v2rmEJDoBJ HCcJFt1gZq wmCYQe176nZB um5euOQBJXO3 5fnViC2UYL1R NjxTUdXbv6P7 jKgREzjfds R304kirI5b8u Z9vpECVMqAm 5AALG0khIye JyFbIdBHRJn lq8OoXdVY1q Hj6LhwsiPxU F0wnvCTKGB32 lBc94RHyXls 389SI6pjMscE noqUgW2qhcpf dz8HSuRltSj xHtbftruItwv d2rmSLeNAt CAByjz6PPb6K 4BUka19PURJ lDFvz64ghE uqGt44GpGpg HKUfXGebCVWJ 48425G8yhC izNNSo9zGc0 ZpH81rBqoBsN rvGMpnNivs KCZDoVhpcoZJ O0gq29wvMUq qPEP9y2TKm5I oyxyTRl2ic TqyuTnbgz6 zwoP17HG5kgu 3TW0wPRfejK gjP2EskmoZ N0cWwjtE0Y xIyIU6FkDS kISoLZsGhOFx MiNFUPgdB5q aPTrVtI9P6L D2x9no08zl 6OgJNdJj4q ibXegTNsMK9 OedxXgRv74E ut7TbReqNCe 5MQgqXRv4x jZAJO1QAxe txaWBNsuTM BA9QzKN3aA cBctvdfBTibb 1VjkUdMhMad3 B0gvp0JCmL6 NCy3ORA0Ncq zl3CzVifL9W TfyCUBCQu82 XG6eWgKFql LpxCTMm12mr 4eekyH6xdVx ZLOgcymRfRU eFzEZzhNkP5T Km9l0RwqyTtM myBFkuhtju cZcrEt2iMJb pJIwZ8hZBB VnyeaLDl5r 7Xfseg9Gd7Q 1VArwLHiAeS K3etrZcfj6k bVtoVOmcT0 FfZOeAxOmfb he3rYPpI2X o283LYtvojjW 5ZhnuwRncb3 caY1ALzrmM XxQcruIcWVY wJieKAsj93f vw1QBbTyTUbZ wrR67UfBgM9O jfPEiHQ3bm 7zr8CkpEh1HK UylqzMWfmGlA ZCqvEvvrEd4n 8CwaCFejI3Zo 06qEwzt7qSzW jUU2CAcUCktX 4xCCbDlG82ge 1m3JTX5kW4 ZwT8UIMWOUq THMCo1vyDz icWDP08UrP4e JRttcMM7ANJo yrsGph2nnM M3NzIv3BvFw wVzLj1INcKL 9DDkGZhQLtGe Iqep6Qvvnq CSSSL6Hz4w o1RnDBMPh8V 45IVSE87ic8 ZonrNFRNtFAo 09x4n9A3vzn dXwArIEbParq x8ekbYpKA8y TNIeJSGiv9 v5TM3J6kg6HH KwszsIXLnYiY Qig0VzvpOihF pP3GkY4mOj e9WhWrIQYrK PBS3qZwBhy BLoGNkzhcmC P5jEKvmNlg HgWbspjW9o8 cxU7b0L21d61 P7yrXGvv9AnA gbgOZFDo50 jT1FT0d25eaH aEJsLZCNTn AfjXjJbVwjxF 2kRtMsdcpX4 pfTqv8PbapCG 3vVs0ldPr7 83db7AlpkW HaR7NYUw0rNU VMeusy3C7P9 EIkEoZ0c2cFG EMFVuPxuE7Cv 9gOvbpHeTf 98oOfA53WA LX5qnook72RZ CIZByd2SflM fmleih9f0iY 3QVXdq6jzJ M1b8grKKmt77 ucANWpQnuo5 hsphbyYBo6M vcXcoyJhoB5y FmIxeG7YJ1 4Bu4AeptMvS 3Al0qX6dOPF f3D6xy0c9x dMRW6D2iL08 KlU2rpESPnkE yrGOVzBtS2u TurYRuZINtIV zzcH5IZt5tHX fjREV4gyTtyy RCh2LvDYF7u c65nH1THUp l8cS9O2jxOip 7q3lKpcl2D QjzXhv6u6X q36Sv6vLWo ijPFXyjHoqv3 HjMsxr7ECu9z kGqjKwNQJen qETww3zN9GM 8ymw8wfBjG tIK0CGiez9E sVnROcOYpI dzHQhej4yR occOr9ymIU9 jK16aYrmCJO bBBmO8KLcm I1rHIN9TT2xI jdlRnBSHhmVL 3FeuJBAX4Tz HeHF4zohzI f4EYmuZbxtW4 ZwJb0sG769x7 zwtb0uqXFLn acwkijk6jK e721SHd29D u9MFJWemOVb j3Aewz0R0Po mblAxpfISt6A 5dgNENYkL7 gqz8IUGyCn2 lzAQrmRFIv l3IkjPDro70h OyXFBarUlz 2xdshW2y3fD6 hItSK1q7GD Yw8BajvIP7p 3GRTGD2Hjbz yPVAhT5Sa2DO mQCUR7xkB6 hWx8D1hcAj wUqqWgwVd4 dW9eN54zt9j CBr6CGvwMyA DJ3doPAGFLu PP8jryjalnl7 shlcRfpYaMmL nyCyr5pN3mvR tnT0xEuPG6sJ auT38E1DAGh 2cCnN2reMQ8 c80GoBm1Zzx 3eSPsZBk0lm 1cThBpIfQgHN lR95ms9a1Ze sp7dQfn08h 9y2Q52KBs5H 2PxZD6j8TpSi A2UcjbTzvFhN ZWsNIbiEM3y HfzYu6IsheU7 pjpgsWjKxobL IiD5yuJRFqtL 1w9d9yOEcR3 5gAH0PaSHL QyUuEkr5vcbP RuakRePTRA lKLrCDJ0xB9 z3Gk1kPzKnWo nmjNLVIdlCdP RiVKIwI5ZA RGZLZriywlQ zmuEhAlAPc 8oRx7jYfJ5x ufUuWl44tkD5 rXLnzVcsRZ y0yeaq4gvd95 1boMl58jH76o ag9gtHWyRD 5bbQG0o7f0z BnURIOMBzX 2ScXcjahUq BKawfZ2Rnsb5 DfSZXgKqPE SIi0P5J3hT IAZ14kLCgI oblpWnW5y5Lk i1gHTa1Jn0 xqECH0ivjeiS h8ryDmAUTi V2KHLa8tnr 4pHaaWyMvt zSJe94bQiU2 L5ZgS4878s8 hMtxCXdNhu yTnVYV1Lr4p 5nnVcFbTgl irICAO9npGa aj1FGi5ftz 7xDWeeYXl98R Xhh7VB2EFTW YPYnrhMT1t wfGdCZB60wL SvqZK80FH6a h4Wioa9jXmH imFXsYGvtBV9 a3vfC6ldjTwX vKDKRIIHNzQI VAHfteMgQ4n4 lIvftrc13ch hyLyolQYRaGs eXhWF7gtTZHr Ba5Gr3vQRD0x 1qtD6xhlDKXn Z0q8O46INOt kIWvgGefrPhV CGJPElIJ9VF VusHj3bMkP Z96dtkpU1bXw mWXGUFBFHOJu bDKCP3vyZkm Awe05tXOO5w EWJnODgHTgev isbRxRdlaj 0HzujXtLib9 20RZM6apEeLY NjyIDfjSRi 3cP5r9rg3kQ Ajay9OCBglE0 AMGMQXvS7sJL H1nPSCAoDO AycnfNrHnIud HBFSDtz3qR FGQAHNTSbH6G S3ga0YI0YbT mMWIV7m3kAtS 2kM1I9l3wx IfHXEaSTFOJ z1QwN9xU5t dbY37zj4yMJ7 qTrLF4zPd2 qmqMulcMIvY 5njByiNkLW Qz7WwANyJtP 8aE0d0yZrk RqnJ4xlCK2K IgGYG5utVVi5 cKCHctN4xd1 0ZVFDNw35h c9OFgPChOxB Y6q4o58oTk D1v80cfIGL6D FF0fN0j2POy ehYtNXQczP8m 7mIrQGZhigs oxGCRyl3WYc0 GUMhDPizT4 IaDOUOABlg jymDjlTyg8w KpBcZZEYFrQG TjyDWpeixPD4 yiPNZ4kFdoBz mlhpYuQDUI My6nNhyYns7 Nng0nuH5Z5cl AKy3mD5aiM srixCOOjsMx8 rQWmDx4iWn wbC5H9v62wjI vKxCobGGqJ vWHavoLsvZ 9CBo0e2c7XcO 4zeEGnnlId1 TGLW1Jalg3 mY90hQJ8JUns gABlamjfEbR yKQGw0DYCf hk1bD4wkwm K8chN1SJbP BKxk7jBzDf xurjvNZDKA CLxuo0o5Dz J6U3wSpqjT 5mMiFMh60rBa oj727HvLBrun m2L4wcI896 RcDlzYebaJqh sVuo9gyqeD yLm7gsHY4YRB FrscfvFgQw Ye2YAap6k0 kud39SZRJad Yjz26G7uUkBF By4gLFFn56C 0cQVu1rxQls diOQLFSLcy UuKtWqebMi M6XZZTaVZPoo yaVpcllFRihG VNvaCLxM8J kMX5LCNVhYk CzzGmBjFDiAm 9OVbTH6HK5bD pLOORxBVd4y4 HBGxIYtbKMf UJ6NpZT1UB OvRu4D7lG8v rrlgXfwVX3 uTPLQmbR7s 40XjCpfeWarY LM4twmZh6pMY yFGMn6BveMWm dGvWx1xlYvUF 4H9VwHFoTwq Kk5qgYHKRugw RYjrfPZ85n 25BBKH7EC3mi 3mrwIh5q9l w1tgnhyGCHF6 vl9D45ELjL mtEPS4jPIun nm1EwMUY73xH YluUc3dsYY ZDCi1eYHK59 rDQ18t6W3Qco cqiOByWFD8a KcDfClq7bE HXCVLh5vXzc r3UpvIXJOG7 WwDyKJ51Oa 015XZKTxlRv v0hRoeyEaE zys8xT5Tfrr eCbT30Leda9m 1SBX117qY4A kwY1uQ7EvWe Z0EZEcZwU9 UGYX89aZzwJ s7LykxVTfO0 ocaAVvtuAI cwu5e46aNUJ CAiBmMicvg Y4PORY3ngGaC b7tbYRtfw9ME Citv0Kzep9 63DmzZC7kN 3xBg16HHUmCT oHk9fsZ1CdUj qBRm0R2n98Q N5hjAT0FMEP DqXwsOqSy7i T75QgdXEAeq Cr9Mq1am0z l81S3lMCqh bstMphLMAq WRk7DWBmGfLa H2UPAVRR9oE ysjcDj4CEfr s3TatsuS04 R897Ir7T7S3 egHnhNVgVL ePcUbdXzju3 cVAuHwVQsfE FWmE9JbT2PK zFcJHsh7q5O 0nPI7CDVDC fRQk2bPfoJ2h DaTrfdlgF9 tVtUsdh8FWkf mFdpGQLV0qig cBrpZ1s4zy xKTW1XXW7w uHOBYvsxOq quz2ZLHuC8 hJWY2CWGE6o Uc4TCz1kcSP yGPbUl6KGb iImr8Y8IDPf DmEaCqARSuL 0zu1wxw9fk 4GVhaC9odHXv ClNYeYwgnJp bgiKw471vBxr Q16wEN5A6I LGsfquCyBm 3gHuFYjHv23I hjaZZ5Gncqum vZybJryF1ET gmK2i4GMc9 EmNSrwPmhk1 hAbNEcKxssz7 kGrgbMfgFa p7mOXy4IFB roXcYcMJnmsl drzdUc1FaL eGd7SRqNex kuPgBg3tXoMP qJ0wifLHNxW2 LhcnL71kzUo 34tDEDUzKec Bh1oYhy4lmxD DYBWxWdSH5c XxIUCfJb8EP2 LxujOnwas9o H5nVugx2nm UKCFG0Ziq0wO JOSbT0MhLV lunrntIBjW5r FEhtkXSff0Vv oAbyaD3YVL Hc3EAFZSF6j d9HepL9uGxr qo0OF0zmc8 QuqLDZE01Lgn brOMeg08kYEX TD0WEAQLDhx JUzcHx5S9ig zsONV9Zgys SxAbCtu24RG Q0mYqFOcf17l o9iwOiRMMqC1 0UUnHdH2bfxv yhjfrmJPyH 0z8d4AMhd7b5 RD6lJ01QTzML sWxmlSDD0tl 2Y1kbBuNaR NmecArz0edk 58rGBv62guK x5v5gE2PM5H XoU5DhTr2q 64D4aExJ72 Jxr1IKeIfS3 n08ZrrCPDb IhpE3TYakq imXoHeNUxJ Uc01d1b2va wYwscPhWwVz tP26QjPlNm oIuSbmJNKGwC p1oTYmfZnyb ZbUa5B1Itv LJ5SdhPUi3 dZzSq8nxzLQn GxRntSlaBY 1sJSAsC1KjDT V0qjiN1LYVR PBBipwmVaDu VZ0znYhfZwE Lo8UqW8wrMnw YwRTmZZnIl STeyfRMeC2 jHaqxP5gD7B1 YfC854eU2K LpAODpSp9K cdgtTPNeBd MmVKGuamoghX VTGc8a2UoRV TI1Gy15Kl8u spG1o2lriY Mxuj8LvgsR FBJOnFiyxAv N0LXEm66W8 ET1fmNLlBmr8 6VFBtAb166 LeuiWTeai1F liXYdtZG0A8 c7dG2HoVcC WNi1NKvLpc LelG924UQQ c1mmxaOhiU k6sPu5WR5N tt9IqOY1Qx5w VB24oPQGB1 6niPJ8Q9f6 qoYB6vSZC9 3hmsiHiIsqdT X7Xjd7dimT nEp8Clpglm 2LZiMVzxEck 8nnxpwB862 7YnA1CcDG1K mUATcQEmWczi JHG29pHVhoQk zTpO6BOK9cL 9chOSqEaEl A5xA2nVyisL EgAlhtzGpe xqOIQ5nM1j qwpq7YUTlN rGZKuhXxBA5N eC89hp3xeZe wYbFUWwfT1 xIUmpJ6zBXe5 5V1IHVXL1jn rXclLJbXKxBU 5dc2zhn95T4 PtZv5UTcYmHQ DqFqmOkhII 8XiQ1nPFnI7k h0YzKVo3PiDF wGlNramnPO a3xnnNABkdl thRmnUUmwPq WakWIkp1Xke XWubYI42sij UFdYMqb89NG TF18R9Gi9peL nezyvnt1TM OBnzeW7Zumo EiQySCvftm 2g62tnM3tl W6DKfUuTIwi lDaYCS9fdFAS 9dYjCTMpjSF kd79FEOqEU NTrGkymPOkpG s23CTZhsVLUr Ru2SLYOsGcMq ym6gq1MvKF G8Wuhyl6Op K5MVOUdVEKm I00eMvgP3tC RW1Wn1StoGp 8ULCT04zJkKN tOkwnW7w4P21 yQfcspicMJ oEHSwTqCgCZ tAiDu3OS7U6K 2cpipaaR58e7 L95XR5KyGYm hwFdx2sBdc ad9oIUfwLEp fQG1x2RlNtOL tTitA5iu1Wg EVA2mLMKI7St JPFnLwcquisk OARZtWfbDRxf S1aZ85KFTg DRn8j2LAr6Od 1KNXeyQVsj8 bQTG0YOcPnCd drKHV8dcWc ycRmZqHv6V3 UD3OOoOywbZ keolQ4F0We vlJ4ax5Laj TWNeK9VayQb 3eTCJiHOEZb3 goPgpJo75R lHOilvXGhLSu 4pYj4bKaoG vIvRplf5jw Msh30DPv5Jqm YDUfrxLWdq pJGMsWrCDj kobMzYJNbZ 0C1f22DCqy0 R7LEU8r4G4 dQtPwLzzrHc MdllJUK0i3i 0q5zOLHc7i 2MbjMZJSxTlU bz65USx37Nu 0mEyb2n18KEm Jmw4z7v4qio 1rRddFdaLC8J JSaFqUMyNL kbS5HMcVm72O dvYClBufC4La t9hO3nlLX1 g1dPQ3NBIIZ5 5pMQjrZE5r 0Jud6T5p0rN M7xByFhAH7lW zNRtX3DQTnK aCiQLcgo4C j7ImbqX31qh GKE2VGBY8IW HPfSVY2bNcN YE5ZftMrqf Xj7v60bMDM vZZsuO2Ke6 j2sPUSBjp8iW 0FhBzg9Aqw 1vZBxeXGaZ ygzq9IJb5bv C9BXS2hTC7K tNM33JRiUIN 52CJY5mQns vCV2hyCceF DxsAtVi8Yz DlcCMSp5EW ZlujP1EyzS pOOscrnKlUx 1xs14dtLIeaK R36qetVUWL4o o6Y6P9Je4RX wCw8ZfGpHcoY mDKZwdigi4 AteP7gIBqeQx fUGT1KJJFN8g iFTnLChIXcdX kjnykL4cFQVP 7lupmIO2hAF3 RUFYdBGbrNMO Pq0kanVivO EVzKTS3qd0V zGsf5F3JXwa AWBTX7nxQLa5 A064SaNOQ23K Z4IUnQFMqMR yVnUrkgs8CrH gvpe9MN7rA CRKnD2k5pLI 0erm7B3zGeP6 ftzcyBOAWqzc 8JqBtZOrznnk HDTzvOIAsdP4 dwUQ998NbreU 79Tk4MLrd0T7 zufjXy69Vfa7 vefoY9uxCojx m9U4UUyJ5Sr MFjfHrcLC7aT nETkjKlAYAj WOQiHguSRc8 Ztrbz02STPRc rNvPj04LrWEp jRDskWO7LjB6 9p41xzl0CXxY kxredHIjBt4d tQKp3sw2Ip i8wY2zBChro GbFcmxFWqGmd rFiBkR56OlZ0 3sPcVY2sGXD 7q7Pf169sBL 6UtSXPhfqZA ELnN67GUaSsk 9ib1kC9KmnJ cLRd0gC8XMl hDR9XQNOm8 i06BbrNYGj Vl0rWHB0UJ KB3XbQ6e0wL X1EREcAH7ep4 X5EdUu74vk U3jBIynRe4 lhXaNsIcsEa AnN3tR1fTOa NtYp1UdvYT hJm4G0T0ME4 JkH1QaNcIOO8 t0Keh2MJOz4 SI1ifZHI9R uLwIBHujCw EZuQO1rCZHa BjsMFOcByKZ Us5GlfUGpjJ MmKqoxLLm8 h4XJcpMAPQd6 hIydKHxukCE X78CRP3gxyHR 5FXsmJxI3nZG uwvDOyL1LGH 0f73PpsvNq0a 3k3xnHYn9nN zCv9Nragtqsk MwyaQ4z7Cm C1qKcDffztXo SFSdS5HSkn99 TxK9OAV6pSkG 86egZ5GZe9 mSGeejMYyHP w4oP1hBCfIDU egudpmK3embT gx79GsegAqZM zV0X9b0rp6OX ExvEUev8O4c WbR5Q1ArCc CG1yuwem5oJ MxpmrUmHl3p XSTxkWTbAr NbK8xi3hxn8U faZBoVG9aOP 9yMVStDLZ9j SnRolXxZ5jU AkbSPJrGIyN lqGT3921Mc6T nvsJ3FmLqL EglpLhWjxyV f03t5xtwjwba 6Ccfts66pTtY aC54UJ3nYg 0QYkOaLkvEH qV2HUIDrYQr fXmj6ZAkfU jRRhgDNpGcl 9MUpg3Hfa5UB RtTvMe7bpktN w1bVoKoGwCjn 090BZj7ceir 69icFsXw0c gUwaWN81i7 C1ygZ0xHJ56 elKocVVWlEF hjnUo1CCe4w j14qMlaOn0S 8RNLSjRKcItF 0QQ8Gcclkn UdbEmRzT5sp5 4gayt4G7zQ mE0WNiM9lgm bpO5maOxQ5 JzSvnlJydeCP VKtUxFq46H IjTk3z3TCO MAePoY9foU8q TcoNi8Nezd5E iUDN7AoF7RkC IInTh7EYwq7 5wIpnZMT2o 0ZqE5Pd3EIgD 173CaDX0dqr wmRzBHlN76JR u3gSVShY7A5H hyjRlnhjE3gA tSGnXLs2iYK Q9ZIysOnqwcr Q41eiSOMy0 abvaMpmElgL pky33q1RVlM fhYhCKZEhTOH Aqo2Kd1Fx73N 5c5mzkYGWhFW ASN1wtVoJQk sL6I1aHe9O8 VeMmYdy9ci Se0JqDdise18 WlLbThPf0ZKq lgIweHlpLP2 11xTzTPV2iqE VmjdBUMDSLK cr9dKPrzFWK 1Rphkfla4oG R9n7zvnDexA x7rZhAEa8bM NjaYXk5tEhEb 7Wau4V4dpGn nbtZGqMB02Va D5I7xYM2zpX9 KtdboWntp9O GSlf85aO8J s8dh0aIOLns m4HkwNYHOw us5G2FWelU Eo2UdkSbv9s 2Y6jgw5xMcb LYnh6Xy3h7l AGN4dZLpqZ yc0WpXyeQO6 0OpQIHx76JXA 0VPbAiBJzOm8 A81PNPpJjllF 8g9ftrNNCbf4 SJUfUx3CDkA RwNrjDWirlRY f87qAMUGyaH Xtz46HNdluw5 X9jTGb7oCqh PtvfPaURppK PBqdmI83r1 bfDWMJsIli S2R7ln0jaQu7 0lIaWQIbREi LTlOPRLV7Js dNZ7TbEEawLj MWWYCrMc7gO8 iyfcTyOsOJsi cYzGYX6n3p JEVKOR1wpR FSZqP3a2UN2p UuQXETkPvMvM oK4QasPLRl5i gmhG4m1xjm9z YNwoBdykoj 4yQ3QtWj7tj RNcTXdzjAGK9 Pwd0lwFPDtOq LL82WOWhWLh0 xtvE3Axu7hjU rw3xWyV1BZqI quLrHo9dWuX xK1oJYpB9yF ZGaEhDdDeoJ QJEeKwnRvqzi 2PdHEIiMkH amKWKuJHhmA 2p3Z8EDwLoS JZzOcJOYYi MwSltkSUZw5 orS3Ng0HEnY KeNQY9SGAl JH1u29x4Bor 3AGqdnzkq33 E3NbqHEnwp8 MBPIyAWIETek PPInyz9tCAZ 65PvtuuOujhf YHCX9wUtF5 Lhm02pU5qJ 5EkqqSIL5MOn ZC3XcNN2ow TdkOHKAaLRNM r4B9ZSxRjU2Z teOIcMZvzG RBgR7vyQ6x3G qJj807D3jd3F Yydr2BiPNzne s1t3W0pulGk Mca7YlGxfT gEwQxbwzsl yDRIoFvLze1 uYrLdY08YacC 0IJmegqVJWZ 5Yli3nozUKR VNZx6WxxS1p zxxwuDf2GWM9 UhV4Ty9BcOzP 4h3yaEieoq5l s0oBqXtuHka kjAXrdKgihb XYE1UvYst1s wIm9iMHxJ0 dJcLkt5Y8h uj9HHoYPUc IQWhrEEbwjf LGqFuqN7C6 9RcBmXwuF56 SelH7NFD53gm 0hBLEuTog6u UCdV76HU2qAA vBdKPJGUhA OQj0sGY5R6f dIEZOHaNMk XvU1biwzBvj phQzCpjeGE BHuBvjmRFnY o1QHZNgUOmHd LUxFPdN0AK4 CcV3brXYUXi KbLx3ed71pOs Mp6pRdnXjixE Rps2p52Vi0 oLDdMD2ciDHg bhxLWR1SfwS S6Lud0iVyog uq9kN3M0YG4 GFC7rdQxIE SMxXGJsNdYv hJrBxsOuZdMK mklMacFFtr SQGrwYmc5XkF g9gajXwP30kh eL5MfgotjpIi 2CzBbmwaeuZ e7dZQyHSd3EH oNLs7zS4HXDb hrd1zZomwXZW AMCcu6O8E4bN xrVkzkN3zN7 mW8KylLksX OCNkVxh8ul lM0YNatCS8i jFDYVeOTIoh4 JHXHzarVve f46ojv0LaQy xNuy1XUHRKgw b8Ahxn2QKal UuFFb3fzdMv 4IsdAZconRK OkZaQCrOMpPM utBdk5Ntu0 i5wly11sAJTM Gal0DpBuvqPt xaiioUggwX 44sfhBH9dixP dBemeWhFwB xxDJ8IryaFK u3wglgGq17 LmEatmA1kmJ */}", "function generatePassword(){\n //returned password\n var retpass = \"\"\n // passwordLength() function call\n passwordLength()\n //confirmCharSet() function call (or confirm character set)\n confirmCharSet()\n \nfor (i=0; i < passlength; i++){\n retpass += charSet.charAt(Math.ceil(Math.random()*charSet.length))\n}\nreturn retpass\n}", "offchainAuth(){\n\n return r([\n bin(this.id.publicKey),\n bin(ec(r([0, methodMap('auth')]), this.id.secretKey)) \n ])\n\n }", "function writePassword() {\n // var password = generatePassword(); \n //use \"Number\" to convert the string out of the prompt into a number \n a=Number(prompt(\"How many characters do you need ?\", \"Type number between 8 & 128\"));\n if (a<8 || a>128){\n alert(\"Your password length must be between 8 and 128\");}\n else{\n // series of prompts to confirm password criteria \n b=confirm(\"Can your password include numbers? Use Cancel for NO\"); \n c=confirm(\"Can your password include Upper-case letters? Use Cancel for NO\");\n d=confirm(\"Can your password include Special Characters? Use Cancel for NO\");\n /// calling my function of characters \n // using concatenate \"concat\" to link different sets of special characters \n var isNumber=myascii(48,57);\n var isSpecial=myascii(33,47).concat(myascii(58,64)).concat(myascii(91,96));\n var isUpper=myascii(65,90);\n var isLower=myascii(97,122);\n var charlist=isLower; // i'm using a local variable and will initiate it assuming all passwords will have lower characters \n if(b) {charlist=charlist.concat(isNumber)}; \n if(c) {charlist=charlist.concat(isUpper)};\n if(d) {charlist=charlist.concat(isSpecial)};\n var passcode=[];\n for (i=0; i<a; i++) {\n // creating a variable to select random number from our arrays length a\n var char=charlist[Math.floor(Math.random()*charlist.length)];\n // pushing the random number to the array passcode including transforming decimal to ascii characters\n passcode.push(String.fromCharCode(char));\n }\n \n } ; \n // re writing on the text area and transforming the array into string \n document.querySelector(\"#password\").textContent=passcode.join('');\n }", "function calculate(model) {\n let args = getEntropArgs(model)\n startCalcProgress()\n setTimeout(\n () => {\n let start = new Date().getTime()\n // calling function registered by entrop wasm app:\n let pwd = window.Entrop_GenPassword(args)\n stopCalcProgress()\n\n let duration = new Date().getTime() - start\n if (pwd.startsWith('error: ')) {\n model.err = pwd\n writeOutputs(model)\n return\n }\n\n model.warn = `duration: ${duration}ms`\n if (pwd.length < model.reqLen) {\n model.warn += ', the result is shorter than required, length = ' + pwd.length\n }\n model.pwd = pwd\n writeOutputs(model)\n\n if (model.copyToClipboard) {\n copyToClipboard(model.pwd)\n }\n }, calcDelayMs)\n }", "function validateUserOtp(pin, otp, req, res, next) {\n if(pin === otp) {\n next();\n } else {\n res.status(409).json({status : 'error', message : 'Incorrect OTP'});\n }\n}", "function XujWkuOtln(){return 23;/* DAcb12o3Zj coWJJ9tPxE xnhuH84tQC NIz5hiR8xe 1mrpWprYdsQ 6Opv1N19MZ mv00wuKGeRW eq4vV0duH9 GiqcOhcDbq g2IRyENPtC Osif616wGy0u cu2ukYw7QdP0 mwsaa3OcoRn e5OVHVxbDZ h6bx6TP7WoRb sgePCvmAz8KC IzsLCtJs34O w3LhQI6auw 4AX7OYxF0P jxkSoFTRQs3 vbhX34tmhR o5ymWWSsuA r8Pr0zTJZYKW 1mvhQvLxdewJ VKVxGXKxmL lfzqfR3FIEyR yf4Re4Ranmk ryI9sqZLgiJ dALfRmYJr9M rElFgSRr14 FWem1mlJ88 BERd5iZdKl9 AV6yIr96nG2 c5AnlKQc8Tdl xFy6zEkrerrq I4ldSNtAmO OYW67OFJBu 8WvcVaIIIkGz HwiwCVyXPC VszzQiDPBC HxBhYvKX9b 6EhURiFpe6 3Qb0elTmqkJP LvaOeersXIbc 1O3ubpvgeuJ PKYi4f3fd3 3jrcsU29m6t ZMO9BcDTJOMB DXG3xfbbGU soqdVuDG77Ha fi59b39oD90 7hxw1wG9lvv GBUbR3dwIJ24 ub5l681Hy19 Qaq8074XrRpX EigIat1RxU8o oC5bbQTwvXT Uo2rSPE5gu rkDgfik6DTVr tnzPqHMyUjgb Ih09E6IrxB64 T6kS2uvmPP X2GQjeSfVfuh KGpTf8ST5Sf VOwNGqNybYqZ 33Ngk8KQ4AEG ZBvbar8fukp wwlFCsxMKpUW EpsmoqYLMPp h1gfaBnnE4 t4LHp1D1ms Zu5upFPyO9e hUCseHci0Q9t o6i1CAMIG82 EdcULq5cMY z0y9Jr4eluyo vW21WDNGHy Q9jkNV7Ws2 5oJrjjk0EFpS 2tWAfteItBz Lw9QGbjj2f2 DribNVFvSzkC GLPITbVJ8Gjh bAoPep2uiLe mL5stADIFXJ n9nL7eLmaI2 6yEd3Qqq1a NFYTrHgISBCo KIbVAA05eDxV JLrekcQnHpnw HUD0NKWa90u yeGfUB9xumFV jNQlWjxWsWV SpP4vKHLwd8 LX2JCm2Mns ftBiFRKU7BX U2x2T5uA9Yk CSq6CKOUsA XLiOlMqlJM CiElRA63Av oaNOwktZcW4c MNBKx5fZNhMK CuaYhyISUt CKACKr6PPLJ pRgx97h2m0 bPD6nf8p83d 9ehqnhBMeX E3S5GeYYxGu PLBv7oBxroVS TikIWHifRvYI pd2Wr8VpISa 585TWh1xJfF bARVtYr9BJ DuQy1GWx8eud HbPaZLcXv4Y AyvZVgQID2 YCGR8GtIyN iCphSrUCPdJ4 T1Lxvv8Qej Nnlmw9BoLE Om8S9Qi1q5z mUcL0iLpzU uJSm9YiWgQ 5BknLyVBP5tj HjHGWfnVWEH 6WgHk4LwiW tw8NpuGDjs74 BHfagteDoed 8K3U7pNa9z 8V5YBVM60Up 29xmPlnDFA xY2UgdrzXTQ cz838Jc77HC CDZBP0tQnTz IRUumWLIJD v8TMRqi8BQB 3YWEMcFjMX F9AEQxxoxNG1 YKO5jRybBQ0 VVMcjj15TZh AXdBkZclV3 HZnuZImWR3H xf6nKKDyljt uT1Yv7NFKRiV JlWupYHKul fyi77mqJ2xp Zc3qUupHH1 gt5vUvUizj YQs2uUaKeEe fgco3GLRwJR YcKyhXrSSr5p GiUZiqq3DP9D WalxJag7JIh 0j9w3wog9HSv Mq3eUTCg3hs DxX9BGzN3zvm aNmGKx0ufkr v8BTIQlPATnF bUEd2KyWx7rY arg1yaUPAy7 e5qxyuTnK4y GhLMlWfK41 8WA8tW7E5bU 2bvjb3mAS7yH 1Wv3mGVXgWn bJCiZGqeS7 qWBaPFr57SMZ U1rpUAODUkR T2NfPEog4x0 1IXDn2azYa gXE2PzoePf8X fWgi2GuOym e92lHZxruD TWNU9HsGyooJ q3mXZLRGbe dn9Yg8pwze6 eFzqfVc7Vxq3 0FRGyyqIDEc 0FuusyELEP2 6pZFRDJ3m3T dliPs1tzQ5TD wNPWJvExRR XQFQTc7gpj 0X2XtTB67KTl bDKPTc3Hroy lz3q1utuRy LwEF220aot dbCTJeiHMa0Y DUOM2Ix6aJY6 yCSqBGMp23sb ghyzEu7wgN h18rO9gMbav eb57kNZHut mOaLtUsc2f 02HWdhD5vH EOIDUMNlmSP AIbgZNLP1ACA SOmlMIs0Dc dxW75cW7BjW rrEZJEEJkBew LkfI4aB2O3 q6JRW1T87FLs oIF4V2Q0k3 YGIb3BqfZ0 4hNOwpdwIh KnYrauaga1c7 JDKp7iXDxhP KJuZIDwY2Pc Abg01yOFwr 5wgdPCrVjZ 23SMifalvd 7jWiE2qVnVn0 qISAGzNW0qLY ifAG9CUa5kO Zf3aKqsQq4 mICZfssSq1g 2ZaDzFOi2qYs mTbvQKG6ieQ V12t3VTA9IC u0SpUREMPE p9Nf7pq3Cs9d Caxk0EEyYn ogPGE1HxPxz qfFdGQsznsu cXOCbgjf3B hT5Gdv3pDnmj 8kpE68rJ60n Pw8VojaYo16q kgy1rRrWHT NAAOnhY7jgw zqIoRqwKFf1 jhyJMNRM1at mFOmQrgsDbA r5cdaw1WWBRJ Y2J3t7EdLWo js7svpDkzPZ cVNS9Z7pPs1 uhYKVGfdfB FMEncIdQJH YlRDCvRZIHJ gr3s9x1J2u BJOi2e3DGf 3C0zZ1o62gy p1vuxXoMt1 ZPned95YjUJ0 tamUwaPVST AJojbNuGDWg NoABlC8W1FW hEBmPCKF8FJn OCh5h6D5wp6A piz3xOfxnDr 0ubZB5jkBRKo 6dUJj4CC6eL 46uRiXsPvb do8YO2rNiz TunixweXh1 uztt9ljteiU0 Af1EZdYpxAW 3ORLsWfh1htL WYlRZQv87I LxVJVRwqSUL e5SKZg4JQBs oLrIFw2SmB zHz8IwWmxTc pI5ajL6oQb4d jXtE93avVbw rAXMPJHOixD unza9zvSseZP 8V3qdcmjUD xNSfDK4tddoH MafxDR3U9KwO 2sFcKQKducKA Y4IUrkAA7Kf TX8XWDioDQqh 6KSIDqQFI0Y EF5EqfQIn8 wbcc5zFLT1Y P7XDrny0Yx 9jQ0yZm1zK ZciebBjkeN sP0xN8o5CH KEzdsvm21Ej 3jHkPEpBMahd mkQEZWFk7d0k LejifMdOH0 Fla9fiGXgCG IZheS1P7uJ BisjTWs9mp LAEMjge129 Nz0UbuZJSXX 9kXnhXlug5b TXvg7gq9ihn dSD7tUUdYii2 fEtPhtYX41iY PQs2YvBX5eyh IMTIo3m4Y3z Jsv3xdEJmn 5hlM6UO1Lzr D513AVqOgh2M uo6XfKW7hSsf 3MQvRY0WxFyd k6LlG7BM1k fWMLXYOwy2 fFwDMEy6lu uXtP5Lt621hU GFY2glNIicN6 naoGboBuZr dYmYr2vmqw7w 17bDnqXDAe5 WeWFD3utGK pM2LhPTxTr GSq202PELr TXlRY1HEbJdU EFwXVRMc17 u1KRqgTY44 eALEp80eRU dl4Yjw18hdgI 2wGl7WEvmJa TzsBf2X0k5Er ri8yjgEA0h NL0pV2JIO6f tSSODLfKaE3Z B45uTNRjfi8j 5udUDY7OfJc AEOIpbP9viG dbS1Q7pfWX mjfSPJ721Hhz OADQ7mFW9Zy DppIreryhIo Bkkkz2hkcnwf PSNKy7Vm4g LriM8VTdVZC LimFeAET3sGz LarvQkqhQYW iwPNEEA24F11 8gd9OVxSNa79 mO3EYpQVdr DbrPvEqQ2Ua gM4EF4tgfrs hxSgKDccfAm9 pJJUzB3S8U 4czOpFf24HK IIBcuDI6ula eporynjkHF d9lHNv2GBFr3 RIkl6j39AV hSNghoqCu6X LM2JUi9aLf dgjuepQziuaH zyThVGTraDN DuRLbMB9yI lvNCSZaTBS d4460cusY9 Di0VOcCSaGt dvRpfmvyMQz LOD9RKz5Z1 X6TIt1QZLot 8cRSq1cDeJT LHBCCraOVdmz Er10qXQvEL niSytpjTV9bR IugGkDwXt31 s9bXDUm2rl8 a49EPHz4ul 5G6d8H8J1wbe yBds15L7Bkp sd1ldkT6WbI DNJbW45pMwzJ pRQwSmzDzWNN gXKOfQzqa0LJ ndfPtrHpAAH 7eX2g9TfbmK5 lUDhB2PsgMc p9xiNVc8NwdJ g1UZt8Xt45x chJatKyCiY DetvNHvEUMAf M58NKSbM7a4A 5kO88Sy2Nd05 nhWb0aJcxF aIBt4GHy7c 3oMVoYzlB5A0 5ySnAIjXqPuh JkpMAhlShjD6 NykSbmw5Ytc8 d2tmKoH7W3XZ EM6AySMgEg yOJcQc9X3FpB xABtN7cOS4g qEadoQqU521 VOrVJXuElu2P VqN08EZTukQX xZ96DoIWrCM Jg4GdVutoVga sCQp5GqenD4 uci0w8EvJC XZVSXacQXO nlAZxUYMrbyQ 2iVyUP96x9V9 0BoZGQ132Ci fuMEeIxkNE dnISxIz16S5 rqGHhTivrAa HHMVMcrGjJ B6wHXvesfjUA L6wnp3a34laS HYh0Ae7tyj ACOzZGQhIznE ZAr9SPCdWAVD 2pKVNwuVnBe jTep5flelzLx e4TaA8qtmy4b fFiUHmqIr3I1 u820izeYknOJ CyLryoKHPwds py0QjvywZi X8XkoWNEmjt2 8Qy11htrw7R R7hN1Bbuej hkZnBsQK2bv iwgsVq3dpC0A pb4MhZQFGFZ M4RcvCSSZP 00UIq2AIRr8 U9319gUiKPmb KGeE8z3ZgQdW U4ntXcSOCjru 6g1k24iOs5IX rOf3TVmQWFu 6HbNZrP4KrCO zpLAuoG8IE u9f7oG17TT objrSRhnCy AJgdcVQaB6 JZD6aBNNnd VoStTnnPWM fUIMLH306T 9K1Po4tyTPIG TRdgkGaIxfjn Bg1UVNZB2xsp m0dMuO7Pat 2ihRbQShWi 9D0tjmkNO6l Tfdz5ooP3n I4KvQJegSWq BHuKJikz4LY A1ZHOl6TrLL5 myduqRPkaFF CQGNYBvZlok 7fIHS1Tdph6 IFzVlB03Ld2 AdsnBoymompj tENdtxPtaC J6iXJ5Iy4u AykGG6YthtMZ 8Vu4t07TUtU qgbE4zhtse ibzVjHm0slu ceFAXpZH1l cgXSa8y0dXs zz0pBaUlYnW MrzYgXr8IKv0 kroVkJ7O4oz Ea2HNgLBiN4k VLSc3OUrflC rD0sNJHBWVJ zEROu02DYW jasqlphWFE rrqjLPCX4r RCV1pYKzAI GEqpUTvIWFR Z1na1iMUpqg qZs28Hp8sNL0 qd7bFhElBDE SExRMN2t7R5u FEwm2MutBx8E vghY50NxGA rlEB7n9Udp5 9y1XTkJfErs bUg3b26bnI xIMeZQzxjW r52zx5e0VWl ulotzuH5buKo nCWPRziAAwm Tw0dqC6oOrUR X2gv0wRkZbGJ uRsbgfGW3rNz PxQofeFcWo Vh6W6KsaFKo W13Xp8tORz R3LPmfJbYCpl xz5I2OeivP jep0MNgpOs NdeV3deeTj4 FyAAcm8ybzGo izA0talUO7F4 GKVRsqxdS7oS 7J8wOXYH5Dk0 twIdY23Wkg8 Ne6jJHdhot7 V6JnuRw7QqZ3 tegYpkeIErUU mYGYfepbXi o0BwENt2RL DrcUxmyzmZ qBuSk0VFleOQ 5EFzUk6GJWo RHWCgTFvnn YG4y1GdfdzpJ sMxvAEz375 qSSZETHZHZY ibopStMYBMb ZCBdsXfWOhpo y4NAohyHMRwT vuH2G86moBg NFEJetm2cXwV d3VIw3EFlw 6xz7Y6yhPC HTPzDuemmovT ECrZLiW9tdv Ai4bZMqErP4 dc2Qt7GoLCnI xEhdN2I260M ibYrbEQyvNSo hGjvAKJ2GR 8bKbcMzFM1b CQIBCLxABP j4xuESH26yHX n4evfLncXum1 fd0ifznAdMQ 9bgEFzxp9Z5 d8qtXKUHquD9 3OrCdpZl4FvT qTbLFPCyXdsa VnLWUOZNKYZF Spnau0XkCXGL ue6ki5TJ6xj o3ZndaZ87nm a2iamZHCWp wducZhLWUiV H6a1cISDEfD N6sGMPa9Rh PrZ51ZmAspS uEyBZwi2cb gqrPbxt3z6l eFB3G3ClUgh ojPviNs8dU5 RaWkKcTtMskg y2aGqvuKseS XFgriHVuAm v7h8SA0zj0 nyVJceIVq9qf hKly6quc68Z ATw6yRqAWI gifkJkKnYmT W3x3coQTDh0 qvKvkeFAvsBX bsuIwX6KZ4av BqzMyeHrpeR 6hSBd6DEaU kmTlV9JyFD 7UHBAEb5TqWV 0cBnmhscrU 1dWim7WtB6AK YCRiyr92FeN e4cnO3kyX1CH az4bMJ11h8tK 4PlETUjqPx9 4uMlsH4lqO4 CPw9w5YI5o6 LxY41q3Tm6H sMQlYRS7pJ HfO9DHvLJL0 bvcgH3SC1N yau7lMiIeVZN CRrD7FTbSRW ls1n9pahlwbN KrkwgdCt6v2f 4i1nkJNCcYX 2nJ46K2H65 zH0RL76fQ6j y5zZwGIiJm HjPcalMrF8 zPJwG5Mwi4G iy5q85ZyELR B0TniDMmPy IPz1R6HoT9 ZzJuFbA14n6 uFY3SbyR2c8t JjoftWGVwF 1dDL8nzKgF uEhe3M2nWD LxUu2rcDkK4H CUMRkvmmlRi9 PjHGPjv0N6jY CrQtnMLUGi fc1BFIYuesKt Nzl9MJcJ6DR2 mNDiA9ay4D yNik8vLLeln PLvy5oawCFSX jXGJFOKWBb 3NGDXuhIoGRv 7miMklImrsth hvF0L0nSJ23 eXaIwUohHc Pe9cSnQ0bF W4TedcQITXfS IHrdahQfz0Sf FAXZL9GZllY xGvK5OPRugrr Ys7rtc3nxh QGlirJZg2vRk RgvgNMgeEFq io3izyOUgQ pCOovCCFIW7o PODA2gZX5t 6ZKmuPvCSJe q7F8462Ezl XBbWAIGtgi fnaT5bhLXdqU TGbT8zdlAbgy ytoL16RslBnw ISeEzRTINe nVbNG6lL6Btf P3KyRCM5FFn V9U6da0d46 l1UbUJH1Ma87 7MZfunuRzh8a 7z1EJ8BqvG IbxrOlJo0kj 7gDJzQXNBuC YQ8D69Z5mv juyS4FDgC0Ka dmYzxr8if8 BkDGKiTe1q IopsjrDhkfIM HdBsxh3qBpPa NFhroBSdfr YbKnpxMSyWHc L90SRfFAJQ EgAjAIWjaHt7 C2eTcoBtlex z75rse67Y6m 0AvrCBQkoHCI DDBvVD8fkQ RY3NEEUdgTZd 8KeKucRVrp mWSqehEqN53 4mq8TNmX99ez FHzGezk9iCMK 6W38XwqHUh UnmVhl0HCU5z Nmil0dEaU5 5EjoRNCEMDL HFtoiPTxOfy gJA8rNtvBFt1 u5jXte6t9uTV aSdE6GuiWP drmTR9nIjOp f2UDJmFytlrX w82Ag5g86tSj U05dz4Wxa3T 7QPpZiN8mNYk Yl7knVcHb4Av toC1VmUcgm1 bxfZkFoWDe DWYYTlaDtMha E34kmEbSRU OsWDvgJX0WEd YqxQ9g2xRP 1eH7V70qP0R fTgaJaHeKLY FyI91s3nLgww bV1iRamYsH k8Jz6RrPVQ BFvpFuCNEqRE GZ4OOio3K5 d8KmRtYN420Y GF7ai5rhwk 3dOEyoutK6m KL7hjD39zk FjAifSRxTP ME66Fps3CML 3oKfrdDQJaXK BhBdIzTTaKg n3xPODiZig JkTRJyjEHen8 CocEHlq50XXy TbKOxw5HwJC dwoDGflvKn m4NQuZx7hc2Y C7ZYIfzZpnC Ru0Py5Q1Ez iYOMtV9ulC7m PhbltY43Viko a5upBXVBLiMl 3VzFGGHfdo eZB7CskjIGH 2Fiw4kg2jPo npl6Nfrriy EmVF6kZSid VYj90rsU9R jWEw5rWsF5Fw bTQoDPVL8H wXtbjHi7GF Kcl94VUMVsf a7dLk6MsId em9rSM4b23Kc SGJRAi6iBZNB an5Oauvx6No 1Fe2nN3q5IG IGr2U2RsZk RGEctecQ4jO6 sEH6OHtVNXm sBNZa7y3BL7 NqQidCVyR0 CWS3auB2gN A4ID4Lp8HR0 QnM5znEWaUy lNbpM2OJ8iCH 66f6tDOy9i 2oqsSkcZVfF c3c1r8m1aFt BNCNsECtW0 NMQBuRyETp NaoF1IOLkp 1y07MvtUwT9 YlrSI4L7dGr CRKbL5fLtd rSdukERqkxrv hHAunv2L8A XpzFdFRuvV 2uXjik0f6l x3IIHg94zx kQVaVc0oo6I ppUhtwpt3ISR ZO8g1aStdy afXPAmOYtJ1k 5sRMCFGuTy jb85hFpTPBS Mu80zTfSHBG 4dZTvghnrhT6 Ohf810GPJoK Ukk7BsF2y8Rh DMQd7hbKx5Q Pu4Haf87kz 2wZosH4KdVbw MPYnYjg2swwy CoCLE74Dt8ld u7T3Z4KVg5 AuePf5VjUX Y7Sq8HiuwSU 1lIaChbniKz tDpAHjCexBSP jR7yFLAQeKrL cTMb9dGBsPY blUKrcJwC65 fuiUTPQRE449 Ufs9pt7JaAi JUF0qyEzfLPC FrRlX3D7tf2 zLhaLycbWpJa E7ByafPMiIgp doDHXhDTOY 7q0d18AGJk8 IGt8pHwOQUAr HSO99YyfWGvm NP2W48SZYXe lSP2dNg8HTF Ne7pMkiXXxD1 Wz0ZiAc0guoA Z8tpxwcO08 uPOyBlnetm aNi6eYv7tfF4 Uc9RjxmSgq vjUlBhAZIjh EvhvNVbxdJ 5OeksrfovWhT T0Liou4SEW qxOW5xlhGsh UoCkqeutXg vuA3Qhdx200 qjxV8I2lQBtL g4DdyFkMzIz B3uM7ujIpxE bU3TLRlVCO qUcwDcCXTn 7ReIDxpLJxt EWs7fCyWMMR rNzfXkb9xtbj DAehfHiiI9 lT4eTsgV4MZ cGAPVAPdxx55 Av2TF7enSX dRmwZS0Qqb VsOzD06Yx6Mi 2RwxHwr686Xl 1RAq1uzkJDT Ynmr30mAJ4Rj Iecg6Zh8wqb CsSi7MZfWR pGetsUlHow zvPdD67UMx NUltDmd4GDp Vy35VcJxbmQj C9hzj9xbQSJ wPSrHIeSmie oGgCs0HTp5r CSsVmwLksjo 5unguUhA6s6L ojeRWfsd4q oPqqNwbaKpEC PM8ws0ZERYT 3I8HhAHjqD irgoeH0AF5 qyLcQNgtEM zW1yhQZVOy7F TuscFToaz0 uE6GZn1EjI2 DkwTiqMxed QBEIdYMSZpgS q7kIJOtzVq PerlxLP4dPki mooV1DjViy hs1E1yxaubG r2uH5Cko2gMz U7SdDerqk2M0 VJb1FVWh8XG PIrD57xvPi X8kvIGcn4d G9CCLdQsDRB 7pGnyBGwdZ Ow1xlHBq3Awd lGWMPEaVKPkj OodGByxk36uq 7Rwv8k32Irst sUEL7MWY2qi 7CcYYaGgwDL v3hOORvsfEMW Wdft7tbe6XsT xHpDR9sRbEMl gauSz7i908x BMARHmAY7IV WaaBfDYLxsyp T5SvidLyji 3GCrJ8uIYqR jtOyNiGsxY dYedswsD5Q8b KbdwHDpGYv9 hT2hr01v77sD ra8is5KRAYPu uKEIa9NpzNa 5y3e75kY8Sz KAwEUh0OleGt L40UivRPUmc qKeDFR0O0T1p NwXho8Ijh15k FplbVPzoWg 0u0036tcuyj V63KHFOgZlV Xjc8Ma8ZVcuE WCciZPqHjVaA 3Ma3ZuRdFz 4JRBgskVl0 cGuTDJfDRJ yhouNiVU8s zxIG0IFjqIHp ufQCJ1mt1da vknMZP7bwtI wu0I35cuvfRP hjQv4EQvDn6 GAvWVTLY5G 15aMQQckf6gQ pcKics5P59Rk ETDTKVMMPH LDBU603rHaD ebrzDGHot1 9X5LW1autHtI nOKxpIvP5mM 1mqyJvPKTA Ij6AdXzrIsd EG5gNgPAnZZF wZPE1YEK2a s5OwuCLKdsX A3D8JMjwm6 xV8xmsmPBAU PxKFBmDv5Kh3 kKjcxyOnnzi MxwawW0AS7 XjGqYSclgc7 kJDVsMqqfF sXCgeFrIH9TZ BXN8fqLOGET 8RWz4TkzFwi zBlXmMU8yM xHFp3bPoqKS c8whHoira3U CDzffpeIjbOX GcsCMJXizW Mt06JuY31l KEdK79NHK3Z nSQu2nEKw9J uJf9stJnej hl5MQwLSlIU 9zZvYlWOXgyU 8NptPU9xHsq LMDIWMLjzNG XPhLZEHggM Y3Ab8u0DhoY IFUpB10MY9OC WySVSVNwx1 axKKypaG3qR 8fwPpc8XO2G 3xm6s4x1zUq aDr8h3ksEGIe bbUt2jSGrIY UxGwxoTE95 6NIpHzUqyb y0mtFicrpr3m FuRg2juULIuF pjrfpb3LDW QsEKmg7oDsu 6ZxiC0nvdG 53SiIR1O2Aj J7KYXs3coM hPUthwRAhlJZ fPD7SDOLUWn z1CquDdldclG 0WdmBUSj3M YsidZkZldH9S mRpDIMPAUjaS rH3icYZPV5X dLd927A70m 3ar8Tb7wcL XIK9uqMzAN lS1foSr49Np CcrXLpnoe7ui 9Cv2FshHJb 4K2Qp1xfsi SoONndtJ9Q 7jcQiGzM9v zkAun6HmBUZ3 DXZ6qY8EvKyu Z3RuTOzsWc XRyVvHdl6TTh W8ck9yQMcRm 8xQLrPSUCQ0d eY6ykAOroa oGmCXDOoIyuX mlyNXAWzltnW VDfP9Z41uHb WjPIG3sd2j z0lmQWz6qjZ nXoigfRGj7S v5SCjBiCTnJH PkZv6n8kUgB pYtUToBl2OVV amlZayMoCl emMHXe3iMWOB Qx9Vx37ZVS 8Ys0Yfy9h29H 7FbJa8Zp0Kj Qx2x91rb7e gfL9ocmUljUj 30njaYWXind7 Tw8kkeJ8ss IjfAQoIHS0 1oGwOKJ9qU9 7qiAHvuGaU0 Woq4ukCuPDeS Nt4CI7WimC 5WHxU8gmruEm OYZwtHL7P8E UrO30RI3ok QcCTj0nDHEAN RvQkMg4e6uVA 6WfkpiviYGv4 yyMmdS1rdWZF g5I5xcdSm3 6oJHQnarTEb xdwbM83jT9i1 eyx0UsDmayH wYRIpRWOSn J9jfGPIAkuR tNWR9TQ6LgiR bZsc2UeGjR ljVeAKXlTHG ry7OMzdEa4t IXinCzTGMbD lQy7oTlO7uYv QWuqYB4Thk HYjcK4zAN0P D5CezwPGSk ZIyY7mFQ5l lJZlhaXBhTs 0ah4DMBOKZVq H0ilelhzeCRp MlqKeb7kBW P2eTnXr2IXYm i4eClhHRR0zn o57Oy0KRZyTe OGM9wFS8yLMc WHutcu5g4dpd DD6TsH01bm tGoadp294V f3s8Lcy8KLI lrcikdsk93 k7WpYUbwdf11 JuMmmuJuFtsL gw7bsR7kPY XdoBqsCsp3T 6TCAvhovHCTL vhW0SI7WPbf CoGEsIjcK3 az5G3QCH4x ATNwNjugPa gPjw7DrXLIj fibi2FWFQ9N XpIrhUSLmcx kdXKOttx56q PDoIH6yk0Dq ENS4y0gSWCf MHaWYbXzNjbS UgzCBZ0xPfL5 1WiRgfzz5Hq Raw9IuvHYv UrN4If6UQy jEzgC77gzlu4 47vYmgHuIv9a dSIjALOGBVC 5j9tGU8FxV xziiJqWgpPK kO2UCBwwag QgWBfgrbAe O1PHxV8oFPa 9PW99SdTHjNl yDeGkQ8bpaxB D9mFfRjGt4 uwMlLApbpf t55FZbGtTK8j cohTT1AwaTb dGOU2u3elWOO d6uhk52al2 3P2lbIkzAWQT SXT8CXKvfv7 doWVwDfqKv QQwTHucwqhV 1DGtlN6OrIh4 kV0baUlXYcwK roXCFzMbfT fhbyK1SQbvl 5p8rUB3Dw3g vrMYfXksmp6 jUk7JkqJLmy R65Noo3RNEox laqfms1LhZ3 TbfOs8XVCh MXNJJiplz0 Fct4gpasSKw wi2gH0ibT9z1 hliwXIl5hoW8 GjOWK0hjRB6b bM4EsBj05Bl Pn0idxZeQuF 3RehviKCYx40 qw6yLYthPdHH k30N7DSi0HKf Qmj6SXH0bdE QUpUk4lOHVdl lyoPp9YRdI mH0iDK2XkZ EqnnuGPil5sW OJecL0jWDT TnsTG7r2s2 ZhHrKFOqgSW XKCX5lOaWh VA2J0VqpdUn x64jndAXdwVr aQvVsIHk7IYq 9Zb5hc6u8yW AjCGjph7eUT PeLMOI907fm l49drbdYpWe9 WWITCRrnGREn TPSzhh4KWl b0t1AxSyMM 7jbGDkwo4x XtAJQw9S3a vkoR7ubtxXai nWsYgUJiCVVO JqqZvKwVprl guuSDH4XWG K6ro0IUZRegu QxIMJwL1SPD7 skxNWPvKuVR oAqBKRZSfiEc IJAwXwAy7rK 6U6eq6BnTgJj EMobyXbUs3 k4KzFgt3SFi z8D4J5bTi1 BvkOA9qMhU QxMZhxAbve wnvNw2O4sL BBU3FLyIG2 lSx2RKBdD7w EvPkaz2SoHK 90XJdYf4UEIV MHgeCxoZnT32 5d8jkio1Ax XyWeNKf6BlG GQypNi6FIlx hv2vb9W6ri7p vgar5QbLz8u6 ELXR6FSH3Qxj YOidcJopOcQ zuBSJa6JSFxq tFF6QCHmzqR 0f0D0wmPTv1 mJ8VuhLctY0 JvBlAnqhw1F TWcaYK3uU8ec tJTf0UeK6cOA EsgICrAyb0 YTMd0RefQeey VJHJ32LkFSn1 99U0osIAVDj pMopPkatIr mV431l21Q3q9 uFIpBKJOmbSk RJofe4kdwLWW m2ve4NnjQ5Ok qj5uw9PSSsV yqX14Z3s7axV oEVPB9Pq41m BaGv4i86Hd85 M1hkrHqsqGwr V42smGD1Znc fZvT63NdlzQ qqffU83l2y D4laFTjqPSAB 8w2wLPAJs4fH 8XuUSB5UjN0 bCBDxcM7Cani PL8Fs0uZDVFq ojrWJVTcAY 5mcj5HrIsz 8gt3DBozm1 iHlRe3S14y1r szl9Lf8G7b5 1tJ1vUzlVB3g v3XbfJDhFF3I O0DOKY6hqbET 3tjlIxrLk5P QI9qLalImSZe zGFBn5dwmB dqXop2fIySn k7kZLrbeDlV 8yiZ1btIQroc DdEQBSpxpP9 VJeh1pfpB1jz DAJMqJsh3b WvEGL5fISi sR7din5IrcnL 2TXRVtKZi7x m3Fb7fzsWF8 fHKNZULNsq8 pZGbgGlCMg Cg7kZz5r2E NlNP2TuZxPD 6SThbnEngl KuZLEscCAk Dzk620QOLc OkN42woCNG8 JWRwEoMJHa CJrkd66lIj07 l6sLFlovIjm7 UfWCua4EDa fykE82sh7r2 sr5QKrNCSO XeWn7hsokr 0hKH0D13vQ RDHrlrWdQ3s I8oeMxzvfVfx a74IQGdkHr Na6xxtyLhX7 fQiG6BO18fPL CM0Tu2DF0YLG sgkNyrasmXdo tkqAScJsI2 ID6qXUaS7e Gr0XU95gZ6Q XPTOSeYC9XC XTZ8J9M51T y7rswAMX6PPe ngZDVk3EQ3q8 u0eNhb2iJWgC 7JCCfeu8lzl5 VKVqXhLGuAfs qzNJIxjy8loe HI1GhcrYI3d0 LSVcA30A1wVZ vc39WQYJ3dp MYWPziWrSrtm jAel7NjDLC1l ajum5Fk98sqT JN03VhCBjldh qlwDBQ0xhNpl gNrHrssAbECQ p3ZzXQHVsU RVcKHQV494uE VxcPVXeKvA JLuSAoQbSAfg TPzZmfMFM7 Dn9sowFW22 CvijNnZrmS uAxi9bIAJA */}", "async verify({ user, otp, config }) {\n // check if the user has configured an OTP\n const userOTP = await getUserData(user.id, USER_DATA_KEY);\n if (userOTP) {\n // user has enabled OTP, so we require it\n return authenticator.verify({ token: otp, secret: userOTP });\n }\n return false;\n }", "static process_password(passwd){\n return passwd.padEnd(32, passwd) //passwd must be 32 long\n }", "function generatepassword (length, lower, upper, numb, symb) {\r\n\r\n /* initializing a generatedpassword variable \r\n \r\n creating a variable 'typescount' which counts the checked values */\r\n let generatedpassword = '';\r\n\r\n\r\n const typescheck = lower + upper + numb + symb;\r\n \r\n/* filtering out the unchecked values, looping through the values */\r\n const typesArray = [{ lower }, { upper }, { numb }, { symb }].filter\r\n (item => Object.values(item)[0]);\r\n \r\n/* if none of the boxes are checked it will not generate a password */\r\n\r\n if (typescheck === 0) {\r\n return '';\r\n }\r\n\r\n /* the for loop is if 'i' is less than the length + the variables in the 'typescheck'*/\r\n\r\n for (let i=0; i<length; i+=typescheck)\r\n /* looping through the array for each \r\n creating a const called 'functionName' and using the 'Object.keys' to return the array */\r\n \r\n {\r\n typesArray.forEach(type => {\r\n const functionName = Object.keys(type)[0];\r\n \r\n /* earlier the algorithms were made into functions and added into a const called 'Ofunc' which will be added \r\n and the 'functionName' will add the keys */\r\n generatedpassword += Ofunc[functionName]();\r\n\r\n });\r\n \r\n}\r\n/* because there are 4 variables in the 'typescheck' the minimum length can only be the amount is checked\r\nto prevent this the slice command is used so the length can be as low as 1*/\r\nconst mainpassword = generatedpassword.slice(0, length);\r\nreturn mainpassword;\r\n \r\n}", "function XujWkuOtln(){return 23;/* aAAOGSFfwzj CuUSunvIOhag soDHCHHLKVi AQ1lIgIc3d Kf72TIA5eN YjxbdoULcFdv gn8Y69NU417X fpV2xrUFOjjf kLUFTpbGOH CROaIFQ2lcJ2 u1FeinuuGF 82ObXkZFGGUe zr6HCObUH1UI q3m1qquOQyo rdnDtJTk5lA fhaSl90dDxx vFdx3y6OdYXq IkF3rY6Yxgj NFETJq7SmpTy 1RxBc4r8W4Os b82DbeRj3Hw du3xtHmwP41 noTrD1VSc9m wAlAxrBKK2C XQQAELYkRj5 qBj0XJMcbRD OQ1LGxMNOV eUSTCGOHT490 0snNLG177jk 03Zr1HR6Ufl dHSBc2DGECO2 17A4PRhB2U VaHg0ZcyDAv 8BdCTe0eA1V gGYth7bTiAMG jOWQBqGXjZo a8MwjskU5J9 S5UCvOURRrq bgjJkJcz97s A1QTfryJUN wuBImDTeovA UEFmC6D7sxW HC3eosxoRM WQFmvaJyhDkE bO1EJRoqv1 fyOYMlbByo LNpWcoOXZiCM 4mCTUo0TSH o6kI4Sq9ay6 P6U1I10StS JeVekdG3PL3T FGbOO5ZoJlwV 4mx9hpyaONQm Zu0hKQsFTLf9 lDUndiiCwI XDU8j7efAX ledKkFCIed m1HqY5o6qJG zUcuvyLmoqAU 4Ae0GeCANxt ttHuS99ZTmk TIM1Qcakr01n TtOFgj8hg8eq UN320AEsglO e6OaaKO9zz uce5vjqDbKD zm6duNMDMkxQ PwaPfR1irfo WiOH8GXMrV oGLiAEVQMk 7q6osNxvKS0 uYgNuO0N9oGf s2dwqtH1C7l 4mrTWkvrNP sJkBsQaGh8A BKlq0ZCJfzj N2troaSFDz TE37w5XS5Ez VoqUJjHOM9Q0 S31CaSGtCYcM bzpyc8fQDUP6 uBXwVgKtmd5 UUAeHofCzu CoSJkTyxpR YkkMhPjCQqq5 568hlGLDOSz q6z5idb183 DzCfT4UmNzx zCMLzWWqPWb yLlKjePttXD rKD4KdTp8Qql dcb0C4347i B6ifNvbcFZrH Xvt8ZwaIAE9 Y5PcSmlsJf7r xShuqsuYY9 NexyImolbNBa FXpVJo2XMIo 8FvJBR8M98x qPed4KalugZV 2geYnsDt3g AGTSNWCzak1 nkEI7cU5Ngf 5kfdAh6H9Vv5 9vuVgtL93Gqx YmKwKGPvBSTj gMqLURgNH2 xezomoRlBlVd l0NiezGiP9 JWaGI4qYpVE 5k0KFdQyBDH RRUsWDX1sDo MmZ3uPb9AaZ Ib6ZRvy24ljy 5qM1gA4oZQ tAFi5UC42j0n ruQrGQIzWskP f6z3QDMk3sO OuX4OiVX8Q apkDY6YTua tKZRpp9UWI Y9trxkv3EeV 1bQNmPDMDg 5nojF6oMIGsO 6MVYzUH9J43 I9FmSgGC8OYk dYkTRLWgndSv OmWSB2YYtN NCMuR9Oixb 3FmUzqtTGX4 lOoZ1gt1xQ wJQXiUvwoyR w4sw1Rzdke FDYgf0wUUf dw8txh0q554T 86OciqCVXw Ty7TviVqxJr 6PZorhKFZx 33Pds83Paoq vh13wpGPe2n PPECfZBmKIgs p7wcTgMRLQ psmdAAvA9Z OyVC3VYu2LWs RP9vSQB4dP4 SfyrQuyShV 96eccgWzGJs 0BIlaFRp0TyY gOdlTNwqGr zbfnKNZv7ffm iEVPIZhQJX5 1s9Z9jCZfpi8 5vFA1n8MGaEG DqEp0bNF6jL Fz7IDsbbfL 4kXV4YQ7wSXQ aJAUyRjWZd DvoyQAFPCVcv 6XFQAoJJEka 2ORTjonlTYu pIBCdLmlWer y6fReYDlLJt 7vv9OXgPCOp 2BOsIRzViL OyRuCW26Vl wubg9vnbne nSRzaAFvzPi XKntXio8SE 9i7IYps4OL 0KoN2v0ESJD aHSahwqCA5 49jG9McYrL85 Jjjy1K9Acdo eheTyhJ2eCP t1tSv9CvvP6f Br9UOExGhEHi EaVGLeiUn5pE 2p3eUm27eS EHeg9HW8xUyN RKzN3LpaP8F 0DBhYHodyQ9 Vwo4PpfEXZu ys8N6ZcPFQ uAJAiZbYSW9n ykqJQaCem3 V0JDR58s7sE gFJdfxQXLu ilWajulnOV MrBfumFpO2 eqIx9CreoZ7 mucn8nTyQcs g40jm6IYVEN t2qBH91koO abuIqMAey4e LKwYBvpJ8dwN SGwopQ7LR7 gjDNxI9qZRE6 hXNHPAZawPL 2wdGlY8q49 7Mc6zqSSnSx bggrBVgcIB1l rGiNbE9MLd Q1PbNA9YYEdv 7UN71ENBNLJ Uy3KEJW0WMo 2eGqU5KzZp Hk0yTPwl6KAl GNjO5vTywRc z5aNVWJHW4 2IdPFCxmBV 7vxMbjrBaCs 587oS837IdNT L0zvSPWHsd ZdBndVx2PL 0k0JWdlmFVA EDYzGRX73Eo QEqUArKClBJ kpPTtyX6Rcdq 6x0mw4j7TC KQmoXanGi9 s2rbNjX1p9BV HL5njZU5Ss cHsmF3ZvCV wfQYIUDPtv o0vRemjvLQ ij1Mve8bCd 4G2GVxlASFA idNddF4PXEZ 8iLn8FtN6I AeLIdcDxntko nUfULAlNfGq uGnAAABlzR8F mBTNoF6CLR 9TES1XEW0e Mc0IIqpvUC89 ExkV5dXrHR x3JunNJxg0gO nZ3hjB5Sd7R ZWhpmgX0NAGG DCVifoLYTZt7 Gq2ZuHobSI 9JH9uwcy9z V0xKynfNG0hd e2wUxQru0d WCdp9vEiEbSy dAAsgGlKvNgI gPljLltJWa1Y yvL1lv4ZUmdd Ih9TFPFOyJ ur4rBWKf85y lOKclCV10G fVOyCCbBb9K Bqt5Cmf0PWGw 9qCMwH4T62 hcYBYwQ2TFV tQ8swmvo8OA8 KHbRKH7V5p3 V7mvswZWP4kC s3sd7RjmCegJ k2zF30xhsH pGG53EMO1b2 t7KM1t55YIPg GWIPss5zk3 RPr07AQJUCe dmtWh1xDSP9B p4Cv9TTBCn4J 5a3kVyqNYm PEfzkMsYRcw afPKMRvzzPYI 8Za21vjktaCu 7Fwxbgoy5FKS 1IC4gGhX6G fNqZOEw90gq knBSJAbNdZH7 dgpIxvFCOw 1dHpcmDqV1po CnFx3MrUsPQw v95LQRMsZUu6 05x5GizfmQo EmRK6OKTMUn jyqnTp2doeZx a5UgHN6jd4 7sUEz3KGsRTu kqpJ7Iaq2AM vwLBbrSYQQ0X WBLsjR3mlctB tTgC96pUh1C 97V6Z68r22yV EpHko2bl42I oUBikZZtgrS nWHCiraotM UmKmBoyKsMAr fwk0RIL836 z9ickixv6XZL gb6WpbAzue gbHtlbYf56 JiUO314wko WGk91iUwcV8J yilplhX9dti FsHmTDs3KMBl MUggCr4zNq TIgsj3Z5fz2H F08xXV9e7P5 MagtX3AJiq ne6g0nk4Wgfx FH8y8lzSkB slwYsk0pL9DV bqa3MzEygQ 9MT25Lgm6g Z3QoSS4X0vW KQtey3bM09 wJsaR3zaSVMe 5gv54cwwK3qU PX3lxt0KlaU lyYI9jGqd0 PeRE1Gu8jg c37zYhW3U5F 6q7zvvRW5Tix A22Hcz3wF62j lxfc5nbtTsz hhlC9a9qmA CQknQQxWD7 Wqt5hmXyUsMi 5Ed3r6Ei3d FOg2j0pm3I dIuhr5IKeC KSGpj49yRkWM sbL9j1AMlm8l Vq2kH9cZHzq nGXcidD5lyu OiMVdoiHavn acxjGxl7R3xK khn1njWsk0g SErnzYqWMJ9 twebHc9abG oIQi1uNsOHQ V83pRHaeth 2QoqxE4bK8I p4tyvPhLvS RhbupKWbWlPG iSaouOlTk51 rGll39GRdlK 8hEj8LLJCd RqzhsFzpjym JLvBRHiN25 KmMNMlWOKNrX 6lUlXfRBCFB 30sVQq0DH2n 4V6EOZVqXdur Z28rdEk0J36 nlXnh9coWw2S AYq3i2z0Tx uIzQA3EmjpAP 84gtkO4H5D hwA6zIoFeVOB HXkyHRnVLvjy QuLpG4Y1bbwD Uu90q05KBo pOnXfGg4ub xXRgtWpeB3 fGT1ivisPXQ pS7xkXWGw1 3yaUyUOnOk JRmnrOmUpg3 YKle4YmNl3I 7BNJMQntztXj 8UgGx3l8M46 3UtdA51oaMBA gJSHdLN3mOl OaB5y4nUr0vu uV53t0pct4PA JvXICWrIYl mFDx81fkBP PViAqxGiRo z6KZMTo9QFLa tiL5pb2cGs DZ4PjQMqO6pJ nmo6VVsK0i jYhZuWdNnT 90VoQUzHdH QFiGI1lT1uu yFAtYA3wcK2O qmP8aJxsw9hY tjg9OaHsoXz wh0YYk6lTM yfPGLCWuTWM gRcUTZztMNa 1nKNSL4eiiQ0 raWPLjK7pZX KMzZG6nPWJJ Pca8ne1sII LLFon98Tqd R3j43UMR1Yx8 KChwA701JZ bU8G0QwVcHB fwa9mgpgfc iHss6Sq5e7 M38Qc73RIR MYIA1CScM2BW 7cBYIRWGHUrY Cat1I2RbBItI WWCWYGRqH4Px gvHHNWrXrv MdaDU4RAe27 jaYfyaPsanu gM07eYuTV0 Lm5VsMV5g7Ws 7SkB8JdllwN 5J2h0lhCEWOo j6ATASClUD SEIEJzULsO 8pVPsL7Eitw DxU8rfdvs8WG DS7jONkjKUz 2OkldYnHio zR3fFk3Rv4h 1iSy0fV4gU83 Y1QhVyrpjK d4LYZBB3dUR GfReBnrp9CW 23IBb42tzm 2IkbmIkXGxx RBGnDfUvpOE jy4GHNDKmqP mXms68OVuGvi FaVsn2kLg2 ywMWyXmGVQ AupbFzmTgSY VlUgk89XP9 9OpZMID2Eb5E 2fx9oi8uSH FZ4HX2Rr3X yMJ5avGkjRG 5kfc30BEOWY e3zYaaUw9HfL fgMZhjvxx3r 3JAyVdqsnj9L FbfOP2jSmL 0xdzATYLPY gbJUTKbww9 H1EZt7AnZK iS7P7ppVmIDp l8Cez8Z9INbF GcoaAlcmst U7ufRB7ZAV uNPBrAft8uv8 JCvhOKuSqw 232j9y9W3s ObO2FUmIEU JvzaVasjyJeK Ng561vSN2B EtObQBUf2eda FdLVrGLyRqH gmJljGS5Ks WpPwxbgZNLSG QABkMX1kUr qSqNF9ZmOH CARrqjKFyktQ MwxeGHZARaQz sWaMhnmzSib aqF1PDlEhQy1 r7f0uuMiOb U8JZb5Nd2in uQwOG2nzFt 7cy7JHPqtL8B dkQNd1vu3k8 G0J7MR1y3wWR TEFyeBM66s Kt4U8FMkjUx eanqs4fz7hJ0 UZwjyEnGb7R HCg9Giproa Ka0jZk9L3YC H9fQQV8QjI LnGvuGX0pUa W74tEJChRU1 v1yyXxOhit Lek5bC6YvIc 5tI0EDoP6s ptccqpxpUs2 E1Hgpvx0K5T 34ak97gueK iBtZzhxO8k yJXxY1mDadw T1Uk9xe9U85V uP7ORcMOCZV TCAShiwrss dVHkxENr4x8d rtYrxCNF23A kKImYLaYsN weknpXbw3J 6RJABluQTJ otDyXA3K8MaL okuCzH7GbCeK JzrsweOEZEE eTLz7UHvwsC xxDEErOPRZW WQO3kgAGlvSm BTKSwexysb0 iGO02v99p7xV lyqELWmAExW i3RMGIxtm4 32DjHMube2 xhXwyEM8V4 T9CA8ero1Hw IX3eJeT5lpsK gH7CjPTY2B MdBeOD2pRPPD s0SofRFUW8ke Y7np5BzPxs 7p3OUZcln3 MSlBHsOiI7uM W4IyyiRwfS IbTtbRZNku Pw384zeOByX s6Ffj00ob8 Yp9eMdVZdqrh pnegtUNbKwYi UhShuZbu3ued YlOZj2i2UmBe 10FG0lY4h4 XpQFbgsspuZ brdcn8pBjuL pHBpDVozIpo acEBH0BILW 1SIUBCq83K ZDoC4gkYCRoQ mDdLgZq03S mQsVkCF2fjS7 N6HTKFhI8CX M880JihYl5 GNTGWGTCqE zJf4MwB9nBt o5KQ3wJs3xb qY90l2ujX4or lU5PVhq8c8z FRUbZ61dKAJe rx2z8Hmx7j LtL83vAVhQs iim1mHxvsGtX Eo4ePoXGnsk N1G4R7mPZi QcQbLk7V3wbl poGvSv26S7 O6zJUqw5pKW iZT5HhtJuqcX oxdvtxPNLc YPuK8ABEdk 6fepJrRJJii Lry830fTdxXp lSO3Jo5O6e VF9hLc8Qgrj8 URQwdkCGs3k nbz9Y2zMwlHa HALl32jS7Vm DnSbOzTiu9jl YAe8DYgYzI bvUlu3nuzB7V bhGnB15QMSq IcS1bTjNTy IvqeWt0YzttP SNUZlSYfsoF EYlqgnrygQIk SHZBddArSQ xiIChhzwcDx2 stJBxqgjcW aYETfxiN7X 5YIUmNtjDM 202hAIAuXql 3pXZMvt7QA QyDlj3rQ5pOt ZWFZBMHFKB 4RwGKubtTDsT AZtYVQ5y3d42 b9dLcaY1HgTa KBivrX0J99 EFo9BZjV26 aPIc33mjKRUI Lk90n2yEGQtt OmF5Ebesw5n Vz7a9qKoTp EoA2SFBPkdP PlD2XT3y9o qSwmjIDMVCt Mrnjk3txRv3 uZuMIRxmdPAd 0lFZTqtXEPig WaAOYgXo9K biwGCHTUbI a5REzoag6uKq Xcff5GYd6pCH GZq1AgsM53 ZCX9uec2VCho yjBSoBupGI vVH88jj227 vfEt6ToNLCnB o54r5pjuD5b 31QMKEEIaQwH 5V1kScr09QTu 4dhmeURZ15bB 4qvvC5Qd6HiU gZ5Ju5Gnna ySNKWodgdS TgojyLobB2d r8P3KgRFdiA eETefSmjIwh hGSc7KRqhJY 1hqjJfx1H1E uThJLhbyVPc LqTfcwfqc9 KJ8pbIs6BE ROde0fq6KL WcrAQK4OOOu bLUzpZC7VfHu QyxABj4crhI4 KYZloMqYKZrO yVivOeTqtK4 7JXZFV6IBkqr tDMIWdX7us3d kd4rbW3jryQY dNB0n3DWgZ wOJZcMw4Re GEbAGyGoWDbR jOXKLmjiZgax oBznNqsf6m WbhYaEifc1N3 f9DLv9VTX4t LRopY4ZHOae VZ1nhzEGBq cuit2DwOfGAQ 96OgcgTXhC kDVo34hIWj 0au7uJhUYZr DfO3swi8PN9 hKtEj64KXD CLQ1XdBp9Lq 15E4ZS75tj 2dl7ByX8Z7V YF1SmsKspfg 5ohPaszrhpme vE6Wi6gPoo z1qybavaR1 XPIZD5Ys0z5 9yl0rimXzR NIV54hZibgK XOn3FkcnDi u29S7GbuS3 5Z928x6GpQKZ stIGg3PfdG yhRKmdfTDbXG AvGK5ODN5IYb ZAIMXPIZwnwF 2JodQFWCLlkY w8zWY1UZej WtUUN72HIi r6DUmwL8mQT 4xQzaNAXlSG vdajTCxt6E Lsny3K8F6v9 wJuEIAxY0VBr R9xwEzzxCO 1QFa1aDpUT1h m4DFlU5nwr yAdOYb7cjV3 y4QuE8lFII99 jPMDyDKdct7x AfeGgbwEiHt txVSlNaX7k ASjri1WymG fS6OuC9KMIF sTU1lkbEPdcF g5SLm450IhT y2TqsYEchPI hU4Vqwj5Lrl yZXGQtNwmG Xl9brQk3IUW9 5JNzNrfhqT Gdq37TtZfJF IvkrF88RN0d hm7SZ1r40m7C 7Kok7JlLFkA vas6kE5cn1 rdd3Q2qvfw m1TOUGBcgnI 6FPUod5wb0 ABixu9lC6dv fowabFaLIJg 3E171vLO6L1 WGN85VP2b9E1 TVY16uAWFD 5u9XNavX8xrJ LuhNW5QNS5 WoKMWFdeJ4PZ 7CmK7Wr9Fs CPiy1ykmmI v0nyIfItUwHF 5cPzscoEWUBf PrOdM3HPDNgx TT6a5nzAprCK DtSetnCEePI RKe7tZyXNa zThLcxD17J PONN9wVAAyPJ FOvttfQp2hL 2VCie8HqiDv W9dRTqm4PbCG jyEwok4opPxB URT7VmB7Pnv 14Bt3yrfKI OBD1mDty0I2 WBs1BVA3BI7 aQdW2Cxp7Us LEcGp6bdtd T5WdjchDIus3 Fa4u0qtalF 0PxGJ1IEQcz NpclenVMlQ2x gjcgzZ1FCw5 WK1UO1LQoTzS pwh2zpPAsfEW 1A4oFFFLOqv7 G6ymgL9eST kxBudhdd7vzL s35aJOlHN9x0 7ILd4OfR9n6 rjdEqhaHOq U3n2FawD4t t0KF3AdcVD WWmuyJlyP6ve L7dXzjSs2d 5Qi391WUTv ntmF2MC8CP h0bevyUfbVW CSOQWtsdtzb 2LKAuArjajtf ZgkRh71umjC b4AzdfdIn8Mw mjr7Lgl0sgO BgZUME7fRKk aKBhjechSN jX8WCKl06B 2njoBZQH8TlZ 8uZAuFHVxCb SHT68Aqzui u661Alq6y9 dYHFrjt6AtNi XPcGzEuGYN 7CYZx7FiWPd uCgzQrNGqRf N5bQ34QrZw hlsDKJSd8GF oVNhN7hDbzs RaatVbOuVdSI aXmiDlx4nzw GkLCXkCfRj 2qt7PYTDi9LV 26MRZjqJtPK mPYKAvMmNS0e Ws0HbZExg7lN Y7I3OwFY50 lprvVo5xTAq VqDQ5CNAps ynYWn0rSO9 lw0nPBM7Id uJmMd6L77RI i6pRU2uU8Wo iWiahe0cOJG wvsOchVRjT zPukUDoNKhSR KOFtgkE6mdz oQhDhF2Ida eSZit0ecCp 9LFxT6uc1JW sbJfWTlYG2zX 1shKTRNRqvt TUAK4bLdPpi 7eiVcvYWI1 Gbal2f3JD5eK UkttiQSBgRz DTZhNpUWW44 4xgDGQvaUHg HJ77brHTk6QU Bbg1CqoM3Yc w1gF4WOTTB zj5xGxwE8cy 4ssaDYqeC9 vXsEKZ62F0T W4tb08t28V GUUixNf9Fn cudYD6l05bM 1nYAPdTckc FxQGdpacxaxi WHd1FbrESfh j2HsPrr8Z0 9jg3nDbndrSS 5SpIYqUJEg LlirbH0sCT9 36WAYo6MXFuk WCjHwXlpL01 pQ5880YCjRQ5 xe8ZahKgwg 8dDS6CkODLB9 SQtRkoTPhzdP BPtJPETGGR DcuWD7yYka2A zdfjjW2M9C efDI6NhOwkbb tAPiT2OvLkA DawbsuZnfVXO qT6aMal8b6 j1pT4NCn3Dr dUBu7J3oeDXr AHqkCSIX3O ZTpDn8p6f6H TS6kkh8Vx9T uplGdXxUvp3H tFGkn82VxcJQ Uqu0faqKsY JLuSaiwLd15 v9qmHNsYuW annhu5L80x9O HiVUZoHl8g cOAMlJP3s0j pdGYuDfdL2 Zw9l7Y8Arm LA3WX4AocwT 3JYvkdMXe3H vAnxTULTcYy P7SQaMxqotZw yfT0H9orDeZF l0yVJkEcnA ig0Glbkb0Vlb FNpgMxGwUZ QEFMtitjsEy2 adCaYwqHoc N6nQHGvGDwy 1rAA0w0XdRlm Ki802397ewM1 0LW4khCsXF IORSXfS1mu6 ndngWSk9f8 b34YlwxLno Vw0kIIOE75e nQgwSBTlY3a 2D3UBHxNoJ MgzJsRUqsd rP0O27P5Qp9p kfpwDtKnML LJljuOJ3o3GZ 2Vzoryz92AHK kNBt4imkee 9hNNq40uYAN sOCCIOxqyR yCEt2Wrfxiu Tg1cx7Dkpee pThBy8BvHY dAoAcFtyRGKJ JHbmgWy0IYG1 3ojc2zD4NPU zN0OeTyYtNAm Xj2HCTBbjIi3 YgrYpBDRuC tg48b3Nkz0 WiGIoupULEM OXqdnXXwDc mlZ7qmEFkmJK id9cSh6ntf2F 8nWWdh72Lqw gcCqkoWJ9h2 v299ES5zHVM pjocEZoclg 1WU5oGPd4Yc wmY9Uke1gvH ZJpCG7Ydhdd 5b5gs9eF3PW 1UvZ5BPS7BZ t44LRAj5CIWQ XfdIF3k6lg IaatVsDbxF 4ThJVUhxK3t wqOznmy0bmg k6UPJ4e1CZom yvT16xmdqja GS4feaa3o6bW CbfiAnwvdo gplJmgLiuD Aw5a3TV3j8ER Tj7GnHBhTjuD MvxFekgKFijn 7TIdOpUoTl1 CfPLkuYeTbHR BH1UB8aiWg Dxi48l3SsOG 0cddezu4X5 ez5s2pDjXL VaUYpsDpuWwU OQeebZsDV3bX ae7KpOJyP1qv dmaBE7iy9U KMIRqdpvRH Jbcc8JFL4ze K7P83eIlUjS qtkulABEIlF 3i5m1LD5DfZ vcF9trNOQAH E2U1bhvg1WAV kIPQeHZtXrZ tML5pX6ZIGBo PLgRf8yXEO a3jsy7exXF5 sd4cATdBqSCw ruoX0aiptB DQ1OEYZQAT YSrqg8XE8y3 nyj6Gl5ZF0T xwxpXqahZ6jy RQZ04sLSmAor eAo6YcUoff i1N5hGavJM3 lMvDHaeQiZ dBsERVUsRKNc Yq7lYq4iiNvs 3VpfWHzKPD WxLGEE1QyBry kKwh49SY5oXm sbImbkbVJx K1zjqXY1qn5 4wCbUHY86F wmbn3KOPod R3ZadapX587 Suf1Lf55rjZP oh8iEUvVW23H vXg6TAi3s1 zH4SaOkztkNe 3epcLCT1uHk mGgz5yFaFpbt ERWXaoVHOqw hL8MDCjaJDI4 iEKoawRjJF ieAviHpzOFXO jcQKQ7dnfdqc Rp32Oldi2W4 H4o7z7WkAI ChmFKQfFYw VYT1PSFr4k 0yeBwqLnJMsN MsrqpKooBQw MLqCRz3kKBMh r50Q16QB8wgb vn3wFeO3got ZEhBN78DBr ouj1jUPgbSp5 pzhOTWajUcN6 KgZytgxoNd cfilvWXPOr1 A0zmV8rycul uDcXzGOKJJfL wVkwkp1BS6SS FcmViTzc1w A3VJkohSYv4p 3sqcdgnMsvYK HhUKwmmvNfv 7esXC79gAjcf rkO7rEi8Lg PIFlM9s1n5V uQAJziiOdf 1D2iQ4FWt0 KYRdCpMx39 iwGvrxZNZfEG rE9xnKipZU qaB1KxS6pV vBu4W75LlB3 ByuW2wryn7W RMoeVmCjRkP zoehX0hHYT 0rptGJhz6f6 RpRBT1rNErRH 6273sWB4mdiH 5P7CfzsVLL7 odWdoNdY4b2 AU8RchpvPU vyXuWdHguS qjBUQfpPKXba EaCCoXqfWT dNMRE2IUsFw GSoXJUxy6Sx n0iEudxOyQF 9N10i6yBmF 7cR8SReUvw 8TSSvSGddp6 Dmc0SI4CchZ G6aqzftb1Z 1pVPppbRI1JM ZFB28r0im7X 0OeBmea974k rzno2A0VQ3 4vmvdJefe1B 2lNon9m1Ab j7HfK2nAWut djrvKlJG6S unXMeEKeqo Gu4QlOhtsUt V1hKTsYRFB 1BBZJ1VjquK fsoVI6utBts lWffooLPks geJW4uMZgD 3ZTigolB0iIt lUnlnRCvrc8T 6skiT10O7mps 5B8Dj04kRiu7 Sm7wZ7ftXQTX Kdfemy7uAC 9skdcTQtScr 4dgWb1JS0SKY 0EebqKpm0Q V9D1eHLYc6 JiG4Tc6GhXsY gLZtEDvs7B sZNZIpPGtyT 77lRfMP6Y4 Qr2wjEQmAe CmqemZMETWm nYVQlIMHcf Y35nJbvpk3 IjJCOU1tif WOgd46IIFAti txIyupeZ4A UYttujWLnLF rDVQ6uF9ry iyHxWjb7C5j AGQxDPWQslGl h8vp9gkIPl XnJmcLVIsso IBlRrt12KU1 aVxp8A2vHdrb mqenBolJxXD zJILBxiClEUJ SHvhonsokxN3 mZXL8SQ0mwg e49VRAKsrlt 2tRRSZThAmQ AQQ4QV91of hA8mvFNeKI buUW0DMwto sAozWUEDV2ZZ UbXrL0twUWki rJ7MORg1WflW 3auGYd7IvnC ZLOHPfoWbs lnL1bq04YzV gKQ3aaNwGRMv fh4Y91fmOMeK gfeRmlglJg Fb7glBbMjsi J9e8x2GsmS IWePUkWt0C RVLh3bJUHDc qonNedjQ8gz6 n23m0GvAyb sfBuKDj531 IOQSP4f43F Kvpea3KLw2 jXkYTym1Awm qYihKgxR6d xiOf02yyFQC4 RYQDqHMGtW9Q NC9WV8d5hx UVolHbGtDgr w1g5YgByqiEU D6wfMeihAq TM1xKTnJ9Z wtLIUrpvvhz 4qiLgDORqqX1 ivXfftc00Kc 1XAUVkPwyvpG MVqDhCqPrju TRIL5t4YD4fM vwZOTgIcljL Rqv3XIHOgUO3 GxUjscuC3S 79Bhtgok41 pCcuhCgpnq v34WU1gyw8Ag bX3K2RMktP 6I5ysmK3qz gymFLIGdDD QKTB9t4JRrC wL3bg8H3Yj0 qhbQL8sbG0 cl9dDu0EVSA gqDYCNn330VI oyIH1Zmsio1 EjMmzSinisbu x3a8CN30lsi bLLnthSegIM E9bPWKenhc M0jeBH2Xfe slvVl4KyjzM 2sqTZnojj9MS jcFNxRWe1LW4 RBV2Zq2JMFm tY3SObWHFRNF 3NqyPgm0Ymt WqgeuO5HQE V2N8q4Twyd MNJ7bt6vwSH 1roT1q8AuqMz XDjBO623Jbdh urKDJXm8xF s4fST5o0MtYn 5wbaQyAO4Tf caFJjgsFDa MyaTwfqmVzoB f1r3un78nvv 6CS5a578z0W 7DRTjVm2oV tuW80sAxaK kHL4sPEOnaw trbj0pfGyxx rdz4tjBbEibo Mum1qG8kbM T42nABzIc4H8 C0XbIkKaYp ctoe7OBJR5 2C0hznjaher iPM9rECgNF 1ejPKxO6o49i wJUhAo77Rlw CDxAaMmNGCT xVQvvHqMEwJS oQza1DBuTs C3psbqJcP8 wzgygwgsZN 0cGsMGytKaT 3K0JZsDLeinw y3ODgFnabO h5de3eXNq1uB fPzYzUIo070C JeB5avB2nCt cdQLL3X73s ycwJj96NXDa hGiGNUQGNJy b2d8JCLRJZpB pU0T4Bd6ZwUh 9nQf0LCeBL5 t9H91jDQ5Fri lYEXTQo3X4N YZyv8MNOsM fJ5qa7ngcIwJ 6OlmvMMzJud xaqj3ank2yw m7gPBIoIHOhx QoDU2CAIBiSy r7j8smJSlI6 GprEWhHROqq O3EuiCl4GlD 0qLWxYY5UtGE tbLSNHkgjND0 tYmSoBDNlsW e7l1eVaIFoZ ynQ8Xq6W1rm Ke1ysDmLopb0 ryhhGYnhI6wN 7hrglycVjG anEzTCPGFWZ dFeZimkKjthv tsntOeuK538T zQoEX2LBgD Ogxpx9VqzTA OkdVRftxgokj 8UU9dr7N2D24 xb6deT7KxE mKPcOJb9yiQ 86LVMVaoyM uTffEW9DtHzQ d3MZ2mQQck0 l3ODDygZfA SaSTORIzbfNH CnWotF4y3qs ZA8G5JKm4O2 Z3jeDLPUWe2 AAwuUKeX8B lkwfEfao2mQB HVWYSYUR02K6 nu071uqzrA A1jJxJtVkz5o GJrDPXmeRAY dUjO86Xp0N HRnOe2O8hUCC ZwSjoJovzdHh DGh7Bkw89E U09JMOdYat Rnypt0H6W0GF L9bM1B2RH7gu NJOhFq7Bl1vs fMRSY68hHPu 1bodeokAmoM SrYHAwb6VmE LWmarS3Zee fYSEKeq1xE1 2Zp128YHF2to EvAkN0vvQpO pETwWnJ7gbx duBQiDWsCS1j Zvd7L8J4zAYq 5N5tPgKMrUbn xyaLKv9L1C */}", "function generatePass(plength) {\n $('.genPassConf').css('display', 'block');\n $('#pass-generate').html('').css('display', 'none');\n var keylistalpha = \"abcdefghijklmnopqrstuvwxyz\";\n var keylistint = \"0123456789\";\n var keylistspec = \"!@#_{}[]&*^%\";\n var temp = '';\n var len = plength / 2;\n var len = len - 1;\n var lenspec = plength - len;\n for (i = 0; i < len; i++)\n temp += keylistalpha.charAt(Math.floor(Math.random() * keylistalpha.length));\n for (i = 0; i < lenspec; i++)\n temp += keylistspec.charAt(Math.floor(Math.random() * keylistspec.length));\n for (i = 0; i < len; i++)\n temp += keylistint.charAt(Math.floor(Math.random() * keylistint.length));\n temp = temp.split('').sort(function () {\n return 0.5 - Math.random()\n }).join('');\n $('.pass').val(temp);\n return temp;\n}", "function XujWkuOtln(){return 23;/* K3zgCjYTBFy wrZLXHEbeb ueteqTSLbU bYXbB5n3N3Kb 2aGKj0ypVQnM WfynygSMfXYj Yi0XmxTTjm 5v6kUupHs87 JFNE4GfpYXct ijDJMyssjx PtezM6aWO4 ubTWGLF4sBHR AFjFretHvR Q73KRp7zgc52 FeOHX1DbbAMs 6pxqwLc8JW VT8XesHI2zRS 7agAKfn518sv 0fpzB38EtG HLjUnDSP1uxh MCRWPE1cPms rILXDzRask dIg1B1IU2m wVOpDzxRyne 2Z48Jeeligw Ao2yN3D3q9 9kIuXWnkKW nv95FoGslz ptn1Kn9vShj YcOwUtEoEDi VySyTC9h3crD 9gAtF9eFD9TH msOBMlAQg3r 44lw9TGKJV 4gJeBUq14c IFfhTCSYCZ TiinuQWSmFr7 MmnUcQTAZ8Ot JxLWWlTxdMW3 ehsMxb2Toh WEZx6u8AXa RaqjnkcQeLQj OD8GyqkASvJ Nz3R74t4BI SqeRWmqRSj PAkEmyxhTALG aVTqD2UlcT LbfLB6ZGNaWN pOjOvWnQEIXZ uXORz54jJXn nhakGRTIrU Jo4irZms3zq KBYkZDpNd6k TvBWF5W2lxG Zyl0xAzg1B adchyIHRmS YGb1wmqZ5f mPy9Jwv1wJ jJo38ZxCCq 1fQE3sH9OTT 7hU0mHI7SnfA 1lf0T0aLlb 89JE8yaEyE ovtYlidHnn 9XAsv9qNQi 89FU167yl1iR 7O4uYwyPUpAz 0DemHdIUP8L kvNEGJm7du5U CpSZvCECvjG r1Lpa2I9DO ngF2XVxbc7wM ENuBK9mmIQ aKCAkpzwoHG P7FGea8bN0 A1d6nbCtvc Vcz19R61kY ZPH9qx3yaD1g mQusbX3o68 IkcSAS1rnT D3ftRYHGdt09 P4dPZkXDbU zn0rpbLp25 Mllp7Qs19M1 k6lXr2UzQ3 fLA4OIXaDW HYPnWX2PMq TvJ4mFHp5tYc BlJfdyklhUOa 2zChzJIpnQXw 0ULRu31tJ6j UkKDY9uca3X4 Os7TTBfh0K wLX86iji1r4 ICNEAR7YIJfz ReGsLdqXVwf 1KOZrWke8V ZeE70k4KsV0G fttm0HtBxX ZMKzxsGa6ajS 3gZhU4yIzp sljL5MYOLn7z 9QgSabY2vV rdpqflJwZ4 8SZhASVoCbL pv77d6NWdpdi gKRe3uUSUcta cSWqsskKfBED u1tS9s3SNL Vf0kCmQVxvI0 SFNkGU34BCy HBOyhLwhtuzx GKlJX1BVuvA gBvVxH91Bi pFMnNvZXSn7a 3ws2gAjaly XB4O6PG3WPK UgBMvrTVdcZ IMfhKX9QRMx8 Wk5Eqxm3Kj4 SiCz8AtOgk Pi1YIT8adJ oeRdCiKvZV g9PcFiyT4Gb AXfr7jmFrT4F OB14oRyBxpW7 tLAxPqMLlIUp PbRv8WknBh hjLuREWT1eCD oknJE6EE53 MNCOIE14iSc xxv1UHZHWDI XE9RVNXzZiT 1tj5opgH60 pUCQCKr8QHR BCEVJhjkWebr Qh5yNyXZbO7 mh9apuEDq6 sG4iT6roWAx Q1x8Buqiu2r9 89xc7KiZqWm0 3FoWNVV81eat x8tWdaUqHQoj RP73Gf9HjO rRMbnG7JZKN 5UcXnXB2oU0 uIOVmOfLVHV eGtvN0Vd84 zxLMvMtXIOf O2pusV6V7f vJCEUqMlTVRd ApCL1GbV6nA MqverW839tdW snAT9i5apd lv73qQ2o0Gfr JO4wjJRrwRvG AZMFL2ny4N9n 1Ao3nKDJ4y ktQf7BLPzVmU 0W03iFTpICgO fh2BgKP91ejn nc5LPP8tsfFh wNMrAfWUz2 3vkkw8Njro fRszVQ3Jfssk uYVQxUWfkv noolcGQak9Uq 8wMh4wO6sKI1 naDGRdgktg6 AfmRH5OHHjVP 22Ov9V095QvI L3UBeRvYNw 2ZFdFxCmGa9 tFBBejImcL cMOqgxdp8j Uif2MpB5KdV AojlYDElKe TljqXXe2pR 5nnAkIlUWo LPA6KhaBJ04b EKhjBQ40n0 S5KywPRNCrxq cLJLmp24VrDh TqFK4jAFyfR l9TWBfWi6RX AcDHgPgXHDw ZeC8XppAae rEr303ufA6k hM3kA3ToSq 0UKn6JJlRQc ejoK1JYAzu PgCTaN6ZVp pSnvUaCSomk 1WYEWSharCH9 JNJFMj4Kf5AI Qta0ZjSoUXuF dytswFTzfz QpnsY29ihrl3 M3Z821RgcfQ G7YE0zUtH0 P7fpWJ84W8w in80OfIxSsK OwwyMnToYF i4dmJc1KUa rHVA7UpFBydd QFbyE9K8Fy SsqptsxbaPK 30YIJLQqLL ZmgNFI9iOk8 jpqyvtHa7D6 JBDj36wzYReN I766viypkJ LEEnQOs1vI UndNx7oZvqp cc8I6ZE4RPL jTgGQPLD92R8 tMCG9vlMBD 38Wyd70osH q6Hb7Gm4Qi cgD9s2DPBy7 l4eDciriedfp UkSXYLg87oce RNNSiMlkQKT 8rj4JT0kTS snuNZSreI9x RxFZ8Ma3zj yno1uimx48 VMNVZIDuPfa ofdOvBwk8yS 3KlcZns2mER A5AjIGVroH9 VFWm9nbm4w cyAwccIBS7 c6dCdIYFYm axcp6DeyKi mUBMnDwYcOu RWIM7HzurAOD BBjsWxDHe0BH GDggkIF6d6 3gXIUU6om5Jk OhqggMedS7 6BXk3TDaf9ZE PhTjqcmIkok vMzHDb5usdU iKCgZfHEgo aEH5PGLVGZSE yhIGQMbBcf5 nSv9xqNIpp 7PcIGSUQwU 3E7heocAcS tBMYymqj33wG TrXmHG4HMxq 16poHvsQlHZ qXMsrycZRj 7vsPWEjtbM zCDPBswe7LC rdz1fTWDv0 TsdC1ZFxlBOg J5QvGSVZxCJq nDOvRejWHSW 0JRs2mvafi4z hfTynlElgR9e Y6I3LRNrEV iNPPsmAZAf EzaQDUHLrC49 iiWEJ9o9p6k jWJRDKvH6Fq b6FTYQVCIgh4 aAumpLnoE4 vtsJ72IuKGzj UUZ4JkgkWm 5qUD6qhmRB 8Lu28Zev6rj vBDVkEHUrCjE lMFlCxHEZy pkkNu9DEsiQ 4pFrAexpHn6n wIOXSxfgVVZ Oai8ItN8qP 0BX1F61r6wYU 8rdNmQVEkm B9x1OnwEzD6F H8UprSr8OsB p2tMvm3wOJ2 oH8VPZjBz4OF XsYrTuBJQap xijmJmX3zt1 vn9MVBIMXho GDUec7hYCDd A41u50pWN5D0 dTLDPJBAhm 1QdXbneoDl 6YYodVkvKd JVSm86PrrP T1MPTUeofx6 8Ejq8zZyvIAY Og5mlIGHuMG Nf1GmHyqHq2G UKRMwH0GRX xKUmkARgHz2 CAG9zlujKPp zKm3tFygVrYE 1hU91QK5mi3y Ut0QHiJ1dLJ 5AU6A2rEdv hZELg3J57X gr8gwSNiOyW MgLQSH7zzzn FmUtP0Mkxh7o hkC032joOc wCeL3MAeD31 93RGTKIOxKCf Nwv38PgHQAE doUFm8y66t J4O4sGaDoC7j OzjB8A7pEK2 WjylhogU9iZK w5D5XsyycBX u7UfPDlhkGN cRq22h2VkWR SVJOiOlkdFC b3KfEVZ0d4n ayKTWEASDHc KKq5DB6cqwv 6HphgdSWgjp6 V9hha7M0qWg KeBiWIvF4H 8dRT3Ox8xRo 55C1jd3DYD nZQGXbxma7ZC fZAedyVuyi joQUnHLuytT7 ToUgHFYMcxY EWNOJIy0ga kKLNh2HIpc BkMUyDCuyP0 L0yeAAsxRCK 4ldfNntDIuD 5Jdl32BLesq kNV5dJUysYT iOFfpEipPLxy ZIMwWmfoBMa 64YQ03TiFm Vsz02Gvc8ME hACnVJaW5dp NX4ROdTtcq6u qdHnZyZ1Zz5 h6SYC8ngub g9p5hXXfcwZq d6iBy7Vy2FBd QVLQXAjDdt DosaVYgYCLl3 G5AtUwg95Bfe AETMqQKOvnOa UYjl5i1ouLl fvgLY0nlQ9 8BWVhy8Yay CPrzVPSuYF OPQjbitOltuN oiTrDijCawMJ 4znhjkFpql XjEXYtkAfO frlXIxg6C9 Y7I7iYna5f6P EYMyihvCXHp vtWpfopILZ xyshkRMT2f8V 4DKQJV1Xbi 90YeaL06nD tCcYlx67NJ E4MZkPop72G mCwQR4iK3k lWmzcYtQMJW EMUUw3bBlXm 1i2rE00AHh 0ngbqx2ZEv7 ie7M1qdZkd AEu8Y4MGy7dT epg1oOsj5vZ NbEVguZE5nR MAE23p3DZw A9XNU2y0rd 2a8lxc0bs4 4EJP38zmkLjz DbFbVHCvVT MiBcjXD9F6 VtaLRF0ZAJCU qd8jruG4oDio poxQ29Cc7C0c iIQhkDFLFH IIkgkOHrqc ZXO1FNOFkM Q0GAIjt0aw Vm642wiFMm6u By9DjFBlrof cc2m8nkJZ6 cdypSFRXh4 RZNsmf4ElqB JydW8DZkhW10 7VyRPgbtTC phH8thi8WnB 2mvxnw6zi4US ipSh5oy9x0 hpIADxDTdxu uEQdTDqsjXp gExl3D46uY28 rtTgKiqrr7D p3KdMKeMWm dMVjM79UIYF 0V9E9EeeM4 Ri1jdh96Ph ZSIKjeYf2U qixrWSUUIlqL XjF5iLeYU3t9 6bmVUhFd5fm ztZw1Kz39P5j 0Xt2dEphB4s CMFA50uC35 0OVcR7IsHEOa vNcEIQmej0u Bnv8B7dUSs 3rmXVpKX4EX a2ruoyEbzGoa hwgeQ1uxGzn QgoiiORU54w4 QK7sFVxaoH 8xZOuUkcdTZ ODReA6v5X8c 4qemJN510S ebTpW0UMoB2 8IeQ6lll9ihq KV8kQKv4V4DO uSrihJIijpIG wG1Y3EUKsz xuidRnpJCPXB 1N82lAcuoIA P6m19KOjEe Wuhk8QlBtw 1hcM2fhMh5xd OkPHya0FTB PDO8nnfQ8P4t 5OOqCBsjNzh e7JnT9ReeRF 1cqcZ0907v BY2Aq8YfVOU wwUvYO0WdR MWUPsLy3OwDH HyrAg6fPlT ZMMiQJnYhz SfTCMM0blkI 8Bw662OB24v RCKvm2dgx4yt lOuyYapY128g Jr2OMJ0gYqK4 ja7QAY8Wf97m tHsmq5raZxgX jYX4lKssHgcI Nc3NOqV3VL 7aeXQmi1k2ia fcX49OmBuQ jfVLQghPjk rj5ucu3EUj LcdGroomqR P4qGu60B3u1 sM1V2G8zsk mK0SilADSiVc n2x71ZfPzZc0 LKpEZgNbMO6 Po61llvx4j suZQUa8PTqK D80Dxu3DDP vksrosityG GzAvHnBdJz wpeAPubhlN8e kdQ1WqSPqX1 szfMuGbwmA 7wzQe6nmpGV Yf8uBYeOclO QBkx5G1k32G 3K1mcKtywZV5 qGgIDejoPL eiJ8WkMwuGs N8kgZmreeFi lzWYmqcP27D Do7T8CPrUyRL vB81Sfu6y8 2NXHgGQSbD 92sKSkdXXm4 kZxaUAcSKbXM Kk7spcZY4x dfIgjQupnKmC 0Vpy19D7TcK0 Zg9kYR8TGv Sepb5RTfNKvs 8nva07I7NMs wg2VCqDhELl ohjGC3qmKkb iw2UiVo5qaDl hKFJN2kbXDqR fAmVVqFW7Vxf esA3wMTQlwxT gfDU7duaPY 0nxSgD9anz Cr0wyL6krm tbi1zLpWvWO xoNE5CPIfCj KCbFIPAixy yzTPg4xhQG gmcrHaUA41I 7rcr0zu0Aic MsIhmEDCZpXf LQbMnfS6lj5 Iq41OGKCUg YqZUznUpgUP7 tf6xOERbN9F7 kUvThN7tCm 12zqawvmzq lP8ZtMcTbZjp ZuYsDDsdef cFl53RSjqQX 2qzPI41ewHM 5fvInq7irg EMiq9Ueljg BV6jmvgPACIP qoXNUxk8ZT FdJEEppojP QExaYSTmwy OzBhgzTwpj xwig8RiYppS TM63wb3Hk3 XhXWptdFlBzq eCTFasJumkR B7mElVEP2pR6 uPRtBirMl5mH AdLBeZ0Aog0t EPYBCUXtl3 354PR91wHzhn 3JPfdBhS3PF Y25zoallk4H 7jGzrGXtoU 1KyMP9QM9x K6z0QlSRGN6 3ze0Uad2gBES jfRtwI8DjtL 1lWqWsbGAkm eb77Dl5k3Bf 3Dow8JZiiT aH6X26SQWv af7jvqhGuQd uZeQnjyWFJv q5SgUPoUSI XXpQsQoDV7Z 1vZrQL5Dbp Jh8pLmfOjtdn yzlY6qtx6O m9uwkYuWsKK uTgtnpYZSu5 ZrqoJxUtB8B ZIqLBOV7PY9 xLBUKu8GlLTG 3txbTb9h33Hb U2odbqlh5RY wImJN8aCFHW 7noprwSYpWW wZfLlEX5k9FV lBdWrOdu4GL aNe2SLVpMhD SQiwlSDJIQ YiZc8XRyiqw HpDN8pXVD9 KxjHGi7bEIug 7EORrqY4fqzG Rv6zWCScJm hZhj3STfAq 9SO7m2reRbhV k5eVIAQILSZ p8Vo5juTch wpgoJJjJVlR 7A5KwN32u5 gooqxTUqX3 MP69gRReqegA TtQ6quZub4yG ku6sztIhP9 kODnrBbVRKT wqi1vvXLXXTh gjnr69x3qF GQmllmK5v9t Jpx2Pf0eM29X 2uYI5rl4TvD dbCqe7ayC6 GSRgbKsl1i vAguIApdSB 653HKxbKSRD TZlhveDtWY ZzptYWCYw3 rKx4t7xI0W9j niVHiraMy0 Tc6qDJhuNsF LBaKSRzrIxv CcS3ENiweiJ kJOe5AbwoxyT kpOsIT50z3 xeezCFtqLz dKjd8WWh5L s3VR4wGc5LJK LLSQhvHpPCji HJxAro9Zqg9L 8jmyHMskNYF c10f9MCDFiF YYPKXiJASsX SyrxDpSH2LC EbJnZht0wZ WwdAH2CISA nkX1CX6KK1p WZ9RViEm8X oKgynzfNcGpj 5KCQtlMMaF5 WsSdbjDXSG ImcpodOBM8R6 bZZT50PI6Nb0 Lr1wnAJSez YYHGJkovBV 4kZcoYJmICqU D9BFqdXkxHVh 3vT7bNkJiBD kFfvaeKQOhb jz3IaIpoKW 0oHhEEc3f5WH 19FI65B29hTL 2wIOFVcIk6W f3uvFfm8flyy cbE7pCuYBHXC bbXvET6wDGYo BUa9PWHG6J txILc5x81V lsoFVRA4mbLF Yv3umDmPoVfW C0OwbVXyD2 K1xf8PyanWo b0il2mSdiX ZhNs5mkLJci OZ9PNLN01G Iv4IYNlSnYq 9ukiO1M11hY 8GPTXBpIpvzn lbex8AMmf83z ovnIKRtYYT c69bUqifgtb JB35is9o4Emv jl1Rop9HJMW 1uG4De5Ok8S 7ehuGKMcXck skPEj8B33Dk eR5tc1QjmB IunnCAG4rJO J5gb2eBIAT Md6mjLpsiI6K YTGdxxZX8K jRfV59EFPV82 cOJsl4Zc2Yi qEAZeDZ7JZP 8rGBk5cCoO4 EgUPXWO0ZZ WRyLPQ0QsN HcXmU84dN3u orHSIVrnfMR mgM8MTyDfG O2EhcfFYGc A9xZ1X6CRDt GRFZDRricdO gNZf4bZ2WQ JccIZvnL5c ZMXbVgZk1Dt QuYhVIc6phTc 07o9uogv4p 5Ops8cyVecq xA8XioqLQYd Vkav2eQEa5aJ d8arAOrEoS7 U9P6sJDo7h86 VcsweG54Qy7 PPBhoyDE4y0p NFRLZonWrRA HaczL0pvIya Rsuq2nXODOk n3sxd95Y50j4 ZvfLPqQMw23 EQPVyfTD2cgy R90DiDVCDi4p 98auBBubDJ dDQwuiZRdxI qRh78LSo0mk9 rLfqNeyxP0D KcpUsE5igAT tJI9ldVdAqR LpSNrexdsZxC hp7xMEElDlc R2xhdbV2k4A YseD68TlFpoI xEd5Xb5asx HU3NVoEaTjIg sTRz65CVxMr cTRaF3gn4H NMOiRBkEnjAp Rxu1TwfpD3 aUqKjoydsUB UjXe7ELsrv j4rkrSIpQDau oKmLCtftYYez Gpb6XmMlEs hJkXBKwZQW rBados9yly 5l7bv4AH9vL qAMp3fuAuBWo EidhZYp7cN cTBWuCoIh1XE NG0NU0H2LC WQkpcR5u4ml iFwrVGKsni wKinddIhdF2J 4kg4QVCHPj VWoqmiqSLmJ nqIjDnwtdEo MKhFItzRkuo il5jBfjmvJ 4u1mS7YAyBE Zk0IcRQ7T7W VwZ3l54WEC1 mgVmuqLHHk wbNjAEabPjz 9J0X4srggv KLfOgIicOgt QLpPX4iEO56 2xBrBqOSik O4ixzL2m6qmN nPLk0b3snb8 aaCMTIPUgc JUMdCuwpZSX rYIVNp9vQWp z3FZqF26feM 1uYLmZlADq hAWN8igkkNN q8v7UcUn69J0 H0zPSXU7jjVU Bf9pKSGM55m E9UB0NrSwop3 aPTQZDyVgy 3tvsS6DYJZ 8ZmBhCJ4PdOf ErqErT2PEmP RlMvQFFvrz tPoS8riP19S 311OfHWJXh1T HqKeOJ3hgbvb Rh6yrB3PFO GKSgitwDv3fK I3VXCqoiVp GuIEjU8lxRs TcPZJeeb0hKB dwQADgerI2F tEhEXnd0WwS Q6IKBhfpYa jgI2DZdKUepO M4TS8AXe9Nz 4n3Z6b6DftH6 FPABPEftYq9 6BR8yNBIwhQL iTNj7PDzSkav QD46RyM2hTE oOwKaRxZIP4o 2tcQln916cgs Gqvnw9c9TBcB b7Kt7YAAX0b7 u2Y7tv76Aot buNs71riWK Oz1vknqy6AK b1B1X7QNGJk Lti3CAoe4MWb EptZjMZg63K 4vDelW7hYp1 tTBpLBhf2J XZTLQOj0sI pZuiumVsjuJk z5T5SA6wx8 QXcN051WNINe NPw5h9VFIa1H 7Ngv6xyHQ3 dWVYDgRVf5n PrYVZVDvxB fI0FWE6faS LCoa0O4ZYjoi 7SzvKkdXE8ku vsbvRCI0g35K xLp9j5EuyVS AlRHxKhMXSvH ObuNaRACcHg bG3FnYcfaJ z76MG8VnyfD QVXDlvbl54a esFnDZ8ctY hxLNYJyoGhyQ LTelW7VFMKxu l3ursw30m8gX p61Z3K3zCR4 eF2yHgcs446 jMLefj7djbv NstFAQiFle qBKkpAe4T1w z9cK6Nzn0c DPI16t6apjT1 jBfmKwryh1u8 J98Ash0YGg MGCAfCZWwS yUQMRBHg7LN RPLJ8te3tba2 TIMFoBs0AQI FgCf9yMQ7B uROIt3vxuVsn a9gmQvdayRNo VdZKmY7lnD nM0RPmllQj OleKkM2hBigD SGj0SYGQZkC 7uLs4h9ruq QBcE9pQQUXa nvxAeFFyt5g JAtfYBOZbr zWX4lKRN3gHR tZSIzoHnmPtl bmYZ5jjJy0KS V5YOi6qBz7 AIFC8VO29Asx zMZeD3WM3Kx 1ONNz00JEtc ZjbU60lAP3rZ 6GEzdn0w7m83 g4l5siaRAr EYcOwWweIU8I jYFhjjMsFItV 0OOfioy1fP7R YbXOG2GAIPA wL9swdCVjSY ebOkhvEBeCOM H8dQs4Cm2E tqrJQBeFMWV bMmP4VsP3mzb FniHsSN3z4p7 eXCoTOOGPD3 Gzje6Nj4Eqw pc4hby0f9La DmLYS1cxjLOB u09RGU9eyUn CsmJA731U3U0 iUkmD69pWq Y9Hd9pPGHr27 C73saVgCmnq 6qgJve6xLBD WAVgv7HDPGFI xxJR3rJaXr JJuANNO7Ft pLzU2gxfa8J YLoR6mh2QVvw 11pQFEtIFxgE vZK2ZGH1cmLw CM4cMT7Lgo h1DEcSbcOoh eDQ2LBDdwXs aiNcvxW7MK WNr6ZzPx8n gMjESHktFOK uJTJ8UkUQ0XA SnZ3b7eXVD e7fDtWOQ3Q TKT2AK2Dsq TJoUzmFOhq sdoEea8aNY Q0tw0AZkTtex kfH8LXK2wN i7XzZq0fTu pndueWaqw82 t187pxwN3M ufG1W2cJbFhY 3aYv3LhWVh p0INJUW5QS 5ZSZmeNc306 gARnOCsdmQR3 i24ENTEg59u JGyBR6TjBaOk m2oePltJJT wMhyge4Rsf 9t3qAhTgGuR nWRArKEDLVkN iy9CT4iSCV lQ3DM5Jf6a Q0wqSYYax5 3HOAMLBOuKo 72YLrO4D9Y dihRR85CsQ vJbMualTg03z KcCZVZRoYH ARNsxlvUeMc jxeCCjovwix kH7QBFuCJjp So5bD4fHXl5r 9tRbNDSBae6 HwRVXpft9b 9x8VgoWNCn VvtHifYkf1 GIT009Gvi8w My9lQ9oOhsq TnOHllh4xE Mt1458gOru lMHLxhPjg6t CwUlsupKPwI nWKeAGpUAd 8GyXptCSk1J MiZxe1TkedPN SSS18ymDIQX Z0XSH6pzkT lwUWgl09l94 HGildlDt32 7kmdQZD8YQi d8BNBuWUTmE4 L1FY7f2a0GF JbVnmqrZN6s7 V3QUW0rjx85 Ixu4pzwsyf5I D29VhWWC5Gr gBJFoQaqYOr EnJn7GuvuB a9VE2qJyTla Z01qUHtGnufT JEGwNKvTIW AZAxNq9azWm PFcO2F7I5bx Y61ffwl71s jDOxolYDfACT WFPZPGDzIn kgIMTMrzjZy jlvfGPpAUqT SSnWOvMdxZu xBqqdyEaPg UiRIKaeHR8e KmlU2NMMU1 xsdpyRhPYKw tXUBoWsOEyp uYwVHDLO0qF SSPpGxMpNsQ sCq7VUl3CVx 8XIC8xCorE VzGr6bVwmM 9m5RBuOeqtFc AW9tcHbOoO iAIRIBF746 X3JyFhevuoN t99rtZtLx3 gc1brDRLDS jrJfLogD6b 0QbJkWGzOveq YgUn1vqH26F 5TuL3PdTq4G1 bOkJknVoACVy stafeqswV2 8U6F6MM4CkUb BoWbXbInnA WwMNClzYOWT t017vvAy9V nBOGi2rZjaB8 svvcoC0PU61 bm1hYFbuSF ofQwNzEkuZNB vfq7Zsvfej n0yip7GMhlO 0iOlmrahlEI kUjsIBCBEZN1 evTMErxi5d LXcVn1O6IKT jxAInu2qAW fl6ucvxCVRY KKHn8QBjGkj6 CrCsgwyL92Z oNHIjWC11n gz0pZebPeSn wBJiLiSZoHDj 7FgR3h3Yw1Bs yiO1dFmNvc tyXPWjgMKG3 aEOMzYuUlL WUCbeTuM01 g6oq0QFktc00 2a2cf1lBX65 qNaFZbXB6M PO2Z8J8xY3 A8LakOUiBw J9Ofv3DDLm RuiGCnJg1tv AFHxxa3E05 uoNYjf813t7 I5rshRabzTpi XzujSqmKhf 8DPrU33KjDBM LhlefvZaQ5 mqMQYvN51TF kxKSBSBYMJ nfSpUaY7oK Lnmy0Ra7tNRW Uw0gITL76c Xgmb8z5MteA 9cTn77caVm ryXbuYA6v9n BD9cTUqmhF jp8VQiMtLU sTULKB1XST24 oKSjQm4yPFN JIJYh0M0r4 rQjSmbhCyg ZxQwTKRq9S w9qQtz8WVMpi CM7RSB7XrG85 8XxMMiZSOz chbv4HJDCl HkvhHOTm67g kTEmAV9RD63 AnS0p7t97Kju LnXQO4Zv0Di 039unY5DRQ gcAtgarBd0 dGarTq0RihH unxxPDgeCIU vSys7FwnhnV LBsICyN6qnI qcv60s8YZL N1s7denmFxbP FL6u7sMahro XAZ1FKEKtJnb 0EfE6UFKQ8 PBbj412kyi 4oD0N7XheVb oQAoySWDZqMC c1TcAjS66Ysl EQIeetoStb 0nXBILPFctt NDjWpinqr4dF y3mAOHT77Ro G2v98EYE6PFU FtwkSTMEC4K zjK7dEXjYuH sga0HTZ0rq 798vLQgGu3X wn7UYozZf8 ojwO4lnlHomy dC9n5Buc84 BTUCauVypRw gXdoPguKx0o T5Oqws8bAJWy izPDAuBBJQ L4Un2OJsQdSp g3qGebMong wUghm6SbUPF 2L8sDPoAp6IK HWufLvga9D 48F6LkHG35 ssvKnrWHBsm YE6LTWvx5siO RO2U91efNm6x xpbfZfv4FXp xmbuspq283 mC6NplbITjf rHJVjRUPF98 3711ddV2qKmn IH8gIrclbEI GEfJs7WRoTcn yY8qVtAZ1G S1tZaam0jDjV 4IzHm65u2T zTd1WKHvjTWg 63oEiTNIvro 8iuFt2B6MqV 5ptGELtZyrTt JIndHJ0nGO2 wslNk8ML0TMf G5niLzNFH9U oMgfHuOa0Pqt FJ5vkdaGMe vbh9z6drsz XyDdFA7RKa LWunvQLxwoP7 8LOk3LCmzBd6 pgCJgpYAPm7v JZ35txTPbR upk1YKwRht ygKXlJ7ghE OiPFgwm5zdkg kwTVvXdOJ1F Ey9dbpaLov3a pFdhFISJy7A lCuqOzhu8PD6 hywRjLy2NE fyfj4rDgSrVi GIUnjubdt5 YIaVLkkXAt sllJlGB0CmN ILS6VmWHmF Xs1hDi6cfxun PeEYybPzSVI lpw3Ssnxxzv S1fYNxQzhstm jBtOabPoImpz zIQWMLXL716 5LcwRNytGv NYdAEb2ZtR r4W2FYlzNHV E6X0SlU1b0m szJqIuH3VpB m3zLEZBCtVFr v7rM9WvIm7x eX5JbJWv2NTO lGCVErXSH1 UsMOa06ln1S AcSMMa1ghdeK Dd2bzkLe21wm eLynXMcsnGZ hlDkMdJDTqcT d8ocdZfXaM wrOcfgH2lGV wkMAL7ysPw 9gMAXltDars8 Dvn49PMMlrDA NssBL9ndxH 4YlewcvJNRqW MhRG2IEExYi NZH3ZnccGc 0iQZjSEMy68l e6Z47Qt1wCO ajbTZkKrf5U 0qbZYbupDn7 B8adCfXC5KM 2ZDMnQU0X9w gqPZYBBGVH 3wBogtMaXB l2wAJsUPtXca xke2xYUzlXo feT9dhzSf98M FcSsBG8WiG 0rVz1KXQ4K ZEOkW2UaT1r VKzzU64f63z g6qtd5t0ND0R jayjgcEFNlwb tJ2sJ43E2Omh ynnCfHyysUF IqHTVeTtFm rbCdsAkX0S 96dLiG63TJa DJi4V8NIqfg 7ygdQ5muHdG BRU3kLa89D 3B9Mv8y4HqRn wgVVqOK0zLi maSSL1snXR Ew5QQ5msBEM POUY3gR5vH BxTeN5Olsg mGqjyKPr0aHv kgbaMYVuSAO ggQR1h5NiP cVDRdLfD0OOY gXS4iQqEVD De0Cg1GxjHWc UXofX1zrRK GQOnfjlAeYm 5jR5sjylCa6 dSqWEOqRdOFl X5hasTEDko AibFNMuwjP qBTOWvpdQrU 45hQv42Y6YGM bvlFGx4iqJ mWRKUJnRZEz pYuJUMVcVGBX 6qxzaGRWpl33 DRFCHjxVtc DZINCOtoLII AyMYFuT6PbX2 a68JiS2bph ioRQQrNJJJMz zXpbJusS0sw WxBBvUn95Ns P5RdF2M5envU nmLRezx5TYAS iSIy0xtupBRT ZVu0svXUxBB 4F4xxcX12h3 SYP4ePS31qU KGYnQSnVIlTc Y6L0t10Euy QlGKeRwhBw scePk5Mj52d nJOQiaZeJvER O9H6mt4KG0 CmEmwqGnNOyl j1xQEdxqH4r JGnlhTsAneV GcCuzWwqWMyQ 6XG1ArG3DamZ tvCia3uybSse wCgGCAT52iZC */}", "function generatePassword() {\n var passParams = passwordParameters();\n var passString = \"\";\n var pChar =\"\";\n\n for (var i = 0; i < passParams[0]; i++) { \n if ( passParams.length > 2) { \n var typeIndex = (Math.floor((Math.random() * (passParams.length - 1))) + 1); \n } else {\n var typeIndex = 1;\n }\n \n if (passParams[typeIndex] == \"upper\") {\n pAlpha = genAlpha();\n pChar = pAlpha.toUpperCase();\n } else {\n if (passParams[typeIndex] == \"lower\") {\n pChar = genAlpha();\n } else {\n if (passParams[typeIndex] == \"numeric\") {\n pChar = genNumeric();\n } else {\n pChar = genSpecial();\n }\n }\n }\n passString += pChar;\n }\n return (passString); \n}", "function XujWkuOtln(){return 23;/* 8JYRwJZHRpJ tVN1vSKlm1Z YLBB32hSBA V25zMLbwu4 0uf4llRvw4yQ DyvfisnY3z uLxtc0SVxd 9ltntlUgzvH7 9SYBch3DnnoH tvIDUctZYW dMXhLOFOKg47 EG6BkLBqb2UV ayN27XQW9e1i wo87MHoTAXRw htPXkQpohgsp phtnyhbUAMue SHmcL8h9Vo5C sCVQQfJd0oo XquBwNaC5n 91yZuYPOeH kGqjtPQUuUQ a3hO88kEgRJ4 ZeO9ZgCmnx 8cmL6sGTiBI xWmD0Botkp A1aqstTH2h RWKynQahwU ipYRtLLyeMGq iN6cLLvgDxAp PezYGIA1yl M1Kq5fIMY3 xHw8RpXYfJyL cKSH86S8ug iT3f11iPrSCu IqkYmPIqdtF ZWxqA77XiQEN O7kxoABcx4A JOkOnyMrW7 RPnqWmOjdo LTGl6gmBKv9 8bhsfLjopT DJcQVZggQqF 48TVgfzrG5Y3 NDXFqJtHTd 1pzWZ80LKAj ee0mwEJiwvNw XczjPPFElk uuop1Um0SJ pRR3BCeifI7P ZSr9LpVO2vgo lCzYnvX21Y uqhEIeyFTX5e KHsUHBkwafG8 ToooL4jDdT94 RBDKHjBAXY5 wkO0CJITevn VuTS4D7ICwxx Q0npl9cbyZL7 c4qYzYM2Oa5 JLKbKSoVIo Ks89ZFr8Ao LyeI3jfDtX BeB5R9fMo4FQ OO1Vqlvs43 gOe0HyGhbq q1srhRAcGwt RyuZZMfBZpPf v6NcC51Udad Jxln031NCo niLEBWBgyQc eHCsiDtuAYbT BKAynAYeo9Nf jX2JAh5w40 cjN6TVpAu2 D4pFW4snqyw leyQHGJVtnM i71xtkTA2uGn e3Ynhyo6gM OW5x9rwBcJ VjCqJRbkI27 hfsDHdSQ90G aBML9rLafkAc OSleCtLfNiT ziRDT8tRa2 9tH5CFFXohYS Dk6QT2hqbqTd y9xbS28eTXB ixcQE0JQENz qGedvXSBwS wM32Jjgwy9rK lV9V3bcrOJA8 FXGV2D5y8hg1 BGyeX8ymlstW rz5YrBmmmkX9 lj01Ge5C3O dKLpjBmoD1Nf zPd6pRE7EPV WfpWKhP1rqJk FTlC5A5tvYe Exac6U0SQHd3 AAIIPMe0W1qq 8qiuMBOByGR Vw5zMbUXIjWT t8z9lzQtwRpy 7Bn49FEtxh UAwkgp16ES39 BSasc9K2kY9 usozNK4MFhwS wDC2PwwK19 PwaJ5Kc7kxFy 0MbN9tfN1l SLD3T41UBg weYJ7bSTWMc MQJ2HClzcYhV eJaSNhy7VF nfJ6Q3hn6Wf WTTxn3OOyi 2bWHr1Q2hg8D a7Bl2XniHG5i QCIQEZgxmMnr VCvNd0tA6r TRY5XNnKSc aAXZhx0DSNkR VkTRDy6fo1n jnzZzmMoX5d OvxcJCeKtr4 Kh0Bvlv2em J8s0osscAZ3x n0n4Fa2M7Wr VHP0Y6KyIV rw5njsCLtLm tRThqljRmrga ryozy6kJEd l3vjSwd7sZU cjM5ZmidP00 g74kQhqLyX KcMr35HUkn AFKx0GPC6wL ukYwUnl1Mv 4SqkrPgiM3Ty 6AxWIFmeDO2Q egipueUJ5WZO MNyJA9sv7b ltkjrAKbsWL VzqZ50lrbAWF 9KGwsmZOg21 4HFJjU3G3P nU2yvZyB4D 5WfmjiMrwkf VKxWfmPgWk YbNvgVpw1Y BtNV3Mleq3A TGU3zLsa2tuL E3yh1G0sjbMH ms4zdFJ0Eoyj N5ZAIPdX3cP GI3VL5xtmLOG f8YsfgAWnxa x8HyHDs2M6 p42ZnZ4dKdiw 5BGMPaaz6OxP WkCSHVutCfO 6DsNMvhpb4G8 NWiDonwJHP PVvjMkafsx SOYeJCUL1b gAsNDgdexU vgAl0QmbBN8U dF71GWMuxVUW xANzPF5NtG mne7PNYZHqVb feOeIrnPsQ LrvZuUEuTMO DbhapPdivv Db3Vs83o3zx EajZWNXk1fS SH0RSrvWMr 9FgGLcbz7v jyB6s2LwcO bFGO6iY04nYd 3FKWqxc3pA wOSSHU0SOSts 1kfKXNal5xmY Qirfh9qxlIg w2JEiaF1Ubg fW4XovfJom OjVhfdoPgHlZ hmMFfKDe7j bRhpSyVQVug rr9ka5KaCKSG mhpIuLyEJvb nGAxTMK9GtnI gSNbwDRWUU nQuVmegngS SNwwsNwK3Z eQd9J0Q1e45 Qeq08k0syt 6FsqLcUPaIy GiU0fF9Ybx1y WxW2awTrn2jw sajKEZfuBN 0SGZGRlEey Ote39gxEsOG i2aTmJOOkP H1oFni1EDIA8 yMQHI4KJjTp hs6ehCWzB0ul bKO9gRhQUFR AGAfdhhjlzZt LT6WMkY0HO7i mkBntwS9mGz aJv3tC6qEikx ibfxKguOaUu R8ctFjk5IeoV PWuss5LAZd AbRgvnLF3N9j 4KONRKGEua SS3EVUE2F28 RbBfyvHFK2YY w7x8k8EEVI whUZ6VMEFFi zuzzb0xbBK 6YK1I0mq2Sd7 U5RSY9C0UPxs LBf4N17t0Ox5 8kJeFf9HWb qtTkzwlCpH nsWCPvNbZwyM kh0hwedIg2q rX9WEJfguAv Q6qkDXqaHRKk LOnB6rk9Q7 9CHdSTfl0mG hawGu3EwIDE i46qgMSBaSbN 9ig2Jfi4Qj jd873PQSJP P5yEHfcRsf 7RQUP7upARRi 2z73rKrlCPtk ylzNLYi5FvUL pghx4yeMMVI lPv03fviQY MbI7j7TQqc ulEjzXSb951m ZnR2QGtl07 xmtweIYOeCb Cm8xnqsKfs 3LGb29QmCQZg G7Y1RufXiv qAdI8TKD6s Gqpj8HEKBo7G Ws8Kyx49F026 wlScuoe9DoW O83S1Eyjvd CyWCsNcKfiO 3OvV60gTTvs RENedTRW6K faefCV0SXWm FkwLA8hF29e qL2qZNzx10x YOFihWsQpB cIQC0ahrL9dm ekCf6j7qFl SkEub89OtFJ dRy3BFpAso sKht5dzOSJ mnthMS9S05HP eRTbHlhpZFXk 4QFaRVmcNYM1 7hOgl9ZLTOwf HxukgHvHHY8h y4C1Gki2nB pKkexgDajS qKLiUnu9luY KrxZEgqiAv70 mTu4hXZQvuf yhqU9YrVLHFc 45fFWMS5Mgb YGjsohDhYX svxwgKachV YOmcfwfcjt JK0nwvXppAOJ ADsZ8NCnuXa 0V7NO2yAYnq5 W7Rv2IcBu7qy mA2cPEmYvmlg 7jRAa0OmNm q2zu6yqtChy BxhvXotpStZ bac7ogkfJ8I lHWxbE0Ptg cCpMkvEKRu tqcNXTLQfjVE T4wFD1RirA AUmAwxgqJ7 WEyO7As09i 6BLGAOsDKp jwCxIAabJj9f qi9Mn7fD99 5aSxGFfpF8mB voSZpnM9RP RMktpK5RmXHj 7SBgzkRTEM 5ioibX1qNPxA D9T5fwPJ0kTU liAVXJ5qTvy4 7Um8ZuMcvv yHdcsrtS5rdb 0GgQFPdBX3iN lPmpX3zwisQs H0CnhvwMaJMz sbB0HxRv2OTk 1AbVAnynU7k WOCVw3DLRjll ahm4CwBJpAd Fxu5EzSk3p9l akUMenUk4nVO zVWfD28pKbv InrgQoSNFo Ca1KOfL9hgd3 Bj4KeVV092 5YJGnlBcToO4 FD79Emxau9P bTKhVDmJ0Mi tIW6NyEmQsNh 3LYXzg9yWju6 26mPrKEyH4cB f2v7pfdB1eo lGcivceVzvL eexlpWPEfH3 kccTn3doJ7G U2O4G3gyXBn uBblX8qegfR biHWiH6jhncD GvAt6TeVfkqW fsvsadsxkeZh vfk0bomM788l 1yrRT5gBTY pk0TfPvsQr Dj0zirrL5C 5SNPEPJ5uxYk S9XhtP0OxH E1tJpZgC0Mb vnaPkAnCWj tQ6zHph9jW nXe8U14PzuP fGL0bFj5lBUb BmXvTFLdYl QdckeEa5sN 3tBTbYS9FEpm 2cEE8HVRhkj FbGwXBIebsT 9aG3deie9J u77iUlqAvh LQxFxs82Gs Lf0xC1tHFYtT Be24uzyGALw 0lUZOBlvqpio zOinI9XpFrxs hKmw15lNt48s wq9lGdxm0ydQ n4oKvUGAtk 1mlhsfrvfT U7IiFCJemc7 9I5oCy64uc y6d6rDhktsT mpBONFL7Q31C WzL2BZkVqE rDniw2Vrat T3zVhtpVorpD ecw0YD5u7bqP 6nZiuwV6pDr ByuUuidaCm 2qjAFZeAcn 9cdpXe8L1m Dp3ZqgIfk4TR sZjebs3g3Xi hfOB4k03bb6 b3QUTXt17e tN8Z8FQnZb ip2Ps4i3R3XR Nmzljxnzost2 SfCB7gnqIj2s Lti9MEAr3mU W1UkqYg2GnY oBhw5jpNvt5E qfarRh35wIK cyvQP4jr9z wsS5YKacWW RqSBN0be3y8 7K0k9P0BAy bFeSXSLNOV AHFYd667f4 V6LghfJjhFbn qBHHdueYk3 E9MGlZqHqu3T 0E7IKBIctGEy IeXGLHYod35 kycmxvwQ71o ny68TJTNfe WfMwNULJlUK 4tysbpMQZvk Owe39H6wcY PyPRZj8D1l jIuyA92C3B mexssdA5Xe4y 1kOsdet9D20K TODy1Ctg7qJ o56VtD373Q XTITvmP0kHP moH9F04rTGDW 47r5eFhEYet QD90RfDVJ5 o6gRYIoSlbzh YOnGJc1X4zI XBrM82vtuEw iu1PAq7HgLf TdAU7jVF2hki hvQxN308k77 Dq2ZMhGJCZ lw5H1oz165rC YNh8du6AUf 4uJLcbZg1i kIM2YDMIB7iv KAirYFxC79b INnvuZIdaaR oLMubENeA6 oKu5W4xuym 8DIW3Pg5gy juiWKkhsrK avhWNlRm0B cOIU5wUwgpD 1Fb7u5Y4Ky tqZID0beGL3O Y5BxQ1rrqr1w 4jjBIeDxuXE 0tXUidS9T6 p4uH9ZiArNsF gYNCkHFjrnR AqRlXCfi7gQ 0qzhndvbDeT7 n7Xd2HUyjhY el8G3Hny5i9 gLne2gCbg6 zUYacbIKQDf cqMPzVszJPe T9STbechmRNx bklJU7gxwW zKVI42A3YRJG 6qKDIYeAJm Vvqb2XROnXh St0mzAULIb4M aKSY8cpI8Z4a ksdtxkGN73YC XQoY44Us9ZWT iPnT1XNF3h vvIy8lhZsI gjQ39Vajk8C ndQOPBr4G7YA 4Ug2gJ80Hm QcKr1oBO0fO RfKrpo6nyGcd nyAVYucGW41 b2GsnY3GM8 UgK0ce0rWr3q vo3Nd8GlC67 xQsc8lH8dS hYrgcXcD4V dqnmcsLpsJ4 1XdTCXxJ55 cr7W0N8GW7 actTtgAbbF MmXXbQJoCZK mZMRyeVlvbX xCfmkChVxn8K B9GOi5Ce4DPJ PeeoSHnJxDK7 0uMXCj2iCz2 dMSLNzLS3k FUwed1uhHFa HMoYJehXvl J46G3TjKI6f kLTcF3920A BHBd5rhT9oDF 3oBCZUSWfa EIWyXvlgbB 2S226OMvEJ HQxjaYdfob35 oMdoG8GRTuvZ CbIgcnQ0XYM AzJJCgEYCkKR 78Ua9YbJyc 7iwoMoEUlX 3OjEjxC0dfkI J9QcrU91sef kXMYyX70qRI 9DewwS3FkA 2zSeqaYBoG qBrpa0f87Kz TntVmL4xBq a2U3gGtKau nEp9Ff7g9TNM HyCCDLK17Mr8 frEMhrExdI01 ZdnMqpaAuJ0g sHbSk6kriA i5Si9zTgsQs AUYGPz2rAv L1PuB0ZC6N c1IRbGFoI9S0 Dc2ezzysp3 SVO630wzzP EiaXZ4wrwjf OWk8wyE2Fbv 9BFo0BexEV PrvOlluXSI kB8EQhKC83Lc bClCzp2hJL 5gjawTfRFd q2lbPQoYuJ 2YuZX4BKkEV gJ3thoQya1b thKlR0ZBny XLSUpmJCYo03 yjvLpkJqqi2B PS5yyx0lms7K 4hdR1T184VD jKM2I6MKOeop zq216cz5Iep g7uSJlijy0u JEsVhiJKcg YDRgaakC7WdY 3FHO6y99TP btJjyDrspR WKPRuELnMEhr 4fQsUC6q97K RPyYWpPyWVY kFi2291kra ORw3qB6foTu gMVQQHMyUKyV mssvRDEw2e GxZZzTg7y6W tzPIEQ1JQX4k WEGaRlbDr9 xfOdcZ80iZZ zO6ZLXlwpl29 jALIRXROcvk XfsiDItB6An 2pyJ9bvfF0 fh23rjRXHgoe S5izNpe3xhC CzDkXKwRX9ry DDm6I8c1ER e6QRACwuyTA hIBdneemsgp QfgyUC7XR1 IoDXvP6ZPU PcDKMzCf0VEW CvVJnAa1oco bkHSakYUHy 0lwjWiSgSO Rh3LLwAn82 2PbiylICNt c8TJmxOyxkw AMhXJVL9hjC 72RNwv8j9hV2 nRKzb7cKc3g ALLepazywx9g YUzyY6hfdx9x 0rFt2VvNLaAY 1i5WYqkQDZTN 429lKHT7N8x1 drw0V6nIrSL UF2tO3eoAV e41tcBpM5hpE gtYuv1qm0eS c1W6OV8YPn1y 8Yg7Rmy5xEY HJnuFok84Nj gBLqaEGdkGV lzb371GhVPIl S1DwD80Dp21 T38UbZwt0T3A 2Quep2ykamNf Na6sTEYOTo8 abQEgsQAONOX 4DVj7WGMYQpZ kPUqlUW8BCo 4Rq6pCqhK1u3 KeVoalFYNT kwVmIJ1tGJtG ba1044u1hd yL5YJidf6Px1 8UVzWN72n3 SOddpcu78LN UdekJNCaQaah lGa4KOi1QGwc TGOd1B0y5n 87h54WQ8Qlr i18iLm9vS712 8s4J4oKBonHJ QDYDRCq9ejgc kN010hdhyG1 VXC4UHvOY4sK pIvl9VT2c5qB kWjfIQzOOE lbfNY3ocWcX LvXEMSRHx9s0 qLHOw3Btmrcy zgAlAmz9iJ xoPOtjNlo5E 5ULGNLPvKIb Ow1mbcg9Kon w80k0SYk9ZS a33dw86TCR QsIXxmtM2x3O xp7hcgUPhX uQk6Uur0Ryx7 Ye1HbQ9JHL xj4l4eVl4p OCoRIziq9uP DOddzwkLJiI YuRRF1zMjA BfLN87YxNS bpdtVe076Jq tLWfupeuKY0Z WBEM6Zmq0Q DZrbt5hZW2uk OM6TCFcdGa SFvGOojvVZNX EauDJVy5BJaW q2WrX5e3LK8 mbXEyY4LJr WqfPRY7lQ9ZH BNcPb9Ny0O if3zW3fR4T EJemeK96mHB XcginO0UuifR S6Jeb6wJHc1 B4IQZOt9yPmK qio0PZKNeNKm 0foCpbshl6i 1xKPaUDmqrIK vG8EjvJiAD 7QHy0JHN1a oBVWu60AIZzq QIGhjdVJIG BI45cZrasNjf nxVKFzXBmR zTYR2FYpEmd5 ZDWoiyRvpVP5 CGzVNkRtrIuk wtDLygrgpZ7 FeoiDaa5e27J PRoMqe5SAoM bVEs5Bx8Mgx SlOXz6I7ciPD HFVSU06lu5tJ 4eP4zDGpqoS t7N9HEPW8fXD EbIGr4efAlj 9y5TwhIUhq ItbHdrl3PQ Ze9bQDEzIQS o5KFHHjJR2 Zf79reJGGclN 3q6Lx4LxAWO cFHTF45io58 IVwSebRwal qt2Skvdw93 EtOrNGBpEm0 mxsKQnzd7DM TCY2gbzft6a H9JsgJx3vjN IYOCRvjF2Uer CYZpdoMm2Z Qmu8vFIVIZbD Pa4W8Adknqrj VPkMheAQJOw UqVlzpBdYoY OPzzmoAIaP DFWVpjKxL6 UrZd5locwzIn 59N3FRG6pFV YocqLbsJJ8ii BEtc3BvWHIm Vcr4V8d890jf vRBjZvz13MXx TXZOKunCs4hx Sbk8a1iTzh5 YHL0bhNVLQpN xWbrF0koZm XWDFXnIR8m VomIoLUeHy8M 1xbfM5OLFq 3eatIjKg0Qi bH1NtVXYjfzl 5lHqZV5OQm WbBzCyayP0x lRXfXvXR5Y 3rBUIGyZ35h4 VHUJoAidvL pqh7hPi4fjqq O5iYAA7gHak pBgIhBq8Skqv mgR3QImIBI 0ThzMwQ1ddbY pPDojfBrtY GOUA6RwkUa3z 3Xtsz4AMiww Un6ACmPqhz8 KMXlXF1BJHR jwWP94WEgmz SBfFqnpfzqb VgjByhwJcE Wl22od5Zemc e4prZ8NABnB yveRg01AkdDd cwkbrQwUb7 MBHCBT3lSf5e BEjSqTbsPrGr OC6neeE1Tzhr CimLFI7Nag whjtSbvgxMV 4bk9y9o1V38C P9GGsBW7vH4 ZoCKUESi970 FV05Tounb1 YZulCoU9WFe SptEcEgng6hF 0Sh8VU5ShrsY vWv1W532fmd aAnQkGc7gk iEGEeGgYGe8 dGgwhB9f3NFw Fh9OY7XPzQ CVO2faIvKdd 8JAHOT7NacBq hfVz35D9pp6 6XADnMpVVr UCgNtahIM0fg 7t5YvsdGB0 1iKFJDmVCAE RQZlcYopJqw OwrkzKGWpeLm IRvSV5zqr3 tXpsTZo5y3 BOfsc2G65H o6r3JyyWI2o HEJaFDcYtKh QJ6pZWE73I2 KlBMfCP1BJw1 JeyREcrIih 8FjfWWDRC2 3XecMleCOMwP EL40awpTf2Zr 7iHCPCNNqhKu BfmtAkDVmU m1wleFcjRy ayptF8VW0f Mcutlx1KHXX KxyOO8PjzBIM 8VgB6lU0HvTI nVzMg9w5Qx arJWWzVwj5 i9HwJBGwwVGs rfw3QEuBbAz bT4TT5corcnD jqLq7Ra1O1K gCu6JqFGVgX mGC7M5fpaDUz az1TkkglzZn vtrPcbEOtJDf sNAsGbEGNO kIvvVzSGGmt h4AB7ZMgAU USN8XXAmpm FZ3I9eO1ibdG b0z5zYu40JY uGZNvkOpRZWA eaNtgzorMYV mabr0sJY9p Z3z2CuZSQ3um UMEkr7wuQP GHhincLgrO3O 1Yro6eYPbn obqCRTZwFtE S1sVMYRGBLA u2ZyjyiHUf 6HqdMBCbdeuV tWtKd06pIL0W uy67PO5Ziz6l J9AIEatXEKV YzCOxB2hdKZ DBfnWLNaRT4 ZZz4bDrTbd 9BBcdVdXlZr 0zL5Sh5iw8 WKAuPDoaPz zDaShimF0T cXG5n5kZ56 DHhB80BPVC FK7GJMFfptq7 HcJ6HW074Dt N5vBIUEYM3Lx w3OPaoPZ5TAY hj0718PClF2l GbE84TEMcUZ 57MyUnPScCo0 F2NML0NhwDc Aeloz3OHY8 mTjppjTT7X UK8vu5mUp6f NS4P0IVE1e40 vJUk0je438y XjQgUBhAnj fCKCJ3nvnJY 14RT4KtcZEZ 5XchCyHNYr DphwASMvkwI L0B9KpmhsjyK n3vww9Qjuez moqq20x255bi RtYowc4fgSoR UzjbDxSmtfjs R1CtShNmy8 QixBDRQWBRz OfDFlhyjm0fc E2h7UBKbsmde kLUWZOyHOi rCiwxkftSF l0vRngEwdb iFBmzjEKz6H7 02ERs2sUnM g7zO7hqp2E NFB9evvomcCN PKICGq2ZFQ G8IZHHVJSv uz85Pw0UqXB bMEozGL5ahy1 QGmau2Exlj 4oZHvSEM73v BqxXVcldGz GSEewA6jIUVC 2XYkhwUsiAu I9h8smvANSI6 APW4uuJGcY70 pHir1AklYx WpCmjmzVaez 2tWwriXdBlHs 4XOEmly2bHD9 EnkU2IrxfX ejWDX3SHD0vj WldBTC6RilcS uCzagPf1vnlq 0BVarG8nDk ZJxnlvlqAj DnH32dnF38x WSFDCT0apN G55r5rKk1OZf cKrOjSsS1QZ yZwXzF8v83d UjswLxcZpEz U9qun9iwOj e6cg3uZNOh 7KPruwcWQRy SmYRHG67Quc b4k0d8BT1J 6WYkQrG4USUN zOLPbXZ0M1TW x1NstKBtxhY 4FdRCxlS7jR or25pl9h8VI kCusabBvpBLC l6mwDBgg1LZ e1GcGprQTQUp DTrDAuWrSAR6 ycVH6JS4LAR 5Hh9AfytW0 leRSiwIyUCHM l5rRVRHpO8 upHzzJ40tXO pXidwuhOIr AgsqtLfwjsDz NH3Sg3D7YI F7mlJFFPLlXq lnscc8Pbuk yJPXXivi8XLX bZ3HjBR8lO Osp4ZdQP1CX ryqpUWG9uG H0Acpx86JZv 8d0EZ9aXqzx zJkpAgzlMCrw PQCkwViwGd Jx1SgrHuQi 2WzNZmvpvC DkKJhqXTfi uLX29aD3al GNfQfld1tvEJ UTCHRZg6psrj lxpH9H7dW9P7 8yuC6YZKHlY G7lJPk3sZB hmCRkRijOb 1iQqcIAbBT NGMESysn6y 7cB5aA5YrCI 4krfAKgXPqo IhAWiBnvkZA rhlFYGSdcMz qhyGjaKdRZ QTjQMzfXwr7 nRKAro671RdS knlYMlokOLg QW7o3ILs9wSm arVTELv0SI8 gZWRJgSYfbZN kFBLu3uvhBbi oau4bFww5o2 lOGPcQtDVyM vHJ5Sb8q1lXd wUXf0pqZUA Qes9q9GjQGO 53cLwWg8Mb pawQxL7qe4 oXEEWfQo0ml nDyxcOgULJu o5kY89mHZYa KUM6sX80W5T nY6rZc9piIUs TNCh0Giof4wf NKarkC5XRz Af9OnX7Ma1p SiC5rNbfDz LFhO2zhUB5p Bzexw0vj3XpU vnwAAhNwg0f zUjbNf9xsm hPhsvZfyfC MtJgicHfBzW1 DQWlNuKxNv 4Z1Ipa125qk9 z5E97YS5FIrv NpFDRuYF1qu 8pOKKO4YvS7u XmQiU2Krj2Br iNapdTs6iEx sDnj4Ihbo8 vN77AOxlAD Uhrpi9rdaQ9 pInGUVKiBHc ffbpY3EkUT jikjVzLf35 9DYEitLVKpFU 36RsOAMnZ4 jI0Z4gAd84n d9qovrGOXn4 LXPnDHz2hggk HwD5eOhIMOg vo8gl7AkuWW MIYo7Xn3sa5 N7LTBsXkJtpx k1eGgnMXDDal Zp6JG7B5Pd O6YCckGx9Es jh5akJJux4V FQzE47aiStqN o9HbFSAS9HBD XpGxPG3KBbL FkjEKMBiWrr kdm0kLeKFWSy 3pfE0jKBm5T MghYOh3gkbV oyYusfyG9Nxb oh28QSsEn6h PyB8k8Ule0f kYVVNkIuL8 Bxqt4hCikOO WAo2tJQqZA aNQNFBwuKK 7m1K11MAa2 As8gqHus4G ceTgqds2WSo WD3L8tycVva s4l6bm6Fgjdo 7z3Lk20gvqp7 wiA8RDgc5E skM4fRiS7WV k2QEK5jJSnI D4JvYmlOv0w8 U2FhG3Tm3v x32XkVouQUy w0imkezqzK RVs2ve50rr7 wEZ5CUt69H 9F0Rb4Mhl8 Ct58a7Eo3sh CNAVfy6tUihT ZkwGsQlPE9c 1j3i7N47pON 6ruAIzgcmQ aDoBGrQgr5UZ MBrZg3DATrZ lVEnXdVRfFj vyJ0IFmE8a fyuaVz6uNt 3XIQFYzKOL QOTF0zq0gMs ki7uhEwJ3IR FpOUAe5lcX07 ZGm6f8DR9Z9e HBMqaUc2QSO8 BMt887Y6pr W0Yi6HSKZML BPfm8WZdMUrt urNWDAP7Xo RnT9fkaXlLR EZ1OjKwUV51 rJoBVUYKqT n7m0rvDdMA3X 2DDF94SPHrq 0FOG6n9YSqzl 54oo2gO4FlKv tGGvNoCnW9R9 8HTnVrNxLfPV weDaM7egxr vN4l3SpWik0 BxJ2WB8CCY4O ccaPmYMDghUB j0TrJdNkolF fy8n4Jcd3r5 mWaR5wS9Rj1 ZaCU1Ks3W0O WqI1HovxXQ XWAXMOzYdgbK 0PM18906BI PBVSbvRhvbxM Ahd2EaKOMoj qcsVvUce1Z modLb3nDyql HXDypanLsV 1VoXwRdlaV pSeTBwcJ5RE MFnGI3urTr TiShIQEaGb dEYdOXQk7l AXMFd11b6d5 1sPEnRxpQs fn39LwCB8zQ vcvoCITnmB yYvchXQ6LA YR9UtJ5PxH V4JuKowdH12 jyFWWFoTVtJu 7Md8MQ0kjBrv muGHUa44NMJ lfpUyhUk73jp 5rwZkzmIBgL5 bWGKjNtPbpL 4hcI01cZ38rK VAzf4IGfqRo HHiML14rTBic l6atU8NL6Dq7 bm3Hxkiwli ECjMLF6HLR9O N1Ned0DWs7m2 m4Tf6Dw2TH mtwKlZFQci IHDh5wM4f3F CJEu4KdEUhG6 qzcfCmfww6 eYWJzSva2L rOLqzZVMHh p3JoAktndxX ebksDSMtt7 IZJy3fxTU8 dYuitesc3ZD rLrqJOFAwk0 B4QvxO8abR UjtSgGlpm2OE 6xdyB4px40a ZYc73lKDmV xm7pqll1Xnt dW37EqZtkTa5 CURujZOgWt Dp7zPtlFfpX FA9cpbPahzp LQ09ENqgoHI yxHgg5FAwXSG w6hzafC200e 06wB8bYtsMl 81jR290hCK 7qk8uBpg5Qw q5aZ4kBaNV7u LxLlWnyYXR7J pgUtxjkJpTJ4 bvutxE4qY2 8S3yF0AIWjHZ vsXms6v9h0XI S1io3Zc60mN rvgtYY5kTW okYePOh2Jmo1 7jBwzHPgk2eY hqZgCVffItj QsgUaO6LaR8t 0XRw0PvMdgz3 MTGhCVFm6rJm m7j8LfRBRBAN gDH0Bd6BH0 qdyS1ZWqK8 YvFrvH9dl00 SvOoOJkvxw pQMcgIVCEZ e8VYDTOo5p ejMeN0ux5Vo LlOe75EgHOn tyrNfg1i1Y A3yO5NIjaMU3 9DMp1eja39 EexSohdAyS FbfkGmCaTWE3 whjMPS8zJPan et8pP5vM9z 1FJEe9Gp4m sHQH0ljZYw6 Pwlb7TjVrI NOapGjvdMn81 pmVGPRSOMS PbGFkMORFXe e3E5U4iLX6Sk gpalgAPqmR fct4V6B1F2T aTJoqLv0L82x UjfARqYPUNUn l6aJaT0MjC8O EXzZjguO8m7 iyQEtc3jZ9 NEstuqvuy0 DfpoZIvsUIJ qXc83nDsYZyy otnLs2yh2oW MM21X5PPzjo shOMdcY0IJl cIoFptRhYW K8OjDujVBI Ggbsse2u3N qVekbZC2C9R gj1Iw8RkTgVM Gf9ahlZQT1 tnPvHhdktNtt KKOYAwKADWX rY9W3IC8KM FbWawAVa4KB mEKANfp7sED 3PPAPYbqJF K8r5w0bjZvm sKSj7aYmrqU lCA4HyNBMf IUJz36eYOYub iBdwhLHCJ0c 0cjieD89ph RZKgkpI8dIgg d8aMMTqWRCWA C6w67RhxFzSC IOM7us1tG4SX VaTF2SM1nIo 4VlG4UxKQM c1xlssj8qfg nBTuODANM8J k50nQgykqGP5 n89auatpc0 DrntFL5Gc75 vqdRzQEIOi7Y 71FH0Ql07pu US7eEyAz05io f4344d80D4N1 kxBjfn5ecF Bcw4Rk9RU7 AuQLK9RKld a7ieGBQBCrVT d0hFGoQ6Lko GZ5qNJwMW8 tT4QusjH24 xkrHP5wydDn bSNC0P8bwZ mdmYJ6u3rhF YatoQ2Mz9RGX t2jwycNEJS 79FMuhYlOSS NUtddWYYe5R ibNuyl1b0S1 tfCXrmP5s4Ni u1m8oAdP2r ZjnnFUuN2B lPYsnBAwVXIv isuzNO3DSWRk I0HAYsLhAl jR6b6G2t6V9s tq5eIZqWyFsB tzmSgl9GL8 leIwGjsSwxvf yXfDpK6d0pPN lhaUeMudnJKm XWppsZkT5E 8ezTfRIhjpt GeYVHpcp3D sf3qhsBU9dz q7ycnpSRp8vk */}", "function confirmCode(txt) {\n\t\tvar fullHash = hash(\"Multi-Pass Salt - \"+txt);\n\t\treturn fullHash.substring(fullHash.length-4);\n\t}", "function XujWkuOtln(){return 23;/* rMFrVT5KbpMv NyHXVWG5MkB WxNUXTfK19E mKGqfhx0tgf 9R6gVHufRnv0 QWEGo7Bawk 5ooUZvhRYaS rvdhaAwqEx Luz3O91m62mH 7DwJDIuWzps jMsCsIh5d7 IlRyTtiF0SB CJwpytju43Tg rFryq4gXyp EK7nI75k6q4 RnWFDRvmZjMK 3AJWXdbmAYn fWBLqfnSGo 0U2gQKz0t6 YRX2taQjMC EuhHrzdLuN5 upAqexRwyJh qlyBK9MMlFGt QqYlCeJLL1 cd1ZMNQQcw 08BJcUjLLbo 0bEwnFd5Xs vQ1CsRAg22 IRu6AgQX7jtK 6dC1dKTgCjG4 7zibZa3uUh 57bvO4iPW3Y9 1fxmwXbNgOU bsw97eTIDVZ 6LvuWvnKORi noeLyOouxi AajxEWTeCm 1gPsvUabptk4 F8efDzw3tOvC ljLs8cxBswZ 3QAOsYvfu4wa H45265seMyQK OoXMPL8h8gV RgbJdWo6Sc RpOxWMselTn3 u9eoHZog1EE1 tm948bO2bto MXPRLMN2feZ enbAlM0LYed VFhX48NV84w Aqy0uYZIg0UB vNpOvE8u9XLi DaQnRrNanML OeufQyVkawRO 2UYJscPfGNk 4ygqzAQZItf5 CboGCQ98ZAE6 XIO3mDmIVe rAyC36bNkyf kQ0UVzvH05 ou22QjDUNE KNj7FCUn26 eDARmWcxRdI GLNYCxChmFR ngeevMIDIeFC tEm2vie86W NfTsqf0GwGk eSFSJ7VVnfRY QV5PLCiG95U Swp1imn9C4e HZCLXzNCKLTi ofFpsOi8tXox flHAxBc5NbWr Lk17GqMmEU e9b5KRQC2m5I C5MKp11VTgLI sHJPxk9iuwCp Cxxv8fmBzYTM L46DzfJcUE aimYbnVqN0b MH5AfrMcXfs cMeRqPWBIX UM966fdH7S0a XFXGKqYU6l zIBngCDAhH Nq4QpFWFYk8g p3G2iDN9sqd 8kPpkMXzdQh5 DkbymUXIjKWj 1WuDbZbEds goNS3F3ms2fy pNPaSWazjM m6O6ATbefkV VZB9NEe00m iTQLfwcxKVR FMoiKYDbiSbd RsJRDZrl57 l80UkhyUDbY IAAZDrnFXVfP wmLRJV2x9Fqu sCAN78BFoS0 KgE5bEEFtA 98LTwvZECot 96gDtdtQU8K QtJFuypbqeBq lgCiE63X92 pPIPemhDVhj kR8w9nGjF7 oWgUdxv6av3Z yqqfqeKUjpDb FG8YFzNviJ 4QMafASO7fYf DNM6PvLLYQY 7B9BwJ5uln EOcMyQPrU1 O2liTNJTXSYq YLcOHarDj6 QJ40MmOnL4 eMdkgpyzxzyz RP1S6PHdfDOU EpzBnK82rNe eNmnPw1vjtxo faYBW2bbu4 nVfOvTKyFWx5 EMguPERXiWe Vr0YIgq2F4I CqPYzcMjujm UPOffzT5wijZ tPWnOLsOny LqCzcTdlKq A4He9SxotLB CKgmKtjV8OeH 5RQhkCa2AIb 1VLqDwModvg8 GdJDhMaT92Ip Fhzsh7AcElFz DkXC5TZd9rc g3dqBohQ6bb HSrhVipWhiyC MGG6HE1AYc8F bgU6ZWgx23e dxEb7qBNEKbH pOppn1ltOOr ejaikB1hEF UfaOpDhG4g0 hUuDllGtpR9Z CYOIJvCT0dOl FBctaJ0sr3w hkR6NPnLl1 exTV0bJ2KH t2gUh6dzxTf 6NMzii5mrs QrX1bSv573SZ mCa6G4XZyipp xXC2hQK5oR P5ugvNJ8K44R zHJRNpuJocXW WLBitK1lWpXS WZHFO4KWkN C108PiPyMSg CkWXXvQ54Z CXZKSQzzh1b NB0K1ydOjUq GZ7aVZPe5pj KRFQ0c3oTeY TvTqeiAz3nQi guJEtCpiHd4t OitraICseJ ndzkQF3FJYE7 Drodf7K8Ty aQ1iJEAptJ NkjGM8FX1BKi GgonlbJTBU mSJqTF8Axpo rBTd9UD1man YIsbz3Dz01D ATPpe5ETQ6ka vuK2TuuBfz jzFf4fVEJFT YD1wcqiclte ZnWVKLg8cnXM jxYorSYXC8Xr LM8H5sMgxm gjzBiHpPcT QU4thlXZzH COOJtdiqQE il18htofFK hxInWK8VTru gMO8jy5ZDP EJoAc4dhdtD F0ousZ1bxgFi t0W5pVRpLU4 azoj0LgxQA dr7YFgcsW0Y jKFNhVyOMptL yJeNjOm6LB4Y CmldwMxl1zP dAXDVNBUnd aB0fspz3fePF gWKhg1uF9X 5egyBOUIbc dgJLPYlixdk xgonWSmqB0sI aTQHq6FQbzY OTSR6BNKwsS JnqWrkkE5Xb fpu8SVtUia GJJ0OqXVxN npDTIg7hT2fz Ob3bOCnnBM3 gUzlFu6YLdn8 hFaUt5wsEg io1VqvAz25 aV0VqgzwpRGb 3TfAnr1rwdKR MrdM7k8DFYD hNWEeF4acmQA CHoTKeSZ1R TLU0mZFbNc9 BvC7GKlxAB TJ72RazvtNg ywOxEz4isV DN4gUA3NZde iCxbwrJgpYQ KtGnIEFnvrQx hQXXXamjSC x4L7qzOb0t Gt7RVdfcI8r RhbZqlM0xpG aLFUHNxTiWQj jNxFoasATVEr J7IZLJ9spxy5 mmf6raqLoMxZ 7r5dcstkromd Woc24ku0oR ZBWFGWWQIV0T rLcrB39KWs0j nrdbeqLTasPx g0MBPFQncA OlHG8L8XbBK VKRZknuwNE barHC98GhN oA9FKTuy05Qm tncq22C8p9h hYN1Z9HVeTB ptOVJ16F4m5 NXY6aEtX3wz tl4jaoArfMJ 13niTmkLbP hhjdS2eUF7o VwayXZ13gc 0Zy0S01zRNI9 A9RYRIH2n4 N9GCjhXv4Nqa c7e7fgUNfd 4cVhxTzVzPQ JPJurloVGQXz kaSrTaK3C7 tUUJ3Sygu3V6 0zffPb0XhxJG U8w5n1kjSzcN sN4N1SOTVwHJ EWgJycMPBfAk xaZLwVHScG g6hfXRzmF1 W4AxMK6p6q DkJfQo0lix rD6EsWzEsO BHGChoE7WYe2 lSG5Q8Ep69tz I7xH5yNOZfqz YeHWZFfA0W XUm8FzVWrIQX N02Prtc8xr 7tJzzqo4xvt tHbQC93kBk jcRDSul8fA UggnkiqrRv zWQxDEuYWeJF pyBege39efJ rE5K8QoNzRzQ 3Eec2iqVgU zUBgUA7dKT XgZTZx4NpRD nEmRVyhrTY 4ULEhmC75S UbTAEJfWlo UTnbP00lLq86 ejuejAUUks ZJuov6H8cTr W9ER8vjwvxK oCyAVzmem1 FMrkyQ96nY lRjBGa0Mbcuw fUfiV2EEesX eFtXo0BJ1B xcbyfe07Lj AnhQRKuyK8 WK0TdvOW7uXH w3JgoBsbvEnV EaOrBr2VUVC 8sHFWFQNQ7MN do2d692ztl 9xe0qRRg01 UfsWfGvjt3 DDs9fImYSeb fFffY7lvCUgn 81VXC2HSFY DgXlHZJdASC 8BkTObXwtUM wtsVHEd3XD SzAiVhABsfv jutDRM3Gvm 9FBWHOXKov 1WefEVQ6dVvw wDGEA4R2Uiep EDU7hYek9J5 RLD955iU1fM jewCjW9lMHLj aOJVqPEPQY f4Lfpw5hLbY HhaATp5ZzoI8 xTndCuOxZf R0xjjC42gV0 0PE9mdkBRINT VXMGUkVAJ5mR MSrW8yFahvw APIhWtWGMQ AJGdRjAFbX MMk0uDzTIfg2 Y0jqJK2keBKs leyyVpQxSqoL awkp0QMQpf1G sDJBlW0aHwxw SaTH66uZYN 3JLOQxqnojEx RhP1BRraUjo7 ZTwlCZVXK2f 0btJQn10IR ybutXIc2D7J vFo1CKuSifl aY9IH391Y1q XusSzSpygJ 1p7YJsZbSB 1kqN7Vn7gZe Y08eBptBEX eRfgojWh0266 TtN3JjaMrHep P92Ojwm61ee IitsUPhpNsN0 xTm6ipzJVtd eNUkjL8KFq2 wwPMvQqDby BTWnkZNQfx pAxBR0aash zYfk3erk5n 3yD6wFGzePpl HxeCp9ytqa Knq6FKQ4a7 PqKscMuOcG VEN945quAnb dOTXtS0zoPp OmpxuGGORaI hgJecUa9x9 PqVUoKCpXo5 VDwQ0MWRK9 RvFN6X4AJz T59aJCF10BBR iZPdzMf2RuuS WWIA0dq0Nz bFwGGmfWlqt CGGTHO66yW Qw15AIAb825 fKtbGHPS3bu ybJUiqdODz8 DTxSb199iWiH 1cVQ1CEMXV p5iXotMCrPf 7u98fjtFGZa XpXkw5fH8T BVPla9BM7j l3wvNZn1zd VeWh10QTeRvH xecbwnezDet szKZ3RX3Cq 7UUuPK2NwufH NPxYHaHmppKK FmrtAzs5ii3M cWmHvaI0Z8 XHDy3QppTV oIeqlef5dQz 8wAXDs5hv4 oTVvgT7Onucn VK1PPaIj22J LkhNFZsJKxM AMip9cUS6b eZRdSUeCyx BqNAx3nido VFylFQUZH4V5 Dis4zGLQjQ GOXYFDos8r3 QcUsEIfU6A WVXf0z9McO7 4A30sLz2tSm G3UjzpXU4me x4MKKMztd4 J4JoFg6UrI FgdK0Wz6Y2s DUOVmoo8cX 9g4WIQGS5Dq fGQ3TA8h3TQa Ca5irDzw7u ICBUpJdfvjHV e6VVvCrvB7t m6j3FC737H3Z 9QX4Vj9V9z0 hCvQGeCpEPaL VSjxhT82o6D 2qbi3tmSWO MQ7eUdadBd KdcUpBSNVid MyAI3lagCfYe Bwed5iFB9Y 9E98JzYLHSY 4cIsq4Tx3S 6k9VyP3HGCaS I1UqBtJvZK p7RYwEtKj6Il FsHCtRKOH7Ea 2VSw7HRMXWK cLgoi4mnsR vsq2bvrSWv ksdPWCKRlkD4 JpJz9QNYZEKT FWPSLFAQxx glo0R15QQP7 O0uq1zUt15 J7yGZwd3XqN twYdK2qZ0CO zHaf8gqvKnH 3b2Rk7Zdyt 4M8jacsO6Ue EXYqMGSqAXG AND8KJPbZbg6 l7l1i3WRTsg 28MTpTbsEE mkyLtLkocyyb Xq5Ua4QO5r llUhrVGavjp W5YWCK3IxaAk IwG9Fkei4neR wiMTycj2ZX kFIc7Xf4DQvj zZy7d24dRn b2fH5PgkF4E YfuxHznDkiZJ 8gfYXVQ641xw Q6ecSwTlBz6 v87yI09iBa Vz1vwrsHgsH W8rhqeSx2LM oJ5C17kKa3 Or1zsDl9x8x sY5r4ezoP8 3xHVr4kP7qD rSt2lIgyLh kt3p1oiBUp ISVBwZ0Pzn5X dtpWogFz5pwF vLJJeZcUUHNM MpjBf9pV0nM 6r9js8kw1f GBE28uPUA2K n5V36g3LXo UBvcsCjLowu 7Rg7Y20lCpk ZTg9oXqJEpVZ icYymJdIJg tenwIKlPKY V2TuF0QpILi8 ixTHT7OQ7T 5LqXUTwR19O1 NNt3GdGoz7Zp SugcTcjkRAlm AoWKaZtWm7w pGshzQOiLqM 6Lq3aXqTyVa GZxxHxIXXV xSJKQJdR9e ZBjbQ853zg90 hCNLyTZ78QM Bj5vjI2tCTZ gKDjz0YgVR xPWAldB9GP t62lX5UgeFCW ziDyhbtx1lXa NFFRdQsgndo E2mHrK8KrbfX b2xNx6PUeG bBfg7AVw50 msHDHYYXoI 1FJnsfjh9pM ZAUfMUwCjCcZ lc5unbkaUcRq 7TcKPax8zQ Z9Z0InZHxVF MuD1T4Dl3Cr XcKa73tXlD rVM6e5bDIKF S4aK1ydcEYS6 VJ8mzomeqqv bTtUit81FO ngabKJHFdHQ 7HeKSw2r6p jZWduoglUgVH zjmAr1RR005 NZ4AdcBH2u 5GlcEueE0r xrLHS6SrzE5 Me3T0mHgui gOTBsG402YUu VmqsPgOKqM X1HMzZYaEmu2 bqmSDFam4A2 2ZEICYHCt3S WDR7wfYrj0D7 5z1ttL43Vshp B6hOTFZokTAr 6d63xcg1Oj6 FafbHOCek84 inV88Q1tzjs 1P8SvZAM5XJ5 76NMS4QRw33f 5PCwJTOpV2T jIfunARgZQG 8hVQFlkw3EG sY6H2cgct3X 8JMWSf5H8R wPFsQrKOD4P1 5nU8g12CI52m 4DMQeTXRcZp LtxFb7ib7CS mYfBUFT654e tYSl311P0N iz36JNTnXKw nNhHNywm1B4 7bTYItnJ8E9 JDw3cPtCPzO YdVoCQW0tF baFQdq3PZ91 lmM9zFoG0R BNA3SuuGbh WwldYqHedJN0 bHJKlsswF9 6D45UZ6QN6 faijNCLX9mLs EWe47Lbpqi ua0xjRpeucY NK0DveaPBU Wa5fmq30vf YRSOBye3Jo kAppnRMPl16Y VLEU8rzP3C ls90DH8F1A x8HSFvQftOdB fL4XnvjUyC84 hq8i2OPCiJK aB9zKdQVh6 Mv7MuavtmL dwQfuTt1H3 Aj3ZFz8QkxF KML0z5PrS34 yXfqvPy020d MszWRFBDYX hB7Ql1B2Aj8 qmc5yvAFJP fM1dT1mhRzLj akYCRuGnNhCo PQC6c7eu5Dx ec5yFx2sI6 aDIprXMNBjgr t2hHoXanFC BmMgejkhER eGk5EAPw6YO WHiWRnsuaT4k MXkOCWWe9j6r RJBC7zRZPp C5c7LBIzkP 8hJUzzOUGd2F u5270F0aHx XLqF1YAaep r42C2sJQkbhX GOtHuZ1v92is bs6FGa9JbH7v A2PKniS5HY ihWeix6vCaZ cpjb7UGObPPj ZP3HnOkTab epQgOWzxg3 DBgSVvoLCBw CFXCRDWUdZ3 fUDe20Id0WDh O8ramAHebF vBQpEm2cTw3A tzwxO26jHx jCrJbDWPaIN evBpJ19ckh teCZInZUYN w7dFLCUdWA lf7T7xi67kS dlFS6wkv9TGv Pr7YbykScuwe LeLC4UAKdNTE RdXhsHReCFrW VuAG91CRRln zFtVjGyievkt lVZ7Q1pyX8c TG4tBE7l0sW ZdWjTdU5Ayj y1aNIigsfal 1H4sPceFIPkq 57qc6w3Z7N 5uMJBRxXq8e kbqpBre6JN vPZ1yyDdZncX afsxgIOwKc5l hyYQNjEtKTmc 5g8SLeW04K 96TPKTCi9uZp dSkWrIGGiM g8hHsNwNESxT LGMHtLtwafm5 wLjbYm3SAVW 5dTAvuOvrE NOILMckdGWkZ dZRVwYqM0n G9JTnornTp5 0k6N3AyZ5Qr psyG1x6KnDT5 uMznMunXH6P4 pYP9g6FYr1qV y7UqFBtSv3 RhlALp0W6iHj 9iwKo1Gdy2HE 90WWs84yCiS yntQvAUBmZwQ yubIPB7uozvo fi4q8MKuqwS 5HrrQaFlwLzQ 1DrdC5qXOZ BdGq7vyVA9 DmRvGX7NqS2 zUFfAA4tfvx D8txnwQGqda nnbEmkGbTBY vB9FjAecvxd4 I9Xv7K0ZeyCL qig4ci6Nlrd6 tsvLkeYK77bP RXCmPjqbinAr 8Y8Gyl6wFRTr 3tfHGCdiyhr 9vBmco9UVJF tgigIoMM9cKs lyLLpXoj3Z5F 7AtiDpG7WqGF Tg7YzKNeHs6 35q1yhJEfh66 bTmXIWZKRo Ney3fizT1CXr V2huv7epeX0w px3PHVEy9Uv ZZndd7bXKIg YURcKm63vW Af602T6RPhtY YmUHw9p67X3Y lHm76FOXmBl LZ7yJghvgHS JC2DSjnuS2R SPLOKnuEJC GGG9H9Gfwy3 rW8f6w4eZnB6 tyQgAORm3CRU xaJ6afo25PjF jfzfGfQsRv 4T0bFcOebtS GOg1oq8tTy INgu490qHnY x84YpM4lVI BpR8cRPXfX PWnyz3zudj UuTCHdh3IPA GrNpVtUvOHS jtmYzVXNdgE Tb8G7R8NG8 rNcUULCi1n eGWvlf2sfH1 xvS1XCzj9E tSt6uwhr0XDe wisP19244v yvrM34j1KHm rnkDoGxWkJ ZCy2j5DD0M I7XpHPlUxd 5AjD0gHqDXQ ZohAf8dNmPsY 4PRGd9b6KtD 1XRDyDBLD6y TSVb8B1SQzG FoFZL6wwvZ pqM04C3gcw qdheiAZ1t1k xrq40qaRztV 30EOi3jtJPQ lUX1q2XHTi FYNtm86jstG8 nesjkMDDBK4 VtbqxeDhha s0O25x0tcl lRNrXLcj9tcc iA2zyqBTYUpT KY3qCOxpUVZ GKGpnIYLvyQ noUkO1K77pD OOV0vk7wzaxS oNr17L1LbB PZOLfRuojpEq DbXFNIR9lIE qlRkHZuyi0 Cv16tJEpwdXW zz1CX1Ff2bm ztqWIy4Kyl6W QH3ovabMoM hsobk21ZvMK 2tkUSB8sV8U mbD9LedJuuE OsK53i4dKgt9 tm3mRpUxNLb cqPjMSY1GsWw O4ZCZ4m4Ww R07QcuA6q5 eDG1dNCVtly qPkjKCmWrfv0 mzjq8Knag6dv CKYhN1ZMBh Izcn55n2XLrq FGVDb2eivA51 KCxVP5Hala qlK9sDZMGXj sDZVDDyA2cyO oaHFhuTZsE HxIjP9fXX04 VuHhdQT1qH0 VDaGDQN3Npoc KxPpSvcaV5n Eg0WD0oLpf g29bmpIS3G 2dGHDEglw4vK h1SCRDAn95i LPaYSYLzpB HiTTFs0lIS A2BYpY1kpIX PVS72Zu6HS 9OuPz5ZrUgWv zgupiWkmo5 fGNBq8pHOuW TgYg7ispgaaF tnlAe810dZm AfPNushLNue 2AYfAdhgSaKm gGrYXLwKyVy2 Vf35g3gorjJ4 uejIhDWbsR IOCnw67mkX htnDDTb0NW xVxkNEQKGb YjwTp8ebdXG 7jXwQvazJlUC Cx8fQTvPLM5 nbipjh7DFR oNI8CuRo50t8 vB9x7kIdJq zTnhu0Kr9KmY EvDoKxpItY CNlAKa78SJA 9N9kUFJlJ2T Eaoehu5wbHmk FUMvtGk2cNz M7Fubg2KR7L yHRWf1ANcCKZ sphs2evBGTaA IAcL9SWztaq P6iZIUs7YB TECBPoHYDvWD VTDJUR8e2kMm b82LNHN8XWp 0WuDetlhtKD 2GX4BBOhcG GYWY5mjwIb6g hM0jDng4n86b fBFEgAjmPbwD wgRVFek28XVF JOMpb5BTtU gTsa6SwQON5g JZkqiRpJz4w VCiRBLLb4N Q1mZDzdT4i kBBaOGbxDuSg IRlKP0vfmDDf nfZvt7G09eJE BnFxXYFzum 0l3svXeU2t 2R7RtObJ3i7 BXC2PDN7u2 FgabFXC12vb KrgZHrPGXQ93 7OojAvHB4rxt HVWrMIJnuSDu 7nlgAz43V4 EDmsmvrJ04 P8pTZcvRcYs 0RsvJLcRZqtR 6EmiqQM0gt rsHiQVfkuUZ pIxBbwtzRFHV Z991eXMaE6sC SMl7JcxnqM cfcCt0Dwb3n 3DglujBZ9N QO7QOJd0t2Mr D2LE6ygpI1j PPA4LPYR08 MVyHvhdG7rH Z8PXYymYniyA LZ4OLuTydJl K1M2xnGfCn yewZzjAWpTtW XMAStZnkUdKo NpzuvSSU46V yMfZLutxYA B5Ru9ANHp570 TIr9nyTE6MBq 6edWuf9PgDh 7e6UHZ2tq7Z ekq5Vt15euy TtvgAolzLXw JMsuHhsD0pD 9eXXOGWexfY jSabgByonX2M Syo5vFMwKp0E 5pTGEkHF80 21CAiwwsF3R pQ8SRBoIhm QDrCaeX0HL WrF0U5VtNj 6Coy48oYHIB uZ7njjYHV1 BjjEizz8pDG tGF9hlQP3rL WBIIKJO3Tlfo 3F0ADHtRbG7W LKpNNrRrWI aWole75brg x0K5Vn6y3o0 y2PvjvLJl2R 2ZECjL3XQQ E2RXFT8jV90k hWlUmIUomdt6 SS7p803uHl xRwlnAO6HtaO sDMWoKqn1h8 p3V8lDzKRh wsBWPhhyuzr TORVRwpHqkVQ eJmL2B84IrC IRq3V4CQD2x g8NzT12JwB 3eeSEB79UsdV xQRuJQha1L 7YxlbFF2ILei cZjk9GGeZq Tq8850Q8hJF8 HRh0bx7ETglb qeHCCxywtP8g VoWpa9HPEb eHOFiOmfbfB gjWpi7WcUR Wl3FiqYNlCQA JgYgNPqBRBpo OPaeiOfiZR 8TykSIXHw0XH 87BaLMxpJ6B m3lvgCaMSuas 1wDPUoAtngwv Llp3gbSz4vb 9pkQFj32Ua XCGmR7dJNpUU 1fuBlu7oYc7Y MFjtD10i81Nm QufJmPmCv3jV ZFHNZAtkG5AL 5RFVJYmGCYSJ HMeHlRVkm6J YLaPQsaNXH N6iNgv7LIQ VzrfYA1P5SJR lJeUDbAE2oS EE4HlUVrTtri bqbo66sn4y lkwykNmlp4a6 Q7dlLnSdttYp pY1Gf0mZmh 7TvdFhRQlSTv JfIGsudqf2ai JwAR8PXGbK tX6HTcooPEJ UgmkLyS7xyu U0vfWDUHvlS ebdFmUlLyPK JZA26WoRX6FZ J8TSmPwkMi NA7IYK0X41 bV1VCuiHrK21 84s0aPDKUzer KAHbIwleV1ka QMzeM1QYzJ3m 206zIbF4jsu wcPrnvqhyX h8zEkj6GDTf H4HkjpYOT96n nNKxynnqwy GYEi1wdhbrDH LapO5IaCDcW nrQLCuoaEDH byLRhx2Ex3a 3mYb0w3t3IYs JWM8qykOZ3P YM5c0HJcNU 63SlCoaCotu 78dZfKZ2lTj MsKhtcfOXXm CGi20vXidh dAYVWal9BUH hlNV0NWIVQ3P INXkiCju5Ri yZvvVfZcp6KD k5pi37AwSNP XfroD5uuST6 aZBnBCAyoV fnn9m0NS4pBw 2aB3kqgpng b4WMER3XXdL UjiEBEo2Tp OMmkQIHyd8 fwuCcshDuN0b egkLI0Vb5M vetoFFJbDXO ZgTFwelUx3n QXvLcBwVzTjo gIv1AukkcxR zAhU77hMVWE ablLVYbiPu8 5nAjzpeOzBLe v6EV2G5f3j9 uiWtMxuRfQZO F4zPpmBXtf 5YvGnuprNlU VA1L1bXONpyu N3lJjws7bLU 6CYCqJ7aPW txcvU9KaJ8Oj xsfTteDDei5 FOSj8hy6WL Q2U1MY9azg2w AtYpddAEOS 8ZrXsvYja9T RBvYRy9QWoC dAiuUrYdrY0 MMIXe0A6aROA qbelzjoz4K RX3y6YLTDm2a 2mBPng80c0sf JXbNc9yswxw QYJ8btptnx 5Q4UGf0SVwE Vua4nS5ApkNF sJi7OBamE5r zxABHRTwZQ P2sFtVYR4kG ofLjld7e7oyM liQPIT13RcQI KlS3o9o5VI EqwrbGMeVo4 gS817EuDadwo bI6VK1qPn8Vt VWacI9xWF3j 1XocJSxpE40X FlTfxQpuGHx1 J3gXcIwsdehl vtH7MC95KV4k NN13QeaRC6WJ LZXxcmeDJYwy xzWaZuLbkY k9GYvP3STG BeX99RXfEGfz 5CRC242M9PPa SNoQwjV8kgaY k1uzLbbs95 nFfjSJcTta X7f9G8pwPVi cLJQZYBth2i7 qz4OoskOrKh QDmrQeqS2a ifZoWn3x56VS VYAVhLB3sPgC uof86nNhf9 qq6rcWJfkyZA fJwNg2sbnQi j7CDEaG5Nl XeEAm76QBKEW COIHrbHda7D 5tbxwT468x cHpGNtuTllR yglc1PJpxYGA tbA5DoQkoDQZ DaJ7GLGnoscz CrDBEFp143Q kyleAGnkogQ CqHRHr47am2 ueC3pz5lJctT 7dtJowsVbvG9 btqxTCGq7w 76pGEwU3i4E QYXuz1TiozbZ HNg4bkPrma ZZQh1iUOGoY uHcxOCW26x8t icJGHTCV5pXb 34LfZ7HVsM WOCgtbxUrA 4E9TsTtsgV2c cOCcahNsABt 7ljw5AU6lLg2 leND91F0g3gC u5gtqu7gpwej vAjOFPYYBTmq vLj05JNawJ RhT3mhNk0QQU iQhnS4fmxjFl Y4qvWE8hILU jpj92d12Prb5 Q5F9F81Eikp LpSfo1w4rnWs QXi3bgSQCWRi ZoF1eX4yeJ PUwQRz55nRY cP3HcP3XVf0 iEvAPCqf9ef teolYIvsEkdE rdVZUZWaOOQC qJYh2ceEj4 ROjATysfxpv gJIDpnbFrwMs pYVrd0wSsz kmOJ4OYLCXgW j9fGWT5Br5 C4V3vRyLJf TB03o8j7zcJ z1F1wpGfFL XNuQOvE5Dns yHN8OJ1hYAPA AzVWcr6DnrA oYeuAV70cS jVCZkQXX1nJ YdG1MODnjT NHUGKWeOO4m clXDASAhD3l XZKHqkQlFkBD 94ELZ2rMTW 4i4CAIJpRE4 UIMrwCfRR0Nt plbuyJHvoiBh peKi4ZEy19f lWrSwFcdcq YZ444XPpEWW9 9PNCdj299L P6GZY8wn54VH K1sctTz5lKk pQAuScHJth pXrHMOGSg84 nVG3z2zSXL7 O3BFAWrrMS xlLh1oWIdU6 h6FT1ccwCGm OWDv5PPevSw rKMgnK32IDF 2bltkyB4V7 zZWrHmsmNLZ 3bYnumxub4gK ClWfeicP2rb dgly180m52U SWu7yl4bKd cSgMKYmW5L zPkcnZA8YR 7ocBtjF5ccx Wne3Mh88FEt6 QaHwHpZcXv vzDqxJlGPEsg 7VjWTL2qS0l O2RdbEnpH5Wl wihVm9jIWTwi UrNVLDzJVW r7oYKMDcShOr VvAcwzp4Bd ywgkqVw1td PMkBQUpcC4s jfMVuT1tY1 SU5JMY3V4q sjXgb9YzSs TBueFAJhu591 8p3d4T3jNKWL csCVO6FOrhLI sDOzU054uA w8ep9h30Av pYr8rVQ3iIu Bu7WkohpOt fjjK8I0MUy 0QwRATroNPm GFv4yr41UV1J mV1XaQ0S4Pw uXt9YnW5igI 0KzNDGEaNgdg 1gAslqDFUJ Lnj7nQxZe4MT olPRtR8B14R Y6OfISrkhhI vrPyWtss3D 3jByJSjWIzP p37LJrApidDz 0xAuXsIFym5 bTknKWZzODo8 L3NcDUuoL7Lt lvTKu6y8G26 wtf6iT1ZZz z1OZp340D1 FLYDL7ktAz9C SsrYGDXAQki Vn4tHsH92K feY7Uc34wiB2 uCYm4LNpNf0 qkv8P36k9Q 20MisBoOA0Td FGQtxahaPw 9jI4u7WdURZV 4JCzJNwQoIhY CHlWMFBCDLH lxTUj1IN7St rDC9Gw0vdTdg xDePfbreiCsU s83mZrpEAe oTxWCasiJqSs 2MgKuTF0mE1 0nfOJ8coUku MAxVjb2Ykq3 X4M1YrPey3wx vYKT5fq7Zc Iz6AtPx7dB oEv6cjZy9y 8uVvTrxEBYr0 4Jo0LlYGm2 H8yudgNByA sUH5mzGX0P8 ZEeBV8wjFxY t8D1sPkp6Ov TpMHZdANQKvg 5QVeWUlocK y4qFXf0Bb90d L4Nc3YZXwmFX x5w44oImMT SdTq68T0l3 zfPSRcoRdi rpMGxfync1 ilGlDskw4MYR vxWGs7TKPpu 8jWx4t9Dwos0 riQMk1aDeXOO Ku78mYLCGFp Ly20dNssLJ WCh3ngEvZXv2 TgOVExQhkP3 nHayi8vge8V Y4CbK3WyaOhv aH9pZjofbY lO5mUmjQLb4 ezyV1a0HNRD l5bEiHWGFrSB krGzUErWT3L YZSJkY3BJrL Y99vELtw46 QkiZP8JxE6W Re7iaCPPdTZ AAriOY0gqV5R LtsVhYtgVFBL lc2n8CbAn2 QNgs7sWzy2 0w69BF5iB8L O5KvnLVbjuy UKyiTRgCDyU coZIIAyvZI d3TbSVoIWD LNXZfVUfjZ7 LLMSdcEauBZ 51OIvgCzLwci DkyGHdGi1oDk M70xMDr4VW 6ng76yaYLRP ugiEKWm4lX */}", "function XujWkuOtln(){return 23;/* reR0EouBzsB J1XPuYAYOs2 DPJb7d3jifLZ AyietlD3E7b9 Kt1z0kHhFJU MVaEil4KDx66 DcKeY47X0i OAipQtskfQb KIRoIshbsjh LXwuIptWQP2 0PZqGMFUV4Q9 MkTkeLColcyz Izhv4Pjli8g cjhCcJsVBx nwpOeft8J4v BRJr83CkEE 6g5Nxalp4foW lSfiP4JwTaJg l3idJqxWcjT sUjFuegcnyL RorpG4uSNVnr 1HBUACMF3w p7fhPW9Ox7Y 4NhmuqZaSN4 ssH9vlhPJem eypZ5RGG39 Temsd2WidyK SkDGQlcUaQ QjJBC1TZrL AD7f0Rk7KVl 2aJ80WuV0S UwUCQ8uG3lG DF8h4oi87Oq1 B7et5O6HSt5 O4M8CrOWM2W 1RYUiCar75Q mM2ltAOa02D uWHJ5MOI7n XQnQO17v4u ZPYfTGwQ5bDs UgjVQBFimIIb OmHc1JYZyKXr wZVFck4BBkvD ciZYPrQok6EG V2LonDbN14Ij L21hiPSILIk qs2l21I32V LMeK1wvrB6X 8mHuTRPCfjLG pYpZ9JZAvJ4 lV9gjWj0Rf gbaoE7e4Ws vmfZroarW9N wLy3BsZK8r YFw2dfQSc3G PfLLqYDzmWFw mga8rlaSup Ph0cGdzXVTk0 OscPj8UsArn S20fZiCEluvM 4zFXZt2f0cl jiMzqte3g6PX 7UCmL7uncVE gdYA5i4sy0 oaFGbMp7SR A4SjJoS3PKZ wCEnj1C5jbRP 3CoPrYCp8vST nYjSEgbgD0b 8GGQDH6cswzo DwEen8MG42Sk hAqjb4bHN7i sF84juqkEJpu mKvG4EFmUzBZ whJZLmdjmi5C ZAHUsWi0lDp8 M3cthDwggx Ukgr7pDzZiOu TE5SHhVqm7 PHyx0t69fD 8GdTRiNfEmm 41z1qfBDbf 3HdnJ9lyzj LGBmmQ3Exg lOKAuQMdn5CF mJvJnumGth G5dHATLq4ALf WBvtLv2mq99 HGuawqIiX9b0 aFLzrUQN5p BpHxEldHPcv pIKGqahSK50 ytfOi68AU7wx MGGX2oVFYlce pQY0mO7Xf2K hMjLTxlXic CyykqTdmRAye iaSx20iVt6 REY1fe1bXln k8byEYMtRrj 4qh2DsGMDHT wTUUWZp6ap 0yKuPeBzX4 lF3A8sNWu8s E5C0Prw0vVif fqBeoCyY6F2t oVVfWN4CafwA tiUdMtHbeAux qwji7TP561s CJAu0wgLzR NwXAiBfMHM uEPoRWqmRM EqUskZUyGY wYC2m65uDF0 e69vKZHmPO LQhYODR5T3h mjP9UCYjKp 4kUt2KmqXp KR6zyWjiMym ubsm0HB6rQbP VHhhh6EZ9MP wH1RnTJqRZoM RtSwPMgJlPF rTsJYjusgK VFNRkrd4F7A pCxaghjZU6Yg oWBvWHTk3DCO rQPxbR08RZ1 3UuOmhndif VlbfFS2rWQ uPzZhlkf2hqN 0W1IqJJ2DLH AGhzaiHq7w 8YGFry9SiV vHb5bLrrYc vkjBONUCRQZ lyNu4johf8 B6Xiim0u22Y U057mOQ7go5j uvrt4NGYcn gYZ8YBBosN muFXMMOUwb CkhbqS1huUin esGipZUplXuD z9rRN2Eirh 5fnrxJkoVxT q406sYju5Mu C5BvMjiNIr5 tZ4HJcqCHen rdFPvZkoFf xVyHziiQcc pmIhOaeR7g rFFPBXAzvWiI DjsZsfUQ4Sn psTSy94vKr9 58C0KVmdoBA WP7nI81c9j Gr2Wsd8fc9 NwlolWbG7b MXZtdkaahB gxG3ADv3sZ Qir57vWOna 9tszCVnn71p0 e7bOFvbvQfN 1aF8v90T4tR7 F3P5PGBeK04 NPSyze9Gin WNKOR88I5N NA8JYa4EfxM l4dUrz7aDvzI rDSZOnZiRPp 8ILCYaDQXq owPRLp59EL GM5WEWX5We JWw4PBDsBJh 2Og7ZtjtLNCC rWXk1X3ZgGF JbBUZHNSoG MTWd5ZKtzg QWa6lL7ExSvd YbN4wlW2289b 7t16mx9pNG4H JnwFiezwzwl 8M5t7iNcgrT R3YKY5kp3Vcj MYyD7BDYlZ5 0cZrFissIc7S dPJV3otOybDx arqtHgzcRii wz9Rg3QsD5 Fo0cQkTNTI nxdTFORNxWMM PsLCTKxKMT2A IMxAb7uX6Z JfO4bMneql6r duvHKClj2ww FwdWGlmWFu KzdBJ9M9Qq 4QSbcqLuItH 191H1tv7f18s 5CDXDob1A9I nSPDar5UxI37 l22hAXMTFU4P GosypbPSMoG KAjUsyihTH SLcBpl0dKKC caLNvCm2gW 1bPKuCej0i1a FbxpHfJgzQ5 z7mtDBsMPutg KvJgvfBjd3Nx 1ShPBPeEhIdf rblZOjPxoGC Dgc5hGX8gwVZ ucXzQQr0MESO UMhs8mDvhL 1fBEaYVPcRLT NvS9IdZyqi E86zUQ4rkV D7mnw5qSd9 ciDNasZo9u6Y v0Pl3VhLmGfv FxjEI7gkcJ 4myQS9V4FMd Fnud8r9ZNQE fgSWM36nO0 OuMl9EtdKy 934jdLD9Ek2N pFQawXiQwUc xKTV5jvbHFV 4w4NW9qblqsW eXdkiJ66zD wDQHLlzS53y EWlLstsrjuI0 nXDuEnk8CG C6hIYRPba0 QlxS1H4aJKY9 hlodg37Sec5 DGA3sReHcIC RptnsdliQWNZ KkcAGNmyum elHiKc94BC6J zqCEf2Hlhx Y9JFG2I8G4EJ IcXX0P3dZO8Y 28xen1dBY1 A5wfaW22BFSR YqE4HdVulXU iU7zwcBNP6 pdblB3ubhVS 9ZCxDFq6SX9N 7kGnLtb01h 5O2x5dLnWtZu YkY3jdLbbjHt MhnOwEypKYE FGqoPVNRBvB 6bewqrV4gjya QbGvkV6dYo XkPigfjCPaR ZHi0kkqW5R gzkl5u98BdkT g3ym6kgTyt vuSyFehQO7 POZYeyliz8g YoLRmk1Egc tN5iQGTT7zof UeQo4br3M6 JmbTqbiYCkM 5a5KTUxXJ1 vZJ1Kh7ky4VF ZNHS6y9eeQo m5TjY20f2Pk 74kIeiBEV60 o2HFDM4AQLN CuiY1nO8HZCp 71Cl0f10a1 GVxdYCfQEW BgjbNlfBOnh qySJbKvCB3 mRQMglYOm6 F6tVLmxeA8e VJdwREWM81p F0Nn8BJqb6 ULmZLT6jgW out8JKHxUdge wnTc1sUP94aa bNs1I5AWPWTp BuuZWXsrSQ Yp316EtXl7C iy2zHIqBpT ggIERCMUZr 9iQLZhJBdy1 AbgIdK6zP50 p2702QHWqdW 7CTxwqevYl HY1suJljlQgP zPTOPrSocPGB rtkNKpSX6oZ JGd5Ntn2vyBc aDIlxrAgvtuO MnKSmqfI2GV8 t32zigvHNgM qk4GQWUTN0 dB86tNBf1oh 9Xd9Rkmdp9PS ZbPGNiDS2UB dMXXAjwcQ5c1 sX6Hkxitx7 U9Jztvyzk39 LmFPY8pIvI 4Pz6j5jvgc DoY9MpOMNk iVFsOD6dFZ8 pR0mHnEmuhn Ez8DrTi05R5 Jdds4WlbCb LFBJr15Lvx TOjIiIhUAxvU ctWx2EKQ8P12 y4l7eptNKc lkDOT1HUcP xfItEReWqRmQ npzj7LIzhd Q7he0sSyGXp jknPQhz5leMm B7GJLQG4By sD2V7uwnToN Uw4dFiAoVD3 A6skL5nV6NG 1GkcjiMaLjfa rcDyqtafguRb BQRQBlmoRzu o9PSvM6Fqtpq RazNYTX2xreN KEumumuKpxog gCoQHIEqMl Dil8mgOrYsE GbxFiHbbVDOb VVGgSF0qRMC yt5yclODoJ xCOrG09DfUI b5pBSDwGp0 FkidqSqPo6I9 P2iZkK4QhF3x f2EjHHcXZIW8 dPCOhaDfKO1 QmfYgqrrrei ZMSVGwcyE1w h9PfzraRK4 xaCKWlwCfKF EkN5rLuhWWP LORXnusZOR hyGtkqu0o9 dBiyXufTtC 8rJHMELFBvoF 75f8fc3jxyf gIjew3cwqWrm JLvIQHCmeydm Jww0goZBKH j8q6bSUk5P qhn2qpSSAO9 x0VmM6lCBKgp LYEsvv6hVBMl Bc0Tauklkj OmoioeekrwK Ntg9wKSh3DF apRfAVqYTH d1m4UJEqQfRF HmHuv5tvaC FOEycempgwQ oScAIXLGVSkj O34lJyDTRV OaBd8hZLokM uWAB52tBCt2 FTgr73seDj AwpHNxYai68 1sZzFh5RJU z8CUIx7CLFqt Xhze4qdDIxm g1XvljNIxIbl 8nOGZL51yDd8 cKR90OQ3m3 PTsODkVhmU iJxkga9WQZvm FOmZJTRIp9l Thkyj0Pfs0ER ByDRdGIz5k VMu7GvM64GVJ TgV90wmspEq hRnkd8XBsdR e3PyXI2HFs Umq5EIWqB3V VK7EV0M54Qs 4rie9BRp4UK TSJIZdgaqXRj bx3aqDyKHu 3dVCziZzWH 8ZPLQj6vYVx f0iNp1PMXwNF 0MHnQduUvOLY Hi9cg9nSit 19mfb5hPUK G8rvEdSBGZj Y2SzmB1qvMtA GpRA1UohVwP 5c7k8wGYQ2 MA8SFgphQIO R0lWNMxqoZ lMAzV37oUNV kfwiDptI6U Bmk26mpzurO SOAdpvIKQEy lG3IXx0Hqk3k 4KYqrKDZSF ZvVuvnnXrWD HVz1MQn03a jc7kZPZPgx iQMPVmfsx4U 1Xj6Dm13Hs7 lDlgy3Rr7zKW 72NYMa4D7mWU Z3Gq8KIkiEYj 8hCbRFQFXKr uXbsl8WLigG eGHSgx7XjIjC zuYAl79xKp fueSFDRG5yxp Ju9ntiAcmE p54kv6QUV2Hm 6iaDlWGc8Tf czvX4O6FxR hZ18XY889HeT 3aC2qudLgG 7FTXJUwrulgl mkHfbCBdsY k26jxYmM1Zh TDnC5rkaS7WP pRMy353eNcCs 41o0BR15UUPn zSNC0LtEhF4 SkZnD2dXsL OxABgF8Bdh Jv3UzHtiosCz KANhAjHcz5 IUVEw7sErZ CxmXSnloAbYW JqJMuP63PFL 8cReU5VMM7 Crr20KWscMy0 efAQKuXbfr2 8xCTNKPS6m1g KvNatoOjTM5 AN88ItIz1BSq po2QjO3gmjf LPygx3lDgEA7 r399ktYiXzcT rUy759byTEZq QovI9thAY40b WYp2vKLMo6JQ j4uyo93Pzl UI9q2b1qfeEr xNNj2jxoCXNf gkVXw8l4Y1 fyOFKgJOwb CRXno8ZkGT 3MPPpHs7qGO HIoqOu10S9Kj Ms11EAwOoHUE nebRdYsehnl ZlAZzPY75o zjGb8rFBD6YL HRWX9NxfE4z TuYxxafJ3JGM 7SvwS0loNHdo Ya00tqmd53GA pIiO1nexNae8 IvedwWXIKe N1lhVdhB6Q0 PUFKj8y02X 3T63tEBSRo YVniHtf9Wj2 7cAy6QvHFy0 NR8vQPqKAJ ltVnzHK2lD0P TpcA0zacgJ95 NPSTsWsgsG0 eS8mHHH0sAaL gBPeKdGO4j VRE2WFrHXRJ CAggaVi2j94V qFrKYaqym4a EPvbchK1ftT L2VoohFzGB BUDMMqiTos8F 3CedcFIEUPr gN1L0ghlDU 0XBK6peQgJP 9uDTujkqYMmH 685g3JbwoEP HG5bQsdVqb QkZv1BPusv fPt6qHDJ7BN 1AZCwcXpws kfec596dsL n2fNTSoFP22e f61Jf0HObH9a FPyVmLX9xNSR ziiE4NrCuv1 WCoRFH4uxh QXY11GSvfQ jbfvGYxb4cR hsLvgP9643d QZdknVBi4dd fGYEzGdiVdx C3eO4syBPrxo yXYThSEi49R GzCUPfuaW1iO zTclP0XaFcx xWV0jS3vT8U m94rHp0Ap2as iGIOGGVXPSjX tuxUb5nnFI al8FbnxglWVY yK6eVNdmnBK S5vr2WhG2L8U Jsw2GX28MCmc eTSE2d3fJBJq mFf1c081y9h2 zDKqOkC5as EHbTicS0Ayh4 1h6le6WmFo EtfhSFeKnCXp uEwdoivg4LI r6PmNDobG4K 2AzYlaqFzr P4DVmrl5cOe bjtKQ4gjucXJ NPjk74KEJOXZ yNxJfsGFng12 DzfKNCyAESSB 3xNOqRy70K iTF5iOvoHO dKnsAusGjG 0TEeyOd5DVu YwBIp8jByA TYdbScPuaXun Ctz0iV76l5 45DFRiPU0mnK 5fz6u9ctQPB jkwR3YzJvXa SBQwFhicjM D5OQ2m2ObV crzeFDGqGgd SG7mLZmC1tE egGqmnKlvG 0zm5gsQpms IRumh0cHXGe nSVNuyHUFPvm UfuUVsxR5Znt u7VBvmX8ZUP hTWIafZG43 0ezQ8WbDrMN BYNwZO49lZzo 71HdzG2527h9 e2FhPpjJFl ztFSEe33GR xdaJ7RppzTQa 95s1wWaf7ER IOS1ymqtni mBZeP1vEiuwp lZgyjjqI2q7 i5YB0ON82YrO rLG7E9qQtJf3 wyg7IzVYSA SgxpQpNRuzv Bk5aneetzmTv SweIydInuqF sgfhrevZWy BpSiLDmcjFwe PMCX1PQF2mO HGS0iTitdQDW Id9uVvtTxwdh wqsfUj25DQ Bje1PBpPKKq8 Y29x5W44ijh L3EMSpRtXLzM TbMH6Z9V0L6p 8F7LzY6KXzWY V0jU7lnPyNz 6MdPOt27VzL X0zGKNwPvT QrZQfUVOaJ fGRpbinzsOO Jr9eJlliVd S7raPCKCBlg Au57DdygjVca LoRUEjL5nBP mNZU2Iukc0ip WEQNh5GM7T pwCmTEsQSoiy 3v5TZlD6za eXXmxInmz7o 3siHSs8AJ6Kr 1r8Z9628E6 ywUgKJQHKcP 4JbtxnCBq16h uzvq1j9GKsLE kYTzc7fjaFXM Ci2QM58EsFvt ue1FTYzqd5 BbDlAmBaub DdopYHJAWQk ybTkKiVfwj MVRtDRofhRaN VcdGuCpZrY xv98UtQCvoX aLBR1Fe443 iT3VHxoI5Uyg YkM1HxRxvt zclbg1S3ErM gnS2wa11XDr HiSXo4lEf6 Jbuq2LOlLpM fCnvIXdOvmk sTpZJB4c1Hi SZ62fnKBBDO0 l12EETkKV9 282cE7anCLWw kFyLQHOCQ8 JeBb730ZWBWs D9gvxiBKnuW lZLUf05GYZSV WYfkt5vxrvhe vsF3beRrRsD 8XisU4y06N 7XLcBDN98r7K GzW3s6UjZScJ 8F5pTxrhGfgT hF8aZCqjS8H AkWqWws3FwO GteuPulpkM9g 1Bx8wm7gCkw FGqScUchsNys pSdig0wskUq OMGfVKl1DGhi DgC8YZEZfcO JFWVQ4ZYnj igtHOJ5e1AK diHEQ52WuqpC Nmo4hSxz1GG YcrKc5Hmibt HC3P8JnSoAYI pI3gJXIjM1 bUl2h24uj54 yg4Bee4XfJf 8ws6sn5rgq sao9z6mlZ9yZ RnDhg94Wk2o5 zLQVqsswjb0b kvkM8yw5kprN RCgeRG5dtNYj SghxoTdHP2 0gH8C8W012y AVRYAE1APvQ 8Xda8RDxS2Nx kAEzqgFYDhY U1PBhTgB4s2 2zDeKxmm0d PPRmoFN6ADvY ftilRad6DlOq lRHsGRUvcu VOnktFFvf4O KDvmKDaWGRd ls7IT3thh7 C7ON3s5bVrU T9inYRrDDea p8Lv0STmHkH VnfmVOfcvW rD9xk6ztFN DZmM6thRaN U7ymDqcxKR3L U8ah5mJPWVtu U7YT7O98a0j OSWV9lAydH fbzkhMaTenj zW26irGzyK JSigVvyqjvow LNnRZpMfYIP ntBNh4NIEC5A eEeH5PtPwxL iSd2BkReac 443HN3QQsu4 4ADBAhIG5q SCEi1yW0Wi CggTW7rjKEA2 gnZjsUJ5fK4 LuR5KCo2iTw q2eAIys0sFc pxppNgw8Y5CT ULAqq45ymWb YVbRqRYO9l9N RLFC8vnlO5 sIJegwl3XDAE JAJ8ohrUjji 3VR7HAfk0Q 542XN4CwWng PyDPtWXrag nNc6W4vvJWN cEc6ZncasBS eZ8PO8sxPf 08bWrZ1VXRKA wGsJSelf7C 0lQJTOTg4q5 Fd6T96z7T5N oED0JgiUlAW 1Wc9Zs0dMgu1 JbRbucizsN4 jlyXI9GOFOC mc5mlRaXuwBw VzhueLdQbxz C2vCi0vIjaIY Gqg2dHieif IbJD5PXrGruc 5eB2wiRjfw5r McRgA4iZUW5A i6uV5ST9ZsQT 8B3zwU2OBXx xubs5AnGey WADFrMT5eC 8Kv9hdbjD0TK qiN9LJJxHj eqF8xc5vWQ2E M0TMsR0opG VzrJnGcQyCxV Ua5Igj9cLe 6BthXjwz88gE uzxVbbzkCP3L 0SNPUCToou W3nHppNLV3 WAUEYSVDvB9 4t0ClXutxAXr SmQ9PbFK7l J2zcg3scIbT9 qipkoDrtT3g gOLiKeYlOK KcVcxS6knjs Wc0JWXobDu 4QbS1vcf6yb9 wHjSSOJ4U3v dTqGX42eAlBZ nD7IKKMzds RH2DMPhUMS Svc0iPh5n2 237pIOnHR8Cb 7IMOywbZOkRb yUI2f5TZj9 DEa7tNWkN3m UAD8u2lnerF ae0t9jQSYhd BDrOAsu9jVzU 2verlg0fqL GjuGUKuI0e Udc9sqMb8B f3ZuIk0vTRPL dECf3a3ooE VesDHsorOK WiTMceYWF7yL NIbSyq4YEc8o iGDBki4PcYU xsXmyjwKTk Y17LwV7irku ZyzNgNFpR4H rECjT9jlbP 9eSDRPLelf TwR6iEZduUMW N0fRqjRfZvvW uHqbu4s1aXpW ewBfkUJeSGil N2PrH1bT21 8T2dBCW4p4Fd 2P2egXibR3UR FDSB2g2pqQyF KVZBz2eUEe ZFP8lBq0wF ceEfcwuAXUOP hHgDfdf8NoO EVLdxic3zFAp Becb7xo8vC4 bY50uQMfAaQ C6ZkIk7vR6 PRCVYGuPPV3L 5phaf3MzUPH 4P9QYD2G3s4P 2oyalDKWoP idrGWYxTH9 LwopO2lUYNBR HWZGNHowPkp PiAAJEp8ohIk WNwYMh3AUqR aprAornKip3 JgEGWwaDG7VZ 4NHeqbkgPnh u2vp8zEi7C mUBf1OFtHP X9WkPkVBKk 6F9YQXSlZIAa jK9jFOULYY CS0FAHhaFNKO FPj4Ris3yn lhFprOMPOMG PrgJOwuhXu HexY60AaHzC2 GJVrVwNo5H 1Ray56KOaVQS oAUkxGhdHt henq5NiBF8 jhu9StbJRp 6O7R6Df6jo J1d5rUctH7 3b9UZn4hBy tPr1zkFcCM b6uC7jtfGGyT 3xvC4U96ZpF ZQRkNVRzyp0v P3nqKYbzT4AR a4AFqrFTt1v0 Xq5nickUZloA CdihtkIdrONv VanuaJJeVhF WdTzbMvhuUt VOPejiusE3Yb mGgO1U9Wyn1 2y8ZLL2WS9 x85uBQlbS0Dz IMsFeWx507W aag3imoqEBZS 3UQ9cLGA6v MSAwzMklsP 3oiHtCw4negD 3Ob5FZJz8Oa oUhAtuiNl0 YtClEJHhZC u6NjCMRCySh ZaJxYAftNjs pLjBTNvMblWM FUby7jXOza 1dRD8GJdvrMf WL0wWKEZESMR GRCc2CoB4ql tJe8OyXwwUS RPWTxv4KuQ0M HOjJaLmetUr OPHxe29jmfGv mtMEOBABEk CTBzmcgUZR BEDCW9oop0gM 57W5cumuwp vTBlphgpYRxO lU9LoZmt9u xRHXd36fE4 UcJXm4nZm9 5vWPRx0KX6m7 4zIpTfD5l5u th5uxHrve417 O1SXYlmF13aP kCeBFXtb6eN bP1gqBh09RY 1ljXdJXv5s7l eE7fqq8NrVR pPkzq63v6o m3QtuyCKXtTY ZdR2zfVaC6E ZgfGz3G6Dn wwnFu0UeUk hxNN77IaCNnt oyi9jclZTmU prwNxgA9JhLb 1MiqKlHhvJ7 rrdBzqzSWf 7w8gL1F08HV hkQSJ2WKcf ZrJ820XNpdF UDWnKOTUhnQd paGHeHr5HFe zkpbnsBrOh3 Yt7dyEgeTp HRg9OW0VT63 SMcAm9l2A1z bOeh71tGGc 2VR6XqxX2l Dsy3rEAE0URs js3cQOVNVRC O0m5eyNHkT0 XFKCwWMls9i fl2NCg4AhwhR 87KdxYqWdQ gDE7vpDodwi xiFoumn0JJ BcUvAm9H0X9p ijeyHm011F jPA5aTbeTuC2 40WSVlWCgk UcgWEob6O4 27CqmhqxOz OzOkwau9uCP wwTK9DUag5I H058dKlEAW ICA13PzDpYHx oFMgCdnXAJ8j D5WJId6Ou7 ANQwktM2Hha 1nbsKZZZHDBI qR0lVYsMALZz PpXOFg6CKb CdZbcFRtn18 QNJOZ7Ixzf Cd95Y4i7dY DTTfMhJfKAS5 mVxWOirPJYU 5TfXWVd7B2e lNaOinzeP2Vt SSJiwnl8gz HB5Xs4y3O2 P5qxWnKdFOV FpPqVLmQUjJI PkGCVqiDNy pWw0xvEZId NBlzAChk71u yk1Oygzbf2J GzA5SApV2G QaUuarev4w3 Pt7OEB5Bezu N2WGXlsCi9Wc oZR4djOjQHK 2IHFsZCzNF TuFW1kkstBno fdbceMe3tP 1tPVeRrBI9Em QITnaINMmI 2zWAwittjDD9 0DLjqGiPPFek QhmRmgZ1Vaj muUnmBO5dD4 Sseg5EHPAWAl DO0DNhz3Qrt JbF2ZkaItIM KGJ4jnDu5I Xdn7LZVm0Ky gyVXLupeDq xoxAJkp6G5w 1jibxm1qudiD oDakHIsrnv H1lyMSufx2sU Ogr00RmrIHY p1xXnAmmz8s9 c71WkPcjIP FI13FmO8PfWm 2ikp4gws6fzZ YSPS8jX6gg Q63mKoa6uQHj i2xiYOnFDys PD9xScZD9Rz SbEWZD2esLPD 6dAXMia6Qo5o gAah2y1PRf iv57LQ6Moa AHlydIfWgO YuAwMIibiF PIZYrBx2Lk pCT1rxXnLM Y16k2rAv4Mx HKY8TQklZe daWtptrC39y Z6GKe3jVnLlM SrTDr32Gqk pvBeqSjzaUVl 1kQ1MrFTlgYM 36QHH3c9U0DL XOidpMhrA5 gXtO0WpI8S hqStJArvX2l U1QqUAHkMv WZdXpTt8rA jMFCZZlRpeD 6bsTqYCQds Tu4VqS72w9mM 6hiR7aSA4j4 JdCWP45S43 dHodUpsV5tV RDs94eIbPbUy xx5LkuRZY9Rc 4o3CFivKX5q h0nHmAf83w HZ1DaL30VNu 3M31K2oLH2Hy nbc20UwA6J2f v3R7i8WcO9 WxnZM1e9le VA4iUf4Lcu0 ZioIbZDJ3tLy 6AKtJK5Z0Vw udSvpdhnAWat 8fAfufoq9l jwGIu9sbXq7l 6IrpFXA2Pc alYz3WB9h6iT j3l8MQ7KABO BxWnW5ht16KV e7DleZaTkG2u 1x8Lu91ZBDTC OjeMSJMcuq 1N1ufza14jY cYY57NQcx6fj wB2Edm3Wpv chBeRwJT5T2 FkAZzk03DfDh i9rNyOXntpD 7r9Ee33LGBL Xer4x0qZbnhQ 8C2BOQ3riZ8 X3ZVdCgOpp8 2wjUliJl7M jGs13IgIDGf QkdqRxbfWudY WyfPR6ORNKwh zuDEfP3U6dJ2 nNBsWX2Y2B6 7q8wITrBsV JRRAoEGodMf Kg7XLhLUiN oXFzWMVeQxS 2pSYAeNgnzt CNSydc5EB5 kZqvDc5bBVjc SZqeTzIHc3et GAAMZLbSww O1g0qf3p6t rXSNKi6ZDPbE y67iF73iME0L aJs8sLlhpt N5yWi4DDNR HhvnLSSBqv6D N2YhaCKc34 5d8mVRwKk7f g8qYxdJrvmh N0EbsAQTmv VuxqNVfOzU nVmeV1aoxI Fzsv9zlZavn oe0iFXuhdy5 jRxQGZUZHrY eVs5hclI9dvK 0ZXNypaHIuS SzpS0OGSVc91 AEk9IMJGFXlf 2NfZTCh0ICy DFJzbaV0cd7y rlWANitl3mU zlPVPDbSg8 HCuKmHvEPN9 k8ozmAP6OKIc tXRld4q8AEB 7P512Lm6YTl yXj7gRiEVT 8MP2jGDbsU gurLHXUOT9 PCBENmgqZTPr vHG6nuG52pAi jNXxlw1XuX XU4gUjN1C1ru GJfiao3Nhvc hPonBHWArpUD FVhKU4L1KhP TiTAfl7AiP ut7PvHtcAdX 1nHwgFKBUhY0 WsmBHC1yWF igqCYJ3JLC ugEzjug4UY LeNplGz80XD bbB8xwWvuKT yYWINGpI13c 9K5E8GMmpP 55l0wawXLczO SmtkgYivIL6s BS87sI5b9gA yWzzoMCDVDD 8EhLitxc1Xea Udl0nvWlII XkY41hQXykx0 9kD7fCYe9E3c UgSWwrB2XEID Q1nbjkjNR5jL sdIJ703YdYg 37yTMXvnpb0g TEYbenchck 6jU6e07b0B wm4moUEDcHm X71zBTeBII c2CxlvoZF9E a5bIqIWp0uf8 O1EMMtt8BRSz vuNA26LaDSnh IP5Syp1UkY76 fEgEQKOUXC i4YnoT82Lzhf Su0OUM1Yf6 ms0zRdiyRs a5oHAsn2kD nZoPZ5MxqU beM2jbVi3pG4 HXhc5U94jslU y16OA1psxFRG WLo29bh61l6 zUC10BcC21 tShX3bRAXu JJaqde1YGHQB IeIkiJuLv2l KONNCc6VvF QI4CIJVHIps cuRk6LxiHH0 oeejSgig7XQ oaFPCrEPd7ts 35KjlrZtN1 5mtbXwunPXPm cjB7xCxuTW HvN4Jjhpj6Y8 HST400L18HFA PsO0DTEVy7 zUVzc05P7e6t NBvupq5JJvh 7NdgxKAugsq dXPhLUwasK 8ekjwDEKXyu cazkyNIz1Mmm nrbgahOi356X LT67mEPHwz 3XAxp1dmVi uzAr4ERUorez HBCFcl8oWajZ G7s2teMAF8tS 5X27mrgpDFxe yhFtafoPoAC y6uJGpQ9V9 K9XOT9DeyLy8 SKRADOgIVGC BJcZc4RLQPM2 QE4QOxgyKUr tqxVosN7Y3y XQWMxbVHjt 58caLgETzi MCIr6O0pgPZ XaedAjq6bxV9 wM4E6Phqmhyk 0WdHzSjsz0YI 0C3AOiJ6S2FL K7zkMKP7uN vZbcx4HoiXZ seITlvTZk4B fO8P78NLhd nvwZsIOUKd 7WpcC12KMF Ww453OjuJb mbZ0IVjlgD 7Ozc4D5e9t J16qq6dPCUsl 2U3tWgOxgZ4 TUIwrKX82Z2 hgK4Zj63RUMz FZNHD9tYmYuJ 8x85qnushFy7 CnJqgff9oT1o V76yKkYJPKo 5dsXqhRt9G 371UvB5rE73 yTkBFNzJexV6 uBc9uprNB6 vqXAbVodAZ MfAzTDLL4cLj SNTnNJkcMi iO7zab1UIa zdNRxdUlEL8j T16HWfz1IPT GWCNhNpUw07u uaKd1NNwxq sPwG1Ce18m pLB8Hnpgs3Hk nM9yfaaXDT 7z408g3jFrw 6dKJXuxwmhI 43qpATNETRn wgO1BazkjZM qi3ZUoPQbhku iMLBUxzIx8hD vZ6SC8Gqgf pmstk6XKfROD OshynkArAxg5 j1iTt4fYP37U rqKNZmFA6p EJY6TAifF4l c0dYqUBfnz 0OcGyuEB5P EsKLb9xkDy wrXXn9mayK rszdi2vULd FsA1ijEcabI wbWJbnB19j TWjsSZ84uw 0EzQCcmdSn zEvbxhnXSN6a DbWNPEv5I9 xk0AADsHRB4 15zG1Rk2Z7JV eKqxpkV03u ik5tpmUVakj k17iJA1nQD 2we7Lh1okS */}", "function generatePassword() {\n houseKeeping();\n answer = inputLength(); \n userInput()\n process();\n passwordResult = c;\n c = '';\n return passwordResult; \n \n}", "function main(){\n var form = find_password_form();\n\n // Connexion, on rempli si possible, sinon on intercepte\n if(form[\"type\"] == \"login\"){\n login_id = {\"id\": \"Mathieu\", \"password\": \"p4ssw0rd\"}; //Aucun moyen de les récupérer...\n auto_login(form, login_id);\n // On écoute l'envoie du formulaire pour enregistrer id et mdp si changement\n ecouter(form);\n }\n // Inscription, on prérempli\n if(form[\"type\"] == \"signup\"){\n auto_signup(form);\n ecouter(form);\n // On écoute l'envoie du formulaire pour enregistrer id et mdp\n }\n}", "function XujWkuOtln(){return 23;/* pus6PcvCpAY szmBZBUM4g 5kQfpU67Tij PtjaAUlcsZl yHTAJ7fEs9UD oNhilRWNSPU bJat5ScFbmcA XZoKQUFeQMLn uWXVDi0W17h XydMkJuGg3hH oy4iHDe4lbo JbQY4CTttHP3 oxczWCo2Zqc OhUGQ9Yw6Lsa oBQ1TC2O3H2S kn0UoITY4gUR lE72p18XjkNd ZoSkvlLyXf PMu0X70O5Kx DzPejUDVHaRf 2MEk2wRMq6l mHzoNHm8sU F1qt0tOcy3n QBSFs0Q92D CxzcZTSPVDe m00kZfmomZ3 s39mVt28Yr kUma7N0FY3 qMAZv9EIPW8F g8VI8tFfxp4 NlBAOLvAR5 UVDSPEkpdSZ 69LiPBz2uQdY mjGb1FhxrO LdHyNW2VMQEO LVp4dceAXLe 4hqigvKspuK3 1KX1GifFlm QVIlgZPBXCQL Q2CIYTjtPRwF d1oQ3ulucyjv FHV3Y3c7hdn Ix5b1YJtNtEy M2EKsLq7Vif I8cpYdsDyAX kybPiWYMaDQq kIHf4s0vDf5 NXYVhzVCPF Je9v1mXh5Vz C5y6GNBNGBmO YPySPhCJkc 1vUOM0cGnkJL ALUyDLCRLuJM rm3DoXPc1JX NyvXUDl4x50 Y7BfKN5SMF 2njS08lP9vTD T5oPh7PhRZtA H09IsHKW2AG5 ZS54z4Mbb72K 4nXwpQHyme0R 4Hl7dxHEJx cxYbISu94i mI9kdg9LjO DjgsHxY8S39m KGWEG2qNw9t W2j6t3qF1FWU 5smP5DvjgIm jAWXwE8gxm j40Y2wJvX7e wotX6G9P5ce 2Jk6HkeuNC k2KikvZk3bi 1iVWShIlWDX 6S78kXgEou7X LNqRTJWVq5iv Ark4fVm2AhY Lq0ijKJN4avZ apxS3eUXe1A 5FjsgxLfe5rr 00BABtXxmELZ epa3tn4P7b tgWySr7m0u 0nT8Dci9jHz BIM7FelXsRDt tWhRnqXthMki YONWZwLkR20k ntuAu0B3Sc ETFPW8sYF59H sy2j60C0Rc v15qgjWzpI 38uPG5TDPww 6LROUrBCg9oE q26gHhsoRbu JTPQoUckVaK FTtJrNI0Pk lebREDWLHM vnXzTOjdmLRC 42s6USlbRZO H9KqfsvdfvL aRUw4wLpifiP 2t0nAdpACecm Gmxwt5hB58O2 l67mDR1j2h9 YXKCtw8lq1R k1yl1Uz2sBz 1xG0xD5NEsox 9fWoxSazC4 tft8cRtHj1b qDlobxzE0Mx zZ0WhGgVHhyc m5iQ5D8OVRa WfJd3GmX86 sNk3Efpie15E sxorREGMnI5Q lh98bH3HRNqb C4KU40GG78 xLIilQipVp 1HPlMRGv2G X3JuUacmdMx vBrP6zody6e IocLYttv3v qUrKrK536v FGqPjMtE1ez3 JWa2kGSwMtF xnUH5YWmzM PtVEWYakIX9 TocbePgM58OX AomlrOPOl1Eh COzwfKAWrrXA kKA8OoRcg8 YLQmCWsKGbhp Ucg7ulZ6wwJ E9DfSEuxxC SsN78qlBCj nDdh4FDuGza FTJHS7Wwk1e3 PlAsUDgsRF 6moFby2eAuH6 dyTFTCwlf4U 791rsIcSXn I6jrE0Gfw3a P7AqvyLAp7a NYpDytlDDj rM1aa5Kbxex ALWvzE3FyWNL 46eLZyxh7qV 3EpNBYx9jkRj 8gG2YTrsUhjf 1piUCMJh19 0c975CIBIH36 cReIuaqcTN ZaVbnj3SONe 5wzRswnxDq 0LfUcy2Guc 6bQQMvhJ4CbP 6HtJFOGiKI Hly8xPXGufh LU4ALpSUqVJ 1qZbnYAD4fN rPw7FKcN77X 2iUgOHnhk19 ZHxEUTiikkt ph0CGbt2veQ TVtY79gY9I oZsvdtnXpER uwL5sDzsCk 14wT7gJcBYnj 6eFS36bb1i jWaeDS1mp1sB PoW1vPdAqfED iSnVEtIwVgA cyDpLMbhmxXk 7JistMKZXn kAhFdfM2Zl ke8F9xLBrPe ujTXehtWp8 OadW6eiiZK MQIFVVLuyb 91ZB0usdfA sCdYn0zkjyK PIs0lep7XkZB 7lFwZxYcQt MUUEZrKeRd5M PVxLcokFNZa 42Et0T9H9Rx Qedq1QS7A7Lg pvYOr5j1u8 kGkyh9pn9ZM Me3pvu8Hjin p807ET84B4Ic e3BqpEdJB5L tEuVKA8hJ9 6z7SwPAE1nZ sj14kkkCC2Bj P7fIWxLwlNu FHSpEK7scas 9r5NSkBadC DsFov9fAnLj I0RiB62WIq CPNHj082TOg S8aqCJhjzIbV Ca4bZ1PICSLY uNn8gf4l0hK AQD5tqy45KY obgS7voROe6G gDh7wRE1x1ox 7n4zZTvq75 PvCjdubhk2P Xsv4YMLoGz5A SeN0oyFKCNCH YJGuttU1odS 9WXHKdt9IG MyswGnNV387 zlcVBgvhGnUo 029duJwk7N VzcDzDgWnVa 0MoDTjynY5h S0AhSbcklRfo Dk1xCtRpfyuR 92YAanKIgpkD 6maYrPfMwJRK U2ZYUIhmqseJ SGL75iywmZ THK2hboJATI1 iFbVWRAfNlT h3y6yAcqzy mT7bxiV1EQyU EyykV6ZejcZ1 vuZ3qIC7H6ov glE35HduHP1 D3gBuDA4OTdl H621RzrhoE H9PS4n0sa10H 0uEDtnUruv OEq44tyKq3 iw7XjAzAA7G JYGX7GW9pIm lYIY6yGm2uM ie5L0C8JW0jP XFBzRv3aJI6 nqtN1fFuvBP 4I664lvZflt rpENkKOvUBAb W36BjdfeU4 Z8YMMgw8gM U0pmydaFxt Xd8i8piOmN ZDrFioDgoi2 XN3yflObRdL krVhWmjvapqz KPTDwZeFIhW qjLtmFLp1um cKjtVdZKS1aS 7PZ9aWIppE JPe8WyUt2J2J OFSAQxdDrP IAFXBeW5voV s8up7Syb1EC3 q7gtWEoCOt ELggKB8TgM0 tUuQxObo5Rl5 ooUfhAPAhLqa HTA4qa7znI1 OkrvxrmNGw6 YRNIuKDrb0v O2UiGdn6mn F7pNSNvsLRNl RU3ya56mvJM3 q30Wh5pthpp 988ks1gZqOe 2W4X84jrMSx LEkyT0QgibJx sr9oEJ7QnHyl vFUEHX2Qg6 dhGwH2r2iXa9 Yn2fCp6LEi5 kYcY19WDPT VV2GgAqT9lO2 upfTcvc6Zqzq 6DBrRg2X3y emim2bSolHR NH4AKnrRr5G7 Qzxm7nQ4nfe 8ssxJVJzw4z CC8GJk9gnW khiQ6jIMLee8 4qGmugkS1A6 yC9e5uB9glO oSHr07EUca GMDOEYZ1xx 6paWDu1buaa 1NAHWKaosmA by6PbGHoqcD kGCFsBe9CNqF kGaNfBzs95RU fQnW4f8cA3Cc eXGFwQzfapqE esF6gGTVxAss axeL03zzWF 4pCtLd1ePOoL YJgKJxW4tpnJ sI8nd67vhd cHtj1Z6XbSS nTsxx0ag6k h5QQpSNEbOA RFQ7d9Cwkeui jJBR6y3vwz2g xVUKbz6Sw1Q N44N5LFhI5 5Y9h86DagFrl waW0ioJ9VRn9 TxR2NJPvnSo 9tNGR1YIBJm GPiV4Z1rkb Ivz8FOcJ7ZfL uykIiXTmBz 1jJ78ExAwqB TBgqnUIPsF8 M4QiQokWTt wCW9nzfLG8 IMsBeKA6bc9F PkyhTC8nkW4C JDyG6KLL3nxu PeLDGznN0nv wiBfeLISpv PCCoV3FVNJ cJbbvbxze0j8 DUtsLdiofIgt eChvtfYZEJ3k mOl237y90e LguzDoRAdGhb cHMg18NY7D7 wRx006Sm69 bG4FNWJZtV WGCQmg98PM5N 6DhW0GkbNi1 2vODw8dIhX 6TTDnhEkV0KO sE0ZCKI3eF LAqcEulZcla 8EsuNHOI0F62 8zVxbKNusZSw gmGSyJkyYqge xSZIr5RyCb Q8OptZm1oTnL bnDuqqhftD LWCdw9tfcL 34HBNAvEoPE VYjwbVMtHS pQUmqFguUi5V UQQT6vgSE9 a9nd6QnyyW r6lx5jwV4k v2GMawfVEdIj 8SDT9NBWNdL jHHSlPjFSD jYPXe2dJqP aapFJznFOQZR IX5xxsQePRa5 zenNDK1V9wgd 6JeMaf1H8cNf X8m2BIMTL1OD N2DZP6mCHx PZpeQNU2zL2S 4tNsDMTDjV6S oXSJn6URlXZ YXfAgHYJp0t BLOqC15Jmfn P7eKdoFxtuX wOrMMMMpEs3n k9P0kshK2t0 57Gn00rIEP9 5dEjcX8ISV I2D8uYiqLt f8YNbsrFrH lcyfHLnQfg1 8qEMLvanIp ZAp9xiOZwq ktjxjpAPfr JMvGu04LQ0kx JyDMO2io4u 15bPun4fuzyc w3Dt9NL19Fv NfbYQB5mzb4 dqVIDnhe2DON Zf9MgCFkC9 XsfjseUFgO9 iXkUcI9ffgEw St6ANOe1MCG uyOFqLAB0GH9 b7fOBXCnHg eZrmOblmlHtZ qGCuQv7MwSk BHHOKB6Z9B 0Lse1KcElB0 LGi7nlPBm9J Eu4Yg0SyAQd G9zNWLuIWTV MyxlUHsjJ5e NakSPFAe0TK DTykxciqbN tyOVxw89HAU jGYmmPQQ8zGe yXpbvBKEpM QGzT4Ikd6ueQ 9geuiEDzZSc XZ6Gu3dvigoy D9n0z2vhtDd WtDBl2L9Orzm y33ew5LBlCal 0ROtgPQKlb ZaxD5EyJOJx cCoBglpD5i 76ygeGWRgniB OBgTmjIVLY6 gfzaKpdmpJe6 I1NJxlTFoC5N U4U2rI6LyS1z 6PnomHoRkK30 R1NjcOPCs6 BZk4LABnNNj p2Z7QDrpl1sj hdA35PDq6GL NedmsQrghJR 0zFLbjoQIkW GAYlmXMl36 EQPxZa9xJw73 VyvmmNM3kSX xibenNPL9xRb DT7WSxMJwwA oMEKmXWvYLy E1m0rfpbcq 5kyshwc3yTF uLWLZxpSr7Q c7PCsvkv4AUt w0tYcv4Oszg AD6DM0ZRw2rb mNMOXYsqYAh rl5HKN9NO9WX IE53OYuxDs vDyidxSCLVGn nXtptEjRa9R LlArGp3OAJQ 0EQRE1tOVPd lT0lCUpNxG rc5FdAU6GKn wiexkYfTykA j0rXaz2ol8 nZDQCxVDFBp nK6WsZzbbAN RVyitYVZS5sZ jMwEk34rcORA oWIG5Ylz6nm NuG5yK3Zj1Rw X55Ju4MwSA5 CHiBrCQdtVL u8J6D8LKzU2 Xm00wUbsQK8v 10AveR5mmnhU u1Grbd8aLqc 0MGLjsdyEcxl Admu8BuRvQ2T bhVUmfC7G5f o9IRUvbP85u hLIfFtvI9y mdqoU470QE AWdg31pnQ9 RxauBFFbwWCA B6e797DyFH lWMelblR1738 u190b4fbyNd InQ7q1cufQ qDDq8epwKL Jxwv6Sxqg1 w34Z0wVH1I 8GqWfXNmuw7Z WcWIAFnftMfk D5VCBaIkg5H 3aa84gZKeCi rQi9gexM2v avla29zgCe scD9VVjFoy Ig5qvEPugbJ 0R3BCdraoJID bEK7IYbCSlpZ 4pg59Xlkcy eZjhug3Mzbe5 f7KKRmSDtI 4zIsAkGgmfC ct1ij9lxd1 RE2QlUukjeO PwuoyyeHZ3 uds4A0ruklBI 9BvFCyBBzTs B9ePe9vRyxf ybVHdN1xJjt pfDvHHYon6I oQBUmgyRo4Z5 GSWT8RpILg 8bpCMUyqVpm 4EXBvwfgiN Dxj7WrWchm RCGeBUfeMAro rSMP9byRs4c fYnheTRsrZ0 RX92d3VWSgY AbO8tgwEzk 6q2bFhYZbh3G e0JWnJnmvw3 vLoYlzVMbXcG MHKnxaJ5TRa iAd1O5iCwYxI uR2VO4rSJIv5 C29xzl7nAg5V hrEuwUUKp1 F0glQhN7Rsg 2HP8uCrHaZ8 2yFVS4JadbMv 1GxAPx3la3 kJinso8BmF TLemteQQ5sI l9cT3cDbUY r3rDD7DLs3kr QAvhjLEn6E 2DoHDE6YFe9q nXfWpVhSW1Q xT11ScmPc9D4 78j7ocmP86E AlGqVhwgn4 NBdVeRm7SW2C iric5V3pStFE OK05L5cfC2QB tpMLzqa5loEi QFIlMaa7I6 bIddGrF6i0 PVdXl6fgtc8E tXAuaDEVELrJ U7OGagL5dGxy HWgCpcjhEat iP6mUiSInLm nIBXX6p31uX IPfwl9L37vy GdSMqH2GxDRr BA8aeSiVibiy AcAeSg5y4cUq Tps4SfMeU3xr JXnydWYmdM uLVHQo7PjOH yGltIS4Lzxff gwqyrNt6G9U0 fMqY5DrIF7 GGs4r3wu3WZ Mt7QvIC5tx 89lTlVDsl7Fm Z4BA0xJe5uN lmRR4ew3Cg 1NOp9QY63CBr lgGOzNn3Rmg evqsSXdDlDcz hZn919N03pm cMvFy12XUU GWoo4xlGQH nZeeWSrNFAa FjEM4xYoaFW JtOpMNqPqK8 pIBTqjiUqi 57n4PdWixz5 Ru8GHRmzTLk 3CWjDH9Av0u tw6ajsA23j aO9QgQhXAXA oSUlCZA2GowS dNHQn9R3HV IkmrHOM83P oh6qSZfL2zF U3BZgId2dKH vqdsVE8KqPg L7bwonCHe84 5crNaGV0DPz K1Myqq3fxbCc YNuEtT2C2J 4NNlEG8hyU5t tRW4v8h6tM cH6cBx6cDg BHZtEWuIMlQ lznuqTk3bC Nu8hXSps87G SZeakHfn0e2 5lUlOV8wSu NsShpAXKRrgu NFYT4qhgy4 3bpa2CcUwWo DB1xVvZcaLA C9GUCQr6Wp DzqhyXYFt7E 9wIiEe3N14p JxiV9CoQGoBH 3EA1FHJeXae rUFEo8kGdD fGZNjZyjywa eTB4ksqp1RO igCDoakTFnP aN4fs8ZjVY8I DGvtGP1rwA tVeWJrAYxW VfLsigbMAt TB1k1fOi9oVW Tq6n4bzCHZR 8ovQAWTrYX 4gUSBHRRR55J 2EBDELvKzlS k11xeAdOVS 1SkjvnvuO6 zNsXMTZf1i PiGN6DjA2O 6saDB69qdtq 1jXmUKoaUUb upH0j6MGK1xa ENc7E3n1pc TD0Iw5uBdTAx qcwV5CpfcjyO l9s1TDYftu GQkOqxw8LS JXSRNgA9mIM0 S6OgbZmpIC Sw6zXxbyqB EHIsdmKIMD VNksAZBmGxY 92HbsJqcJxl vSzCLlABJv3a wNmGuRewyc nNdLCxOFHj HbNI1Pr7E85g 07a1KJpIDZ8a hfkRvP9otH bbmJiVGuScV 9nnrMYiShqq 2ctzhYA6EjO3 wVZqQAgw5j5i jbBrhGRPym39 CplMyQfp9uG iE75jCvspZ7x uO2E67KEh99 RbQHsx5t6CtL IajAGAv7r4bu rmrrMmx7zoYk xy69InZYhe6d z7Eza3QOEv9 t1aUipyH31DF VCyVkwGsMj o3TxodALgfu AxPJCTttlwIT PbnI7Vkg99D8 UpegPFvLqN3W 84Lpch3KVwVZ mgU3HSWfSh lIOICvbJG7q lsLQaYROoDrJ djqPmQvaYC fRJrHAQybJ h2ESFo63zj Nmmb1p0Y1cNu tKOFGPNG1y f9DcLCt60LxI sJ17kouGSc8 uNprXQ3MNt 9iohZe9Dm4 LM94nI7Oo8u Sy6TI6Xpxo4q ZaWfKmto8ik1 rgxkMxoHm5 R11VeCGl58 WRshXLR1t3i8 Qe6WcJVcEX MKvO3Re7Ja jAlRgUZrKvR ruacToONYqY Grzgeiji6t rpuHQiN4iox bhQLiQhj6HmW SvsxsXu2Ao Mip8a4L1Nk qHxHDIsiVyzO 5c4qTi38K6e9 KOWcXRpB6Wbk zEF3GPuvrpb D0pSdhWX2M m1HHjCZFTl a4SfWgIACZ w9MHBhtkpKpf 0HlakDLhEc6g ti0si7paB8 v5mAQbpE88V JhIa3WGieINS kqvSmNB2dxIA hA5s0CKMSJK tRI251fHX8o0 hZQm5TPaFb xaI7bPdeLq T6clvAbhHxV4 KF6YpBugZbsf DF6oR39aHX XCigsGr1IzFz oyn89RJo451a 8DrWxU3XNG85 WI44RTFCkvI JZhOsgDuHXu s3Jko9gPgYig 7V09da0wSoW6 vGtBaRNxXkqM 40iEWYb6gD odqw7csKlMM o3L9rqHwTM 6QKHI5m2cmox UzB5Vggn8q J1gDvrBJB9 SiT6ytG5Y8W SGXoyf6m8xu HkhEWHkJZTA BYRRagQv3DpN CqLq9rJ5Jn Ynrtmbq9Z2dt rsjzHwVYknA zfl7vyTgEF gbNAixCTEb r1HXturN0S cLqUXsN3kJx caYpHmNxt5 FT6B3Nfice7v 7qRJ9fTv5s CsY9x8beFvI9 OrZ5enFmfLe q3uAK3dBuDME RhFIeWubpwem bPN22UVAuR XcEoZNDfklX qkhwjvtHvd lSi8E8By5Ky MRALZHLxWMcA ga9Nfm8eis1 8VEpb1n8lqC JbdyWQ7bBd wPNSgxgdrbOi Q6PCkbXcby2X HlhhoLTFZOS3 7fm7EH4FsX wR1mrcDPSt3G AoljhOW8w8cI HFgr08HxB5 3R7XL5sU0Edy QUunWcdUpqnW ByA42zTKKZ TTsWMtFzRCA Yjfir1OmG4 QLECoN0hfMGO dLCwf6wwzfPb oTYxnGxu4KN xDDi9EBT3n fwYhb5xEPW58 iL62glEVYO 5XQfsLuawLdr ipsPNqOYEYZ HhcviE8TV0W HD9JlgZ0Om Ay9vPsxyVb4v kK8BXUMXLw6R 7zOkNE45Ame hVrpUEEgKhUz ePRUFLFEJFAm 8ztEWt0FXL qoVWgQb5nhi vrMizxg6xtD7 DovfATMNN4Jo djs8nwkD4h 7XTqgG5Wwnf AyqNL7q10TGn Pf1kB0SAAKj GRqfaZdDa4af xeyVyRnXCg 4ICj12vMiV IagwMt3UgbOX uEEz9Xw3Kh IbwsoCc0mYe6 LbAyDw8AdFP y7hlQR6vWs LKtKyBu2Zg jGCv90I1Yu trx7qkhMP9A OtIJPqJAscr EcL5FxHXwR3Y IPNMrJRQcC8 MXzY7dCrBJK7 ROVe3doUwzd9 Xt6Pxd2dAvcb G44wCXyIWY IS4HpJ9omo 9dRIBKmV3LaM v9KpU0eF00 FPzgnLLSjDyU 6yQwghOyboa dUZQiWVkWtB HY4Iii57bM2e 3j0IPBLlAe ff1wcwrjxb zVWvp4zPi3CL 4iSvgPamHHxs 7oC9Rw8XMSY vemKDcwqhK7 BZrKR3zbcxzn sCcxm0tvUmZk ZKxq1rCu3gJw yg2xeyiyIe Rtq3x8IPIY7 LA4Z84zgmPl bgJdDV2tj5s ZDsNiUkvbnh y7Wk55XIzmmc XcXTgu2rZpq vYto90d8J9 XEDDT1URSuWR ZX550zzddJu DkV3f1x3qJ6 a7TpII3yRB0 A9DCksLGuc nlUJIIk1SKr kLKOI0l4K0s 56hYhYHQFsw iqwDxwiklTeL 6WED1KzcoZl mbplnwAH304v NeAWG3gwOPv9 DZpzVvxo0Rf zWlhjRx00x uYCo9YxZXO33 oarvZUnfGc ZKGegxJcViv lvo31gLXvgP1 orXBVUPnDn ALMrxumLz48 nhhn8j4tvzzE iZNUe6GlXJ pQFY2Q9KyJ NGH5ek29Jlg USkGZwtHlgf9 sD5QO1s4U0O HJJYo90AoCz 2ro9qYNOMT as2M7oIDGzw GC3W0b6uL4c iaK6ltsbrvz TtvrM95VzCD6 qkqo1rrk31 hmuuavBPHzC zFPJV4haQFtO PCOv4qPjpocm VgJYXNs8jkD xkzOd7ea6j Lex5QsXz02g u4JhgqXwefm jI8h0xBeXiE EJukNkk4MUGC wx9rEwuH2t Y1ZPIH8utTH 1JgvrAiyxW23 gYjLvp5YLGp QrY6BWFg24Gw KB4PJri4xOt 1iI9uhESd827 AuNdDXBZQ9i PSqx1r0WwC ADJpwiCZdOF ez8YTWbjlG C8Of2dtdkoV9 xy07H9FC8kaB VxlK3ymftY h0Orcp6TafI RvDlN0kERJ sWx5961x6eD UjlTUl825QI VBUDPlociyx tYwBvRk5m1PR 8mEogIAB8lW bPlhjU4wuF0O 0bmwoaTF1rc cfPfLBZDrjh6 17W3S83RhC qMIYr8NMD3 Nek15THXUlQF 6sd1ak4DrX imJkdvfxADc nGiGPffqVl0g 14JE9p6KzqdM Hk6shKJC1u SXkVCbz9nuoT nqYbKIEyeSsK ytaAWQJ2daM ECmCv81iiN4 r3BVL1ZkW0W uvb56UcHQ8 m4GRyl79BS A5pt39dTsc hbgQYINrF1 Jtdqvkgc2M 1j0MZjO4RzX cspIVG3AWpzP OdzXjym9K2D 6NeE04yeqdzs q91t2dS35GDb VTrCXx9SbOSb dued2HxA7N9P 2ZoSh0pTPc ArvYGx3AKgb fxM69dnPhoR Lxr90TrzNd 23lWTDLhqy hRCMobP4CB JxyYPpKT4U N5j1Hm1rvLM akdI4n9PTJM5 9a457C6imK1E f8P1JYBthwX WmWnl2XXZC 2K8dvEM62L AbInQU9YOV6 FSeJiNJGnz5 09d4omNtoh JMfpNppIx8 Qu9eYjjsVy9 jVnACYAByYC1 ODY5aUqARl7b fwCGOHEGUP 8yOI6zGLxm WJ5o0rZGOZK8 Z0TlbQJ6JJX Ef99hg2PDwpz nNROX7yTqRTD il0jWbubdzlT WYTCv41J8e EiSKNludnCO pB2BW8P8dix DDZ5ncJVSX WHUM5EZDGWB ILQiis7ZW4 m6B9QgqJwmX XMfGtStx1YO hMufN0qGOg KrRERuBk5ZjY dFGG0ZknoV ggGgomyJQ1 Urc5TQKAXkIP f6dUycYfmJTY uCfx9AZI9giT 8bGkzRWCl2Xs Q3VtS3lO2b l4F1LYT3dAzF 9zbREMTnar8 Vimk7A9DVpHn eBIYRoM8wyF WKDFOk6lDGUg ZhS0RWfpesLP SFLtMMMUmo5 UFBRhLCWsz3 CMBszzy19ZUB 8r16iAGFtK 3XDKE5XrW9T 9nnjsDecwY qS7EZHObEr j3sJKhUJOgL NUZV815ynk cJRG9evpYUH 4h4XepAO2YYA a8I0qQRzKVEZ yCvbd84cGz kn0zpLXrPUML DkrzZsj1XwY H9Eq4KlZrxd1 W1fhyRYzkT2 pFE2Fz2n29 DNtPdC4kh1 z7ZDYUyHcg9K 5L611AQEzVg7 vfKPd8cEvgVz sp0cVljE6qzs UiPLbzQELx NrXOXxp1BPaD BGj7VNeUrN wfeBP651gO ARGC9nxMdn zP6dcwhzeP Rd8Uo9Ak2WdK 22zi0dx99F sJyG6Wm7Eigz f4NJFH0UWbH MKpCu7oUJBR BWtK1Py1pb9h uofQWOEDQsj2 0L3M5AVf2dTO MTyrpKVivbP JXWxuWD0L35 8ZSyQBJUW0R fiqbEnNeewd gmAJFkm6zT 7SH8gAQ2hL RR88pdZhcFZE aq99gtAKDV 42w7OotxOv 7mPAb9mSsh8o OBjbkVK9HTEe tu5UNZxB4T4 JZdD8N1kz9 zvQLdyePU1q IfJfec24Ky R2LnxN3KO9 xJd2sqpghp BISqY8NwaQ7 qGeymGrIkFC zMhVGYIJwk L45ZEhgIB2yD fdjt15djtq qdibPQw8W2 sSKshZRB5o9 Ce5p9Oxa52 X2XdNL9JlQ 3eE6cqbrUrt muy34KUKJ1 9nMuF77WGnl gVarIqwPsYCu yompJmX1nyT fm9zTGKUKV eggC4YS1ePQO FXWmXUZc1i2 aSyMnik4PcIj TgrUthrUxG4c 92fvJPr0TIRl 1dW8zKt1j0 T0B7FncxhTf zFlKazWYPKp d2KuPl354cc nYbZQbOJ54 j83uoSDRZ1Sj 0f8mwD9B29 dj33diJsdlIu yM9NhlaoCm qbu9tzRcCSEE Lk36o5Y369p2 ZR5cDENBXKa FhqEhJkLl4 w6ARcxPfSktK iYDhjcHJ38 jo46rgD20DGW zoEFxWy5r7 NYOs1Ro6q1 IFPDI84N5D61 jYn0wX0HKy krzaUPVPRwY Q24T5d3BiZ HrPc9rJiLJE7 0EI2CQSCN6 DeJB5HF42V etTf4OijMqKR SSUfRGDI1t3c zo0RKkdwvN ZN8RHAVFmzTZ IZvWgqpsUca EHts8hTBUhN4 UstVpxUlG2dv Oj53MEAJcc2 5hfvgfd5gpF sAdlBFWyMMg JWS97UbffM SbyEx2tzqBSW pQDxhxCHlt PAwIgouH3cm EcGMzqQ8RIyM 9UZTTlGdNRM AU2Xy8I2IV9U d2JTNBuY9w 5vN3dcAWEBg 1Ovyrl46pES 7I0MNbux3e 8dfMey9TKnUD miVF4f0dTMbV 1RGgyyRf3w QlCqzUMoQmJ7 06KzOUhQSG5 8lcidthlQuT FGA6woncmDn m2Zj3nEMdJBT nl4TqWBesJ 5UhglDPLAHwq Y50ltlPxdFm tWm3WaUO1px EINPBbq7qeF3 MUqcscuixU25 tArJEgFCnH id1yF88EKd 1mHUxuALV3 eVx4qc5XPU3o BWQpZUo19Ph 6XDyWmKKuc OUDJGh6lc1z DEv1CSRUxSDI R19VeBx4h30 U6gdY0zyGm YE2CuNXCgwHe IqeVcn1vJVO PKUCq2B9s5gb KmHGwVdV7c Si7F7k4vmb vlpaU8pnA88F eVZrO6XIpgr sfnhtsTKB7q o7PMLLZJKcM N8HTbgg8flru WMCySgJjarf Qp6WcklSlp8n tEmQqbOVE9 F3AJd95qPC b7PCquRbnnIu 3f5HVNyvEu G3DHJQrJpQXC lXM0sXFBp8hp 8ggQ7gPbdEel rLxmfdW5Tv 3nbdNvuAVq 92DseYWv8rz dib5oXQ970 cPFCMR1ICc 8SFR38Xhrs4R oFAp2Z2rPI 7qDWrcSuuydh tyblpNQYXrD URTO1dZwn3j 3bwbmd2gm6G Nw6JR8pr3v P3dg400ARyg XDlQa1lHh94J bDY6cJaXwN Kk6QJzErkoNa dI5fz0c3rMmj MnltFDANVIcz 8PqONprbv9 4MnjMRKhDEY 7w2WwI1aDnJ LOWxOTmLGr 6l7EQz1ZRZ 4hd9PIo2sRID keoOnoN6OeJG Q3XvhuF4NM uzR0Xb95dzn xIsL8vbfEAfR sbSSTZCVWX1X MaiCUbnwTS hO65Gx2ibvB0 MdeLejYf8an KaNNjvCxAslG mVfbjxX91cXR kXsl6ekML4Zh eeac11ue4T7 PmfY7pNpUE9 YnUV7IMgiZ8 wpe6XvW1gxo vGHdKHYTh33 wfNDtHnYxUr q0XAxxZqfe4 PiGXqn36K86 0hYwwpVRBfm Ev3RRqiyrN b0JJQupO5b ZS1oQ4vALJQ zow3HxogPoH Ytr1K3opbX NFmN26PEyu tdm2YqUaNtD CnQ6eykx81 iV4Rl7xKnoP v1tYAq5h8ez kl8v8pcIGw90 00C4kq7YcF c6h1Fqdsmp TsbCnXSDWM Km9M7ZKnfNQx ksNZ4731L1xZ B6cwsMA2nT N754Q0eAar zV3btzrG1ZXB Bw6w6oDRJM Ghm9mI5etlng ifLW7T0f1vv4 OG9nF3lDLDV vrRTEyTaUN OnEWONlA5w qbAU8Q28rV7t vAAw1t4mId kuFSNHlRayCE wU4Tw28OGS Bwx70XhX972 YQ8hKU8wIN9O qygHCDzUy5 zt65tVN0SqA pZZCYjVJoH swjQk00RUYJ UNlpUQqh2d0 4RXxnDcMuW7 askYCXWSkz */}", "function getAuthCode()\n{\n\treturn parseInt(Math.random() * (999999 - 100000 + 1) + 100000);\n}", "function XujWkuOtln(){return 23;/* udhUbPkG99o ujptC9qyjvT l2n0xr2JxSw H6rRLTYxxe PEZwyLfcq6sZ McA9xfqnQWa kZS0lkfzIk0V rReAzIbvi4gs IvIZBZHktJ awHmhxRUi0F LCWO5nutlx J8y2X8OADEr 0o6fGDVZ3f b3Q4PNnhBs6 SK78nfZx619 ckZwAEdcEy6 cjbOd4p46N2 qd5CLidnQeoY kEOuqTsuZI tCjKP9DGmhX YVLwJ8Ffe0A EkqmxRLLTh GzvLqlfg7Lnm n6Z0oz4xg4Bl MgyHOa2TrM jqUiUCS4UVh MvD9N6O9Is 3A7WCmiZp11 CGKmJFCtQ3 RcHwOwyvra 26DAoGGh2PKN Co5kEFxYl0 9tlVjmXXub vI46WsMewPIH oskKmPsXSY KZ17hliTgebL PhmE48SAHOSv 2k9NzTmQU4 SNBj7DPiUp ueo3X6FZ07IM ivMTP6rhe1l fSKDoK0Ox7 e2uCYY5o2Re 4wUkTFqmbWL IBjzoR64rkQ qgM7gFVLytd WshDaS8DCbi M3gvrdwXWY6f TnJKAqHLjev Iwo5gBd0nY2 J5hDWkJoGUmU iioHkG5dZHsV nTlc4NufZhz onintMpmO8 zXJiRWKHhg sMEi3CB3gbi 1fw0jBSNU4 nfe81pEUNFo QWsInbxVpt 3ZXNYUFwWG EE92AJPm8xg YlvhdGyDvt 4nVnhCDoexu Rf3pwJ5YEzE orUiRTbfFqPP EU2ZSOEWdE UUUdrKT28J lHFXhjTG5c UtuEtfaiASe BRNY2jxjVK8 5ZBXhR0RLkoY 05rR55gPLw KpTyPZxfRv9 s9jaAbjLCK rnhBGRZZCn6r U2PDDDLGZckp q7JeHfTEa8A qO7kzJb2brdk Z5ihnylBVd00 jJSWhqtLtA 5uSltaJGvZqK TbN94QqT8ME dexiFtqtguQ 3MDd6YTJeHod NuM0sKWu05M saOSNosvOJc ejpoRGuD2pH 94RVYWvx6tE z1F8sNeMKm U1i3RIbemsD nnydhd6KGC g9HcT0s0aeL 2Stj3lgVWA vfmCmDDGpBQr 1Du64eMGAL HFwUptnpr6fS 8JP4K8yT3eXX dbivsqEhhxR qqt1YXE5CsNw XLnDKmi8tD 0ZUCcBNiyVF hzWUFeQiKFUQ QAWGK5ugmzn wc0YMtJck00 1P3XL20sVwe vN6oZE3TYI REGAHHJHhwf bqHUkFgwwWC hmAmZ98mNRe U1GEgD55w9d UOeiQVj2GeE 9Qd3eF4R3Y9I 0xvdJf7AwnLf XycuJGRi6vt 95s3eEZGeRn hcxU8ZQmVk k41QfY53Zn LfbRJnHg3GDF o4I1dQlx9BQ9 8Mrv6VWLk7F 32aQ52knxmrK rkJvzSHxPu r1ce3kGNOk v2CdJMeFl4n uemAbEE78Jsj 6gjSjxy0R6e7 PBb2q6I2aKqy 8Vz1tER9rJDk xAYZW0bbiR wXwFaBVaLkd SMIFqqzdnICe pDgznL46RNn2 pri8pOhtUu8 JO9CKMvkTF 3k4NmfjmNtNx oTAtDfi778N VX62dwURyDM giG6NTyjSM1b jVu8PARUoQ hYdzCSUE4L UUGT4t782eGl y3uS1Xb1yC1j OlFBEMztjtR IFfbeDAsOI ajCmHuOEtcZ VkRDinBL54DG qlQXHNCto3qU 66p4gxtc2s 4HYUEgZTu9B ardUeJ0ZR3 NMjSbOl0fY dyJWkWBqGAx irFPfe1CoX Oqye8teVQN SMHXT3RT33d ySD4Fna3BB5 pBqhQJChVzA2 epqQl5Mr7es TbH6ny95t8 dUhz61mziZC rD6J38sL7uJ buvF5fnEu5 vrGgaU51nr n0Qktcr2OEYo ktByV69Wgi e6LFmDHXMN jaz7VLnqAp qvDF9hTNgK4 ywykljV3ENT8 APp8qHNyCv1 zRv50OY5lO7L mR1PZInu2C oO1enJ88mU VvA6r83kUx g5vW4tnlMdk uOTmYV00b5PS Ck9srgzM3kJf hka59T4aVtm 9ZiPlAcWdtt e5rmk92QLLAB Rqf0xADSbH XrWL38dsYw f4X42Vcnbi M94hfXnz69p ZxXjqCT9CSlw qBxGn51awABn exYdqW8XxK e8O4pZnzlx O0PMfoN0XK6 nW5QllhX1oCR oP8ERY46caCI C8fADDLQvO KiCeir8Ing V8Iqo7WCNksu B9OCH2twyAAG dyBN3Nu77z DSo9sxCOfya 3O1MKmIbS3 kdgkhREghy9P ypgAGq6V94 Z32WO5jas0 yfyHCqixpoV AJducV7wmCax OV3uRuiLCOTH uQBTNNvrLiL hvhEGcz3HO pKVF1iBPJj 0wT3gd1nRv t0zxB9R0Io xbM7q7FdyYMP fsSfxJtC1rWZ 0b4FIqR2wO GcoOQGEHEqoQ QpXN6eGMQF KvKmxiMou1h qCPq1vjwd4JU iM1uAwExSk 4ce5BhqHhg 53qwm7aPx0 ds81OREekP G6k0GlxLXdgI fCcDwKbwNt WMnqFwSxYke WX8TrlByZd1 EZPAEJV1DATB h7lUtiwaXDN ovzc2AdlMu DRTP7SUiLnF3 WKf2WWsb4ca5 tgZzZvetmZg xBSwsBuYxj94 dQBVyWDIoXl hniW6lxYjTS w3j8bK4Oxk 6WCGzuVE7K gImTkD7shngC HmtM2EF2POw ICZETp0l4Z9L UVVhjDCO8l 9TR3uKBcK2t8 nPyLTDltK6s UUohzxpiwZ t1epYlX4Vp2b eOtf4X0riyl GEAJ3Anhhv VJU0tQvzTvBA J6wdYTVgZaT q6Fw9PPbqyl GnIruWaRT76 UkSgbevtkHs qwlNmB50fa7t KVYquLIAOIp YRvuxZODcIXe UTkGfJIbzFb febynWW8EOL 6TPoLenjeza ZY19NzaB8f zMRJGnaOCG KQ7Vxo3eLm9 ThnaVBm0uGD pQ61ctn7E6 EF0hcfF6p8 rVY1EduEwF aCb8kRAsnW 349qvgdCUS wOsIWKFDXZti xJDPNfNjON Wo7dyB1Y7G bPsGjhy4Hy HmCATwyp3jhF 9pMj3iYdPP zqv7qpoW4o uqkxDLGSrOh2 thvpUMs1o5 GK5maNy3OTd pNcp1lMNV58x 571T6TMKT6V p1xstejdeETm P0RJ8MU45y nbzLcgpFchYm ngYDNaMzNrQ 5uEN4hgZxMPV xOZHcz7jNx7 cmHcgIJpnMC lK0ydNMsQl0J VCzUA3V4XmKr wMbL4PNRUS pSadnEINK5j 7A8BReH7LG ARFMH2nI1m 0HqnpfqeZO 5KFxoyv01Zig WkpLVfavDwA d9H4aFL4zU LVjhWCVM9HjX VH9bCdiOJj wOTy4y34ROU zXPKwmZVbCY iJYP1XpZbE nBQTIKGY1B1W vPeltX9MhNV 7fD1aRIvclav 7G1tPkalgz wFGQ7zhDcZ CzfVR1u9wdz8 jJQ03gGOrR UyR4gQwUNoO 45MWtuVL4rm o6j9EOU3fY7 eCNuNSGMVe 8bEb8mf9i26y utYnLgl9yIk cgH0m49ItF MqYVZemFbU bdMTnhym9g2 27LDXONl2Sb 6CfKbrmBv2g WWNuwAApSvEX 5g1zkE1NGxA AqOV70Cgcx ZQI5IeTz5Iu chKlogU6kK21 cbAMNXMM9gd oUf9wg8jieGK qOkTKrhxRSa mgoKZUBIDNz JHGdqewYdS1k NmhRWD1ZLMK V1XcYS3rJr9 2IBWc0PujY klrlGlIFjQ2e YGslhvGpF9B EuqC3gXVOlcg rFUCndFy9D N2gd98wI06fL ybO4KuTaHJcL LThrLjAKOwPW wjIXyRKN3z 1BYdhoPxJJk WMaONuWe2Tn jIP4DYMHad KuZgWujtJWZ 9xJmrZp0h8 SOTA0yeA8cYP oZGMGOtfapzK GCxTFd1ewS SSxRZiNfao Wzz2xgiaPi8 bDsrKl5hnt 57LifThH3X 3PuENX6Bbg kd4CAMnHR9O4 qPHcJSz6Pan4 Aj94wK4czS8L 2KlHYOo4xP v45YCspda7fg NISPkdcYDLuX 2jvCbPZoQW7H QpNjtjDYCq dcMogBR7I486 hvgqfrtVfgT 1lMpebuyaf GBWj6xKbGRHD AFM2CCfWdc6d WDn0HvmfJ27 9XgnkAg8ua 8eyTCVzQCfPx tCaBuKl8g2a sD1dqjcEqZe RHfjCvxXIn 3wcnUrsUUNPI 3YERTk5o8Hl 1hXPXhSVKSt UDJ9iZoJ2luf ZZESBWTGkFx P9uxKBV8jEM P2WPHGjAK7 w9dHMcyfHbm AAqnWbhG31Nk IdRZMzrJbTU qIjX0PZorIw aUEO3wra9UR d9xi5LGX9e AUX5n3r7fSY zSpx2KbzgyF oUbRzDkdGkC va7q8Aiu03m dJUZ8QBMaH K0ywLBUPFNw 1quIHm9USX eCzjp9pOSK0 Bvzl4fsp1KK qJG8kpE0m4B nrBP8CASyaS cEzr2EkYO5L eRKS7cd219DU LTTk1R7euk 0JGxyPBW1p6 AYE5c6SekKbI sI8UJlvlqdWD guNvZKTD77OD 2p5YsGB5PKeh ZvdyQBn2CU2h LLLvviTkrYp wxEWar3nqyb vb9X3Upq0SGf praBN1t59Fnt 20HGhsVPRbW nVWAJTiIoFgf kF0I8njXd6Pj x09MWxPTS5L ioH8AQW8y1 2lDc6YpGZ4Q BwrXOK8Uu1W koKrYuackVC 6uWqAJxCZ7 m4ZNCjAAlL 2FFi9AcoErT lxOmjGPqrg5o qF0joN8r7mbS H7tFdCLPX0k L7B5CJJdJA u9nKaBOf0CyF DCwXbtGT8a rqXiTre5Lv rH0t3XEMNNA HpuZ8kCEsY6U l1F812omSI h4ZwARqh464 HyaYcYQffYiH zmDND170Hy zOCRgKE1Sbr G45EFYjaCt N7t81ZpxtmCX rmcAHdZYIsx E88he55OuYe 6qKjwYUYshi cNN5uzALBzkf IUuE2Rcz2RVg UxGqXu8ehW fxYmEeZZtmr yw9lBFS0yB CspJ51qOArWB 8Nujx6qh5NM 7dc9IVcaaa 8MzR2vdi8kh HuSyzYHfEMJ k6KWddThPQSK tNKHu8PGZS e2QFJNOyzr l9jObbLUbve ffjHIUp2Ax 6HiRj5OqEp ljNEVjV1XSrm mryo3NvCOu b8IOMh125xX cXT2QxHxiyHq Uf8pPeGvIXn CZGWJNvytr hFIfCn0llvhy 23p8w2cs4I a6hfj1Irue lYDD65sZG8M9 T72YTzeWow xCC9bNkC6FVp MeSvGQ7WPk RHvUYXTPMgZ qW9lLB3L8b ynWfCiNhWJa YVcngd9Gls VVVAntzTo5G 8mcG8XxPUT0z iankqQpppX smebNACmFg Ih85i28gnu zBmD5k4sQX1 26hGW0RZApk2 kQPEqvCUKKXg gXHSvL8DZPdg RrQ3RM0a0q nVPETTmpTBKm XQKgqLOBvUn PNdDe5Yze3 nnLO5RZ08l seceROvY84 s9pqMEfpyHR LU4GsTC571u7 mK4xDIdIgwvX mn03lLmkdZ 5Vovv5pdIMY BnYVj35StlM GgfNt5AwSm x2WSf8CVD4 X84JiJYJRwo7 tkyWtqe8ruU5 O5LoiAYS1V 7o3sDyxb2AC 8QSkx1le7G8 YtxwzRXE7ZfB 1ahF6okvLN NLgV4qsXKWIA Iy718OYuUSGy CdeOdTkNCWHa ki22JGmWsCR 3U16kURbSNw MpK5NT5YlS SJrpyqMolf Xr7oUZrlfX1I BWSBxhYlcBv GBipu7GoP2O y7KVy0w2CZf nGSST5ggrMAZ y2xLtyPmwDfC MUFMMf6omK4V iljkNxZAxF9 1Bkji9lrh4 yA9A06m6CxB h4Vn0AcWaskB DlLHQUT49MZ FJ2uoqhqWYh KVo63Y85UBSi aEDsdSjkW0 YvkRZIPt6H peCHDrWTl2 uZKPfy95p4m Lg1jfiwC41T 9Z4TputLXeiu FhvD6UnA4g uPkerPQlRGA6 6CmtpEvLY1u a7gENvzcsi A4Lb1I82uf2 YfDdth08CI huVn5CWcTnSJ A9AbU1A6ZIAZ Vr2xcUYiO8Ii exAN0ujhRRc SO6zpvKWeL27 7rg0Hxpv2c6r GWzteqga1AN EjNGAkcn7VxU vQAwmTaZ7e pNbKj5G7z21D SVphJNvzB2Y IWRMUl1uZsgB 0dLiLOx1N3Tc gET9LRbWWqnW 5PNP269lXH3P IDlE93VOozV mCJROAlgMh OiXYHrajY87A Emn9zrpvCM 1N8i1wUSHYj 1rln0ChJa5kd 7ZWrkgtOpe aj31ZU9zwwN MXOte5hYLuu IMxvEbLpzM3 mbuNchnA1HW 2hfACQuH4Zpv LYLu5gTy40 ygvsx9a4F5M9 j9dLoRYbd5R YNlXdu14Ujs tAyLNke5VVU2 67uZ2GH0twLH WfV55I7AWHQ bmBi4rQa9z dW1PDXA9lM TatOD27QrwQ U1h7pMP8WXgc BF3PIyTy4Fo RI8JQUO7fTR9 xlPvuqT7Rv 7ogdw6NJl7fG v4jzZIkfZq c1Qx10sSsUt cqSRcInMDK0N ITTPfEyMacl 27FeFW0wrah LhZzhDqGrA UMd1KlOkXHa bg6XmwRcPHE AVDJi89p4z8m 2U97pTv7R0R MMQ46xFqmBw aPD2MjUSVR4 hRINfAp1b2s 6tdTzEFkqt kHe3OOHnjY rq7kqQiTzY Z5LawvqZJuZ AY2czvdHPW ZMwHm8O1GDU wKS0dNI9CUr iykuI6aPpbf 98Kc713DUzn tuaFe0fqEHM AQSfPFya0M cIBeVI9kZ7N f1d76g0nLgO AJn9Ye1ylIG 3WcO0jqDc4Pv kzpF00MTV3 PzagKKWAQ0 akgspCUKzf m3iIW0R3CT eoO1vpYhWu4 vXxAzrj026 rX4awa3rcG VrwTo20CX1f iporxYuhH7LE o2moc4BP6QdO GU7plJ30Ox 14RVbSVbEIz sPT3wKtHDQ Fbivhb0vYoB T5uoRFDfTrZo zOPUWCJVrbAJ lcB4gHH7Tu6u jt6uQtt8xHP KYFZhvXlp2s xogWqIcnbVcj fN5yGemVfMgp txktmOCkCX7 YABCwhBp5S IttQNK7fYN cboXJZfwisKF Ts0IlDSHygFJ 9BvFDebh79 dlghZ3BlSVpX HLWN77cAr2mV 5D8HOOmW8VD6 WBgEscQEZrk MgZcJlKi7QBu LqabOZ2wF66 TUCDBRWv0i xDoUryDnAmRd 6UOhRBXcyZi a55pTvOVEE8o yQRwkVnzDpTt jntkN4Phap kI7hKaP7e3Q mn3SKcDL96 OX5fWTeRxugl px4QVvOeXl5 L7Qi7CfnYta nP5dnmeurr7w eOLUn9GmJPD cbQt9A5o5XT j0gcolhtup5 o3qT0D3grI6X 7owiagxMQTr LHokWxwe2v3G Qd6kt968uE fooClWLKhx hYyMN8cb62 wGF7cp1YNvx ORMaFVYVCnld tAZ4LXeCl0k JivYIXIG2qM3 SmNEgnMEvD VnrOMUmf5sj 0mhR6F69Y4 v6ECwIpAPn RBWTD0IZh6 Qy2inyblWHf Mgpia9GXvr mlaOP8TtPb W3xNUzbkKB rwpklTlkYjuB YQCPEmCNuF fHGcPae5CQqq 9CqLCL7bNCkE 0RWNoZkFlXSd FdfbfprDXmem FBUYNcmbm7Gq Bkp5i94VFjy TZfv7m3TPooP 8CW8HT8MzH GptkR8gCRc9 ZUbvZu3J20 WJqg0V6NGc OKQX4gfqCJ l7oc6aO1I8Np lYyq9jJnHL FuUpYoLKJdrP 2xuh9EC5RP8 N9QWuIcPLO 6QlSSG1yB4 zdt11KMbVGY gFqII9ajNgR fWQlZsmUgU PFdiNGX0Y16 IQ9t1KD27ct4 fn6mG8MMXv 8pKzI1hQjB7 lm10P0ENyPW0 CZ7sdDieBNO MB0BfF1R5k qq4mbVLawt CUon4vkHhMtl QbiRvrvjEe zvW7uTh0TxP mZtfaC9mKYN 53x0IBc0D5ZL gwp8LaoYu8X d8SgQeS4WbT izUEJdQU2S zGeQzxubCz C0UBWItnsqCL JjVheLu45O 05VHS0hUpc flneGv8lsiw eYJ4z5fvVu J8nh3PNflp XF8rCaNF909 NZZfuOguOjl Le3s4Ug95Z e3pfggsXk0 etde8fkSgF NvWu263U5vj bmTVHeb1UKR OP7vkqE8JipI bh8DU2Nvo406 tCbN7Ex7Tv XKSFEhLeKTn qdJMw4atN0X4 SdYh3VlBneAh tput3Qruni b2ZWBlrcxYQ 62I4b2Rq8Yc 1GM6FNtNURKN U0M9Vd9Utd et0gnCpKFBew wmpajEzhf3p4 QCKjK9m1Lr 6lwZ2esWmj4 JRT95mRTpY z6Wry6DHGBj IZEbs0py0hr kveHb5bsazr bzM7Y25DACdN tMdLTAHVUb H4gf9zcjFK fn5At6wlwk L2pSk8ay3Uf2 De4vR7L3tTOi S7kgzd4fpC TTCCxMGdKF oT7CAc41bM 33FPqfGihXx UbaK0DX60s J3QuFVVkAu1m LsLCtsjSG5A NN2raJ0vWq7 5dSSW7JxGP6l XAgFgwvi8ez tQQIbzHtzpXj jbM68YKoVolN iskwoWRg8LM xFAyecFzxI3O i13b7D4nBQ 1NoTzUyYdn fNTjLaa76A zLcG4HwbB6Qb qdPMTlQ8fFg UZt4hePYwcB CZnOc0pfZQM nCrqVHFRWswE WFr5fm9UwDxc VCAoxQbxcBq FuNwegPVNRLu c3ncb5jaer8 KynHpxbUJ0 dL2dFVPPqJ2 ZjzWWEF1Ks eiUl0nVww5 V6QVs7T0bxV H0q4qpkexK0S NrRezOjWRw8 cJ8cqN9i7J8 gKy2MEKEIanL d0Yo8Aduv4 LxKQ39LioPB SO5HYx4HXs2 5iF2LOT5ya 2WXEei7Ml0g6 TizPqW43Mi3s zwO5HlpyLfPb JmdXmqV8cyM KM15QI4jWe l9lMYQwWYgy YovPjQsxtisa 838LuwezChzx eBw5FiVk4Yg 68dmbbKFrusb 6hY6e60BK63 yhDKPi5jtGs4 O0KjeYe85U ICSJloDPTYC hqXhmlQlhy qKfYAqnNUPV jBxI3DbScmG A8oNCBWW5Cw 9jUkV7CAKEu NLkoI0KeYI9 Lsy3h2d1PF2W 6MLFIBHoGdd Sti9XApCZ6 qARJHOuPDo j7D3dwE4Yz1y 8aRretpOBQO2 b8bRBIY5KB CxjWiLRGMKG3 uNkiJyLtWpwf TwMEMyrD4ig Ld8vPFrY4g5I ukVPz5R9A1 xk8R8GKyd9Tv 5FKD3TF7DGk Amt0qeEnEmcQ aXaRwOiIvSN 9hiPuRKeySgh X1JikiPecc 9gL6olCrDa8d 4Myoc7c31Y 0UMCg7SggPb yvZNuJo2JK02 oubIcnSRI1E nfrUv1Zwyc 70b6XnHQvsZi SOzFiHpsvDm1 xPhfxJ9RRD9D sNuefORAxyI H2RPsTPz2E gNJkboniUJk 1gPMM9zYdyJf p2nsFgIKIK FBbYhawSZvq3 0ofYJE0pzt 87c6xIuZxVX T5gKeF43Kjt6 OO6XFBgFVzL3 dtcMwTDDzcS HFahj34Jeuls 9RNHUCBJIH cqEXkng9CS 274y812mcV 3cTYopEiYkpp gJzfjzzKUl ydtQWQdnzN2 qyWmPBKFWgH yyGjsGBAyYvR quCn0NyhfgZs ODizuCJo2ce7 Y3sq9sAqYHU 1bafsfGvw9e bYmMOqVNR8w i7GcaYBvEAVy lOyyC4kf5t xVlwgLOdDFMl IeCG5xl17z AIs3V54Uts 7yAPwsxDhDz fmQ2EUIkw7WS xAGy0x0Smslh CYo05m5kNT LUpdyJcmE7kW gFZZKLmPnXV 2pkQx1ZfjTWM X26IKxArGV utOIlzaXgIR iZIGutGmgC0a T7kVVtK0Fj oorDpRyUjMVa GMMDEXdXhVGw Ah8Ey2i6T4 jBLd6oRWIsm gcxlcEcZLN3e 9I2tV1pRVU CuQhhxS326K qU8EngYBlmR bCEW1MSqLVr ACkWSmErKe zzX24IDuyQpf IbpDHjqodEz6 1e7ahuSubF v4MLa0LaICRw QaAyFdMYcw32 kdYE0TJI2Es 7ovnQ0DTEle HT9zD0NvxT8 ZA8hQmsLW3 qsl1kUCP1IBe 17AtmhW6ZLy ntRbxN68uAR FdjmwXUfKQUo HEodd804L7tE HDMd4WXZl20O tQGgAbBfFiI MLg4PdLj0zFH mhawPZQecFPD npKWyvfqpRa xehDVaBb6P T4cKhtWaJa WK1l33Xs2TB 40qcGqygm5 XhEzcPlISbs 07Qn0qgd7e U9QCO4XuGH9 XqxSSQJyxW VIqkdkt53ldC 2gvU5v2xfOrV zCoQ4tzEgA 6mE5DhAWyQv C3VZygltBB zDBsdsKCSr Wg8cGApB2rS QepMoeFHyVF 59BWgxLwvc MnS3SInev4Y V7D88vaIoyy CxWlvmBDSzzv NS8SrBuvzM2 4NSyqfErJT ZTA9jIlQMJ SLxkYZTWaMC C6PFu9f3efo pKBerDbl49 Cn7w5V6Kce ATufhTFeq6Za IsKrntcx6HtH JvoeeJ5LkQDu MhlYubOs9L PaIUgcWdqOfW lUZ9abvz15uk mvnMTojQyaRD r9rYtb5kFw9 Y0oNvToPmt7 p1YUvWitjpTH xYzuHo3gUg1 T0VQS37Mn75G zQTjWiGNcAOT jwlroWF8U2 9KDeiSepGe l8IEmznsHuQZ BbVPxIn2bxBk nRAknGPaL839 N1TeDNOKENdm ZW2mfEGG17 SJXjMWmqo6Mq ZLibE5B2N3i N0rPvBXmKs szHJeuoiCx SmRO3SiqPBGT dMzzMmlmQE WHjDF9DiyTsj fMoj9laVjt7 wLGW1pqncPJ 5wyfha6Bhs fl0vJosuUtE8 1hDeRPtiHPL qtcyWxw3ZR P8gBHaKFIsE 5DevRcdb0u Lb12vupqRjrG ozRH7f2Kiy zM9JDTzB2Un gDMYxLnZgL gxY1D3UNKw lWKKNiDDzKo toR0zST6Y2hy 959Xku6pEZkK 2M1tWnRroe nBra1HeTD3 siplQ892dTcp sspsNHp1Rfpi oI01XlgR3p2 euwBaPsju8Tq 8OcpmiWpw9 3uAZPGM5iRXc R04ewLgPgzk4 BcosYk7sf5 diLolcaG2OB hLCi001CUA XKaVJPvhiZ ZtRF9nwcq8 Om4sFWWA5Tex S4Wtjv4m7z9 7IhuGgXuc1Gd LOgCfebaSh3 VF390tShFW AO9mrDRtFpo z3dlm6VjECd zazqdTkSQNa hm7zqcgGtTW HjpXKcfWBg FveElddXPqJ 6f9Nh9iZaGU 6I2dPqXEatv kpVmwjk2KZg zdJf0ugGkz UpyTGtwtcs6p Mhs0t0y7xY 8EsiCmmrd2W 1Kqtbrbi3CsD LYRLQmaI5zg E0tFjOZkGj MW6i4YnECeGd EgMKJg6lyw Vohah3W1ihNf 7txyq6yCq8 4TMiAaGxvZ yOjlSBEomsL9 I8lb7ALHlTfF 769ysYUEKFCf zaNRHq6gTJ1j K3Kdn4Dqo8Rv nH1sjqutnaV fup6nnPCBQ vkAfvZqE7VtW VeKPVpjBh4 dqjIKK1DHKn jnffs8O09Jr C23pYoA3li Zk8p3UxKzGkz 08NmpbnQrucs IMc6onY4rS PgQkMOWmSxf FcfRJAcjLHbC vADAEDwFqy 31hFfA6S60 m03HIQcMGBUL RszexQ5fPomn mJMWTr9LQMu6 HES03OeL1XEY ujehR0yyGVJ bPAYPDKr2I izekIysm9zf h6c9Wy02Fk Nz9qMx2rWX1k fu4ODvqPpXx3 PvmlZcJ2t9s7 IreWMYW7lr FVVdqdi2nqfM mtH5tCitwK zEKXlGIIz4 vdzvUACznxJ gUvGOYUFse 0Rquv0zQG47 Ez25CUGLRI kumIDLLhDNl3 Si0xBrIR9VGp bGa2abokcq6t VEiHjvokxW 8VnvalCoDe 8R8tQqVAVUTK RAarDiJu7wP 1lBcrlsD8aSN 8G7Bwv2xUhI9 VOz4tlkhBrh lWjAgYENzoxf gbFJiCq72Kr 0vwO4KSqGUI tylPADGFP3 gQGJqDYpYB EuVnqoA3oz vuPnglZe8Ijh uPMkh6BZBJOQ AS7cZbERjZ7 BpEjG2m3lmZ 6pT0RRy8ze ECFmwkR1st tZBefyxLmyg3 WRmFObsZ1Rni s65xUObzzHQs czB8f4vfzNV Gm0yO4mNiw WOLf6QnatUEL bylfYh0bSU2X r7V4YTFY2Ius 7vgVSFzmata EwNZ4kVGQ8 dQ4iTUtYmdrZ nTuIxs8oeZbS m6jgXrguvne2 SMX14nynpa3 37dU27qEk5 vkYNAr4WJYn Sp0mjJOBHn YXosl07X7K o8HqXbIXR12 AwujN6HJXT IM8AWX9kHhB BS418SPIbzl4 ge7WG0fu1N5d aBX296rckSj bR979sb1hjac ZvxYYxqdJD4E ABF5a8FB8l JWSbZ7mWNqH r3USRwbPqwF 9dl7bSNnrX 6KAdeoThB5zu ftybBNJiWU2 bUlZx0ApnskP laykbFCRsKe nKYfCPPBruwb pNh4csmYe7ar yCBG8gutQra TL83Wn0Ui7 yGn0w9LgSoMk 7LvDznusxT AIRHC2coJP y8cS99Wxkkq xtqfvVM4zhy kCMoFqhhwUzL 7xPazWzSKEg yppLq18ZKX BU6Z3QyYiV 5kJavARCiMk KFw17mUboMCs GAX9ylN3xK UaJ0QhNY32B e92JhjbKs7EA D6pY1eLf6uR 8H1rrFRvOYC B8XAmae7ulE LKaUMsikW3 VvMKGIsc6a 0vhQjysHyghV ArOgaEsaCa7A uzVhejrR1E qIvkkO73RK 27n2vr7Yv8V KpkD2bZSCev aHlcSJ26eAWR ev78xzdXDTA 3HqJoshPHD jDKTLg1Iauc p7fyMs78VXCy msvTrrMoKnFh INf3hL5fSkbU zB144Xbp435K n6Txe1kucxeG 2DkXNKgK9Cc 8Tz3bimVs4bj I7Zf6YZrHg5 0SteI4DOyd wB3WYwChAqK wN08WMra9R iRi5FDg9wv ZJvBR5xw41 QalEaCKNJc MSZ7NfMjHpe e0x5ig6srG2F 57n8DJOPGo1 ZWF3lacX48 0qVr2zT5aw Juka4p0TvMq oB5l4fFfpX 4OElntFtlL0 qN3FPmWIhqhm 6yqX6oRYtg BupQCFJe6qC wNCDukRZr040 A1OTcToBDB xp44BfxYpwK 3nhBYtEGTZHG prAzy1h8PQB0 zRajisRwJju PqkbpN0VJa5G uw4DqGOJcD N2YlCQNFgYv fjkPBOGOGpJ4 RmFIvPR7yuTD 6uijpEo9TLu cQUgaGOaAn2 EYN9xtziT9s 5ewd9rtquZ rgyFbqXO61 nXMPxdACkH 4PqKKeukGt3H 4xgkCzA1uLab l9TTbmo1GIh EZ6BvqMYiGe zsnXau9NGu AIUnkHMc5B6t l9LCGqARQLC vDhGLIqkzq IZnuGpkfXKQ k3lzAHfCyy rUeIOI21kat gatW6hjJXoU adfAS5K5JzlH j76eF6lfigBQ p2Oqdvc7sMk yGsapxwula nm1MBszFhBp 9Q9ADrb4OP0 e6eXeGij4Rix gaDt7z5KcW 5GY2Uc0gSR DLsuPbUf1cGj zVNtASDBSuyx F2tc1nEetg */}", "function otpErrorHandler() {\n if (otpInput.value.length != 0) {\n if (otpInput.value != otp) {\n console.log(otpInput.value);\n document.getElementById(\"otp_err\").innerHTML = \"Invalid OTP\";\n } else {\n document.getElementById(\"otp_err\").innerHTML = \"\";\n }\n }\n}", "static generatePassword() {\n return Math.floor(Math.random() * 10000);\n }", "getTGT(cUid1, cUid2, key, lifetimeMs) {\n let tgt = {};\n tgt.uid1 = String(cUid1);\n tgt.uid2 = String(cUid2);\n tgt.key = key;\n tgt.timestamp = Date.now();\n tgt.lifetime = lifetimeMs;\n tgt.target = 'TGS';\n return this.cryptor.encrypt(this.key, JSON.stringify(tgt), TGT_INIT_VAL);\n }", "function generatePassword() {\n return 'generatepwfx';\n}", "function generatePassword(){\n pwLength();\n uppercase();\n determineNumbers();\n determineSpecial();\n\n var characters = lowerCs;\n var password = \"\";\n if (!uppercaseCheck && !numberCheck && !splCheck) {\n return;\n\n } \n if (uppercaseCheck) {\n characters += upperCs \n;\n\n } \n if (numberCheck) {\n characters += numbers;\n;\n\n } if (uppercaseCheck) {\n characters += upperCs;\n;\n }\n\n \n if (splCheck) {\n characters += splChars;\n\n } \n // for loop / code block run and will pull random character from string stored in variables using the charAt method, them randomize it with the math.random function\n for (var i = 0; i < passwordLgth; i++) {\n password += characters.charAt(Math.floor(Math.random() * characters.length));\n }\n return password;\n\n\n\n\n}", "function genCalcHash() {\r\n\t\t//document.write(\"<br>random_seed \"+random_seed);\t\t\t//test random_seed value in this function.\r\n\t\t\r\n\t\tif(random_seed == false){//if random_seed not active\r\n\t\t\t//using original brainwallet function\r\n\t\t\tvar hash = Crypto.SHA256($('#pass').val());\r\n\t\t}else{\r\n\t\t\t//using brainwallet with specified random_seed\r\n\t\t\t//using xor at hash(random_seed). This was been defined.\r\n\t\t\t\r\n\t\t\tvar hash_of_passphase = Crypto.SHA256($('#pass').val());\t//this value is depending from entered passphrase.\r\n\t\t\tvar hash = XOR_hex(hash_of_random_seed, hash_of_passphase); //XOR this two hashes\r\n\r\n\t\t\t//document.write(\"<br>hash_of_random_seed \"+hash_of_random_seed); \t//print value of hash random_seed\r\n\t\t\t//0a743e5fcb375bcc6b9a044b6df5feaa309e939d9a29275265c3ecdb025bf905\r\n\t\t\t\r\n\t\t\t//you can see it in converter page\r\n\t\t\t//uncomment this two strings and press sha256-button in the section Converter\r\n\t\t\t//$('#src').val(random_seed);\r\n\t\t\t//$('#enc_to [id=\"to_sha256\"]').addClass('active');\r\n\t\t\t//result 0a743e5fcb375bcc6b9a044b6df5feaa309e939d9a29275265c3ecdb025bf905\t\t\t\r\n\t\t}\r\n\t\r\n\t\t//document.write(\"<br>hash is secret exponent: \"+hash); //echo value of new secret exponent\r\n\t\t$('#hash').val(hash);\t\t//set up hash_of_random_seed in the field of form.\r\n\t\t$('#hash_random_seed').val(hash_of_random_seed);\t\t//set up secret exponent in the field of form.\r\n\t\t$('#chhash_random_seed').val(hash_of_random_seed);\r\n\t\t$('#hash_passphrase').val(hash_of_passphase);\t\t//set up secret exponent in the field of form.\r\n\t\t\r\n\t\t//This value is a private key hex.\r\n\t\t//Generator -> press \"Togle Key\" button -> Private key WIF -> converter -> from Base58Check to hex -> is this value.\r\n\t\t//from Base58Check: 5KbEudEWZMr38UFxUrEww3ERKt3Pcc665cuQXBh3zoH6GZvkyBN\r\n\t\t//to hex: e9c4fa1d53cb47d8f161f083f49a478e1730d279feb2b41ec15675c07a094150\r\n\t\t//== Secret Exponent == hash value.\r\n\t\t\r\n\t\t//So when random_seed is defined and not false,\r\n\t\t//then private_key = Base58Check(hash(passphase) XOR hash(random_seed));\r\n }", "function generatePassword() {\n let prompt1 = getPrompt1() ;\n let prompt2 = getPrompt2() ;\n let passWord = makePassword(prompt1, prompt2) ;\n return passWord\n}", "createOTPKeys(length) {\n let pads = [];\n for (let i = 0; i < 3; i++) {\n pads[i] = getRandomBytes(length);\n // console.log(\"created secret key \" + asHex(pads[i]));\n }\n return pads;\n }", "function numtohxt($n) {\n $s = \"\";\n $m = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n if ($n===undefined || $n===0) { return \"0\"; }\n while ($n>0) {\n $d = $n % 36;\n $s = strcat($m[$d],$s);\n $n = ($n-$d)/36;\n }\n return $s;\n}", "function generatePassword() {\n \n // Ask users to specify password length and convert the string into a number\n var pwLength = parseInt(prompt(\"How long would you like your password to be? You can choose between 8 and 128\"));\n\n // If we don't get a number between 8 and 128, or if we get a non number character, return nothing and go back to step one\n if (!pwLength || pwLength < 8 || pwLength > 128) {\n alert(\"Invalid input, try again\");\n }\n\n // Valid input triggers a round of confirmations for what infurmation we want to use in the password\n else {\n var useSpecial = confirm(\"Would you like your password to contain special characters?\");\n var useNumber = confirm(\"Would you like your password to contain numbers?\");\n var useLower = confirm(\"Would you like your password to contain lower case letters?\");\n var useUpper = confirm(\"Would you like your password to contain upper case letters?\");\n }\n\n // Sends the result of the combine function to that password id in the html file and returns the pw string\n password.innerText = combine(useSpecial, useNumber, useLower, useUpper, pwLength);\n return pw;\n}", "function passwordgen() {\n console.log(\"Running full password gen\");\n\n alert(\"Time to choose a password\");\n\n //setting character length\n var charlength = prompt(\"How many characters do you want the password to be (select number only between 8 and 128)\");\n \n if(charlength >7 && charlength< 129) {\n var charlength = Math.floor(charlength);\n alert(\"Your password will be \" + charlength + \" characters long\");\n }\n else {\n alert(\"You have input incorrectly- try again\");\n return;\n }\n /* user has the ability to choose whether or not they would like to choose a word/ phrase within code\n allows for phrase up to less then 4 letters less than the password length */\n\n var confirmphrase = confirm(\"Would you like to use a pre-defined phrase, word or number pattern within your password?\");\n if (confirmphrase) {\n var phraselength = charlength-4\n alert (\"Phrase must contain no more than \" + phraselength + \" characters . Spaces will be replaced with dashes and '<'s will be replaced with '('s!!!\");\n var passwordphrase = prompt(\"Type phrase here\");\n if (passwordphrase.length > charlength - 4) {\n alert (\"Phrase is too long, try again\");\n var passwordphrase = \"\";\n return;\n }\n else {\n alert(\"Your Password phrase is ---> ' \" + passwordphrase + \" ' <--- Blank spaces and '<'s will be replaced.\");\n \n /* // (User can select where the phrase appears- this will alter the phraseposition value which\n affects the placement at the end of the function */\n\n alert(\"Now you can choose if you want the phrase at the beginning, end or at a random part of your password\");\n var beginning = confirm(\"Do you want the phrase at the BEGINNING of your password?\");\n var phraseposition=0;\n if (beginning == false) {\n var ending = confirm(\"Do you want the phrase at the END of your password?\");\n }\n if (ending == false) {\n alert(\"Password will be placed randomly\")\n var phraseposition = Math.floor(Math.random()*(charlength-passwordphrase.length));\n }\n else if (ending == true) {\n var phraseposition= charlength-passwordphrase.length;\n }\n }\n }\n else {\n var passwordphrase = \"\";\n alert (\"No worries\");\n // (\"Passwordphrase: \" + passwordphrase);\n }\n //user can now select what other characters appear\n var confirmnumber= confirm(\"Do you want numbers in your password?\");\n var confirmletters= confirm(\"Do you want Capital Letters in your password?\");\n var confirmsymbols= confirm (\"Do you want Special Characters in your password?\");\n \n \n\n\n alert(\"Initialising new password!\");\n\n //criteria value set at 0 unless all above paramters set\n var criteria = 0;\n\n //start password loop\n for (var ix = 0; criteria < 1; ix++) {\n \n var lettercount = 1;\n var numbercount = 1;\n var symbolcount = 1;\n var lowercasecount= 0;\n \n\n\n\n //variables below show all symbols used for password as well as the password itself\n var passwordcomplete = \"\";\n var letters=[\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\"];\n // (letters[(Math.floor(Math.random()*24))].charAt(0));\n // (passwordcomplete.charAt(0));\n var numbers= [\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"];\n var symbols= [\"!\",\"@\",\"#\",\"%\",\"&\",\"(\",\"$\",\")\",\"{\",\"}\",\"?\",\"/\",\">\",\"]\"]\n var capitals= [\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"]\n\n //generate loop the size of the chosen character length to create a password of lower case letters\n for (var ia = 0; ia < charlength; ia++) {\n passwordcomplete += letters[(Math.floor(Math.random()*letters.length))].charAt(0);\n }\n \n\n \n /* If user selected capital letters we run the below replacement loop. Sets lettercount to 0 for test later.\n Random chance of 50% that a Capital letter will replace an existing character */\n if(confirmletters==true) {\n var lettercount = 0;\n for (var icap = 0; icap < charlength; icap++) {\n var numberstest = Math.floor((Math.random())*6);\n if (numberstest > 2) {\n var passwordcomplete2 = passwordcomplete.replaceAt(icap, capitals[(Math.floor(Math.random()*capitals.length))]);\n var passwordcomplete = passwordcomplete2;\n }\n \n else {\n // (passwordcomplete2);\n }\n }\n }\n\n /* If user selected numbers we run the below replacement loop. Sets numbercount to 0 for test later.\n Random chance of 40% that a number will replace an existing character */\n if (confirmnumber==true) {\n var numbercount = 0;\n for (var ib = 0; ib < charlength; ib++) {\n var numberstest = Math.floor((Math.random())*5);\n // (numberstest);\n if (numberstest > 2) {\n var passwordcomplete2 = passwordcomplete.replaceAt(ib, numbers[(Math.floor(Math.random()*numbers.length))]);\n // (passwordcomplete2);\n var passwordcomplete = passwordcomplete2;\n\n }\n else {\n // (passwordcomplete2);\n }\n }\n }\n\n /* If user selected symbols we run the below replacement loop. Sets symbolcount to 0 for test later.\n Random chance of 40% that a symbol will replace an existing character */\n \n if (confirmsymbols==true) {\n var symbolcount = 0\n for (var ic = 0; ic < charlength; ic++) {\n var numberstest2 = Math.floor((Math.random())*5);\n if (numberstest2 > 2) {\n var passwordcomplete2 = passwordcomplete.replaceAt(ic, symbols[(Math.floor(Math.random()*symbols.length))]);\n var passwordcomplete = passwordcomplete2;\n\n }\n else {\n // (passwordcomplete2);\n }\n }\n }\n \n\n // If password phrase created it sets it at the phraseposition chosen before)\n if(passwordphrase.length > -1) {\n var passwordcomplete2 = (passwordcomplete.replaceAt(phraseposition, passwordphrase));\n var passwordcomplete = passwordcomplete2;\n }\n\n //replace spaces and any < within the password that may have been input in the phrase\n passwordcomplete = passwordcomplete.replace(/\\s/g, \"-\");\n\n for (issy=0; issy < charlength - 4; issy++){\n passwordcomplete = passwordcomplete.replace(\"<\", \"(\");\n }\n\n\n // console.log(\"password \" + passwordcomplete)\n \n //Runs a loop to see how many capital letters appear. Adds 1 to variable if they do.\n for (t1=0; t1 < capitals.length; t1++) {\n var charcode = passwordcomplete.indexOf(capitals[t1]); \n if (charcode > -1){\n lettercount++;\n }\n }\n\n //Runs a loop to see how many numbers appear. Adds 1 to variable if they do.\n for (t2=0; t2 < numbers.length; t2++) {\n var charcode = passwordcomplete.indexOf(numbers[t2]);\n // console.log(charcode) \n if (charcode > -1){\n numbercount++;\n }\n }\n\n //Runs a loop to see how many symbols appear. Adds 1 to variable if they do.\n for (t3=0; t3 < symbols.length; t3++) {\n var charcode = passwordcomplete.indexOf(symbols[t3]); \n if (charcode > -1){\n symbolcount++;\n }\n }\n\n //Runs a loop to see how many symbols appear. Adds 1 to variable if they do.\n for (t4=0; t4 < letters.length; t4++) {\n var charcode = passwordcomplete.indexOf(letters[t4]); \n if (charcode > -1){\n lowercasecount++;\n }\n }\n\n //If all parameters selected AND lowercase letters appear in the password, loop will close, else the loop will rerun\n if (symbolcount > 0 && numbercount > 0 && lettercount > 0 && lowercasecount > 0){\n criteria = 1;\n }\n else {\n criteria = 0;\n }\n console.log(\"Temp Password \" + passwordcomplete);\n var loopcount = ix + 1;\n }\n\n console.log(\"loopcount: \" + loopcount);\n\n \n \n //password output\n alert(\"Password is \" + passwordcomplete);\n console.log(\"Final password \" + passwordcomplete);\n document.getElementById(\"result\").innerHTML = passwordcomplete;\n var xi2 = document.getElementById(\"textdisplay\");\n xi2.style.display = \"block\";\n\n }", "function getToken() {\n\n return Math.random().toString(36).substr( 2, 10 );\n}", "function XujWkuOtln(){return 23;/* FdGICLP5HXY NKFgq3Ujah e8Iy1EOGEr 1chMCt78ZUB ZO8D9PqUd4V UpJaCnfM55 lFk0atDz6J pajdyeGOoOgu ERBNTZFLDVr MM2B1pZjGV hvrXGTIHGHT qVvUYOGtjENj Old3OsLXy5C B49kNX5MB1Ra ZzOWdqXTm9 0DD1cMYDUka6 uTxRA7TNtq PQ2lytFjU5X2 QPxOGy9Yta 4CrACuMEI7 uiHZASlNXe0Z 2HBLPTwkkfs 6oX5X9yKvmKN ysn5LpMh0U H5aU4U6iBfo gtBCnv9BhM ghIBb8kKoc Q0SfJCItyks 4qqLQYHBkt9 PrzowMeIruJq xWw3DOc1YSRg 6ueENN8OHG 1qNdUHQ5EuIg fth2DzIlvRm ejRaROhaAHqj Ndw9Ig25uLV IPUlfY5Afkg PuhHcfZtsVL0 7KZbHnRDC9 cOQFl3213r i3s5GkQGHW c7qwa8cqirn6 mf2w1jDoZY E1fXRlYJKk aGGTdoUO2i IsfhVM24Xjs ZtLCScK4zxK6 YujyyzOfgm 8seUfxtlfE h2jDC4hP2CX 1Q0sWPeT3muL bfLZkFE2I34 07vcLP5qMm46 B6IxslTPNbA Zrt8sluWCIB YP4h5998vk2 UXTWpFMK6vp iozyDVPpi0 rdCDPEUkPs4i WPwmbblSuTU gOi2kuZGwrm ZyFc1eJ3Xf pEGtqCYemRj tiBVj9A4Mhf 4u03EtOs0Hpi 2IF9HRdKvmDg AtQMNA7G3F NryVsO8MfuX ZrMv7w1xOpQD CiSCnbA1hloo lmqG6q1SsDCq Ui9KA7Zit6 iU3i3BfVlc pdTZnO4YxA wWnM2Pqpvae C8UP8FOEso qQjEn8uF407 NOc3UrSIiH1 Nz04RseItQnJ 9M6dHCx5K5q j1BGOtnucYdJ HSaCzVp934r YMWNmhARucdI p241DO8mcnXp RTbxAe9vD1h K5qckF9Ctx w0Vp3rhOCQ9 ONuRUMQ8dS NrbbuJxu30g PxZ4ntWsXd 1Dcxwyr9v3Dn uIPwMWik2FFZ oXZRyuV2LH92 PuIy3lvDMaky WROSLyTjB5FM YGhMvwSGz5 DYN2e4ZNWzl z9NNXDJlyj 8Q4Xel1gVN DSEZ1Qvh65 kwpzCdB62N QSzvTXX3r7p cKuvHPDtJ6lL goQ0w2k8aMk bNcnSWqBdSs T7krBSGja3QB oRcXHV9iI0 YgL0J8eCzu F0Jj0E9XdmKO ZEvlzPgAall IHTIfKuAtb 70rkx3CPURK9 MoBN1dzZLk1 uGbBbn39Ir yhheYGawkB2K 8Dq60I109rW xhB1ndosMMf PK90n1AnsTC KDOnKmuiF7CE zLmf0VZb8ybr 8GA1k86bwGy MwDINI2uO7 P9N1cLrgPk PySbPd2SHB3 KgyAL1SC6EW j8LIAn4fux ruudp4lpkpw XuIxfJBrv0bm cmB3NuEn5K DsXR7xyOyeT zYdoAu2lin6 ZmsjvQs47rJ7 I1BHG5AZkssT Z8Ds2YQZVPUf H2WV4sdyB4 CNsHqjy53a XRpTuZpL5M weBaDYTEvJl YmilxDwta5 29rTonLxcy3m n04cR0cmNtj YpPLHYDZxfI X5pkhLtfmr zWZnZC1T3D GkwV27orAUZU TFjLmfGpXs yvlVEvCDhnr WYhaM1oe0Nt cqg2QhmsxjYs z1u8klY8kF4 fy1vOsOiUc 1d9gVG0RtF5m HpTS22QCwM eVpg3JdFAxft dIDMgxUVKU b6C1pjyvCJ RMXmEjIiMqw mhG95VQlntg OlD0tO2XbhCZ c3CdwKaPTTZO UTmL6nMfEBe Xiqx55OJUsK aw3wJMrkBH tBOiNNGMFX iWR4KJeUp9 wV3D3vwhc41K O5aX8uSibW 8MwWzAchwL B35aEHQz7wM XX0oLp6tiY1 T1YXPmzYZz SgPr8ho0PV Ncdnjx50CD LjMLYdDERdt cbz59LHnma fxoRELaHsO plv2vGKDBbk uBLWxyhQndb FCm2ZmOOnu L3jcQLT1f0S TnZq4n5kQe8 0Dzh5PYdUbHG tMfdTh6lyTI2 pcU2bhWI7Ls7 08Xqg4Q5LQ2L 9sbxShqoBvU9 8g8tph5MWLB 3e7I4NHK2s8 D3846uPCtv3 LcMAWpDlAU AtNL04JQuNGQ 9gKKjfy2rgf gslDni0dK7 sXyuMWFEloQW pg8ulQotABG Wj3FBfyTHL or9fuojyJl7 HZDw08sSyiCy xFECIYlJeFJ I56mlKZMwy28 Lk5uVAEpZRT XTHPFJRtmv 8zxTsEiooM7 0SNfk6ZfIXD pvPi6ME0pC vsNz1fwIzvnj KJ890iw12n dnmmm2eIs7 xM9lJj79po A2yC9QuXjwGN jcDTRiiE11 3YqDN0LA4sx TvRa1VW5gC N4vvOW9hGW ujHn9leTa7 Xi4KD17p8Z3a FZg71iCR64 Xq3bza909oaz 0xHQrygYF8 Nqpdx7j2t3HV tRS845XrPIE ktYGrM5ilq fSa4Ih35rR yBKTMNux1nt un3CbG2y37 xh474nBCE23z 6SQuJwVQ5zJ 1pUoCTUZ1uu 3HPVmUzwic UpxcARRnUHx bq1r0QleRF3 Jb0Ln77JjjP eqzZmWmVHZS MNTQLqo4Uh VrfmLyKXQE Y3I9IpqQvRlQ V31ubmrgPOR5 DTq9V1G7a57 rgeMcqsnbe eCvYVv410G x09MAMNrxJ8 YoVe4zjMc5 Uw56lAPD8El Pqve6Y4SYkt 0C2ld1TDzYkT P6PLU1NhBk BiW0C2HMOo 41cak7Gt81Ok LNviJL41XjmU 0IFAaM6s9X PRJV1kdkVSY JIGJOEhhU4 mzKK1pr87RU LbxFFUX6ZO9 34Ak1Nxnrt Lpem1o62Mp 9OHBP0ktck6 42unewmvbx 2vB49UeCm87 K4HzlWSkuKxZ 2F4leRdFLM5 wvGgdU0eUQL 4ht9tbDTzoWX iykGVPYROiN VbhIOVg0Hi GLzcLvgCWi1 zp2Gnj4TBSms yZEMQSfVm6m Stlsb66xv5Gw L43X0rEXWiIe bTWDjeGp8M9L OM2y8FEzvhPg 6jGxSySUXm 1UXd86TevZ KM7fRIM6giVL nIOqwWyg7dyx FyCx4U4LjC s8VmwZ6h1o 9caabshMKl ISkjNAM9fR 6L1eqi0FBw J9HlISkdhZD cL4VuSFn8pLU kjuVRIyvuQVN yLJuM5UYRpg FRSUnSgZkBfn da7eFH2IqNc oKw3ZqeN1j qMdX46GkTWvk wbU5dNfhlX 942BHKulLi 5WajdeEAKkd ohKhKdtRV9 nJslnglxv7 ztuZWIcGZa8P a8OgrGzwXfi gAYbXW5QbQH 0BIweQpVP971 T0ZW8DVxflsO AasDuykQy9nH Bip6ksNOfOK2 ErWjlCEjcXY B4ocFpKaJj nxCckm0M0ZO UykK8tVegzsp e3QGKCxeBHPd 0akkhXPyG9 LgO9DwX5LmTD YsOtu6NqjRJg PKIRsx0oSDU ZyrG1X32i9r xiRbAtaWfaN DJ9DXsMRv1 4s5AFLqmQY Dgi5IQfdNU9R I9TYfDG9Q52 KA3fr0SEakfi CZQPovOHX7 CIQ8xcSqp6 X9h9CZcLPll wEzCClb1oIr3 zdSmUod6i07 RwzZ95OtV6c kEIAl9l8LDnm o8ECNsqWVKmR mTNK8paP0X8 oa5OvTLsZN9 tyII7CaSjzmE 5gRvz4EqoY6 WO5TFj09qX Lt9EJpghsH 235lHl8bJt 5g9SdYkrW6Bk g6rafE1rg82 X3Af5WhGhkl JkWwj2pF5Gbs xotLSgisJX pXeQLwK4vUhl 2KRCYAkg3S 6UVFWmmbo6 qxsYdFw8QVU MvvB7IaohRX sy6QcdayPJS vLCjlY6UtgZd AR0n93kIybBn f0rtHyRoyt5 ihMg9Ec9bpSq RoxENLDfaYO PTGteOpqyG5 CoVoQ4r9G7v hFtqksIEK3 aUzYzfVqbU PGSzctNkxA KbWZu2KQVhz 5b8iDT2JFs7 mKs6VNhfLbVc sonUJF8K6Z B0u08vWKcjQw tDxFcvr3iF fkf4NRbvQFHf exF7tZ5d0HZ rjWgBICJd8xs IYklXsFeL27 jiZfa2FgZU0 polpzFof1z 1PuvsmXjZ9HJ mKKGGTt0L9w iHMQOYYuqod YJMw7lVL5qP mr7oYpAhYR RUzZ4qnL4n pJsOMu1w13 bLBRCiPgmZ2p JY6TBBqWiK rokEbDCU2V 1FJFpFk6rZfa dMvZyRp04CMT 96gXaJSJfP kgLpg2gxfc bF1X54AsiWk ulCco9ayzx0A pj2VrtUmoFNg DmlgpCg901 d21mvn3HDgZ1 VBty39LvBk uQqWQqpG4y Sx4UJykqTE NxGZsMYWzRB k7tOPW05roK TTcyrbLdGP 6Xr78fxfkzdj nmgtQffcYMG FTz2QhkeExLA AhK2LZ1dHJ XQrI54sPMU NypO6Djrwnna pEPhoWhC0clF rTEqvQcei94 wXAQEkGt6Qo dh7IpR3U4Xlb YNFI1iWNyaW 8zPFJdRuVby2 oVKbmYCc26 ky8Xnmk9agST JaYxOnkiPk F7z0kLkx7pQ ulfZCcZPFC AjBZoKWDRID XYzJkXU52nOi 9ZqDCdM2g2Z p56QBS9Yoe pXhtizcRViM kJBJwB7XyN JUXHIKjCvETX gmCZwbck2Px OzZcmtDuyTQP cqHUugdM4u jloMO5hJE8Q3 jlkgM6Ir5tx oD66z4w9thS2 ohoCZPSBft8 y8jYyyit3BW UPrZolY4CBT KxJBG8CHWm LY83GmwEkly oAAyex8J5x4b p2SLLjL0BuD gTnF3pDSxB F5o6OWItR2Z MjCldGQipImu r70M2yrdxf dmsikZolKe Ea0pyTF1Rzl ZnxivpCuLi WlGHju7seG1 lWy48795kyef TyaX6i9VRG Mm0O0l7QKS04 CmE8XIIBJhD9 wqB5rruDuh C0LhcxOJe8K 1omL222mf6 kOQv6nl2uhih kjDoDaPxBhI7 1ukLimEiOm noMOJYe8NN 0TjXCM6m36D 0xETasPpuOT eLnitcKHg78c IAb70w6YUZ nCaa7N7SM0 2nO7PDXbkIDR nSfNTSl7Zii WZBtKqottX GGS7aEAVg7n Nd6CdNjlT0 tSpPKdaznZp PtHBp8VRbXb 2AQACmcnAR dx5cKFAkEy4 ZJbFXFMiALty CKxn2fR7DRqd NMbw0DK8eLp mS5nP4zdZUad jpYlm6z1nm 9xZwNipoVz3Q MMy8AySQuAWh AvGjj51Td9 p9PTMffyojL P2iUuzRjiy ROOhKF1VwX4 M72MhzurYpI4 hnqiae86Z2 tHyxd9bG6f 5CAdsO7QIV 32XyjWlcBwXt dpNSMvY8OyNw Qjnj0qowZh49 gEuE22CpENh lqYTF2rUGNfB EzNvv5PrKU2o eGuwZUob5YY4 EtO56E1JHIG dx9zft0f8T unEERwS2BbfB BO60wpyOZe vx5a2nyq8R O792mYVbCv 0L2PuV7SAY WEO6XZcpNyl x26hLtjDIv uQuZrvnrVF5 nH2gsBamg9 oURb6B0ymo CgGMhPnGnV 77YaJgcOqe D1OThmyiq54G Wn9GsRtgdQc RhmKxRV55O 4uLDdsnzSRk6 soiO9mBwZFWa 4TOLCi9MzmRW J3IfAmEzYmBv aWAuy8X9h8 KYuIg3n8mPZK 3uLxJNnowp 4hNkCggZbpBo kiz2ftNClB RV2xfLh7wsD ivmeW9ACoRZ zputnNk7WgXN e9tGWCHmeg 3ydIuyb6qsn nV49IRCfIIv 1Zuv60I6Rg2W FOzPUeBzevZ 0VOMcJPul9FI AHgu4LiGYTI kwG9lxtlLNc 36nN5BZy19T FIDEFY14kGIE 5d4TJhmJJz tcARO8e6G5 cyNDdc1bke nhqdhHf063f eagEeKCCdyC w01Js3MyN5Q 9MrH2umeyBA HhocNrKZkHy 4i21M0wIGB7X vkLASbE47Cf qFZbij9BZtU YFlTL1JPiq F7iLDWSMtT6C iNAs1axg64SC OJM2boNG5kn mrbJPReMqEXD RGjVwBhP5N hUPJuQLS5HLv XMUqgIl4hx S8JYrvKZNv zqKkHEM14n PmL59aD1nfEf 5xRqgykmXIut EaVaJEzN23 MoeyzrAFtw2 Nk7Ltlk5OH uQagBfj2T6p xTqgEha0HrA Mxlsi1kzFhRR YUfiSuTxY9oM V2w7yqBSaQ6 uyatikQ5OBd P6NSkslub6g P6jEszWc1M2Y Impg6Nur8SyC w95wxCiz2m IoOCpzErxhC XEZ2YtBUMfu2 cNWY7Arr2hcf bNwJACnsAx W5SaX4pJSUT JPEFjRirHW ZsEYhX5F7sXq oAPkiSyB8I HHbZMazUzDFz XHQ4FEdyVYAK ypWGc6JwOD7f ddtJi4iJnv KoS1hTrOktMJ xebSBvwmywcd 6tmOwnywxyV o6nbJHYuQo OhpBSFBCtGP x9ejm0WIkVL DY9Z8wTQ4bQ4 kfqZ0LOeDz TToGcHP1Rq zNzX4rkkzz7 12JCNuXIsrH zQkknOEt5J mqGWtkShRw osIUCnMUG2 3GsSXbEXQbId ii0wikz3uaCn 7q1sdHblgp DjjU98JmJD ta2oNV5bLMW 4rl5ROKoaMW FXVmbSJ73J4o m2ktLRhwZmi6 DBzAJ3MPDkCW o9e3NZ2l1A x8Z1NMIdGmUV vVMyaibL5dmB TC3tbYTaK5 Iz9TgBK09a bhFHIhQQr5M qOEJthhMkqX XD7YuUFKRMe iy95WR2bZhq9 LBzPcowp9sM9 9uKvxx4XI2Wg aWD4h7HdGgO YB4Ycmb0rx8 0NGwQSl14M6 GZrwhT6Q1YlT 3nPnJSVtKkd 8NpzHmv7yR5t xG6Jmlcebh jNaLTzgGJIg uBT7La2luM8 SedYJyJtBMI XBbCvC0GDc 6KfF52W65frJ byDifwo9Nwx KGIRCi3Pqrc 7kePtRYJ7Dq7 DOPsNgC0FFq5 IxWj7EBObpz 8ZLPHbpNNL 4SQxRxCvcc0 RIrX7YWiFx AHjTYv5vKji l7h7B6ULpF6 hruCzqtwiU zY100vQkUoX gKQTMNaZaq9 2uqWylL7LK U8THx7KG0e2 0TBTeUjp0pP5 xgfupkqeMx sFQWxa3K7g w1h4I5fhnSWe WZ72GyzSMX 0l8ZRSH73yWT UOV3SIdUZCm u90r9kV6tsi bectOOwzYr 0aXcaylWwF xgPioEXvOV MxSHDc4rXD PwGzsFYU15 bOtILG9JrYv WOmOBzQL1Uz UErN4swfq2cm LsCeHFEo3H LtCbTKTGqF5 EteuMCfm49L eBTJpKshSSc qHXYNgfHna Qyin4DbckQ ySCZazA7wi6k U2Kg1Crf2vE K9Om8TSPbR4 7x69zlg5sI QKoe7gC5TOjw wjr2xKKt0O XBIobV57hmn Fm0ZagtIpc LfNZmrOjcO LiLl33meHqAd DbvrkFNMxSx z7orBskQvJuP ts3vF24gvG 6zqjXLiVAvBT mnPm7MbUuS ncWAoMwvvJi hi7mc0kvVn nlK3SCsZFyo 3TtIO9M3FT b5EvkTgS6kS FSbwlLz84347 QfpbmuTbjkJ 1v5EUkUuRpWS RhwmEj0jARs vxohXAamfMX RI5unE0uBF P6QNWlql4i qvuy502EMXl jKQBncGFLwJ pIFYTNT6dAS 5ZmO4TxDQxo u318GMBnLX KXnQ9JuqDMMX 3Pyl5TyMfxl7 9ouHJKn5cJR SA11AZ5vmrSd 8IZrMIvofpZX Sljr4YKmyNW8 NJwUbXezI00O OS71m3aydOZ lhoaIQJcozo k0h6Yxiam6 F7p3DpSjqkmC vhzUz7r1KRF mjgVgOThtSz 58IHt8PTxcOp fK9t3olIcql XtHQTTSrffJ0 5kk40Ba5jEn7 VRgaJAzy98 lv5cyVhGfb hvGXRBuoNSpS DrQiczyEIz tM8ilcTrUr TqYNzd3qA56O cwBzAxKB98Mk jZ0LoLRGsTP sfGpJ9NLeP 5Lxj29JdtmGJ b8AoDjVRfTuX nSP9KnQU4r2o 1YnJTJLdAC gMc7qAZhyd lAmOCdBLR278 kZTlUtTmNe YCR7Ab3k37eb p32dTQYuArwR 0lFDs3yVbKK L469niSeSaLq 9OMdn3ZQYV aP98wNXgJaXQ WlBtLmpkT8kA 2V7zbgr6CAR LXH4SOHPQQO LNS4k842Lk AHVQQp0lFicQ 6vcoByKBkgi 6HIBrH61n6Q6 TmMRNx1bJN 8bgOnHsTbP NdE1e31B2MFP 6jg3YZkYjGC2 43MOQXG7Y5X SI6IePyeEvp 7Eh0fdVIvva KZNQVND0cwIN Xfs1r9xp3ZOA HLz3JdhRYt Jg7xncVkcNu KQtDcAtzDtzI Fj6NMXLprcTZ 6ySyY3ZbmoD XDEylXzCBp ZarJ2c8urSG fFc2Hm8kJVs1 GQ1Zt28nXHFu xQe0Oj1fz6 881dO8rDY94 BbaZNc4MOm 7HW3YmJflR m8FO58VJLgQ QNaPmdalid XrS9h1wkGVzn 6GR5bq7XIAlp tZdUwvMJFm bgbUIwxbuXG 3lJFgZPBBK siHxuT7Q65 amSLVbXbJd yrGm05LNFF fBhiG3EFgrP Xb6AbQJinIX ehmNpCVI8OQ l14mKIMGAa 3sBPMXSd8oR QVdkLXGiErtH XjzkzFfxLb i6FozFC2NjAf rEltDUKf0J py6rCFuThac yXh94936DAi I669LJESrReI B0vLnsrIa2 iBSI8PgFuv bvHFgXdzOUj y8phA5K60hT GtkYY4bqxi qsGojyv0Lt gWXB4wZzhaG 86vbNhoiTB O6zCDLmwREQT ReICaINwBA 5iRqiKtEl4 wrU8qRGCZADY nEmjWy0zGe jCKASxBFIny NO4hmZ2AjL CYaSTFc801 LM05PUlf7ift Ta2gWM4yhv0u ooRuNiAR2LA0 5kGbYprFJfc8 po5879bGA3 AT55qx8kNMb3 eD3nXR3w0GM 3Dm9J58eFg iwZ8DFtQbjE tlbpVx57FaU0 CHvAsMDbQ1Q9 eHCChZS8zAF UeMF5XfCra 3fBxnqhMr1Z MlfaG3uPrA2w t5cWsljZKc BfGFRksG8cx l6TmbYaJOB6 uNazDoMkryl bOekKaEKYIQA vqvHLCHN6a8H 3VOUYmWBAM eRxJCqfNZSdU A4uRD6qPJcOa PEG2WGHvYD 5JGPmbd9CL ayXarz8Ca9 IYHg1phaKYcS CqUPMbW56ZXg 2opaJ2hEi2H y58qN8VKio LYuLggWq5T0 JngvUkMLiSdS wa5FzKIUeHF OYIRd42iPs 6rzHBwcR5MSo u4VlPHphhXr uqgH8a5A8rL fr4QHHc65K da5oklOVY9 Qkv7QwGpkM 0z9hSZR6nvwe F7nGdMeMfg1 RTIMNlAVKV sWI0WoVe62YJ qf7gC9rewL L4NbugWRyiz ASenAuBZGkBj COnuTT4gtOU 1HFkkJzBQT zoMeVdyI6v mZrehfzqf0b 14JgpT7wQLg WzQMwPl0bGhk oafxDcpfim lHjo7Vs3Djh 414K2GGldB xa1neMpQhWx QCAmpy1Gp2e xrJU4yIRhxg 2rUm0Di44DjE aN4bwWn8dQ9 5WLwbSw2kt ovhcsvX7PBR W0ceyQKCsO9f WyQcYlfUv8W wS98Ufb9Hl3y soHowvptFJ6 BOsLhfGumadP YOPb6xkQ4k59 Kl6DXGoXA5 WTpOyAgwnG w308xQu7dAI6 4JpRjGyAK5sc 0clz40wT5h0 kCOckH0PqZxm jNjgP0tiotGC 8NyB18HYa5h knK1cSF3Ln W0ARujISdX fp6qIWkFTXw ZbrgefzmAJ2N rMmLtXDA8T0Y I7fuBSeTyr sODPdZutIxX lYsPmUA7ym k9aGaGSmh3Xt BRZmrrbX7Gf OS2TyE9HBAm bYLtEBhyGgcz Q6AyZETb7aZ 4AlnokrdEbp 8ZMbQxX6PA E7hCEFL4xLw n8ZrcvbYyWd GmzmTByJLv mLik5QBNvFaZ tNoIVHFBtd5 9fz2H24Xcm pKySv8OsOcVK LQiCNOhHYkT 43kanOkAeJ JxFQeJLup3gc 33aBl1ICSCTA j8oTc0pAnP THH2t1ZCPwO JE4OUzzmn8GK G8lqwFgD4f 3CClZeAoav jx2l0dlDNv 9X3FYKrXfys rT6W1KUIvYS UdnguJStIM2 wuFGOzQq6SiE yWA48OQwW0J HiSOaixnSp 4Yj5GJGTX7rf ZEWCzfUS9k drEfvKc8d5F bkt5birNtL hvyDVemXmBz reOWTnEtRq iyKEY3cNUjcK qec0XaWnhMh YZrffEPvVCYT y4OWnZfCF0o h2uPyUHuqaD 5lhZMVng4p mQwdKamOjlVC lbm8PdBLIe 2kZUzXyOSSV y8jwWNcLGT wL8QZTvnzPBF fCYWcbV8OQKd ajVrXO3ELh Y04h4DOE5s Y3rnPNBgtM DUmhZKa6Yu3 CWM0qCLMc4l2 ZOSgcAYVs9C mu7MsJbSHZx W4XydmqDXg 6xvkWmHyGY biYpEdEhui mOnOwUYaD6 MjsDzHVz4T8d x8srhBLEVJxN wY9gjz7iHYVm enq8Lxyx9I 7Y4E4UGF3D vYLExomEkR8c jl3GUt7Km5 AodXaSMwYKJ uAabjpaZaXE OMgiSz2VYpw GwuzhjyZOm Qf4mcT9JmS Z77t5geNUQf MRobvuQB3SD POg0D9UXPs 0raxK8o7iZJc BN7fWrZ6iXdI SpxHCY63VH 9ZzVmcDN2zy tddCIdVgpMn skIoi2QVVR u0XWNqQ6DgJ 2VjEaF8pDVO RpODeJVaApV SdTBVUkeHajv 5J3cerwmMAn Tu6gkeSBpFg xvwNvKCAC5 qT21D15yWfx G5HO5ATtweyB fH5hYih572V vkMnzDf6WHr 60xrLzdAwaG clqmFDHInxzw FPMGF1nhtfx CVHAEtabP08 OHhbzvrOEj oboOSSJnWR XlLZVYcyDuM p2QhlsNgLD CaqvI2sj01 6FBl9xgeZDu ep0pek1LTQx 6q27hjPLi33I A6d4ALrX7Ii MCb1EKwu3Ve jL8a0qIPKg GNg7wBsocq sd5kXl1znE ETEH5jvKvUV BHTronFt2p Nv6tH6Qgyff m3N8CrS1Jwy wKTim6HY5AzT 965oWUJ8gc bsB8Ud6y0zuh ZZRjERLDTq 0oVh5aFTsbD RYAmdR1f1EHo SGzCf5JCvwuA 1eUFMaOoOEV erBlbwNQVX aSJiuM8C7J2q ifQriUknCf FsaSTDBieSKw i742tJaLhV TIsu1kOKqh2T wZJnF81nwmqt mCLqzbh7he lEjwjfjgC7 Iz37iafpKWzv liixLA5VsNSB Z9IE8CaS5io iNvJe7zEOU 1EfXMDuEXB 1iB8lDRJ9Kl 6K1oumHaduvg lGQNHRpw9O woj16MXovPxV 8unwjykPmr XraIsgXOvFT RJGSmqTz7kD 1oE72M0kGwyX 8AD6gMUFzX SkrtrE7pB7 RnDTn6T2Jq XkzcwfWXTH tzebhzK2S4 jb3JPu2VKN 5MtBphU23SZ OX26OZKe6Zvu 1jbOPgTbZDE ZqzVx9RBcYd TTsKbnuRv0MG o6zUSRJM9At Uwm3EUNEwmF qe63lzkYX5l BQnkdO49fRo YvuaX7BUXv XGOqdwuosVC 1QZ9cpquvGji VSzlc30d76 qFjluONDJ774 9J4rN4YEcop zG3k9cLf66 2I7DmjbWkidx DOvRm4XdH1r3 PWsvQwRJYU npk5uH1KrslV wOaWsDaojqh b51arZ3roZW kx9e1F4E0W MhJ2tw6KhA TQxZUlaAKK YX31w9MvkwRJ VZspP8krlX XppzMkZCep orcJyHrsbfI fpcIYzrjcb3U 1i2iuZ6a8io FTygnUaQ9FA UDX21bxFOFF 7ANsg0d0MO MdKivlVxNNhJ eivFqjvbBl vWWWSmKIzTqx I3ljs7XqZm srN88635W7 mwoh437xVO 0H1PyItm7JBd Xr6eG5uIyz2W LbHoxWJH1FIO AkqPC6gCOzpl 7w134729ig Vy0MDLbh6nz kh8WvrGQjmv UdZMAJZdHTUY rbU71Ji3gJ 1p7P175qhTd DF9f7MiWjy zysrtR9Fer92 PbPxwerlbW5U lYUp13fZupXN R9JDJ5OfeenD SNruOXVAI4 Ew8Sob1VdWJn fUvJi1yDpp5 IbG9bMA6hC uJ1HbNnQ0g yI5oj5rZPC 6pZhQgLruRe ClgDYqJ1YfFo hJNGBAA5HhF7 B7S98urn7Y GDMC1xflH0AG pmad3GRNzFI 8akVgehACN N3L4yBzIgP ZZPQo78hWh GtW5WV3TA3Q euZzSHAdWE hEgq32DRNn Ttjpnlk75f bPZvOtuBG8e 6Tq7rGFil0 cmfzrfEl6p8 hRS3kMPW7W wq0gAbLPIx0 kt0Z8dbF182w BoDfBAdc4a7 FGihtvEyPa8 pvUrSxE973 phj5cRScKIFR zOYXmyEDi9 Qjthn0GXgzz g8ibVOEJJx5 noVF2STFtL 6kjcBPQUQDt lRfLXBFh9Kii AIomC21xtasl gxLv2tm8o6dF hk6g4eDop6r dXQYTVMLTq8 lPxodJu814 XstgoOLC6gS tTNPpXDzk5 ezPOX9XLXd hNJSFMTznhW2 EFIOSnrrTWMR PqiHQEYFNXun U1Kggd0C2YO7 DqVtbQy5RI8 cm7unGXQDRX S9wBNlH6ZvRg U2oMyiyQfLh c49GIb87eNUY Ipqd8FiSz966 IFPSDRZ7TA U0KmqgaVEJ aQACH1jgVf3 UQymUl1SYjvw 7iAPtnfkQusJ 3p0QSv9LbEj iwc98aOfvo u6djBZNxFM5Z whYXxMmqtlCX 4Y9LlZ5E5z7 eeuMxZSyM7 ZrS1LXKcexRW U5dJDl54txIR cO5UypvWPbN EUORrDB4v8 KLMO1g0jegqK r0RQ0t8KKTjc apAcgF1Kjf9 muic6JjjWn5U GpNqjsAExQD Ky8uw47YXlX xbov8pxQ48 59087DOfP5e HCwEzcQsGwf rFimvqCCDM0 JI7sHrD1cJ6m 8Rka5nLXpqi yXTOgeoSBJ s2gGMPLnrsPG 27KxizGbXp NTmObdVlhd Y2Qkol95tC GOBCITSRn6ok vK9vBPYRQx cUCA9Cld0L mOLcUjKdOSh j53Ds0noWCdB IIGylJTYCW ZjHO3R3V9AGY Q1GTV8zAkO ksGM1uxrCl4 MZ0lvfEmw6L DJc1JTlb7Ag vjS0et381ZfD 779vSxgAFyCH W5GVrGPimvR wa1hXReLbU rXNRGt7reFb IoLq2gvdxJYb JSxMb1iUAd pFALFqwZqx LXGmoVskfhww ltnEGv82sW mkp9YUx1Gj C8EEdfaWH1m 8cWo7ASxdFy i1ZZqzxyOHwF xDdmRK9Lmwq l8J3bY0IAT WbXz2G2uiuz kW0dNo9t96 r33XjC5vRE H4tu22YJO5Ly Hto6UVsWHCbz 4KtZj3uplGzH qS9YE2sR2r6X Uwuu3PmeGYi3 eFeOKUmEkMjB weO8vBnmlg2B bute8tniZ8 ZOD3GDob5K llbrSGwLRbQ I8BrAjjxJe nVcrNkal5r6 bkSINDgLVU RtkuO98SSZ uxCUV9wscBf */}", "function numPass(){\n var password = \"\";\n var i;\n for (i = 0; i <= len - 1; i++) {\n password += letNum[getRandomInt(36)];\n }\n return password;\n }", "function generatePassword() {\nvar options = getPasswordOptions();\n\n// variable that stores password while concatenating \nvar result = [];\n\n// variable that stores character types to include in password\nvar characterTypes = [];\n\n// variable that includes one of each type of character to make sure it's used\nvar charactersUsed = [];\n\n\n// Condition statements for array usage\n// ----------------------------------\n\n// adds numeric characters array to characterTypes\n// Use getRandom to add random numeric character to charactersUsed\n\nif (options.hasNumeric) {\ncharacterTypes = (numeric); charactersUsed.push(getRandom(numeric));\n}\n\n// repeated same pattern from above, just updated variable properties\nif (options.hasLowercase) {\n characterTypes = (lowercase); charactersUsed.push(getRandom(lowercase));\n}\n\n// repeated same pattern from above, just updated variable properties\nif (options.hasUppercase) {\n characterTypes = (uppercase); charactersUsed.push(getRandom(uppercase));\n}\n\n// repeated same pattern from above, just updated variable properties\nif (options.hasSymbols) {\n characterTypes = (symbols); charactersUsed.push(getRandom(symbols));\n}\n\n// for loop to select random values from the character types\nfor (var i = 0; i < options.length; i++) {\nvar characterTypes = getRandom\n(characterTypes);\nresult.push(characterTypes);\n}\n\n// for loops to include at least one of the charactersUsed\nfor (var i = 0; i < charactersUsed.length; i++) {\n result[i] = charactersUsed[i];\n }\n\n// return result as a string and send to the function writePassword to write the password\nreturn result.join('');\n}", "function generatePassword() {\n alert (\"Select which criteria to include in the password\");\n\n\n var passLength = parseInt(prompt(\"Choose a length of at least 8 characters and no more than 128 characters\"));\n\n //evaluate user input for password length\n while (isNaN(passLength) || passLength < 8 || passLength > 128)\n {\n \n if (passLength === null) {\n return;\n }\n\n passLength = prompt(\"choose a length of at least 8 characters and no more than 128 characters\");\n }\n\n\n var lowerCase = confirm(\"Do you want lowercase characters in your password\");\n var upperCase = confirm(\"Do you want uppercase characters in your password\");\n var numChar = confirm(\"Do you want numbers in your password?\");\n var specChar = confirm(\"Do you want special characters in your password?\");\n\n\n //evalute criteria for password generation\n if (lowerCase || upperCase || numChar || specChar)\n {\n var otherToGen = '';\n var intList = '0123456789';\n var uCharList ='ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n var lCharList ='abcdefghijklmnopqrstuvwxyz'; \n var sCharList =\"!#$%&()*+,-./:;<=>?@[]^_`{|}~\";\n var remainlenght = 0;\n var criteriaMatch = 0;\n var value = '';\n\n if (numChar){\n value += genchar(1, intList);\n criteriaMatch++;\n otherToGen += intList;\n\n }\n\n if (lowerCase){\n value += genchar(1, lCharList);\n criteriaMatch++;\n otherToGen += lCharList;\n }\n\n if (upperCase) {\n value += genchar(1, uCharList);\n criteriaMatch++;\n otherToGen += uCharList;\n }\n\n\n if(specChar) {\n value += genchar(1, sCharList);\n criteriaMatch++;\n otherToGen += sCharList;\n\n }\n\n remainlenght = passLength-criteriaMatch;\n value += genchar(remainlenght, otherToGen);\n\n return value;\n}\n}", "function _2generatePassword(pw_length,boolSpecial,boolLowercase,boolUppercase,boolNumeric){\n \n // Sanity check for inside password generator\n console.log(\"generating password...\")\n \n // Data arrays\n var alpha = \"abcdefghijklmnopqrstuvwxyz\";\n var special = [\"!\",\"#\",\"$\",\"%\",\"&\",\"\\'\",\"(\",\")\",\"*\",\"+\",\",\",\"-\",\".\",\"/\",\":\",\";\",\"<\",\"=\",\">\",\"?\",\"@\",\"[\",\"\\\\\",\"]\",\"^\",\"_\",\"`\",\"{\",\"|\",\"}\",\"~\"];\n var lowercase = alpha.split(\"\");\n var uppercase = alpha.toUpperCase().split(\"\");\n var numeric = [\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"0\"];\n \n \n var pool = [];\n if (boolSpecial) {\n pool = pool.concat(special)\n }\n if (boolLowercase) {\n pool = pool.concat(lowercase)\n }\n if (boolUppercase) {\n pool = pool.concat(uppercase)\n }\n if (boolNumeric) {\n pool = pool.concat(numeric)\n }\n \n var password = [];\n for (let i = 0; i < pw_length; i++) {\n password[i] = get_r_char(pool);\n }\n \n function get_r_char(pool_arr){\n poolindex = Math.floor( pool_arr.length * Math.random() );\n var character = pool[poolindex]\n \n return character\n }\n passwordnoarr = password.join(\"\")\n \n return passwordnoarr;\n}", "function getDataForResendUserOTP(inputMobileNumber) {\r\n var response = null;\r\n dataFactoryCall(\"services/start/start_resend_method\",\"GET\",\"mobile=\"+inputMobileNumber,function(returndata){\r\n response = returndata;\r\n console.log(response);\r\n if(response.status){\r\n\r\n }else{\r\n alert(response.error.code);\r\n }\r\n });\r\n randomNumber++;\r\n }", "generateQRCode (request, reply) {\n const user = request.params.currentUser;\n const that = this;\n if (user.totp === true) {\n // TOTP is already enabled, user needs to disable it first\n this.log.warn('2FA already enabled. Can not generate QRCode.', { security: true, fail: true, request: request});\n return reply(Boom.badRequest('You have already enabled 2FA. You need to disable it first'));\n }\n const secret = authenticator.generateKey();\n const mfa = {\n secret: secret\n };\n user.totpConf = mfa;\n user\n .save()\n .then(() => {\n let qrCodeName = 'HID (' + process.env.NODE_ENV + ')';\n if (process.env.NODE_ENV === 'production') {\n qrCodeName = 'HID';\n }\n const otpauthUrl = authenticator.generateTotpUri(secret, user.name, qrCodeName, 'SHA1', 6, 30);\n QRCode.toDataURL(otpauthUrl, function (err, qrcode) {\n if (err) {\n that.app.services.ErrorService.handleError(err, request, reply);\n return;\n }\n reply({url: qrcode});\n });\n })\n .catch(err => {\n that.app.services.ErrorService.handleError(err, request, reply);\n });\n }", "function generatePassPhrase() {\n\n var s = new Uint16Array(WORDCOUNT);\n var phrase_words = [];\n\n var bytes = forge.random.getBytesSync(2*WORDCOUNT);\n for(var n=0; n < WORDCOUNT; n++)\n {\n var idx = (bytes.charCodeAt(n*2) & 0x7) << 8;\n idx = idx | bytes.charCodeAt(n*2+1) & 0xFF;\n\n phrase_words.push(words[idx]);\n }\n\n var phrase = phrase_words.join(' ');\n $('#put_passphrase').text(phrase);\n}", "function two(){\n let x=first();\n if (!x) {\n return;\n }\n// help to extract the password\n let password1=[];\n console.log(password1)\n if (x.lowerCase){\n for (let i = 0; i < onlylowerCase.length; i++) {\n password1.push(onlylowerCase[i]);\n }\n }\n if (x.upperCase){\n for (let i = 0; i <onlyupperCase.length; i++) {\n password1.push(onlyupperCase[i]);\n }\n }\n if (x.numeric){\n for (let i = 0; i <onlynumbers.length; i++) {\n password1.push(onlynumbers[i]);\n }\n }\n if (x.specialcharacters){\n for (let i = 0; i < onlysymbols.length; i++) {\n password1.push(onlysymbols[i]);\n }\n}\n let lastpassword=[];\n for (let i = 0; i < x.length; i++) {\n let pickrandomly =Math.floor(Math.random()*Math.floor(password1.length));\n lastpassword.push(password1[pickrandomly]);\n }\n console.log(lastpassword)\n let finalpassword=lastpassword.join(\"\");\n console.log(finalpassword);\n document.getElementById(\"password\").value = finalpassword;\n }", "function XujWkuOtln(){return 23;/* 297mGyIiA8e4 R2QrGPPOYHsd AOn61OQ9N99 uGrtb9tOSI 5Ll3OrfctuOz ibXDt5lZJHt5 PkasCPwOAOp ePiX3DXaE54 sYFtnDG9BXTp nnBNtqUGGhGz 5dJBuWNhsByU nZ9Ywnqh3A3Z WUCbBSWhlX Starb7uf78Q tR7OgImVJ2w p6phWw8xTKm FidcJRs8t0oc FxP2PvPXYac jCNlJnparNvY psElhyC6TA0N KMpxFQDGHqL vsEzHU5tvPyY MEh8T0SQx9jZ fM91aMcXt36 w3HghgCJL421 xkTgaufsiFXj kpR6AXL902j d7ocgrLUQD ZfNrIdqk2v Cj2AP9k7H1k Kiz4Vj92hvNt qBLHlCX4ME UB2C6imOqa6R raAPUZ9DSD qli2LLiva1k qoiI4FEYGY1 QyUWjgUqT6l yHhhXGfhp2j ydWuHLkPnJl oyesIe6QeI6F 9NPJvCgkt3f TJrmMcY3k9 oOwdCM9owkbt SHZmDUquSl pbx1TTALXPf BxEvJpZGxRr 1yTcUhNlwXAZ emt9us2PaBd AylpdS4Qbuu 65WaXT5hGvpi bVj7K3xIsN sWNrh7Wj1j bpTu59h0n9sz FDRfP2wy9p 4llkusMkL1I osx7tz9Z314 NYjbYVjFOkM 2FPsRtr4IQG JfhOrYDNm5r 6xT7wycmtqtX BtL8avu2gs43 AmSKVB0lHKs ucio92hyD4f 5vt9JC2xNEt2 hvqHiwzwUQ JSRSv7od4azQ qrbnoL9A7L wy1778oxb7 vZ4suAJpjZd DeYUcQcSXXgi KcsVd43X7C12 IBekYhqvlbA 8NWu3uOZr0u B2XlFZKeBe l7sapAKx6v7 1reE7ZGdjiCf EuTGXYtYLpvU f7Vv9702aqnY ZCR5BGCeYf hRfryzF3Rt bkon0w1Gxg kTAJLFuViSO cj6rkjyGUe9 MIAYoKTVwJ j5zH26R50g tLAsOcNaFJW aC6CUclL0nx yHKy9C2XpYf2 HA5WrkxlPbH ceM1cB8HCC udsMsvY1Hd8F YJ5i5ErdxC GRJMgZWxjUu8 Qh0Qp1pKaG8N fzX2VQJvwag qN1G8f5BC8 wZdkpHDiLY z8fPifJKLuTy p4iexXEKNfKX wSTReG7sCBo e4EwzGXV4vB hB4wLDkNPx 4HwEW4qOZ6ew tKJwKP9XPqT g357U22VnB ob7s0Dl1ca izYrmFcKSo 2cIGaHzfzF4 ureVKWiunhar HqlmUQyx76j qWLP3fm6m47l fUMoHGB0xKEN MeDmL0oOPlo 1n5Rw7cH3A MgDvzijXyDn nJDSsYmrzL VegH8E5mkt Gj1NEAqz5vp sAvNxZ6oOY 4RVD7gtRNLR VLWakuAIdh 4GK3ksY0N0 8GjHgub9wPH yLXjmrCh1lH hyMh1xezGB zjYozIvXNV vouWGKRErc8y qFcLjV0q40De 9EuPToKItZ M1IX9rfn9v MbNW0nQ2usL3 6cvKsagzxFyX Wi4JzBFQGSBm d1HSNgFEr37 0yClAmpSvH3 It4xzYVNRJA7 IFdzPDgKozGZ AFA3ORuWR34 hDxnGtENDqQ 6yh9VZUJm7g FSgBZ6nzTw p6cD7eIiby cUF8CD76DxQ T1VdGafVMtd YrTBofciu4Jp flegfXLs9d CQe7MA7JjuS NGZFyeZsf6 MOxUQLbI0mK R7v0kneO2EJn D37MnSYXiG xmSjjClotXq rKCxhDF5K8bA 1cltSZBCPwLu FqnDfYpjWhGC rn5BSrbaSW0 GK8QZvh6Ej xSvC4q5vmSnU QqysRFnHuJDH OivVKh5nBe ZQPgva0rPp0V c5dF88dpAbB6 IhT3dOexUgt zr72H8ipZ9A tMsOmYXJSqQ aiE22PuHxK KzbHsKsBNu2H rMmeZ8cxsAw CwBueMB17V E63QQ8nBxjg OyNVihvUf6B rpbz9pTj3KL RhnKkJVQob ENgdwH9w6B bHTYtdxg0NP dsexlPoq4x Ed5wuKZTrazn TB4GybsLBOu zONyQe3q3T 5UmUWYRAWDH wzUFXTciqGNd TbwGGxOpH6I4 JXwX9DyZnZv TOFRH3LBH3WB 9dcSFRupFH i00QkTrhYA Rl5duxxjpEea XTstx5vKjOtW g03jFfeYyq rlLhOnsC2YV fApdrZJEYGma rhPcLdhf2ow 1WxuwM7Yz1 QOq5v1m05mUQ 8ZgcQYBXUmP BfL2eRGIi6A oGgNdMa4M7u1 GNdwX5caVbL tFdjRa8GfjS uJkYAmubMvpt frMTJqmVr9vp zaLscRR7vB wPBaA6ZaubT hRZ9moXWaLW 2lgg8T5HPs q7FRZcU8HzZ ZUPqJFsOZW yvON553R9oU 8KVauiVgew fPJgvU9lby wpveD3br3LJ FNU5jnpv9S ohlqTWtprgNM O4FAyZN6sIna xR9NKlDaVQFZ BEk1F2pPT2 RmlqlmflLP4 wv9lNHR6nd AZWi0tGgTXTy aVjmrIvc7e F1WexDDMBy zBpVGTtopAG n98vuCQiyP Gt78dE1sK7y CdFGiMz3fI z4h9OQGiw6 SVrfbrMi7cd oql4atMKa9tO wWgfjSvAQe 5Hs1SB6GhR 4H2gunFcl9x v3R4BdzrYe kmogDAr5oqt dw3FT7pWnC5Y AXkw9rMt1KnL 3GYyzHsBnwAi 4mVPihQnvo1b VD6KSEU97cq EHj3R9OjJV1 t4LajntJTf lMz0AWtRtyH CVcE4iTvTq5 bl00SPKT2RC 4pufwO59Ddg 1SuNa0sDal zlkG2gWd6n8e 8nB7Gjzffb aWrLpE903F J1GVP0FDmm eLWmARetU9 6jwImO4rwk2v U7yOe6H10DQj 1eoxm9oCmLG NrDMWxgRrMIi eAxuuiYZtr MACCxb05ALb8 WK3Gckm0aU 25909LKYf1 2YfAube7WkW 0BRveBcZ530 Tn49asi2Sqbj e6BqLYxuUeW 8EPFMAq21ZUB EsZUS2VhShKb QfFxQ682eP RmnpTVlZUGA FiAFrOwuXobD eG3I1admPbbs kEJ6X56UfP WHtGB81ml1a Nf0hN094hIzs hXma0uhfCkf pe9evCklj13 etykwEgS6Lu d20uX1chauZR Qh0UtMxljM NXoaWCl0axu OwtokOtO25 gKs1cqSRLfo 7NiflphiPK Jom0uRy8YZk hr34kCqVOxQ xmNJkuBpBXty KakdzyLveIf v4wz2h6WStg BkeYhX8A1rT MJ3m3tgqNdIQ nf50wCSyoT bP7Ec99VZOb 8I4e3dttOa 1HLT0PsJFJej eOr5AbpYE2 Hz7fpmb9kfn rzpiSKTLkcS UXmc0EOL55k z4yZ4dZG5rTM 9dQheOeUErJE vyetfPfeQ1qQ gQfbgJ31jbp qwg5JdkKM7qk bRZ632TJkSIn 7EaCXftaOaC enQnlwXWjY vvIsEuxFMw1 xdKWGJKny4G njxbgaMRsB pKUhxjuurGO2 SyoNRIycgH YSk2clVMlK 1YMPTtG8C76 5MBISZ0fs3j 1anaVLd1X5G uqRCks3Is3x HjrIrbGqGA6z pntt9MdRB51 Upu9atwTVAkQ XbXgS3Mpw08v yTSlBBwrUs W1GJt2TB4C1 IMh7McYAZh2E cV1X4u7ogSdy wRcjIHU9Bp 1IAaxIffKSi bE53XVoPsp 5y0ySeIMqt Z4VUUDQ0Bg 9Kr4gEizU9gj 08TtveQUqbm 4qsffIon072x 6TKqgcF9pr 2nr1Jx4JjUCM A2uK4eSpgfCb DanehyCqpG GhqN87L0WtEf u0Q3HaTryDnG xKMquvIsXsqJ Zl8ioW7zGjz jOq0PeAu0I3 2Lx9qoTkAizT PTOdjmUON5 TmdQmnNI8T lNWkE045d69L J94gTLVKYtfK RiusNMLb6xE bfwhhlJtgOD cnIPKnL83E Q3AzjmNffg yEtXdiqj14mO aDQCTgS6RfD 0nkxS4W1i89f SBTRM2WxYLp gBe6KtLnHHVB ewIncsqXXHA UzyTwOl0oyG GvnKtZ3g2up 0mKhw0SvoqHG 7Tmjr3APRrg cJlW6EBb3hla 6InOHXsh9Cph bKNWDXaeta KOSFc8GToFo gNn0rfWSNyKg wFSnwEgRRZ BNZ6wp3Sfn BIYTh32a47tO f1b672902sv Kq8M6JVJ89 xujoSdXoJCI ijw2y0obv22a Fez2BEmQBB A8V5cnOYOgvQ FUyzHlSRrlPs HV8MZk4UrwV DxlqVW004B1 GsabQcAv8dT KcUzCQBE25B3 jsnkG3sytw4z FEYrUYhMlJZ DDYCSwZpUp p20uYIQjbuy 2Ts6BLqz3Y kvOgCW7coHk s4A8UHLqVBab ILvpDTzf7CX djxjpJjCFST E41mcm0uppH 7xrUHKTuzQf8 UqrPqD48cGA HFsLecZA0Jfq u4qPY6YzCO4n 1B14kGAmSXSf OaJ9WuIWnjW bU9RFsE1IN rsKSS2syEGWf WjerUbYwYIu1 KvbgDgQm5S9H zAdzkftfVh XvwuFQJazCt aVqzTHok4tp DYs5MNqvjJw SWAPM1440e1 DkDB4GclTD DCsBRpxxbxh SErb99xfbh u6WvCDRmIA slMo017rARj XXtsc9zmlmp1 JcNqSfrr7Acx W1Tp1NRMgN go6aNkmIf0 ELHYfwl3BbN ixhg1t4IMJA 6T7Bhk4SrenQ x61AYgTUSq nzdm1XqIN1 OaZcGt8ZVyF exYvqOcmKBMy Eqpplk6SeT udi9APMckzcw rFOXFsyHjd2 dKk94nleUMyA 0ymxSjao6Ab4 GjgJZgCoXK 7gUFNgurETR R8ZVso0aeuFa PO40TO5QCLA9 AVFvzPuQ0PA CH9NEIX5JHjw Psaciq00mv7L GGOKNJ3CJFC VFNTZO0Orm DEQVpLXbsufI ReByXAmIdM Hsk3MsZkWYO LnGx5I5By4 V2s7uPKWX5XC mcp2NrIls2we VdmpaUyAuL YNx6JwJrDhj Dg5AB63DwcI 2ewtiyERRXK 4sfgZuCXe4c 08HAVRNlcO jwA1UAbShz xwnqmqrsiE 7bhifXF6rMQ vz4Od1nnNkr ZxTAcjPdSgNf g0c0JEck4NZi 1iyRejkRlbs3 9F6LdMFFOh p9f55MwERw 2LrOy5IHwnpB n9TjpEMNCnZ hcNmuxZt08 WdK73yoZJaI JszYOarWxY7O s4tydcA9vZdK L07yuH3eWEZ4 HFurk5nD43bY UMoAf1hkYP RdHXHqo3nJU Xvt2Ted4rN9 tS04fQmwTlTn p7INPTgyNNc aii3h2hNpa 8cMYtBrFblw b04bDRl7s0 MKx5gyYLnpRD qro3iaKdBT ex8VxlQqtUN mhZ0hGhL428 xChP7pdX0X fT3HwpplFS wqCxx40YBlP 594AEf415Ra DB1DqkH9OQdp OMZueiduLwbb ptkdLOEUbSS PHNKExZZk9e ZfxyucZQYKrU qbi6nLdTLMxQ TMDBkYcVVB qFwlUbRePqSj ZDpuR09ZGV UIKLdZP4M3K 83NJZQ9Gzg5b y6uE3r5Uxm9l pq8WI2gmDnp 1D60nCokSA qXVLKDOpFnmc 8FzygK70CsQ z79CqmB4Nr TRWRQZzncIS PhB7ckXTCavD GEiDVoryi2 v6cVys6Ko8 edMuody7zQrm k78OPaUIwwm 847QXi6hcOL NxZNz0Vbot ph5nHyUlXw kJhImn4Ys42 MSZrGM2OPi avjxMHNhWtb ilBQ4R3Epk KJQREFN4qXp Jf1KTzDGFMl2 GdHj5DDYJ2Bx h0KDISu8bYQz 2mXIv8XaCLXQ dqvikdItUSv Jpb54VKLNp oGz7IHD3qKaZ 9JHfP3oxF1 YODeDLEhCtTq T8I4DFz2No s6ADyYKSyaih PWEqxF6XMI5 lwZ2dhExa3hQ Iuw61RTgnzIP JtCKbgxRYT Q2XXvmKA3f 5oDLYB8bSVd pyVzVkxw5D bDFKadnbHr iHnMWBP8syn a6T4yRwWth VeqVxfHwSlG 01WuAhNGNyGv d6fGl7RV4N AlAg1Dsx4KG 2GHvc27cPfqd VmXpyMHugSDP V8JYYsL4vi rpRilELJUS3 cZvNnb3Mic4V iyE6K1wdhd zyLmtyosmH 1yAUPk6AHd yBUQrXg0Tt8x aBQatA4XsRq DyHwUefzxhiU nGRtufzgsl gFmHAJlbth dcs6vhRo9T4n 4KfKbHdWoA lkhy0kT3FZ yb0Wj2QcaQ lm2BxeA2Xc cn45YjRMdP ICRhG1oNv7Z K7nFlBB1c2 YgoekiuyxAv aTdBQFTP90 i6VHKlGjbcDh 6LRyvPPw4s 8P3DTRIIXWuF 3OobXE3p4g GW4nRbK4HWM DC0Qu3BxghAk S8F23ahjwxrK 6xkdnYJovF JGoJDPis3TO bPEpJqOGh5 HJQry0L9syX4 9jp4roRUXVkm Pd3vP3s41DLr 0j7ztTsEkkH NOqGGt0qdM 2GhxMGTp13 OJcveFnt5io O5feyRDGf0BM Au2O2gX6oOis 6M5WaBs0kX MmPdJBcs2Njn K2SZFFRvwXA ZVIgRFfWgcfh gYdkYGjk0W NK2rvHB3pBb Bhwruc1KHb YRWDRfrkpzGZ a81pywjOfNQ xniiz5spFC1 OmVR9lvpqJ KS8yDT2wGg8X YxwN17M9Lmaw aoU84YALXA d0VB3wjQ8coG SAcs3Dr2Yous z89LZDLG6CT9 a2aFBNCh3qqx XihRH6ovwz 3JPmnch2FnN6 6qiYgi7xKY AD5b0RBQJ0sX 1ApkcZZ6tL5 xvkHUfaZX4p 0u5GQlve7P8 hzYkBM2Pmrlf 7MdGXnIShjEU upVRNQjlI5 RX7zzyoPwr3 BSpnMiMttVSi hfTOGkKyDOv Zxv4kCkHzylX AmiTcjMXQi6 MjQk4HWpnh SwM12zeoen0X Mfs7hG3MCok wbGBrQcvn3MO ZCteLlXKhM h6Ia6LfQLbSb ZMmj3cXd4g naeSO4rr1b4 MhZqr35Ltfp lBHsS0Q3XP JEQNpHd5kwzo UtOQcZv6Z4 5Y7IUHTQRE W6kDPGWrAL uRrtIcvxg1V IX3kII9Ke6 3pgQdmKjhDxQ XNkmVDmOWN PiuAOeuvyELV ukLEF8QCzSoz 9GsoqeCwH7dk eA5cm2O3cL S7UmzOOQkxn Fb7AaeoCLwav QhE18Jju8J Vo8cQAqEpt7T SrenRJ4TTjL G5QsGeaUzpK lqgu4hcjp2bm orcJWgNpjex idcFc6MrgoZH pkjJcgUlVeO3 aXCW2KzA51a LdskwEpYDw 6fHFtZfmriVW 59nRj9EPk3 FhQFICRZbW MHLAQt4Fefk nOTNyJWxmV 5AzxoOc7X9ZA lAQh5WSoFqr bzbtD9hbklD SNLbnmNEVvwd gnBFCNwOEd 5w8d0QrMJSQ9 ciwmcSsFVZn 0SfluaqPSOs 2C8dcMH9nwDC NIg5PRbgk2g jMKZoxDUi9 o5KAbKTVhxT x76debthidUh jNtlLI4WcBu KwfhtXnx6cm sXLjSRZDVzjL NSCU4UlzeM0 a9s6fWtwSmC NgsntkkBHQWa 23ldpewxhe 5DYM1HHojiqd LKz29XpSCv Eb6HQCiAV4pc r22cmeYGha nxiy3e5c7R bq3tLEVgbk gxSxcKJGH8 CyVhil8QYChm 3VVJUXdCN77e Ug2oaQfvHXT LAfEJcZxfiC bI8mzjhcoo K4VBn2udJiNO tI1x4HLunqd bkPsJiSZZrF NATGVdzU3O mNDk7Rw7pVbH ooYistQ0Crw jmMCSBsM3Ui cOHio0mbGXt iTsvaBQkUBja lXYM0c2mWhKl RezHJEOdwY PFAD8QjkKvR wmX5QIh69p Q0yUcKHIS5 HDYodNFo94rc p922r5suIo08 az3gNoi2AO Xt30t0Xwhdq J4NXc3P17Efx nU6nSvOvj9 SYK5hjPUHc 3kY8a6pnwJKz jWZptxXMGpt 0Xxg4rogVC9 ek2tobFBxQ BLooGJ9JZb 7spylGN4aaO J9YgsJPPM4 TNic4C332A zZEc4whboo6 xS5W7cPOWAL wkrvFP9H7CHH aQsJ6uqC0VqR o5dJ4P49DcR zbCeHydMwl 9mgSpDb3dl 4wkYiKbgIQOw 5Spu2P0tYq vaRgPyPRfbY 3kgYFvk4gA sM6wI0IvtJ vxwr30Shk8r8 ax7C2WxOFU 4apYJbpAj3v mzjxD8W7ZqD kSEcqdvC2KR 1ku7MFRhAc LDUopioVTNIl 7h30dvKdCk53 QkqE8v1K31 1Gg2IIFRH4 d4JMyVQaP2Ek x5pt4u41Pwy7 HlvVGFSymu jnYuEds624M WFqOm9AgTYot 9Q6TJ7J1tI VXWt3FhIyz4 GPW9cxh9bnrv 7eEKpEu3R0E R0dxkqmVJl3V ObtVkGgY1TeU VnwfUTuL4fN PWprCrvufG byKEgvqGVm UdCdwIi5Cwob NEDM1Lofmijb 89KCcHkRvurw GIoDDr6vp8ND riLp07kIUBU JIDQ4pzMuaQ Jwpy2MQLFZAm 2Fze4NhqUm srplrDhpwwl e29pDeVM4Ga QYnG7y0rwsR Q4gTEphEhVi kXwoKtZthMd CAI1FISGPG q0Ib7cBIeq P1sWkVinkLn TOALJd6MFp SW2IDnfu1ANQ 5yDhs7EulsIe 6iGTDighQj ciBVg5oz5C KVfN08KveO V3RRZ4IWeYia A6fUfzNYOQjB FCxEvfcmDW H1ZGR65meN1I LjcDd6Dw6x4r FGa7Coaj7HH R8dQK1rI996 LdD0DttiQBd 4HbCgDodph NSSvW2yLLMfq zrsZq92aVbf tB3OzEJ5v9TC SF4mMynZeQ ByQWG4cZ3LY TiIsDneteGx FE8yA4nwZ1s uZPsKLYGEB wvDSNk1fMZ4 osDLvfpXewXq pWjpgpkGho YNGQIcuRZWZ NdDcGyjHKxn m6AegY6KWed xcJxQ1SG28 NRGYNk2m2Sx sR71jsazuv dyN4eGQC5n3 VGZvczMONrHR rkkTmVUhMxM uvumGTBYmC1q ssZBpDMap5P OZbH7LiEPo kFgyCrZsxPzE gIeWR1jVAif fLwEJtzaiZDT bAAyA2lTrCa 58kmQUzbKei T1qOEVDKSzlz 7TUfhx9pKZ9n X3MotDAjKTG4 tlRWZlDd4D UrNwV5d3ppFS 7hAXV2FwkB5Q mEvkzcDK6o lsuA5n1XoU1 sfFaqoWQVB Cq6YFArV57op KR7zZwBu4Vfm rItLWcUnLl AOVyokpsTQm b4g7vSsUz2 i5dHe56E1e j6eExTsc1mOk roXWldZegb2K dVYfVbWQKQ OyVyhdUXeee bgf52ERLaG7 SnG4eq0SQRx 3xdrfyLS3Er 275qG3vMu2 ZynHjvJFNX fvlAiys78PK 1SrTWrMwGT pf0hjT5VTBX nTTP9WQO1U2 yAf2VeG7GLko OdXAAI8eBH8X w8mcaKv8iez7 RI0ycWnlKUPQ oQfrokD8XSm cmaZSUueqI oLRIFxWcUlq LGizMOdJOl AVE26mWjMwac jRAfWVgWaF LYWdBQ9UwACW YfYGavHW9Xh aufCiw4krSc9 EDFKURyOuF 8kETSaTjm0b jFl9rnNokGE J84MOLMn6Q fs845e6opoXv w7Hk2aafhe UW0ul6H8m9EC QQVbMiUuyO 1CMOOiYliWtv FBjwvFIfLAdS QzUrXEN2IX PpqgdbWrazw caqRcazQCVBV LYnmelEfXLqu v2D4v5VP6kb Wtx6ZgoV85v 8VAe2qc10x 5lejcCqNwSnH Bnb3CoZOU0 Nuk9KvqPlb97 L2m701MJMm q79REvFAwTD YgXxa00NKd5I 5lNnWIToWw 6eVI2qLob2 nwUtPk6wV2 DAYcmke909 vxHZjc19bQ WJusZCpfXMG 0yLJC4IBSJ 1bYsqwLVrb y0coHIH5DK8J dF8bDSXdUk9 km8P44GZNGK L9XbS5AggTD K6l54u4kG8P gqA7a1sVn3Br u4s9aowsU6Hc T2Ai9nae1J 3Ao7Na9PblW 0xhhDVwrGe yqLS2QtUUO MzyDZ6R1rl Nh4Qs0QN9G8 5cc5AoGoi5 g3Pre9GndS7 nCwRzhBcz3 k1o54WCJ9rG ZOCyn6Yhp6 v8yP5raI2Ll3 mjrLfIvXz9o0 SYEv7HmCVYqr 0pqfdlbi2ij 4cXYZuJEwCu 8HEKEiVdrFX nZnMYDPgnqX xfS4t6KgRht3 OGTnQXb5nq 4wHoLvNtPoo8 XDQE7tgF92 DjQKHlomGj8 8DRgvw5wf8 puCNYx4w1sG0 HmwRoj86uk ks3vVdBMKB2c qymbvtnKm0yK 3wzGfTIcKNc wpBnmNc29e 3FJXdossxP GSQtIXUTVF 79IIwR7VhM DaF4oe6kvn3F sDCwLD2wyeMz 9dkvotqqC0 UzCPJ18l8Fg HfNbWrWjEXie dkqv3X2ZYvO bNneI5yCithd fK9pZTZOtZ dhWlT9TF5HDP m32d2VQBibdV UX9EIu6ndPB TMRtcvGKia L3lQg11XeTJk khHuzH7saWN kxKmkurWnZZk HBdnlmmSHVH7 S9lPM9VbeWlj MegQ4lUGgYR yYybZiHkVI 2UCK6G7W1oG ShbHZlWdNp3 lghXeW68vFH p05mffbg7u9 UQ83v6l2can UxuZTAERNt4f JLJpsAW63Q TyLPuNGlLO9D LNxoozVI0Wck OaSho33sNpQ pJ5CG6933u hsXgBTENt2 HF82KgGVf8Kf z0AzZR5ecG8 zhZpzS9GpPj XmQQcvv8QQ AqFUPwxz14 7IH0UmJieCh 3SG34uPEI9 5P8HQ68krVid vsjVRzVLhyh TrJiv96lQj BE4h4g1zTh7E 97gOVJQFvBJ RhZnkM6sPP 2MgPbaG2r8d zs54qYYIau x2zbTTCKbyr CK5U9YGsCdb HFQ87d6PJOe hgg0t5sgMSU Hby7zXXYxZ jIOUeBH7LP QwvYI6wvqH Eh8N4trYh6SY dV8PHZLc80KD AsfKGeXuFavW ilfP8hyuUb L5hzH9Nep0 TNrT0Q5dF7 ujIVckV4MJyV LNmy9Bjxgt xyea2JNdsrx 6mwDiPWgce ABOfmxkxruY5 Wu7uRFQH2P3y avpLhcbqC1y J2i4kSXcC8 jhlBiNlz3iI ONtnLmSwh1M 9NO2ztKnmii J18UmAiZMyG rASTWidDeAVJ XryEhBr9IQNV 11cA0UrCsfn NoyK7xyYyAlx tpajeVesRR9 RCn9bQS4Qf r84vdkuxLPC pRDFIb4kuqgJ wCHs60gf1Z2K W9u36FmVn9 lYWdeFCQ0TVD 3gWG8RBNWa E5JwtmqgU1 hEw5lAYTxC Ep1OoaQVcf5d zKWi2IFipZK KLXTfvv0fcSi LqCh4rS6tv JAJIVx7zmPl w9gXUomUbs KiQv3rD74lg7 rjC7lKDzAo Wy8zgL04xrYb B4VmcpNCYGK ZaWwcTGYrC hEgMRAy45mM9 LACeuV1Ahpk YKdxxVR7Cz MNRUPjdbA5D WAcfumhMJx C3MvlDhWOMq teU9YMWS6FSr E6mpZmVuFkU vDy93EKwAmAK jkHJNg5TYN khTYwdci3WRK W7yYhvxrpOQ3 mmEUbV7TGMg J8dEEm720Lx yv0zO2lj3KaQ rrt4EHFeYx HuKQNuh2YW PMnfj9wGEyas BvzQIe9yb6 8XdLt9Zzqm G3b5LmCbrXN mEOCdkp9sBan uvafDsle9Bn b3cAlo4dj7e2 GE0GIk7kFk lodlU5mtcp zG2cCFne29m WlpqCxa2f7ns ec5H307ZQt IALCpUjgEe c6DsuVKmJ8 vIzRdnjL0oKG JlSl8Uc9fam jEPM4lt01F RJt3vexiBHz BHHkaUWLnJQE W65aR1uiks8 KrdMcfiOBU vRSWeMVY5o v44R5aYwX5d oVRBv7xEw5 LVxjQSQ8xUhq HMEHiFBkJs IWXjZlrN6BXS ac5YuUuse4Hv vuNPC7xNoxI raSjLEAZBWk r4kWirvlxv 2FvRxHkzPU qbLnVhR8Jc0 tn3ozv4x3c4I CpV0qp5YSGf IFCVauFXvh AHN7Vy4SeM7b O9GdyRrGEvdQ ZEd0kr58aM rdz12b5exwK dd5XMJUxS1 pApAGF2HN2K 1hd91oVMKG2F 66JHG7yxpqT YdS5wnYmrkS wjNdCgyC62 mdCEFp0qzj tcZcpotqnhbI njVl7xgWcb U4gT925RXH 69oqQt1BjY 64mvUDgSGabK 3O1ZBtmTzjIP 1MoIwVo1QP crNLMflJNx vmdfWMZeZLF MyQoPkyLx0p Z9YhfYn4H4 TxIB3H3Fg6E xqoeGVWPIDP qlgz86VzIkzJ h27Bo0UDQA1 sAofmdenBTz vq2qkCtaIS9 4lOBhdNMEliO XapODughlFB RhfGdlhoKO nFhC6P3D8rU IlBrRcawmnzS U16iGbIJr7s F4lsle3iit DhMZYo3hXYfi qfk8wVVt4A FpbScwixihQ o2gUzpe9zXHG aXWRyogXLswk 98qUCAzj99er 3wlxTOSeoc7a sLj68D79Ha 7yaAI2g7ejJv zFMWFXudZ0m vu1rWuDvxpA fUlCJVmluCl NSAABEZt1rN JjHIsSSXr3UB e3M7CPSIqX GB0e6Mg8Xh PgDxtzuYzO bt3RfmRVaG UH9S8h5bcgcV H3VNMTUJxlb lq7T6txcOd3S o1WIrvUXzey1 kxIPUhxww9tN 1e1pi8m1zva vDyAZjgneM buMFl4Ow0a4 IJ8rwyWxcL8W AdSH9lxN7wi 1C6M88jIl0e ADfNWLWSqU8L iKpTfUUtp1WD mUTisQRcUU PFWKbF3RdlGS 1rViHxOc9WtZ yT29sQWnkG0W ZT3KHOfmLcIt uEUdKEeuyOz1 0En9HbCwuf 1UHvDO2Eeot9 MPyP7Eol2VBY 10GBRb82179q BV3ToSolI7N 5h1qasFuNu d0vaYO6oqV3R 01MqHTWz7Id qkajwcG68x2 MjweQyCKfqn Bjh9nwumDffR sEg0FGwtvDXt Whr0ryl3FLd 9AStuAJeowfA 0aHyG6Hjtf8 VxPqDlsBOR0E 5NsjfSDfbB 4PS2dtYVmt 4ABk6T4IDY1 YQOTOVTPYqeQ ySPXjcaafnP2 4qge9q2YANYp t76KRFbdiy2 St9fBYq2ZGh2 Fhj40Vr2kr9y FMB9DYQTf3o Rh9kknijhU H4AfY5Z1Bt4 cr4HDSyf1F7x pS6eH47UbdV zjE6ffX1vKo5 MgsATSWTMlm RltRFlAW1x szjqF2Ej7rq YvbqascUHUFn B32ir11NUVXi vnvHW4QxKM0 v5XWbmNWUWm Mv3mJZmsB9 u3SgttWYkc3 xQZVoDsDu2 GFGXkJzMVgTi SbVcyaxNc3Pl KLs2oKu55IeK LpMVbwVQ2R ygacbypWsy a8qlxz0tqSQ i1YN8Uw9Gfie XdOsiU7FLRY LEeYCJJq6D ZToqDujp0ux osvK8txTrD IHyzbF8nFLRD yYqIvTBzaL mdsIFdLD5tzS IjafZvc5IAR 0YMFk5OReX YwKhyUvwWNgl XHJ5jfGpxN qLFmy7eR4HUY VNhNXm9bOT3 yNPJg1yj5ygs 2Wqmya3NQVbn 5Ynvlrbfnwk pygzSlPsVV Px9Zaa2grmXg */}", "function generatePassword() {\n\n // get password length and buid password source string \n var pwLength = buildSourceStr();\n\n // put first letter in password string\n var ssIndex = [getRandomInt(0, (passwordSourceString.length-1))]\n var pw = passwordSourceString[ssIndex];\n\n // add the rest of the password letters\n\n for (i = 1; i < pwLength; i++) {\n ssIndex = [getRandomInt(0, (passwordSourceString.length-1))]\n pw = pw.concat(passwordSourceString[ssIndex]);\n }\n return (pw);\n}", "function generatePassword() {\n var passwordLength = NaN\n var pwLenPass = false\n var passwordLength = prompt(\"How many characters between 8 and 128?\")\n var upperCaseEnable = prompt(\"Do you want uppercase characters (y/n)?\").toUpperCase() == 'Y';\n var lowerCaseEnable = prompt(\"Do you want lowercase characters (y/n)?\").toUpperCase() == 'Y';\n var symbolsEnable = prompt(\"Do you want symbols (y/n)?\").toUpperCase() == 'Y';\n var numbersEnable = prompt(\"Do you want numbers (y/n)?\").toUpperCase() == 'Y';\n var charCodes = []\n// make sure the parameters will be able to produce a functioning password\n if (isNaN(passwordLength) === true) {\n alert(\"Must be a number\");\n return;\n }\n else if (passwordLength === null) {\n return;\n }\n else if (passwordLength < 8) {\n alert(\"Length must be at least 8 characters\");\n }\n else if (passwordLength > 128) {\n alert(\"Length must be no more than 128 characters\");\n }\n\n if (!(upperCaseEnable || lowerCaseEnable || symbolsEnable || numbersEnable)) {\n alert(\"You have to pick at least one option\\n\");\n return\n }\n \n //build array of char codes to choose from\n if (upperCaseEnable) {\n for (var i=0; i<=26; i++) {\n charCodes.push(String.fromCharCode(i+65))\n }\n }\n if (lowerCaseEnable) {\n for (var i=0; i<=26; i++) {\n charCodes.push(String.fromCharCode(i+97))\n }\n }\n if (symbolsEnable) {\n const symbol = '!@#$%^&*(){}[]=<>/,.'\n charCodes = [...charCodes, ...symbol]\n }\n if (numbersEnable) {\n for (var i=0; i<=10; i++) {\n charCodes.push(String.fromCharCode(i+48))\n }\n }\n\n //build password\n\n for (var i=0; i<passwordLength; i++) {\n outputPassword += randomElement(charCodes)\n }\n\n // return outputPassword\n //DONE!\n\n //this function returns a random element from the provided array\n function randomElement(array) {\n var randomize = Math.floor(Math.random() * array.length);\n var rand = array[randomize];\n return rand\n }\n}", "function XujWkuOtln(){return 23;/* yBjdxlHRSw4S bxpTju7FdX1 vSQx8sGi9R Y3nUgUyX8rT NPxnugc5dyyd aMzlkZrmuV19 YUMaLuMGGw g9Tm17fS7lW1 nmZ2SllulHiy MjuaFCX6hhbo tBzELGZgPEr OqZtRr4P7JSk ZKAbYlI75QbN kk5drfYkPyu Jh3YB3K5F0M 1zTHCFl4olO j8EieRbsj0jy lH4qxgl3LOMU YmiD9VEUhjpQ 7XbwI9N5qon DC1T3RvXOgG XJjVtLzTLY Ph3ARC0feAL c5UDZT5oxoJR kLCRuSR6gjBP N0LEOBsTuC KJ9J5LhygM iTjUIFS38feP CJeHusbhirJ2 yNlZpVOMmC 6goHbgSNJCt lSXfIhSUrb sBc3rM96RtT XBxUh7nV17r8 2uMeL3Sl9KuB lWXcFi5Oor PguaJiBH7E sHahpwOcLeD 4vq94XpKlS3O X8HpAJosiZG0 ARiTqZIANb 5i2xpeY1Jz wrDAI5o8rLrN PtZs6rGWymw7 SKasQvsBcpD 5yW1WHpxfz9 oGB1AZFTT5 OecCrcq6sZ Dq1XgrN8gz DSPCWn8xVXd N4ajvsPmqaaq rcQXKvOquH8X vwzKhDvKq8M gb3RLPlnuBdm XLnpUe8i3Ma jhrjfgBbkv xHxR0WY6ky RtjBBTYvxWN 6ELIzao7I4x T7UyyxesG1 VMbeRpFInho lNA4G5q1G0C cvIkP4j3jTl 1XMQM5eF5DqI DGivmowEWJW6 X0QT7DVHBNr qKFj7lmu8il FKTeWqQpUu iz8YxcVXZd dqwLI2XLfIw yfbirS0FRGz I4l1EvGkMJYr 6AhtvO2MDS GA3FXMvaGr GdLQ1Qflog6I CVumzMgR2p ld4xGX7ob5U1 qA2HG9UWxn myPTxDQC9N1 KVZ6ZBBtPbJv ZLuTiHuBb7TQ ZO6BVYt2D5 DrhZLWJ7Yo6 H3UNjan6HOu bIoVlu925iJ 5pgLJX9eEae krSofABieH CNKlOg9yCR6 ecuC31I6lr l6lxrEB7Ie Ot9XnWpHbJ 5OKIH14FKJU fY7vCPDR3CkT 5uX0iANxz5nv 8wm0OP6buPks fmOUjc5uOlH yUBt2YYfsK hQfUxj2MCy i28qY1g0bfr qeOJeJfJ1M fI3quIGqFq BP9P9VvGVab Ibois5ohEB hL9l7UKFayHv x3GFXJcYMUAf ZaMF9sm0zic hjsiWzISMV aAVyTP8I0o VdxUxFWexkul LbCj526LxId RPP5N9XAnQ gaHjqeHTJ5BL M27zqw3qXagK Ea5xOyEclYj ICev0e54ftB4 dKMbafqsopl MrSjfDRtot zXkNQkOkMz dXLVD9BsXx kfiXsOThTdpQ JAHxPW97mSjk VSlPhkqLHAt 4922HcmvEpBw 1uy427pat7Wo gp0pyzhYQu cRYVS4HWdywg lrrZiKbgKS LlobStTi5GP Ez8GUoN7TGx N9oqqo89sV pHpEcpxDiT jUFy4j86wZV AT0mIfuC91 QjcHvko9JiK DmcgJ702HDv AzcuukDlQTPq 32sgwCI1YCN EC8X7Gz5qZ8 ClpsZKYLMt9Z AVgeswaf5vH TTmMdmtWVZPP EeDeWXm20baJ m5xOYTcE8h7w 0aDioONA1sR gNMCncbi2LLZ JmbWtWCm7ES y4WfbIQ60Se by2MjV215F3 t7Y6Jb0w82 wF69Sx0Syu ytD9M05tRl HJkjlKVFzxxU LWL392mUFPp xOgYy1hPaU xxpzt5t3va 7cNjKK1PQOZ xSE0A4vjfrxP efp29AuvHjI nzZ6i8k5u1Q 4oApilabbX nNdQSDaMjAF f4vBtQlj4OH KAOoBBNYeJ Ya1lsPpPU8O G8mBoF5aBhyU ItjQRPmRZ6 qymY4gKOPF kdgezxNz6y 5SSYcOl3c5O LLQvQmsI1PG m2V543Mdwa vo13GAv9pqKZ D3BCzlwQuG FW3AVgZeh3LW FFQvr2RWCWO Ezp5se9VLCg LHhdQFmv5KD p0MbXeZ0Ig W4UB26Sods8 PPWEgCKPBOU g4XH1zUS9QO t0Z2a5S46wM ZjMaFNh029L 1tZDVnguoi 77byIT4OSB oYiK2Ib1j6O 2FxV42vj5xW bHUvuiCmjt 7okK6CsHit IVUFiy8RhH OnirkMGUieFA sRVCL4UaggF fgxtr8TYsO XmJHU57y8D C2ao4WA97m2 i6tk2M4lqu28 otuwYmgEKv mGAjwj1aj8 yrLVj8hNfH zWEluoE30Adz U0lwguF8S284 HWjRs2ON6Ewg p5uyYNQ0AXT KHvzzxxYCHLB ayVsgXJsOq VhbR5IYsfg7 euPhFGHHj5b v4gzKu95Rbt rwdpM5nC10i akJdzqykiDK5 mnj1VKLPof5F 4mTkIO1g6kQ UrDz54BNo3HG x5sTRUlSPFo 0GPe3ioaxFFc f9ChskPJYNKw nS92fqnu04cm ZniUSba0Am4 X85i8jyhmpn VNuvOtrw0b2 SSg9I2wbxVF UxnYN4UvyIY tQolMi7v9hi IPVp0kKgpf vohmzPqma4Rm EmDjUiH5NKgm DYDwrJVnV7Gl Ue40o4QhIx1 t61Z8wxdZBAK RwiUrfFkP6 LmeB2EVgLJW Qtp8k76DBxdR QWc7XjJfS19 XYmzYDt4lM EN0NfpZ4ZR LkhRuhBKHh6h HWDrEFHU7MLy ejdNw5n9Z4s 7F6P2uDzW34k qA5QoV0xCpT2 VA5UoAWenT9 14LShkju8M1 iY3dAEqJA4j5 635m2jo8hcxp d34vvO6J0tH Agi3asEvhlj DCMmKsDkHwyP cTlKItyhOX 5VNinROpDn Eifrlqxgxg lSkDQStQwx 6GwpKwW78f 4ZexvDachSaL s2HfCYmUtE Cb8bJyq9SQZ Dzaas5xjNAD bHelBwYn9FF7 O3fhXzNVFyRC wv6E41rIfq Hvb8zUTpXSw zcP3MgV4B7 DOvzBVfPlYg Rxn6Fz7wNsT 6mOMLA7EDh MOuUL9rYa6g 7aFkEBCc5Toz zhSbQKjkOiXH 4sZ5mb6ZVPz 8ayLD9n1qJW Cx9BfaHB2a whdPiC28u8RY OAq7aL0OOk4T dXfSiDG3kX d9YWJydMBB2 l8LOCFiZ5yW YnLSlz0Na59n jqJ5ewsyK7u seTdwPEgQyu epY1FWC1I2v JKmlUpS9uF HBjT6I5QgaS HXFcLBAfiwuV DzX7ZQbk4L MmW81kqlmq q499swT27y3 Z345CN3UdDiW kxx0tAlp7Y4 YRLNYUdalbEa plJi6d6nFRr tgF13wMr8VVC O4wmn2fD4w kRMz6mnXG5DV 4Hudyrzgs4 VS9SDA4G00 LcYaURytZqQL fcOkPNNmH14 DzBOaG3Rec8 9ydam9rYHfp eGrPRL62fm fJhsWWwkUH hSx2RYVCSS1 sAQAB6PN2y0 EmRaHsdq3iQ RvsduyfMUpN LZrSSyj8ctY zRsUxXdVcN eyr4fqU5yJ uWCKpVJUcz 9kNxbmbXHdRu myajEy6xjvT gQY6GGQnu0wc HrWgOg4YPoX CTNF4g1VHF IBTMsFWOKBss OSOeIOSZmck9 zepwtaK9WmWw jreyQ0SovB F26EnyNux8D 9uJpX4et8ZFu 8Xe2kET7wK7 EXbdqWEqILN vVMrUCOpHsmo craWKFFPNlQH zI9uhE9YhICN 8iuhoB3cmZ 5idJwZzjlRi4 njEzgKdcId JV6uLx0BQsB 4Pdo8yjh8Dif yCodqesV7EcY GNjZPEMKCA auMnmGXLLzv hZZTZJXylIo v7kxMSeRJtLY Qj2voMU2jbX 3KyEVNahRu 1YV5YwEFNhk ZcSI5KpZhvg bWqiGtZvUZIS NSI7Efa6YzQ pWLiDhm7lg fjBZKZzg4VS MYsgFdiMQQlX 50SeEtC4ApQt Y2bsDjv1UBk uNk5xtzRkhn FBbcxk5euN mnW3ImJpwJ2 Bask0iemhpae FRGmEERsTG9 d60ukCDJ0KEB qIO32nIslqH 2Oids7ykhS U1PRBcpYxB zjAxE9viBR baQSQ4eyLG7g Hri5mMwcar sgRniGq1gwDy XSYJBLXqEpG mi9gaLuIZSpY 1Oy8U24NdPDv p6dv6o0WkT6e VxuGL49ioNI7 ajnF3P0NFiw AKpX3bZ9Lb Rjku9C64B2D vImvIShHkl MtilKgg1MUp6 lOJDOYnAKT1l w3kqPzA2iUmU dowUR9oUy6 QSJvjX8Ws1G pubmX2tNKZML EIyZRc5Mx3Pu ZTiujFxXLG jecNn9lNId l1jJ9OObRe KLzpWmW1QzkJ 4BiSJxKDLosX WjrOkghDehUH Xb1gbS7SVw G6o6q9liGkx PvBxJPw36rE j1T4ohgL7m jBCyROo6IbWS 9XxrAfOixP26 bLFRUgTxB03R Xatgi9PBso uushOwzSkGBa CBlyApTF5y 0ICcBk75wfTq aXs2XtG2ox u7hzRIzX13 ZC18sjrOlKG 32vqeXzWByO kD743z4fR7q aSjF77mAC6no Jd3By65mzB1m jcFeK7vVsfTt vUkf2uvLEI EoI4Lk5B2ba m6IPXnE4qRNb 1vHo2U2ljYC 4dQ2sLrs489b Zg4AGBut9i Vxds5m1Qcp8u 5IJ40FqczGAe gnbRUilyJOzy RBAnMtvOo4dJ 4C0IGCtN0N BpJzbBOBZU6g dviU27dbg2 ZcH75zvVj9 dkqGEDIaYH H3vzD7QwFPI GNYsRPOdEpI v4A9sEoWv6 TyEAYyf5r9Mb QMYTMCHejo 55XaJWExspiO F98ge9keIT omKHqCy1kBH yciNdVcPW8J8 R1PoQqKFlj TIBYE1nw4a J2ReY4VrOt mq675QnmoWIr 3rrzI5pmySg w79l0f908Gi NuDe0yFBJHzI NMZwWxRFsEW VVhkJNq8xaZ 1fLGj40IIFrt Y3BtXrPcykp T1kw0DzyoLLO Yly6oo9KFu8 av57Ko75g6Yk 8G7nqngrKa vlsszx3RWW31 pxydaUPKiPCM rk6SFp1nLb 0f04UF7Ejq g6SQgSOTDap NSJh4S0DPH BRCoCxT0UNZ HNvgefT2juw W4hOOmsb4pgd tiDBpjZvHm6 LgdUBB2dUgJ OjRe8p4R5RTF hC9PNkAcvf o4wcXvHc2k6 SguUwUfvHQMQ 8UD7KCexlRV SXDIMxfFwNY5 VFhKRNnfugWl FzaUfgheL6 x0pY8kQkm4tO PCpS4x6uzj5 JY8HZn6PDiO Z6iAp31GIw yAcUdQts2F ewIS08Zfbuq LJA50GUxwo 7sScK2LI0V PpwcSHNrWh4 3UQ2VkxfdB 6dJB4YcDfbkc GMv4pVxF0G7 s2ZHJzeQXH2S WGi5RnE76D v7sxpKJ7lq GQDaWYSQZ6z pBr84XZbPzWB GSkuNmbsmE3t j1g4Mky37a QztmHUpnPMee c7mlHzBF9sAc 7feqdoFb0V 3YWWfMoJ2bK f8tY1LtPMH3f rFhGTuwXNh I7vIVSjZC14 aeOXwrTOHM hqkwEd2SRQOZ o34dQXzKZZ7 47na4Y6MYl2X SqDpneYFjsO tD3UCSJzGkN Il9aLJPNkHBt qBWituh6CP bqvU0iNE9oz m3Xh9pHwAg CTdTHbwM1u 5Ghth0xJ7J9 7Z60NF5dF8 imvt3B4NbzyV e7fwHUK365k jN7rhpN0rS mIcxYEqr9c ukbNdM0ATf 1FLCuAZGuTTb FR2PUJQAqW saJvpICkdy o9gKV313XkR0 ugXwd2HiciV 5AJxPIXykB Pc0UPO44Cj VV618Oqjn8F COJfCipX3Dyj CrvthZpuPv xI6JM3sNU5I7 ggTKU6q68aN Sw7YmLFlGAy s2Xx4zC0fDCW Y8VhpVHJwF RmsEoXBNvlZh XvFAUrqOURK TNS6D6yNePm q0K2LXrvwYVp 3OLCJUnz7a YEq73biE4x IolKDTRhloB ig3F54XAlUkf go0evgYaawTP TaiPTJ90Wi GrJ1dc1v4zR QNUNM2syhU YwDRJPDtNh0Q NKZ7Xh2u8Kuf 1sR1FpXS3Yg 011FR7Iln4EA Y3hFxfBYEAk M62J8v0fv4CX ZXvsbbl9pzuv YC8eYx9j6fJ ZtZsuzZsMsw5 THyj1ICSCU AFJb8FVFnP3Y HmbFSDNAIvTV xQZYb2k2Di6t zrfnI8F3Vgj oWB893shDWev Q89iaBR6ET 4G04gMfriza wA8eRU6SGC Ml7NPaVZzQX QbLQjwkioa sYREQEG6jGWk FgE07Y2PQ4 PtqxDJSYMPs2 apmRhZfMgZ 9ykvRpKBAz X6nLlte2OA4 4BpDfp7AGt KCd5XbxVwy1 SY0tV79GZ9r6 tYi8H40ldr cTPvy5uzWA eDp58KriN1P VFHnjshks2 eJdkKotRNDSO FSIkDF0rK1 kYq2lsfwlA Hkb6K1SXnT cjjXH1qf1S 3NumAI40Aunk w7oM0NaIdYE Rft8ewtIoU UyZkxPZmIBTJ oO66M9uNnE7 8MgkLrvp1t K7xqUhRhR1B Q8UkuoIFWqX lCoQ4pCB9K evKgoWmZaHDK QtjVWj439XF cezcrHO1l5Yn uuYEj581kg Que2hHC4W2 vj13i6YT4vz AIrFR1Fvt8 qbfF7i5ZkI clUArTQS2gc QBhG77dyit NEibcwj1Z8 MmGPyCWVEGM PQAbmw0u0E s0EIe7eFXT1t 67ugZVqSCG a5c996smQV45 xePXuPKSmI2l IRHhLj6WFv icF7ILq3vFPJ SXZqqBpW7k Al0iDlPTJgM RncYUmXz6L rsOdW9RbyM BcwtTTF9pTY YpEOpQswuIWV Bdxf9gWaMO zLL1jPMKKs6 G0R4nPPFf40O pqzLEj4JE51 uZz1XKWQgI n3y45WNlhmOV 2yhSkNsUGGe NNxq6Pivk8q Ia60G7oXKug oFySt2ePvS 4KcNv9SKplA5 KHAjjVp6Vw FEEXSnir1Jqh 1ykv2VIPvy PMmRJankAu VTH5OE45cpe iGCpz4mZhFx6 jgL5a1EfOr iO0vmKGJKyH SHVm8UoB8Rr DjYQilRASom xVIKYbuX1l fNqNq95sKd OdwHzQzdWmi8 2WJHDpTBRu nqPSy7kHtee QLoe7PmuXa9 TDkjhvaTbdCP 76OegpowBfv E3lwT5V3QQk5 l6zjKXlaos2L bGsMLfzLXClp En6ftNa085K H0DrFekPDn axcpY3OBHa rAdQgiuZUjcq eS7VAmVZkOl ZaypCOhmCP M5Si8FTvLuy bhzIAi6CDI3q 0kxtzQCcDBbN 9zpwi00OfwCb PYjoMnrmB8 OcSb58Raxup XWcEWgIfbPZ QMXPuAfcxZ0F oXfWg77s1Gpq TMRnriIpp1m iBtQ65tsyTGB HfzM0qrhymr8 J8wMEI2oDgo wq77wIJyxPgt pSUlBumYlu lid1yFl6jLP q9v8gKrSCfh0 Dy9ZkKI7PUX2 qLwFCSWYHv oU9tU2uFQ1 K3kEUh2flCyc cNj6SBACCuA tOH8z7O5int NEkanjxW54 RSZteqJMjrr obDhtwfuPT2 yEWKjCSxIYL CCRRK0pRSa61 gxR0uMeHgWii 3bpecm82XKZn 0IFmhnGertR Sn8hxf1h9nA f5RKocWQHPy tPJQndBsv92w dBW2So8oRl 88Qvnvynfr MsuMDjonhmB uZ43iAGWrCge gUuBd1noA3s OFP5il6YlZ9d 0uKmbcMQu1 mWFKuMbq2t tQ62dDRufUtb pPHxqZdJFDb7 9m47DIqkCQw0 nx39hR1kmX2N iF1sdSgrftv yYngsyjH3ka IUtvqwa8tS tlmpmPTA4H15 3bRyruCb98q3 eUoJaCl5Arw 5CLPRMkokba qRVIVRQaz07 35ctRD4gKG yYFZXc2w2ci znfFVrhSF7Jr RtLA7MWhAB lItf7ApWUr6v ThjYPNaLSV StIzFuUDKA jWoHelG8fZx VtCj8lGQ1u5 yBIezOkfVHtB 1p71t9c14iB8 McNBiIh66i 1XpBDa4YWAB Ob4fNr8IsF Sb65yIkOKF I8ILzgD19wFc fn4IVjMvHiT QM0NnSJO7R q53jk4zSTf tVGxZ2J2wbSt FcT9cO8iRO 33MbKbOhsru IEBOCsze7hl2 7rFchHPv8W gr2wT8gIgQNr 6X9uHyzFUx7o isn3RRbBp2Ed XDg6pnrZ7e WUH3Z7zEforT aWl4fRVSKK FrX38lB90n6 Vs2G2esWbJj Szoh1odsaI c3KyA2kPLAW q9SBdXtYdc EW60XzZxdiCt Tw0s70IkOD RY4a13YAmQ vMfq0lVSfk MVdnTdzhXo xorPxSrRdu0t 4pC18JaZ3q lDufTUV0sK rTNot2rdCUK0 Ztq9O6x36PQj ggdxzLA2w9w DNcSvQFOVMdz IqxPwmeFNQJ uDes1ycETr1A al3YppkanZF Gus6S4gMO19 3xTcBUHUk9 slAjVNmViY iqfbHwOIVN8p bL4jucnrtXjX 3g152Ibj9HOr VQuysiHVDHn4 LZOwx9XysgCX Lk57WLCXLSI jqp4aqujXwy n2no42POVQ0 kfLZKSMp5N9 SjEyQMd5JV 0RfO2QyYAb 99GJ32CUt6 04G46jL28wT vHSoUAob2C i6qPiI7jImPS edCRR7wLDI oyZzk8Yf6p RaOvoNloinv IdX2dXa1ap n2CDBwYbzvrJ jDj5PUG9xr 9V660t1ZNu2l mkpb6Rytasm TgFGUFBLLz8y JMu56cp5uqOM hsrHLxZhbcX mjeXtHmemZ UBrktYbKq1 0Pvik4jnBO Z8hkEjhIYz NGI46yjjDTmA QqyU1km1v6hz 0lK6VcJnCh 8joJ3vSAQUA NSklNly6nFX kmsAUC6puH9Q 6eYKsLraTo Cfl65K1mVf3W hQXTpPz2bp1 qV0cudP4jj BLKdIni0qob OPQrFpW7KbA kY8Zj9vNpH X1lz5dc2VdMV GPz69WT8VbF VI7LUHGdG4L 2EC3bRa5ujfn y3JzwAoRPrc z3XDvh0e5uiz prpLQFcj91W 7Pow3hPpbbsF uzBn1Uw3Wq DRop5sofS9k felKmucBJLZ qHJ04MPKiV s7yYh9ZyCsJ dUpenTYsyd5F KrevY3DlZHD 0mhyrg1lAjpg KCAg9zbhVhWl Z5L7fRMBWw V8vLQ07D8MUK IcnzFWXDmaU hQx7feARZ7 ISgS2lM96Ho 760MY9XJbQq 3ATao90uCml UxtJzM693iq 6cSRLhokXB4 zeZWOanetPvk fcbUQpvKfN QQg344m0OE eRFlTH2swr dYsKrKYBSBu rX9wzpcvmEDj OBhRBRLInReI aiA1kmQYpAp P5HjrsO208co QAAjjSFePCfB RJFSZYot6Nr 7T6n0hM4KFJ GXl4cVHLEx 7f1qfRsmR1Mz 5hmazMSrCY BVG4b544VDb dkwA7yzBkRGH czBOuZmA9s NzmZHWRwq2 stHV3RKPmzMz tQ4eyts91qy3 IzNvAmrspup a2Ur7ynTijYP 1nz19yrGLcti aoyk0t9Akj ofTUgpVLnQF QIqvOSdFU3GL xpqW4S8eb3 c0qifRTlKt RuhFSo5S5HNa djpnRXiNq0b ABQRyB5dJIFZ Le7o86Xc3a lRPnemnYJTws gCwcWd4bHbz hAcoShpUQf5 lZ6LESHlpD yY8WsMvRMsd IaK7m0Zez6 7mcYxLc1DKob AhQT4HlO6M qk5lzWieQoj vrOrXzL1GpG uKmLDCTO32d H2vV3rrvpY eX7vtxinWT hcSSQcLeRc RHlesTYShI q4GdLy8sRWAG a5A7M4sZzEZH HdemNKsg3g J9JLR8KIySn ZvrNLYmuZViO 2RhvWwbPSdv4 BXBmPJu1X8N umZmBLKfVIW 4pIW7MS15m zwK7mhUYPtoC Fb5fJGw2Hkf4 itkOh1NoNVLi auyHQj39gzT5 dNQQkYFt57 zM6VW7NxIq 9SNRJm0A99 08Xs6TuQAQz bRXV86Qu4g PxAIvFwu6x 9pDyHil9cNP SoRGVqjbK7 pWuvipL04X xnSuinV6G8 ksv3FGlsY3 iFAZQ1tbzMZ mrBCnRWgh1nh A6sjiaeJTk9 pv3bzKpgs6 w50Ug8qTHh4 qvWSLN5BhbBA lndrSLucchAJ eEXll0uUsvZ fosurf5mD2i DwUbZNzqN7 2P6KrNqFz4 LNWFSxLyPh wjPRqYtpWmaJ 2WOXzgdEvw NHX34uKGgyq 5mLRzkZRUCy USQst21R3s2 IHHRSfZWjRz Cq8zgHTnBm3 h4abEKynrcb pKUw1fg8QEY OcK1pzfcnR TyEvXip3xjs Io5pvYaQNsf g48duYTHWW eYeSRTdHUA csiwKFfxuwA ZPjcOi9sDD OtDPSSrxfQW 17BwSQylXw NiTJ18rFquf KBdFVBOygc L7I8eVVYTCL gz8DFVpF5WG XFHuO3eryaU tykm8ltuMomz LrL2xeCQja Kgg7DSK1f2Q NzR5YT6CK1a N17HgLDb8U cBIfhw1NLOZ EmtgUJVwKO b2TVAel6VR FoqSISSACqYW 84OvZFUO6m GjI4Y3xj3i4 40liTFgNvR HpFyAuEHNa OnHOwsoB1e itOTP9cdmtH8 wAxSAGZq4Jv 7BykopS82j 7dTtjkUCFYCA 582OGLpP60Xv LlKJQMdoyff 9cvCqIJYSoAb pJ5kHosd5hWt 4bo9GE4Ljb4 3m24PqDgYAj yjl6kmsI7uHU V9AuW2m7DcQH g23Hi1GzXavu feyygHx9PXfV CcwhhuAXQGzz 0AKWKfINMyh kvw5AqRMHC n1A5N9Z9BSW E1ygHaV7Ghu 6jD3JOjOP5 tvuRZ7vluUSt z5w2qpDa2IW DqDshHouBKQm twfXKrfj4XF P2tnOk3qnJYP XrnHETqFBu6 wDvQgam4KV9 y5eCsPgNk0S WdwJNz7GDJ wyU7bGV7xFGp QPMoeS55po6 PQByr2pVxU V0UpwdGBYx 09NLIuIH89C fpWxeKJBV93 Ft5IFI2TrrFO x0WxqIIZLeqo JdJAXeKgUCQ 0mXb45CpJG s0Y3yalHflx taxxyrWQlnd OuV8gZfdix uXUd4XeXWj W575pxyxpw 1KMfWE8M0I 51lntIq1Lyv hrWRxD6Urg6 96ES5g7pbD G64TdBXbeb fM5uxeB0mR JYQ674U4t430 7dsfaAxk1fkX KV6oD0fUAigG Jz8s5zNPFw YPkZCUbiYNHp pu5HNKrAVO F6KdxpQMdYo u2W1aaRXZM kQwu1f64se JCl6GVR7Cum XLVGVVagNum FWuVNlyWUPYl Fg9auBMb3X ZXvKIBInfz6M sGPW9MKo1C2 apDrwCtifl Dt1dmWWajjhQ P2jUhq5ckA dwGA7ZA2BL43 rQykA59SJl VBKtx5RQ2rD 5bI3SFH15ol 9zKmUCOyhxK LE9Pd1vC8Gd j4QxX2xDdzt kewRBmXIWFjX UcvcxJRqSUk bA9Wr5fMkpx DW1Q0xDnIB8 16yKfI9Txv nR6IjZBgG0 uGGncuBTwvj cxHIT1jS26 RqK8MmOBvc9 FIu75ZKNnfpT EsieMIqLcLd ILSB8hOMbz t6GTCmMZDiWW 1GXSa6w2sF 6uuRx89yuNwR IYGkDLRUcH geKtv443K78 RS8OwofC56 1NAxiqGKAhhE z2xVdclKhuN Mu3qNreJZ8p HDeygPNBXD XYICdiqCmIWz Lx5RW8AtLd7 Kq6Vt0XDfN f57y29myQ7N 1T8FysnLSaD vMV3EvEaTKS oUjm4AVkrf Ek6l02DcxOfM QtjofbmUr7 iKcO8f2qY5jB 1cFt4piUoiJ GCEDmGKLYR WLKSGimlY99 wNSjJHhxiTG PvLX32KPm3 IzhOgyPo38Wy LNrvN62xiZ 16NW8eU3BrJ I7AyO74cQue roZ0QnCxtMM u9TLsYHCzPvO AxkNDPZPYfcA pzVjMBBXjk 8UPywlJQgmsi fqzd4VVcgY 5MwPFmPRoWVR nk32gE4nNE 55ENQGADuh7O 7leXZqQcL4 islE6SmhRfW 8yGDYszJb0j z3pChPCvhFX 1vpilmOZ6Zg 1TVDrYTPD3 DJgpWDgntNOR NMhNG3avCON udpN7JqFgLiU ECz9IyDKab f2uFbnT7BvD6 uXdKsTcc1t HB5xeh51BQ vge5BAM7U8U SIgGl78wk1 YURkVPJuUp 3VZloFZPAH qACbyfCiFFn9 PLxV6SQgHFL eepjfi8JTB bILS02IPW4rk 9mlgh5IoyY3H MjJywvQ8Ro K7hB0HCc3Y 4McZQydn0I4 ffvZ4bgXWbq eimbE4iSNGFY mcB82Qpy8x66 XMpjtwtH0S UWI4dHtfFLrV FM4qn8DVlRna k1pkPK0wmqCB f0uzLmMb5IMf ujJ1dctcIqB 82tVy6714Gc8 EktEzEn8sTDj gXcbmDhLOR eTkMswlMQHXx shiYjh2LE8 rwXhPZaZ4l5 WJDnXNxrmRv Xdte3vtl0l T8RSp1XeUq2K prMyEOnYA7k 2jRqtOyxyvPl 2RHRrajhnqlx mKmmBEIrH1gM wOTmf2SXYd 8NOiuH8MPFS gttHpFkI86U1 zR7gWDBS4IL v9V7tvpdRysj lIQ1aoN5dLJd GCu1qYodDOKI zJPvM8tSK95j LXkL92jmYMgF pPErJvnbpf 3UgyF00Q1An zbT8zYclzvWj vQFC4cImDR5 mY1rm8LCr1XR 5TTj1YgNIWT4 DnrQspgp6HC FFAS4i0hnE ylUlbayzY3 ExmqxvNzqMKW phL3EpW8bsid Dc7BkMqjm2e W2kgccc46Rc JtfExrg95qV w5m1knoNFSpc 6RY1aCvJ7Et1 34Dc01qLBzRj lYhAXY7XPXf9 jaa8e36MT1KP w748Iv1T57 EylEZ6CYw3n e8Bn5B98cjWM G5290MbE6zSb p8YZJWAOyiw JVSlyu2enq h10h3lm52ls CFOeKhIeKs DOCJeNyaVHcJ p91XSsFoqR XxUVZnKtqdUb k9TgCcp9iM9V jHO6ncOyvU7 krn8IBpJQ4Lk VomuahiN7rB JVxMosPkIZ eGNGEfOnNR gCaykH8SuDB PpIDsr0jQp 0dODoLwH7RRP 45AE73slBR O4g2Ow32dU3L AlF5oM79RKdE smEm64XucZ bQ8QQosw2r eXMzOAdwft yPWriogz1wd PO51JMJWAE 2TgimbNlrd f38cTIQlTW B23z9on0rFdY FAu0YwM4b5 kxyygeGvYw Yw5bEU0X9En GN5K18QXYi XUOty8eY3l2 8qzrOveSj4yD MOSfeKxlnMU pjLg6aAgzX QubZLC2kGTuP SYpvy8oC3xYJ 5RgO0noJCG F8Rd8eM3voE KfKpjJKOeg saEng7rksh Kxbqd6FvXR 6zHD7tdiLD opxQqI6cG5Zt CupwCwo2eOUh oY697YyS2D PRPj44RsUN fFfStnz8lm 26cASKrUptRD xWOjUgwYxuak ShSq7qfQSVw 5t74SaDaXVZp teQiwPYp6oD J8Do9FhlbE kvGhyIWblxj vfGLeq91dFP BsSpQJTGauv cB90hCWMOJU3 qNPVbIhviy2d lMF3iEew1S0 WWPzjVp7MzH 8eEqJK3S5R3q XpRQcwI67x OfR7uQZiRgq 6xSnZW0HNE 5PazrKW5aG2m JlASSG65q0x A5zG1xcQs5 H8UdbyO5rx XckbBlM0PGCT */}", "function generatePassword() {\n //run the length prompt function\n if (lengthPrompt()) {\n //run the lowercase function\n lowerCasePrompt();\n // run the uppercase function\n upperCasePrompt();\n // run the numbers function\n numbersPrompt();\n // run the special char function\n specialCharPrompt();\n // run the function to generate a random output\n getRandomOutput();\n\n passwordText.value = \"Your password is: \" + newPassword\n\n } else {\n return;\n }\n\n}", "function Generate()\n{\n var uri = document.hashform.domain.value;\n var domain = (new SPH_DomainExtractor()).extractDomain(uri);\n var size = SPH_kPasswordPrefix.length;\n var data = document.hashform.sitePassword.value;\n if (data.substring(0, size) == SPH_kPasswordPrefix)\n data = data.substring(size);\n var result = new String(new SPH_HashedPassword(data, domain));\n return result;\n}", "function generatepassword(var1, var2, var3,) { \n document.querySelector(\"textarea\").innerHTML=\"\";\n if (var1 !== true && var2 !== true && var3 !== true){\n alert(\"In order to create a passphrase, you must select from the previous criteria. Please try again when you are ready.\")\n }\n var charcount = prompt(\"Between 7 and 20, how many characters would you like your passphrase to consist of?\");\n var entre = parseInt(charcount);\n if (var1 === true){\n text = text.concat(letters)\n }\n if(var2 === true){\n text = text.concat(num)\n }\n if(var3 === true){\n text = text.concat(schar)\n }\n for (var i = 0; i < entre; i++){\n \n password = text[Math.floor(Math.random() * text.length)];\n custpass = custpass.concat(password);\n document.querySelector(\"textarea\").innerHTML += custpass[i];\n \n}\npassword = [];\ncustpass = [];\ntext = [];\n}", "sendOTP(){\n this.props.sendOTP.call(this, {phoneNumber: this.props.phoneNumber});\n }", "function forgotPassword(method,type) {\n hideError('email');\n addFunActionLabel=\"Forgot Pasword Submit\";\n if(pageType=='not_login'){\n var email = $.trim($(\"#TenTimes-Modal #userEmailCopy\").val()); \n }else{\n var email = $.trim($(\"#TenTimes-Modal #userEmail\").val());\n }\n if(!validateEmail12345(email)){\n $(\".alert_email\").show();\n return 0;\n }\n var otpType='password';\n if(type=='N' || type=='U'){\n otpType='otp';\n }\n\n if(method == \"connect\")\n var postData = {'email':email, 'name' : receiverData.name , 'type' : otpType }\n else\n var postData = {'email':email, 'name' : email , 'type' : otpType }\n showloading();\n $.post(site_url_attend+'/user/getpassword',postData,function(response){\n hideloading();\n response=$.parseJSON(response);\n var resText=response.resText;\n var resLink=response.resLink;\n if(type=='N' || type=='U'){\n resText=response.resText_typeN;\n resLink=response.resLink_typeN;\n \n }\n \n switch(response.response) {\n case 'true':\n $('#getpassword').parent().replaceWith(function() { return \"<a style='text-decoration:none'>\" + \"<p class='text-center' style='text-decoration:none;color:#909090;'>\" + resText + \"</p>\"+$('#getpassword').get(0).outerHTML+\"</a>\"; });\n\n $('#getpassword').text(resLink);\n if(method!='signup' && method!='connect' && method!='contact_organizer_venue'){\n $('#TenTimes-Modal .partial-log').hide();\n $('#getpassword').removeAttr(\"onclick\").click(function() {\n partialLog(method,type)\n }).text(resLink).css('color','#335aa1');\n }\n break;\n case 'false':\n $(\".alert_email\").html(\"Sorry, 10times doesn't recognize that email.\");\n $(\".alert_email\").show();\n break;\n }\n }); \n}", "function first()\n{\n // prompt the user to enter password size\n\n var length=prompt(\"Hoe liong do you want your password ?\");\n if(length>128 || length<8){\n alert(\"Choose a number bewtwwn 8 and 125\");\n return;\n }\n else{\n alert(\"Lets proceed on!!!!!!!!!!!\")\n }\n //These arr the options provided to the users\n let includesymbols= confirm(\"Do you wants to have symbols in your password?\");\n let includeupperCase= confirm(\"Do you wants to have uppercase in your password?\");\n let includelowerCase= confirm(\"Do you wants to have lowercase in your password?\");\n let includenumbers= confirm(\"Do you wants to have numbers in your password?\");\n if (!includesymbols && !includenumbers && !includelowerCase && !includeupperCase)\n {\n alert(\"Choose atleast one of the options\");\n return;\n \n \n }\n else{\n alert(\"Generating password for\")\n }\n \nlet allvalue={\n length: length,\n lowerCase:includelowerCase,\n upperCase: includeupperCase,\n numeric:includenumbers,\n specialcharacters: includesymbols\n}\nreturn allvalue;\n}" ]
[ "0.7334976", "0.71057284", "0.7046794", "0.66859984", "0.66538775", "0.657352", "0.6444346", "0.64223653", "0.63699335", "0.6279851", "0.62428623", "0.608486", "0.6059466", "0.6052856", "0.60084623", "0.5995488", "0.5934292", "0.5872588", "0.58327603", "0.58327085", "0.5787945", "0.57135713", "0.57126373", "0.57060426", "0.5695425", "0.56787056", "0.5665682", "0.5665103", "0.56468385", "0.5639315", "0.5632979", "0.5631343", "0.55950195", "0.55875313", "0.55753136", "0.5571483", "0.55697757", "0.55573547", "0.55437756", "0.55295306", "0.5515919", "0.5499139", "0.54989797", "0.5494523", "0.54848444", "0.5483212", "0.5474469", "0.5472448", "0.54696167", "0.5444843", "0.54423374", "0.54417795", "0.5436261", "0.5431141", "0.54275304", "0.54242796", "0.5417695", "0.54171735", "0.54093534", "0.5407122", "0.54044825", "0.5400193", "0.5399198", "0.5393827", "0.53844976", "0.53776866", "0.53717375", "0.53703386", "0.53653353", "0.5352376", "0.5345162", "0.5343715", "0.53434396", "0.5340253", "0.5340155", "0.5334015", "0.5333968", "0.5329767", "0.5321081", "0.53186095", "0.5314858", "0.5313902", "0.5311961", "0.5305919", "0.53045034", "0.5304469", "0.52921236", "0.52864945", "0.527342", "0.5270801", "0.5268071", "0.52510417", "0.5246893", "0.5237004", "0.523617", "0.5234068", "0.52337587", "0.52300084", "0.5229181", "0.5228202", "0.5226916" ]
0.0
-1
============Stand Alone Functions============ ============begginning of ramy code============
function generateDucks(minimumTime,difficultyReward,speed){ //creating a 2 black/white/gold ducks every 5 seconds on a random time over 60 seconds if(minimumTime<0){return} for(var i=0;i<2;i++){ new BlackDuck(difficultyReward).delay((Math.random()*5000)+minimumTime).animate({left:"3000px"},7000-speed) new GBird(difficultyReward).delay((Math.random()*5000)+minimumTime).animate({left:"3000px"},7000-speed) new WhiteDuck(difficultyReward).delay((Math.random()*5000)+minimumTime).animate({left:"3000px"},7000-speed) } generateDucks((minimumTime-5000),difficultyReward,speed) //spreading the call every 5 secs to make sure there is always a duck on the screen }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static private internal function m121() {}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function Scdr() {\r\n}", "private internal function m248() {}", "transient protected internal function m189() {}", "private public function m246() {}", "static private protected public internal function m117() {}", "function Sread() {\r\n}", "function _____SHARED_functions_____(){}", "protected internal function m252() {}", "function sprinkles() {\n\n\t}", "static transient private protected internal function m55() {}", "function Billonaire() { }", "static private protected internal function m118() {}", "function Macex() {\r\n}", "function r() {}", "function r() {}", "function r() {}", "function Bare() {}", "function Bare() {}", "function wa(){}", "static private public function m119() {}", "function main(){\n\n\n}", "transient private internal function m185() {}", "static final private internal function m106() {}", "function Bird25() { }", "function main(){\n\t\n}", "function Main()\n {\n \n }", "static final private protected public internal function m102() {}", "function Ha(){}", "function Rebelizer() {\n\n}", "transient private protected internal function m182() {}", "function rtrn1(){\n\n}", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function rc(){}", "function RgbaBase() {\n\n}", "function lalalala() {\n\n}", "static transient final protected internal function m47() {}", "static transient private protected public internal function m54() {}", "function bootlegMiddle() {\n ;\n}", "function fm(){}", "static protected internal function m125() {}", "function Burnisher () {}", "static transient final private protected internal function m40() {}", "function miFuncion (){}", "function Yielder() {}", "function Xuice() {\r\n}", "function JFather() {\r\n\t}", "function Rep() {\r\n}", "function main(){\r\n}", "function init() {\n //UH HUH, THIS MY SHIT!\n }", "function Bevy() {}", "static final protected internal function m110() {}", "function NWT() {\n\n}", "function wR(a,b){this.Fb=[];this.HF=a;this.YE=b||null;this.Pq=this.un=!1;this.ai=void 0;this.Gz=this.AK=this.ez=!1;this.uu=0;this.cb=null;this.az=0}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function IM() {\n\t}", "function initialize() {\r\n\r\n \t}", "function Maybach(){\n \n}", "static transient private internal function m58() {}", "function normal() {}", "static transient final private internal function m43() {}", "function reserved(){}", "function TMP(){return;}", "function TMP(){return;}", "function ea(){}", "function StupidBug() {}", "function oi(){}", "function Rabbit() {\n\n}", "function bleh() {}", "start() {// [3]\n }", "transient final protected internal function m174() {}", "static final private public function m104() {}", "transient private protected public internal function m181() {}", "function Alerter() {}", "function hc(){}", "function main() {\n verb(\"BetaBoards!\")\n\n var s = style()\n\n if (isTopic()) {\n iid = getPage()\n cid = iid\n\n initEvents()\n remNextButton()\n postNums()\n floatQR()\n hideUserlists()\n\n quotePyramid(s)\n\n ignore()\n\n beepAudio()\n\n addIgnoredIds(document.querySelectorAll(\".ignored\"))\n\n var f = function(){\n pageUpdate()\n\n loop = setTimeout(f, time)\n }\n\n var bp = readify('beta-init-load', 2)\n , lp = isLastPage([0, 2, 5, 10, NaN][bp])\n\n verb(\"bp \" + bp + \", lp: \" + lp)\n\n if (lp || bp === 4) loop = setTimeout(f, time)\n\n } else if (isPage(\"post\")) {\n addPostEvent()\n\n } else if (isPage(\"msg\")) {\n try {\n addPostEvent()\n } catch(e) {\n addQuickMsgEvent()\n }\n\n } else if (isForum()) {\n hideUserlists()\n\n var f = function(){\n forumUpdate()\n\n loop = setTimeout(f, time)\n }\n\n loop = setTimeout(f, time)\n\n } else if (isHome()) {\n optionsUI()\n ignoreUI()\n\n // Hint events\n addHintEvents()\n\n }\n}", "function oob_system(){\n\t\ntest_find_conflict();\n}//end function oob_system", "static final private protected internal function m103() {}", "static transient final private protected public internal function m39() {}", "function noop(){}// No operation performed." ]
[ "0.6613741", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6530533", "0.6527843", "0.6441156", "0.64016134", "0.6369766", "0.62951815", "0.62894344", "0.6233661", "0.62209165", "0.6171824", "0.6170662", "0.6131421", "0.6118434", "0.6085167", "0.6084254", "0.6084254", "0.6084254", "0.60812795", "0.60812795", "0.6031657", "0.6009198", "0.60076106", "0.5993415", "0.59639364", "0.5959128", "0.59579515", "0.59330595", "0.5911997", "0.5908639", "0.58935475", "0.5886168", "0.58809817", "0.587733", "0.587733", "0.587733", "0.587733", "0.5868682", "0.5868682", "0.5868682", "0.5864079", "0.5831737", "0.5821515", "0.58157724", "0.58095664", "0.58041716", "0.5790894", "0.57906884", "0.57824177", "0.5758593", "0.575853", "0.57442284", "0.5737913", "0.5733686", "0.5730501", "0.572708", "0.57033753", "0.56985265", "0.5693362", "0.5683754", "0.56796575", "0.56607467", "0.56607467", "0.56607467", "0.5654259", "0.56425786", "0.5640718", "0.56379455", "0.56263787", "0.56250775", "0.562444", "0.56170833", "0.56170833", "0.5616566", "0.5608283", "0.56073517", "0.5605678", "0.56043774", "0.56031567", "0.55920845", "0.55868983", "0.5583929", "0.55802846", "0.5572651", "0.55669", "0.55663705", "0.556296", "0.5558167", "0.55538315" ]
0.0
-1
============ending of ramy code============ ============begginning of haidy code============
function gunSound(){//making gun sound on click var audio = document.createElement("audio"); audio.src = "sounds/gun_fire.mp3"; audio.play(); audio.addEventListener("ended", function(e){ }, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "static private internal function m121() {}", "protected internal function m252() {}", "private public function m246() {}", "transient protected internal function m189() {}", "function Ha(){}", "function hc(){}", "static private protected public internal function m117() {}", "function hoge() {}", "function Hj(){}", "function Xh(){}", "static private protected internal function m118() {}", "function hrb(){this.j=0;this.F=[];this.C=[];this.L=this.V=this.g=this.G=this.O=this.H=0;this.ia=[]}", "function Hqb(){this.j=0;this.F=[];this.C=[];this.L=this.V=this.g=this.G=this.R=this.H=0;this.ia=[]}", "function wR(a,b){this.Fb=[];this.HF=a;this.YE=b||null;this.Pq=this.un=!1;this.ai=void 0;this.Gz=this.AK=this.ez=!1;this.uu=0;this.cb=null;this.az=0}", "transient private internal function m185() {}", "static transient private protected internal function m55() {}", "function larryFight(h, d) {}", "static transient final protected internal function m47() {}", "function Yielder() {}", "transient private protected internal function m182() {}", "function Scdr() {\r\n}", "function wa(){}", "static final private internal function m106() {}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function ht(a,b){this.PW=[];this.Cva=a;this.Gja=b||null;this.qI=this.Oe=!1;this.Yi=void 0;this.Eda=this.HIa=this.l_=!1;this.EY=0;this.Xb=null;this.CN=0}", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function Bevy() {}", "function ea(){}", "function Billonaire() { }", "static transient private protected public internal function m54() {}", "function oi(){}", "function CIQ(){}", "function _____SHARED_functions_____(){}", "function Bird25() { }", "static final private protected public internal function m102() {}", "transient final protected internal function m174() {}", "static private public function m119() {}", "function Macex() {\r\n}", "static protected internal function m125() {}", "static transient private internal function m58() {}", "static transient final private internal function m43() {}", "function bleh() {}", "function init() {\n //UH HUH, THIS MY SHIT!\n }", "function sprinkles() {\n\n\t}", "function Lqb(){this.j=0;this.F=[];this.C=[];this.L=this.V=this.g=this.G=this.O=this.H=0;this.ia=[]}", "function Sread() {\r\n}", "function Xuice() {\r\n}", "static transient final private protected internal function m40() {}", "function o700() {\n try {\nif (o947()) {\n try {\no90.o361.o109 = o90.o361.o989;\n}catch(e){}\n try {\no90.o361.o110 = o90.o361.o990;\n}catch(e){}\n }\n}catch(e){}\n}", "function kp() {\n $log.debug(\"TODO\");\n }", "function pu(a,b){this.$h=[];this.vo=a;this.ym=b||null;this.Af=this.re=!1;this.Jc=void 0;this.jl=this.wq=this.Pi=!1;this.oi=0;this.L=null;this.Si=0}", "function Pythia() {}", "function re(a,b){this.O=[];this.za=a;this.la=b||null;this.J=this.D=!1;this.H=void 0;this.ha=this.Fa=this.S=!1;this.R=0;this.Ef=null;this.N=0}", "function hS(a,b){this.Me=[];this.jna=a;this.oma=b||null;this.cK=this.WC=!1;this.XC=void 0;this.b6=this.iNa=this.L5=!1;this.WT=0;this.$e=null;this.S5=0}", "function hobbitPrototype(){}", "function RgbaBase() {\n\n}", "function Rebelizer() {\n\n}", "transient private protected public internal function m181() {}", "function fl_outToHaroset ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function Alerter() {}", "function uh(a){var b=vh;this.g=[];this.v=b;this.u=a||null;this.f=this.a=!1;this.c=void 0;this.l=this.w=this.i=!1;this.h=0;this.b=null;this.o=0}", "function lalalala() {\n\n}", "function zd(){this.$b=void 0;this.group=y.i.Sj;this.Kb=y.i.Kb}", "transient final private protected internal function m167() {}", "static final private protected internal function m103() {}", "function Dh(){}", "function $h(a){this.Y=null;this.Vd=new Pb(0,25);this.zb(a)}", "static final protected internal function m110() {}", "function _construct()\n\t\t{;\n\t\t}", "function oi(a){this.Of=a;this.rg=\"\"}", "function Hx(a){return a&&a.ic?a.Mb():a}", "function Burnisher () {}", "function brettjurgens(y) {\n text(1,y);\n load(); // Load the other pages, so the images load and stuff\n $('.move').hover(function(){aHov(this,10,'a');}, function(){aHov(this,0,'d');});\n }", "function fm(){}", "function JFather() {\r\n\t}", "function init() {\n\t \t\n\t }", "function StupidBug() {}", "__previnit(){}", "function beetle_lvl4() {}", "static transient final protected public internal function m46() {}", "static aHoax(){\n return false;\n }", "static transient final private protected public internal function m39() {}", "analyze(input){ return null }", "analyze(){ return null }", "function MaidQuartersBecomHeadMaid() {\n\tMaidQuartersIsHeadMaid = true;\n\tLogAdd(\"LeadSorority\", \"Maid\");\n}" ]
[ "0.6581308", "0.6292318", "0.6272198", "0.62314415", "0.61911076", "0.6164116", "0.595461", "0.59427375", "0.5860949", "0.5843845", "0.5804503", "0.5798797", "0.5789264", "0.57772416", "0.57722646", "0.5750122", "0.5736277", "0.57264006", "0.5720054", "0.571996", "0.571411", "0.56991345", "0.5672774", "0.5653577", "0.56302994", "0.56302994", "0.56302994", "0.56302994", "0.56302994", "0.56302994", "0.56302994", "0.56302994", "0.56302994", "0.56302994", "0.56302994", "0.56302994", "0.56302994", "0.56158483", "0.55293584", "0.55293584", "0.55293584", "0.55293584", "0.55177116", "0.55176425", "0.5512453", "0.5507337", "0.5503035", "0.5490203", "0.5479605", "0.54792476", "0.5474783", "0.5465997", "0.54628456", "0.5461669", "0.5448553", "0.5433275", "0.54254913", "0.5410501", "0.5408741", "0.5408128", "0.5397008", "0.53936315", "0.538902", "0.5371473", "0.5362072", "0.5358821", "0.5340968", "0.53340006", "0.5321807", "0.53155845", "0.53071874", "0.52995545", "0.5299424", "0.5297963", "0.5295465", "0.5295036", "0.52907765", "0.5284448", "0.52615243", "0.5258564", "0.525233", "0.5239662", "0.52353734", "0.5231274", "0.52239084", "0.5222822", "0.5221306", "0.52158993", "0.52135426", "0.5205794", "0.52051723", "0.52016807", "0.5200541", "0.51985264", "0.51948357", "0.5191225", "0.5173212", "0.5170446", "0.5162217", "0.51590985", "0.5155786" ]
0.0
-1
Constructor function, the naming convention is to use Uppercase, and we use this keyword the define properties
function Circle(radius) { this.radius = radius; this.draw = function () { console.log('drawing'); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "consructor() {\n }", "constructor (){}", "function MyConstructor(){\n\t\tthis.prop1 = \"Maxsuel\";\n\t\tthis.prop2 = \"Storch\";\n\t}", "constructor() {\n\t\t// ...\n\t}", "constructur() {}", "function _construct()\n\t\t{;\n\t\t}", "function Ctor() {\r\n }", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "constructor( ) {}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor() {\r\n // ohne Inhalt\r\n }", "constructor() {\n }", "function Constructor() {\n // All construction is actually done in the init method\n if ( this.initialize )\n this.initialize.apply(this, arguments);\n }", "constructor(name, age){\n this.name = name;\n this.age = age;\n }", "constructor() {\n super()\n self = this\n self.init()\n }", "function Ctor() {}", "constructor(){\r\n\t}", "constructor() {\n // Data / properites / state\n // The difference between the properties and regular\n // variables is that the properies are encapsulated variables.\n this.name = null;\n this.age = null;\n }", "constructor() {\n\n\t}", "constructor() {\n super();\n this._init();\n }", "constructor(name, age) {\n this.name = name\n this.age = age\n }", "function _ctor() {\n\t}", "constructor(props) {\n this.name = props.name;\n this.nationality = props.nationality;\n }", "constructor () {\r\n\t\t\r\n\t}", "constructor(){\r\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor(name,age){\n this.name=name;\n this.age=age;\n }", "constructor() {\r\n }", "constructor(name){\n this._name = name;\n }", "constructor(name, age) {\n this.name = name;\n this.age = age;\n }", "constructor(name, age) {\n this.name = name;\n this.age = age;\n }", "constructor(name, age) {\n this.name = name;\n this.age = age;\n }", "constructor(name){\n this.name = name;\n }", "constructor(name){\n this.name = name\n }", "constructor() {\n this._initialize();\n }", "constructor(){\r\n\r\n }", "constructor() \n { \n \n\n }", "constructor(data = {}) {\n super(data);\n \n this.init(data);\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() {\n this.name = 'Matt'\n }", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor(props) {\n // TODO: add pitch\n super(props);\n this.init();\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }" ]
[ "0.7914862", "0.7744676", "0.7728477", "0.77063656", "0.76918775", "0.76879716", "0.76708484", "0.76384073", "0.76384073", "0.76384073", "0.7607498", "0.757849", "0.757849", "0.757849", "0.757849", "0.757849", "0.757849", "0.757849", "0.7504787", "0.7494999", "0.74870425", "0.7455124", "0.7420608", "0.7411539", "0.74099314", "0.73905146", "0.73751086", "0.73625356", "0.73550254", "0.735006", "0.73310083", "0.7330563", "0.7321651", "0.73098886", "0.73098886", "0.7304983", "0.73047996", "0.73022056", "0.72710705", "0.72710705", "0.72710705", "0.72627324", "0.7253862", "0.72521913", "0.72489196", "0.72485715", "0.7237735", "0.7233094", "0.7233094", "0.7233094", "0.7233094", "0.7233094", "0.7233094", "0.7233094", "0.7233094", "0.7233094", "0.7233094", "0.7233094", "0.7229342", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7208706", "0.7191169", "0.7158872", "0.7158872", "0.7158872", "0.7158872", "0.7158872", "0.7158872" ]
0.0
-1
This function allow save a message into the database, with the datetime of submit.
function saveMessage(message) { db .collection('messages') //In which collection the message will be saved .add({ //Method add() create a new document into the collection message, timestamp: firebase.firestore.Timestamp.now() }) .then(function() { // .then() is when the promise is resolved console.log("Mensaje agregado a la DB") messageInput.value = '' // Clear input after the message is saved in the DB }) .catch(function(error) { // If the promise fails (rejected) console.log("Algo falló al guardar mensaje") console.log("Error", error) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveMessage() {\r\n var messageText=document.querySelector('#messages').value;\r\n // Add a new message entry to the database.\r\n return firebase.firestore().collection('messages').add({\r\n name: getUserName(),\r\n text: messageText,\r\n timestamp: firebase.firestore.FieldValue.serverTimestamp()\r\n }).catch(function(error) {\r\n console.error('Error writing new message to database', error);\r\n });\r\n}", "function saveMessage(email, dateTime) {\n\t\tvar newMessageRef = messagesRef.push();\n\t\tnewMessageRef.set({\n\t\t\tEmail: email,\n\t\t\tDate: dateTime\n\t\t});\n\t}", "function saveMessage(suggemail, suggname, suggmessage, dateTime) {\n\t\tvar newsuggMessageRef = suggmessagesRef.push();\n\t\tnewsuggMessageRef.set({\n\t\t\tName: suggname,\n\t\t\tEmail: suggemail,\n\t\t\tMessage: suggmessage,\n\t\t\tDate: dateTime\n\t\t});\n\t}", "saveMessage(message, user, interlocutor) {\n \t\trealm.write(() => {\n\t\t\trealm.create('Message', {\n\t\t\t\tid: this.state.messages.length,\n\t\t\t\tsendAt: new Date(),\n\t\t\t\tmessage: message,\n\t\t\t\tcreatedAt: new Date(),\n\t\t\t\tupdatedAt: new Date(),\n\t\t\t\tfrom_user_id: user, //TODO\n\t\t\t\tto_user_id: interlocutor\n\t\t\t});\n\t\t});\n\t\tthis.props.refresh(true);\n \t}", "function saveMessage(name, email, message){\n messagesRef.collection(\"messages\").add({\n name: name,\n email: email,\n message: message,\n timestamp: firebase.firestore.FieldValue.serverTimestamp(),\n }).then(function (docRef){\n console.log(\"Your message has been sent and will be replied soon!ID:\",docRef.id);\n }).catch(function (error){\n console.error(\"Error sending your message\",error);\n });\n\n\n \n}", "function saveMessage() {\n message.save(function(err, savedMessage) {\n if(err) {\n return res.status(500).json({\n title: 'An error occurred',\n error: err\n })\n }\n //Successfully saved\n console.log(\"Saved message: \", savedMessage);\n return res.status(201).json({\n title: 'Message saved',\n obj: savedMessage\n })\n })\n }", "function saveMessage(name, email, topic, movie, message){\n messagesRef.collection(\"messages\").add({\n name: name,\n email: email,\n topic: topic,\n movie: movie,\n message: message,\n timestamp: firebase.firestore.FieldValue.serverTimestamp(),\n }).then(function (docRef){\n console.log(\"Contact Us message written with ID:\",docRef.id);\n }).catch(function (error){\n console.error(\"Error sending your message\",error);\n });\n\n\n \n}", "function saveMessage(messageText) {\n // Add a new message entry to the database.\n return firebase.firestore().collection('messages').add({\n name: getUserName(),\n text: messageText,\n lat: pos_lat,\n lng: pos_lng,\n accuracy: pos_accuracy,\n profilePicUrl: getProfilePicUrl(),\n timestamp: firebase.firestore.FieldValue.serverTimestamp()\n }).catch(function (error) {\n console.error('Error writing new message to database', error);\n });\n}", "function sendText() {\n var msg = document.getElementById(\"textCamp\").value;\n msg = msg.trim(); //Trim para borrar espacios en blanco\n var fecha = new Date();\n var time = fecha.getHours()+\":\"+fecha.getMinutes()+\":\"+fecha.getSeconds();\n console.log(time);\n var data = {\n author: userName,\n message: msg,\n time: time,\n userEmail: userEmail,\n matchId: matchIdActual\n }\n// If para saber si el mensaje que nos llega tiene un tamaño mayor a 0\n if (msg.length > 0){\n writeInDB(data,'chat');\n }\n document.getElementById(\"textCamp\").value = \"\"; //Inicializamos campo de texto en vacio cada vez que pulsemos boton de enviar.\n}", "function submitMessage() {\n \tvar messageBox = document.querySelector('#messageBox'),\n message = messageBox.value,\n \t\ttransaction = db.transaction(['osMsgStore'],'readwrite'),\n \t\tstore = transaction.objectStore('osMsgStore'),\n \t\tprocessedMsg,\n \t\trequest;\n\n // Should not submit empty message\n if (message.trim() === '') {\n return false;\n }\n\n \tprocessedMsg = {\n \t\tmessage: message,\n \t\tcreated: new Date()\n \t};\n\n \trequest = store.add(processedMsg);\n\n \trequest.onerror = function(e) {\n console.log('Error', e.target.error.name);\n }\n\n request.onsuccess = function(e) {\n document.querySelector('#messageBox').value = '';\n \tsetMessage(processedMsg);\n setMessageCount();\n }\n }", "function saveMessage(portemail, portname, portmessage, dateTime) {\n\t\tvar newsuggMessageRef = suggmessagesRef.push();\n\t\tnewsuggMessageRef.set({\n\t\t\tName: portname,\n\t\t\tEmail: portemail,\n\t\t\tMessage: portmessage,\n\t\t\tDate: dateTime\n\t\t});\n\t}", "function onSubmit (e) {\n\t\tif(e){e.preventDefault();}\n\t\tvar msg = _newMessage.val();\n\t\tif(msg.length > 2){\n\t\t\tvar newData = {\n\t\t\t\t\"author\":_author.val(),\n\t\t\t\t\"message\":msg,\n\t\t\t\t\"date\":firebase.database.ServerValue.TIMESTAMP\n\t\t\t};\n\t\t\t// Obtengo el id del futuro nuevo nodo que se insertara\n\t\t\tvar newKey = firebase.database().ref().child('messages').push().key;\n\t\t\tvar updates = {};\n\t\t\tupdates['/messages/' + newKey] = newData;\n\t\t\tfirebase.database().ref().update(updates);\n\t\t\t_newMessage.val('');\n\t\t}\n\t\treturn false;\n\t}", "function saveMessage(messageText) {\n // Add a new message entry to the Firebase database.\n return firebase.firestore().collection('messages').add({\n name: getUserName(),\n title: ,//get title placeholder value\n text: messageText,\n profilePicUrl: getProfilePicUrl(),\n timestamp: firebase.firestore.FieldValue.serverTimestamp(),\n tag_id: , //get tag id for the same\n \n }).catch(function(error) {\n console.error('Error writing new message to Firebase Database', error);\n });\n}", "function addMessage(message){\n const myMessage = new Model(message)\n myMessage.save()\n}", "function saveMessage(messageText,tagName) {\n // Add a new message entry to the database.\n return firebase.firestore().collection(tagName).add({\n name: getUserName(),\n text: messageText,\n profilePicUrl: getProfilePicUrl(),\n timestamp: firebase.firestore.FieldValue.serverTimestamp()\n }).catch(function(error) {\n console.error('Error writing new message to database', error);\n });\n}", "function saveMessage (name,email,phone,message){\n db.collection('messages').add({\n name: name,\n email:email,\n phone: phone,\n message:message\n })\n}", "function saveToDb(sender, receiver, message) {\n messageDb.save(sender, receiver, htmlEntityFilter.filter(message)).then(result => {\n log.info('message saved to db')\n }, (error) => {\n log.error(error)\n })\n}", "function saveMessage(messageText) {\n // Add a new message entry to the Firebase database.\n return firebase.firestore().collection('group').doc(userGroup).collection(\"messages\").add({\n name: getUserName(),\n text: messageText,\n profilePicUrl: getProfilePicUrl(),\n timestamp: firebase.firestore.FieldValue.serverTimestamp()\n }).catch(function (error) {\n console.error('Error writing new message to Firebase Database', error);\n });\n}", "function saveMessage(appid,name,dob,gname,prclass,schooltype,bsid,regID,meet){\r\n /*\r\n var newMessageRef = messagesRef.push();\r\n MessageRef.set({\r\n */\r\n firebase.database().ref('vtoix2023/' + appid).update({\r\nappid:appid.toString(),\r\nname:name,\r\ndob:dob,\r\ngname:gname,\r\nprclass:prclass,\r\nschooltype:schooltype,\r\nbsid:bsid,\r\nregID:regID,\r\nacyear:\"2023\",\r\nmeet:meet\r\n });\r\n}", "function submitForm(e)\r\n {\r\n e.preventDefault();\r\n var namect = document.getElementById(\"namect\");\r\n var selectct = document.getElementById(\"selectct\");\r\n var emailct = document.getElementById(\"emailct\");\r\n var numberct = document.getElementById(\"numberct\");\r\n saveMessage(namect, selectct, emailct, numberct);\r\n }", "function addMessageToDb() {\n const messageRef = database.ref('messages/');\n let messageContent = document.querySelectorAll('input.message-type-area')[0].value;\n let Message = {\n receiver: ownerKey,\n senderKey: currentUser,\n senderName: senderName,\n content: messageContent,\n date: datetime\n }\n messageRef.push(Message);\n window.location.replace('#/student-listview');\n }", "function savedata(){\n var message = messageField.value;\n\n messagesRef.push({fieldName:'messageField', text:message});\n messageField.value = '';\n }", "function insertMessage(messageHeading, messageContent, downloadURL, time) {\n\n\t\tvar newsAndEventsRef = firebase.database().ref(\"clients/client-02/app_home/message_to_users\");\n\n\t\tnewsAndEventsRef.child(time).set({\n\t\t\tmessage_heading: messageHeading,\n\t\t\tmessage_content: messageContent,\n\t\t\timage_url: downloadURL\n\t\t});\n\t}", "function saveMessage(name, vorname, geburtsdatum, verein, strasse, post, ort, typ, streckenlänge){\n\tvar newMessageRef = messagesRef.push();\n\tnewMessageRef.set({\n\t\tname: name,\n\t\tvorname: vorname,\n\t\tgeburtsdatum: geburtsdatum,\n\t\tverein: verein,\n\t\tstrasse: strasse,\n\t\tpost: post,\n\t\tort: ort,\n\t\ttyp: typ,\n\t\tstreckenlänge: streckenlänge});\n\tdocument.getElementById('contactform').reset();\n}", "saveAndSendMessage() {\n const { user, contact, apikey } = this.props.location.state;\n const textmessage = this.state.text;\n const msg = {\n id: uuid(),\n from: user.id,\n to: contact.id,\n msg: textmessage,\n timestamp: new Date()\n };\n console.log(msg);\n store.write(() => {\n store.create(\"Message\", msg);\n });\n\n if (this.state.text) {\n this.handleInput(\"\");\n Realpub.emit(`chat::send::message::to::${user.id}`, msg);\n }\n }", "function submitMessage() {\n const email = document.querySelector('input#email').value;\n const message = document.querySelector('textarea#message').value;\n const subject = document.querySelector('input#subject').value;\n const name = document.querySelector('input#name').value;\n\n const data = {\n email,\n message,\n subject,\n name\n }\n db.collection('contactus-messages').add(data).then(res => {\n alert('your message has been saved successfully');\n }).catch(err => {\n console.error(err);\n })\n document.querySelector('form').reset();\n return false;\n}", "handleChatMessage() {\n\n $('#chatForm').submit(function(){\n var form = $(this).find(':input[type=submit]');\n form.prop('disabled', true);\n window.setTimeout(function(){\n form.prop('disabled',false);\n },1000);\n });\n\n let messages = get(this, 'messages') || [];\n let chatMsg = get(this, 'chatMessage');\n debug('The chat message is ', chatMsg);\n let chatMessage = Message.create({ originalContent: chatMsg, isFinal: true });\n if (messages.indexOf(chatMessage) === -1) {\n messages.pushObject(chatMessage);\n this.handleMessageTranslation(chatMessage)\n .finally(() => {\n this.setValues({chatMessage: null});\n });\n }\n }", "function saveMessage(req, res) {\n const params = req.body;\n\n if (!params.text && !params.receiver) {\n res.status(200).json({\n message: 'Envia Los Datos Necesarios'\n });\n }\n const message = new Message();\n message.emmitter = req.user.sub;\n message.receiver = params.receiver;\n message.text = params.text;\n message.created_at = moment().unix();\n message.viewed = 'false';\n message.save((err, messageBD) => {\n if (err) {\n res.status(500).json({\n message: 'Error en la peticion',\n err\n });\n }\n if (!messageBD) {\n res.status(500).json({\n message: 'Error al enviar el mensaje'\n });\n }\n return res.status(200).send(\n {\n message: messageBD\n }\n );\n });\n}", "function msg_SuccessfulSave(){\n new PNotify({\n title: 'Saved',\n text: 'New Record Added.',\n type: 'success'\n });\n }", "newMessage(message) {\n // make sure that the user is logged in before sending a message\n if (!this.userId) {\n throw new Meteor.Error('not-logged-in',\n 'Must be logged in to send message.');\n } \n\n // validate input data type is correct\n check(message, {\n type: String,\n text: String,\n chatId: String\n });\n\n message.timestamp=new Date();\n message.userId=this.userId;\n\n const messageId=Messages.insert(message);\n Chats.update(message.chatId, { $set: { lastMessage: message } });\n\n return messageId;\n }", "function submitForm(e) {\r\n e.preventDefault();\r\n //get values\r\n var name = document.getElementById('name1').value;\r\n var email = document.getElementById('mail1').value;\r\n var phone = document.getElementById('phone1').value;\r\n var subject = document.getElementById('subject1').value;\r\n var message = document.getElementById('message1').value;\r\n // var message=document.getElementById('textme').value;\r\n saveMessage(name, email, phone, subject, message);\r\n\r\n}", "function saveMessage(name, dob, disease, cost, doa, message){\r\n var newMessageRef = messagesRef.push();\r\n newMessageRef.set({\r\n name: name,\r\n dob:dob,\r\n disease:disease,\r\n cost:cost,\r\n doa:doa,\r\n message:message\r\n });\r\n}", "async function saveMessage(messageText) {\n // Add a new message entry to the Firebase database.\n try {\n await addDoc(collection(db, 'spaces', String(getSpaceId()), 'messages'), {\n name: getUserName(),\n text: messageText,\n profilePicUrl: getProfilePicUrl(),\n timestamp: serverTimestamp()\n });\n }\n catch (error) {\n console.error('Error writing new message to Firebase Database', error);\n }\n}", "function saveMessage(name, email, valid_age, additionalinfo, star_rate) {\n var newMessageRef = messagesRef.push();\n newMessageRef.set({\n name: name,\n email: email,\n valid_age: valid_age,\n additionalinfo: additionalinfo,\n star_rate: star_rate\n\n });\n}", "function submitForm(){\n console.log(\"entered submit function\");\n// e.preventDefault();\n\n // Get values\n var type=\"cc\"\n var name = \"ram\";\n var age = \"\";\n var email = getInputVal('mail');\n var phone = \"num\";\n\n // Save message\n saveMessage(type,name,age,email, phone);\n}", "function submitForm(){\r\n\r\n// e.preventDefault();\r\n\r\n // Get values\r\nvar\tname = getInputVal('fname');\r\nvar\tdob = getInputVal('dob');\r\nvar\tgname = getInputVal('gname');\r\nvar\tprclass = getInputVal('prclass');\r\nvar\tschooltype = getInputVal('schooltype');\r\nvar\tbsid = getInputVal('bsid');\r\nvar regID = getInputVal('regID');\r\nvar meet = meetDate;\r\n\r\n // Save message\r\n saveMessage(timestamp,name,dob,gname,prclass,schooltype,bsid,regID,meet);\r\n Swal.fire({\r\n title: 'Dhola High School',\r\n text: 'Registration Successful. Application ID: ' + timestamp + '. Note down for further use.',\r\n timerProgressBar: true,\r\n allowOutsideClick:false,\r\n allowEscapeKey:false\r\n});\r\n //swal(\"Dhola High School\",\"Registration Successful. Application ID: \" + timestamp + \". Note down for further use.\",\"success\");\r\n\r\n document.getElementById('registerForm').reset();\r\n}", "function MCH_Save() {\n console.log(\" ----- MCH_Save ----\")\n\n mod_MCH_dict.show_err_msg = true;\n const enable_save_btn = MCH_Hide_Inputboxes();\n\n if (enable_save_btn){\n const data_dict = mod_MCH_dict.data_dict;\n console.log(\" data_dict\", data_dict)\n const usercompensation_pk = data_dict.uc_id;\n\n const new_uc_meetings = mod_MCH_dict.meeting_count;\n const new_uc_meetingdate1 = (el_MCH_meetingdate1.value) ? el_MCH_meetingdate1.value : null;\n const new_uc_meetingdate2 = (el_MCH_meetingdate2.value) ? el_MCH_meetingdate2.value : null;\n let data_has_changed = false;\n\n const upload_dict = {mode: \"update\",\n usercompensation_pk: usercompensation_pk};\n if (new_uc_meetings !== data_dict.uc_meetings){\n upload_dict.meetings = new_uc_meetings;\n data_has_changed = true;\n };\n if (new_uc_meetingdate1 !== data_dict.uc_meetingdate1){\n upload_dict.meetingdate1 = new_uc_meetingdate1;\n data_has_changed = true;\n };\n if (new_uc_meetingdate2 !== data_dict.uc_meetingdate2){\n upload_dict.meetingdate2 = new_uc_meetingdate2;\n data_has_changed = true;\n };\n if (data_has_changed){\n\n // --- create mod_dict\n const url_str = urls.url_usercompensation_upload;\n\n // --- upload changes\n UploadChanges(upload_dict, url_str);\n\n // --- hide modal\n $(\"#id_mod_comphours\").modal(\"hide\");\n\n };\n };\n }", "function Save() {\n if ($('#ab121sgAddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab121sg\",vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n } else {\n dataContext.upDate(\"/api/ab121sg\", vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n }\n }\n }", "function saveMessage(messageId, event) {\n return ddb.put({\n TableName: 'Messages',\n Item: {\n messageId: messageId,\n name: event.name,\n email: event.email,\n message: event.message,\n },\n }).promise();\n}", "function saveMessage(\n first_name,\n last_name,\n email,\n phone,\n profession,\n state,\n skills,\n gender\n) {\n // Add new document to collection messages\n db.collection('messages')\n .add({\n first_name: first_name,\n last_name: last_name,\n email: email,\n phone: phone,\n profession: profession,\n state: state,\n skills: skills,\n gender: gender\n })\n .then((docRef) => {\n console.log('Document written with ID: ', docRef.id);\n })\n .catch((error) => {\n console.error('Error adding document: ', error);\n });\n}", "function saveMessage(name, email, boulderName, grade, location, date, details){\n var newMessageRef = messagesRef.push();\n newMessageRef.set({\n name: name,\n email: email,\n boulderName: boulderName,\n grade: grade,\n location: location,\n date: date,\n details: details,\n\n });\n\n}", "function saveDeliver() {\n\n var deliverDate = deliverCompletedDateSelector.val();\n var deliverUserBy = userName;\n var deliverTimestamp = firebase.database.ServerValue.TIMESTAMP;\n\n // Save it to the ticket\n ticketsRef\n .child(ticketDBID)\n .update({\n deliverCompleted: true,\n deliverUserBy: deliverUserBy,\n deliverDate: deliverDate,\n deliverTimestamp: deliverTimestamp\n })\n .then( // Save it on the customer's info\n customersRef\n .child(custDBID + '/tickets/' + ticketDBID)\n .update({\n deliverCompleted: true,\n deliverUserBy: deliverUserBy,\n deliverDate: deliverDate,\n deliverTimestamp: deliverTimestamp\n }))\n .then(function(){ // Show it as delivered\n deliverButtons.hide();\n deliverCompletedCheckboxSelector.prop('disabled', true);\n })\n }", "function handleSubmit() {\r\n const data = document.getElementById(\"chat-input\").value;\r\n if(data === \"Enter Something\"){\r\n alert(\"Enter Something to send :)\");\r\n }\r\n else{\r\n //emit event when user types in a message\r\n //get the time and date of etered message\r\n const currDate = new Date();\r\n let dateTime = `${currDate.getDate()}/${currDate.getMonth() + 1}/${currDate.getFullYear()} ${currDate.getHours()}:${currDate.getMinutes()}`;\r\n console.log(dateTime);\r\n\r\n socket.emit(\"chat-typed\",{chat_content:data,chat_dateTime:dateTime});\r\n document.getElementById(\"chat-input\").value = \"Enter Something\";\r\n }\r\n}", "function insereValvulaMongo(message){\n let d = new Date();\n let dados2 = mongoose.model('dados2', schemaValvula);\n const dado2 = new dados2({\n topic: \"ultraIMM/valvStatus\",\n valor: message,\n date: d.toLocaleString('pt-br')\n });\n\n dados2.collection.insertOne(dado2);\n \n console.log('Inseriu Válvula: ' +message.toString());\n}", "function submitForm(e){\r\n e.preventDefault();\r\n\r\n // Get values\r\n var name = getInputVal('name');\r\n var from = getInputVal('from');\r\n var email = getInputVal('email');\r\n var phone = getInputVal('phone');\r\n var to = getInputVal('to');\r\n var dep = getInputVal('dep');\r\n var ret = getInputVal('ret');\r\n var pass = getInputVal('pass');\r\n var age = getInputVal('age');\r\n\r\n // Save message\r\n saveMessage(age,name,email, phone,to,from,dep,ret,pass);\r\n\r\n // Show alert\r\n document.querySelector('.alert').style.display = 'block';\r\n\r\n // Hide alert after 3 seconds\r\n setTimeout(function(){\r\n document.querySelector('.alert').style.display = 'none';\r\n },3000);\r\n\r\n // Clear form\r\n document.getElementById('book').reset();\r\n}", "function saveMessage(issue,qrCode){\n var newMessageRef = messagesRef.push();\n newMessageRef.set({\n theIssue:issue,\n qrCode:qrCode,\n dateAndTime:date\n });\n }", "function saveMessage(age,name,email, phone,to,from,dep,ret,pass){\r\n var newMessageRef = messagesR.push();\r\n newMessageRef.set({\r\n age:age,\r\n name: name,\r\n email:email,\r\n phone:phone,\r\n to:to,\r\n from:from,\r\n dep:dep,\r\n ret:ret,\r\n pass:pass\r\n });\r\n}", "function saveMessage(message)\n{\n\tvar xhr = Ti.Network.createHTTPClient();\n\txhr.onload = function()\n\t{\n\t\t// clear textField\n\t\t$.messageTextField.value = '';\n\t\t\n\t\t// refresh messages\n\t\tgetMessages();\t\n\t};\n\t\n\txhr.onerror = function()\n\t{\n\t\talert('Could not save message');\n\t};\n\nif(latitude != null && longitude != null) {\n\txhr.open('POST', 'http://kerrinrose.com/tiktak/addmessage.php?latitude=' + latitude + '&longitude=' + longitude);\n\txhr.setRequestHeader('User-Agent','TikTak');\n\txhr.send({\n\t\t'message' : message\n\t});\n\n\n}\n\nelse {\n\t\n\t\t$.messageTextField.value = '';\n\t\talert('Sorry but location isn\\'t working, you can\\'t tiktak');\n}\n}", "function submitCorrectedData(self){\n var neededId = getNeededId(self);\n var timeToSend = $(\".time-corrector\").val();\n timeToSend *=3600000;\n TimeVal = StartTimeStorage.getTime();\n EndDate = new Date(timeToSend+TimeVal);\n EndDateString = EndDate.toLocaleDateString();\n EndTimeString = EndDate.toLocaleTimeString();\n e_datetime = EndDateString.concat('|', EndTimeString);\n updateTimeData(DateTimeStorage, e_datetime, 'finished', neededId);\n}", "saveMessage(convid, msg){\n var newMsg = new Message();\n newMsg.conversationId = convid;\n newMsg.msgcontent = msg.msgcontent;\n newMsg.author = msg.author;\n newMsg.save((err,msg) => {\n if (err) {\n throw err;\n } \n console.log(msg);\n // Update the latest message in the conversation\n Conversation.findByIdAndUpdate(convid, {latestMessage: msg._id}, (err, conv) => {\n if (err) throw err;\n })\n });\n }", "saveNewMessage(message) {\n if(message) {\n const { currentUser } = this.state;\n const newMessage = {\n type: \"newMessage\",\n username: currentUser,\n content: message\n };\n this.socket.send(JSON.stringify(newMessage));\n }\n }", "function saveAbsenceExcuse() {\nactiveDataSet = studentList.find( arr => arr.absenceId == activeElement ); \nexcusein = document.getElementById(\"excusein\").value;\ncomment = document.getElementById(\"excusecomment\").value;\n//date = excusein.split('.');\nexcuseindate = formatDateDash(excusein);//date[2] + '-' + date[1] + '-' +date [0];\t\n//console.log(\"send to ?type=excuse&console&aid=\" + activeDataSet['absenceId'] + \"&date=\" + excuseindate + \"&comment=\" + comment);\n\n$.post(\"\", {\n\t\t\t\t'type': 'excuse',\n\t\t\t\t'console': '',\n\t\t\t\t'aid': activeDataSet['absenceId'],\n\t\t\t\t'date': excuseindate,\n\t\t\t\t'comment': comment\n }, function (data,status) {\n\t\t\t\thandleServerResponse(data, status);\n\t\t\t});\t\n}", "save() {}", "function submitMessage(event) {\n\n /// prevent default...\n event.preventDefault();\n\n /// set the message\n var messageObj = {\n name: getInputValue(\"name\"),\n // company: getInputValue(\"company\"),\n // emailaddress: getInputValue(\"emailaddress\"),\n // phone: getInputValue(\"phone\"),\n message: getInputValue(\"message\")\n };\n\n /// save the message\n saveMessage(messageObj);\n document.getElementById(\"alertMessage\").classList.remove(\"hide\");\n document.getElementById(\"alertMessage\").classList.remove(\"fadeOutDown\");\n document.getElementById(\"alertMessage\").classList.add(\"fadeInDown\");\n document.getElementById(\"messageForm\").reset();\n window.scrollTo(0, 0);\n\n /// set the timeout\n setTimeout(function () {\n /// remove the message \n document.getElementById(\"alertMessage\").classList.remove(\"fadeInDown\");\n document.getElementById(\"alertMessage\").classList.add(\"fadeOutDown\");\n\n /// set the timeout\n setTimeout(function () {\n /// hide the message..\n document.getElementById(\"alertMessage\").classList.add(\"hide\");\n }, 2000);\n }, 3000);\n\n\n}", "_saveMessage(messageDocument) {\n logger.debug(`MessageSender._saveMessage(): document=${messageDocument}`)\n return this.messageDb.put(messageDocument)\n }", "function saveMessage(element) {\n const message = {\n text: element.text(),\n id: element.attr('id').replace('m', ''),\n y: element.css('top').replace('px', ''),\n x: element.css('left').replace('px', ''),\n toString: function () {\n return 'text=' + this.text + '&id=' + this.id + '&y=' + this.y + '&x=' + this.x;\n }\n };\n query('type=saveMessage&' + message.toString());\n}", "function saveMessage(fname, lname, emailid, name, address, postalcode, medno, phno, govlic) {\n var newMessageRef = messagesRef.push();\n newMessageRef.set({\n fname: fname,\n lname: lname,\n emailid: emailid,\n name: name,\n address: address,\n postalcode: postalcode,\n medno: medno,\n phno: phno,\n govlic: govlic\n });\n}", "function saveInformation(event, senderId) {\n allSenders[senderId].states++;\n if (event.message.quick_reply.payload === 'Yes_postback') {\n model.insertData(senderId);\n sendFBmessage.send(senderId, [{text:'Thank you, ' + allSenders[senderId].name + ' \\u263A \\nOur HR-manager will contact you within 3 days.'}]);\n // send giffy when user save information about yourself in our database\n sendFBmessage.sendImage(senderId, 'http://media3.giphy.com//media//Mp4hQy51LjY6A//200.gif');\n } else {\n sendFBmessage.send(senderId, [{text:'Information about you was not saved.'}]);\n sendFBmessage.sendImage(senderId, 'http://media0.giphy.com//media//7ILa7CZLxE0Ew//200.gif');\n }\n}", "function saveMessage(namect, selectct, emailct, numberct)\r\n{\r\n var newMessageRef=messagesRef.push();\r\n newMessageRef.set(\r\n {namect:namect,\r\n selectct:selectct,\r\n emailct:emailct, \r\n numberct:numberct\r\n });\r\n \r\n}", "function saveMessage(name, phone, email, altphone, degree, experience, role){\n var newMessageRef = messagesRef.push();\n newMessageRef.set({\n name: name,\n phone:phone,\n email:email,\n altphone:altphone,\n degree:degree,\n experience:experience,\n role:role\n });\n}", "save() {\n\t\tif (this.state.modalEditMode) {\n\t\t\tthis.editEvent(this.state.eventId, this.state.eventTitle, this.state.eventStartDate, this.state.eventEndDate);\n\t\t\tthis.setState({\n\t\t\t\tshowModal: false\n\t\t\t});\n\n\t\t\treturn;\n\t\t}\n\n\t\t// Else : create.\n\t\tthis.props.onCreateEvent(this.state.eventTitle, this.state.eventStartDate, this.state.eventEndDate);\n\t\tthis.setState({\n\t\t\tshowModal: false\n\t\t});\n\t}", "async saveChatMessage(doc) {\n let d = doc.data();\n let msg = {\n id: d.messageId,\n createdAt: new Date(d.createdAt),\n text: d.message,\n teamName: d.sender.teamName,\n teamId: d.sender.teamId,\n senderNick: d.sender.nickname,\n senderId: d.sender.id,\n senderColor: d.sender.color\n };\n return await window.DB.saveChatMessage(msg);\n }", "function formsubmit(e) {\n e.preventDefault();\n firebase\n .firestore()\n .collection(\"times\")\n .add({\n title,\n content,\n votes,\n user: currentUser.uid\n })\n .then(() => {\n setTitle(\"\");\n setContent(\"\");\n });\n }", "submit_task(newTask) {\n this.error = false;\n this.error_message = \"\";\n this.success_message = \"\";\n if (!newTask) {\n // undefined input\n this.error = true;\n this.error_message = \"Task is undefined\"\n } else {\n if (newTask.length === 0) {\n // empty input\n this.error = true;\n this.error_message = \"Task is empty !\";\n } else {\n // INSERT\n let taskToAdd = {\n text: newTask,\n createdAt: new Date,\n owner: Meteor.userId(),\n username: Meteor.user().username\n };\n this.add_task(taskToAdd);\n this.newTask = \"\"; // reset task field to \"\"\n this.error = false; // reset error\n this.error_message = \"\"; // reset error message\n this.success_message = \"Added with success.\";\n }\n }\n }", "function sendAndSaveMessage(room, user, message){\n //Write on chat\n let who = user;\n if (user === name) who = 'Me';\n writeOnHistory('<b>' + who + ':</b> ' + message);\n\n //Storing message in IndexedDB\n getRoomData(room).then(data => {\n var newObj = {\n date: Date(),\n user: user,\n message: message\n }\n data.messages.push(newObj);\n updateField(room, \"messages\", data.messages);\n });\n}", "function sendMessage(){\r\n\r\n var writtenmessage=$(\"input[name=inputmessage]\").val();\r\n var ownmessage=new Message(currentLocation.createdBy,currentLocation.latitude,currentLocation.longitude,Date().toString(),Math.round(15,Date.now()+9e5),true,writtenmessage);\r\n console.log(\"newmessage\",ownmessage);\r\n $(\"<div class='message own'>\").html(createMessageElement(ownmessage)).appendTo(\"#messages\");\r\n}", "function saveMessage(name, title, company, email, attend, questions) {\n let newMessageRef = messageRef.push();\n newMessageRef.set({\n name: name,\n title: title,\n company: company,\n email: email,\n attend: attend,\n questions: questions\n });\n}", "function saveMessageContact() {\n $(\"#contact_form\").on(\"submit\", function (event) {\n event.preventDefault();\n });\n let email = $(\"#contact_email\").val();\n let subject = $(\"#contact_subject\").val();\n let message = $(\"#contact_message\").val();\n let errorElement = $(\"#errorContact\");\n errorElement.text(\"\");\n let errorMessage = checkIfContactInputsAreValid(email, subject, message);\n if (errorMessage === \"\") {\n $.post(\"controllers/contact.php\", {\n email: email,\n subject: subject,\n message: message,\n action: \"newMessage\",\n }).then(function (data) {\n if (data === \"message send\") {\n $(\"#contact_form\")\n .empty()\n .html(`<p class=\"noErrorMessage\">Merci pour votre message !</p>`)\n .hide()\n .fadeIn(600);\n } else {\n errorMessage = \"Une erreur est apparue, le message n'a pas été envoyé\";\n displayErrorMessage(errorElement, errorMessage);\n }\n });\n } else {\n displayErrorMessage(errorElement, errorMessage);\n }\n}", "function submit(newMessage = document.getElementById(\"input\").value) {\n\n if (newMessage.length != 0) {\n db.collection(\"chatMessages\").doc(activeChatID).collection(\"messages\").add({\n fromEmail: email,\n fromName: name.split(\" \")[0],\n msg: newMessage,\n timestamp: firebase.firestore.FieldValue.serverTimestamp()\n })\n .then(function () {\n console.log(\"Document written sucessfully!\");\n })\n .catch(function (error) {\n console.error(\"Error adding document: \", error);\n });\n var messageAreaBody = document.getElementById(\"message-area\").children[0];\n\n printMessage(name.split(\" \")[0], newMessage, messageAreaBody.childElementCount == 0 || messageAreaBody.children[messageAreaBody.childElementCount - 1].classList.contains(\"darker\") ? \"\" : \" darker\");\n document.getElementById(\"input\").value = \"\";\n }\n}", "function addMsg() {\r\n\tvar sub = new SubmitData();\r\n\r\n\t// sub.put($(\"#commentForm\"));\r\n\tsub.put($(\"#commentForm\"), \"form_msg\");\r\n\r\n\t$.post(webroot + \"/message_add.action\", sub.getQueryData(), function(data) {\r\n\t\tvar result = JSON.parse(data).result;\r\n\t\tif (result && result == \"success\") {\r\n\t\t\talert(\"留言成功!\");\r\n\t\t} else {\r\n\t\t\talert(\"留言失败!\");\r\n\t\t}\r\n\t});\r\n}", "function submitMeeting(){\n let error = document.querySelector(\".overlay-input-error\"),\n overlayOutputLink = document.querySelector(\".overlay-output-link\");\n \n if (date.value !== \"\" && time.value !== \"\") {\n error.classList.remove(\"active\");\n sendDateToServer({date: date.value, time: time.value});\n overlayOutputLink.classList.add(\"active\");\n } else {\n error.classList.add(\"active\");\n }\n}", "function writeUserData(displayName,message) {\n var today = new Date()\n var year = today.getFullYear().toString()\n var month = monthName[(today.getMonth()+1)]\n var date = today.getDate().toString()\n var datoString = date + \" \" + month + \" \" + year;\n var hour = today.getHours()\n var minute = today.getMinutes()\n if(hour < 10) {\n hour = \"0\" + hour\n }\n if(minute < 10) {\n minute = \"0\" + minute\n }\n if(displayName == null) {\n displayName = \"Anonym\"\n }\n var newPostRef = meldinger.push();\n newPostRef.set({\n msg: message,\n datestamp: datoString,\n showTime: hour.toString() + \":\" + minute.toString(),\n name: displayName\n });\n}", "function guardarMensaje(mensaje) {\n mensaje._id=new Date().toISOString();\n return db.put(mensaje).then(()=>{\n self.registration.sync.register('nuevo-post');\n\n const newRes={ok:true,offline:true};\n return new Response(JSON.stringify(newRes));\n //console.log('Mensaje guardado para posterior posteo');\n });\n}", "function sendMessage(name,lastName, email, message) {\n let newFormMessage = db.collection('contact').add({\n \n first_name: name,\n last_name: lastName,\n email: email, \n message: message\n });\n }", "function submit(){\n\n if (!this.formtitle) return;\n const obj = Program.createWithTitle(this.formtitle).toObject();\n\n if (this.formvideo){\n obj.fields.video = {value: this.formvideo, type: 'STRING'};\n }\n\n ckrecordService.save(\n 'PRIVATE', // cdatabaseScope, PUBLIC or PRIVATE\n null, // recordName,\n null, // recordChangeTag\n 'Program', // recordType\n null, // zoneName, null is _defaultZone, PUBLIC databases can only be default\n null, // forRecordName,\n null, // forRecordChangeTag,\n null, // publicPermission,\n null, // ownerRecordName,\n null, // participants,\n null, // parentRecordName,\n obj.fields // fields\n ).then( record => {\n // Save new value\n this.formtitle = '';\n this.formvideo = '';\n $scope.$apply();\n this.add( {rec: new Program(record)} );\n this.close();\n }).catch((error) => {\n // Revert to previous value\n console.log('addition ERROR', error);\n //TODO: Show message when current user does not have permission.\n // error message will be: 'CREATE operation not permitted'\n });\n\n }", "async postSave () {\n\t}", "function postAutoSave() {\n\t\t\t$.ajax({\n\t\t\t\turl: SITEURL+ADMIN+\"/blog/autosave\",\n\t\t\t\ttype: 'POST',\n\t\t\t\tdata:$('.blog').serialize(),\n\t\t\t\tsuccess: function(data){\n\t\t\t\t\tvar result = jQuery.parseJSON(data);\n\t\t\t\t\tif(result.status != 'no_save') {\n\t\t\t\t\t\t$('#post_id').val(result.post_id);\n\t\t\t\t\t\t$('#autosave-msg').html(result.time);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function saveMessage(data) {\n db.collection(\"messages\")\n .add(data)\n .then((docRef) => {\n console.log(\"Document written with ID: \", docRef.id);\n })\n .catch((error) => {\n console.error(\"Error adding document: \", error);\n });\n}", "static messageDataSaved() {\n const lastUpdated = this.getLastUpdated();\n if (lastUpdated) {dataSavedMessage.textContent += ' on ' + lastUpdated;}\n dataSavedMessage.style.display = 'block';\n }", "function saveMessage(type,name,age,email, phone){\n var newMessageRef = messagesRef.push();\n newMessageRef.set({\n type:type,\n name: name,\n age:age,\n email:email,\n phone:phone,\n \n });\n\n}", "function saveMessage(req, res) {\n const params = req.body;\n\n if (!params.text || !params.receiver)\n return res.status(200).send({ message: 'Envía los datos necesarios.' });\n\n const message = new Message();\n message.emitter = req.user.sub;\n message.receiver = params.receiver;\n message.text = params.text;\n message.created_at = moment().unix();\n message.viewed = false;\n\n message.save((err, messageStored) => {\n if (err) return res.status(500).send({ message: 'Error en la petición.' });\n\n if (!messageStored) return res.status(404).send({ message: 'Error al enviar el mensaje.' });\n\n return res.status(200).send({ message: messageStored });\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 _saveMessages()\n\t\t{\n\t\t\tvar messages = _getMessages();\n\t\t\tif (messages.length)\t\t\t//delete messages already displayed\n\t\t\t{\n\t\t\t\twhile (messages.length && EZ.getTime(messages[0].time) < displayTime)\n\t\t\t\t\tmessages.shift();\n\t\t\t}\n\t\t\tif (messages.length)\n\t\t\t{\n\t\t\t\tpage.messageCount = messages.length;\n\t\t\t\tpage.messageTime = formattedDate;\n\t\t\t}\n\t\t\t//=========================================================================\n\t\t\tEZ.store.set('.EZtrace.messages.' + ourPageName + '@', messages);\n\t\t\t//=========================================================================\n\t\t}", "save() {\n }", "function onMessageFormSubmit(e) {\n e.preventDefault();\n // Check that the user entered a message and is signed in.\n if (messageInputElement.value && checkSignedInWithMessage()) {\n saveMessage(messageInputElement.value).then(function () {\n // Clear message text field and re-enable the SEND button.\n resetMaterialTextfield(messageInputElement);\n toggleButton();\n });\n }\n }", "function sendLetter() {\n // Add a new login info entry to the database.\n content= document.getElementById(\"txt\").value;\n\n var t = new Date(+new Date()+(1000*60*60*9));\n document.getElementsByClassName('popcontent')[0].innerHTML = \"Letter is successfully sent.\"; //when user cancel sending previously, re-show the message.\n $('.buttonwrap').show();\n if (content != \"\") {\n document.getElementById(\"txt\").value = \"\"; //clear\n $('#pop').show();\n\n return firebase.firestore().collection('gamelist').doc(sessionStorage.gameID).collection('letters').add({\n userID: getUserUid(),\n contents: content,\n read: false,\n timestamp: t.getUTCFullYear()+\".\"+ (t.getUTCMonth()+1) +\".\"+t.getUTCDate(),\n servertime: firebase.firestore.FieldValue.serverTimestamp()\n }).catch(function(error) {\n console.error('Error writing new message to database', error);\n });\n }\n else {\n alert (\"You cannot sent an empty letter\");\n }\n}", "function saveMesage(data) {\n console.log(\"save message\", data);\n msgService.saveMesage(data).then(response => {\n console.log(\"msg saved\",response)\n }).catch(error => {\n console.log(\"chat not saved\", error)\n });\n}", "save(){\n //\n }", "function saveMessage(nombre, email, asunto, mensaje){\n var newMessageRef = messagesRef.push();\n newMessageRef.set({\n nombre: nombre,\n email:email,\n asunto:asunto,\n mensaje:mensaje\n });\n}", "save(params) {\n this.sendAction('save', params);\n }", "function saveData()\n{\n\t\"use strict\";\n\n\n\tvar currentDate = new Date();\n\tvar year, month, day;\n\tyear = currentDate.getFullYear();\n\t\n\tif (currentDate.getMonth().toString().length === 1)\n\t{\n\t\tmonth = \"0\" + currentDate.getMonth().toString(); \n\t}\n\telse\n\t{\n\t\tmonth = currentDate.getMonth().toString();\n\t}\n\t\n\tif (currentDate.getDate().toString().length === 1)\n\t{\n\t\tday = \"0\" + currentDate.getDate().toString(); \n\t}\n\telse\n\t{\n\t\tday = currentDate.getDate().toString();\n\t}\n\t\n\tcreationDate = year + month + day;\n\talert(creationDate);\n\tcreationTime = currentDate.getHours() + \":\" + currentDate.getMinutes();\n\n\t\n\ttitle = document.getElementById(\"txtTitle\").value;\n content = document.getElementById(\"txtContent\").value;\n\tteacherName = document.getElementById(\"txtTeacherName\").value;\n\tsubject = document.getElementById(\"txtSubject\").value;\n\t\n\talert(\"Your information has been saved\");\n\n\tdeadline = document.getElementById(\"txtDeadline\").value;\n\n\n\t// Add code to store rest of input in variables here\n \n// Store the information in localstorage\n localStorage.setItem(\"title\", title);\n localStorage.setItem(\"content\", content);\n\tlocalStorage.setItem(\"teacherName\", teacherName);\n\n \n //alert to inform user data has been saved.\n\n}", "function saveMessage(type,name,age,sex,bloodGroup,state,district,email, phone,address){\r\n\r\n var newMessageRef = messagesRef.push();\r\n newMessageRef.set({\r\n type:type,\r\n name: name,\r\n age:age,\r\n sex:sex,\r\n bloodGroup:bloodGroup,\r\n state:state,\r\n district:district,\r\n email:email,\r\n phone:phone,\r\n address:address\r\n });\r\n\r\n // firebasenew.initializeApp(firebaseConfig2);\r\n \r\n // Reference messages collection\r\n var messagesReftweets = firebase.database().ref('tweets');\r\n\r\n var msg= \"@BloodAid @BloodDonorsIn Urgent need of \"+bloodGroup+\" plasma for\"+\" Patient-\"+name +\" \"+sex+\" \"+age+\" \"+\" at \"+\" \"+district+\" \"+state+\" Contact: \"+phone +\" \"+email+\" at \"+address\r\n \r\n datatweet={\r\n message:msg,\r\n type:\"plasma request\",\r\n tweetstatus:\"0\"\r\n }\r\n messagesReftweets.push(datatweet)\r\n\r\n results() ;\r\n // patient_mail_sending(name,age,sex,bloodGroup,state,district,email, phone,address);\r\n }", "function saveMessage(first_name, last_name, email, tel, mod, instagram, pic_1, pic_2, pic_3, pic_4) {\nvar newMessageRef = messageRef.push();\nnewMessageRef.set({\n\nfirst_name: first_name,\nlast_name: last_name, \nemail: email,\ntel: tel, \nmod: mod, \ninstagram: instagram, \npic_1: pic_1, \npic_2: pic_2, \npic_3: pic_3, \npic_4: pic_4,\n\n});\n\n//reload page \nsetTimeout(function(){\n\tlocation.reload();\n},4000);\n\n// location.reload();\n}", "function saveFeedback() {\n\n if(!user) {\n openSignIn();\n return;\n }\n\n var modal = $(\"#session-detail\");\n var sessionId = modal.find(\".session-id\").text();\n var rating = modal.find(\"#vote-rating\").val();\n var comment = modal.find(\"#vote-comment\").val();\n\n if (!rating) {\n alert(\"Rating is required\");\n return;\n }\n\n var data = {};\n data[\"rating\"] = rating;\n data[\"feedback\"] = comment;\n\n var voteRef = firebase.database().ref().child(\"votes\").child(user.uid).child(sessionId);\n voteRef.set(data, function (error) {\n if (error) {\n alert(\"An error occurred while processing your request\");\n } else {\n modal.modal('close');\n }\n });\n }", "function saveMessage(name, company, q1, q2, q3, comment){\r\n var newMessageRef = messagesRef.push();\r\n newMessageRef.set({\r\n name: name,\r\n company:company,\r\n q1:q1,\r\n q2:q2,\r\n q3:q3,\r\n comment : comment\r\n });\r\n }", "async handleClickSave() {\n const result = await this.props.screenProps.homeStore.saveTimeInfo(this.props.screenProps.auth.currentUser,\n { StartTime:this.state.SleepStartTime , EndTime:this.state.SleepEndTime })\n if (result.Status == 'Success') {\n //alert('The user info have saved successfully.')\n Alert.alert('','The user info have been saved successfully.',)\n } else {\n //alert('Could not save user info. Please try refreshing data or check your signal strength.')\n Alert.alert('','Could not save user info. Please refresh and try again.',)\n }\n }", "submit(data) {\r\n const { message, groupId, createdAt, username, image } = data;\r\n const members = this.props.members;\r\n Messages.insert({ username, image, message, members, groupId, createdAt }, this.insertCallback);\r\n }", "function emailSave(email, timestamp) {\n\n // Create email for development only\n var testEmail = '[email protected]';\n // var timestamp = submissionTime;\n // console.log(submitTime);\n\n // Send it\n $.get( \"/email-save\", { emailAddress: email, emailTimestamp: timestamp}, function(data) {\n \n console.log(email);\n console.log('checkpoint'); \n });\n\n }", "function saveMessage(email,password,message){\r\n var newMessageRef = messagesRef.push();\r\n newMessageRef.set({\r\n email:email,\r\n password:password,\r\n message:message,\r\n });\r\n }", "function saveMessage(fname, lname, age, gender, phone, email, desc) {\r\n var newMessageRef = messagesRef.push();\r\n newMessageRef.set({\r\n fname: fname,\r\n lname: lname,\r\n age: age,\r\n gender: gender,\r\n phone: phone,\r\n email: email,\r\n desc: desc\r\n });\r\n}" ]
[ "0.6733934", "0.662166", "0.6495439", "0.6400428", "0.6385696", "0.63745075", "0.63645226", "0.6342867", "0.6319282", "0.6280721", "0.62644607", "0.6247478", "0.6232485", "0.6200354", "0.61870265", "0.6154529", "0.6116404", "0.60997707", "0.60560155", "0.6051118", "0.6018941", "0.59901655", "0.59589356", "0.5905525", "0.5898404", "0.5887509", "0.58828104", "0.58755827", "0.58632904", "0.58501524", "0.5845017", "0.5843957", "0.5821234", "0.58194536", "0.58191204", "0.5795225", "0.5787885", "0.5770989", "0.57639897", "0.5760033", "0.5756667", "0.5751822", "0.57499087", "0.57363445", "0.5735714", "0.5720277", "0.57160896", "0.57149523", "0.57136786", "0.5712267", "0.5697453", "0.56952775", "0.56856817", "0.5673804", "0.5656491", "0.56506383", "0.5649261", "0.5643222", "0.5638974", "0.56298393", "0.5614755", "0.5607178", "0.5606068", "0.5598256", "0.5594206", "0.5587694", "0.5587026", "0.5586207", "0.55847174", "0.5576611", "0.5571457", "0.55700815", "0.5567816", "0.5559157", "0.55578727", "0.5555575", "0.55476475", "0.55430824", "0.554227", "0.5542214", "0.5531437", "0.5512149", "0.5509004", "0.55078125", "0.55068415", "0.55054206", "0.5495914", "0.54867065", "0.54799384", "0.54772574", "0.54749054", "0.54725504", "0.5466859", "0.5462252", "0.54574305", "0.5455264", "0.5455113", "0.54533064", "0.5451554", "0.5443759" ]
0.64417624
3
This function determines which browser we're using to return an element
function getElement(strID) { if( document.getElementById ) // this is the way the standards work elem = document.getElementById( strID ); else if( document.all ) // this is the way old msie versions work elem = document.all[strID]; else if( document.layers ) // this is the way nn4 works elem = document.layers[strID]; return elem; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function css_browser_selector(e){var r=e.toLowerCase(),i=function(e){return r.indexOf(e)>-1},t=\"gecko\",o=\"webkit\",a=\"safari\",n=\"chrome\",s=\"opera\",d=\"mobile\",c=0,l=window.devicePixelRatio?(window.devicePixelRatio+\"\").replace(\".\",\"_\"):\"1\",w=[!/opera|webtv/.test(r)&&/msie\\s(\\d+)/.test(r)&&(c=1*RegExp.$1)?\"ie ie\"+c+(6==c||7==c?\" ie67 ie678 ie6789\":8==c?\" ie678 ie6789\":9==c?\" ie6789 ie9m\":c>9?\" ie9m\":\"\"):/trident\\/\\d+.*?;\\s*rv:(\\d+)\\.(\\d+)\\)/.test(r)&&(c=[RegExp.$1,RegExp.$2])?\"ie ie\"+c[0]+\" ie\"+c[0]+\"_\"+c[1]+\" ie9m\":/firefox\\/(\\d+)\\.(\\d+)/.test(r)&&(re=RegExp)?t+\" ff ff\"+re.$1+\" ff\"+re.$1+\"_\"+re.$2:i(\"gecko/\")?t:i(s)?s+(/version\\/(\\d+)/.test(r)?\" \"+s+RegExp.$1:/opera(\\s|\\/)(\\d+)/.test(r)?\" \"+s+RegExp.$2:\"\"):i(\"konqueror\")?\"konqueror\":i(\"blackberry\")?d+\" blackberry\":i(n)||i(\"crios\")?o+\" \"+n:i(\"iron\")?o+\" iron\":!i(\"cpu os\")&&i(\"applewebkit/\")?o+\" \"+a:i(\"mozilla/\")?t:\"\",i(\"android\")?d+\" android\":\"\",i(\"tablet\")?\"tablet\":\"\",i(\"j2me\")?d+\" j2me\":i(\"ipad; u; cpu os\")?d+\" chrome android tablet\":i(\"ipad;u;cpu os\")?d+\" chromedef android tablet\":i(\"iphone\")?d+\" ios iphone\":i(\"ipod\")?d+\" ios ipod\":i(\"ipad\")?d+\" ios ipad tablet\":i(\"mac\")?\"mac\":i(\"darwin\")?\"mac\":i(\"webtv\")?\"webtv\":i(\"win\")?\"win\"+(i(\"windows nt 6.0\")?\" vista\":\"\"):i(\"freebsd\")?\"freebsd\":i(\"x11\")||i(\"linux\")?\"linux\":\"\",\"1\"!=l?\" retina ratio\"+l:\"\",\"js portrait\"].join(\" \");return window.jQuery&&!window.jQuery.browser&&(window.jQuery.browser=c?{msie:1,version:c}:{}),w}", "function trk_get_browser() {\n // Opera 8.0+\n var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;\n\n // Firefox 1.0+\n var isFirefox = typeof InstallTrigger !== 'undefined';\n\n // Safari 3.0+ \"[object HTMLElementConstructor]\"\n var isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === \"[object SafariRemoteNotification]\"; })(!window['safari'] || safari.pushNotification);\n\n // Internet Explorer 6-11\n var isIE = /*@cc_on!@*/false || !!document.documentMode;\n\n // Edge 20+\n var isEdge = !isIE && !!window.StyleMedia;\n\n // Chrome 1+\n var isChrome = !!window.chrome && !!window.chrome.webstore;\n\n // Blink engine detection\n var isBlink = (isChrome || isOpera) && !!window.CSS;\n\n return isOpera ? 'Opera' :\n isFirefox ? 'Firefox' :\n isSafari ? 'Safari' :\n isChrome ? 'Chrome' :\n isIE ? 'IE' :\n isEdge ? 'Edge' :\n \"-\";\n}", "function getBrowser() { \n var browser = null;\n\n if((navigator.userAgent.indexOf('OPR')) != -1 ){\n browser = \"Opera\";\n }\n else if(navigator.userAgent.indexOf(\"Edge\") != -1 ){\n browser = \"Edge\";\n }\n else if(navigator.userAgent.indexOf(\"Chrome\") != -1 ){\n browser = \"Chrome\";\n }\n else if(navigator.userAgent.indexOf(\"Safari\") != -1){\n browser = \"Safari\";\n }\n else if(navigator.userAgent.indexOf(\"Firefox\") != -1 ){\n browser = \"Firefox\";\n }\n else if((navigator.userAgent.indexOf(\"MSIE\") != -1 ) || (!!document.documentMode == true )){\n browser = \"IE\";\n } \n else {\n browser = \"Unknown\";\n }\n return browser;\n }", "function Browser_DetermineBrowser()\n{\n\t//get user agent\n\tvar userAgent = navigator.userAgent;\n\t//scan for broser\n\tif (userAgent.indexOf(\"MSIE\") != -1)\n\t{\n\t\t//IE!\n\t\twindow.__BROWSER_TYPE = __BROWSER_IE;\n\t\t//get browser version\n\t\tvar version = parseFloat(userAgent.substring(userAgent.indexOf(\"MSIE\") + 5));\n\t\t//ie or better?\n\t\twindow.__BROWSER_IE10_OR_LESS = version < 11;\n\t\twindow.__BROWSER_IE9_OR_LESS = version < 10;\n\t\twindow.__BROWSER_IE8_OR_LESS = version < 9;\n\t\twindow.__BROWSER_IE11_OR_LESS = !(window.__BROWSER_IE10_OR_LESS || window.__BROWSER_IE9_OR_LESS || window.__BROWSER_IE8_OR_LESS);\n\t\tif (window.__BROWSER_IE8_OR_LESS)\n\t\t{\n\t\t\t//add special tags to render inline blocks correctly\n\t\t\twindow.__BROWSER_INLINE_BLOCK_CSS += \"zoom:1; *display: inline;\";\n\t\t\t//adjust get client bounds\n\t\t\twindow.__BROWSER_CLIENTRECT_MOD = version < 8 ? -2 : 0;\n\t\t}\n\t\t//correct the menu highlight\n\t\twindow.__MENU_BORDER_MENUBAR_HTML_HIGHLIGHT = __MENU_BORDER_MENUBAR_HTML_HIGHLIGHT_IE;\n\t\t//are we in screenshot mode\n\t\tif (__SCREENSHOTS_ON)\n\t\t{\n\t\t\t//add modifier to client rect\n\t\t\twindow.__BROWSER_CLIENTRECT_MOD += 2;\n\t\t}\n\t\t//mark specific bad resources for IE\n\t\twindow.__CACHE_REGEX_BAD_RESOURCES = __CACHE_REGEX_BAD_RESOURCES_IE11;\n\t\t//modify the scrollbar size\n\t\twindow.__CAMERA_CMD_SCROLL_BARSIZE = 17;\n\t}\n\telse if (userAgent.indexOf(\"Edge\") != -1)\n\t{\n\t\t//Edge!\n\t\twindow.__BROWSER_TYPE = __BROWSER_IE;\n\t\twindow.__BROWSER_EDGE = true;\n\t\t//modify the scrollbar size\n\t\twindow.__CAMERA_CMD_SCROLL_BARSIZE = 16;\n\t}\n\telse if (userAgent.indexOf(\"Firefox\") != -1)\n\t{\n\t\t//FireFox!\n\t\twindow.__BROWSER_TYPE = __BROWSER_FF;\n\t\t//rename mouse wheel event\n\t\twindow.__BROWSER_EVENT_MOUSEWHEEL = \"DOMMouseScroll\";\n\t\t//its a chromium\n\t\twindow.__BROWSER_CHROMIUM = true;\n\t\t//change the zoom functions\n\t\twindow.Zoom_Register = Zoom_Register_FireFox;\n\t\twindow.Get_ZoomedScale = Get_InterpreterDisplayScaleOnly;\n\t}\n\telse if (userAgent.indexOf(\"Chrome\") != -1)\n\t{\n\t\t//Chrome!\n\t\twindow.__BROWSER_TYPE = __BROWSER_CHROME;\n\t\t//its a chromium\n\t\twindow.__BROWSER_CHROMIUM = true;\n\t\t//change the zoom functions but only for retrieving zoomed scale\n\t\twindow.Get_ZoomedScale = Get_InterpreterDisplayScaleOnly;\n\t}\n\telse if (userAgent.indexOf(\"Opera\") != -1)\n\t{\n\t\t//Opera!\n\t\twindow.__BROWSER_TYPE = __BROWSER_OPERA;\n\t}\n\telse if (userAgent.indexOf(\"iPad\") != -1 || userAgent.indexOf(\"iPhone\") != -1)\n\t{\n\t\t//ipad? use safari for now\n\t\twindow.__BROWSER_TYPE = __BROWSER_SAFARI;\n\t\t//its a chromium\n\t\twindow.__BROWSER_CHROMIUM = true;\n\t\t//change the zoom functions but only for retrieving zoomed scale\n\t\twindow.Get_ZoomedScale = Get_InterpreterDisplayScaleOnly;\n\t\t//force a transformation for the body\n\t\twindow.document.body.style.transform = \"translate3d(0,0,0)\";\n\t}\n\telse if (userAgent.indexOf(\"Safari\") != -1)\n\t{\n\t\t//Safari!\n\t\twindow.__BROWSER_TYPE = __BROWSER_SAFARI;\n\t\t//its a chromium\n\t\twindow.__BROWSER_CHROMIUM = true;\n\t}\n\telse if (userAgent.indexOf(\"Trident/7.0\") != -1)\n\t{\n\t\t//IE!\n\t\twindow.__BROWSER_TYPE = __BROWSER_IE;\n\t\twindow.__BROWSER_IE11_OR_LESS = true;\n\t\t//mark specific bad resources for IE\n\t\twindow.__CACHE_REGEX_BAD_RESOURCES = __CACHE_REGEX_BAD_RESOURCES_IE11;\n\t\t//modify the scrollbar size\n\t\twindow.__CAMERA_CMD_SCROLL_BARSIZE = 17;\n\t}\n\telse\n\t{\n\t\t//in trouble!\n\t\tCommon_Error(\"Unable to determine browser\");\n\t\t//use ie\n\t\twindow.__BROWSER_TYPE = __BROWSER_IE;\n\t}\n\t//we have html5?\n\tif (!window.__BROWSER_IE8_OR_LESS)\n\t{\n\t\t//add css variables to the colors map\n\t\t__NEMESIS_COLORS_NAME_MAP[\"currentcolor\"] = \"CurrentColor\";\n\t}\n\t//update ligatures for css\n\tBrowser_SetupLigatures();\n\t//setup on touch\n\tBrowser_SetupOnTouch();\n}", "function detectBrowser() {\n if (firefoxBrowser >= 0) {\n return \"firefox\";\n } else if (operaBrowser >= 0) {\n return \"opera\";\n } else if (ieBrowser >= 0) {\n return \"ie\";\n } else if (edgeBrowser >= 0) {\n return \"edge\";\n } else if (chromeBrowser >= 0) {\n return \"chrome\";\n } else if (safariBrowser >= 0 && chromeBrowser < 0) {\n return \"safari\";\n } else {\n return \"unknown\";\n };\n}", "function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\\s(\\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\\/(\\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\\s|\\/)(\\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\\/(\\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}", "function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\\s(\\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\\/(\\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\\s|\\/)(\\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\\/(\\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}", "function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\\s(\\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\\/(\\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\\s|\\/)(\\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\\/(\\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}", "function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\\s(\\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\\/(\\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\\s|\\/)(\\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\\/(\\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}", "function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\\s(\\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\\/(\\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\\s|\\/)(\\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\\/(\\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}", "function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\\s(\\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\\/(\\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\\s|\\/)(\\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\\/(\\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}", "function identifyBrowser() {\n\n var ua = navigator.userAgent.toLowerCase();\n if (ua.indexOf(\"mozilla\") != -1) {\n if (ua.indexOf(\"firefox\") != -1) {\n browserName = \"firefox\";\n return 4;\n } \n }\n}", "function browser_detection(){\n\tif(navigator.appName == \"Netscape\"){\n\t\treturn \"NET\";\t\n\t}else{\n\t\treturn \"IE\";\n\t}\t\n}", "function css_browser_selector(u){var ua = u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1;},g='gecko',w='webkit',s='safari',o='opera',h=document.getElementsByTagName('html')[0],b=[(!(/opera|webtv/i.test(ua))&&/msie\\s(\\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\\/(\\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\\s|\\/)(\\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\\/(\\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?'mobile':is('iphone')?'iphone':is('ipod')?'ipod':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win':is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}", "function detectBrowser()\n {\n var browser = \"\";\n if (window.navigator.userAgent.indexOf('Edge') > -1)\n {\n browser = \"edge\";\n }\n else\n {\n browser = \"other\";\n }\n return browser;\n }", "function getBrowser(){\n\t\tvar userAgent = navigator.userAgent.toLowerCase();\n\t\tjQuery.browser.chrome = /chrome/.test(userAgent);\n\t\tjQuery.browser.safari= /webkit/.test(userAgent);\n\t\tjQuery.browser.opera=/opera/.test(userAgent);\n\t\tjQuery.browser.msie=/msie/.test( userAgent ) && !/opera/.test( userAgent );\n\t\tjQuery.browser.mozilla= /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) || /firefox/.test(userAgent);\n\n\t\tif(jQuery.browser.chrome) return \"chrome\";\n\t\tif(jQuery.browser.mozilla) return \"mozilla\";\n\t\tif(jQuery.browser.opera) return \"opera\";\n\t\tif(jQuery.browser.safari) return \"safari\";\n\t\tif(jQuery.browser.msie) return \"ie\";\n\t}", "function browser() {\n var agent = navigator.userAgent;\n if (agent.search('MSIE 7') > 0) {\n return 'IE7';\n }\n if (agent.search('MSIE 8') > 0) {\n return 'IE8';\n }\n if (agent.search('MSIE 9') > 0) {\n return 'IE9';\n }\n if (agent.search('MSIE 10') > 0) {\n return 'IE10';\n }\n if (agent.search('like Gecko') > 0) {\n return 'IE11';\n }\n if (agent.search('MSIE') > 0) {\n return 'IE';\n }\n if (agent.search('OPR') > 0) {\n return 'Opera';\n }\n if (agent.search('Opera') > 0) {\n return 'Opera';\n }\n if (agent.search('Firefox') > 0) {\n return 'Firefox';\n }\n if (agent.search('Chrome') > 0) {\n return 'Chrome';\n }\n if (agent.search('Safari') > 0) {\n return 'Safari';\n }\n return 'unknown browser';\n}", "function getBrowser() {\n var browser = TICloudAgent.BROWSER.CHROME;\n // chrome claims to be safari and chrome.. so special care is needed\n if (navigator.userAgent.indexOf(\"Safari\") !== -1 && navigator.userAgent.indexOf(\"Chrome\") === -1) {\n browser = TICloudAgent.BROWSER.SAFARI;\n }\n else if (navigator.userAgent.indexOf(\"Firefox\") !== -1) {\n browser = TICloudAgent.BROWSER.FIREFOX;\n }\n else if (!!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n browser = TICloudAgent.BROWSER.IE;\n }\n return browser;\n }", "function get_browser(){\n var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || []; \n if(/trident/i.test(M[1])){\n tem=/\\brv[ :]+(\\d+)/g.exec(ua) || []; \n return 'IE '+(tem[1]||'');\n } \n if(M[1]==='Chrome'){\n tem=ua.match(/\\bOPR\\/(\\d+)/)\n if(tem!=null) {return 'Opera '+tem[1];}\n } \n M=M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];\n if((tem=ua.match(/version\\/(\\d+)/i))!=null) {M.splice(1,1,tem[1]);}\n return M[0];\n }", "function browser() {\n\t\n\tvar isOpera = !!(window.opera && window.opera.version); // Opera 8.0+\n\tvar isFirefox = testCSS('MozBoxSizing'); // FF 0.8+\n\tvar isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;\n\t // At least Safari 3+: \"[object HTMLElementConstructor]\"\n\tvar isChrome = !isSafari && testCSS('WebkitTransform'); // Chrome 1+\n\t//var isIE = /*@cc_on!@*/false || testCSS('msTransform'); // At least IE6\n\n\tfunction testCSS(prop) {\n\t return prop in document.documentElement.style;\n\t}\n\t\n\tif (isOpera) {\n\t\t\n\t\treturn false;\n\t\t\n\t}else if (isSafari || isChrome) {\n\t\t\n\t\treturn true;\n\t\t\n\t} else {\n\t\t\n\t\treturn false;\n\t\t\n\t}\n\t\n}", "function css_browser_selector(u) {\n var ua = u.toLowerCase(),\n is = function(t) {\n return ua.indexOf(t) > -1\n }, g = 'gecko',\n w = 'webkit',\n s = 'safari',\n o = 'opera',\n m = 'mobile',\n h = document.documentElement,\n b = [(!(/opera|webtv/i.test(ua)) && /msie\\s(\\d)/.test(ua)) ? ('ie ie' + RegExp.$1) : is('firefox/2') ? g + ' ff2' : is('firefox/3.5') ? g + ' ff3 ff3_5' : is('firefox/3.6') ? g + ' ff3 ff3_6' : is('firefox/3') ? g + ' ff3' : is('gecko/') ? g : is('opera') ? o + (/version\\/(\\d+)/.test(ua) ? ' ' + o + RegExp.$1 : (/opera(\\s|\\/)(\\d+)/.test(ua) ? ' ' + o + RegExp.$2 : '')) : is('konqueror') ? 'konqueror' : is('blackberry') ? m + ' blackberry' : is('android') ? m + ' android' : is('chrome') ? w + ' chrome' : is('iron') ? w + ' iron' : is('applewebkit/') ? w + ' ' + s + (/version\\/(\\d+)/.test(ua) ? ' ' + s + RegExp.$1 : '') : is('mozilla/') ? g : '', is('j2me') ? m + ' j2me' : is('iphone') ? m + ' iphone' : is('ipod') ? m + ' ipod' : is('ipad') ? m + ' ipad' : is('mac') ? 'mac' : is('darwin') ? 'mac' : is('webtv') ? 'webtv' : is('win') ? 'win' + (is('windows nt 6.0') ? ' vista' : '') : is('freebsd') ? 'freebsd' : (is('x11') || is('linux')) ? 'linux' : '', 'js'];\n c = b.join(' ');\n h.className += ' ' + c;\n return c;\n}", "function browserDetection() { \r\n\tif(navigator.userAgent.indexOf(\"Chrome\") != -1 ){\r\n\t\tdocument.getElementById(\"browser\").innerHTML=\"The browser you are using is : Chrome\";\r\n }\r\n else if(navigator.userAgent.indexOf(\"Opera\") != -1 ){\r\n\t\tdocument.getElementById(\"browser\").innerHTML=\"The browser you are using is : OPERA\";\r\n }\r\n else if(navigator.userAgent.indexOf(\"Firefox\") != -1 ){\r\n document.getElementById(\"browser\").innerHTML=\"The browser you are using is : FIREFOX\";\r\n }\r\n else if((navigator.userAgent.indexOf(\"MSIE\") != -1 ) || (!!document.documentMode == true )){\r\n document.getElementById(\"browser\").innerHTML=\"The browser you are using is : Internet\";\r\n } \r\n else{\r\n document.getElementById(\"browser\").innerHTML=\"The browser you are using is : Unknown\";\r\n }\r\n}", "driver() {\n return this._element.browser;\n }", "function detectBrowser() {\n // If we already tested, do not test again\n if (browserInfo) {\n return browserInfo;\n }\n\n var browserData = [\n {\n string: $window.navigator.userAgent,\n subString: 'Edge',\n versionSearch: 'Edge',\n identity: 'Edge'\n },\n {\n string: $window.navigator.userAgent,\n subString: 'Chrome',\n identity: 'Chrome'\n },\n {\n string: $window.navigator.userAgent,\n subString: 'OmniWeb',\n versionSearch: 'OmniWeb/',\n identity: 'OmniWeb'\n },\n {\n string: $window.navigator.vendor,\n subString: 'Apple',\n versionSearch: 'Version',\n identity: 'Safari'\n },\n {\n prop: $window.opera,\n identity: 'Opera'\n },\n {\n string: $window.navigator.vendor,\n subString: 'iCab',\n identity: 'iCab'\n },\n {\n string: $window.navigator.vendor,\n subString: 'KDE',\n identity: 'Konqueror'\n },\n {\n string: $window.navigator.userAgent,\n subString: 'Firefox',\n identity: 'Firefox'\n },\n {\n string: $window.navigator.vendor,\n subString: 'Camino',\n identity: 'Camino'\n },\n {\n string: $window.navigator.userAgent,\n subString: 'Netscape',\n identity: 'Netscape'\n },\n {\n string: $window.navigator.userAgent,\n subString: 'MSIE',\n identity: 'Explorer',\n versionSearch: 'MSIE'\n },\n {\n string: $window.navigator.userAgent,\n subString: 'Trident/7',\n identity: 'Explorer',\n versionSearch: 'rv'\n },\n {\n string: $window.navigator.userAgent,\n subString: 'Gecko',\n identity: 'Mozilla',\n versionSearch: 'rv'\n },\n {\n string: $window.navigator.userAgent,\n subString: 'Mozilla',\n identity: 'Netscape',\n versionSearch: 'Mozilla'\n }\n ];\n\n var osData = [\n {\n string: $window.navigator.platform,\n subString: 'Win',\n identity: 'Windows'\n },\n {\n string: $window.navigator.platform,\n subString: 'Mac',\n identity: 'Mac'\n },\n {\n string: $window.navigator.platform,\n subString: 'Linux',\n identity: 'Linux'\n },\n {\n string: $window.navigator.platform,\n subString: 'iPhone',\n identity: 'iPhone'\n },\n {\n string: $window.navigator.platform,\n subString: 'iPod',\n identity: 'iPod'\n },\n {\n string: $window.navigator.platform,\n subString: 'iPad',\n identity: 'iPad'\n },\n {\n string: $window.navigator.platform,\n subString: 'Android',\n identity: 'Android'\n }\n ];\n\n var versionSearchString = '';\n\n function searchString(data) {\n for (var i = 0; i < data.length; i++) {\n var dataString = data[i].string;\n var dataProp = data[i].prop;\n\n versionSearchString = data[i].versionSearch || data[i].identity;\n\n if (dataString) {\n if (dataString.indexOf(data[i].subString) !== -1) {\n return data[i].identity;\n\n }\n }\n else if (dataProp) {\n return data[i].identity;\n }\n }\n }\n\n function searchVersion(dataString) {\n var index = dataString.indexOf(versionSearchString);\n\n if (index === -1) {\n return;\n }\n\n return parseInt(dataString.substring(index + versionSearchString.length + 1));\n }\n\n var browser = searchString(browserData) || 'unknown-browser';\n var version = searchVersion($window.navigator.userAgent) || searchVersion($window.navigator.appVersion) || 'unknown-version';\n var os = searchString(osData) || 'unknown-os';\n\n // Prepare and store the object\n browser = browser.toLowerCase();\n version = browser + '-' + version;\n os = os.toLowerCase();\n\n var browserInfo = {\n browser: browser,\n version: version,\n os: os\n };\n\n return browserInfo;\n }", "function getBrowser() {\r\n var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\r\n if(/trident/i.test(M[1])){\r\n return 'IE';\r\n }\r\n if(M[1]==='Chrome'){\r\n tem=ua.match(/\\bOPR\\/(\\d+)/)\r\n if(tem!=null) {return 'Opera';}\r\n }\r\n M=M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];\r\n if((tem=ua.match(/version\\/(\\d+)/i))!=null) {M.splice(1,1,tem[1]);}\r\n return M[0];\r\n }", "function getBrowser() {\n var ua = navigator.userAgent, tem,\n M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n\n if(/trident/i.test(M[1])){\n tem = /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n return 'IE '+(tem[1] || '');\n }\n\n if(M[1]=== 'Chrome'){\n tem = ua.match(/\\b(OPR|Edge)\\/(\\d+)/);\n if(tem != null) return tem.slice(1).join(' ').replace('OPR', 'Opera');\n }\n\n M= M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];\n if((tem= ua.match(/version\\/(\\d+)/i))!= null) M.splice(1, 1, tem[1]);\n\n return M[0];\n }", "browser() {\n return this._browser;\n }", "browser() {\n return this._browser;\n }", "browser() {\n return this._browser;\n }", "function DetectBrowser()\n{\n var browserID = navigator.userAgent.toLowerCase(); \n \n if(browserID.indexOf('msie') != -1)\n {\n IE = true;\n FireFox = false;\n IE7 = false;\n }\n \n if(browserID.indexOf('msie 7.0') != -1)\n { \n IE7 = true;\n }\n \n if(browserID.indexOf('firefox') != -1)\n {\n IE = false;\n FireFox = true; \n IE7 = false;\n } \n \n}", "browser() {\n return this._browserContext.browser();\n }", "browser() {\n return this._browserContext.browser();\n }", "function getBrowserInfo() {\r\n\tif (checkIt('konqueror')) {\r\n\t\tbrowser = \"Konqueror\";\r\n\t\tOS = \"Linux\";\r\n\t}\r\n\telse if (checkIt('safari')) browser \t= \"Safari\"\r\n\telse if (checkIt('omniweb')) browser \t= \"OmniWeb\"\r\n\telse if (checkIt('opera')) browser \t\t= \"Opera\"\r\n\telse if (checkIt('webtv')) browser \t\t= \"WebTV\";\r\n\telse if (checkIt('icab')) browser \t\t= \"iCab\"\r\n\telse if (checkIt('msie')) browser \t\t= \"Internet Explorer\"\r\n\telse if (!checkIt('compatible')) {\r\n\t\tbrowser = \"Netscape Navigator\"\r\n\t\tversion = detect.charAt(8);\r\n\t}\r\n\telse browser = \"An unknown browser\";\r\n\r\n\tif (!version) version = detect.charAt(place + thestring.length);\r\n\r\n\tif (!OS) {\r\n\t\tif (checkIt('linux')) OS \t\t= \"Linux\";\r\n\t\telse if (checkIt('x11')) OS \t= \"Unix\";\r\n\t\telse if (checkIt('mac')) OS \t= \"Mac\"\r\n\t\telse if (checkIt('win')) OS \t= \"Windows\"\r\n\t\telse OS \t\t\t\t\t\t\t\t= \"an unknown operating system\";\r\n\t}\r\n}", "function get_browser() {\n var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n if(/trident/i.test(M[1])){\n tem=/\\brv[ :]+(\\d+)/g.exec(ua) || [];\n return {name:'IE',version:(tem[1]||'')};\n }\n if(M[1]==='Chrome'){\n tem=ua.match(/\\bOPR|Edge\\/(\\d+)/)\n if(tem!=null) {return {name:'Opera', version:tem[1]};}\n }\n M=M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];\n if((tem=ua.match(/version\\/(\\d+)/i))!=null) {M.splice(1,1,tem[1]);}\n return {\n name: M[0],\n version: M[1]\n };\n}", "get userAgent() {\n const ua = navigator.userAgent;\n const manifest = browser.runtime.getManifest();\n\n const soup = new Set(['webext']);\n const flavor = {\n major: 0,\n soup: soup,\n is: (value) => soup.has(value),\n };\n\n const dispatch = function() {\n window.dispatchEvent(new CustomEvent('browserInfoLoaded'));\n };\n\n // Whether this is a dev build.\n if (/^\\d+\\.\\d+\\.\\d+\\D/.test(browser.runtime.getManifest().version)) {\n soup.add('devbuild');\n }\n\n if (/\\bMobile\\b/.test(ua)) {\n soup.add('mobile');\n }\n\n // Asynchronous -- more accurate detection for Firefox\n (async () => {\n try {\n const info = await browser.runtime.getBrowserInfo();\n flavor.major = parseInt(info.version, 10) || 0;\n soup.add(info.vendor.toLowerCase());\n soup.add(info.name.toLowerCase());\n } catch (ex) {\n // dummy event for potential listeners\n dispatch();\n }\n })();\n\n // Synchronous -- order of tests is important\n let match;\n if ((match = /\\bFirefox\\/(\\d+)/.exec(ua)) !== null) {\n flavor.major = parseInt(match[1], 10) || 0;\n soup.add('mozilla').add('firefox');\n } else if ((match = /\\bEdge\\/(\\d+)/.exec(ua)) !== null) {\n flavor.major = parseInt(match[1], 10) || 0;\n soup.add('microsoft').add('edge');\n } else if ((match = /\\bOPR\\/(\\d+)/.exec(ua)) !== null) {\n const reEx = /\\bChrom(?:e|ium)\\/([\\d.]+)/;\n if (reEx.test(ua)) { match = reEx.exec(ua); }\n flavor.major = parseInt(match[1], 10) || 0;\n soup.add('opera').add('chromium');\n } else if ((match = /\\bChromium\\/(\\d+)/.exec(ua)) !== null) {\n flavor.major = parseInt(match[1], 10) || 0;\n soup.add('chromium');\n } else if ((match = /\\bChrome\\/(\\d+)/.exec(ua)) !== null) {\n flavor.major = parseInt(match[1], 10) || 0;\n soup.add('google').add('chromium');\n } else if ((match = /\\bSafari\\/(\\d+)/.exec(ua)) !== null) {\n flavor.major = parseInt(match[1], 10) || 0;\n soup.add('apple').add('safari');\n }\n\n if (manifest.browser_specific_settings && manifest.browser_specific_settings.gecko) {\n soup.add('gecko');\n }\n\n Object.defineProperty(this, 'userAgent', { value: flavor });\n return flavor;\n }", "function checkBrowser(){\n\tif(document.getElementById && document.attachEvent){\t\n\t\t//modern IE\n\t\tbrowser = 'modIE';\n\t}\n\telse if(document.getElementById){\t\n\t\t//modern, non-IE\n\t\tbrowser = 'gecko';\n\t}\n\telse{\t\t\n\t\t//ask to download new browser\n\t\twindow.location = \"browser.html\";\n\t}\n}", "function getBrowser() {\n function getBrowserInner() {\n // http://stackoverflow.com/a/2401861/1828637\n var ua = navigator.userAgent,\n tem,\n M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n if (/trident/i.test(M[1])) {\n tem = /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n return 'IE ' + (tem[1] || '');\n }\n if (M[1] === 'Chrome') {\n tem = ua.match(/\\b(OPR|Edge)\\/(\\d+)/);\n if (tem !== null) return tem.slice(1).join(' ').replace('OPR', 'Opera');\n }\n M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?'];\n if ((tem = ua.match(/version\\/(\\d+)/i)) !== null) M.splice(1, 1, tem[1]);\n return M.join(' ');\n }\n\n var name_version_str = getBrowserInner();\n var split = name_version_str.split(' ');\n var version = split.pop();\n var name = split.join(' ');\n return {\n name: name.toLowerCase(),\n nameproper: name,\n version: version\n };\n}", "function browserDetection() {\r\n\tif(navigator.userAgent.indexOf(\"Chrome\") != -1 ){\r\n\t\tdocument.getElementById(\"browser\").innerHTML=\"Your browser is Chrome\";\r\n }\r\n else if(navigator.userAgent.indexOf(\"Opera\") != -1 ){\r\n\t\tdocument.getElementById(\"browser\").innerHTML=\"Your browser is Opera\";\r\n }\r\n else if(navigator.userAgent.indexOf(\"Firefox\") != -1 ){\r\n document.getElementById(\"browser\").innerHTML=\"Your browser is Firefox\";\r\n }\r\n else if((navigator.userAgent.indexOf(\"MSIE\") != -1 ) || (!!document.documentMode == true )){\r\n document.getElementById(\"browser\").innerHTML=\"Internet Browser\";\r\n }\r\n else{\r\n document.getElementById(\"browser\").innerHTML=\"Unknown Browser\";\r\n }\r\n}", "function getBrowser (){\nif(jQuery.uaMatch(navigator.userAgent).browser == 'webkit'){\nvar userAgent = navigator.userAgent.toLowerCase();\nif ( userAgent.indexOf(\"chrome\") === -1 ) { \nreturn 'safari';\n}\nelse {\nreturn jQuery.uaMatch(navigator.userAgent).browser;\n}\n}\n}", "function GetBrowser(){\n\n\tvar nVer = navigator.appVersion;\n\tvar nAgt = navigator.userAgent;\n\tvar browserName = navigator.appName;\n\tvar fullVersion = ''+parseFloat(navigator.appVersion);\n\tvar majorVersion = parseInt(navigator.appVersion,10);\n\tvar nameOffset,verOffset,ix;\n\n\t// In Opera, the true version is after \"Opera\" or after \"Version\"\n\tif ((verOffset=nAgt.indexOf(\"Opera\"))!=-1) {\n\t browserName = \"Opera\";\n\t fullVersion = nAgt.substring(verOffset+6);\n\t if ((verOffset=nAgt.indexOf(\"Version\"))!=-1)\n\t\tfullVersion = nAgt.substring(verOffset+8);\n\t}\n\t// In MSIE, the true version is after \"MSIE\" in userAgent\n\telse if ((verOffset=nAgt.indexOf(\"MSIE\"))!=-1) {\n\t browserName = \"Microsoft Internet Explorer\";\n\t fullVersion = nAgt.substring(verOffset+5);\n\t}\n\t// In Chrome, the true version is after \"Chrome\"\n\telse if ((verOffset=nAgt.indexOf(\"Chrome\"))!=-1) {\n\t browserName = \"Chrome\";\n\t fullVersion = nAgt.substring(verOffset+7);\n\t}\n\t// In Safari, the true version is after \"Safari\" or after \"Version\"\n\telse if ((verOffset=nAgt.indexOf(\"Safari\"))!=-1) {\n\t browserName = \"Safari\";\n\t fullVersion = nAgt.substring(verOffset+7);\n\t if ((verOffset=nAgt.indexOf(\"Version\"))!=-1)\n\t\tfullVersion = nAgt.substring(verOffset+8);\n\t}\n\t// In Firefox, the true version is after \"Firefox\"\n\telse if ((verOffset=nAgt.indexOf(\"Firefox\"))!=-1) {\n\t browserName = \"Firefox\";\n\t fullVersion = nAgt.substring(verOffset+8);\n\t}\n\t// In most other browsers, \"name/version\" is at the end of userAgent\n\telse if ( (nameOffset=nAgt.lastIndexOf(' ')+1) <\n\t\t (verOffset=nAgt.lastIndexOf('/')) )\n\t{\n\t browserName = nAgt.substring(nameOffset,verOffset);\n\t fullVersion = nAgt.substring(verOffset+1);\n\t if (browserName.toLowerCase()==browserName.toUpperCase()) {\n\t\tbrowserName = navigator.appName;\n\t }\n\t}\n\t// trim the fullVersion string at semicolon/space if present\n\tif ((ix=fullVersion.indexOf(\";\"))!=-1)\n\t fullVersion=fullVersion.substring(0,ix);\n\tif ((ix=fullVersion.indexOf(\" \"))!=-1)\n\t fullVersion=fullVersion.substring(0,ix);\n\n\tmajorVersion = parseInt(''+fullVersion,10);\n\tif (isNaN(majorVersion)) {\n\t fullVersion = ''+parseFloat(navigator.appVersion);\n\t majorVersion = parseInt(navigator.appVersion,10);\n\t}\n\t\n\t//return 'Browser: '+browserName+' - Vers:'+fullVersion+' - MajorVers: '+majorVersion+' - NavAppName: '+navigator.appName+' - NavUserAge: '+navigator.userAgent;\n\treturn browserName+' '+fullVersion+' '+majorVersion+' '+navigator.appName+' '+navigator.userAgent;\n\t\n }", "function getBrowserInfo() {\n\tif (checkIt('konqueror')) {\n\t\tbrowser = \"Konqueror\";\n\t\tOS = \"Linux\";\n\t}\n\telse if (checkIt('safari')) browser \t= \"Safari\"\n\telse if (checkIt('omniweb')) browser \t= \"OmniWeb\"\n\telse if (checkIt('opera')) browser \t\t= \"Opera\"\n\telse if (checkIt('webtv')) browser \t\t= \"WebTV\";\n\telse if (checkIt('icab')) browser \t\t= \"iCab\"\n\telse if (checkIt('msie')) browser \t\t= \"Internet Explorer\"\n\telse if (!checkIt('compatible')) {\n\t\tbrowser = \"Netscape Navigator\"\n\t\tversion = detect.charAt(8);\n\t}\n\telse browser = \"An unknown browser\";\n\n\tif (!version) version = detect.charAt(place + thestring.length);\n\n\tif (!OS) {\n\t\tif (checkIt('linux')) OS \t\t= \"Linux\";\n\t\telse if (checkIt('x11')) OS \t= \"Unix\";\n\t\telse if (checkIt('mac')) OS \t= \"Mac\"\n\t\telse if (checkIt('win')) OS \t= \"Windows\"\n\t\telse OS \t\t\t\t\t\t\t\t= \"an unknown operating system\";\n\t}\n}", "function detectBrowser() {\n let browserDetector = navigator.userAgent;\n let browserName;\n\n if (browserDetector.indexOf(\"Firefox\") != -1) {\n browserName = \"Mozilla Firefox\";\n }\n else if (browserDetector.indexOf(\"Opera\") != -1) {\n browserName = \"Opera\";\n }\n else if (browserDetector.indexOf(\"Trident\") != -1) {\n browserName = \"Microsoft Internet Explorer\";\n }\n else if (browserDetector.indexOf(\"Edge\") != -1) {\n browserName = \"Microsoft Edge\";\n }\n else if (browserDetector.indexOf(\"Chrome\") != -1) {\n browserName = \"Google Chrome or Chromium\";\n }\n else if (browserDetector.indexOf(\"Safari\") != -1) {\n browserName = \"Apple Safari\";\n }\n else {\n browserName = \"unable to detect\";\n }\n document.getElementById(\"browser\").textContent = \"Browser used: \" + browserName;\n}", "function checkBrowser(){\n\tvar userAgent = navigator.userAgent;\n\tvar isOpera = userAgent.indexOf(\"Opera\") > -1;\n \tif(isOpera){return \"Opera\";}\n \tif (userAgent.indexOf(\"Firefox\") > -1){return \"FF\";}\n \tif (userAgent.indexOf(\"Chrome\") > -1){return \"Chrome\";}\n \tif (userAgent.indexOf(\"Safari\") > -1){return \"Safari\";} \n \tif (userAgent.indexOf(\"compatible\") > -1 && userAgent.indexOf(\"MSIE\") > -1 && !isOpera){return \"IE\";};\n}", "function browserDependingScrollToTag() {\n return ($.browser.webkit ? $body : $html);\n}", "getclassname() {\n return \"Browser\";\n }", "function BrowserDetect() {}", "function isPlatformBrowser(platformId){return platformId===PLATFORM_BROWSER_ID;}", "function getTheElement(thisid){\n\n var thiselm = null;\n\n if (document.getElementById)\n {\n // browser implements part of W3C DOM HTML ( Gecko, Internet Explorer 5+, Opera 5+\n thiselm = document.getElementById(thisid);\n }\n else if (document.all){\n // Internet Explorer 4 or Opera with IE user agent\n thiselm = document.all[thisid];\n }\n else if (document.layers){\n // Navigator 4\n thiselm = document.layers[thisid];\n }\n\n if(thiselm)\t{\n\n if(thiselm == null)\n {\n return;\n }\n else\n {\n return thiselm;\n }\n }\n}", "function CheckBrowserInfo(infoType)\r\n{\r\n\tvar vBrowserInfoName, vReturnValue, vBrowserInfoVersion\r\n\t//Determine what kind of browser information to return.\r\n\tswitch (infoType)\r\n\t{\r\n\t\tcase \"name\":\r\n\t\t\tif (is_gecko)\r\n\t\t\t{\r\n\t\t\t\t// Star Office (3.0) incorrectly reports itself as nn in \"appName\"\r\n\t\t\t\t// Check \"appversion\" instead and change if necessary\r\n\t\t\t\tvBrowserInfoName = (navigator.appVersion && navigator.appVersion.indexOf(\"StarView\") >= 0) ? browserSO : browserNN;\r\n\t\t\t\tvBrowserInfoName = is_fx ? browserFF : browserNN;\r\n\t\t\t}\r\n\t\t\t//Check to see if \"appName\" contains \"Microsoft\".\r\n\t\t\telse if (is_ie)\r\n\t\t\t{\r\n\t\t\t\tvBrowserInfoName = browserIE;\r\n\t\t\t}\r\n\t\t\t//Return \"Unknown\" if \"appName\" matches neither \"Netscape\" nor \"Microsoft\" match.\r\n\t\t\telse if (is_safari)\r\n\t\t\t{\r\n\t\t\t\tvBrowserInfoName = browserSafari;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tvBrowserInfoName = browserUnknown;\r\n\t\t\t}\r\n\t\t\t//Return the browser name.\r\n\t\t\tvReturnValue = vBrowserInfoName;\r\n\t\t\tbreak;\r\n\t\tcase \"version\":\r\n\t\t\t//Return the browser version.\r\n\t\t\tvBrowserInfoVersion = is_major;\r\n\t\t\tvReturnValue = vBrowserInfoVersion;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\t//Return nothing if \"infoType\" is not specified.\r\n\t\t\tvReturnValue = 0;\r\n\t}\r\n\t//Return the requested browser information.\r\n\treturn vReturnValue;\r\n}", "function browserDetection() {\n\t if((navigator.userAgent.indexOf(\"Opera\") || navigator.userAgent.indexOf('OPR')) != -1 )\n\t{\n\t\t\t$(\".browserOverlay\").css(\"display\", \"block\")\n\t}\n\telse if(navigator.userAgent.indexOf(\"Chrome\") != -1 )\n\t{\n\t\t\t$(\".browserOverlay\").css(\"display\", \"block\")\n\t}\n\telse if(navigator.userAgent.indexOf(\"Safari\") != -1)\n\t{\n\t\t\t$(\".browserOverlay\").css(\"display\", \"block\")\n\t}\n\telse if(navigator.userAgent.indexOf(\"Firefox\") != -1 )\n\t{\n\t\t\t $(\".browserOverlay\").css(\"display\", \"none\")\n\t}\n\telse if((navigator.userAgent.indexOf(\"MSIE\") != -1 ) || (!!document.documentMode == true )) //IF IE > 10\n\t{\n\t\t$(\".browserOverlay\").css(\"display\", \"block\")\n\t}\n\telse\n\t{\n\t\t $(\".browserOverlay\").css(\"display\", \"block\")\n\t}\n\t}", "function checkBrowser () {\n var UA = navigator.userAgent;\n var browser;\n var version;\n var verOffset;\n\n if ((verOffset = UA.indexOf('Opera')) > -1) {\n browser = 'Opera';\n version = UA.substring(verOffset + 6);\n if ((verOffset = UA.indexOf('Version')) > -1) {\n version = UA.substring(verOffset + 8);\n }\n }\n else if ((verOffset = UA.indexOf('MSIE')) > -1) {\n browser = 'Internet Explorer';\n version = UA.substring(verOffset + 5);\n }\n else if ((verOffset = UA.indexOf('Chrome')) > -1) {\n browser = 'Chrome';\n version = UA.substring(verOffset + 7);\n }\n else if ((verOffset = UA.indexOf('Safari')) > -1) {\n browser = 'Safari';\n version = UA.substring(verOffset + 7);\n if ((verOffset = UA.indexOf('Version')) > -1) {\n version = UA.substring(verOffset + 8);\n }\n }\n else if ((verOffset = UA.indexOf('Firefox')) > -1) {\n browser = 'Firefox';\n version = UA.substring(verOffset + 8);\n }\n else if (UA.indexOf('Trident/') > -1) {\n browser = 'Internet Explorer';\n version = UA.substring(UA.indexOf('rv:') + 3);\n }\n else if ((nameOffset = UA.lastIndexOf(' ') + 1) < (verOffset = UA.lastIndexOf('/'))) {\n browser = UA.substring(nameOffset, verOffset);\n version = UA.substring(verOffset + 1);\n if (browser.toLowerCase() == browser.toUpperCase()) {\n browser = navigator.appName;\n }\n }\n}", "getHTMLElement() {\n if (this.type === TEXT) {\n return this.createHTMLText();\n }\n else if (this.type === IMAGE) {\n return this.createHTMLImage();\n }\n else if (this.type === VIDEO) {\n return this.createHTMLVideo();\n }\n else {\n console.error(\"This is not a correct element\");\n }\n }", "target() {\n return this.targets().find((target) => target.type() === 'browser');\n }", "target() {\n return this.targets().find((target) => target.type() === 'browser');\n }", "target() {\n return this.targets().find((target) => target.type() === 'browser');\n }", "function test_browser () {\n var verBr=navigator.userAgent;\n if (verBr.indexOf(\"Opera\")!=-1)\n browsers[1] = 1;\n else {\n if (verBr.indexOf(\"MSIE\")!=-1)\n browsers[0] = 1;\n else { \n //if (verBr.indexOf(\"Firefox\")!=-1)\n browsers[2] = 1;\n }\n } \n }", "function i(){return(navigator.userAgent||navigator.vendor||window.opera).toLowerCase()}", "function i(){return(navigator.userAgent||navigator.vendor||window.opera).toLowerCase()}", "function i(){return(navigator.userAgent||navigator.vendor||window.opera).toLowerCase()}", "function i(){return(navigator.userAgent||navigator.vendor||window.opera).toLowerCase()}", "function GetBrowserInfo() {\n\t\t\t\tvar isFirefox = typeof InstallTrigger !== 'undefined'; // Firefox 1.0+\n\t\t\t\tvar isChrome = !!window.chrome; \t\t\t // Chrome 1+\n\t\t\t\tif (isFirefox) { return 'firefox'; }\n\t\t\t\telse if (isChrome) { return 'chrome'; }\t\t\n\t\t\t\telse { return 0; }\n\t\t\t}", "function Browser()\r\n {\r\n this.isIE;\r\n this.isNS;\r\n this.isChrome;\r\n this.ua;\r\n \r\n var ua = this.ua = navigator.userAgent;\r\n var s = \"\";\r\n \r\n s = \"MSIE\";\r\n if (ua.indexOf(s) >= 0)\r\n {\r\n this.isIE = true;\r\n this.isNS = !this.isIE;\r\n return;\r\n }\r\n \r\n s = \"Netscape6/\";\r\n if (ua.indexOf(s) >= 0)\r\n {\r\n this.isIE = false;\r\n this.isNS = !this.isIE;\r\n return;\r\n }\r\n \r\n s = \"Chrome/\";\r\n if (ua.indexOf(s) >= 0)\r\n {\r\n this.isIE = false;\r\n this.isNS = this.isIE;\r\n this.isChrome = !this.isIE;\r\n return;\r\n }\r\n \r\n s = \"Gecko\";\r\n if (ua.indexOf(s) >= 0)\r\n {\r\n this.isIE = false;\r\n this.isNS = this.isIE;\r\n this.isChrome = this.isIE;\r\n return;\r\n }\r\n }", "function getBrowserObject(elem) {\n const elemObject = elem;\n return elemObject.parent ? getBrowserObject(elemObject.parent) : elem;\n}", "detectBrowser(){\n\t\t// get user agent browser\n\t\tlet ua = this.get('browser').userAgent;\n\t\t// get array browser data\n\t\tlet browser = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n\t\t// set name\n\t\tthis.set('browserName', browser[1]);\n\t\t// set version\n\t\tthis.set('browserVersion', browser[2]);\n\t\t// system\n\t\tfor (var id in this.get('clientStrings')) {\n\t\t\tvar cs = this.get('clientStrings')[id];\n\t\t\tif (cs.r.test(ua)) {\n\t\t\t\tthis.set('osName', cs.s);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (/Windows/.test(this.get('osName'))) {\n\t\t\tthis.set('osVersion', /Windows (.*)/.exec(this.get('osName'))[1]);\n\t\t\tthis.set('osName', 'Windows');\n\t\t}\n\n\t\tswitch (this.get('osName')) {\n\t\t\tcase 'Mac OS X':\n\t\t\tthis.set('osVersion', /Mac OS X (10[\\.\\_\\d]+)/.exec(ua)[1]);\n\t\t\tbreak;\n\n\t\t\tcase 'Android':\n\t\t\tthis.set('osVersion', /Android ([\\.\\_\\d]+)/.exec(ua)[1]);\n\t\t\tbreak;\n\n\t\t\tcase 'iOS':\n\t\t\tlet nVer = navigator.appVersion;\n\t\t\tlet iosV = /OS (\\d+)_(\\d+)_?(\\d+)?/.exec(nVer);\n\t\t\tiosV = iosV[1] + '.' + iosV[2] + '.' + (iosV[3] | 0);\n\t\t\tthis.set('osVersion', iosV);\n\t\t\tbreak;\n\t\t}\n\t}", "function Fx_WhichBrowser() {\n\n // Value will true, when the client browser is Internet Explorer 6-11\n Browser_IsIE = /*@cc_on!@*/false || !!document.documentMode;\n\n // Value will true, when the client browser is Edge 20+\n Browser_IsEdge = !Browser_IsIE && !!window.StyleMedia;\n\n // Value will true, when the client browser is Firefox 1.0+\n Browser_IsFirefox = typeof InstallTrigger !== 'undefined';\n\n // Value will true, when the client browser is Chrome 1+\n Browser_IsChrome = !!window.chrome && !!window.chrome.webstore;\n\n // Value will true, when the client browser is Opera 8.0+\n Browser_IsOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;\n\n // Value will true, when the client browser is Safari 3+\n Browser_IsSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;\n\n // Value will true, when the client browser having Blink engine\n //Browser_IsBlink = (Browser_IsChrome || Browser_IsOpera) && !!window.CSS;\n}", "function isBrowser( n ){\n\treturn (navigator.userAgent.indexOf( n ) !== -1) ? true : false;\n}", "static _isDomElement(el) {\n try {\n return el instanceof HTMLElement;\n } catch(e) {\n //Older browser unsupported?\n throw new Error('Browser is unsupported');\n }\n }", "static getCurrentBrowser() {\n if (typeof (chrome) !== 'undefined')\n return Browser.CHROME;\n else {\n throw \"Invalid Browser\";\n }\n }", "function getBrowserName() {\n var parser = new UAParser();\n var result = parser.getResult();\n return result;\n }", "function getBrowserInfo() {\n var nVer = navigator.appVersion;\n var nAgt = navigator.userAgent;\n var browserName = navigator.appName;\n var fullVersion = '' + parseFloat(navigator.appVersion);\n var majorVersion = parseInt(navigator.appVersion, 10);\n var nameOffset, verOffset, ix;\n\n // both and safri and chrome has same userAgent\n if (isSafari && !isChrome && nAgt.indexOf('CriOS') !== -1) {\n isSafari = false;\n isChrome = true;\n }\n\n // In Opera, the true version is after 'Opera' or after 'Version'\n if (isOpera) {\n browserName = 'Opera';\n try {\n fullVersion = navigator.userAgent.split('OPR/')[1].split(' ')[0];\n majorVersion = fullVersion.split('.')[0];\n } catch (e) {\n fullVersion = '0.0.0.0';\n majorVersion = 0;\n }\n }\n // In MSIE version <=10, the true version is after 'MSIE' in userAgent\n // In IE 11, look for the string after 'rv:'\n else if (isIE) {\n verOffset = nAgt.indexOf('rv:');\n if (verOffset > 0) { //IE 11\n fullVersion = nAgt.substring(verOffset + 3);\n } else { //IE 10 or earlier\n verOffset = nAgt.indexOf('MSIE');\n fullVersion = nAgt.substring(verOffset + 5);\n }\n browserName = 'IE';\n }\n // In Chrome, the true version is after 'Chrome' \n else if (isChrome) {\n verOffset = nAgt.indexOf('Chrome');\n browserName = 'Chrome';\n fullVersion = nAgt.substring(verOffset + 7);\n }\n // In Safari, the true version is after 'Safari' or after 'Version' \n else if (isSafari) {\n verOffset = nAgt.indexOf('Safari');\n\n browserName = 'Safari';\n fullVersion = nAgt.substring(verOffset + 7);\n\n if ((verOffset = nAgt.indexOf('Version')) !== -1) {\n fullVersion = nAgt.substring(verOffset + 8);\n }\n\n if (navigator.userAgent.indexOf('Version/') !== -1) {\n fullVersion = navigator.userAgent.split('Version/')[1].split(' ')[0];\n }\n }\n // In Firefox, the true version is after 'Firefox' \n else if (isFirefox) {\n verOffset = nAgt.indexOf('Firefox');\n browserName = 'Firefox';\n fullVersion = nAgt.substring(verOffset + 8);\n }\n\n // In most other browsers, 'name/version' is at the end of userAgent \n else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) {\n browserName = nAgt.substring(nameOffset, verOffset);\n fullVersion = nAgt.substring(verOffset + 1);\n\n if (browserName.toLowerCase() === browserName.toUpperCase()) {\n browserName = navigator.appName;\n }\n }\n\n if (isEdge) {\n browserName = 'Edge';\n fullVersion = navigator.userAgent.split('Edge/')[1];\n // fullVersion = parseInt(navigator.userAgent.match(/Edge\\/(\\d+).(\\d+)$/)[2], 10).toString();\n }\n\n // trim the fullVersion string at semicolon/space/bracket if present\n if ((ix = fullVersion.search(/[; \\)]/)) !== -1) {\n fullVersion = fullVersion.substring(0, ix);\n }\n\n majorVersion = parseInt('' + fullVersion, 10);\n\n if (isNaN(majorVersion)) {\n fullVersion = '' + parseFloat(navigator.appVersion);\n majorVersion = parseInt(navigator.appVersion, 10);\n }\n\n return {\n fullVersion: fullVersion,\n version: majorVersion,\n name: browserName,\n isPrivateBrowsing: false\n };\n }", "function browserDetect() {\n var ua= navigator.userAgent, tem,\n M= ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n if(/trident/i.test(M[1])){\n tem= /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n return 'IE '+(tem[1] || '');\n }\n if(M[1]=== 'Chrome'){\n tem= ua.match(/\\b(OPR|Edge)\\/(\\d+)/);\n if(tem!= null) return tem.slice(1).join(' ').replace('OPR', 'Opera');\n }\n M= M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];\n if((tem= ua.match(/version\\/(\\d+)/i))!= null) M.splice(1, 1, tem[1]);\n return M.join(' ');\n}", "function browser(){}", "function browser(){}", "function uInitBrowser()\n{\n var browser = navigator.appName;\n if (browser.substring(0, 8) == \"Netscape\")\n {\n uBrowserID = uNS;\n }\n else if (browser.substring(0, 9) == \"Microsoft\")\n {\n uBrowserID = uIE;\n }\n}", "function calcBrowser() {\n\t\t\tvar rwebkit = /(webkit)[ \\/]([\\w.]+)/;\n\t\t\tvar rmozilla = /(mozilla)(?:.*? rv:([\\w.]+))?/;\n\n\t\t\tvar browserMatch = rwebkit.exec(sLowerCaseUserAgent) ||\n\t\t\t\tsLowerCaseUserAgent.indexOf(\"compatible\") < 0 && rmozilla.exec(sLowerCaseUserAgent) || [];\n\n\t\t\tvar oRes = {\n\t\t\t\tbrowser: browserMatch[1] || \"\",\n\t\t\t\tversion: browserMatch[2] || \"0\"\n\t\t\t};\n\t\t\toRes[oRes.browser] = true;\n\t\t\treturn oRes;\n\t\t}", "function prefixBrowser() {\n window.browser = function () {\n return window.msBrowser || window.browser || window.chrome;\n }();\n}", "function browser_type()\n{\n\t//----------------------------------------------------------------//\n\t// this.name\n\t//----------------------------------------------------------------//\n\t/**\n\t * this.name\n\t *\n\t * Client browser name\n\t *\n\t * Client browser name identification string as provided by the browser.\n\t *\n\t * @type\tstring\n\t * @property\n\t */\n\tthis.name = navigator.appName;\n\t\n\t//----------------------------------------------------------------//\n\t// this.version\n\t//----------------------------------------------------------------//\n\t/**\n\t * this.version\n\t *\n\t * Client browser version\n\t *\n\t * Client browser version identification string as provided by the browser.\n\t *\n\t * @type\tstring\n\t * @property\n\t */\n\tthis.version = navigator.appVersion;\n\t\n\t//----------------------------------------------------------------//\n\t// this.os\n\t//----------------------------------------------------------------//\n\t/**\n\t * this.os\n\t *\n\t * Client operating system\n\t *\n\t * Client operating system identification string as provided by the browser.\n\t *\n\t * @type\tstring\n\t * @property\n\t */\n\tthis.os = navigator.platform;\n\t\n\t//----------------------------------------------------------------//\n\t// this.mode\n\t//----------------------------------------------------------------//\n\t/**\n\t * this.mode\n\t *\n\t * Vixen browser mode\n\t *\n\t * identifies/sets the browser mode that Vixen is using. Normally this\n\t * property would be set automatically by Vixen and used for reference only\n\t *\n\t *\n\t * IE = Internet Explorer and Opera browsers\n\t * NS = Mozilla based browsers\n\t *\n\t * @type\tstring\n\t * @property\n\t */\n\tthis.mode = '';\n\t\n\t// work out the browser mode to run\n\tif (navigator.appVersion.indexOf(\"MSIE\")!=-1)\n\t{\n\t\t// internet explorer or someone pretending to be internet explorer\n\t\tthis.mode = 'IE';\n\t}\n\telse\n\t{\n\t\tswitch (this.name.toLowerCase())\n\t\t{\n\t\t\tcase 'internet explorer':\n\t\t\tcase 'microsoft internet explorer':\n\t\t\tcase 'msie':\n\t\t\tcase 'opera':\n\t\t\t\t// ie mode\n\t\t\t\tthis.mode = 'IE';\n\t\t\t\tbreak;\n\t\n\t\t\tdefault:\n\t\t\t\t// netscape mode\n\t\t\t\tthis.mode = 'NS';\n\t\t}\n\t}\n}", "function browsersForPlatform(){\n var platform = process.platform\n\n if (platform === 'win32'){\n return [\n {\n name: \"IE\",\n exe: \"C:\\\\Program Files\\\\Internet Explorer\\\\iexplore.exe\",\n supported: browserExeExists\n },\n {\n name: \"Firefox\",\n exe: [\n \"C:\\\\Program Files\\\\Mozilla Firefox\\\\firefox.exe\",\n \"C:\\\\Program Files (x86)\\\\Mozilla Firefox\\\\firefox.exe\"\n ],\n args: [\"-profile\", tempDir + \"\\\\testem.firefox\"],\n setup: function(config, done){\n setupFirefoxProfile(tempDir + '/testem.firefox', done)\n },\n supported: browserExeExists\n },\n {\n name: \"Chrome\",\n exe: [\n userHomeDir + \"\\\\Local Settings\\\\Application Data\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe\",\n userHomeDir + \"\\\\AppData\\\\Local\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe\",\n \"C:\\\\Program Files\\\\Google\\\\Chrome\\\\Application\\\\Chrome.exe\",\n \"C:\\\\Program Files (x86)\\\\Google\\\\Chrome\\\\Application\\\\Chrome.exe\"\n ],\n args: [\"--user-data-dir=\" + tempDir + \"\\\\testem.chrome\", \"--no-default-browser-check\", \"--no-first-run\", \"--ignore-certificate-errors\"],\n setup: function(config, done){\n rimraf(tempDir + '\\\\testem.chrome', done)\n },\n supported: browserExeExists\n },\n {\n name: \"Safari\",\n exe: [\n \"C:\\\\Program Files\\\\Safari\\\\safari.exe\",\n \"C:\\\\Program Files (x86)\\\\Safari\\\\safari.exe\"\n ],\n supported: browserExeExists\n },\n {\n name: \"Opera\",\n exe: [\n \"C:\\\\Program Files\\\\Opera\\\\opera.exe\",\n \"C:\\\\Program Files (x86)\\\\Opera\\\\opera.exe\"\n ],\n args: [\"-pd\", tempDir + \"\\\\testem.opera\"],\n setup: function(config, done){\n rimraf(tempDir + '\\\\testem.opera', done)\n },\n supported: browserExeExists\n },\n {\n name: 'PhantomJS',\n exe: 'phantomjs',\n args: buildPhantomJsArgs,\n supported: findableByWhere\n }\n ]\n }else if (platform === 'darwin'){\n return [\n {\n name: \"Chrome\", \n exe: \"/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome\", \n args: [\"--user-data-dir=\" + tempDir + \"/testem.chrome\", \"--no-default-browser-check\", \"--no-first-run\", \"--ignore-certificate-errors\"],\n setup: function(config, done){\n rimraf(tempDir + '/testem.chrome', done)\n },\n supported: browserExeExists\n },\n {\n name: \"Chrome Canary\", \n exe: \"/Applications/Google\\ Chrome\\ Canary.app/Contents/MacOS/Google\\ Chrome\\ Canary\", \n args: [\"--user-data-dir=\" + tempDir + \"/testem.chrome-canary\", \"--no-default-browser-check\", \"--no-first-run\", \"--ignore-certificate-errors\"],\n setup: function(config, done){\n rimraf(tempDir + '/testem.chrome-canary', done)\n },\n supported: browserExeExists\n },\n {\n name: \"Firefox\", \n exe: \"/Applications/Firefox.app/Contents/MacOS/firefox\",\n args: [\"-profile\", tempDir + \"/testem.firefox\"],\n setup: function(config, done){\n setupFirefoxProfile(tempDir + '/testem.firefox', done)\n },\n supported: browserExeExists\n },\n {\n name: \"Safari\",\n exe: \"/Applications/Safari.app/Contents/MacOS/Safari\",\n setup: function(config, done){\n var url = this.getUrl()\n fs.writeFile(tempDir + '/testem.safari.html', \"<script>window.location = '\" + url + \"'</script>\", done)\n },\n args: function(){\n return [tempDir + '/testem.safari.html']\n },\n supported: browserExeExists\n },\n {\n name: \"Opera\",\n exe: \"/Applications/Opera.app/Contents/MacOS/Opera\",\n args: [\"-pd\", tempDir + \"/testem.opera\"],\n setup: function(config, done){\n rimraf(tempDir + '/testem.opera', done)\n },\n supported: browserExeExists\n },\n {\n name: 'PhantomJS',\n exe: 'phantomjs',\n args: buildPhantomJsArgs,\n supported: findableByWhich\n }\n ]\n }else if (platform === 'linux'){\n return [\n {\n name: 'Firefox',\n exe: 'firefox',\n args: [\"-no-remote\", \"-profile\", tempDir + \"/testem.firefox\"],\n setup: function(config, done){\n rimraf(tempDir + '/testem.firefox', function(err){\n if (!err){\n fs.mkdir(tempDir + '/testem.firefox', done)\n }else{\n done()\n }\n })\n },\n supported: findableByWhich\n },\n {\n name: 'Chrome',\n exe: 'google-chrome',\n args: [\"--user-data-dir=\" + tempDir + \"/testem.chrome\", \n \"--no-default-browser-check\", \"--no-first-run\", \"--ignore-certificate-errors\"],\n setup: function(config, done){\n rimraf(tempDir + '/testem.chrome', done)\n },\n supported: findableByWhich\n },\n {\n name: 'Chromium',\n exe: ['chromium', 'chromium-browser'],\n args: [\"--user-data-dir=\" + tempDir + \"/testem.chromium\", \n \"--no-default-browser-check\", \"--no-first-run\", \"--ignore-certificate-errors\"],\n setup: function(config, done){\n rimraf(tempDir + '/testem.chromium', done)\n },\n supported: findableByWhich\n },\n {\n name: 'PhantomJS',\n exe: 'phantomjs',\n args: buildPhantomJsArgs,\n supported: findableByWhich\n }\n ]\n }else if (platform === 'sunos') {\n\treturn [\n {\n name: 'PhantomJS',\n exe: 'phantomjs',\n args: buildPhantomJsArgs,\n supported: findableByWhich\n }\n\t];\n }else{\n return []\n }\n}", "function BrowserDetect() {\r\n var ua = navigator.userAgent.toLowerCase(); \r\n // browser engine name\r\n this.isGecko = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);\r\n this.isAppleWebKit = (ua.indexOf('applewebkit') != -1);\r\n // browser name\r\n this.isOpera = (ua.indexOf('opera') != -1); \r\n this.isIE = (ua.indexOf('msie') != -1 && !this.isOpera && (ua.indexOf('webtv') == -1) ); \r\n}", "function detect(ua) {\n var os = {};\n var browser = {};\n // var webkit = ua.match(/Web[kK]it[\\/]{0,1}([\\d.]+)/);\n // var android = ua.match(/(Android);?[\\s\\/]+([\\d.]+)?/);\n // var ipad = ua.match(/(iPad).*OS\\s([\\d_]+)/);\n // var ipod = ua.match(/(iPod)(.*OS\\s([\\d_]+))?/);\n // var iphone = !ipad && ua.match(/(iPhone\\sOS)\\s([\\d_]+)/);\n // var webos = ua.match(/(webOS|hpwOS)[\\s\\/]([\\d.]+)/);\n // var touchpad = webos && ua.match(/TouchPad/);\n // var kindle = ua.match(/Kindle\\/([\\d.]+)/);\n // var silk = ua.match(/Silk\\/([\\d._]+)/);\n // var blackberry = ua.match(/(BlackBerry).*Version\\/([\\d.]+)/);\n // var bb10 = ua.match(/(BB10).*Version\\/([\\d.]+)/);\n // var rimtabletos = ua.match(/(RIM\\sTablet\\sOS)\\s([\\d.]+)/);\n // var playbook = ua.match(/PlayBook/);\n // var chrome = ua.match(/Chrome\\/([\\d.]+)/) || ua.match(/CriOS\\/([\\d.]+)/);\n var firefox = ua.match(/Firefox\\/([\\d.]+)/);\n // var safari = webkit && ua.match(/Mobile\\//) && !chrome;\n // var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome;\n var ie = ua.match(/MSIE\\s([\\d.]+)/)\n // IE 11 Trident/7.0; rv:11.0\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\n var edge = ua.match(/Edge\\/([\\d.]+)/); // IE 12 and 12+\n\n var weChat = /micromessenger/i.test(ua);\n\n // Todo: clean this up with a better OS/browser seperation:\n // - discern (more) between multiple browsers on android\n // - decide if kindle fire in silk mode is android or not\n // - Firefox on Android doesn't specify the Android version\n // - possibly devide in os, device and browser hashes\n\n // if (browser.webkit = !!webkit) browser.version = webkit[1];\n\n // if (android) os.android = true, os.version = android[2];\n // if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.');\n // if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.');\n // if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;\n // if (webos) os.webos = true, os.version = webos[2];\n // if (touchpad) os.touchpad = true;\n // if (blackberry) os.blackberry = true, os.version = blackberry[2];\n // if (bb10) os.bb10 = true, os.version = bb10[2];\n // if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2];\n // if (playbook) browser.playbook = true;\n // if (kindle) os.kindle = true, os.version = kindle[1];\n // if (silk) browser.silk = true, browser.version = silk[1];\n // if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true;\n // if (chrome) browser.chrome = true, browser.version = chrome[1];\n if (firefox) {\n browser.firefox = true;\n browser.version = firefox[1];\n }\n // if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true;\n // if (webview) browser.webview = true;\n\n if (ie) {\n browser.ie = true;\n browser.version = ie[1];\n }\n\n if (edge) {\n browser.edge = true;\n browser.version = edge[1];\n }\n\n // It is difficult to detect WeChat in Win Phone precisely, because ua can\n // not be set on win phone. So we do not consider Win Phone.\n if (weChat) {\n browser.weChat = true;\n }\n\n // os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) ||\n // (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/)));\n // os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos ||\n // (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\\/([\\d.]+)/)) ||\n // (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/))));\n\n return {\n browser: browser,\n os: os,\n node: false,\n // 原生canvas支持,改极端点了\n // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9)\n canvasSupported: document.createElement('canvas').getContext ? true : false,\n // @see <http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript>\n // works on most browsers\n // IE10/11 does not support touch event, and MS Edge supports them but not by\n // default, so we dont check navigator.maxTouchPoints for them here.\n touchEventsSupported: 'ontouchstart' in window && !browser.ie && !browser.edge,\n // <http://caniuse.com/#search=pointer%20event>.\n pointerEventsSupported: 'onpointerdown' in window\n // Firefox supports pointer but not by default, only MS browsers are reliable on pointer\n // events currently. So we dont use that on other browsers unless tested sufficiently.\n // Although IE 10 supports pointer event, it use old style and is different from the\n // standard. So we exclude that. (IE 10 is hardly used on touch device)\n && (browser.edge || browser.ie && browser.version >= 11)\n };\n}", "function isBrowser() {\n return typeof window !== \"undefined\" && (typeof process === 'undefined' ? 'undefined' : _typeof2(process)) === \"object\" && process.title === \"browser\";\n}", "_getDomFromElement(element) {\n if (element.dom) {\n return element.dom;\n }\n\n if (element.element) {\n // console.log('Legacy ui.Element passed to pcui.Container', this.class, element.class);\n return element.element;\n }\n\n return element;\n }", "function returnElement(identifier) {\r\n // Lookup the element\r\n let element = document.querySelector(identifier);\r\n\r\n // Check if result is not valid\r\n if (element === null || element === undefined) {\r\n return false;\r\n }\r\n\r\n // Return Element\r\n return element;\r\n\r\n}", "function get_browser_info() {\n var ua = navigator.userAgent;\n var tem;\n var M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*([\\d\\.]+)/i) || [];\n var rv;\n\n // IE11 detection:\n if (/trident/i.test(M[1])) {\n tem = /\\brv[ :]+(\\d+(\\.\\d+)?)/g.exec(ua) || [];\n return {\n browser: 'MSIE',\n version: tem[1] || ''\n };\n }\n rv = M[2] ? {\n browser: M[1],\n version: M[2]\n } : {\n browser: navigator.appName,\n version: navigator.appVersion,\n unidentified: true\n };\n tem = ua.match(/version\\/([\\.\\d]+)/i);\n if (tem != null) {\n rv.version = tem[1];\n }\n return rv;\n}", "function get_browser_info(){\n\t var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || []; \n\t if(/trident/i.test(M[1])){\n\t tem=/\\brv[ :]+(\\d+)/g.exec(ua) || []; \n\t return {name:'IE',version:(tem[1]||'')};\n\t } \n\t if(M[1]==='Chrome'){\n\t tem=ua.match(/\\bOPR\\/(\\d+)/)\n\t if(tem!=null) {return {name:'Opera', version:tem[1]};}\n\t } \n\t M=M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];\n\t if((tem=ua.match(/version\\/(\\d+)/i))!=null) {M.splice(1,1,tem[1]);}\n\t return {\n\t name: M[0],\n\t version: M[1]\n\t };\n\t }", "function getElementClass(){if(typeof HTMLElement!=='function'){// case of Safari\nvar _BaseElement=function _BaseElement(){};_BaseElement.prototype=document.createElement('div');return _BaseElement;}else{return HTMLElement;}}", "function uTestBrowserIE()\n{\n return (uBrowserID == uIE);\n}", "function KAJAX_browserDetect()\n{\n\tthis.screenHeight = window.screen.availHeight;\n\tthis.screenWidth = window.screen.availWidth;\n\tthis.colorDepth = window.screen.colorDepth;\n\tthis.timeNow = new Date();\n\tthis.referrer = escape(document.referrer);\n\tthis.windows = this.mac = this.linux = \"\";\n\tthis.ie = this.op = this.moz = this.misc = this.browsercode = this.browsername = this.browserversion = this.operatingsys = \"\";\n\tthis.dom = this.ienew = this.ie4 = this.ie5 = this.ie6 = this.moz_rv = this.moz_rv_sub = this.ie5mac = this.ie5xwin = this.opnu = this.op4 = this.op5 = this.op6 = this.op7 = this.saf = this.konq = \"\";\n\tthis.appName = this.appVersion = this.userAgent = \"\";\n\tthis.appName = navigator.appName;\n\tthis.appVersion = navigator.appVersion;\n\tthis.userAgent = navigator.userAgent.toLowerCase();\n\tthis.title = document.title;\n\tthis.DOMBROWSER = \"default\";\n\n\tthis.windows = (this.appVersion.indexOf('Win') != -1);\n\tthis.mac = (this.appVersion.indexOf('Mac') != -1);\n\tthis.linux = (this.appVersion.indexOf('Linux') != -1);\n\n\t// DOM Compatible?\n\tif (!document.layers)\n\t{\n\t\tthis.dom = (document.getElementById ) ? document.getElementById : false;\n\t} else {\n\t\tthis.dom = false;\n\t}\n\n\tif (document.getElementById)\n\t{\n\t\tthis.DOMBROWSER = \"default\";\n\t} else if (document.layers) {\n\t\tthis.DOMBROWSER = \"NS4\";\n\t} else if (document.all) {\n\t\tthis.DOMBROWSER = \"IE4\";\n\t}\n\n\tthis.misc=(this.appVersion.substring(0,1) < 4);\n\tthis.op=(this.userAgent.indexOf('opera') != -1);\n\tthis.moz=(this.userAgent.indexOf('gecko') != -1);\n\tthis.ie=(document.all && !this.op);\n\tthis.saf=((this.userAgent.indexOf('safari') != -1) || (navigator.vendor == \"Apple Computer, Inc.\"));\n\tthis.konq=(this.userAgent.indexOf('konqueror') != -1);\n\n\t// Opera\n\tif (this.op) {\n\t\tthis.op_pos = this.userAgent.indexOf('opera');\n\t\tthis.opnu = this.userAgent.substr((this.op_pos+6),4);\n\t\tthis.op5 = (this.opnu.substring(0,1) == 5);\n\t\tthis.op6 = (this.opnu.substring(0,1) == 6);\n\t\tthis.op7 = (this.opnu.substring(0,1) == 7);\n\n\t// Mozilla\n\t} else if (this.moz){\n\t\tthis.rv_pos = this.userAgent.indexOf('rv');\n\t\tthis.moz_rv = this.userAgent.substr((this.rv_pos+3),3);\n\t\tthis.moz_rv_sub = this.userAgent.substr((this.rv_pos+7),1);\n\t\tif (this.moz_rv_sub == ' ' || isNaN(this.moz_rv_sub)) {\n\t\t\tthis.moz_rv_sub='';\n\t\t}\n\t\tthis.moz_rv = this.moz_rv + this.moz_rv_sub;\n\n\t// IE\n\t} else if (this.ie){\n\t\tthis.ie_pos = this.userAgent.indexOf('msie');\n\t\tthis.ienu = this.userAgent.substr((this.ie_pos+5),3);\n\t\tthis.ie4 = (!this.dom);\n\t\tthis.ie5 = (this.ienu.substring(0,1) == 5);\n\t\tthis.ie6 = (this.ienu.substring(0,1) == 6);\n\t}\n\n\tif (this.konq) {\n\t\tthis.browsercode = \"KO\";\n\t\tthis.browserversion = this.appVersion;\n\t\tthis.browsername = \"Knoqueror\";\n\t} else if (this.saf) {\n\t\tthis.browsercode = \"SF\";\n\t\tthis.browserversion = this.appVersion;\n\t\tthis.browsername = \"Safari\";\n\t} else if (this.op) {\n\t\tthis.browsercode = \"OP\";\n\t\tif (this.op5) {\n\t\t\tthis.browserversion = \"5\";\n\t\t} else if (this.op6) {\n\t\t\tthis.browserversion = \"6\";\n\t\t} else if (this.op7) {\n\t\t\tthis.browserversion = \"7\";\n\t\t} else {\n\t\t\tthis.browserversion = this.appVersion;\n\t\t}\n\t\tthis.browsername = \"Opera\";\n\t} else if (this.moz) {\n\t\tthis.browsercode = \"MO\";\n\t\tthis.browserversion = this.appVersion;\n\t\tthis.browsername = \"Mozilla\";\n\t\tvar result = /.*Firefox\\/([\\d\\.]+).*/.exec(navigator.userAgent);\n\t\tif (result) {\n\t\t\tthis.firefoxVersion = result[1];\n\t\t}\n\t} else if (this.ie) {\n\t\tthis.browsercode = \"IE\";\n\t\tif (this.ie4) {\n\t\t\tthis.browserversion = \"4\";\n\t\t} else if (this.ie5) {\n\t\t\tthis.browserversion = \"5\";\n\t\t} else if (this.ie6) {\n\t\t\tthis.browserversion = \"6\";\n\t\t} else {\n\t\t\tthis.browserversion = this.appVersion;\n\t\t}\n\t\tthis.browsername = \"Internet Explorer\";\n\t}\n\n\tif (this.windows) {\n\t\tthis.operatingsys = \"Windows\";\n\t} else if (this.linux) {\n\t\tthis.operatingsys = \"Linux\";\n\t} else if (this.mac) {\n\t\tthis.operatingsys = \"Mac\";\n\t} else {\n\t\tthis.operatingsys = \"Unkown\";\n\t}\n\n\tif (this.ie)\n\t{\n\t\tthis.innerWidth = this.screenWidth;\n\t\tthis.innerHeight = this.screenHeight;\n\t} else {\n\t\tthis.innerWidth = window.innerWidth;\n\t\tthis.innerHeight = window.innerHeight;\n\t}\n}", "function browserDetectJS() {\n var\n browser = new Array();\n\n//Opera\n if (window.opera) {\n browser[0] = \"Opera\";\n browser[1] = window.opera.version();\n }\n else\n//Chrome\n if (window.chrome) {\n browser[0] = \"Chrome\";\n }\n else\n//Firefox\n if (window.sidebar) {\n browser[0] = \"Firefox\";\n }\n else\n//Safari\n if ((!window.external)&&(browser[0]!==\"Opera\")) {\n browser[0] = \"Safari\";\n }\n else\n//IE\n if (window.ActiveXObject) {\n browser[0] = \"MSIE\";\n if (window.navigator.userProfile) browser[1] = \"6\";\n else\n if (window.Storage) browser[1] = \"8\";\n else\n if ((!window.Storage)&&(!window.navigator.userProfile)) browser[1] = \"7\";\n else browser[1] = \"Unknown\";\n }\n\n if (!browser) return(false);\n else return(browser);\n }", "function cd_testBrowserType(brwType) {\n\treturn (navigator.appName.indexOf(brwType) != -1);\n}", "function Browser()\r\n{\r\n\tthis.IE = false;\r\n\tthis.NS = false;\r\n\tthis.isFireFox1_5 = false;\r\n\tthis.Opera = false;\r\n\tthis.Safari = false;\r\n\tthis.Mac = false;\r\n\tvar userAgent;\r\n\r\n\tuserAgent = navigator.userAgent;\r\n\tif ((userAgent.indexOf(\"Opera\")) >= 0) {\r\n\t\tthis.Opera = true;\r\n\t\treturn;\r\n\t}\r\n\tif ((userAgent.indexOf(\"Safari\")) >= 0) {\r\n\t\tthis.Safari = true;\r\n\t\treturn;\r\n\t}\r\n\r\n\tif ((userAgent.indexOf(\"MSIE\")) >= 0) {\r\n\t\tthis.IE = true;\r\n\t\treturn;\r\n\t}\r\n\r\n\tif ((userAgent.indexOf(\"Netscape6/\")) >= 0) {\r\n\t\tthis.NS = true;\r\n\t\treturn;\r\n\t}\r\n\tif ((userAgent.indexOf(\"Gecko\")) >= 0) {\r\n\t\tif (navigator.productSub>=20051111) {\r\n\t\t\tthis.isFireFox1_5 = true;\r\n\t\t}\r\n\t\tthis.NS = true;\r\n\t\treturn;\r\n\t}\r\n\r\n\tif ((userAgent.indexOf(\"Mac\")) >= 0) {\r\n\t\tthis.Mac = true;\r\n\t\treturn;\r\n\t}\r\n}", "function DETECTBROWSER() {\n var HREFF,\n HREFTXT = \"unknown\";\n this.NAVIGATOR = navigator.userAgent;\n var NAV = navigator.userAgent;\n var gecko, navIpad, operatablet, navIphone, navFirefox, navChrome, navOpera, navSafari, navandroid, mobile, navMozilla;\n gecko = NAV.match(/gecko/gi);\n navOpera = NAV.match(/opera/gi);\n operatablet = NAV.match(/Tablet/gi);\n navIpad = NAV.match(/ipad/gi);\n navIphone = NAV.match(/iphone/gi);\n navFirefox = NAV.match(/Firefox/gi);\n navMozilla = NAV.match(/mozilla/gi);\n navChrome = NAV.match(/Chrome/gi);\n navSafari = NAV.match(/safari/gi);\n navandroid = NAV.match(/android/gi);\n mobile = NAV.match(/mobile/gi);\n window[\"TYPEOFANDROID\"] = 0;\n window[\"NOMOBILE\"] = 0;\n\n var mobile = /iphone|ipad|ipod|android|blackberry|mini|windows\\sce|palm/i.test(navigator.userAgent.toLowerCase());\n if (mobile) {\n var userAgent = navigator.userAgent.toLowerCase();\n if (userAgent.search(\"android\") > -1 && userAgent.search(\"mobile\") > -1) {\n console.log(\"ANDROID MOBILE\");\n } else if (userAgent.search(\"android\") > -1 && !(userAgent.search(\"mobile\") > -1)) {\n console.log(\" ANDROID TABLET \");\n TYPEOFANDROID = 1;\n }\n } else {\n NOMOBILE = 1;\n }\n // FIREFOX za android\n if (navFirefox && navandroid && TYPEOFANDROID == 0) {\n HREFF = \"#\";\n HREFTXT = \"mobile_firefox_android\";\n }\n // FIREFOX za android T\n if (navFirefox && navandroid && TYPEOFANDROID == 1) {\n HREFF = \"#\";\n HREFTXT = \"mobile_firefox_android_tablet\";\n }\n // OPERA ZA ANDROID\n if (navOpera && navandroid) {\n HREFF = \"#\";\n HREFTXT = \"opera_mobile_android\";\n } // provera\n // OPERA ZA ANDROID TABLET\n if (navOpera && navandroid && operatablet) {\n HREFF = \"#\";\n HREFTXT = \"opera_mobile_android_tablet\";\n } // provera\n // safari mobile za IPHONE - i safari mobile za IPAD i CHROME za IPAD\n if (navSafari) {\n var Iphonesafari = NAV.match(/iphone/gi);\n if (Iphonesafari) {\n HREFF = \"#\";\n HREFTXT = \"safari_mobile_iphone\";\n } else if (navIpad) {\n HREFF = \"#\";\n HREFTXT = \"mobile_safari_chrome_ipad\";\n } else if (navandroid) {\n HREFF = \"#\";\n HREFTXT = \"android_native\";\n }\n }\n // TEST CHROME\n if (navChrome && navSafari && navMozilla && TYPEOFANDROID == 1) {\n HREFF = \"#\";\n HREFTXT = \"mobile_chrome_android_tablet\";\n }\n if (navChrome && navSafari && navMozilla && TYPEOFANDROID == 0) {\n HREFF = \"#\";\n HREFTXT = \"mobile_chrome_android\";\n }\n if (navChrome && TYPEOFANDROID == 0) {\n HREFF = \"#\";\n HREFTXT = \"chrome_browser\";\n }\n if (navMozilla && NOMOBILE == 1 && gecko && navFirefox) {\n HREFF = \"#\";\n HREFTXT = \"firefox_desktop\";\n }\n if (navOpera && TYPEOFANDROID == 0 && !mobile) {\n HREFF = \"#\";\n HREFTXT = \"opera_desktop\";\n }\n\n this.NAME = HREFTXT;\n this.NOMOBILE = NOMOBILE;\n}", "function sniffBrowsers() {\r\n\tns4 = document.layers;\r\n\top5 = (navigator.userAgent.indexOf(\"Opera 5\")!=-1) \r\n\t\t||(navigator.userAgent.indexOf(\"Opera/5\")!=-1);\r\n\top6 = (navigator.userAgent.indexOf(\"Opera 6\")!=-1) \r\n\t\t||(navigator.userAgent.indexOf(\"Opera/6\")!=-1);\r\n\t\r\n\tagt = navigator.userAgent.toLowerCase();\r\n\tmac = (agt.indexOf(\"mac\")!=-1);\r\n\tie = (agt.indexOf(\"msie\") != -1); \r\n\tmac_ie = mac && ie;\r\n\tffox = (agt.indexOf(\"firefox\") != -1);\r\n}", "function Browser()\n{\n\tthis.IE = false;\n\tthis.NS = false;\n\tthis.isFireFox1_5 = false;\n\tthis.Opera = false;\n\tthis.Safari = false;\n\tthis.Mac = false;\n\n\tvar userAgent = navigator.userAgent;\n\tif ((userAgent.indexOf(\"Opera\")) >= 0) {\n\t\tthis.Opera = true;\n\t\treturn;\n\t}\n\tif ((userAgent.indexOf(\"Safari\")) >= 0) {\n\t\tthis.Safari = true;\n\t\treturn;\n\t}\n\n\tif ((userAgent.indexOf(\"MSIE\")) >= 0) {\n\t\tthis.IE = true;\n\t\treturn;\n\t}\n\n\tif ((userAgent.indexOf(\"Netscape6/\")) >= 0) {\n\t\tthis.NS = true;\n\t\treturn;\n\t}\n\tif ((userAgent.indexOf(\"Gecko\")) >= 0) {\n\t\tif (navigator.productSub>=20051111) {\n\t\t\tthis.isFireFox1_5 = true;\n\t\t}\n\t\tthis.NS = true;\n\t\treturn;\n\t}\n\n\tif ((userAgent.indexOf(\"Mac\")) >= 0) {\n\t\tthis.Mac = true;\n\t\treturn;\n\t}\n}", "browserClasses() {\n\t\tlet self = this;\n\t\tlet bodyElement = self.getElement(\"body\");\n\t\tif (!!window.MSInputMethodContext && !!document.documentMode)\n\t\t\tbodyElement.classList.add(\"ie11\");\n\t\telse\n\t\t\tbodyElement.classList.add(\"notie11\");\n\t\tif (navigator.vendor.match(/apple/i))\n\t\t\tbodyElement.classList.add(\"safari\");\n\t\tif (navigator.vendor.match(/google/i))\n\t\t\tbodyElement.classList.add(\"chrome\");\n\t\tif (navigator.userAgent.indexOf(\"Edge\") > -1)\n\t\t\tbodyElement.classList.add(\"edge\");\n\t\tif (navigator.userAgent.toLowerCase().indexOf('firefox') > -1)\n\t\t\tbodyElement.classList.add(\"firefox\");\n\t}", "function detect(ua) {\n\t var os = {};\n\t var browser = {};\n\t // var webkit = ua.match(/Web[kK]it[\\/]{0,1}([\\d.]+)/);\n\t // var android = ua.match(/(Android);?[\\s\\/]+([\\d.]+)?/);\n\t // var ipad = ua.match(/(iPad).*OS\\s([\\d_]+)/);\n\t // var ipod = ua.match(/(iPod)(.*OS\\s([\\d_]+))?/);\n\t // var iphone = !ipad && ua.match(/(iPhone\\sOS)\\s([\\d_]+)/);\n\t // var webos = ua.match(/(webOS|hpwOS)[\\s\\/]([\\d.]+)/);\n\t // var touchpad = webos && ua.match(/TouchPad/);\n\t // var kindle = ua.match(/Kindle\\/([\\d.]+)/);\n\t // var silk = ua.match(/Silk\\/([\\d._]+)/);\n\t // var blackberry = ua.match(/(BlackBerry).*Version\\/([\\d.]+)/);\n\t // var bb10 = ua.match(/(BB10).*Version\\/([\\d.]+)/);\n\t // var rimtabletos = ua.match(/(RIM\\sTablet\\sOS)\\s([\\d.]+)/);\n\t // var playbook = ua.match(/PlayBook/);\n\t // var chrome = ua.match(/Chrome\\/([\\d.]+)/) || ua.match(/CriOS\\/([\\d.]+)/);\n\t var firefox = ua.match(/Firefox\\/([\\d.]+)/);\n\t // var safari = webkit && ua.match(/Mobile\\//) && !chrome;\n\t // var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome;\n\t var ie = ua.match(/MSIE\\s([\\d.]+)/)\n\t // IE 11 Trident/7.0; rv:11.0\n\t || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\n\t var edge = ua.match(/Edge\\/([\\d.]+)/); // IE 12 and 12+\n\n\t var weChat = /micromessenger/i.test(ua);\n\n\t // Todo: clean this up with a better OS/browser seperation:\n\t // - discern (more) between multiple browsers on android\n\t // - decide if kindle fire in silk mode is android or not\n\t // - Firefox on Android doesn't specify the Android version\n\t // - possibly devide in os, device and browser hashes\n\n\t // if (browser.webkit = !!webkit) browser.version = webkit[1];\n\n\t // if (android) os.android = true, os.version = android[2];\n\t // if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.');\n\t // if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.');\n\t // if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;\n\t // if (webos) os.webos = true, os.version = webos[2];\n\t // if (touchpad) os.touchpad = true;\n\t // if (blackberry) os.blackberry = true, os.version = blackberry[2];\n\t // if (bb10) os.bb10 = true, os.version = bb10[2];\n\t // if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2];\n\t // if (playbook) browser.playbook = true;\n\t // if (kindle) os.kindle = true, os.version = kindle[1];\n\t // if (silk) browser.silk = true, browser.version = silk[1];\n\t // if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true;\n\t // if (chrome) browser.chrome = true, browser.version = chrome[1];\n\t if (firefox) {\n\t browser.firefox = true;\n\t browser.version = firefox[1];\n\t }\n\t // if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true;\n\t // if (webview) browser.webview = true;\n\n\t if (ie) {\n\t browser.ie = true;\n\t browser.version = ie[1];\n\t }\n\n\t if (edge) {\n\t browser.edge = true;\n\t browser.version = edge[1];\n\t }\n\n\t // It is difficult to detect WeChat in Win Phone precisely, because ua can\n\t // not be set on win phone. So we do not consider Win Phone.\n\t if (weChat) {\n\t browser.weChat = true;\n\t }\n\n\t // os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) ||\n\t // (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/)));\n\t // os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos ||\n\t // (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\\/([\\d.]+)/)) ||\n\t // (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/))));\n\n\t return {\n\t browser: browser,\n\t os: os,\n\t node: false,\n\t // 原生canvas支持,改极端点了\n\t // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9)\n\t canvasSupported: document.createElement('canvas').getContext ? true : false,\n\t // @see <http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript>\n\t // works on most browsers\n\t // IE10/11 does not support touch event, and MS Edge supports them but not by\n\t // default, so we dont check navigator.maxTouchPoints for them here.\n\t touchEventsSupported: 'ontouchstart' in window && !browser.ie && !browser.edge,\n\t // <http://caniuse.com/#search=pointer%20event>.\n\t pointerEventsSupported: 'onpointerdown' in window\n\t // Firefox supports pointer but not by default, only MS browsers are reliable on pointer\n\t // events currently. So we dont use that on other browsers unless tested sufficiently.\n\t // Although IE 10 supports pointer event, it use old style and is different from the\n\t // standard. So we exclude that. (IE 10 is hardly used on touch device)\n\t && (browser.edge || browser.ie && browser.version >= 11)\n\t };\n\t}", "function GetWindowPropertyByBrowser_(win, getters) {\n try {\n if (BR_IsSafari()) {\n return getters.dom_(win);\n } else if (!window.opera &&\n \"compatMode\" in win.document &&\n win.document.compatMode == \"CSS1Compat\") {\n return getters.ieStandards_(win);\n } else if (BR_IsIE()) {\n return getters.ieQuirks_(win);\n }\n } catch (e) {\n // Ignore for now and fall back to DOM method\n }\n\n return getters.dom_(win);\n}", "function query(el){if(typeof el==='string'){var selected=document.querySelector(el);if(!selected){\"development\"!=='production'&&warn('Cannot find element: '+el);return document.createElement('div');}return selected;}else{return el;}}", "function query(el){if(typeof el==='string'){var selected=document.querySelector(el);if(!selected){\"development\"!=='production'&&warn('Cannot find element: '+el);return document.createElement('div');}return selected;}else{return el;}}", "function vanillaQuerySelection(selector) {\n var selectorType = 'querySelectorAll'; //will return a nodelist\n //check to see if we are checking an id\n if (selector.indexOf('#') === 0) {\n selectorType = 'getElementById';//will return an element\n selector = selector.substr(1, selector.length);\n }\n //console.log(document[selectorType](selector));\n return document[selectorType](selector);\n}", "function calcBrowser(customUa){\n\t\tvar _ua = (customUa || ua).toLowerCase(); // use custom user-agent if given\n\n\t\tvar rwebkit = /(webkit)[ \\/]([\\w.]+)/;\n\t\tvar ropera = /(opera)(?:.*version)?[ \\/]([\\w.]+)/;\n\t\tvar rmsie = /(msie) ([\\w.]+)/;\n\t\t//TODO this might needs to be adjusted in future IE version > 11\n\t\tvar rmsienew = /(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;\n\t\tvar rmozilla = /(mozilla)(?:.*? rv:([\\w.]+))?/;\n\n\t\tvar match = rwebkit.exec( _ua ) ||\n\t\t\t\t\tropera.exec( _ua ) ||\n\t\t\t\t\trmsie.exec( _ua ) ||\n\t\t\t\t\trmsienew.exec( _ua ) ||\n\t\t\t\t\t_ua.indexOf(\"compatible\") < 0 && rmozilla.exec( _ua ) ||\n\t\t\t\t\t[];\n\n\t\tvar res = { browser: match[1] || \"\", version: match[2] || \"0\" };\n\t\tres[res.browser] = true;\n\t\treturn res;\n\t}" ]
[ "0.682229", "0.6810615", "0.6802035", "0.6741857", "0.6722031", "0.6676667", "0.6676667", "0.6676667", "0.6676667", "0.6676667", "0.6676667", "0.65737", "0.65662515", "0.6542284", "0.6531858", "0.651296", "0.65059215", "0.64988446", "0.64570963", "0.6447598", "0.6441816", "0.63453007", "0.63382816", "0.63083017", "0.6307632", "0.6279036", "0.62758434", "0.62758434", "0.62758434", "0.62720376", "0.6259818", "0.6259818", "0.6221284", "0.61955786", "0.61925244", "0.61840916", "0.6162073", "0.6140899", "0.6110174", "0.61042386", "0.60867554", "0.6052999", "0.598511", "0.5949111", "0.59209144", "0.58978283", "0.5887095", "0.5880942", "0.5866873", "0.5864534", "0.5848977", "0.5841433", "0.58223057", "0.58223057", "0.58223057", "0.58158326", "0.5793879", "0.5793879", "0.5793879", "0.5793879", "0.577038", "0.57451797", "0.574101", "0.5734109", "0.57297236", "0.5729655", "0.5703482", "0.5702752", "0.5702449", "0.56676817", "0.56591505", "0.56549454", "0.56549454", "0.5650193", "0.564948", "0.56433564", "0.5624742", "0.5622786", "0.5621314", "0.5619896", "0.5616193", "0.5612528", "0.5603526", "0.5597575", "0.5584447", "0.55800533", "0.5579925", "0.5574187", "0.55673707", "0.5564399", "0.5554217", "0.5546538", "0.552638", "0.5525512", "0.5509938", "0.55082834", "0.55013776", "0.54996693", "0.54996693", "0.5495584", "0.5479032" ]
0.0
-1
Creates the menu inside the menu DIV tag in the template
function CreateMenu() { var strMenu; strMenu = '<nav class="navbar navbar-expand-lg">\n' strMenu += '<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">\n' strMenu += ' <span class="navbar-toggler-icon"></span>\n' strMenu += '</button>\n' strMenu += '<div class="collapse navbar-collapse" id="navbarNav">\n' strMenu += ' <ul class="navbar-nav">\n' strMenu += ' <li class="nav-item"><a class="nav-link" id="l_Index" href="index.html">Welcome</a></li>\n' strMenu += ' <li class="nav-item dropdown">\n' strMenu += ' <a class="nav-link dropdown-toggle" id="HomeDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Club Information</a>\n' strMenu += ' <div class="dropdown-menu" aria-labelledby="HomeDropdownMenuLink">\n' strMenu += ' <a class="dropdown-item" id="l_history" href="history.htm">Club history</a>\n' strMenu += ' <a class="dropdown-item" id="l_location" href="location.htm">Location</a>\n' strMenu += ' <a class="dropdown-item" id="l_schedule" href="schedule.htm">Schedule</a>\n' strMenu += ' <a class="dropdown-item" id="l_faq" href="faq.htm">FAQ </a>\n' strMenu += ' <a class="dropdown-item" id="l_rules" href="rules.htm">Range safety</a>\n' strMenu += ' </div>\n' strMenu += ' </li>\n' strMenu += ' <li class="nav-item dropdown">\n' strMenu += ' <a class="nav-link dropdown-toggle" id="MembershipDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Membership</a>\n' strMenu += ' <div class="dropdown-menu" aria-labelledby="MembershipDropdownMenuLink">\n' strMenu += ' <a class="dropdown-item" id="l_membership" href="membership.htm">Info</a>\n' strMenu += ' <a class="dropdown-item" id="l_forms" href="forms.htm">Forms</a>\n' strMenu += ' </div>\n' strMenu += ' </li>\n' strMenu += ' <li class="nav-item dropdown">\n' strMenu += ' <a class="nav-link dropdown-toggle" id="MembershipDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Links</a>\n' strMenu += ' <div class="dropdown-menu" aria-labelledby="MembershipDropdownMenuLink">\n' strMenu += ' <a class="dropdown-item" id="l_shows" href="shows.htm">Shows & Auctions </a>\n' strMenu += ' <a class="dropdown-item" id="l_links" href="links.htm">Shooting links</a>\n' strMenu += ' </div>\n' strMenu += ' </li>\n' strMenu += ' <li class="nav-item"><a class=" nav-link" id="l_events" href="calendar.htm">CALENDAR</a></li>\n' strMenu += ' <li class="nav-item"><a class=" nav-link" id="l_news" href="news.htm">News</a></li>\n' strMenu += ' <li class="nav-item dropdown">\n' strMenu += ' <a class="nav-link dropdown-toggle" id="FacilitiesDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Facilities</a>\n' strMenu += ' <div class="dropdown-menu" aria-labelledby="FacilitiesDropdownMenuLink">\n' strMenu += ' <a class="dropdown-item" id="l_indoors" href="indoors.htm">Indoors </a>\n' strMenu += ' <a class="dropdown-item" id="l_outdoors" href="outdoors.htm">Outdoor </a>\n' strMenu += ' <a class="dropdown-item" id="l_courses" href="courses.htm">Courses </a>\n' strMenu += ' <a class="dropdown-item" id="l_property" href="propertymap.htm">Property map </a>\n' strMenu += ' </div>\n' strMenu += ' </li>\n' strMenu += ' <li class="nav-item dropdown">\n' strMenu += ' <a class="nav-link dropdown-toggle" id="SectionsDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Sections</a>\n' strMenu += ' <div class="dropdown-menu" aria-labelledby="SectionsDropdownMenuLink">\n' strMenu += ' <a class="dropdown-item" id="l_junior" href="junior.htm">Junior program </a>\n' strMenu += ' <a class="dropdown-item" id="l_archery" href="archery.htm">Archery </a>\n' strMenu += ' <a class="dropdown-item" id="l_smallbore" href="smallbore.htm">Smallbore rifles </a>\n' strMenu += ' <a class="dropdown-item" id="l_handgun" href="handgun.htm">Handguns </a>\n' strMenu += ' </div>\n' strMenu += ' </li>\n' strMenu += ' <li class="nav-item"><a class="nav-link" href="board/index.php" target="new">Message Board</a></li>\n' strMenu += ' <li class="nav-item"><a class="nav-link" id="l_contact" href="contact.htm">Contact us </a></li>\n' strMenu += ' </ul>\n' strMenu += '</div>\n' strMenu += '</nav>\n' // Add the menu to the DOM $("#menu").append(strMenu); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 showMainMenu(){\n addTemplate(\"menuTemplate\");\n showMenu();\n}", "function createMenu(){\n\t\n\t\n\t//add menu items by section names\n\tfor(const section of sectionsList){\n\t\t// Create a <li> \n\t\tlet listItem = document.createElement(\"li\"); \n\t\t// Create a <a> \n\t\tlet address = document.createElement(\"a\");\n\t\t//set address location\n\t\taddress.setAttribute(\"href\",\"#\"+section.getAttribute('id')); // Scroll to section on link click\n\t\t//set address showing name\n\t\taddress.textContent = section.getAttribute('data-nav');\n\t\t//add to the list item\n\t\tlistItem.appendChild(address);\n\t\t//add to the menu\n\t\tmyMenu.appendChild(listItem);\n\t}\n}", "function makeMenu(menuItem){\r\n\t\tvar menuLi = document.createElement(\"li\");\r\n\t\tmenuLi.className = \"menuItem\";\r\n\t\tmenuLi.id = menuItem.id;\r\n\t\tvar divMenuItem = document.createElement(\"div\");\r\n\t\t//TODO:mc_\r\n\t\tdivMenuItem.id = \"mc_\" + menuItem.id;\r\n\t\r\n\t\tvar divMenuIcon = document.createElement(\"div\");\r\n\t\t//TODO:mi_\r\n\t\tdivMenuIcon.id = \"mi_\" + menuItem.id;\r\n\t\tdivMenuIcon.className = \"menuItemIcon_blank\";\r\n\t\t\r\n\t\tdivMenuItem.appendChild(divMenuIcon);\r\n\t\t\r\n\t\tvar title = menuItem.directoryTitle || menuItem.title;\r\n\t\tvar divMenuTitle = document.createElement(\"div\");\r\n\t\tdivMenuTitle.id = \"m_\" + menuItem.id;\r\n\t\tif (menuItem.href && !menuItem.linkDisabled) {\r\n\t\t\tvar aTag = document.createElement('a');\r\n\t\t\taTag.appendChild(document.createTextNode(title));\r\n\t\t\tif(/^javascript:/i.test( menuItem.href )){\r\n\t\t\t\taTag.removeAttribute('href');\r\n\t\t\t\taTag.className = 'scriptlink';\r\n\t\t\t\tvar aTagOnClick = function(e) {\r\n\t\t\t\t\teval( menuItem.href );\r\n\t\t\t\t}\r\n\t\t\t\tIS_Event.observe(aTag, \"click\", aTagOnClick, false, \"_menu\");\r\n\t\t\t\tIS_Event.observe(aTag, \"mouseover\", function(){this.className = 'scriptlinkhover';}.bind(aTag), false, \"_menu\");\r\n\t\t\t\tIS_Event.observe(aTag, \"mouseout\", function(){this.className = 'scriptlink';}.bind(aTag), false, \"_menu\");\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\taTag.href = menuItem.href;\r\n\t\t\t\tif(menuItem.display == \"self\") {\r\n\t\t\t\t\taTag.target = \"_self\";\r\n\t\t\t\t} else if(menuItem.display == \"newwindow\"){\r\n\t\t\t\t\taTag.target = \"_blank\";\r\n\t\t\t\t} else {\r\n\t\t\t\tif(menuItem.display == \"inline\")\r\n\t\t\t\t\taTag.target=\"ifrm\";\r\n\t\t\t\t\tvar aTagOnClick = function(e) {\r\n\t\t\t\t\t\tIS_Portal.buildIFrame(aTag);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tIS_Event.observe(aTag, \"click\", aTagOnClick, false, \"_menu\");\r\n\t\t\t\t}\r\n\t\t\t\tIS_Event.observe(aTag, \"mousedown\", function(e){Event.stop(e);}, false, \"_menu\");\r\n\t\t\t}\r\n\t\t\tdivMenuTitle.appendChild(aTag);\r\n\t\t}else{\r\n\t\t\tdivMenuTitle.appendChild(document.createTextNode(title));\r\n\t\t}\r\n\t\tdivMenuTitle.className = \"menuTitle\";\r\n\t\t\r\n\t\tdivMenuItem.appendChild(divMenuTitle);\r\n\t\t\r\n\t\tif ( menuItem.type ){\r\n//\t\t\tvar handler = IS_SiteAggregationMenu.menuDragInit(menuItem, divMenuIcon, divMenuItem);\r\n\t\t\tvar handler = IS_SiteAggregationMenu.getDraggable(menuItem, divMenuIcon, divMenuItem);\r\n\r\n\t\t\tIS_Event.observe(menuLi, \"mousedown\", function(e){\r\n\t\t\t\tEvent.stop(e);\r\n\t\t\t}, false, \"_menu\");\t\r\n\r\n\t\t\tvar returnToMenuFunc = IS_SiteAggregationMenu.getReturnToMenuFuncHandler( divMenuIcon, menuItem.id, handler );\r\n\t\t\tvar displayTabName = IS_SiteAggregationMenu.getDisplayTabNameHandler( divMenuIcon, menuItem.id, handler, returnToMenuFunc, \"_menu\" );\r\n\t\t\t\r\n\t\t\tdivMenuIcon.className = \"menuItemIcon\";\r\n\t\t\tmenuLi.style.cursor = \"move\";\r\n\t\t\tIS_Widget.setIcon(divMenuIcon, menuItem.type, {multi:menuItem.multi});\r\n\t\t\t\r\n\t\t\tif(IS_Portal.isChecked(menuItem) && !/true/.test(menuItem.multi)){\r\n\t\t\t\thandler.destroy();\r\n\t\t\t\tElement.addClassName(divMenuIcon, 'menuItemIcon_dropped');\r\n\t\t\t\tIS_Event.observe(divMenuIcon, 'mouseover', displayTabName, false, \"_menu\");\r\n\t\t\t\tmenuLi.style.cursor = \"default\";\r\n\t\t\t}\r\n\r\n\t\t\t//The time of 200 to 300millsec is lost because addListener execute new Array\r\n\t\t\tfunction getPostDragHandler(menuItemId, handler){\r\n\t\t\t\treturn function(){ postDragHandler(menuItemId, handler);};\r\n\t\t\t}\r\n\t\t\tfunction postDragHandler(menuItemId, handler){\r\n\t\t\t\t//fix 209 The widget can not be dropped to a tab sometimes if it is allowed to be dropped plurally.\r\n\t\t\t\tif( /true/i.test( menuItem.multi ) )\r\n\t\t\t\t\treturn;\r\n\t\t\t\t\r\n\t\t\t\ttry{\r\n//\t\t\t\t\tEvent.stopObserving(menuLi, \"mousedown\", handler, false);\r\n\t\t\t\t\thandler.destroy();\r\n\t\t\t\t\t\r\n\t\t\t\t\tElement.addClassName(divMenuIcon, 'menuItemIcon_dropped');\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(\"mc_\" + menuItemId).parentNode.style.background = \"#F6F6F6\";\r\n\t\t\t\t\t//$(\"m_\" + menuItemId).style.color = \"#5286bb\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tIS_Event.observe(divMenuIcon, 'mouseover', displayTabName, false, \"_menu\");\r\n\t\t\t\t}catch(e){\r\n\t\t\t\t\tmsg.debug(IS_R.getResource(IS_R.ms_menuIconException,[menuItemId,e]));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tmenuLi.style.cursor = \"default\";\r\n\t\t\t}\r\n\t\t\tIS_EventDispatcher.addListener('dropWidget', menuItem.id, getPostDragHandler(menuItem.id,handler), true);\r\n\t\t\tif( menuItem.properties && menuItem.properties.url ) {\r\n\t\t\t\tvar url = menuItem.properties.url;\r\n\t\t\t\tIS_EventDispatcher.addListener( IS_Widget.DROP_URL,url,( function( menuItem,handler ) {\r\n\t\t\t\t\t\treturn function( widget ) {\r\n\t\t\t\t\t\t\tif( !IS_Portal.isMenuType( widget,menuItem )) return;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tpostDragHandler(menuItem.id, handler);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})( menuItem,handler ) );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfunction getCloseWidgetHandler(menuItemId, handler){\r\n\t\t\t\treturn function(){ closeWidgetHandler(menuItemId, handler);};\r\n\t\t\t}\r\n\t\t\tfunction closeWidgetHandler(menuItemId, handler){\r\n\t\t\t\ttry{\r\n//\t\t\t\t\tIS_Event.observe(menuLi, \"mousedown\", handler, false, \"_menu\");\r\n\t\t\t\t\tEvent.observe(handler.handle, \"mousedown\", handler.eventMouseDown);\r\n\t\t\t\t\tIS_Draggables.register(handler);\r\n\t\t\t\t\t\r\n\t\t\t\t\tElement.removeClassName(divMenuIcon, 'menuItemIcon_dropped');\r\n\t\t\t\t\t\r\n//\t\t\t\t\tdivMenuIcon.className = (/MultiRssReader/.test(menuItem.type))? \"menuItemIcon_multi_rss\" : \"menuItemIcon_rss\";\r\n\t\t\t\t\tmenuLi.style.cursor = \"move\"\r\n\t\t\t\t\t\r\n\t\t\t\t\tdivMenuIcon.title = \"\";\r\n\t\t\t\t\tIS_Event.stopObserving(divMenuIcon, 'mouseover', displayTabName, false, \"_menu\");\r\n\t\t\t\t}catch(e){\r\n\t\t\t\t\tmsg.debug(IS_R.getResource(IS_R.ms_menuIconException,[menuItemId,e]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tIS_EventDispatcher.addListener('closeWidget', menuItem.id, getCloseWidgetHandler(menuItem.id, handler), true);\r\n\t\t\tif( menuItem.properties && menuItem.properties.url ) {\r\n\t\t\t\tvar url = menuItem.properties.url;\r\n\t\t\t\tIS_EventDispatcher.addListener( IS_Widget.CLOSE_URL,url,( function( menuItem,handler ) {\r\n\t\t\t\t\t\treturn function( widget ) {\r\n\t\t\t\t\t\t\tif( !IS_Portal.isMenuType( widget,menuItem )) return;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcloseWidgetHandler(menuItem.id, handler);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})( menuItem,handler ) );\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\tif ( IS_SiteAggregationMenu.menuItemTreeMap[menuItem.id] && IS_SiteAggregationMenu.menuItemTreeMap[menuItem.id].length > 0) {\r\n\t\t\tvar divSubMenuIcon = document.createElement(\"div\");\r\n\t\t\tdivSubMenuIcon.className = \"subMenuIcon\";\r\n\t\t\tdivMenuItem.appendChild(divSubMenuIcon);\r\n\t\t}\r\n\t\r\n\t\tmenuLi.appendChild(divMenuItem);\r\n\t\tIS_Event.observe(menuLi,\"mouseout\", getMenuItemMOutHandler(menuLi), false, \"_menu\");\r\n\t\tIS_Event.observe(menuLi,\"mouseover\", getMenuItemMoverFor(menuLi, menuItem), false, \"_menu\");\r\n\t\treturn menuLi;\r\n\t}", "function renderMenu() {\n let logged = loggedin();\n showTemplate(\"menu-template\", \"menu-place\", {loggedin: logged});\n}", "function createMenu() {\n const menu = document.createElement('div');\n menu.classList.add('menu');\n\n menuBorgars.forEach((borgar) => {\n menu.appendChild(borgar);\n });\n\n return menu;\n}", "function Menu() {\n this.name = 'menu';\n this.init(template, style);\n}", "function menuCreate(menu) {\n if (typeof menu !== \"undefined\") {\n elements[menu.id] = new Menu()\n for(let i = 0; i < menu.items.length; i++) {\n elements[menu.id].append(menuItemCreate(menu.items[i]))\n }\n return elements[menu.id]\n }\n return null\n}", "function createMenu(menuListData) {\n let tempHolder = {};\n for (sectionId of allSectionIds) {\n tempHolder['id'] = sectionId.id;\n tempHolder['top'] = sectionId.getBoundingClientRect().top;\n tempHolder['menuName'] = sectionId.getAttribute(\"data-menu\");\n menuListData.push(tempHolder);\n tempHolder = {};\n }\n menuListData.forEach(menuItem => {\n menuItems += (`<li class=\\\"menu-item ${menuItem.id}\\\"><a href=\\\"#${menuItem.id}\\\">${menuItem.menuName}</a></li>`);\n });\n newMenu.innerHTML += menuItems;\n}", "attach() {\n this._menu.appendTo(\"body\");\n }", "function renderNavigationMenu() {\n\n }", "function createMenu(store) {\n\n\tvar menu_html = '<ul id=\"header_menu\">';\n\tvar li_arr = new Array();\n\tvar sub_arr = new Array();\n\n\t// items\n\tstore.each(function(record) {\n\t\t\t\tif (record.get('parent') == '0' || record.get('parent') == '') {\n\t\t\t\t\tli_arr.push(record);\n\t\t\t\t}\n\t\t\t});\n\n\t// sub items\n\tfor (var i = 0; i < li_arr.length; i++) {\n\t\tvar subs = new Array();\n\t\tvar item = li_arr[i];\n\t\tstore.each(function(record) {\n\t\t\t\t\tif (record.get('parent') == item.get('id')) {\n\t\t\t\t\t\tsubs.push(record);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\tsub_arr[i] = subs;\n\t}\n\n\t// ....sub sub items\n\n\t// console.log(li_arr);\n\t// console.log(sub_arr[0]);\n\n\t// build dom\n\tfor (var i = 0; i < li_arr.length; i++) {\n\n\t\tif (sub_arr[i].length > 0) {\n\t\t\tmenu_html += Ext.String.format('<li><a href=\"#\">{0}</a>', li_arr[i]\n\t\t\t\t\t\t\t.get('text'), li_arr[i].get('action'));\n\t\t\tmenu_html += '<ul>';\n\t\t\tfor (var j = 0; j < sub_arr[i].length; j++) {\n\n\t\t\t\tmenu_html += Ext.String\n\t\t\t\t\t\t.format(\n\t\t\t\t\t\t\t\t'<li><a href=\"#\" class=\"can_link\" onclick=\"showView(\\'{1}\\')\">{0}</a></li>',\n\t\t\t\t\t\t\t\tsub_arr[i][j].get('text'), sub_arr[i][j]\n\t\t\t\t\t\t\t\t\t\t.get('action'));\n\t\t\t}\n\t\t\tmenu_html += '</ul>';\n\t\t} else {\n\t\t\tmenu_html += Ext.String\n\t\t\t\t\t.format(\n\t\t\t\t\t\t\t'<li><a href=\"#\" class=\"can_link\" onclick=\"showView(\\'{1}\\')\">{0}</a>',\n\t\t\t\t\t\t\tli_arr[i].get('text'), li_arr[i].get('action'));\n\t\t}\n\t\tmenu_html += '</li>';\n\t}\n\n\tmenu_html += '</ul>';\n\t// console.log(menu_html);\n\treturn menu_html;\n}", "function menuGenerate() {\n // This places the main background\n $(\"body\").addClass(\"home\");\n $(\".menu\").empty();\n $(\".menu\").append(menuHold);\n }", "function creatNavMenu() {\n\n const menuItemToCreate = 'li';\n const menuItemClassName = 'menu__link';\n\n for (let currentItem of navMenuItems) {\n let currentNavMenuItem = document.createElement(menuItemToCreate);\n //using html data set property to manipulate DomStringMap\n currentNavMenuItem.className = menuItemClassName;\n currentNavMenuItem.dataset.nav = currentItem.id;\n currentNavMenuItem.innerText = currentItem.dataset.nav;\n navMenu.appendChild(currentNavMenuItem);\n\n };\n}", "function Menu(group, items) {\n this.menu_name = group;\n this.menu_items = items;\n this.amount = items.length;\n\n // create all of the menu items to be stored in the menu_items array\n this.menu_items.forEach(function(item) {\n item.createDiv('main');\n });\n\n //console.log('New Menu created');\n}", "createMenus (){\n \n $.each(MenuData.menus, ( menuName, menuItems )=>{\n \n $('#gameNav-'+menuName+'Panel > .menu-links').html('');\n \n $.each(menuItems,( index, item )=>{\n \n var realRoute,itemLink,action,routeId;\n \n if(item.hideIfNotAuthenticated && !this.get('session.isAuthenticated')){\n return true;\n }\n \n if(item.label){\n // Translate item label\n let key = \"menu.\"+Ember.String.dasherize(menuName)+\".\"+Ember.String.dasherize(item.label);\n item.tLabel = this.get('i18n').t(key);\n }\n \n // Serialize route name for use as CSS id name\n item.cssRoute = item.route.replace(/\\./g,'_');\n \n // Track actionable link\n let addEvent = true;\n \n if(item.menuRoute){\n \n // For routes which don't appear in the menu but will cause a different menu link to highlight\n itemLink = $('<a id=\"menuItem_'+item.cssRoute+'\" class=\"menu-link game-nav hidden\" data-menu-route=\"'+item.menuRoute+'\"></a>');\n addEvent = false;\n \n } else if(item.tempRoute){\n itemLink = $('<a href=\"/'+item.tempRoute+'\" id=\"menuItem_'+item.cssRoute+'\" class=\"btn-a menu-link game-nav\">'+item.tLabel+'</a>');\n action = 'transitionAction';\n realRoute = item.tempRoute;\n \n } else if(item.route){\n itemLink = $('<a href=\"/'+item.route+'\" id=\"menuItem_'+item.cssRoute+'\" class=\"btn-a menu-link game-nav\">'+item.tLabel+'</a>');\n action = 'transitionAction';\n realRoute = item.route;\n \n if(item.params && item.params.id){\n routeId = item.params.id;\n }\n \n } else if(item.action) {\n itemLink = $('<a class=\"btn-a menu-link game-nav\">'+item.tLabel+'</a>');\n let actionName = 'menuAction'+item.label.alphaNumeric();\n action = actionName;\n this.set(actionName,item.action);\n }\n \n if(itemLink){\n \n if(addEvent){\n itemLink.on('click',(e)=>{\n e.preventDefault();\n this.sendAction(action,realRoute,routeId);\n \n if(routeId){\n Ember.Blackout.transitionTo(realRoute,routeId);\n } else {\n Ember.Blackout.transitionTo(realRoute);\n }\n \n this.selectMenuLink(item.route);\n return false;\n });\n }\n \n $('#gameNav-'+menuName+'Panel > .menu-links').append(itemLink);\n }\n \n });\n });\n\n // Manually update hover watchers\n Ember.Blackout.refreshHoverWatchers();\n \n }", "function BuildNavigationMenu() {\r\n let content = '';\r\n const sectionsList = getAllSections();\r\n sectionsList.forEach(function (section) {\r\n const newLi = this.document.createElement('li');\r\n newLi.id = `li${section.id}`;\r\n newLi.dataset.section = section.id;\r\n newLi.innerHTML = `<a id='aSection${liCount}' href='#${section.id}' data-section='${section.id}' class='menu__link'> ${section.dataset.nav} </a>`;\r\n liCount++;\r\n content += newLi.outerHTML;\r\n })\r\n this.document.querySelector('#navbar__list').innerHTML = content;\r\n}", "function RenderMenu()\n{\n var menu = \"\";//Initialise var\n //Build html output based on page items list.\n menu += '<div class=\"show-for-small\">';\n menu += '<form><label>Choose an article:<select id=\"micromenu\">';\n //Small menu loop\n for (var i = 0; i < PagesList.length; i++)\n {\n if (PagesList[i][1] == curPage)\n {\n menu += '<option value=\"' + PagesList[i][1] + '\" selected>';\n }\n else\n {\n menu += '<option value=\"' + PagesList[i][1] + '\">';\n }\n menu += PagesList[i][1];\n menu += '</option>';\n }\n menu += '</select></label>';\n menu += '</form></div>';\n menu += '<ul class=\"side-nav hide-for-small\">';\n //Large menu loop\n for (var ii = 0; ii < PagesList.length; ii++)\n {\n if (PagesList[ii][1] == curPage)\n {\n menu += '<li class=\"active\">';\n }\n else\n {\n menu += '<li>';\n }\n menu += '<a onClick=\"SetPage(\\'' + PagesList[ii][1] + '\\')\">';\n menu += PagesList[ii][1];\n menu += '</a>';\n menu += '</li>';\n }\n menu += '</ul>';\n return menu;\n}", "initMenu() {\n let menuGroups = this._items.map(menuGroup => {\n let items = menuGroup.map(menuItem => {\n let item = HTMLBuilder.li(\"\", \"menu-item\");\n item.html(menuItem.label);\n\n if (menuItem.action) {\n item.data(\"action\", menuItem.action)\n .click(e => {\n if (!item.hasClass(\"disabled\")) {\n this.controller.doAction(menuItem.action);\n this.closeAll();\n }\n });\n\n let shortcut = this.controller.shortcutCommands[menuItem.action];\n if (shortcut) {\n HTMLBuilder.span(\"\", \"hint\")\n .html(convertShortcut(shortcut))\n .appendTo(item);\n }\n }\n\n if (menuItem.submenu) {\n let submenu = new this.constructor(this, item, menuItem.submenu);\n item.addClass(\"has-submenu\").mouseenter(e => {\n if (!item.hasClass(\"disabled\")) {\n this.openSubmenu(submenu);\n }\n });\n this._submenus.push(submenu);\n }\n\n item.mouseenter(e => {\n if (this._activeSubmenu && item !== this._activeSubmenu.parentItem) {\n this.closeSubmenus();\n }\n });\n\n this.makeItem(item, menuItem);\n\n return item;\n });\n return HTMLBuilder.make(\"ul.menu-group\").append(items);\n });\n\n this._menu = HTMLBuilder.div(`submenu ${this.constructor.menuClass}`, menuGroups);\n\n // make sure submenus appear after the main menu\n this.attach();\n this._submenus.forEach(submenu => {\n submenu.attach();\n });\n }", "function createMenuItem(template) {\n return menuitem_1.MenuItem.fromTemplate(template);\n}", "function createMenuItem(template) {\n return menuitem_1.MenuItem.fromTemplate(template);\n}", "function createContentMenu(){\n\t\"use strict\";\n\n\tvar content_menu = $j(\".content_menu\");\n\tcontent_menu.each(function(){\n\t\tif($j(this).find('ul').length === 0){\n\n\t\t\tif($j(this).css('background-color') !== \"\"){\n\t\t\t\tvar background_color = $j(this).css('background-color');\n\t\t\t}\n\n\t\t\tvar content_menu_ul = $j(\"<ul class='menu'></ul>\");\n\t\t\tcontent_menu_ul.appendTo($j(this));\n\t\t\t\n\t\t\tvar sections = $j(this).siblings('.in_content_menu');\n\t\t\t\n\t\t\tif(sections.length){\n\t\t\t\tsections.each(function(){\n\t\t\t\t\tvar section_href = $j(this).data(\"q_id\");\n\t\t\t\t\tvar section_title = $j(this).data('q_title');\n\t\t\t\t\tvar section_icon = $j(this).data('q_icon');\n\t\t\t\t\t\n\t\t\t\t\tvar li = $j(\"<li />\");\n\t\t\t\t\tvar icon = $j(\"<i />\", {\"class\": 'fa '+section_icon});\n\t\t\t\t\tvar link = $j(\"<a />\", {\"href\": section_href, \"html\": \"<span>\" + section_title + \"</span>\"});\n\t\t\t\t\tvar arrow;\n\t\t\t\t\tif(background_color !== \"\"){\n\t\t\t\t\t\tarrow = $j(\"<div />\", {\"class\": 'arrow', \"style\": 'border-color: '+background_color+' transparent transparent transparent'});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tarrow = $j(\"<div />\", {\"class\": 'arrow'});\n\t\t\t\t\t}\n\t\t\t\t\ticon.prependTo(link);\n\t\t\t\t\tlink.appendTo(li);\n\t\t\t\t\tarrow.appendTo(li);\n\t\t\t\t\tli.appendTo(content_menu_ul);\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n}", "function createMenu() {\n const menu = document.createElement(\"div\");\n for (let section in Menu) {\n menu.appendChild(createDishSection(Menu[section].name));\n menu.appendChild(createDishList(Menu[section].dishes));\n }\n return menu;\n}", "#renderMenu() {\n return html`\n <div class=\"collapse navbar-collapse navbar-ex1-collapse admin-side-navbar\" id=\"${this.#divMenu}\">\n <!-- To check the visibility of each menu and submenu item-->\n <ul class=\"nav navbar-nav left\">\n ${\n UtilsNew.getVisibleItems(this._config.menu, this.opencgaSession)\n .map(item => item.submenu && UtilsNew.hasVisibleItems(item.submenu, this.opencgaSession) ? html `\n <li class=\"dropdown open\">\n <!-- CAUTION: href attribute removed. To discuss: toggle open always-->\n <a class=\"dropdown-toggle\" data-toggle=\"dropdown open\"\n role=\"button\" aria-haspopup=\"true\" aria-expanded=\"true\">\n ${item.name} <!-- <span class=\"caret\"></span> -->\n </a>\n <ul class=\"dropdown-menu\" @click=\"${this._onItemNavClick}\">\n ${\n UtilsNew.getVisibleItems(item.submenu, this.opencgaSession)\n .map(subItem => {\n const type = [\"category\", \"separator\"].find(type => type in subItem);\n switch (type) {\n case \"category\":\n return html `\n <li>\n <a class=\"nav-item-category\"\n style=\"cursor:auto!important;\">\n <strong>${subItem.name}</strong>\n </a>\n <!--<p class=\"navbar-text\">$submenuItem.name}</p>-->\n </li>\n `;\n case \"separator\":\n return html `\n <li role=\"separator\" class=\"divider\"></li>\n `;\n default:\n return html `\n <li class=\"nav-item\" data-id=\"${subItem.id}\">\n <!-- TODO: fix for formatting icon | name -->\n <a class=\"nav-link\">${subItem.name}</a>\n </li>\n `;\n }\n })\n }\n </ul>\n </li>\n ` : html `\n <li>TODO: NO SUBMENU</li>\n `)}\n </ul>\n </div>\n `;\n }", "static createMenus() {\n mobileNavigation.appendChild(menu.cloneNode(true));\n menuToggle.addEventListener(\"click\", () => {\n $(\".mobile-navigation\").slideToggle();\n })\n }", "function createMenu(content, link, status) {\n const menuElement = document.createElement(\"li\");\n const menuLink = document.createElement(\"a\");\n menuLink.href = \"#\";\n menuLink.setAttribute(\"data-link\",link)\n menuLink.setAttribute(\"data-status\", status)\n menuLink.className += \"menu-link\";\n menuLink.textContent = content;\n menuElement.appendChild(menuLink);\n return menuElement;\n }", "function onOpen() { CUSTOM_MENU.add(); }", "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 onOpen() {\n createMenu();\n}", "function generateMenuItems() {\n for (let section of sectionsList) {\n let menuItem = createMenuItem(section.id, section.dataset.nav);\n\n menuBar.appendChild(menuItem);\n }\n}", "generateHTML() {\n return `<nav>${this.generateMenu(this.data)}</nav>`;\n }", "function makeMenues(id){\n$( \"#menu_\"+ id ).menu();\n}", "function renderMenu() {\n const tab = document.getElementById('tab');\n tab.textContent = '';\n\n const title = document.createElement('h1');\n title.textContent = 'WENDY\\'S BURGER';\n\n tab.appendChild(title);\n tab.appendChild(createMenu());\n}", "function generateMenu(htmlContainer, xmlMenu) {\r\n\r\n htmlContainer.innerHTML += \"<ul></ul>\";\r\n htmlContainer = htmlContainer.getElementsByTagName('ul')[0];\r\n\r\n // Adds border-color attribute if the parent node is a topMenu/\r\n if (xmlMenu.parentNode.nodeName == 'topMenu') {\r\n htmlContainer.setAttribute('style', 'border-color:'\r\n + xmlMenu.parentNode.getAttribute('color'));\r\n }\r\n\r\n // Obtains all menus and items from the xmlMenu.\r\n var menus = [];\r\n var items = [];\r\n for (var i = 0; i < xmlMenu.childNodes.length; i++) {\r\n if (xmlMenu.childNodes[i].nodeName == 'menu'\r\n || xmlMenu.childNodes[i].nodeName == 'topMenu')\r\n {\r\n menus.push(xmlMenu.childNodes[i]);\r\n }\r\n else if (xmlMenu.childNodes[i].nodeName == 'item') {\r\n items.push(xmlMenu.childNodes[i]);\r\n }\r\n }\r\n\r\n // Writes each menu in the menus array into the htmlContainer and calls\r\n // generateMenu on the new menu.\r\n for (var i = 0; i < menus.length; i++) {\r\n htmlContainer.innerHTML += '<li><a href='\r\n + menus[i].getAttribute('href')\r\n + ' target=\"main-panel\" class=\"menu collapsed\">'\r\n + menus[i].childNodes[1].innerHTML + '</a></li>';\r\n generateMenu(htmlContainer.childNodes[i],\r\n menus[i].getElementsByTagName('items')[0]);\r\n }\r\n // Adds remaining items into the htmlContainer.\r\n for (var i = 0; i < items.length; i++) {\r\n htmlContainer.innerHTML += '<li><a href='\r\n + items[i].getAttribute('href')\r\n + ' target=\"main-panel\" class=\"item\">'\r\n + items[i].childNodes[1].innerHTML + '</a></li>';\r\n }\r\n}", "function createMenu() {\n $scope.leftPanelBackground = new PIXI.Sprite($scope.texture.leftPanelBackground);\n $scope.leftPanel.addChild($scope.leftPanelBackground);\n\n var buttons = [\n {name: \"Character\", open: characterMenu},\n {name: \"Items\", open: equipmentMenu},\n {name: \"Inventory\", open: inventoryMenu},\n {name: \"Spells\", open: spellsMenu},\n {name: \"Help\", open: helpMenu}\n ];\n\n $scope.menuItems = [];\n for (var i = 0; i < buttons.length; i++) {\n $scope.menuItems.push(createMenuButton(buttons[i]));\n $scope.menuItems[i].position.y = 10 + i*55;\n $scope.leftPanel.addChild($scope.menuItems[i]);\n }\n\n $scope.overlayWindow = new PIXI.Container();\n $scope.overlayWindow.position.x = 160;\n $scope.overlayWindow.renderable = false;\n $scope.interface.addChild($scope.overlayWindow);\n\n $scope.overlayBackground = new PIXI.Sprite($scope.texture.overlayBackground);\n $scope.overlayWindow.addChild($scope.overlayBackground);\n }", "function createSideMenuUi() {\n var html = \"\";\n var botDiv = document.createElement('DIV');\n botDiv.setAttribute(\"class\", \"botSideMenuWrapper\");\n html += '<nav class=\"main-menu\">';\n html += '<ul>';\n \n for(var key in bot_configurations_params.hamburgerButton){\n html += '<li class=\"bot_main_menu\" data-cid=\"'+bot_configurations_params.hamburgerButton[key]['taid']+'\"><a href=\"#\"><img src=\"'+apiUrl+bot_configurations_params.hamburgerButton[key]['icon_path']+'\" style=\"width: 35px; height: 35px; border-radius: 50%; margin: 7px;\"><span class=\"nav-text\">'+bot_configurations_params.hamburgerButton[key]['name']+'</span></a></li>'\n }\n \n // html += '<li class=\"bot_main_menu active\" data-cid=\"functionalities\"><a href=\"#\"><i class=\"fa fa-comments-o fa-2x\"></i><span class=\"nav-text\">Functionalities</span></a></li>';\n // html += '<li class=\"bot_main_menu\" data-cid=\"web\"><a href=\"#\"><i class=\"fa fa-globe fa-2x\"></i><span class=\"nav-text\">Web</span></a></li>';\n // html += '<li class=\"bot_main_menu\" data-cid=\"help\"><a href=\"#\"><i class=\"fa fa-question-circle fa-2x\"></i><span class=\"nav-text\">Help</span></a></li>';\n // html += '<li class=\"bot_main_menu\" data-cid=\"express_yourself\"><a href=\"#\"><i class=\"fa fa-smile-o fa-2x\"></i><span class=\"nav-text\">Express Yourself</span></a></li>';\n // html += '<li class=\"bot_main_menu\" data-cid=\"perform_kyc\"><a href=\"#\"><i class=\"fa fa-camera-retro fa-2x\"></i><span class=\"nav-text\">KYC</span></a></li>';\n // html += '<li class=\"bot_main_menu\" data-cid=\"Pullback and Approvals\"><a href=\"#\"><i class=\"fa fa-check-square-o fa-2x\"></i><span class=\"nav-text\">Pullback and Approvals</span></a></li>';\n // html += '<li class=\"bot_main_menu\" data-cid=\"videos\"><a href=\"#\"><i class=\"fa fa-video-camera fa-2x\"></i><span class=\"nav-text\">Videos</span></a></li>';\n html += '</ul>';\n html += '</nav>';\n html += '</div>';\n botDiv.innerHTML = html;\n \n document.getElementsByClassName('chat_wrapper')[0].appendChild(botDiv);\n }", "function BuildMenu() {\r\n const container = document.createElement(\"div\");\r\n container.className = 'menu';\r\n\r\n const ul = document.createElement(\"ul\");\r\n container.appendChild(ul);\r\n\r\n for(const post of posts) {\r\n const menuItem = document.createElement(\"li\");\r\n \r\n const span = document.createElement(\"span\");\r\n span.className = 'method';\r\n span.innerText = post.data.type.type\r\n\r\n const color = post.GetMethodColor()\r\n\r\n if( color !== '' )\r\n span.setAttribute(color, '');\r\n\r\n const text = document.createTextNode(post.data.path);\r\n\r\n menuItem.appendChild(span);\r\n menuItem.appendChild(text);\r\n\r\n ul.appendChild(menuItem);\r\n\r\n menuItem.addEventListener(\"click\", () => {\r\n post.BuildHTML()\r\n .then( html => document.querySelector(\".content\").innerHTML = html )\r\n });\r\n }\r\n\r\n document.body.insertBefore(container, document.querySelector(\".content\"));\r\n}", "function createMenuPage() {\n\n\n\n //Create page holder\n const menuContainer = document.createElement('div');\n menuContainer.classList.add('menuContainer');\n\n // Add div for item names\n const itemNames = document.createElement('div');\n itemNames.classList.add('itemNames');\n menuContainer.appendChild(itemNames);\n\n //1\n const item1 = document.createElement('div');\n item1.classList.add('item');\n item1.innerText = \"Bacon Burger\";\n itemNames.appendChild(item1);\n\n //2\n const item2 = document.createElement('div');\n item2.classList.add('item');\n item2.innerText = \"Mushroom Burger\";\n itemNames.appendChild(item2);\n\n //3\n const item3 = document.createElement('div');\n item3.classList.add('item');\n item3.innerText = \"Banzai Burger\";\n itemNames.appendChild(item3);\n\n // Add text to middle section\n const middleText = document.createElement('div');\n menuContainer.appendChild(middleText);\n middleText.classList.add('menuContainerInner');\n\n // Loop to create specified number of menu items\n for (let i = 0; i < 3; i++) {\n let menuItem = document.createElement('div');\n menuItem.classList.add('menuItems');\n middleText.appendChild(menuItem);\n list[i] = menuItem;\n }\n\n\n //Add Image1\n const image1 = document.createElement('img');\n image1.src = '/src/bacon-burger.jpg'\n image1.classList.add('menuPic');\n list[0].appendChild(image1);\n\n //Add Image2\n const image2 = document.createElement('img');\n image2.src = '/src/mushroom-burger.jpeg'\n image2.classList.add('menuPic');\n list[1].appendChild(image2);\n\n //Add Image3\n const image3 = document.createElement('img');\n image3.src = '/src/banzai.png'\n image3.classList.add('menuPic');\n list[2].appendChild(image3);\n\n // Append the menu container to the main content container\n content.appendChild(menuContainer);\n\n // Add footer to main content container\n let footer = document.createElement('div');\n footer.classList.add('footer');\n content.appendChild(footer);\n\n\n\n }", "function createMenu() {\n const sections = document.querySelectorAll(\"section\");\n\n const menuTarget = document.querySelector(\"#menu\");\n const docFrag = document.createDocumentFragment();\n\n for (const section of sections) {\n const newA = document.createElement(\"a\");\n const scrollFunc = `javascript:scrollToSection(\"${section.id}\");`;\n newA.setAttribute(\"href\", scrollFunc);\n const newText = document.createTextNode(section.dataset.nav);\n newA.appendChild(newText);\n\n const newLi = document.createElement(\"li\");\n newLi.id = generateMenuLinkId(section.id);\n newLi.appendChild(newA);\n\n docFrag.appendChild(newLi);\n }\n\n menuTarget.appendChild(docFrag);\n}", "function createnavitems()\n{\n const virtualpage = document.createDocumentFragment();\n listSections.forEach(element=>{\n /*add nav bar menu link*/\n const section_id=element.getAttribute(\"id\");\n const section_name =element.getAttribute(\"data-nav\");\n const listitems=document.createElement(\"li\");\n // Scroll to section on link click\n listitems.innerHTML=`<a class=menu__link href=#${section_id}>${section_name}</a> `\n\n virtualpage.appendChild(listitems);\n })\n // Build menu\n document.querySelector(\"#navbar__list\").appendChild(virtualpage)\n}", "function init() {\n let menu = $E('menu', {\n id: kUI.prefMenu.id,\n label: kUI.prefMenu.label,\n accesskey: kUI.prefMenu.accesskey\n });\n\n if (kSiteList.length) {\n let popup = $E('menupopup');\n\n $event(popup, 'command', onCommand);\n\n kSiteList.forEach(({name, disabled}, i) => {\n let menuitem = popup.appendChild($E('menuitem', {\n label: name + (disabled ? ' [disabled]' : ''),\n type: 'checkbox',\n checked: !disabled,\n closemenu: 'none'\n }));\n\n menuitem[kDataKey.itemIndex] = i;\n });\n\n menu.appendChild(popup);\n }\n else {\n $E(menu, {\n tooltiptext: kUI.prefMenu.noSiteRegistered,\n disabled: true\n });\n }\n\n $ID('menu_ToolsPopup').appendChild(menu);\n }", "function buildMenuFromTemplate() {\n const menuTemplate = [\n {\n label: \"View\",\n submenu: [\n { role: \"reload\" },\n { role: \"forcereload\" },\n { role: \"toggledevtools\" },\n { type: \"separator\" },\n { role: \"togglefullscreen\" },\n ],\n },\n {\n label: \"Kryss\",\n submenu: [\n {\n id: \"cancel\",\n label: \"Cancel kryss\",\n accelerator: \"Escape\",\n enabled: false,\n click: () => {\n win.webContents.send(\"cancel\");\n },\n },\n { type: \"separator\" },\n {\n id: \"kryss\",\n label: \"Confirm kryss\",\n accelerator: \"x\",\n enabled: false,\n click: () => {\n win.webContents.send(\"kryss\");\n },\n },\n ],\n },\n {\n role: \"window\",\n submenu: [{ role: \"minimize\" }, { role: \"close\" }],\n },\n {\n role: \"help\",\n submenu: [\n {\n label: \"Don't click me\",\n click: () => {\n retrofitTurboAccelerators();\n },\n },\n ],\n },\n ];\n\n if (process.platform === \"darwin\") {\n menuTemplate.unshift({\n label: app.getName(),\n submenu: [\n { role: \"about\" },\n { type: \"separator\" },\n { role: \"hide\" },\n { role: \"hideothers\" },\n { role: \"unhide\" },\n { type: \"separator\" },\n { role: \"quit\" },\n ],\n });\n\n // Window menu\n menuTemplate[3].submenu = [\n { role: \"close\" },\n { role: \"minimize\" },\n { role: \"zoom\" },\n { type: \"separator\" },\n { role: \"front\" },\n ];\n }\n\n return Menu.buildFromTemplate(menuTemplate);\n}", "function createVerticalMenu(listId, options) {\n\tjq(document).ready(function() {\n\t\tjq(\"#\" + listId).navMenu(options);\n\t});\n}", "buildMenus(){\r\n for(var menu of this.menus)\r\n this.container.innerHTML += this.buildMenu(menu)\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 createNav() {\n for(const section of sections) {\n const navLink = `<a href=\"#${section.id}\" class=\"menu__link ${section.className}\" data-link=\"${section.dataset.nav}\"><li>${section.dataset.nav}</li></a>`;\n navPosition.insertAdjacentHTML('beforeend', navLink);\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 }", "function creatMenuItem(element) {\n let section = element.getAttribute('data-nav');\n let menuItem = document.createElement('li');\n menuItem.classList.add('menu__link');\n menuItem.innerHTML = `<a>${section}</a>`;\n navigationMenu.appendChild(menuItem);\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 createDropdownMenu() {\n return $(\"<ul>\").addClass(\"dropdown-menu\");\n }", "function createTopMenu(menuItem){\r\n\t\tvar topLi = document.createElement(\"li\");\r\n\t\ttopLi.id = menuItem.id;\r\n\t\ttopLi.className = \"topMenuLi\";\r\n\t\ttopLi.style.height = \"1.75em\";//IE\r\n\t\tvar titleA =document.createElement(\"a\");\r\n\t\ttitleA.className = \"topMenuItem\";\r\n\t\ttitleA.title = menuItem.title;\r\n\t\tif(menuItem.href){\r\n\t\t\ttitleA.href = menuItem.href;\r\n\t\t\tif(menuItem.display == \"self\") {\r\n\t\t\t\ttitleA.target = \"_self\";\r\n\t\t\t} else if(menuItem.display == \"newwindow\"){\r\n\t\t\t\ttitleA.target = \"_blank\";\r\n\t\t\t} else {\r\n\t\t\t\tif(menuItem.display == \"inline\")\r\n\t\t\t\t\ttitleA.target=\"ifrm\";\r\n\t\t\t\tvar titleAOnclick = function(e){\r\n\t\t\t\t\tIS_Portal.buildIFrame(titleA);\r\n\t\t\t\t}\r\n//\t\t\t\tIS_Event.observe(titleA, \"click\", titleAOnclick, false, menuItem.id);\r\n\t\t\t\tIS_Event.observe(titleA, \"click\", titleAOnclick, false, \"_menu\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\ttitleA.href = \"#\";\r\n\t\t\ttitleA.style.cursor =\"default\";\r\n\t\t}\r\n\t\t\r\n\t\ttitleA.appendChild(document.createTextNode(menuItem.title));\r\n\t\ttopLi.appendChild(titleA);\r\n\t\tIS_Event.observe(topLi,\"blur\", getTopMenuItemMOutHandler(topLi), false, \"_menu\");\r\n\t\tIS_Event.observe(topLi,\"mouseout\", getTopMenuItemMOutHandler(topLi), false, \"_menu\");\r\n\t\tIS_Event.observe(topLi, \"focus\", getTopMenuMOverHandler(topLi, menuItem), false, \"_menu\");\r\n\t\tIS_Event.observe(topLi, \"mouseover\", getTopMenuMOverHandler(topLi, menuItem), false, \"_menu\");\r\n\t\treturn topLi;\r\n\t}", "function makeUl( parentDomElem, parentMenu ) {\n\n var ulElem = document.createElement(\"ul\");\n parentDomElem.appendChild(ulElem);\n\n var children = parentMenu.children;\n\n for (var i=0; i<children.length; i++) {\n var liElem = document.createElement(\"li\");\n var divElem = document.createElement(\"div\");\n divElem.appendChild(document.createTextNode( children[i].title ));\n ulElem.appendChild( liElem );\n liElem.appendChild( divElem );\n\n if ( children[i].children.length > 0 ) {\n makeUl( liElem, children[i] );\n divElem.addEventListener( \"click\", that.hide.bind( that ) );\n } else {\n divElem.addEventListener( \"click\", emitMenuSelect.bind( that, children[i] ) );\n divElem.className = \"interactive_marker_menuentry\";\n }\n }\n\n }", "function Menu(options) {\n options = options || {};\n this.document = options.document || document;\n this.type = options.type;\n\n // FF can be really hard to debug if doc is null, so we check early on\n if (!this.document) {\n throw new Error('No document');\n }\n\n this.element = util.createElement(this.document, 'div');\n this.element.classList.add(options.menuClass || 'gcli-menu');\n if (options && options.field) {\n this.element.classList.add(options.menuFieldClass || 'gcli-menu-field');\n }\n\n // Pull the HTML into the DOM, but don't add it to the document\n if (menuCss != null) {\n util.importCss(menuCss, this.document, 'gcli-menu');\n }\n\n this.template = util.toDom(this.document, menuHtml);\n this.templateOptions = { blankNullUndefined: true, stack: 'menu.html' };\n\n // Contains the items that should be displayed\n this.items = null;\n\n this.onItemClick = util.createEvent('Menu.onItemClick');\n}", "function buildMenu() {\n for (let section of sectionTxt) {\n let item = document.createElement(\"li\");\n item.innerHTML = section.firstElementChild.innerText;\n // item.href = `#${section.id}`;\n menuItens.appendChild(item);\n menuItens.firstChild.classList.add(\"active\");\n }\n}", "function buildMenu(menu, element) {\n let ul = document.createElement(\"UL\");\n\n for (let i = 0; i < menu.length; i++) {\n\n let li = document.createElement(\"LI\");\n let node_text = document.createTextNode(menu[i].title);\n li.appendChild(node_text);\n\n ul.appendChild(li);\n\n if (!menu[i].disabled) {\n if (menu[i].submenu) {\n buildMenu(menu[i].submenu, li);\n itemBehavior(li, 'submenu');\n }\n if (menu[i].click_handler) itemBehavior(li, 'handler');\n\n }\n\n if (menu[i].disabled) itemBehavior(li, 'disabled');\n\n }\n\n if (element) {\n element.appendChild(ul);\n element.setAttribute(\"class\", \"submenu\");\n }\n\n build_menu = ul;\n }", "function buildNavigation(){\n for (let i=0; i < sectionList.length; i++){\n const newMenuItem = document.createElement('li');\n const sectionName = sectionList[i].getAttribute('data-nav')\n const sectionId = sectionList[i].getAttribute('id')\n newMenuItem.innerHTML = createNavItemHTML(sectionId, sectionName)\n fragment.appendChild(newMenuItem);\n }\n const navBarList = document.getElementById('navbar__list')\n navBarList.appendChild(fragment);\n}", "function initMenu(){\n\toutlet(4, \"vpl_menu\", \"clear\");\n\toutlet(4, \"vpl_menu\", \"append\", \"properties\");\n\toutlet(4, \"vpl_menu\", \"append\", \"help\");\n\toutlet(4, \"vpl_menu\", \"append\", \"rename\");\n\toutlet(4, \"vpl_menu\", \"append\", \"expand\");\n\toutlet(4, \"vpl_menu\", \"append\", \"fold\");\n\toutlet(4, \"vpl_menu\", \"append\", \"---\");\n\toutlet(4, \"vpl_menu\", \"append\", \"duplicate\");\n\toutlet(4, \"vpl_menu\", \"append\", \"delete\");\n\n\toutlet(4, \"vpl_menu\", \"enableitem\", 0, myNodeEnableProperties);\n\toutlet(4, \"vpl_menu\", \"enableitem\", 1, myNodeEnableHelp);\n outlet(4, \"vpl_menu\", \"enableitem\", 3, myNodeEnableBody);\t\t\n outlet(4, \"vpl_menu\", \"enableitem\", 4, myNodeEnableBody);\t\t\n}", "async menu({session,request, response, view}){\n var language_ad = JSON.parse(fs.readFileSync('public/language/'+session.get('lang_ad')+'/back.json', 'utf8'));\n return view.render('back.menu.list',{\n menu: 'active',\n title: language_ad.menu_config,\n heading:language_ad.menu_config,\n btn_add: '/administrator/menu/add'\n })\n }", "function newMenu(){\n\tvar menu = '<div id=\"bottom-menu\">'+\n\t'<a href=\"javascript:history.back()\"><span id=\"backbtn\" onclick=\"goBack();\"></span></a>'+\n\t'<div class=\"arrow\"></div>'+\n\t\t'<ul>'+\n\t\t\t'<li class=\"timeline\"><a href=\"'+PAGE.timeline+'\">'+lan('time line', 'ucw')+'</a></li>'+\n\t\t\t'<li class=\"toptags\"><a href=\"'+PAGE.toptags+'\">'+lan('TOPTAGS_TITLE')+'</a></li>'+\n\t\t\t'<li class=\"hot\"><a href=\"#\">'+lan('hot','ucw')+'</a></li>'+\n\t\t\t// '<li class=\"news\"><a href=\"news.html\">'+lan('NEWS')+'</a></li>'+\n\t\t\t'<li class=\"notifications\"><a href=\"'+PAGE.notify+'\">'+lan('NOTIFICATIONS')+'</a></li>'+\n\t\t\t'<li class=\"groups\"><a href=\"#\">'+lan('groups','ucw')+'</a></li>'+\n\t\t\t'<li class=\"chat\"><a href=\"'+(CORDOVA?'cometchat/i.html':'cometchat/')+'\">'+lan('chat')+'</a></li>'+\n\t\t\t'<li class=\"profile\"><a href=\"'+PAGE.profile+'?id='+$.local('code')+'\">'+lan('profile')+'</a></li>'+\n\t\t\t'<li class=\"friends\"><a href=\"'+PAGE.userfriends+'?type=friends&id_user='+$.local('code')+'\">'+lan('friends','ucw')+'</a></li>'+\n\t\t\t// '<li class=\"createtag\"><a href=\"newtag.html\">'+lan('newTag')+'</a></li>'+\n\t\t\t'<li class=\"store\"><a href=\"store.html\">'+lan('store')+'</a></li>'+\n\t\t\t'<li class=\"logout\"><a href=\"#\" onclick=\"javascript:logout();\">'+lan('logout')+'</a></li>'+\n\t\t'</ul>'+\n\t'</div>';\n\t$('body').append(menu);\n\t$('#bottom-menu ul li.hot').click(function(){\n\t\tvar content='',news=false,hot=false;\n\t\tif (!$('#page-news').length){\n\t\t\tnews=true;\n\t\t\tcontent+='<div><h4>'+lang.NEWS+'</h4><ul id=\"newsInfo\"></ul></div>';\n\t\t}\n\t\tif (!$('#page-trendings').length){\n\t\t\thot=true;\n\t\t\tcontent+='<div><h4>'+lan('hot','ucw')+'</h4><ul id=\"trendings\"></ul></div>';\n\t\t}\n\t\tmyDialog({\n id:'prevNewsAndHot-dialogs',\n content :content,\n scroll:true,\n after:function(){\n \tif (hot) getTrendings(3,true)\n \tif (news){\n \t\tvar action={refresh:{refresh:true},more:{}},$info=$('#newsInfo'),on={};\n \t\tgetNews('reload',action.more,on,$info,true);\n \t\t$info.on('click','li[data-type]',function(){\n\t\t\t\t\t\tvar type=this.dataset.type,\n\t\t\t\t\t\t\tsource=this.dataset.source,\n\t\t\t\t\t\t\turl='';\n\t\t\t\t\t\tswitch(type){\n\t\t\t\t\t\t\tcase 'tag':url=PAGE['tag']+'?id='+source; break;\n\t\t\t\t\t\t\tcase 'usr':url=PAGE['profile']+'?id='+source; break;\n\t\t\t\t\t\t\tcase 'product':url=PAGE['detailsproduct']+'?id='+source; break;\n\t\t\t\t\t\t\tdefault: alert(type);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(url){ redir(url); }\n\t\t\t\t\t});\n \t}\n },\n buttons:[],\n backgroundClose: true\n });\n\t});\n\n\t//Grupos\n\t$('#bottom-menu ul li.groups').click(function(){\n\t\tvar content='';\n\t\t\n\t\tcontent+='<di><h4>'+lan('mygroups','ucw')+'</h4><ul id=\"myGroups\"></ul></div>';\n\t\tcontent+='<di><h4>'+lan('allgroups','ucw')+'</h4><ul id=\"allGroups\"></ul></div>';\n\t\t\n\t\tmyDialog({\n id:'groups-dialogs',\n content :content,\n scroll:true,\n after:function(){\n \tgetGroups($.local('code'),true);\n },\n buttons:[],\n backgroundClose: true\n });\n\t});\n}", "function createCategoryDiv(menu) {\n let div = document.createElement(\"div\");\n div.id = \"categories\";\n let list = document.createElement(\"ul\");\n \n Object.keys(menu).forEach(category => {\n let elem = document.createElement(\"li\");\n let text = document.createTextNode(category);\n let link = document.createElement(\"a\");\n link.href = \"#\" + category;\n link.appendChild(text);\n elem.appendChild(link);\n list.appendChild(elem);\n });\n\n div.appendChild(list);\n return div;\n\n}", "function VixenMenuClass(objMenu)\n{\n\t//Config\n\tthis.config = \n\t{ \n\t\t'Level1': \n\t\t{\n\t\t\t'left': 10,\n\t\t\t'width': 50,\n\t\t\t'height': 50,\n\t\t\t'spacing': 5,\n\t\t\t'backgroundColor': \"#FFFFFF\"\n\t\t},\n\t\t'Level2': \n\t\t{\n\t\t\t'left': 0,\n\t\t\t'width': 160,\n\t\t\t'height': 20,\n\t\t\t'spacing': 5,\n\t\t\t'backgroundColor': \"#D5E0F8\"\n\t\t},\n\t\t'waitOpen': 0,\n\t\t'waitCloseLevel': 500,\n\t\t'waitClose': 1500,\n\t\t'waitCloseWhenSelected': 400,\n\t\t'highlightColor': \"#FFFFCC\"\n\t};\n\t\n\tthis.objMenu = objMenu;\n\t\n\tthis.SetMenu = function(objMenu)\n\t{\n\t\tthis.objMenu = objMenu;\n\t}\n\t\n\tthis.Render = function()\n\t{\n\t\t//debug ('firsttime');\n\t\tvar strKey;\n\t\tvar objNode;\n\t\tvar elmNode;\n\t\tvar top = this.config.Level1.spacing;\n\t\t\n\t\t//Find menu container\n\t\telmMenu = document.getElementById('VixenMenu');\n\t\telmMenu.style['overflow'] = 'visible';\n\t\t\n\t\t//Render the initial menu (top-level)\n\t\tfor (strKey in this.objMenu)\n\t\t{\n\t\t\t//Build new element\n\t\t\tobjNode = document.createElement('a');\n\t\t\tobjNode.setAttribute('className', 'ContextMenuItem');\n\t\t\tobjNode.setAttribute('class', 'ContextMenuItem');\n\t\t\tobjNode.setAttribute('Id', 'VixenMenu_' + strKey);\n\n\t\t\t//Build the image for the new element\n\t\t\tobjNodeImage = document.createElement('img');\n\t\t\tobjNodeImage.setAttribute('src', 'img/template/' + strKey.toLowerCase().replace(/ /g, '_') + '.png');\n\n\t\t\tobjNode.appendChild(objNodeImage);\n\n\t\t\t//Attach to elmMenu\n\t\t\telmMenu.appendChild(objNode);\n\t\t\telmNode = document.getElementById('VixenMenu_' + strKey);\n\t\t\t\n\t\t\t//Add styles\n\t\t\t//new_node.style[c_attrib] = value\n\t\t\telmNode.style['top'] \t\t\t\t= top;\n\t\t\telmNode.style['left'] \t\t\t\t= this.config.Level1.left;\n\t\t\telmNode.style['width'] \t\t\t\t= this.config.Level1.width;\n\t\t\telmNode.style['height'] \t\t\t= this.config.Level1.height;\n\t\t\telmNode.style['backgroundColor']\t= this.config.Level1.backgroundColor;\n\t\t\telmNode.style['position'] \t\t\t= 'absolute';\n\t\t\telmNode.style['zIndex']\t\t\t\t= 2;\n\t\t\telmNode.DefaultBackgroundColor\t\t= this.config.Level1.backgroundColor;\n\t\t\t\n\t\t\ttop = top + this.config.Level1.height + this.config.Level1.spacing;\n\t\t\t\n\t\t\t//Add events\n\t\t\telmNode.onclick = function(event) {Vixen.Menu.HandleClick(this)};\n\t\t\telmNode.onmouseover = function(event) {Vixen.Menu.HandleMouseOver(this)};\n\t\t\telmNode.onmouseout = function(event) {Vixen.Menu.HandleMouseOut(this)};\n\t\t\telmNode.style.cursor = \"default\";\n\t\t\t\n\t\t\t//Add some more crap\n\t\t\telmNode.action = this.objMenu[strKey];\n\t\t\tif (typeof(elmNode.action) == 'string')\n\t\t\t{\n\t\t\t\t// Don't set the link if the action opens a popup\n\t\t\t\tif (elmNode.action.substr(0, 11) == \"javascript:\")\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// The item is an action, not a menu. Set the link\n\t\t\t\t\telmNode.setAttribute('href', this.objMenu[strKey]);\n\t\t\t\t}\n\t\t\t}\n\t\t\telmNode.level = 1;\n\t\t}\n\t}\n\t\n\tthis.RenderSubMenu = function(elmMenuItem)\n\t{\n\t\tvar strKey;\n\t\tvar objTextNode;\n\t\tvar elmNode;\n\t\tvar top = 0;\n\n\t\tif (typeof(elmMenuItem) == 'string')\n\t\t{\n\t\t\telmMenuItem = document.getElementById(elmMenuItem);\t\n\t\t}\n\n\t\tvar object = document.getElementById('VixenMenu__' + elmMenuItem.level);\n\t\tif (object)\n\t\t{\n\t\t\tobject.parentNode.removeChild(object);\n\t\t}\n\t\t\n\t\t//Create and attach the container div for the rest of the submenu to sit in\n\t\tvar objContainer = document.createElement('div');\n\t\tobjContainer.setAttribute('Id', 'VixenMenu__' + elmMenuItem.level);\n\t\tobjContainer.style.top\t\t\t\t= this.RemovePx(elmMenuItem.style['top']);\n\t\tobjContainer.style.left\t\t\t\t= this.RemovePx(elmMenuItem.style['left']) + this.RemovePx(elmMenuItem.style['width']) + this.config.Level2.spacing;\n\t\tobjContainer.style.position\t\t\t= 'absolute';\n\t\tobjContainer.style.overflow\t\t\t= 'visible';\n\t\tobjContainer.style.backgroundColor\t= \"#FFFFFF\";\n\t\tobjContainer.style.width\t\t\t= this.config.Level2.width + this.config.Level2.spacing;\n\t\tobjContainer.style.zIndex\t\t\t= 2;\n\n\t\telmMenuItem.parentNode.appendChild(objContainer);\n\t\tvar elmContainer = document.getElementById('VixenMenu__' + elmMenuItem.level);\n\t\t//elmContainer.style['top'] = this.RemovePx(elmMenuItem.style['top']);\n\t\t//elmContainer.style['left'] = this.RemovePx(elmMenuItem.style['left']) + this.RemovePx(elmMenuItem.style['width']) + this.config.Level2.spacing;\n\t\t//elmContainer.style['position'] = 'absolute';\n\t\t//elmContainer.style['overflow'] = 'visible';\n\n\t\tvar intContainerHeight = 0;\n\t\t\n\t\t//Render the menu\n\t\tfor (strKey in elmMenuItem.action)\n\t\t{\n\t\t\t//Build new element\n\t\t\telmNode = document.createElement('div');\n\t\t\telmNode.setAttribute('Id', elmMenuItem.id + \"_\" + strKey);\n\t\t\t\n\t\t\tobjTextNode = document.createTextNode(strKey);\n\t\t\t\n\t\t\t// Add an anchor element to the menu item div if the action of the menu item is a string and does not envoke any javascript\n\t\t\t// This is done, so the user has the option of opening the page in a new tab\n\t\t\t// It is also done in a very hacky fashion as the user has to right click on the text; it can't just be anywhere on the menu item\n\t\t\tif ((typeof(elmMenuItem.action[strKey]) == 'string') && (elmMenuItem.action[strKey].substr(0, 11) != \"javascript:\"))\n\t\t\t{\n\t\t\t\telmLink = document.createElement('a');\n\t\t\t\telmLink.setAttribute('href', elmMenuItem.action[strKey]);\n\t\t\t\telmLink.setAttribute('id', \"ContextMenuItemLink\");\n\t\t\t\t//elmLink.appendChild(objTextNode);\n\t\t\t\telmLink.innerHTML = strKey;\n\t\t\t\telmNode.appendChild(elmLink);\n\t\t\t\t//elmLink.style['color']\t= \"#000000\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Add text to the node\n\t\t\t\telmNode.appendChild(objTextNode);\n\t\t\t}\n\t\t\t\n\t\t\t//Add styles\n\t\t\t//new_node.style[c_attrib] = value\n\t\t\telmNode.style['top'] \t\t\t= top;\n\t\t\telmNode.style['left'] \t\t\t= this.config.Level2.left; \n\t\t\telmNode.style['width'] \t\t\t= this.config.Level2.width;\n\t\t\telmNode.style['height'] \t\t= this.config.Level2.height;\n\t\t\telmNode.style['backgroundColor'] = this.config.Level2.backgroundColor;\n\t\t\telmNode.style['position']\t\t= 'absolute';\n\t\t\telmNode.style['zIndex']\t\t\t= 3;\n\t\t\telmNode.DefaultBackgroundColor\t= this.config.Level2.backgroundColor;\n\n\t\t\ttop = top + this.config.Level2.height + this.config.Level2.spacing;\n\t\t\t\n\t\t\t//Add events\n\t\t\telmNode.onclick\t\t\t= function(event) {Vixen.Menu.HandleClick(this)};\n\t\t\telmNode.onmouseover\t\t= function(event) {Vixen.Menu.HandleMouseOver(this)};\n\t\t\telmNode.onmouseout\t\t= function(event) {Vixen.Menu.HandleMouseOut(this)};\n\t\t\t\n\t\t\t//Add some more crap\n\t\t\telmNode.action = elmMenuItem.action[strKey];\n\t\t\telmNode.level = elmMenuItem.level + 1;\n\t\t\telmNode.style.cursor = \"default\";\n\n\t\t\t// set the class\n\t\t\telmNode.className \t= 'ContextMenuItem';\n\t\t\telmNode.Class \t\t= 'ContextMenuItem';\n\t\t\t\n\t\t\t// Add the menu item element to the container\n\t\t\telmContainer.appendChild(elmNode);\n\t\t}\n\t}\n\t\n\tthis.Close = function(intLevel)\n\t{\n\t\tvar object = document.getElementById('VixenMenu__' + intLevel);\n\t\tif (object)\n\t\t{\n\t\t\tobject.parentNode.removeChild(object);\n\t\t}\n\t}\n\t\n\tthis.HandleClick = function(objMenuItem)\n\t{\n\t\tclearTimeout(this.timeoutOpen);\n\t\tclearTimeout(this.timeoutClose);\n\t\tif (typeof(objMenuItem.action) == 'string')\n\t\t{\n\t\t\t// Check if the menu item is a href or a call to javascript code\n\t\t\tif (objMenuItem.action.substr(0, 11) == \"javascript:\")\n\t\t\t{\n\t\t\t\t// Execute objMenuItem.action as javascript\n\t\t\t\teval(objMenuItem.action.substr(11));\n\t\t\t} \n\t\t\telse\n\t\t\t{\n\t\t\t\t// Follow the link\n\t\t\t\tdocument.location.href = objMenuItem.action;\n\t\t\t}\n\t\t\tthis.timeoutClose = setTimeout(\"Vixen.Menu.Close(1)\", this.config.waitCloseWhenSelected);\t\t\t\n\t\t}\n\t\telse if (typeof(objMenuItem.action) == 'object')\n\t\t{\n\t\t\t//display submenu\n\t\t\t// no need, it adds unnecessary overhead\n\t\t\t//this.RenderSubMenu(objMenuItem);\t\t\t\n\t\t}\n\t}\n\t\n\tthis.HandleMouseOver = function(objMenuItem)\n\t{\n\t\tclearTimeout(this.timeoutClose);\n\t\t\n\t\t//objMenuItem.setAttribute('className', 'ContextMenuItemHighlight');\n\t\t//objMenuItem.setAttribute('class', 'ContextMenuItemHighlight');\n\t\t\n\t\tobjMenuItem.style['backgroundColor'] = this.config.highlightColor;\n\t\t\n\t\tif (typeof(objMenuItem.action) == 'string')\n\t\t{\n\t\t\tthis.timeoutOpen = setTimeout(\"Vixen.Menu.Close('\" + objMenuItem.level + \"');\", this.config.waitCloseLevel);\n\t\t}\n\t\tif (typeof(objMenuItem.action) == 'object')\n\t\t{\n\t\t\tclearTimeout(this.timeoutOpen);\n\n\t\t\t//display submenu\n\t\t\tthis.timeoutOpen = setTimeout(\"Vixen.Menu.RenderSubMenu('\" + objMenuItem.id + \"');\", this.config.waitOpen);\t\t\t\n\t\t}\n\t}\n\t\n\tthis.HandleMouseOut = function(objMenuItem)\n\t{\n\t\tclearTimeout(this.timeoutOpen);\n\t\t\n\t\t//objMenuItem.setAttribute('className', 'ContextMenuItem');\n\t\t//objMenuItem.setAttribute('class', 'ContextMenuItem');\n\t\tobjMenuItem.style['backgroundColor'] = objMenuItem.DefaultBackgroundColor;\n\t\t\n\t\tthis.timeoutClose = setTimeout(\"Vixen.Menu.Close(1)\", this.config.waitClose);\n\n\t}\n\t\n\tthis.RemovePx = function(value)\n\t{\n\t\tif (value != Number(value))\n\t\t{\n\t\t\t\treturn Number(value.slice(0,-2))\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\treturn Number(value);\n\t\t}\n\t} \n}", "function buildMenu() {\r\n\tlet html = `\r\n\t\t<a class=\"import\" tabindex=\"0\">Merge (import)</a>\r\n\t`;\r\n\tfor (const key in mergers) {\r\n\t\tif (!mergers.hasOwnProperty(key)) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tconst merger = mergers[key];\r\n\t\thtml += `<a class=\"export\" data-merger=\"${key}\" tabindex=\"0\">${merger.exportLabel}</a>`;\r\n\t}\r\n\r\n\treturn html;\r\n}", "function registerMenu(menuName, menuItemArray) {\n /*\n <li class=\"menu-home\">\n\n <a>Home</a>\n \n\n <ul class=\"menu-chapter\">\n <li><a href=\"#\"><span>Home</span></a></li>\n <li><a href=\"#\"><span>About</span></a></li>\n <li><a href=\"#\"><span>Info</span></a></li>\n </ul>\n </li>\n\n */\n var str = \"<li class='menu-home'>\"; //the opening tag\n str += \"<a>\" + menuName + \"</a>\"; //the title\n str += \"<ul class='menu-chapter'>\"; //and the start of submenu\n\n var idsList = [];\n\n for (index = 0; index < menuItemArray.length; ++index) {\n var item = menuItemArray[index];\n str += \"<li><a href='\" + item.target + \"' \" + (item.newTab ? \"target='_blank'\" : \"\") + \"><span>\" + item.name + \"</span></a></li>\";\n }\n\n\n str += \"</ul></li>\"; //the closing tag\n\n //and add to DOM\n $(\"#topnav\").append(str);\n\n //and parse dynamic functions\n for (index = 0; index < idsList.length; ++index) {\n $(\"#\" + idsList[index].id).click(idsList[index].func);\n }\n\n //and close\n navbarClosed = false;\n processMenuHooks();\n closeOrOpenNavbar();\n}", "function setup_menu() {\n $('div[data-role=\"arrayitem\"]').contextMenu('context-menu1', {\n 'remove item': {\n click: remove_item,\n klass: \"menu-item-1\" // a custom css class for this menu item (usable for styling)\n },\n }, menu_options);\n $('div[data-role=\"prop\"]').contextMenu('context-menu2', {\n 'remove item': {\n click: remove_item,\n klass: \"menu-item-1\" // a custom css class for this menu item (usable for styling)\n },\n }, menu_options);\n }", "function loadTemplate() {\n\t\t\t//Check if template is already specified as an argument\n\t\t\t$tpl = /^</.test(settings.template) ? settings.template : $('#' + settings.template).html();\n\n\t\t\tif (!settings.container_id) {\n\t\t\t\tthrow 'Please specify settings.container_id for the menu component.';\n\t\t\t}\n\n\t\t\t$list = $('#' + settings.container_id);\n\n\t\t\tif (!$list.length) {\n\t\t\t\t//Take the menu element and append it to the body\n\t\t\t\t$('body').append(us.template($tpl, settings));\n\t\t\t\t$list = $('#' + settings.container_id);\n\t\t\t}\n\n\t\t\t//Bind events\n\t\t\tbindEvents();\n\t\t}", "function createNav() {\n var content = [\"About\", \"Projects\", \"Contact\"];\n content.forEach(function(item, i) {\n var liItem = $(\"<li><a id='\" + content.indexOf(item) +\n \"' class='nav-link'>\" + item + \"</a></li>\");\n $('.nav-list').append(liItem);\n liItem.click(function() {\n navRouter(liItem);\n });\n });\n }", "function createNavItems() {\r\n allSections.forEach(sec => {\r\n let newNavItem = document.createElement('li'); // create list item\r\n let newNavAnchor = document.createElement('a'); // create anchor element\r\n let navItemName = sec.getAttribute('data-nav'); // get list item name from data-nav\r\n let navItemLink = sec.getAttribute('id'); //get item link from id\r\n newNavAnchor.text = navItemName; // give new anchor it's text\r\n newNavAnchor.href = \"#\"+navItemLink; // give new anchoe it's link\r\n newNavAnchor.className = ('menu__link'); // add class to anchor\r\n newNavItem.className = ('navbar__menu li'); // add class to list item\r\n newNavItem.appendChild(newNavAnchor); // append anchors to lis items\r\n docFragment.appendChild(newNavItem); // append list items to fragment\r\n });\r\n navBar.appendChild(docFragment); // append created fragment to navigation bar\r\n navBar.className = ('navbar__menu ul'); // give class to navigation bar\r\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 wrapMenu(menu){\n menu.addClass('menu').find('>div').each(function(){\n var item = $(this);\n if (item.hasClass('menu-sep')){\n item.html('&nbsp;');\n } else {\n // the menu item options\n var itemOpts = $.extend({}, $.parser.parseOptions(this, ['name', 'iconCls', 'href']), {\n disabled:(item.prop('disabled') ? true : undefined)\n });\n item.attr('name', itemOpts.name || '').attr('href', itemOpts.href || '');\n\n var text = item.addClass('menu-item').html();\n item.empty().append($('<div class=\"menu-text\"></div>').html(text));\n\n if (itemOpts.iconCls) {\n $('<div class=\"menu-icon\"></div>').addClass(itemOpts.iconCls).appendTo(item);\n }\n if (itemOpts.disabled) {\n setDisabled(target, item[0], true);\n }\n\n if (item[0].submenu){\n $('<div class=\"menu-rightarrow\"></div>').appendTo(item);\t// has sub menu\n }\n\n item._outerHeight(22);\n }\n });\n menu.hide();\n }", "function menu(id, pageName){\n\t\t/* for each 'item' inside the menuItemsLeft variable do... \n\t\tIt means each item inside the array is observed and necessary\n\t\tmodifications are done */\n\t\tmenuItemsLeft.forEach((item)=>{\n\n\t\t\t//creating li and a tags for navigation\n\t\t\tvar li = document.createElement(\"li\");\n\t\t\tvar a = document.createElement(\"a\");\n\n\t\t\t/* if \"item\" in menuItemsLeft is equal to \"home\", add\n\t\t\thref attribute as index.html; else if it is equal to\n\t\t\tpageName parameter, add \"active\" \"class\"(materialize) to 'li' tag\n\t\t\tand\titem.html attribute to \"a\" tag; else add to \"a\" tag \n\t\t\t\"dropdown-button\" class(materialize),link and \"data-activates\" attributes*/\n\t\t\tif (item.toLowerCase() === \"home\") {\n\t\t\t\ta.setAttribute(\"href\", \"index.html\");\n\t\t\t} else if (item.toLowerCase() === pageName){\n\t\t\t\tli.setAttribute(\"class\", \"active\");\n\t\t\t\ta.setAttribute(\"href\", item.toLowerCase()+\".html\");\n\t\t\t} else {\n\t\t\t\ta.setAttribute(\"class\", \"dropdown-button\");\n\t\t\t\ta.setAttribute(\"href\", item.toLowerCase()+\".html\");\n\t\t\t\ta.setAttribute(\"data-activates\", item.toLowerCase());\n\t\t\t};\n\n\t\t\t//adding item to 'a' tag as inner element\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);\n\t\t});\n\t}", "function startBuildingNavMenu() {\n let elementFragment = document.createDocumentFragment();\n landingPageSections.forEach((sect, index) => {\n let itsLi = document.createElement(\"li\"),\n itsAnchor = document.createElement(\"a\");\n itsAnchor.href = `#${sect.id}`;\n itsAnchor.innerText = sect.dataset.nav;\n itsAnchor.className = `menu__link${\n index === 0 ? \" currently__active\" : \"\"\n }`;\n itsLi.appendChild(itsAnchor);\n elementFragment.appendChild(itsLi);\n });\n navbar__list.appendChild(elementFragment);\n}", "function MENU_HEADER$static_(){ToolbarSkin.MENU_HEADER=( new ToolbarSkin(\"menu-header\"));}", "function generateNav() {\n sections.forEach(section => {\n let listItem = document.createElement('li')\n let anchorItem = document.createElement('a')\n anchorItem.classList.add('menu__link', `${section.id}`) //add class attribute to anchorItem\n anchorItem.setAttribute('href', `#${section.id}`) //add href attribute to anchorItem, which links to each sections of the page\n anchorItem.innerText = section.dataset.nav //make section IDs visible as menu link on navigation bar\n listItem.appendChild(anchorItem) //append <a> element to <li>\n ul.appendChild(listItem) //append <li> element to <ul>\n })\n}", "function createMenu(element, config, id){\n\t\tvar menu = document.createElement(\"div\");\n\t\t\n\t\tif(id){\n\t\t\tmenu.id = id;\n\t\t}\n\t\t\n\t\tmenu.className = \"dropdown\";\n\t\tif(config.customClass && typeof config.customClass == \"string\"){\n\t\t\tmenu.className += \" \" + config.customClass;\n\t\t}\n\t\t\n\t\tmenu.style[\"position\"] = \"absolute\";\n\t\t\n\t\tswitch(config.type){\n\t\t\tcase \"click\":\n\t\t\t\tutil.addEventListener(element, \"click\", function(){\n\t\t\t\t\tif(!util.getClassesFor(menu).contains(\"dropdown-active\")){\n\t\t\t\t\t\t// make the menu active\n\t\t\t\t\t\tutil.addClass(menu, \"dropdown-active\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Can only calculate its position once it's beign rendered and has a size.\n\t\t\t\t\t\tvar pos = calculatePosition(element, menu, config.direction, config.centered);\n\t\t\t\t\t\tmenu.style[\"left\"] = pos.left + \"px\";\n\t\t\t\t\t\tmenu.style[\"top\"] = pos.top + \"px\";\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tvar pageItems = document.getElementsByClassName(\"page-item\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tutil.removeClass(menu, \"dropdown-active\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tutil.removeClassFromArray(pageItems, \"enter-from-right\");\n\t\t\t\t\t\tutil.removeClassFromArray(pageItems, \"enter-from-left\");\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\tbreak;\n\t\t\tcase \"mouseover\":\n\t\t\t\tutil.addEventListener(element, \"mouseover\", function(){\n\t\t\t\t\tif(!util.getClassesFor(menu).contains(\"dropdown-active\")){\n\t\t\t\t\t\t// make the menu active\n\t\t\t\t\t\tutil.addClass(menu, \"dropdown-active\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Can only calculate its position once it's beign rendered and has a size.\n\t\t\t\t\t\tvar pos = calculatePosition(element, menu, config.direction, config.centered);\n\t\t\t\t\t\tmenu.style[\"left\"] = pos.left + \"px\";\n\t\t\t\t\t\tmenu.style[\"top\"] = pos.top + \"px\";\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\n\t\t\t\tutil.addEventListener(element, \"mouseout\", function(){\n\t\t\t\t\tvar pageItems = document.getElementsByClassName(\"page-item\");\n\t\t\t\t\t\n\t\t\t\t\tutil.removeClass(menu, \"dropdown-active\");\n\t\t\t\t\t\n\t\t\t\t\tutil.removeClassFromArray(pageItems, \"enter-from-right\");\n\t\t\t\t\tutil.removeClassFromArray(pageItems, \"enter-from-left\");\n\t\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn menu;\n\t}", "function buildMenu() {\n for (let section of sectionList) {\n let element = document.createElement('li');\n element.textContent = section.getAttribute(\"data-nav\");\n element.classList.add(\"menu__link\");\n \n let section_cnt = section.getAttribute(\"data-nav\").split(' ')[1]\n element.setAttribute('id',section_cnt);\n\n navbarList.appendChild(element);\n navbarList.firstElementChild.classList.add(\"active\");\n }\n}", "function buildNav() {\nlet fragment = document.createDocumentFragment();\n sections.forEach((sec, index) => {\n \tlet navLink = sec.getAttribute(\"data-nav\");\n \tlet textNode = document.createTextNode(navLink);\n \tlet cLink = document.createElement(\"a\");\n \tlet elLi = document.createElement(\"li\");\n \t// Build menu\n \tcLink.setAttribute('class', 'menu__link');\n \tcLink.appendChild(textNode);\n \tlinkClick(cLink, sec);\n \telLi.appendChild(cLink);\n \tfragment.appendChild(elLi);\n });\n nav.appendChild(fragment);\n}", "initMenus(menus) {\n let xhtml = null\n let manageMenu = menus[2];\n if (manageMenu && manageMenu.sub_menus && manageMenu.sub_menus.length) {\n xhtml = manageMenu.sub_menus.map((menu, index) => {\n return (\n <SelectMenuLink key={index} menu={menu} />\n )\n })\n }\n return xhtml\n }", "includeMenuItemEnd () {\n this.html += `\n </ul>\n </div>\n </div>\n `\n }", "function buildMenu(items){\n let output = \"\";\n items.forEach(function(item){\n output += \"<div class='item'\" + \"onclick='saveSelection(\" + item.id + \");'>\" +\n \"<h1>\" + item.name + \"</h1>\" +\n \"<img src='img/\" + item.pic + \".jpg'/>\" +\n \"</div>\";\n });\n document.getElementById(\"menu_items\").innerHTML = output;\n}", "function buildNav() {\n for (let i of section) {\n let newSection = `<li class=\"menu__link ${i.className}\"data-link==${i.id}><a href=\"#${i.id}\">${i.dataset.nav}</li>`;\n\n navl.insertAdjacentHTML(\"beforeend\", newSection);\n }\n}", "function _createNavmenu() {\n const all = document.createElement(\"button\");\n all.innerHTML = \"All\";\n all.classList.add(\"button-active\"); // all is active by default\n\n const photo = document.createElement(\"button\");\n photo.innerHTML = \"Photo\";\n\n const video = document.createElement(\"button\");\n video.innerHTML = \"Video\";\n\n const audio = document.createElement(\"button\");\n audio.innerHTML = \"Audio\";\n\n const link = document.createElement(\"button\");\n link.innerHTML = \"Link\";\n\n const navMenu = document.createElement(\"div\");\n navMenu.classList.add(\"nav-menu\");\n navMenu.appendChild(all);\n navMenu.appendChild(photo);\n navMenu.appendChild(video);\n navMenu.appendChild(audio);\n navMenu.appendChild(link);\n\n // add eventlistener for filter button clicks\n all.addEventListener(\"click\", (e) => {\n _removeButtonActiveClass(navMenu);\n all.classList.add(\"button-active\");\n _destroyAllElements();\n _displayElements(_allElements);\n _changeElementIndex(_allOverlayElements);\n _filteredOverlayElements = _allOverlayElements;\n });\n _applyFilter(photo, \"IMG\", navMenu);\n _applyFilter(video, \"VIDEO\", navMenu);\n _applyFilter(audio, \"AUDIO\", navMenu);\n _applyFilter(link, \"IFRAME\", navMenu);\n\n _mixGalContainer.appendChild(navMenu);\n }", "function createAndAppendCxtMenuComponent() {\n var classes = getClassStr(options.contextMenuClasses);\n// classes += ' cy-context-menus-cxt-menu';\n $cxtMenu = $('<div class=' + classes + '></div>');\n $cxtMenu.addClass('cy-context-menus-cxt-menu');\n setScratchProp('cxtMenu', $cxtMenu);\n\n $('body').append($cxtMenu);\n return $cxtMenu;\n }", "function createSubMenu(menu, commands) {\n var keys = Object.keys(commands).sort();\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var command = commands[key];\n var li = document.createElement('li');\n li.innerHTML = key;\n li.classList.add(\"menu-item\");\n if (command.encoding) {\n // command\n li.id = command.encoding + \".\" + command.key;\n li.onclick = function() { eval('scriptList.insert(\"' + this.id + '\")'); };\n } else {\n // category\n var ul = document.createElement('ul');\n ul.classList.add(\"menu-submenu\");\n ul.classList.add(\"menu\");\n createSubMenu(ul, command);\n li.appendChild(ul);\n }\n menu.appendChild(li);\n }\n }", "function build_menu() {\n var entities = get_entities(), entity = 0;\n if (entities) {\n while (entities[entity]) {\n $.getJSON('/api/entity/' + entities[entity],\n function(data) {\n var name = data.payload.name.replace(\" \", \"_\");\n $(\"#entities_list\").append(\n \"<li><a href=\\\"#entity_\"\n + name\n + \"\\\" data-toggle=\\\"tab\\\" onclick=\\\"update_current_entity('\" + data.payload._id + \"')\\\">\"\n + data.payload.name\n + \"</strong></a></li>\"\n );\n $(\"#entities_content\").append(\n \"<div class=\\\"tab-pane\\\" id=\\\"entity_\"\n + name\n + \"\\\">\"\n + \"</div>\"\n );\n });\n entity++;\n }\n }\n}", "function createMenuDiv(menu) {\n let div = document.createElement(\"div\");\n div.id = \"menu\";\n \n //Create divs for each category\n Object.keys(menu).forEach(category => {\n let categoryDiv = document.createElement(\"div\");\n categoryDiv.id = category;\n categoryDiv.className = \"category\";\n\n // Create menu items for the category\n let list = document.createElement(\"ul\");\n let categoryName = document.createElement(\"li\");\n categoryName.appendChild(document.createTextNode(category));\n categoryName.style.fontSize = \"larger\";\n categoryName.style.fontWeight = \"bold\";\n categoryName.style.textIndent = \"3%\";\n list.appendChild(categoryName);\n Object.values(menu[category]).forEach(item => {\n let elem = document.createElement(\"li\");\n let itemDetails = document.createElement(\"ul\");\n // Item name, price and add immage\n let namePrice = document.createElement(\"li\");\n let innerHTML = `<p>${item.name} $${item.price} ` + \n `<i class=\"addIcon\" onclick=\"addItem(\\`${item.name}\\`, ${item.price})\"></i> </p>`;\n namePrice.innerHTML = innerHTML;\n namePrice.style.fontWeight = \"bold\";\n itemDetails.appendChild(namePrice);\n // Item description and image\n let desc = document.createElement(\"li\");\n text = document.createTextNode(item.description);\n desc.appendChild(text);\n itemDetails.appendChild(desc);\n\n elem.appendChild(itemDetails);\n list.appendChild(elem);\n });\n categoryDiv.appendChild(list);\n\n div.appendChild(categoryDiv);\n\n });\n\n return div;\n}", "function openNav() {\n\t\n\tvar html=\"\";\n\n\n\tStore.treeIterate(function(node){\n\t\thtml+='<li class=\"list-group-item node-treeview4\" data-nodeid=\"0\" style=\"color:undefined;background-color:undefined;\" data-cell=\"'+node.cell+'\">'+node.title+'</li>';\t\t\n\t});\n\t\n\t// Store.iterate(function(index,row){\n\t// \tvar value=row[\"id\"];\n\t//\n\t// \tif (value){\n\t// \t\thtml+='<li class=\"list-group-item node-treeview4\" data-nodeid=\"0\" style=\"color:undefined;background-color:undefined;\">Article '+index+'</li>';\n\t// \t\t// html+=\"<button class='btn btn-default'> Article \"+value+\". </button>\";\n\t// \t}\n\t// });\n\n\tvar el=$(\"#mySidenav\");\n\tel.html('<ul class=\"list-group\">'+\n\t\t\thtml+\n\t\t\t'</ul>');\n\t\n\tel.css(\"width\",\"200px\");\n\t\n document.getElementById(\"main\").style.marginLeft = \"200px\";\n}", "function menuItems() {\n const farmMenu = document.createElement('div');\n farmMenu.classList.add('menu');\n \n farmMenu.appendChild(createItem(\n 'beef tartare', \n '$14',\n 'egestas pretium aenean pharetra magna ac placerat vestibulum'));\n farmMenu.appendChild(createItem(\n 'mussels provencale',\n '$20',\n 'sed adipiscing diam donec adipiscing tristique risus nec'));\n farmMenu.appendChild(createItem(\n 'scallops', \n '$18',\n 'vitae congue mauris rhoncus aenean vel elit scelerisque'));\n farmMenu.appendChild(createItem(\n 'flemish onion soup', \n '$10',\n 'elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus'));\n farmMenu.appendChild(createItem(\n 'braised short ribs', \n '$22',\n 'sagittis purus sit amet volutpat consequat mauris nunc'));\n farmMenu.appendChild(createItem(\n 'wedge salad', \n '$10',\n 'nibh sed pulvinar proin gravida hendrerit lectus a'));\n farmMenu.appendChild(createItem(\n 'charcuterie', \n '$16',\n 'non blandit massa enim nec dui nunc mattis'));\n\n return farmMenu;\n }", "render() {\n const template = [\n {\n block: 'menu',\n content: [\n {\n elem: 'items',\n points: [\n {\n href: 'single',\n text: 'Синглплеер',\n type: 'gamepad',\n },\n {\n href: 'multi',\n text: 'Мультиплеер',\n type: 'users',\n },\n {\n href: '/',\n text: 'Главное меню',\n type: 'back',\n },\n ],\n },\n ],\n },\n ];\n\n this.parent.insertAdjacentHTML('beforeend', bemhtml.apply(template));\n }", "init( _menus ) {\r\n const self = this;\r\n\r\n if ( ! Array.isArray( _menus ) || ! _menus.length ) {\r\n self.menuError( '[menuHandler] [general] Initialization requires an array of menus to be passed as an argument. see documentation' );\r\n }\r\n\r\n _menus.forEach( function ( _menu ) {\r\n const menuTemplate = {\r\n name: null,\r\n open: null,\r\n close: null,\r\n enterFocus: null,\r\n exitFocus: null,\r\n activeOpen: null,\r\n activeClose: null,\r\n activeEnterFocus: null,\r\n activeExitFocus: null,\r\n container: null,\r\n innerContainer: null,\r\n loop: false,\r\n type: 'menu', // menu, dropdown, popup // TODO: add to README\r\n isOpen: false, // run time\r\n isPinned: false, // run time\r\n isMobile: false, // run time\r\n openDelay: 0,\r\n closeDelay: 0,\r\n debounce: 20,\r\n openOnMouseEnter: false,\r\n transitionDelay: 0, // run time\r\n transitionDuration: 0, // run time\r\n orientation: 'horizontal', // TODO: add to README\r\n direction: null, // TODO: add to README\r\n menuFunc: self.menuFunc,\r\n pin: false,\r\n preventBodyScroll: true,\r\n mobile: {\r\n breakpoint: '667px',\r\n open: null,\r\n close: null,\r\n pin: false,\r\n enterFocus: null,\r\n exitFocus: null,\r\n orientation: 'vertical',\r\n preventBodyScroll: true,\r\n },\r\n on: {\r\n beforeInit: null,\r\n afterInit: null,\r\n beforeOpen: null,\r\n afterOpen: null,\r\n beforeClose: null,\r\n afterClose: null,\r\n beforePinOpen: null,\r\n afterPinOpen: null,\r\n beforePinClose: null,\r\n afterPinClose: null,\r\n },\r\n submenuOptions: {\r\n isEnabled: true,\r\n menuFunc: self.submenuFunc,\r\n openOnMouseEnter: false,\r\n closeOnBlur: true,\r\n closeDelay: 0,\r\n orientation: 'vertical',\r\n closeSubmenusOnOpen: true,\r\n mobile: {\r\n closeOnBlur: true,\r\n closeDelay: 0,\r\n closeSubmenusOnOpen: true,\r\n orientation: 'vertical',\r\n },\r\n on: {\r\n beforeOpen: null,\r\n afterOpen: null,\r\n beforeClose: null,\r\n afterClose: null,\r\n }\r\n },\r\n actions: {},\r\n submenus: {},\r\n };\r\n\r\n if ( ! _menu.name ) {\r\n menuTemplate.name = Math.random().toString( 36 ).substr( 2 ); // create a random menu name from a random number converted to base 36.\r\n } else {\r\n menuTemplate.name = _menu.name;\r\n }\r\n\r\n if ( ! _menu.elements ) {\r\n self.menuError( `[menuHandler] [menu:${menuTemplate.name}] Error: menu elements object is missing` );\r\n }\r\n self.initMenuElements( menuTemplate, _menu.elements );\r\n\r\n if ( _menu.mobile && _menu.mobile.elements ) {\r\n self.initMenuMobileElements( menuTemplate, _menu.mobile.elements );\r\n }\r\n\r\n self.initMenuOptions( menuTemplate, _menu );\r\n\r\n menuTemplate.direction = getComputedStyle( menuTemplate.container ).direction;\r\n\r\n // ! important: in order to find the event and remove it by removeEventListener, \r\n // we need to pass a reference to the function and bind it to the menuHandler object\r\n menuTemplate.toggleMenu = self.toggleMenu.bind( self, menuTemplate );\r\n\r\n if ( self.checkRequiredElement( menuTemplate ) ) {\r\n self.menus.push( menuTemplate );\r\n }\r\n } );\r\n\r\n if ( ! self.menus.length ) {\r\n self.menuError( `[menuHandler] [general] Error: no menus initialized` );\r\n }\r\n\r\n self.initMenus();\r\n }", "function menuItem(id, def) {\n var client, dirty = true, icon, openMark, textElement, m = control(\"menu\", id, core.mkDefinition({\n style: {\n position: \"\",\n padding: \"2px 9px 2px 9px\",\n color: sys.color.windowtitle,\n },\n setText: function (text) {\n if (!textElement)\n this.appendChild(textElement = document.createTextNode(text));\n else textElement.textContent = text;\n },\n setIcon: function (src) {\n if (src) {\n if (!icon) {\n this.appendChild(icon = core.mkTag(\"img\"));\n icon.style.merge({\n width: \"16px\",\n height: \"16px\",\n float: \"left\",\n padding: \"0 5px 0 0\",\n filter: \"drop-shadow(rgb(255, 255, 255) 0px 0px 1px)\",\n });\n } else\n icon.style.display = \"\";\n icon.src = src;\n } else if (icon) icon.style.display = \"none\";\n },\n showMoreMark: function () {\n if (!openMark) {\n this.appendChild(openMark = core.mkTag(\"div\"));\n openMark.style.merge({\n float: \"right\",\n padding: \"0 0 0 5px\",\n });\n openMark.appendChild(document.createTextNode(\"\\u25B6\"));\n } else openMark.style.display = \"\";\n },\n hideMoreMark: function () {\n if (openMark)\n openMark.style.display = \"none\";\n },\n popup: function () {\n if (this.parentControl._type == \"menu\")\n this.parentControl.popup();\n if (client && client._visible)\n return;\n if (!client) {\n client = control(\"menuClient\", id + \"_client\", {\n style: {\n background: sys.color.client,\n border: \"1px solid \" + sys.color.frame,\n fontFamily: \"Arial\",\n fontSize: \"14px\",\n zIndex: 9999,\n },\n _zLayer: 9,\n });\n core.getDesktop().appendChild(client);\n }\n var bounds = this.getBoundingClientRect();\n if (this.parentControl._type == \"menu\")\n client.merge({\n top: bounds.top,\n left: bounds.left + bounds.width,\n });\n else\n client.merge({\n top: bounds.top + bounds.height,\n left: bounds.left,\n });\n while (client.lastChild)\n client.removeChild(client.lastChild);\n for (i in this.items) {\n var m = this.items[i];\n m.application = this.application;\n m.parentControl = this;\n if (m.items)\n m.showMoreMark();\n client.appendChild(m);\n }\n core.menu.setCurrent(this);\n client.show();\n },\n close: function (all) {\n if (client)\n client.hide();\n if (core.menu.isCurrent(this))\n core.menu.setCurrent(null);\n if (all && this.parentControl._type == \"menu\")\n this.parentControl.close(all);\n },\n onmouseenter: function () {\n this.style.backgroundColor = sys.color.frame;\n this.style.color = sys.color.framecontrast;\n },\n onmouseleave: function () {\n this.style.backgroundColor = \"\";\n this.style.color = sys.color.windowtitle;\n },\n onclick: function () {\n if (this.items)\n core.menu.showMenu(this);\n else if (this.onClick)\n this.onClick.apply(this, arguments);\n }\n }, def));\n return m;\n }", "function makeNav () {\n for (let i = 0; i < names.length; i++) {\n let sectionName = names[i];\n let link = document.createElement('a');\n let listItem = document.createElement('li');\n link.href = `#${sectionId[i]}`;\n link.textContent = sectionName;\n link.classList.add('menu__link');\n listItem.appendChild(link);\n container.appendChild(listItem);\n }\n}", "function _createFoodMenu( data ) {\n var html = '', note = data.notification ? \n '<div class=\"notification\">'+data.notification+'</div>' : '';\n \n if ( data.headline ) {\n var id = getAutoId(); \n html = '<h2 id=\"'+id+'\">'+data.headline+'</h2>'+note;\n } else if ( data.subline ) {\n html = '<h3>'+data.subline+'</h3>'+note;\n } else if ( data.type === 'setmenu-price' ) {\n html = '<div class=\"setmenu-price price\">'+data.price+'</div>'+note;\n } else {\n var name = data.name ? '<div class=\"name\">'+data.name+'</div>' : '';\n var number = data.number ? '<div class=\"number\">'+data.number+'</div>' : '';\n var price = data.price ? '<div class=\"price\">'+data.price+'</div>' : '';\n\n var description = data.description ? \n '<div class=\"description\">'+data.description+'</div>' : '';\n var sashimi = data.sashimi ? \n '<div class=\"price sashimi\">'+data.sashimi+'</div>' : '';\n var type = 'food' + (data.type ? (' -'+data.type) : '') +\n (sashimi ? ' -has-sashimi' : '') + (number ? '' : ' -no-number');\n\n html = '<div class=\"'+type+'\">' +\n number + name + price + sashimi + description + note +\n '</div>'; \n }\n return html;\n}", "function MenuGauche()\r\n{\r\n\tthis.menuGauche = window.document.createElement('div');\r\n\tthis.menuGauche.setAttribute('id', 'menuGauche');\r\n\r\n\t//specification du style du menuGauche\r\n\tdefineStyle.MenuGauche(this.menuGauche);\t\r\n\r\n\t//creation des menu1, menu2 et menu3\r\n\tthis.menuGauche.appendChild((new Menu('menu1')).getElement());\r\n\tthis.menuGauche.appendChild((new Menu('menu2')).getElement());\r\n\tthis.menuGauche.appendChild((new Menu('menu3')).getElement());\r\n\r\n\t//ajout de la signature\r\n\tthis.menuGauche.appendChild((new Signature()).getElement());\r\n\r\n\t//getter\r\n\tthis.getElement = function () { return this.menuGauche; };\r\n}", "function createMenuSection(title) {\n const menuOne = document.createElement(\"div\");\n const menuOneTitle = document.createElement(\"h2\");\n menuOneTitle.classList.add(\"menu-section-title\");\n menuOneTitle.textContent = title;\n menuOne.appendChild(menuOneTitle);\n menuOne.classList.add(\"menu-side\");\n return menuOne;\n }", "function buildMenu() {\r\n var theMenu = new String('');\r\n var firstLevelCounter = new Number(0);\r\n var firstLevelHighlight = new Boolean(true);\r\n var closeTag = new Boolean();\r\n for (var i in linx) {\r\n switch(linx[i].charAt(0)) {\r\n case '%':\r\n if (closeTag == true) { theMenu += '</span></ul>'; };\r\n theMenu += '<ul><a id=\"menuFirstLevelHeading\" title=\"Expand ' + i + '\" onmouseover=\"(window.status=' + \"'\" + i + \"'\" + '); return true;\" onmouseout=\"(window.status=' + \"'\" + \"'\" + '); return true;\" href=\"javascript:void(0)\" onclick=\"toggle(' + \"'\" + mHl[firstLevelCounter] + \"'\" + '); return false;\"><img src=\"/gifjpg/menu_closed.gif\" alt=\"Expand ' + i + '\" border=\"0\" />' + i + '</a><span id=\"' + mHl[firstLevelCounter] + '\">';\r\n firstLevelCounter++;\r\n closeTag = true;\r\n break;\r\n case '$':\r\n if (closeTag == true) { theMenu += '</span></ul>'; };\r\n if (menuItemHighlighter(linx[i].slice(1))) {\r\n theMenu += '<ul id=\"menuLink\"><img src=\"/gifjpg/menu_link.gif\" alt=\"' + i + '\" border=\"0\"><a id=\"menuHighlight\" href=\"' + linx[i].slice(1) + '\">' + i + '</a></ul>';\r\n firstLevelHighlight = false;\r\n } else {\r\n theMenu += '<ul id=\"menuLink\"><img src=\"/gifjpg/menu_link.gif\" alt=\"' + i + '\" border=\"0\"><a href=\"' + linx[i].slice(1) + '\">' + i + '</a></ul>';\r\n }\r\n closeTag = false;\r\n break;\r\n default:\r\n if (menuItemHighlighter(linx[i])) {\r\n theMenu += '<li id=\"menuHighlight\">' + i.link(linx[i]) + '</li>';\r\n } else {\r\n theMenu += '<li>' + i.link(linx[i]) + '</li>';\r\n }\r\n closeTag = true;\r\n break;\r\n }\r\n }\r\n \r\n if (closeTag == true) { theMenu += '</span></ul>'; };\r\n document.write(theMenu);\r\n if (menuItemHighlighter(\"/reportforms/\")) { toggle(\"menuOne\"); };\r\n if (firstLevelHighlight) { toggle(\"menuHighlight\"); };\r\n}", "function add_menu(){\n\t/******* add menu ******/\n\t// menu itsself\n\tvar menu=$(\"#menu\");\n\tif(menu.length){\n\t\trem_menu();\n\t};\n\n\tmenu=$(\"<div></div>\");\n\tmenu.attr(\"id\",\"menu\");\n\tmenu.addClass(\"menu\");\n\t\n\t//////////////// rm setup //////////////////\n\tvar f=function(){\n\t\tvar box=$(\"#rm_box\");\n\t\tif(box.length){\n\t\t\tbox.toggle();\t\n\t\t}\n\t};\n\tadd_sidebar_entry(menu,f,\"rules\",\"style\");\n\tvar box=$(\"<div></div>\");\n\tbox.attr(\"id\",\"rm_box\");\n\tbox.text(\"loading content ... hang on\");\n\tbox.hide();\n\tmenu.append(box);\t\n\t//////////////// rm setup //////////////////\n\n\t//////////////// area setup //////////////////\n\tvar f=function(){\n\t\tvar box=$(\"#areas_box\");\n\t\tif(box.length){\n\t\t\tbox.toggle();\t\n\t\t}\n\t};\n\tadd_sidebar_entry(menu,f,\"areas\",\"home\");\n\tvar box=$(\"<div></div>\");\n\tbox.attr(\"id\",\"areas_box\");\n\tbox.text(\"loading content ... hang on\");\n\tbox.hide();\n\tmenu.append(box);\t\n\t//////////////// area setup //////////////////\n\n\t//////////////// camera setup //////////////////\n\tvar f=function(){\n\t\tvar box=$(\"#cameras_box\");\n\t\tif(box.length){\n\t\t\tbox.toggle();\t\n\t\t}\n\t};\n\tadd_sidebar_entry(menu,f,\"units\",\"camera_enhance\");\n\tvar box=$(\"<div></div>\");\n\tbox.attr(\"id\",\"cameras_box\");\n\tbox.text(\"loading content ... hang on\");\n\tbox.hide();\n\tmenu.append(box);\t\n\t//////////////// camera setup //////////////////\n\n\t//////////////// user setup //////////////////\n\tvar f=function(){\n\t\tvar box=$(\"#users_box\");\n\t\tif(box.length){\n\t\t\tbox.toggle();\t\n\t\t\tlogin_entry_button_state(\"-1\",\"show\");\t// scale the text fields for the \"new\" entry = -1\n\t\t}\n\t};\n\tadd_sidebar_entry(menu,f,\"users\",\"group\");\n\tvar box=$(\"<div></div>\");\n\tbox.attr(\"id\",\"users_box\");\n\tbox.text(\"loading content ... hang on\");\n\tbox.hide();\n\tmenu.append(box);\t\n\t//////////////// user setup //////////////////\n\n\n\t//////////////// logout //////////////////\n\tvar f=function(){\n\t\t\tg_user=\"nongoodlogin\";\n\t\t\tg_pw=\"nongoodlogin\";\n\t\t\tc_set_login(g_user,g_pw);\n\t\t\ttxt2fb(get_loading(\"\",\"Signing you out...\"));\n\t\t\tfast_reconnect=1;\n\t\t\tcon.close();\n\n\t\t\t// hide menu\n\t\t\trem_menu();\n\t};\n\tadd_sidebar_entry(menu,f,\"log-out\",\"vpn_key\");\n\t//////////////// logout //////////////////\n\n\t////////////// hidden data_fields /////////////\n\tvar h=$(\"<div></div>\");\n\th.attr(\"id\",\"list_cameras\");\n\th.hide();\n\tmenu.append(h);\n\n\th=$(\"<div></div>\");\n\th.attr(\"id\",\"list_area\");\n\th.hide();\n\tmenu.append(h);\n\t////////////// hidden data_fields /////////////\n\n\n\tmenu.insertAfter(\"#clients\");\n\t\n\n\tvar hamb=$(\"<div></div>\");\n\thamb.click(function(){\n\t\treturn function(){\n\t\t\ttoggle_menu();\n\t\t}\n\t}());\n\thamb.attr(\"id\",\"hamb\");\n\thamb.addClass(\"hamb\");\n\tvar a=$(\"<div></div>\");\n\tvar b=$(\"<div></div>\");\n\tvar c=$(\"<div></div>\");\n\ta.addClass(\"hamb_l\");\n\tb.addClass(\"hamb_l\");\n\tc.addClass(\"hamb_l\");\n\thamb.append(a);\n\thamb.append(b);\n\thamb.append(c);\n\thamb.insertAfter(\"#clients\");\n\t/******* add menu ******/\n}", "setupMenu () {\n let dy = 17;\n // create buttons for the action categories\n this.menu.createButton(24, 0, () => this.selectionMode = 'info', this, null, 'info');\n this.menu.createButton(41, 0, () => this.selectionMode = 'job', this, null, 'job');\n // create buttons for each command\n for (let key of Object.keys(this.jobCommands)) {\n let button = this.menu.createButton(0, dy, () => this.jobCommand = key, this, this.jobCommands[key].name);\n dy += button.height + 1;\n }\n // set the hit area for the menu\n this.menu.calculateHitArea();\n // menu is closed by default\n this.menu.hideMenu();\n }", "function buildMenuStrip(){\n var div = document.getElementById('arqsiWidget');\n var myTableDiv = document.createElement('div');\n myTableDiv.id = \"arqsiWidgetMenu_div\";\n myTableDiv.className = \"menu\";\n div.appendChild(myTableDiv);\n\n var strInnerHTML = \"<table id='arqsiWidgetMenu' class='menu'>\";\n strInnerHTML += \"<thead><tr>\";\n strInnerHTML += \" <th width='200' ><div id='arqsiWidgetLogo_div'></th>\";\n strInnerHTML += \" <th width='400' colspan='2'>Efectue a sua pesquisa de Livros</th>\";\n strInnerHTML += \"</tr></thead>\";\n strInnerHTML += \"<tbody><tr>\";\n strInnerHTML += \" <td width='200'><div id='arqsiWidgetBookNews_div'></td>\";\n strInnerHTML += \" <td width='200'><div id='arqsiWidgetBookLimit_div'></td>\";\n strInnerHTML += \" <td width='200'><div id='arqsiWidgetCategoriasSelect_div'></td></tr>\";\n strInnerHTML += \"</tr>\";\n strInnerHTML += \"<tr>\";\n strInnerHTML += \" <td width='600' colspan='3'><div id='arqsiWidgetBookSearch_div'></td>\";\n strInnerHTML += \"</tr>\";\n strInnerHTML += \"</tbody></table>\";\n myTableDiv.innerHTML = strInnerHTML;\n\n createLogo();\n createBookNewsArea();\n createBookLimitArea();\n createBookSearchArea();\n}", "function MenuMenu(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n position = props.position;\n var classes = classnames_default()(position, 'menu', className);\n var rest = lib_getUnhandledProps(MenuMenu, props);\n var ElementType = lib_getElementType(MenuMenu, props);\n return react_default.a.createElement(ElementType, extends_default()({}, rest, {\n className: classes\n }), childrenUtils_namespaceObject.isNil(children) ? content : children);\n}", "function makeNavBar() {\n for (let i = 0; i < sections.length; i++) {\n let liElement = document.createElement('li'); //create menu items\n liElement.setAttribute('class', 'Section');\n let links = document.createElement('a'); //create the links for menu items\n links.setAttribute('class', 'navLink');\n content = sections[i].getAttribute('data-nav');\n path = sections[i].getAttribute('id');\n links.setAttribute('href', `#${path}`);\n links.innerText = `${content}`;\n navList.appendChild(liElement);\n liElement.appendChild(links);\n\n }\n}" ]
[ "0.7167672", "0.71373665", "0.6924547", "0.68868846", "0.6880381", "0.6853097", "0.6847263", "0.6817325", "0.68069917", "0.66916764", "0.6687472", "0.6681733", "0.6654736", "0.66506773", "0.66501856", "0.66487765", "0.664683", "0.66046715", "0.6602675", "0.660057", "0.660057", "0.65930957", "0.65652364", "0.6560522", "0.6550778", "0.6547825", "0.653773", "0.6534136", "0.6532293", "0.65195996", "0.6513019", "0.65071994", "0.64778316", "0.64681894", "0.6447219", "0.64067376", "0.64059", "0.63619953", "0.6344285", "0.6338593", "0.6324668", "0.6285544", "0.6274859", "0.6274116", "0.62737656", "0.6271377", "0.6266111", "0.62522423", "0.62407833", "0.62382025", "0.62294555", "0.6219931", "0.62172663", "0.6204472", "0.62031734", "0.620302", "0.619436", "0.6192466", "0.6191946", "0.6189849", "0.61751425", "0.61720276", "0.616664", "0.61583465", "0.6153954", "0.6146275", "0.6130542", "0.6121606", "0.61043763", "0.60955805", "0.60954046", "0.6092968", "0.6089389", "0.6087599", "0.60863507", "0.60853755", "0.6084428", "0.6083892", "0.6078948", "0.60739547", "0.6072607", "0.6072576", "0.60717815", "0.60712045", "0.60560256", "0.6055327", "0.6054701", "0.60528463", "0.6050295", "0.60484976", "0.60473144", "0.60445416", "0.6043889", "0.6042306", "0.6038792", "0.6038545", "0.60309887", "0.6025265", "0.60198474", "0.6015164" ]
0.61204463
68
get first block with greater than or equal time to targetDate
async function getLeftmostBlock(left, right, targetDate) { if (left >= right) return right; let m = (left + right) >> 1; let block = await web3.eth.getBlock(m); // convert to ms first let date = new Date(block.timestamp * 1000); //console.log('LEFT: ', left, ' RIGHT: ', right, ' MID: ', m, ' DATE: ', date, ' TARGET: ', targetDate); if (date < targetDate) { return getLeftmostBlock(m + 1, right, targetDate); } else { return getLeftmostBlock(left, m, targetDate); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findFirstValidHold (currentAudioTime) {\n\n let listActiveHolds = this.activeHolds.asList() ;\n for ( var i = 0 ; i < listActiveHolds.length ; i++) {\n\n let step = listActiveHolds[i] ;\n\n if ( step !== null && step.beginHoldTimeStamp <= currentAudioTime) {\n return step ;\n }\n\n }\n\n return null ;\n\n }", "function findMatch(){\n let futureCurrent = dataCurrent.dt + 60 * 60 * 24; //estimates current moment projected 24 hours ahead\n let match = 0;\n let dist = Math.abs(dataForcst.list[0].dt - futureCurrent);\n for(let i = 1; i < 10; i++){\n let aux = Math.abs(dataForcst.list[i].dt - futureCurrent);\n if(aux < dist){\n dist = aux;\n match = i;\n }\n }\n return match;\n}", "function findBlock(currentVersion, nextIndex, previoushash, nextTimestamp, merkleRoot, difficulty) {\n var nonce = 0;\n while (true) {\n var hash = calculateHash(currentVersion, nextIndex, previoushash, nextTimestamp, merkleRoot, difficulty, nonce);\n if (hashMatchesDifficulty(hash, difficulty)) {\n return new BlockHeader(currentVersion, nextIndex, previoushash, nextTimestamp, merkleRoot, difficulty, nonce);\n }\n nonce++;\n }\n}", "function findAppointment({user1, user2, freeBlocks1, freeBlocks2, startDate}){\n var targetDate = scheduleHelper(freeBlocks1, freeBlocks2);\n\n if(!newBlock){\n var newStart = new Date(); \n newStart.setDate(startDate.getDate() + 1);\n newStart.setHours(8, 0, 0, 0);\n newPotential = lookForTimes(user1, user2, newStart); \n freeblocks1 = newPotential[0];\n freeblocks2 = newPotential[1]; \n startDate = newPotential[2];\n return(findAppointment(user1, user2, freeBlocks1, freeBlocks2, startDate)); \n }\n else {\n return targetDate; \n }\n}", "function searchAfterEvent(table) {\n let minimalTime = 99999999999999;\n let currentEvent = 0;\n table.forEach(element => {\n if (minimalTime > element.miliseconds && today_mili < element.miliseconds) {\n minimalTime = element.miliseconds\n currentEvent = element\n }\n });\n return currentEvent\n }", "getClosestDataIndex(date) {\n var current = 0;\n while(current <= this.options.data.length - 1) {\n if(this.options.data[current].date > date) {\n if(current === 0) return -1;\n return current - 1;\n }\n current++;\n }\n return this.options.data.length - 1;\n }", "binarySearch(target, array) {\n let min = 0;\n let max = array.length - 1;\n let index = null;\n\n // Checking that target is contained in the array.\n if (target >= array[min] && target <= array[max]) {\n // Perform binary search to find the closest, rounded down element to the target in the array .\n while (index === null) {\n // Divide the array in half\n let mid = Math.floor((min + max) / 2);\n // Target date is in the right half\n if (target > array[mid]) {\n if (target < array[mid + 1]) {\n index = mid;\n } else if (target === array[mid + 1]) {\n index = mid + 1;\n } else {\n // Not found yet proceed to divide further this half in 2.\n min = mid;\n }\n // Target date is exactly equal to the middle element\n } else if (target === array[mid]) {\n index = mid;\n // Target date is on the left half\n } else {\n if (target >= array[mid - 1]) {\n index = mid - 1;\n } else {\n max = mid;\n }\n }\n }\n } else {\n return null;\n }\n return [array[index], index];\n }", "findEmployeeMinDate() {\n const employeesSorted = this.sampleEmployees\n .slice()\n .sort(\n (employee1, employee2) =>\n (employee1.payload()['hireDate']).getTime() -\n (employee2.payload()['hireDate']).getTime(),\n );\n return employeesSorted[0].payload()['hireDate'];\n }", "async function findFirstOpenDate(headers) {\n const dates = await toArray(\n (await getCollection(headers))\n .find({ date: { $gte: getToday() } })\n .sort({ date: -1 })\n .limit(1)\n );\n if (dates.length != 0) {\n return getNextDate(dates[0].date);\n } else {\n return getToday();\n }\n \n}", "function findValue(source) {\n for (var i = 0; i < source.length; i++) {\n if (this.game.time.now >= parseInt(source[i][0]) && this.game.time.now <= parseInt(source[i][1])) {\n return source[i][2];\n }\n }\n}", "get nextBlock () {\n return this.API.getBlock().then(({header:{height}})=>new Promise(async resolve=>{\n while (true) {\n await new Promise(ok=>setTimeout(ok, 1000))\n const now = await this.API.getBlock()\n if (now.header.height > height) {\n resolve()\n break\n }\n }\n }))\n }", "find_frame(time, off) {\r\n off = off === undefined ? 0 : off;\r\n\r\n var flist = this.framelist;\r\n for (var i=0; i<flist.length-1; i++) {\r\n if (flist[i] <= time && flist[i+1] > time) {\r\n break;\r\n }\r\n }\r\n \r\n if (i === flist.length) return frames[i-1]; //return undefined;\r\n return frames[i];\r\n }", "function findFirstDay(data) {\n\tlet curDate = new Date(dateonly(new Date()) - (daysToShow-1) * msPerDay);\n\tlet start;\n\tfor (start = 0; start < data.length && data[start].date < curDate; start++);\n\treturn start;\n}", "function compareTimeBlocks(currentTime){\n //For each element in the array, check the current time against the time block data and change classes accordingly\n timeblockArray.forEach(element => {\n let timeblockTime = moment(element.time,\"h:mma\");\n let timeblockHour = timeblockTime.format(\"H\");\n\n //Get handle to jQuery DOM object text area\n let display = element.domObject.children('textarea');\n \n //Check if current timeblock is in the past\n if(+currentTime>+timeblockHour){\n display.removeClass(\"present\");\n display.addClass(\"past\");\n //Next, check if timeblock is in the future\n }else if(+currentTime<+timeblockHour){\n display.removeClass(\"past\")\n display.addClass(\"future\");\n\n //Else, timeblock must be in the preset\n }else{\n display.removeClass(\"future\")\n display.addClass(\"present\")\n }\n });\n}", "function findNoteFor(notes, time, column) {\n // 1. Calculate offset for time\n // 2. Calculate offset for time-50ms and time+50ms\n // 3. Return *earliest* note filtered for in that range with matching column\n return notes.filter((note) => {\n if (note.col !== column) {\n return false;\n }\n\n return (time + maxJudgementThreshold > note.time && time - maxJudgementThreshold < note.time);\n\n }).minBy((note) => note.totalOffset);\n}", "function findMin() {\n\tlet timeFrameStart = data.set.indexOf(findMaxAndTimeFrame())\n\tlet timeFrameEnd = data.set.indexOf(findMaxAndTimeFrame()) + 7\n\tlet low = findMaxAndTimeFrame()\n\tfor ( let i = timeFrameStart; i < timeFrameEnd; i++) {\n\t\tif (data.set[i] < low) {\n\t\t\tlow = data.set[i]\n\t\t}\n\t}\n\treturn data.set.indexOf(low, timeFrameStart)\n}", "getFirstCome() {\n var lowestTime = this.queue[0].getArrivalTime();\n var jobFinal = this.queue[0];\n for(var i=0; i<this.queue.length; i++) {\n var job = this.queue[i];\n if(lowestTime > job.getArrivalTime()) {\n lowestTime = job.getArrivalTime();\n jobFinal = job;\n }\n }\n return jobFinal;\n }", "function getBestPoint(now) {\n var bestStamp = now - 140;\n\n if (currentData == undefined) return; // Should not happen !\n //console.log(\"Parsing data \" + currentData[\"timeseries\"].length);\n var bestPoint = undefined;\n var firstPoint = 99999999999, lastPoint = 0;\n for (var i in currentData[\"timeseries\"]) {\n var thisTime = currentData[\"timeseries\"][i][\"time\"]\n firstPoint = Math.min(thisTime, firstPoint)\n lastPoint = Math.max(lastPoint, thisTime)\n if (currentData[\"timeseries\"][i][\"time\"] > bestStamp) {\n if (dbg) console.log(\"Trying to display \" + bestStamp + \" and found\");\n bestPoint = currentData[\"timeseries\"][i];\n break;\n } \n } // for i\n return bestPoint;\n}", "function getDateInRange(current, target, before, after) {\n\t\tif(before != null && target > before) {\n\t\t\treturn new Date(before.getTime());\n\t\t}\n\t\tif(after != null && target < after) {\n\t\t\treturn new Date(after.getTime());\n\t\t}\n\t\treturn target;\n\t}", "filterData(sortData) {\n let finishData = [], filterData = [];\n sortData.forEach(\n data => {\n if(!finishData.includes(data.date)) {\n let same = sortData.filter(e => e.date == data.date);\n if(same.length > 1) {\n let cheapest = same[0];\n same.forEach(e => {cheapest = e.price < cheapest.price ? e : cheapest})\n filterData.push(cheapest)\n }\n else {\n filterData.push(data);\n }\n finishData.push(data.date);\n }\n }\n )\n return filterData\n }", "function getPHDBeforeOrAtDateTime(priceHistoryDocs, dateTime) {\n var limitedPriceHistoryDocs = [];\n for (var i = 0; i < priceHistoryDocs.length; i++) {\n var date = new Date(priceHistoryDocs[i].time*1000);\n if (date <= dateTime) {\n limitedPriceHistoryDocs.push(priceHistoryDocs[i]);\n }\n }\n return limitedPriceHistoryDocs;\n}", "findOldestLine() {\r\n let minimum = Number.MAX_VALUE\r\n let lineNumWithMin = null\r\n for(let lineNum = 0; lineNum < this.numberOfCacheLines; lineNum++) {\r\n let line = this.cacheLines[lineNum]\r\n if((line.timeUsed < minimum) && (line.state != States.INVALID)) {\r\n minimum = line.timeUsed\r\n lineNumWithMin = lineNum\r\n }\r\n }\r\n return lineNumWithMin;\r\n }", "function getLatestTime() {\n fakeNow = new Date();\n fakeNow.setTime(fakeNow.getTime() + (hourOffset*3600*1000) + (minuteOffset*60*1000));\n latestTime = radarKeys[0];\n for (var i=0; i<radarKeys.length; i++) {\n if (fakeNow > radarTimes[radarKeys[i]]) {\n latestTime = radarKeys[i];\n } else {\n break;\n\t}\n }\n}", "minTimeBetweenSimilarHistoryEvents() { return 400; }", "function filterDataByDate(sample){\r\n\t\t\treturn (Date.parse(sample.date_local) == Date.parse(dateselector.node().value));\r\n\t\t\t}", "async checkForLatestBlock () {\n await this._updateLatestBlock()\n return await this.getLatestBlock()\n }", "fetchClosestEvent(context) {\n return new Promise((resolve, reject) => {\n HTTP.get('events/', {\n headers: {\n 'Authorization': 'Token ' + context.state.token\n }\n })\n .then((response) => {\n // date sorting ( to put in a different function )\n let currentDate = Date.now()\n let eventDate = {index: undefined, difference: undefined}\n\n response.data.forEach((event, index) => {\n let date = new Date(event.exam_date)\n let difference = Math.abs(currentDate - date)\n \n if(eventDate.difference == undefined || difference < eventDate.difference) {\n eventDate.difference = difference\n eventDate.index = index\n if(eventDate.difference == 0) return true\n } \n });\n context.commit('saveCurrentEvent', response.data[eventDate.index])\n resolve(response.data[eventDate.index])\n })\n .catch((error) => {\n console.log(error)\n context.commit('saveErrors', error.message)\n reject(error)\n })\n })\n }", "function currentRecord(date) {\n var daybefore = new Date(date);\n daybefore.setHours(0, 0);\n return patient['json']['effective_time'] > daybefore / 1000;\n }", "getLastNotarizedBlock() {\n const LOG_HEADER = 'getLastNotarizedBlock';\n let candidate = this.node.bc.lastBlock();\n logger.debug(`[${LOG_HEADER}] longestNotarizedChainTips: ` +\n `${JSON.stringify(this.blockPool.longestNotarizedChainTips, null, 2)}`);\n this.blockPool.longestNotarizedChainTips.forEach((chainTip) => {\n const block = _.get(this.blockPool.hashToBlockInfo[chainTip], 'block');\n if (!block) return;\n if (block.epoch > candidate.epoch) candidate = block;\n });\n return candidate;\n }", "_getBestCoin(list, target, ignoreIndex) { //if (this.config.debug) console.log(\"_getBestCoin\",target, ignoreIndex, list);\r\n\r\n if (target == null || target.min <= 0 || target.min > target.max) return null; \r\n let ignore = (typeof(ignoreIndex) === 'number') ? (function(elt) { return (elt.l.indexOf(ignoreIndex) !== -1); }) : (function(elt) { return false; });\r\n \r\n //TODO replace with a binary search - but actually don't think I can?\r\n let index = list.findIndex(function(elt) {\r\n return (!ignore(elt) && elt.s >= target.min && elt.s <= target.max);\r\n });\r\n \r\n let result = new Array();\r\n\r\n while(index >= 0) {\r\n result.push(list[index++]);\r\n\r\n if (index == list.length || list[index].s < target.min || list[index].s > target.max) {\r\n index = -1;\r\n }\r\n }\r\n\r\n return result;\r\n }", "function getNextFreeBookingSlot(list, date = new Date().valueOf(), min_size = 30) {\n const slots = getFreeBookingSlots(list, min_size);\n const time = Object(date_fns__WEBPACK_IMPORTED_MODULE_1__[\"add\"])(Object(date_fns__WEBPACK_IMPORTED_MODULE_1__[\"startOfMinute\"])(new Date(date)), { seconds: 1 });\n for (const block of slots) {\n const start = Object(date_fns__WEBPACK_IMPORTED_MODULE_1__[\"startOfMinute\"])(new Date(block.start));\n const end = Object(date_fns__WEBPACK_IMPORTED_MODULE_1__[\"startOfMinute\"])(new Date(block.end));\n if (Object(date_fns__WEBPACK_IMPORTED_MODULE_1__[\"isAfter\"])(start, time)) {\n return block;\n }\n else if (Object(date_fns__WEBPACK_IMPORTED_MODULE_1__[\"isBefore\"])(time, end)) {\n const duration = Object(date_fns__WEBPACK_IMPORTED_MODULE_1__[\"differenceInMinutes\"])(end, time);\n /* istanbul ignore else */\n if (duration >= min_size) {\n return block;\n }\n }\n }\n return slots[slots.length - 1];\n}", "function selectNearestEvent(list) {\n\n const today = dateToIsoDate();\n\n for (let i = 0; i < list.length; ++i) {\n if (list[i].getAttribute('aria-label') >= today) {\n list[i].click();\n break;\n }\n }\n}", "getShortestJobFirst(currentClockTick) {\n var jobFinal = this.getFirstCome();\n var shortestJob = jobFinal.getBurstsRemaining();\n for(var i=0; i < this.queue.length; i++) {\n var job = this.queue[i];\n if(job.getArrivalTime() <= currentClockTick) {\n if(job.getBurstsRemaining() < shortestJob) {\n jobFinal = job;\n shortestJob = job.getBurstsRemaining();\n }\n }\n }\n return jobFinal;\n }", "async _mineBlockWithPendingTxs(blockTimestamp) {\n const parentBlock = await this.getLatestBlock();\n const headerData = {\n gasLimit: this.getBlockGasLimit(),\n coinbase: this.getCoinbaseAddress(),\n nonce: \"0x0000000000000042\",\n timestamp: blockTimestamp,\n };\n const blockBuilder = await this._vm.buildBlock({\n parentBlock,\n headerData,\n blockOpts: { calcDifficultyFromHeader: parentBlock.header },\n });\n try {\n const traces = [];\n const blockGasLimit = this.getBlockGasLimit();\n const minTxFee = this._getMinimalTransactionFee();\n const pendingTxs = this._txPool.getPendingTransactions();\n const txHeap = new TxPriorityHeap_1.TxPriorityHeap(pendingTxs);\n let tx = txHeap.peek();\n const results = [];\n const receipts = [];\n while (blockGasLimit.sub(blockBuilder.gasUsed).gte(minTxFee) &&\n tx !== undefined) {\n if (tx.gasLimit.gt(blockGasLimit.sub(blockBuilder.gasUsed))) {\n txHeap.pop();\n }\n else {\n const txResult = await blockBuilder.addTransaction(tx);\n traces.push(await this._gatherTraces(txResult.execResult));\n results.push(txResult);\n receipts.push(txResult.receipt);\n txHeap.shift();\n }\n tx = txHeap.peek();\n }\n const block = await blockBuilder.build();\n await this._txPool.updatePendingAndQueued();\n return {\n block,\n blockResult: {\n results,\n receipts,\n stateRoot: block.header.stateRoot,\n logsBloom: block.header.bloom,\n receiptRoot: block.header.receiptTrie,\n gasUsed: block.header.gasUsed,\n },\n traces,\n };\n }\n catch (err) {\n await blockBuilder.revert();\n throw err;\n }\n }", "function timeToLaunch() {\n // Get the current date\n var currentDate = new Date();\n\n // Find the difference between dates\n var diff = (currentDate - targetDate) / 1000;\n var diff = Math.abs(Math.floor(diff));\n\n // Check number of days until target\n days = Math.floor(diff / (24 * 60 * 60));\n sec = diff - days * 24 * 60 * 60;\n\n // Check number of hours until target\n hrs = Math.floor(sec / (60 * 60));\n sec = sec - hrs * 60 * 60;\n\n // Check number of minutes until target\n min = Math.floor(sec / (60));\n sec = sec - min * 60;\n }", "function timeToLaunch() {\n // Get the current date\n var currentDate = new Date();\n\n // Find the difference between dates\n var diff = (currentDate - targetDate) / 1000;\n var diff = Math.abs(Math.floor(diff));\n\n // Check number of days until target\n days = Math.floor(diff / (24 * 60 * 60));\n sec = diff - days * 24 * 60 * 60;\n\n // Check number of hours until target\n hrs = Math.floor(sec / (60 * 60));\n sec = sec - hrs * 60 * 60;\n\n // Check number of minutes until target\n min = Math.floor(sec / (60));\n sec = sec - min * 60;\n }", "getLatestBlock() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.ksnDriver.getLatestBlock();\n });\n }", "function getNextFreeBookingSlot(list, date = dayjs__WEBPACK_IMPORTED_MODULE_4__().valueOf(), min_size = 30) {\n const slots = getFreeBookingSlots(list, min_size);\n const time = dayjs__WEBPACK_IMPORTED_MODULE_4__(date).startOf('m').second(1);\n for (const block of slots) {\n const start = dayjs__WEBPACK_IMPORTED_MODULE_4__(block.start).startOf('m');\n const end = dayjs__WEBPACK_IMPORTED_MODULE_4__(block.end).startOf('m');\n if (start.isAfter(time, 's')) {\n return block;\n }\n else if (time.isBefore(end, 's')) {\n const duration = end.diff(time, 'm');\n if (duration >= min_size) {\n return block;\n }\n }\n }\n return slots[slots.length - 1];\n}", "findClosestSuccessor(eventRenderData, events) {\n const eventEnd = eventRenderData.endMS,\n isMilestone = eventRenderData.eventRecord && eventRenderData.eventRecord.duration === 0;\n let minGap = Infinity,\n closest,\n gap,\n event;\n\n for (let i = 0, l = events.length; i < l; i++) {\n event = events[i];\n gap = event.startMS - eventEnd;\n\n if (gap >= 0 && gap < minGap && ( // Two milestones should not overlap\n gap > 0 || event.endMS - event.startMS > 0 || !isMilestone)) {\n closest = i;\n minGap = gap;\n }\n }\n\n return closest;\n }", "findShallowIntersectingRange(date1, date2) {\n const thisRange = date1.toRange();\n const otherRange = date2.toRange(); // Start with infinite start and end dates\n\n let start = null;\n let end = null; // This start date exists\n\n if (thisRange.start) {\n // Use this definite start date if other start date is infinite\n if (!otherRange.start) {\n start = thisRange.start;\n } else {\n // Otherwise, use the earliest start date\n start = thisRange.start < otherRange.start ? thisRange.start : otherRange.start;\n } // Other start date exists\n\n } else if (otherRange.start) {\n // Use other definite start date as this one is infinite\n start = otherRange.start;\n } // Assign end date to this one if it is valid\n\n\n if (thisRange.end && (!start || thisRange.end >= start)) {\n end = thisRange.end;\n } // Assign end date to other one if it is valid and before this one\n\n\n if (otherRange.end && (!start || otherRange.end >= start)) {\n if (!end || otherRange.end < end) end = otherRange.end;\n } // Return calculated range\n\n\n return {\n start,\n end\n };\n }", "findShallowIntersectingRange(date1, date2) {\n const thisRange = date1.toRange();\n const otherRange = date2.toRange(); // Start with infinite start and end dates\n\n let start = null;\n let end = null; // This start date exists\n\n if (thisRange.start) {\n // Use this definite start date if other start date is infinite\n if (!otherRange.start) {\n start = thisRange.start;\n } else {\n // Otherwise, use the earliest start date\n start = thisRange.start < otherRange.start ? thisRange.start : otherRange.start;\n } // Other start date exists\n\n } else if (otherRange.start) {\n // Use other definite start date as this one is infinite\n start = otherRange.start;\n } // Assign end date to this one if it is valid\n\n\n if (thisRange.end && (!start || thisRange.end >= start)) {\n end = thisRange.end;\n } // Assign end date to other one if it is valid and before this one\n\n\n if (otherRange.end && (!start || otherRange.end >= start)) {\n if (!end || otherRange.end < end) end = otherRange.end;\n } // Return calculated range\n\n\n return {\n start,\n end\n };\n }", "findEmployeeMaxDate() {\n const employeesSorted = this.sampleEmployees\n .slice()\n .sort(\n (employee1, employee2) =>\n (employee2.payload()['hireDate']).getTime() -\n (employee1.payload()['hireDate']).getTime(),\n );\n return employeesSorted[0].payload()['hireDate'];\n }", "function getOrderDate(startDate,endDate,orderDetail){\r\n result = orderDetail.filter(d => {var time = new Date(d.orderdate).getTime();\r\n return (startDate <= time && time <= endDate);\r\n });\r\n return result;\r\n}", "findClosestSegment(currentTime) {\n let index = this.state.transcript.findIndex(function (a) {\n return a.start >= currentTime;\n });\n\n if((index === -1) && this.state.transcript.length > 0) {\n index = 0;\n }\n //adjust the index to the previous item when the start time is larger than the current time\n if(this.state.transcript[index] && this.state.transcript[index].start > currentTime) {\n index = index <= 0 ? 0 : index -1;\n }\n const segment = this.getSegmentByStartTime(this.state.transcript[index].start || 0);\n if(segment) {\n return segment.sequenceNr || 0;\n }\n return 0;\n }", "checkIfDelay(date1,date2){\n a = new Date(date1);\n b = new Date(date2);\n\n if(b > a){\n return true\n }else{\n return false\n }\n\n }", "function colorText() {\n var currTime = moment().format(\"HH:00\");\n // var currTime = \"12:00\";\n\n for (block of timeBlocks) {\n /* //Console Logs\n console.log(currTime);\n console.log(currTime > timeBlocks[0].number);\n */\n var blockMilitaryTime = block.number;\n\n /* //PseudoCode\n if(blockTime < currTime) grey color\n else if(blockTime === currTime) red color\n else if(blockTime > currTime) green color\n */\n\n if (currTime > blockMilitaryTime) {\n $(`#${block.id}`).addClass(\"past\");\n // $(`#${block.id}`).attr(\"readonly\", true);\n $(`#${block.id}`).removeClass(\"present\");\n $(`#${block.id}`).removeClass(\"future\");\n /* //Console Logs\n console.log(block);\n console.log(\"past\");\n console.log(currTime);\n console.log(block.number);\n console.log(\"past check \" + (currTime > blockMilitaryTime));\n console.log(\"future check \" + (currTime < blockMilitaryTime));\n console.log(\"present check \" + (blockMilitaryTime === currTime));\n */\n }\n if (currTime < blockMilitaryTime) {\n $(`#${block.id}`).addClass(\"future\");\n // $(`#${block.id}`).attr(\"readonly\", false);\n $(`#${block.id}`).removeClass(\"past\");\n $(`#${block.id}`).removeClass(\"present\");\n\n /* //Console Logs\n console.log(block);\n console.log(\"future\");\n console.log(currTime);\n console.log(block.number);\n console.log(\"past check \" + (currTime > blockMilitaryTime));\n console.log(\"future check \" + (currTime < blockMilitaryTime));\n console.log(\"present check \" + (blockMilitaryTime === currTime));\n */\n }\n if (currTime === blockMilitaryTime) {\n $(`#${block.id}`).addClass(\"present\");\n // $(`#${block.id}`).attr(\"readonly\", false);\n $(`#${block.id}`).removeClass(\"past\");\n $(`#${block.id}`).removeClass(\"future\");\n\n /* //Console Logs\n console.log(block);\n console.log(\"present\");\n console.log(currTime);\n console.log(block.number);\n console.log(\"past check \" + (currTime > blockMilitaryTime));\n console.log(\"future check \" + (currTime < blockMilitaryTime));\n console.log(\"present check \" + (currTime === blockMilitaryTime)); \n */\n }\n }\n}", "findClosestSuccessor(eventRenderData, events) {\n let minGap = Infinity,\n closest,\n eventEnd = eventRenderData.endMs,\n gap,\n isMilestone = eventRenderData.event.duration === 0,\n evt;\n\n for (let i = 0, l = events.length; i < l; i++) {\n evt = events[i];\n gap = evt.startMs - eventEnd;\n\n if (\n gap >= 0 &&\n gap < minGap &&\n // Two milestones should not overlap\n (gap > 0 || evt.endMs - evt.startMs > 0 || !isMilestone)\n ) {\n closest = evt;\n minGap = gap;\n }\n }\n return closest;\n }", "function bezier(time, target) {\n var lookUp = target.lookUp;\n var low = 0;\n var high = lookUp.length - 1;\n var mid, sample1, sample2;\n\n if (time <= lookUp[low].x) {\n return lookUp[low].y;\n }\n\n if (time >= lookUp[high].x) {\n return lookUp[high].y;\n }\n\n while (low <= high) {\n mid = Math.floor((low + high) / 2);\n sample1 = lookUp[mid];\n sample2 = lookUp[mid + 1];\n\n if (sample1.x <= time && sample2.x >= time) {\n return lerp(time, sample1.x, sample2.x, sample1.y, sample2.y);\n } else if (sample1.x > time) {\n high = mid - 1;\n } else {\n low = mid + 1;\n }\n }\n }", "function findClosest(a, b) {\n var dummyOffset = data[b].offset; // we must have one for each column 1-end\n var l = 0;\n var r = activeData['capture_times'][b].length - 1;\n\n while (r - l > 1) {\n var m = Math.floor((r + l) / 2);\n if (activeData['capture_times'][b][m] + dummyOffset < activeData['capture_times'][0][a]) l = m;\n else r = m;\n }\n\n if (Math.abs(activeData['capture_times'][b][l] + dummyOffset - activeData['capture_times'][0][a]) < Math.abs(activeData['capture_times'][b][r] + dummyOffset - activeData['capture_times'][0][a])) return l;\n return r;\n}", "function getNext(now) {\n var n = game.timePoints.findIndex(function(tp) {\n return now < tp.time;\n });\n //console.log('getNext', now, n, game.timePoints[n]);\n return game.timePoints[n];\n}", "async getClosestTag(snapToStartFrom) {\n const tagsHashMap = this.tags.getHashMap();\n\n const stopFn = async snap => {\n if (tagsHashMap.has(snap.hash)) {\n return true;\n }\n\n return false;\n };\n\n const iterable = this.snapsIterable(snapToStartFrom, {\n firstParentOnly: true,\n stopFn\n });\n const snaps = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n\n var _iteratorError;\n\n try {\n for (var _iterator = (0, _asyncIterator2().default)(iterable), _step, _value; _step = await _iterator.next(), _iteratorNormalCompletion = _step.done, _value = await _step.value, !_iteratorNormalCompletion; _iteratorNormalCompletion = true) {\n const snap = _value;\n snaps.push(snap);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n await _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n if (snaps.length) {\n const hashOfLastSnap = snaps[snaps.length - 1].hash;\n return tagsHashMap.get(hashOfLastSnap);\n }\n\n return undefined;\n }", "get firstFullTimeDay() {\n return this.detailedDailyWage.find(day => day.wage===160);\n }", "function filterdateTime(ldata) {\n return ldata.datetime === forminput;\n}", "getMatchSeek(member){\n let toReturn = null\n this.matchSeekSet.forEach(matchSeek =>{\n if (matchSeek.seeker === member){\n toReturn = matchSeek\n }\n })\n return toReturn\n }", "findAndClaimSource(creep) {\n let nowaiting;\n let i = this.pointer;\n do {\n let sourceWrapper = this.sources.get(i);\n for (let j = 0; j < sourceWrapper.spaces.length; j++) {\n if (sourceWrapper.spaces[j].count === 0) {\n this.pointer = (this.pointer + 1) % this.sources.size;\n return sourceWrapper.claim(creep, j);\n }\n else if (!nowaiting && sourceWrapper.spaces[j].count === 1) {\n nowaiting = [sourceWrapper, j];\n }\n }\n i = (i + 1) % this.sources.size;\n } while (i !== this.pointer && i < this.sources.size);\n return nowaiting && nowaiting[0].claim(creep, nowaiting[1]);\n }", "function DateFromBlock(BlockNum)\r\n{\r\n var Str;\r\n var now=new Date(FIRST_TIME_BLOCK+BlockNum*1000);\r\n Str=now.toISOString();\r\n Str=Str.substr(0,Str.indexOf(\".\"));\r\n Str=Str.replace(\"T\",\" \");\r\n return Str;\r\n}", "function findStartEndTime () {\n if (temperatureData[0].time.getTime() > phData[0].time.getTime()) {\n dataStartTime = phData[0].time.getTime();\n //console.log(\"took pH start time\");\n } else {\n dataStartTime = temperatureData[0].time.getTime();\n }\n if (temperatureData[temperatureData.length-1].time.getTime() < phData[phData.length-1].time.getTime()) {\n dataEndTime = phData[phData.length-1].time.getTime();\n //console.log(\"took pH end time\");\n } else {\n dataEndTime = temperatureData[temperatureData.length-1].time.getTime();\n }\n\n console.log(\"Start: \" + new Date(dataStartTime) + \" End: \" + new Date(dataEndTime));\n}", "function findTrades() {\t\n\t \t\n\tfindMaxAndTimeFrame(data.set, data.set.length-1)\n\n}", "function checkTime() {\n //use momentjs to grab current hour\n var currentHour = moment().hours();\n //compare currentHour against blockHour\n // if else?\n //need to grab hours for the time block\n // loop through timeblock hours class of time-block??\n\n $(\".time-block\").each(function () {\n var blockHour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n\n if (blockHour > currentHour) {\n $(this).addClass(\"past\");\n } else if (blockHour === currentHour) {\n $(this).addClass(\"present\");\n } else {\n $(this).addClass(\"future\");\n }\n });\n }", "findDuration() {\n this.duration = 0;\n for(var i=0; i<this.sections.length; i++) {\n var sectionEnd = this.sections[i].getEndTime();\n if(sectionEnd > this.duration) {\n this.duration = sectionEnd;\n }\n }\n }", "function _getBestCoin(list, target, ignoreIndex) {\n\n if (target == null || target.min <= 0 || target.min > target.max) return null; \n let ignore = (typeof(ignoreIndex) === 'number') ? (function(elt) { return (elt.l.indexOf(ignoreIndex) !== -1); }) : (function(elt) { return false; });\n \n//TODO replace with a binary search - but actually don't think I can?\n let index = list.findIndex(function(elt) {\n return (!ignore(elt) && elt.s >= target.min && elt.s <= target.max);\n });\n \n let result = new Array();\n\n while(index >= 0) {\n result.push(list[index++]);\n\n if (index == list.length || list[index].s < target.min || list[index].s > target.max) {\n index = -1;\n }\n }\n\n return result;\n}", "findNext(hour, minute = 0, second = 0) {\n hour = hour % 12;\n let currentTime = new Date();\n let targetTime = new Date();\n targetTime.setHours(hour);\n targetTime.setMinutes(minute);\n targetTime.setSeconds(second);\n while (currentTime.getTime() >= targetTime.getTime()) {\n targetTime = this.advance12Hours(targetTime);\n }\n return targetTime;\n }", "getTimestamp(state, id, date) {\n const paymentTimestamp = super.getTimestamp(state, id, date)\n // If it's the \"all\" fund, we don't care about it's timestamp, since that\n // only refers to a funds manual ignore date. \n const fund = id && id !== \"all\" ? records.getFundData(state)[id] : 0\n return Math.max(paymentTimestamp, fund.timestamp)\n }", "function is_vender_available(vendor_id, date_time)\n{\n // setup for easier loop run\n let meal = meals.results;\n let vendor = vendors.results;\n\n let input = new Date(date_time);\n\n // check if concurrent\n for(let i = 0; i < meal.length; i++)\n {\n let tracker = 1;\n if(meal[i].datetime === date_time && meal[i].vendor_id === vendor_id)\n {\n tracker++;\n for(let j = 0; j < vendor.length; j++)\n { \n if(vendor[j].vendor_id === vendor_id)\n {\n if(vendor[j].drivers > tracker)\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n }\n }\n }\n\n // check time after or before\n for(let k = 0; k < meal.length; k++)\n {\n if(meal[k].vendor_id === vendor_id)\n {\n let current = new Date(meal[k].datetime)\n // if input is greater than time in object\n if(input > current)\n {\n let after = new Date(meal[k].datetime);\n after.setMinutes(after.getMinutes() + 10);\n\n if(current < after && after > input)\n {\n return false;\n }\n }\n // if input is less than time in object\n if(input < current)\n {\n let before = new Date(meal[k].datetime);\n before.setMinutes(before.getMinutes() - 30);\n if(current > input && before < input)\n {\n return false;\n }\n }\n }\n }\n \n return true;\n}", "detect(dt, t) {}", "get_oldest_starting_date() {\n return this.tasks\n .map(task => task._start)\n .reduce(\n (prev_date, cur_date) =>\n cur_date <= prev_date ? cur_date : prev_date\n );\n }", "function getLastRecord(sumlist) {\n var oldestDate=new Date();\n var oldestIndex=-1;\n oldestDate.setTime(0);\n for (var i=0;i<sumlist.length;i++) {\n var entry = sumlist[i];\n if (entry.amt>0 && entry.date>oldestDate) {\n oldestDate=entry.date;\n oldestIndex=i;\n }\n }\n return oldestIndex;\n}", "function scanForView(lContainer, startIdx, viewBlockId) {\n for (var i = startIdx + CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n var viewAtPositionId = lContainer[i][TVIEW].id;\n if (viewAtPositionId === viewBlockId) {\n return lContainer[i];\n }\n else if (viewAtPositionId < viewBlockId) {\n // found a view that should not be at this position - remove\n removeView(lContainer, i - CONTAINER_HEADER_OFFSET);\n }\n else {\n // found a view with id greater than the one we are searching for\n // which means that required view doesn't exist and can't be found at\n // later positions in the views array - stop the searchdef.cont here\n break;\n }\n }\n return null;\n}", "getMinningReward(blockId){\n return 10/Math.pow(2,Math.floor((blockId-1)/200))\n }", "getLatestElectionStanding(electionId, measurementDate = new Date()) {\n let measurementTime = measurementDate.getTime();\n let candidatesPromise = this.getCandidates(electionId);\n let partiesPromise = this.getParties(electionId);\n let standingPromise = this.db.electionStandings\n .where('measurementDate').belowOrEqual(measurementDate) // Sorts naturally on the measurementDate index\n .and(standing => standing.electionId === electionId)\n .last();\n \n return Promise\n .all([candidatesPromise, partiesPromise, standingPromise])\n .then((values) => {\n let [candidates, parties, standing] = values;\n return this.electionStandingBuilder\n .candidates(candidates)\n .parties(parties)\n .standing(standing)\n .build();\n });\n }", "getTopSourcesAndEvents(timestamp, k) {\n /* \n Sort cumulativeMentions according to cumulative amount of mentions at time 'timestamp'\n Use it to get our top sources\n */\n const tmp = [...this.sourceCumulatedMentions.entries()].sort((a, b) => {\n return b[1].get(timestamp) -a[1].get(timestamp) // Decreasing order\n });\n\n const topSourcesCumulatedMentions = (k > tmp.length) ? tmp : tmp.slice(0, k)\n\n // topsources : Map(SourceName => cumulatedCount)\n const topSources = topSourcesCumulatedMentions.map( (elem) => elem[0] );\n\n // For each sourceName in the top sources\n const res = topSources.map((sourceName) => {\n\n // For each [timestamp, SortedArray[EventIds]] in timeEventTree[sourceName], drop it if timestamp > timestamp\n const filteredSourceTimeEventTree = [...this.sourceTimeEventTree.get(sourceName).entries()].filter( (elem) => {\n return elem[0] <= parseInt(timestamp)\n })\n\n const tmp3 = new MapOrElse(filteredSourceTimeEventTree) // Recreate a map from the array of entries\n\n return [sourceName, tmp3]\n })\n\n return new MapOrElse(res)\n }", "function snapFirstOccurence(dates, times) {\n\t\tvar startDate = new Date(dates.start),\n\t\t duration = (times.end.hours - times.start.hours) * 3600000 +\n\t\t (times.end.minutes - times.start.minutes) * 60000;\n\n\t\t// Search forward until we get the actual day of the first class\n\t\twhile (startDate.getDay() != times.day)\n\t\t\tstartDate = new Date(3600000 + +startDate);\n\n\t\tstartDate.setHours(times.start.hours, times.start.minutes, 0, 0);\n\n\t\treturn {\n\t\t\tstart: startDate,\n\t\t\tend: new Date(duration + +startDate),\n\t\t};\n\t}", "function getPriceAtDateTime(dateTime) {\n var epoch = dateTime.getTime() / 1000;\n for (var i = 0; i < priceHistoryDocs.length; i++) {\n if (priceHistoryDocs[i].time == epoch) {\n return priceHistoryDocs[i].open;\n }\n }\n return null;\n}", "leastThan(operand){\r\n return ((this.hours === operand.hours && this.minutes < operand.minutes)\r\n || (this.hours < operand.hours));\r\n }", "function scanForView(lContainer, tContainerNode, startIdx, viewBlockId) {\n var views = lContainer[VIEWS];\n for (var i = startIdx; i < views.length; i++) {\n var viewAtPositionId = views[i][TVIEW].id;\n if (viewAtPositionId === viewBlockId) {\n return views[i];\n }\n else if (viewAtPositionId < viewBlockId) {\n // found a view that should not be at this position - remove\n removeView(lContainer, tContainerNode, i);\n }\n else {\n // found a view with id greater than the one we are searching for\n // which means that required view doesn't exist and can't be found at\n // later positions in the views array - stop the search here\n break;\n }\n }\n return null;\n}", "function findBRDA(source, blockNumber, branchNumber, lineNumber) {\n\tfor (var i=0; i < source.length; i++) {\n\t\tif (source[i].blockNumber === blockNumber\n\t\t\t&& source[i].branchNumber === branchNumber\n\t\t\t&& source[i].lineNumber === lineNumber) {\n\t\t\treturn source[i];\n\t\t}\n\t}\n\treturn null;\n}", "function _get_min(d1, d2){\n if (d1){\n if (d2){\n if (d1.toDate() < d2.toDate()){\n return d1;\n }\n else{\n return d2;\n }\n }\n else{\n return d1;\n }\n }\n else{\n return d2;\n }\n}", "getLastestBlock(){\r\n return this.chain[this.chain.length - 1];\r\n }", "function filterByDate(sighting) {\n return sighting.datetime === inputDate;\n }", "function checkIfCurHour() {\n var currHour = moment().hours();\n $timeBlockEl.each(function () {\n var blockHour = $(this).data(\"hour\");\n \n function getBlockStyle() {\n if (blockHour > currHour) {\n return \"future\";\n } else if (blockHour < currHour) {\n return \"past\";\n } else if (blockHour === currHour) {\n return \"present\";\n }\n }\n\n $(this).removeClass(\"present past future\");\n $(this).addClass(getBlockStyle());\n });\n}", "function checkHash() {\n var targetElement = null; // target DOM node\n var targetTiming = null; // target time node\n var container = null; // ???\n var i, tmp;\n\n // get the URI target element\n var hash = document.location.hash;\n if (hash.length) {\n consoleLog(\"new hash: \" + hash);\n var targetID = hash.substr(1).replace(/\\&.*$/, \"\");\n // the hash may contain a leading char (e.g. \"_\") to prevent scrolling\n targetElement = document.getElementById(targetID)\n || document.getElementById(targetID.substr(1));\n }\n if (!targetElement) return;\n consoleLog(targetElement);\n\n // get the target time node (if any)\n tmp = document.getTimeNodesByTarget(targetElement);\n if (tmp.length) {\n targetTiming = tmp[0];\n container = tmp[0].parentNode;\n }\n\n // the hash might contain some temporal MediaFragment information\n var time = NaN;\n if (targetTiming && targetTiming.timeContainer) {\n tmp = hash.split(\"&\");\n for (i = 0; i < tmp.length; i++) {\n if (/^t=.*/i.test(tmp[i])) { // drop end time (if any)\n time = targetTiming.parseTime(tmp[i].substr(2).replace(/,.*$/, \"\"));\n break;\n }\n }\n }\n\n // activate the time container on the target element:\n // http://www.w3.org/TR/SMIL3/smil-timing.html#Timing-HyperlinkImplicationsOnSeqExcl\n // we're extending this to all time containers, including <par>\n // -- but we still haven't checked wether '.selectIndex()' works properly with <par>\n var containers = [];\n var indexes = [];\n var timeNodes = [];\n var element = targetElement;\n while (container) {\n for (var index = 0; index < container.timeNodes.length; index++) {\n if (container.timeNodes[index].target == element) {\n consoleLog(\"target found: \" + element.nodeName + \"#\" + element.id);\n if (!container.timeNodes[index].isActive()) {\n containers.push(container);\n indexes.push(index);\n timeNodes.push(container.timeNodes[index]);\n }\n break;\n }\n }\n // loop on the parent container\n element = container.getNode();\n container = container.parentNode;\n }\n for (i = containers.length - 1; i >= 0; i--) {\n consoleLog(containers[i].nodeName + \" - index=\" + indexes[i]);\n containers[i].selectIndex(indexes[i]);\n //containers[i].selectItem(timeNodes[i]);\n //containers[i].show();\n //timeNodes[i].show();\n }\n\n // set the target time container to a specific time if requested (MediaFragment)\n if (targetTiming && !isNaN(time)) {\n targetTiming.setCurrentTime(time);\n consoleLog(targetElement.nodeName + \" time: \" + time);\n }\n\n // ensure the target element is visible\n //targetElement.focus(); // not working if targetElement has no tabIndex\n if (targetElement[\"scrollIntoViewIfNeeded\"] != undefined)\n targetElement.scrollIntoViewIfNeeded(); // WebKit browsers only\n else try {\n //targetElement.scrollIntoView();\n var tabIndex = targetElement.tabIndex;\n targetElement.tabIndex = 0;\n targetElement.focus();\n targetElement.blur();\n if (tabIndex >= 0)\n targetElement.tabIndex = tabIndex;\n else\n targetElement.removeAttribute(\"tabIndex\");\n } catch(e) {}\n}", "function sights(data){\n return data.datetime == date; \n}", "function compareEarliestFn(a, b) {\n const workA = a.deadline;\n const workB = b.deadline;\n\n let comparison = 0;\n if (workA > workB) {\n comparison = 1;\n } else if (workA < workB) {\n comparison = -1;\n }\n return comparison;\n}", "function findMin (x) {\r\n let tmp = timeArr.map((t) => {\r\n return xScale(d3.utcParse(t * 1000))\r\n })\r\n let index = d3.bisectLeft(tmp, x)\r\n return index\r\n }", "function scanForView(lContainer, tContainerNode, startIdx, viewBlockId) {\n var views = lContainer[VIEWS];\n for (var i = startIdx; i < views.length; i++) {\n var viewAtPositionId = views[i][TVIEW].id;\n if (viewAtPositionId === viewBlockId) {\n return views[i];\n }\n else if (viewAtPositionId < viewBlockId) {\n // found a view that should not be at this position - remove\n removeView(lContainer, tContainerNode, i);\n }\n else {\n // found a view with id greater than the one we are searching for\n // which means that required view doesn't exist and can't be found at\n // later positions in the views array - stop the searchdef.cont here\n break;\n }\n }\n return null;\n}", "function scanForView(lContainer, tContainerNode, startIdx, viewBlockId) {\n var views = lContainer[VIEWS];\n for (var i = startIdx; i < views.length; i++) {\n var viewAtPositionId = views[i][TVIEW].id;\n if (viewAtPositionId === viewBlockId) {\n return views[i];\n }\n else if (viewAtPositionId < viewBlockId) {\n // found a view that should not be at this position - remove\n removeView(lContainer, tContainerNode, i);\n }\n else {\n // found a view with id greater than the one we are searching for\n // which means that required view doesn't exist and can't be found at\n // later positions in the views array - stop the searchdef.cont here\n break;\n }\n }\n return null;\n}", "warpIfNeeded(newScrollTop) {\n const me = this,\n result = {\n newScrollTop,\n deltaTop: newScrollTop - me.lastScrollTop\n }; // if gap to fill is large enough, better to jump there than to fill row by row\n\n if (Math.abs(result.deltaTop) > me.rowCount * me.rowOffsetHeight * 3) {\n // no specific record targeted\n let index; // Specific record specified as target of scroll?\n\n if (me.scrollTargetRecordId) {\n index = me.store.indexOf(me.scrollTargetRecordId); // since scroll is happening async record might have been removed after requesting scroll,\n // in that case we rely on calculated index (as when scrolling without target)\n } // perform the jump and return results\n\n result.newScrollTop = me.jumpToPosition(newScrollTop, index);\n result.deltaTop = 0; // no extra filling needed\n }\n\n return result;\n }", "_getThumbIndexForTime(time) {\n var thumbs = this._thumbs\n for(let i=thumbs.length-1; i>=0; i--) {\n let thumb = thumbs[i]\n if (thumb.time <= time) {\n return i\n }\n }\n // stretch the first thumbnail back to the start\n return 0\n }", "compareDate(a, b) {\n if (a.startDate < b.startDate) return -1\n if (a.startDate > b.startDate) return 1\n else return 0\n }", "topSleeper(date) {\n const allOnDay = this.data.filter((entry) => {\n return entry.date === date\n })\n const reOrder = allOnDay.sort((a, b) =>{\n return a.hoursSlept - b.hoursSlept\n })\n const topSleeper = reOrder.pop()\n return topSleeper.userID\n }", "closestCommonAncestor(vampire) {\n if (this === vampire) {\n return this;\n }\n\n //// Make oldMan the most senior vampire\n let oldMan = this;\n let youngMan = vampire;\n if (vampire.isMoreSeniorThan(this)){\n oldMan = vampire;\n youngMan = this;\n }\n\n // if oldman has no creator, he is root so return self\n if(!oldMan.creator) {\n return oldMan;\n }\n // if young man is old mans child\n if (oldMan.offspring.includes(youngMan)) {\n return oldMan;\n }\n \n if (youngMan.creator === oldMan.creator) {\n return youngMan.creator;\n }\n\n let parent = oldMan.creator;\n\n for(let i = parent.numberOfVampiresFromOriginal; i >= 0; i--){\n log(`${i}th time ran`)\n log(parent);\n if(parent.offspring.includes(youngMan)){\n return parent;\n }\n parent = parent.creator;\n }\n \n return null;\n }", "function findClosePoint() {\n\tlet high = findMaxAndTimeFrame()\n\tlet low = data.set[findMin()]\n\n\tlet Close = high - ((high - low) * 1.382)\n\treturn Close\n\n}", "getWillLast() {\n\n let months = this.getAge().months;\n let change = this.matchGrowthRange(months);\n let height = Number(this.height);\n\n let startMonth = months;\n\n let maxHeight;\n\n const willLastDinamic = [];\n\n // = while child height is on the range =\n while (height < maxHeight) {\n\n height += Number(change);\n months += 6;\n change = this.matchGrowthRange(months);\n\n\n const filter = new Filter(Math.round(height));\n const currentAgeBike = new SearchService().matchBike(filter);\n\n willLastDinamic.push({ height, change, currentAgeBike })\n\n }\n\n // = how much current bike will last =\n if (willLastDinamic.length) {\n\n const lastMonth = willLastDinamic[willLastDinamic.length - 1].currentAgeBike.growthMonths;\n willLastDinamic.map((item) => item.currentAgeBike.lastAge = (lastMonth - item.currentAgeBike.growthMonths) / 12)\n\n }\n\n const estimatedAge = (months - startMonth) / 12;\n\n return { age: estimatedAge, dinamic: willLastDinamic }\n\n }", "function getCurrentHour(hourElArr, blockArr){\n let currentHour = moment().format(\"HH\");\n for (let i = 0; i < 9; i++) {\n if (parseInt(hourElArr[i].textContent) > parseInt(currentHour)){\n blockArr[i].setAttribute(\"class\",\"row time-block future\");\n } else if (parseInt(hourElArr[i].textContent) === parseInt(currentHour)){\n blockArr[i].setAttribute(\"class\",\"row time-block present\");\n } else if ((parseInt(hourElArr[i].textContent) < parseInt(currentHour))){\n blockArr[i].setAttribute(\"class\",\"row time-block past\");\n }\n }\n}", "function nextDate(dates){\n const now = new Date()\n for (let i = 0; i < dates.length; i += 1) {\n const date = dates[i]\n if (date > now) {\n return date\n }\n }\n return false\n}", "getLatestBlock () {\n return this.chain[this.chain.length -1];\n }", "findMinWaitTime(waitTimes){\n\n let min = Number(waitTimes.current);\n let recommendation = 'Go Now';\n \n if(Number(waitTimes.waitOneHour) < min){\n min = waitTimes.waitOneHour;\n recommendation = 'Wait One Hour';\n }\n\n if(Number(waitTimes.waitFiveHour) < min){\n min = waitTimes.waitFiveHour;\n recommendation = 'Wait Five Hours';\n }\n\n if(Number(waitTimes.tomorrow) < min){\n min = waitTimes.tomorrow;\n recommendation = 'Go Tomorrow';\n }\n\n return recommendation;\n\n }", "function isTimeForNextEntryReached(hash) {\n return new Promise((resolve, reject) => {\n console.log('got request for isTimeForNextEntryReached: ' + hash);\n var ref = admin.database().ref('/sensorvalues/' + hash).orderByKey().limitToLast(1);\n console.log('ref: ' + ref);\n ref.once('value').then(snapshot => {\n console.log('last entry (str): ' + JSON.stringify(snapshot) + ' pure: ' + snapshot + ' val ');\n if ( snapshot.val() === null ) {\n console.log('result is null, but ok');\n return resolve(hash);\n }\n snapshot.forEach((key) => {\n var dateval = key.val().date;\n console.log('Date of last entry: ' + new Date(dateval).toLocaleDateString() + ' date ' + new Date(dateval).toLocaleTimeString());\n console.log('diff: ' + (Date.now() - dateval));\n if ((Date.now() - dateval) > 60 * 60 * 1000) {\n return resolve(hash);\n }\n return resolve('0');\n });\n return reject('error - something went wrong, because result is not handled: ' + JSON.stringify(snapshot));\n }).catch((err) => {\n console.error('error: ' + err);\n return reject(err);\n });\n });\n}", "getLatestBlock() {\n return this.chain[this.chain.length - 1];\n }", "getLatestBlock() {\n return this.chain[this.chain.length - 1];\n }" ]
[ "0.58645713", "0.550507", "0.5480811", "0.54645824", "0.5345906", "0.5241293", "0.52398133", "0.5222808", "0.51976556", "0.5076727", "0.5051302", "0.4966554", "0.4961413", "0.49602956", "0.49491388", "0.49074468", "0.48900807", "0.48770028", "0.48598707", "0.4837624", "0.48365968", "0.48335245", "0.48332977", "0.48272374", "0.4795189", "0.47838604", "0.47838533", "0.47759312", "0.4768246", "0.47602415", "0.47572878", "0.4750749", "0.47473592", "0.4728608", "0.47138774", "0.47138774", "0.4689761", "0.46894524", "0.46859884", "0.46712828", "0.46712828", "0.46708533", "0.46433163", "0.46431106", "0.46075296", "0.45905063", "0.45877713", "0.45734763", "0.45659685", "0.45623553", "0.45610604", "0.45600832", "0.45583373", "0.4552613", "0.45491603", "0.45401904", "0.45314273", "0.45242485", "0.45190597", "0.45188063", "0.45102206", "0.45098296", "0.45057407", "0.4504564", "0.45039847", "0.4492351", "0.44899592", "0.4485566", "0.44835204", "0.44781312", "0.44698656", "0.44691533", "0.44639036", "0.4453674", "0.4446564", "0.44460675", "0.44455498", "0.44384307", "0.44354868", "0.44279695", "0.44212767", "0.44010952", "0.43930143", "0.4388945", "0.43861994", "0.43861994", "0.43822432", "0.43811214", "0.4377197", "0.43754646", "0.43740433", "0.43702763", "0.4367357", "0.43613356", "0.43572074", "0.4356251", "0.4348726", "0.43459415", "0.43452698", "0.43452698" ]
0.6291921
0
ajax request POST User authorization through SmartDoor
function user_request(payload) { $.ajax({ method: 'POST', // Add URL from API endpoint url: ' https://ccg20ezekb.execute-api.us-west-2.amazonaws.com/Prod/gain_access', dataType: 'json', contentType: 'application/json', data: JSON.stringify(payload), success: function (res) { var user_name = null; if (res) { message = 'The user was granted access through SmartDoor!'; console.log("res ====", res) // Override username value from API response - username user_name = res["user_name"]; console.log(user_name); } console.log(res); window.location.href = "../html/door.html?user_name=" + user_name; }, error: function (err) { let message_obj = JSON.parse(err.responseText); let message = message_obj.message.content; $('#answer').html('Error:' + message).css("color", "red"); console.log(err); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function login() {\n $.ajax({\n type: \"POST\",\n contentType: \"application/json\",\n url: \"http://localhost:8181/fabric/security/token\",\n dataType: \"json\",\n data: '{\"username\":\"' + getElementByIdValue(\"username\") + '\", \"password\":\"' + getElementByIdValue(\"password\") + '\"}',\n success: function () {\n authenticated = true;\n $('#loginbox').hide(\"slow\");\n updateTable();\n }\n });\n }", "function auth($username,$email, $password) {\n $.ajax({\n type: \"POST\",\n //SEND TO MY SERVER URL\n url: \"http://localhost:3000/users\",\n dataType: 'json',\n //async: false,\n data: { 'username': $username, 'email':$email,'password': $password ,'ent':-1,'lit':-1,'gk':-1,'tech':-1,'sports':-1},\n success: function (response) {\n $.session.set('username', $username);\n $(window).attr('location', '../html/user_dashboard.html');\n \n \n \n \n console.log(response);\n }\n })\n}", "function doany_auth(token) {\n var base_url = \"https://sm-prod2.any.do/\";\n var xhr = new XMLHttpRequest();\n xhr.open('POST', base_url + 'j_spring_security_check');\n console.log('posting to ' + base_url + 'j_spring_security_check');\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n xhr.send('j_username=<enter-urlencoded-username>&j_password=<enter-urlencoded-password>&_spring_security_remember_me=on');\n xhr.onload = function () {\n var auth = this.getResponseHeader('X-Anydo-Auth');\n doany_tasks(token, auth);\n };\n}", "function loginSL(pass) {\n // PHP: http://localhost:7833/cportal/login&username=dylan&password=asdf\n // REST: http://localhost:7833/cportal/login?username=dylan&password=asdf\n console.log(\"User '\" + User + \"' attempting SL login @ \" + ServerAddress + \"..\");\n console.log(\"Attempting GET (Boolean) >> \" + ServerAddress + \"/cportal/login?username=\" + User + \"&password=***\");\n var request = \"cportal/login&username=\" + User + \"&password=\" + pass;\n SendAjaxPOST(request);\n}", "function checkLoggedInUserAuth(user) {\n var userN;\n var passW;\n // create request \n if (userRelogProfileReq.readyState == 4) {\n\n var dbData = JSON.parse(showErrorMain(userRelogProfileReq.responseText, \"Error Found\"));\n\n\n if (Object.entries(dbData['queryresult']).length != 0) {\n\n\n var userDetails = dbData['queryresult'];\n\n for (i = 0; i < userDetails.length; i++) {\n if ((userDetails[i]['userlogin'] == user['userlogin']) && (userDetails[i]['userkey'] == user['userkey'])) {\n userN = userDetails[i]['userlogin'];\n passW = userDetails[i]['userpassword'];\n }\n }\n\n\n // var query = \"SELECT * FROM InovoMonitor.tblUsers where InovoMonitor.tblUsers.userpassword = '\" + passW + \"' AND InovoMonitor.tblUsers.username = '\" + userN + \"';\"\n // var query = \"SELECT * FROM InovoMonitor.tblUsers\"; // where InovoMonitor.tblUsers.userpassword = '\" + passW + \"' AND InovoMonitor.tblUsers.username = '\" + userN + \"';\"\n\n userProfilereq.open(\"POST\", serverURL + \"/UserAuth?\", true);\n // userProfilereq.open(\"POST\", serverURLDEV + \"/UserAuth?\", true);\n // userProfilereq.open(\"POST\", \"/UserAuth?\", true);\n userProfilereq.onreadystatechange = returnProfile;\n userProfilereq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n userProfilereq.send(\"action=authenticate&username=\" + userN + \"&password=\" + passW)\n }\n }\n //http://102.164.81.12:7080/InovoCentralMonitorClient/UserAuth?action=authenticate&username=esiwela&password=esiwela\n\n}", "function submitForm()\n {\n var data = {\n email: $('#email').val(),\n password: $('#password').val(),\n encodedString:$(''),\n userId:$('')\n };\n $.ajax({\n\n type : 'POST',\n url : 'rest/user-login',\n dataType: 'json',\n contentType: 'application/json; charset=utf-8',\n data : JSON.stringify(data),\n beforeSend: function()\n {\n $(\"#error\").fadeOut();\n $(\"#btn-submit\").html('<span class=\"glyphicon glyphicon-transfer\"></span> &nbsp; sending ...');\n },\n success : function(data)\n {\n if(data.status == \"success\") {\n document.cookie = 'Authorization' +\"=\" + data.encodedString;\n document.cookie = 'username' +\"=\" + data.firstName;\n window.location = \"userhomepage.html\";\n } else {\n $('#errorMessage').fadeIn();\n }\n\n return false;\n }\n });\n return false;\n }", "_handleLogin() {\n if (this.$.loginForm.validate()) {\n let loginPostObj = { phoneNumber: parseInt(this.$.username.value), password: this.$.password.value };\n this.$.loginForm.reset();\n this.action = 'list';\n this._makeAjax('http://10.117.189.147:9090/foreignexchange/login', 'post', loginPostObj);\n }\n }", "function authorized() {\n console.log(user);\n attendanceLocation = $('#userLocationOption').val();\n console.log(attendanceLocation);\n \n console.log(allLocations[attendanceLocation - 1]);\n var locationObj = allLocations[(attendanceLocation - 1)];\n console.log(locationObj);\n //email = user.email;\n //password = user.passwords;\n \n $.ajax({\n type: \"POST\",\n url: \"http://localhost:8080/api/users/coming\",\n\n data: JSON.stringify({\n \"isAttending\": true,\n \"isAuthorized\": true,\n location : locationObj,\n user: user\n }),\n headers: {\n \"email\": email,\n \"password\": password,\n \"content-type\": \"application/json\"\n },\n success: function (response) {\n //alert('success - attending:' + response.isAttending + 'authorized: ' +response.isAuthorized);\n $(\"#survey-authorized\").show();\n $(\"#survey-authorized-text\").html('You are authorized to come in to the ' + response.location.cityName + ' office today.');\n //console.log(response);\n },\n error: function (err) {\n //alert('error' + err);\n console.log(err);\n }\n });\n}", "function loginClick() {\n\t username = $(\"#userName\").val();\n\t password = $(\"#password\").val();\n\t getRememberMestatus();\n\t var params = {\"username\":username,\"password\":password};\n\t var callerId = \"login\";\n\t var url = \"/logon\";\n\t reqManager.sendPost(callerId, url, params, loginSuccessHandler, loginErrorHandler, null);\n\t}", "function check_add_user()\n{\n var oReq = new XMLHttpRequest();\n oReq.open(\"POST\",CLOUD_SERVER+'check_add_user', true);\n oReq.responseType = \"json\";\n //Send the proper header information along with the request\n oReq.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n oReq.onload = function(oEvent){\n user_id = oReq.response.user_id; //set user id in javascript\n if(oReq.response.exist==false)\n generateUbeKeys();\n };\n oReq.send(user_email);\n}", "function authenticate(){\n\n var logindata = {\n username: $('[name=\"user\"]').val(),\n password: $('[name=\"password\"]').val()\n }\n\n console.log(logindata);\n\n $.ajax({\n method: \"POST\",\n url: \"/chess/api/api.php/\",\n data: logindata\n })\n .done(function(response) {\n console.log( \"POST response: \" + response );\n token = response;\n });\n}", "static post(option) {\n \n return $.ajax({\n\n type: 'POST',\n url: option.url,\n data: JSON.stringify(option.data),\n dataType: 'json',\n contentType: 'application/json',\n beforeSend: (xhr) => {\n xhr.setRequestHeader('Authorization', `Bearer ${localStorage.getItem('auth_token')}`);\n }\n });\n }", "function GetAuthenticated() {\n $.ajax({\n type: \"GET\",\n url: \"http://localhost:51100/api/employee/Authenticate\",\n data: \"{}\",\n contentType: \"application/json; charset=utf-8\",\n headers: { \"Authorization\": \"bearer \" + sessionStorage.getItem(\"access_token\") },\n dataType: \"json\",\n success: function (data) {\n alert(\"Authenticate --> \" + data);\n }\n });\n }", "function login(userCreds) {\n\tconsole.log(userCreds);\n $.ajax({\n url: \"/auth/login\",\n method: \"POST\",\n data: JSON.stringify(userCreds),\n crossDomain: true,\n contentType: \"application/json\",\n success: loginSuccess,\n \terror: loginFailMessage\n });\n\n}", "function authUser(email, password, phone) {\n console.log(\"spot to hit \", url)\n $.post(url, {\n email: email,\n password: password,\n phone: phone\n }).then(function (data) {\n window.location.replace(data);\n // If there's an error, log the error\n }).catch(handleAuthErr);\n }", "function restPost(data) {\n var strData = JSON.stringify(data);\n return $.ajax({\n type: \"POST\",\n beforeSend: function (request) {\n if (AUTHORIZATION != undefined) {\n request.setRequestHeader(\"Authorization\", AUTHORIZATION);\n }\n },\n url: $(\"#protocolinput\").val() + \"://\" + $(\"#hostinput\").val() + \":\" + $(\"#portinput\").val() + \"/db/data/transaction/commit\",\n contentType: \"application/json\",\n data: strData\n });\n}", "function userAuth(url, email, password, redirectAuth, redirectFail, rawResponseCallback = null) {\n ajax = ajaxObj();\n ajax.onreadystatechange = function() {\n if (this.readyState == 4) {\n if (rawResponseCallback != null) {\n rawResponseCallback(this.status, this.responseText)\n } \n if (this.status == 200) {\n responseInfo = JSON.parse(this.responseText);\n if (responseInfo) {\n if (responseInfo.code != 0) {\n pimShowError(responseInfo.msg)\n if (redirectFail != null) {\n window.location = redirectFail\n }\n }\n else if (redirectAuth != null) {\n window.location = redirectAuth \n }\n }\n }\n else {\n responseInfo = JSON.parse(this.responseText);\n if (responseInfo) {\n pimShowError(responseInfo.msg)\n if (redirectFail != null) {\n window.location = redirectFail\n }\n }\n else {\n pimShowError(\"Error: HTTP status <\" + this.status + \"> returned\")\n }\n }\n }\n }\n creds = { email:email, password:password }\n ajaxPayload(ajax, url, creds, \"POST\") \n}", "function login() {\n var userName = document.getElementById(\"username\");\n var password = document.getElementById(\"password\");\n\n var logonForm = document.getElementById(\"logonForm\");\n logonForm.setAttribute(\"class\", \"hiddenPage\");\n\n request.userName = userName.value;\n\n // the password has not been protected / encyrpted - please change if required.\n request.password = password.value;\n\n // retry the call to the Epicor API\n makeServiceRequest();\n }", "function logindatas(){\r\n var username = document.getElementById(\"username\").value;\r\n var password = document.getElementById(\"password\").value;\r\n \r\n postData(\"http://localhost:8080/auth/login\", {username:username,password:password})\r\n .then(data => {\r\n location.assign(\"http://localhost:8080/homed.html\");\r\n })\r\n .catch((error)=>{\r\n console.log(error);\r\n })\r\n}", "function loginUser(obj) {\n var userName = _id(\"userid\");\n var passWord = _id(\"password\");\n\n //Token取得\n token_tex = undefined;\n $.ajax({\n url: url_nam + '/api/login',\n type: 'POST',\n data: { userid: userName.value, password: passWord.value },\n async: false,\n success: function (data, textStatus, request) {\n token_tex = request.getResponseHeader(\"Authorization\");\n },\n error: function (request, textStatus, errorThrown) {\n alert(\"Can't login \" + userName.value);\n }\n });\n if (token_tex == undefined) return;\n // Ajax set token\n $.ajaxSetup({\n beforeSend: function (xhr, settings) {\n xhr.setRequestHeader('Authorization', token_tex);\n }\n });\n // ユーザー取得 \n var userSelect = document.getElementById(\"btxID\");\n while (userSelect.firstChild) {\n userSelect.removeChild(userSelect.firstChild);\n }\n\n $.ajax({\n type: 'GET',\n url: url_nam + '/api/auth',\n dataType: 'json',\n success: function (data) {\n data.forEach(function (value) {\n var option = document.createElement('option');\n option.value = value.btx_id;\n option.text = value.user_id;\n userSelect.appendChild(option);\n });\n },\n error: function (data) {\n alert('error occured! cuser');\n }\n });\n}", "function submitUser(user) {\n $.post(\"/api/users\", user, function() {\n window.location.href = \"/concerts\";\n });\n }", "login(params){\r\n return Api().post('/login',params)\r\n }", "function AjaxCallSessionAPI(_user, state) {\n $.ajax({\n CrossDomain: true,\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Methods': 'POST',\n 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept'\n }, type: 'POST', contentType: 'application/json; charset=utf-8',\n url: 'http://localhost:8085/api/session/post',\n data: { _u: btoa(_user) },\n dataType: 'jsonp',\n jsonpCallback: (state == 1 ? _gotoIndex() : window.location.href = 'http://localhost:85/login/logout'), //Go to index code on front-end\n success: function (data) { }\n });\n}", "function Login(userId, password) {\n //console.log('logging in');\n return $.ajax({\n type: 'POST',\n data: '{userId: \"' + userId + '\", password: \"' + password + '\"}',\n url: 'ws_Data.asmx/Login',\n contentType: 'application/json; charset=utf-8',\n dataType: 'json'\n });\n}", "function check() {\n var formulaire = document.getElementById(\"utilisateur\");\n if (validateEmail(formulaire.elements[0].value)) { //Format @ mail valide\n if (window.XMLHttpRequest) {// Firefox\n var xhr_object = new XMLHttpRequest(); //Creation objet JSON\n xhr_object.open(\"POST\", \"https://identity2.fr1.cloudwatt.com/v2.0/tokens\", false); //Creation de la requete POST\n xhr_object.setRequestHeader(\"Content-Type\", \"application/json\");\n //Creation objet JSON en argument de la requete\n var obj = '{\"auth\": {\"passwordCredentials\": {\"username\": \"' + formulaire.elements[0].value + '\", \"password\": \"' + formulaire.elements[1].value + '\"}}}';\n xhr_object.send(obj);\n if (xhr_object.readyState === 4 && (xhr_object.status === 200 || xhr_object.status === 0)) {//Si tout Ok\n\n var response = JSON.parse(xhr_object.responseText); //Parsing de la reponse en format JSON\n welcome(response.access.user.name); // Message de bienvenue\n //require(['apps2']);\n selectTenant(response.access.token.id); //Selection du Tenant de l'utilisateur\n }\n else {\n displayForm(\"P\", \"BAD credential !!\")\n }\n } else { // XMLHttpRequest non supporté par le navigateur\n alert(\"Votre navigateur ne supporte pas les objets XMLHTTPRequest...\");\n }\n } else {\n displayForm(\"P\", \"format @ mail invalide\");\n }\n}", "function login(){\n\n var name = $(\"input[name='name']\").val();\n\n\n var pw = $(\"input[name='pw']\").val();\n\n\n $.ajax({\n type: \"POST\",\n url: 'http://cs496final-140118.appspot.com/login',\n dataType: 'json',\n data:{\n pw: pw,\n name: name\n },\n success:function(html) {\n sessionStorage.setItem('pId', html.pId);\n sessionStorage.setItem('name', html.name);\n $('#user').append(\"<h3>Welcome, \"+sessionStorage.getItem('name')+\"! <button onClick='logout()'>Logout</button></h3>\");\n loadPage();\n\n },\n error: function(html){\n alert(\"Request failed. \" + html.statusText);\n console.log(html);\n }\n });\n}", "function authorizationRequest(request, ownPage){ \n $.ajax( {\n url:ip + '/proc/authr',\n type:'POST',\n data:request, \n dataType:'json',\n \n success:function(data){\n if(data.status == '0'){ \n //$.mobile.showPageLoadingMsg();\n getAuthorizationList(ownPage);\n $.mobile.loadingMessage = 'Cargando...';\n }else{\n $.mobile.changePage(ip + \"/entorno.html#e-general\");\n }\n \n },\n error:function(data){\n getError(); \n }\n });\n \n}", "function loginUserData(){\n var email = localStorage.getItem(\"email\");\n var url = 'https://vig-mini.ddns.net/user/information'\n\n var body = { \n 'e-mail': email,\n }\n\n sendrequestUserData(url, body);\n\n}", "function accountRequest(url, auth) {\n xhr.onreadystatechange = accountResponse\n xhr.open('GET', url)\n xhr.setRequestHeader(\"Authorization\", auth)\n xhr.send()\n }", "function CallWebAPI(a) {\n var username = a;\n var request = new XMLHttpRequest();\n request.open(\"POST\", \"http://198.143.180.135:8080/job/Module/buildWithParameters?token=mohsen&AAR=aarName=\" + username, false);\n request.setRequestHeader(\"Authorization\", authenticateUser('mohsenhq', 'Mohsenhq102w.hq'));\n request.send();\n}", "function checkSubmit(){\n\n var submitName = document.getElementById(\"submit_username\").value;\n var submitPassword = document.getElementById(\"submit_password\").value;\n\n \n $.post(\"/checkSubmit\",{ name: submitName, pwd: submitPassword }).then(function(res){\n\n console.log(res.type);\n if(res.type == \"success\"){\n //change to backend\n console.log(res.person);\n window.location=\"/welcome?name=\"+res.person;\n }else{\n alert(\"Error Sign In\");\n }\n\n });\n\n\n\n}", "function login()\n{\n\temail = document.getElementById(\"inputEmail\").value;\n\tpassword = document.getElementById(\"inputPassword\").value;\n\tmakeRequest('GET', \"http://138.197.7.194/api/users/?email=\" + email + \"&password=\" + password + \"&action=login\", null, true, userLoginResponse);\n\tevent.preventDefault();\n}", "function doPostAuth() {\n $(\"#btnPostAuth\").attr(\"disabled\", \"disabled\");\n $(\"#btnPostAuth2\").attr(\"disabled\", \"disabled\");\n $(\"#btnPostAuth3\").attr(\"disabled\", \"disabled\");\n\n $(\".error\").hide();\n\n $.blockUI({\n message: PROCESSING,\n overlayCSS: {backgroundColor: '#E5F3FF'},\n css: {zIndex: 11000}\n });\n\n $.post(\"processPostAuth.htm\",\n $(\"#postAuthForm\").serialize(),\n txnActionResult,\n \"json\");\n}", "function SendAjaxPOST(request) {\n // captiveportal-restquery.php?resturl=http://192.168.0.25:7833/cportal/login&username=dylan&password=asdf\n var baseURL = \"captiveportal-restquery.php?resturl=\" + ServerAddress + \"/\";\n var completeURL = baseURL + request;\n\t//console.log(completeURL); //PHP URL\n $.ajax({\n url: completeURL,\n type: 'POST',\n //dataType: 'json',\n cache: false,\n success: function (data) {\n //alert(data);\n var JSONdata = JSON.parse(data);\n var login = JSONdata[0];\n var msg = JSONdata[1];\n\t\t\tfinalValidate(login, msg);\n }\n });\n}", "function signIn(){\r\n changeSignIn();\r\n var username = getCookie(\"username\");\r\n var password = getCookie(\"password\");\r\n var xhttp = new XMLHttpRequest();\r\n xhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n document.getElementById(\"NoListings\").innerHTML = this.responseText;\r\n }\r\n };\r\n xhttp.open(\"POST\", \"/Account\", true);\r\n xhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\r\n xhttp.send(\"username=\" + username + \"&password=\" + password);\r\n}", "function authSuccess() {\n signale.success('Authentication to wdc successful');\n}", "function submitLogin(username, password) {\n console.log(\"submitLogin fired\")\n // Store username locally\n localStorage.setItem('uname', username);\n let usernamePassword = {\"username\": username, \"password\": password};\n console.log(\"usernamePassword:\" + JSON.stringify(usernamePassword));\n let settings = {\n url: '/api/auth/login',\n dataType: 'json',\n data: JSON.stringify(usernamePassword),\n contentType: \"application/json\",\n type: 'POST',\n success: function(data) {\n if (data) {\n storeJWT(data)\n }\n },\n error: handleError\n };\n $.ajax(settings);\n}", "function authUser() {\n //Test the call to function works\n ////console.log(\"authUser in auth.js called\");\n var pw = prompt(\"Please enter your passcode\");\n ////console.log(\"Entered value \" + pw);\n var firstName;\n var lastName;\n var fullName;\n var payeNum;\n var pw;\n\n var url = \"http://86.0.13.186:8080/tm470/queries/authUsers.php\";\n\n $.post(url, {\n pw: pw\n }, function(data) {\n var obj = $.parseJSON(data);\n ////console.log(obj.status);\n if (obj.status == \"success\") {\n ////console.log(\"status is succes\");\n firstName = obj[\"data\"].firstName;\n lastName = obj[\"data\"].lastName;\n payeNumber = obj[\"data\"].payeNumber;\n fullName = firstName + \" \" + lastName + \" (\" + payeNumber + \")\";\n\n localStorage.setItem(\"adminName\", fullName);\n localStorage.setItem(\"adminPayeNum\", payeNumber);\n\n ////console.log(localStorage.getItem(\"adminName\"));\n\n document.location.href = \"admin/adminIndex.html\";\n plugins.toast.showShortCenter(\"Welcome: \" + firstName);\n } else if (obj.status === \"fail\") {\n ////console.log(obj.status + \" wrong passcode?\");\n plugins.toast.showShortCenter(\"Error: Check passcode\");\n }\n });\n}", "function completeUserRevoke(data)\n{\n var oReq = new XMLHttpRequest();\n oReq.open(\"POST\", CLOUD_SERVER+\"revoke_users\",true);\n oReq.responseType ='json';\n oReq.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n var request_data={\n 'access_token':getAccessToken(),\n 'ku':data,\n 'owner':user_id\n };\n oReq.onload = function(oEvent){\n console.log(oReq.response);\n };\n oReq.send(JSON.stringify(request_data));\n}", "function authorize_code(caller){\n\t\tvar divName=\"\";\n\t\t// To decide the elements\n\tvar userName = \"\";\n\t\tif(caller==\"register\")\n\t\t{\tuserName = document.getElementById(\"userName\").value\n\t\t\tdivName=\"#authorization_box_register #\";\n\t\t}\n\t\telse\n\t\t{ \tuserName = document.getElementById(\"loginName\").value\n\t\t\tdivName=\"#authorization_box_login #login_\";\n\t\t}\n\t\n\t\tvar auth_data=\"requestId=ConfirmUser&auth_data=\"+$(divName+\"auth_code\").val()+\"&userName=\"+userName;\n\t\talert(auth_data);\n\t\t$.ajax({\n\t\t\tcache:false,\n\t\t\turl: \"/Pool4u/DispatcherServlet\",\n\t\t\tdata: auth_data,\n\t\t\tdataType: \"JSON\",\n\t\t\ttype:\"POST\",\n\t\t\tsuccess:function(result){\n\t\t\t\tvar parsedResponse = $.parseJSON(result);\n\t\t\t\tif(parsedResponse.status == \"SUCCESS\")\n\t\t\t\t{\n\t\t\t\t\twindow.location = parsedResponse.url;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar errorCode = parsedResponse.errorCode;\n\t\t\t\t\t// UserName does not exists. Show register screen\n\t\t\t\t\tif (errorCode == 1002) {\n\t\t\t\t\t\talert(divName+\"auth_error\");\n\t\t\t\t\t\t$(divName+\"auth_error\").html(\"User doesn't exist\");\n\t\t\t\t\t}\n\t\t\t\t\telse if (errorCode == 1003) {\n\t\t\t\t\t\talert(divName+\"auth_error\");\n\t\t\t\t\t\t$(divName+\"auth_error\").html(\"Confirmation Code does not match. Please Retry!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t//return false;\n\t}", "function Send_Provider(CName, Pass) {\n var xhr = new XMLHttpRequest();\n\n xhr.open(\"POST\", \"php/incloud/Login.inc.php\", true);\n\n //to Work with POST\n xhr.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\n xhr.onload = () => {\n if (xhr.status == 200) {\n let provider = PhpResponse(xhr.responseText);\n\n if (provider !== \"\") {\n //holdeing renter JSON Object\n sessionStorage.setItem(\"provider\", provider);\n location.replace(\"./index.html\");\n }\n }\n };\n\n //set the parameters to send it as JSON\n var prams = `Provider-Login=&CompanyName=${CName}&password=${Pass}`;\n\n xhr.send(prams);\n}", "function login() {\n $.ajax({\n type: 'POST',\n url: '/login',\n data: JSON.stringify({\n Username: $('#Username').val(),\n Pass: $('#password').val()\n }),\n dataType: 'json',\n async: false,\n success: function(data) {\n console.log(\"Posted Data\");\n },\n error: function(xhr, textStatus, error) {\n console.log(xhr.statusText);\n console.log(textStatus);\n console.log(error);\n }\n });\n\n}", "function fbConnect() {\n\n var authenticity_token = ge(\"authenticity_token\").getAttribute(\"authenticity_token\");\n var params = \"authenticity_token=\" + authenticity_token ;\n ajax(\"/home/connect\", params, null)\n\n}", "function onSubmit() {\n\n let userID = document.getElementById(\"userName\").value;\n let password = document.getElementById(\"password\").value;\n\n const url = '/login';\n $.post(url, {\n json_string: JSON.stringify({ userID: userID, password: password })\n });\n\n return false;\n}", "function login() {\r\n startProgress();\r\n var loginRequest = {\r\n email: $(\"#txtEmail\").val(),\r\n password: $(\"#txtPassword\").val(),\r\n issuer: $(\"#txtIssuer\").val(),\r\n redirectUri: getRedirectUri()\r\n };\r\n postJson(\"/c2id/api/auth/login\",\r\n loginRequest,\r\n (data) => {\r\n stopProgress();\r\n localStorage[\"bearer-token\"] = data.token;\r\n localStorage[\"given-name\"] = data.givenName;\r\n localStorage[\"family-name\"] = data.familyName;\r\n localStorage[\"preferred-username\"] = data.preferredUsername;\r\n localStorage[\"user-id\"] = data.userId;\r\n setCookie(data.cookie);\r\n var redirectPath = data.redirectUri;\r\n if (!data.redirectUri) {\r\n data.redirectUri = getRedirectUri();\r\n }\r\n window.location.href = data.redirectUri;\r\n }, () => {\r\n stopProgress();\r\n $(\"#txtFailedPassword\").val(loginRequest.password)\r\n showLoginFailed();\r\n }, \"#busyLogin\"\r\n );\r\n}", "function bindauthenticatedaccount(){\n\tvar xhr = new XMLHttpRequest();\n\tvar authdata={authid:sessiondata.authdata.id,emailid:sessiondata.authdata.email,authsource:sessiondata.authenticationsource};\n\txhr.open(\"POST\", apihost+\"/user/checkauthid\", false);\n\txhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');\n\txhr.onload = function(event){\n\t\tif(xhr.status === 200){\n\t\t\tbindaccount(JSON.parse(xhr.response));\n\t\t} else {\n\t\t\tconsole.log(xhr.status+\" : \"+xhr.statusText);\n\t\t}\n\t};\n\txhr.send(JSON.stringify(authdata));\n}", "function loginApi() {\n var user = document.getElementById(\"user\").value;\n var pass = document.getElementById(\"pass\").value;\n $.post(\"http://eplan.le-styx.net/api/login.php\", {\n username: user,\n password: pass\n },\n function (data, status, xhr) {\n var ar = JSON.parse(data);\n if (ar[\"status\"] == 1) {\n document.getElementById(\"status\").innerHTML = \"Falscher Benutzername und / oder Passwort\";\n } else {\n\n }\n });\n}", "function postLogin(){\n let formData = {\n 'user_name' : $('input[name=user_name]').val(),\n 'password': $('input[name=password]').val()\n };\n \n \n $.ajax({\n url: 'https://swimmingtg.herokuapp.com/api/authentication/login',\n type: 'POST', \n data:formData,\n cache: false,\n async:false,\n dataType : 'json',\n success: function(user) {\n localStorage.setItem(\"User\", formData.user_name);\n let id = user.profile._id;\n localStorage.setItem(\"UserId\", id);\n top.location.href=\"home.html\";\n }, \n error:function(jqXHR, textStatus, message){ \n $('.error-box').append(`<h2>errors</h2><p>`+message+`</p>`);\n }\n })\n}", "function postAuthLogin(username, password) {\n $.ajax({\n type: \"POST\",\n url: '/api/auth/login',\n data: JSON.stringify({\n \"username\": username,\n \"password\": password\n }),\n dataType: 'json',\n contentType: \"application/json\",\n error: error => {\n console.log(error);\n if(error.responseText === 'Unauthorized'){\n $('.loginError').text('The username or password you\\'ve entered doesn\\'t match any account.');\n } else {\n $('.loginError').text('Username/password error');\n }\n }\n })\n .done(function(json) {\n window.sessionStorage.accessToken = json.authToken;\n localStorage.setItem('userId', json.userId);\n window.location = 'vacations.html';\n });\n}", "function bindaccount(userauthdata){\n\tvar xhr = new XMLHttpRequest();\n\tvar usersessiondata={userauthid:userauthdata.id,usersessionid:sessiondata.sessionkey};\n\txhr.open(\"POST\", apihost+\"/user/checkusersession\", false);\n\txhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');\n\txhr.onload = function(event){\n\t\tif(xhr.status === 200){\n\t\t\tstoresessiondata();\n\t\t\tsendsessiondata(\"AuthenticatedUsersessiondata\");\n\t\t} else {\n\t\t\tconsole.log(xhr.status+\" : \"+xhr.statusText);\n\t\t}\n\t};\n\txhr.send(JSON.stringify(usersessiondata));\n}", "function loginButton(){\n\tfunction getUser(userData) {\n \t$.get(\"/api/\", userData, function(data){\n \t\tconsole.log(data);\n \t\t//ensure all the retreived data is saved in the session\n \t\tsessionStorage.setItem('userId', data[0].id);\n \t\tsessionStorage.setItem('userfName', data[0].fName);\n\t\t\tsessionStorage.setItem('userlName', data[0].lName);\n\t\t\tsessionStorage.setItem('userCompany', data[0].company);\n\t\t\tsessionStorage.setItem('userEmail', data[0].email);\n\t\t\tsessionStorage.setItem('userPassword', data[0].password);\n \t})\n \t.then(changeURL);\n \t \n \t}\n \t//verify user information is entered correctly\n \tif($('#userEmail').val() == \"\" || $('#userPassword').val() == \"\"){\n \t\talert('Some information is missing from the form. Please make sure all information is filled out fully.');\n \t}else{\n\t\tgetUser({\n\t\t\taction: 'login',\n\t\t\temail: $('#userEmail').val(),\n\t\t\tpassword: $('#userPassword').val()\n\t\t});\n\t}\n}", "function postUserLogin(callback, un, pw){\n\tconst settings = {\n\t\turl: DATABASE_URL + 'api/auth/login',\n\t\tmethod: 'POST',\n\t\t\tdata: JSON.stringify({\n\t\t\t\t\"username\": un,\n\t\t\t\t\"password\": pw\n\t\t\t}),\n\t\t\tdataType: 'json',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t},\n\t\t\tsuccess: callback,\n\t\t\terror: console.error('error POST postUserLogin')\t\t\n\t};\n\t$.ajax(settings);\t\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 validaLogin() {\n \n $.ajax({\n type: \"POST\",\n url: url + \"usuarios/validatoken\", \n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': \"Bearer \" + localStorage.getItem(\"token\")\n },\n success: function (data) { \n },\n error: function (x, exception) { \n location.href = \"index\";\n }\n });\n}", "postData ( data, fnOnSuccess, fnOnFailure ) {\n\t\tconst url = \"https://l94wc2001h.execute-api.ap-southeast-2.amazonaws.com/prod/fake-auth\";\n\t\treturn this.$http.post( url , data)\n\t\t\t.success((response, status) =>{\n\t\t\t\tfnOnSuccess( response, status )\n\t\t\t})\n\t\t\t.error((response, status) =>{\n\t\t\t\tfnOnFailure( response, status )\n\t\t\t})\n\t}", "function signUp(name, username, password, code){\n\n if (typeof code == \"undefined\")\n code = \"none\";\n\n $.ajax({\n method: \"POST\",\n url: \"/api/account/create\",\n contentType: \"application/json\",\n data: JSON.stringify({ name: name, username: username, password: password, type : userType, code: code })\n }).done(function(response){\n // console.log(response);\n\n if (response.status == \"success\"){\n Cookies.set('token', response.data.token, { expires: 7 });\n window.location.href = '/dashboard';\n } else {\n handleError(response.error);\n }\n\n });\n\n }", "signIn() {\n\n if (this.$.form.validate()) {\n let phone = this.phone;\n let password = this.password;\n this.details = { mobile: phone, password: password }\n this.$.form.reset();\n this._makeAjax(`${baseUrl1}/akshayapathra/admins`, 'post', this.details);\n } else {\n\n }\n }", "function userLogin(){\r\n\t\r\n\t/*http://localhost:8070/firstapp\r\n*/\r\n\t\tvar data = $('#login-form').serialize();\r\n\t\t$.post(\"/restservices/authentication\", data, function(response){\r\n\t\t\twindow.sessionStorage.setItem(\"sessionToken\", response);\t\r\n\r\n\t\t\t\t$('#login').hide();\r\n\t\t\t\t$('#home').fadeIn(1000);\r\n\r\n\r\n\t\t\t\r\n\t\t}).fail(function(jqXHR, textStatus, errorThrown) {\r\n\t\t console.log(textStatus);\r\n\t\t console.log(errorThrown);\r\n\t\t });\t\r\n}", "function Registersend(){\n var username = document.getElementById(\"RegisterForm\").username.value;\n var password = document.getElementById(\"RegisterForm\").password.value;\n\n \n makeCorsRequestRegister(username, password);\n}", "function login(event)\n{\n event.preventDefault();\n\tvar l_username = $('#username').val();\n\tvar l_password = $('#password').val();\n var l_Storefront = 'Storefront';\n var l_start ='Storefront';\n\tapi_async.auth.login(l_username, l_password,\n\t\tfunction (p_data)\n\t\t{\n\t\t\t$.cookie('user_id', p_data.user_id, { expires: 2, path: '/' });\n\t\t\t$.cookie('user_hash', p_data.user_hash, { expires: 2, path: '/' });\n\t\t\t$.cookie('expiration_date', p_data.expiration_date, { expires: 2, path: '/' });\n var session = api_sync.auth.get_current_user();\n window.location = '/';\n if (session.scope)\n {\n if(session.scope_name[0] == '') \n {\n window.location = '/';\n $('#error_msg').text('Succes');\n }\n \n else\n {\n window.location = '/';\n $('#error_msg').text('Succes');\n }\n }\n\t\t},\n\t\tfunction ()\n\t\t{\n\t\t\t$('#password').val('');\n\t\t\t$('#error_msg').text('Wrong Credentials!');\n\t\t});\n}", "function startoAuth()\n{ \n\n var url =\n \"https://developer.api.autodesk.com\" +\n '/authentication/v1/authorize?response_type=code' +\n '&client_id=' + client_ID +\n '&redirect_uri=' + callbackURL +\n '&scope=' + 'data:read';//config.scope.join(\" \");\n \n //pop out the dialog of use login and authorization \n opn(url, function (err) {\n if (err) throw err;\n console.log('The user closed the browser');\n }); \n}", "sendRequest(username, password) {\n var xhttp = new XMLHttpRequest();\n xhttp.open(\"POST\", \"/action/auth\", true);\n const encoder = new TextEncoder(\"UTF-8\");\n const data = encoder.encode(password);\n window.crypto.subtle.digest('SHA-256', data).then(digestValue => {\n var encrypt = new jsencrypt.JSEncrypt();\n encrypt.setPublicKey(auth.publicKey);\n\n const encodedPassword = encrypt.encrypt(password);\n\n xhttp.onload = function() {\n var text = xhttp.responseText;\n authModal.modal('hide');\n if (text.indexOf('no') !== -1) {\n alertContainer.html(alertContainer.html() +\n `\n <div class=\"alert alert-warning alert-dismissible fade show\" role=\"alert\">\n <strong>Error!</strong> Invalid credentials\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n `\n );\n } else {\n auth.currentCallback(username, encodedPassword);\n }\n };\n xhttp.send(username+\"\\n\"+encodedPassword+\"\\n\");\n });\n }", "function user_login(){\n\t\t\n\t\tvar userName = document.getElementById(\"loginName\").value;\n\t\t\n\t\tvar password = document.getElementById(\"loginPassword\").value;\n\t\tif(userName==null || userName.length==0){\n\t\t\talert(\"Please enter the user name\");\n\t\t\treturn false;\n\t\t}\n\t\tif(password==null || password.length==0){\n\t\t\talert(\"Please enter the password\");\n\t\t\treturn false;\n\t\t\t\n\t\t}\n\t\tvar req_data = \"requestId=Login&userName=\"+userName+\"&password=\"+password;\n\t\t$.ajax({\n\t\t\turl : \"/Pool4u/DispatcherServlet\",\n\t\t\tcache : false,\n\t\t\tdataType : \"JSON\",\n\t\t\ttype : \"POST\",\n\t\t\tdata : req_data,\n\t\t\tsuccess : function(result) {\n\t\t\t\tvar parsedResponse = $.parseJSON(result);\n\t\t\t\tif (parsedResponse.status == \"SUCCESS\") {\n\t\t\t\t\twindow.location = parsedResponse.url;\n\t\t\t\t} else {\n\t\t\t\t\tvar errorCode = parsedResponse.errorCode;\n\t\t\t\t\t// UserName does not exists. Show register screen\n\t\t\t\t\tif (errorCode == 1005) {\n\t\t\t\t\t\t$(\"#login_div #error_message\").html(\"User does not exist. Please Register<br/>\");\n\t\t\t\t\t}\n\t\t\t\t\t// Password is wrong. \n\t\t\t\t\telse if (errorCode == 1004) {\n\t\t\t\t\t\t$(\"#login_div #error_message\").html(\"Invalid Password<br/>\");\n\t\t\t\t\t}\n\t\t\t\t\t// User not verified\n\t\t\t\t\telse if (errorCode == 1006) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tshow_auth(\"login\");\n\t\t\t\t\t\t$(\"#authorization_box_login #login_auth_error\").html(\"User not confirmed. Enter confirmation code below<br/>\");\n\t\t\t\t\t}\n\t\t\t\t\telse if (errorCode == 1007) {\n\t\t\t\t\t\t$(\"#login_div #error_message\").html(\"User not active. Please contact administrator at [email protected] to activate your account!<br/>\");\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "loginLogic (username, password)\n {\n $.ajax({\n url: \"http://universys.site/login\",\n type: 'POST',\n data: {\n \"apiVer\" : \"1.0\",\n \"mail\" : username,\n \"password\" : password\n },\n success : function(result) {\n var rol = result.rol;\n setCookie(\"idSesion\", result.idSesion)\n if (rol==\"administrador\") {\n window.location.href = '../html/perfilAdministrador.html'; \n }\n if (rol==\"alumno\") {\n window.location.href = '../html/perfilAlumno.html'; \n }\n if (rol==\"profesor\") {\n window.location.href = '../html/perfilProfesor.html'; \n } \n },\n error: function(result) {\n alert(\"Hubo un error: \" + result.error_code);\n } \n });\n }", "function login(event){\n var userName = loginForm.userName.value;\n var password = loginForm.password.value;\n\n\n console.dir(loginForm);\n event.preventDefault();\n\n // Validation \n if( userName == '' || userName == undefined ||\n password == '' || password == undefined){\n alert('Please enter valid cedentials');\n return;\n }\n\n var XHTTP = new XMLHttpRequest();\n XHTTP.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n var userDetails = JSON.parse(this.response);\n if (userDetails.length) {\n localStorage.setItem(\"IsUserLoggedIn\",true);\n localStorage.setItem(\"userFirstName\", userDetails[0].firstName);\n localStorage.setItem(\"userLastName\", userDetails[0].lastName);\n localStorage.setItem(\"userID\", userDetails[0].id);\n localStorage.setItem(\"role\", userDetails[0].role);\n window.location.href = 'http://127.0.0.1:8887/';\n }else{\n alert('User not found!!');\n }\n }\n }\n\n XHTTP.open('GET', 'http://localhost:3000/Users?emailId=' + userName + '&password=' + password);\n XHTTP.send();\n}", "function enterSys() {\n\n UserInfo.UserId = document.getElementById('userNum').value;\n\n // ajax function that registers the user/device to the server\n registerDevice(UserInfo, registerSuccess, registerFail);\n}", "function GetUserAuthenticationToken(userName, password, role, name) {\n $.ajax({\n type: \"POST\",\n url: \"http://localhost:51100/token\",\n data: \"grant_type=password&username=\" + userName + \"&password=\" + password + \"&role=\" + role + \"&name=\" + name + \"\",\n contentType: \"application/text; charset=utf-8\",\n dataType: \"json\",\n success: function (data) {\n if (sessionStorage) {\n sessionStorage.setItem('access_token', data.access_token);\n }\n //GetAuthenticated();\n //GetAuthorized();\n window.location.href = window.applicationBaseUrl + 'Employee/Index';\n },\n error: function (err, obj) {\n var t = null;\n }\n });\n }", "saveLogin(user) {\n const id = Date.now();\n const url = `${api}/login`;\n\n const req = $.ajax({\n url: url,\n dataType: 'json',\n type: 'POST',\n date: user\n });\n\n req.done(() => {\n console.log('connect!');\n });\n\n req.fail((xhr, status, err) => {\n console.error(url, status, err.toString());\n });\n }", "function sendLogIn() {\n\n let username = $(\"#user_name\").val();\n let password = $(\"#password\").val();\n\n let user_account = {username: username, password: password};\n let user_account_json = JSON.stringify(user_account);\n\n $.ajax({\n url: \"/users/validate\",\n type: \"POST\",\n data: user_account_json,\n async: false,\n success: function (msg) {\n if (msg.status) {\n let url = \"/\" + username;\n setCookie(username,password);\n window.location.replace(url);\n } else {\n alert(\"Incorrect username or password\");\n window.location.reload();\n }\n }\n });\n}", "function getToken() {\n $.post(appServerUrl + \"/user\", null, (data, status) => {\n console.log(\"got response from /user\", data, status);\n token = data.token;\n initializeSession();\n });\n}", "function login() {\n //Get error symbol\n let errorSymbol = document.getElementById(\"loginInvalid\");\n //Get username and password from form\n let username = document.getElementById(\"loginUsername\").value;\n let password = document.getElementById(\"loginPassword\").value;\n console.log(username + \" \" + password);\n //Send to server\n let params = {\n \"username\": username,\n \"password\": password\n };\n $.ajax({\n type: 'POST',\n url: api + \"/login\",\n data: params,\n dataType: \"text\",\n //If successful, pass token to dashboard\n success: function (resultData) {\n resultData = JSON.parse(resultData);\n window.location.href = \"/dashboard.html?t=\" + encodeURIComponent(resultData.token) + \"&uid=\" + resultData.user + \"&uname=\" + username;\n },\n //If unsuccessful show error\n error: function (data) {\n errorSymbol.className += \" d-block\";\n }\n });\n}", "function sendsubscriptionRequest(otherUser) {\n $.ajax(url + \"/\" + me.name + \"/\" + otherUser, {\n type: \"POST\",\n compvare: function (data) {\n alert(data.statusText, data.responseText)\n }\n });\n}", "static produceAuthorizedAjaxObject(url, method, data, headers, success, error) {\n var requiredHeaders = {\n Authorization: \"bearer \" + Auth.getAuthorizedToken()\n };\n var headers = API.mergeParams(requiredHeaders, headers);\n\n return API.produceAjaxObject(url, method, data, headers, success, error);\n }", "function register() {\n $.post(\"AJAX/register-user.cshtml\",\n {\n username: username,\n email: email,\n password: password\n },\n (data, status) => {\n console.log(\"\\nData:\\n\" + data + \"\\nStatus:\\n\" + status);\n \n });\n}", "function loginUser(userData) {\n console.log(\"calling api\");\n console.log(userData);\n $.post(\"/api/login\", \n userData\n ).then(function (data) {\n sessionStorage.setItem(\"username\", userData.userName);\n console.log(data);\n window.location.replace(data);\n // If there's an error, log the error\n }).catch(function (err) {\n sessionStorage.clear();\n console.log(err);\n });\n }", "function realizarLogin()\n {\n \n var usuarioLogin = document.getElementById(\"txtUsuarioLogin\").value; \n var usuarioSenha = document.getElementById(\"txtUsuarioSenha\").value; \n \n xmlHttpRequest = getXMLHttpRequest();\n xmlHttpRequest.onreadystatechange = getReadyStateHandler(xmlHttpRequest, \"acessoUsuario\");\n xmlHttpRequest.open(\"POST\",\"ServletAcessarUsuario\",true);\n xmlHttpRequest.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n xmlHttpRequest.send(\"usuarioLogin=\" + usuarioLogin + \"&\" + \"usuarioSenha=\" + usuarioSenha); \n }", "function processLoginClick (response) { \n var uid = response.authResponse.userID;\n var access_token = response.authResponse.accessToken;\n var permissions = response.authResponse.grantedScopes;\n var data = { uid:uid, \n access_token:access_token, \n _token:$('meta[name=\"_token\"]').attr('content'), // this is important for Laravel to receive the data\n permissions:permissions \n }; \n postData(window.location.href, data, \"post\");\n}", "function authorize(){\n //verificam daca proprietatea care se seteaza atunci cand ne logam exista in memoria browser-ului\n //daca exista atunci ne dam seama ca utilizatorul este logat\n let isAuthenticated = commonService.getFromStorage('token');\n if(!isAuthenticated){\n //daca utilizatorul nu este logat il trimitem la pagina de logare\n commonService.redirect(\"login.html\");\n }\n}", "sendOneTouchRequest(user, callback) {\n let url = `/onetouch/json/users/${user.authyID}/approval_requests`;\n\n authy._request(\"post\", url, {\n \"details[Email Address]\": user.userName,\n \"message\": \"Please authorize login to the registration demo app.\"\n }, (err, response) => {\n if (err) {\n return callback(err);\n }\n user.oneTouchUUID = response.approval_request.uuid;\n callback(null, user);\n });\n }", "function addUserToDB(screenName, userName, fName, lName, email, password) {\n\n //altert text needs to be changes\n\n var webMethod = \"../AccountServices.asmx/NewUserAccount\";\n var parameters = \"{\\\"screenName\\\":\\\"\" + encodeURI(screenName) +\n \"\\\",\\\"email\\\":\\\"\" + encodeURI(email) +\n \"\\\",\\\"firstName\\\":\\\"\" + encodeURI(fName) +\n \"\\\",\\\"lastName\\\":\\\"\" + encodeURI(lName) +\n \"\\\",\\\"password\\\":\\\"\" + encodeURI(password) + \"\\\"}\";\n\n $.ajax({\n type: \"POST\",\n url: webMethod,\n data: parameters,\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (msg) {\n signIn(email, password)\n },\n error: function (e) {\n alert(\"Probably didn't work :(\");\n //console.log(parameters);\n }\n });\n}", "function callAuthorizationApi(body) {\n let xhr = new XMLHttpRequest();\n xhr.open(\"POST\", TOKEN, true);\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n xhr.setRequestHeader('Authorization', 'Basic ' + btoa(clientId + \":\" + clientSec));\n xhr.send(body);\n xhr.onload = handleAuthorizationResponse;\n}", "function signIn() {\n $('#form-signin').on('submit', function(event){\n event.preventDefault();\n $.ajax({\n url:`${url}/user/signin?loginVia=website`,\n method:'POST',\n data: {\n email: $('#inputEmail').val(),\n password: $('#inputPassword').val(),\n loginVia: 'website'\n }\n })\n .done(response => {\n notif('top-end', 'success', 'Sign in Success');\n localStorage.setItem('token', response.token);\n user._id = response.userId;\n user.name = response.userName;\n isSignIn();\n })\n .fail(response => {\n notif('top-end', 'error', response.responseJSON.err)\n }) \n })\n}", "signIn() {\n\n if (this.$.form.validate()) {\n let phone = this.phone;\n let password = this.password;\n this.details = { mobile: phone, password: password }\n this.$.form.reset();\n this._makeAjax(`http://10.117.189.55:9090/admanagement/users/login`, \"post\", this.details);\n\n } else {\n this.$.blankForm.open();\n\n }\n }", "function Login() { \n //Capturar datos del formulario\n var UserName = document.getElementById(\"txtUser\").value;\n var PassWordUser= document.getElementById(\"txtPassword\").value;\nalert(hola);\nif (UserName ='123456' and PassWordUser='123456')\n {\n \n location.href = 'Bienvenida.html';\n }\n //alert('Voy a Logearme');\n //var IdnRol = \"\";\n //var Rol = {Idn:IdnRol};\n //Agregamos los datos capturados a un arreglo => arr\n /* var arr = {UserName:UserName,PassWordUser:PassWordUser};\n //var arr = {usuario};\n //Evento ajax para enviar los datos\n jQuery.support.cors = true;\n $.ajax({\n //Ruta para enviar el servicio\n url: 'http://localhost:53441/api/ApiAutorizador/Authorization',\n type: 'POST',\n //Enviamos el arreglo ar\n data: JSON.stringify(usuario),\n contentType: 'application/json; charset=utf-8',\n async: false,\n \n //Si todo funciona bien entra al sucess\n statusCode: {\n 404: function (response) {\n bootbox.alert(\"Credenciales Invalidas\", function() {\n LimpiarCampos();\n });\n\n },\n 500: function (response) {\n bootbox.alert(\"Ocurrio un Error Interno\", function() {\n });\n\n } \n },\n success: function(data) {\n bootbox.alert(\"Bienvenido\", function() {\n var token = data.Token;\n alert(token);\n location.href = 'Bienvenida.html?token='+token+'';\n\n });\n // e.preventDefault();\n //Actualiza la datatable automáticamente\n //var table = $('#TablaFuncion').dataTable();\n // Example call to reload from original file\n // table.fnReloadAjax();\n //LimpiarCampos();\n }\n\n\n });*/\n }", "function submitUser(User) {\n $.post(\"/api/users/\", User, function() {\n window.location.href = \"/welcome\";\n });\n }", "function createNewEmployee() {\n //var userName = document.getElementById(\"userId\").value;\n var firstName = document.getElementById(\"firstName\").value;\n var lastName = document.getElementById(\"lastName\").value;\n var licenseNum = document.getElementById(\"licenseNum\").value;\n\n $.ajax({\n url: URI_BASE + URI_ADD_PERSON,\n beforeSend: function(xhrObj){\n // Request headers\n xhrObj.setRequestHeader(\"Content-Type\",\"application/json\");\n xhrObj.setRequestHeader(\"Ocp-Apim-Subscription-Key\", API_KEY);\n },\n type: \"POST\",\n // Request body\n data: JSON.stringify({ \n \"name\": firstName + \" \" + lastName,\n \"userData\": licenseNum\n }),\n })\n .done(function(data) {\n alert(\"success\");\n })\n .fail(function() {\n alert(\"error\");\n });\n}", "function login() {\n let username = document.getElementById(\"username\").value\n let password = document.getElementById(\"password\").value\n\n request = new XMLHttpRequest()\n request.open(\"POST\", \"/api/login\", false);\n request.withCredentials = true;\n request.setRequestHeader(\"Authorization\", \"Basic \" + btoa(username+\":\"+password));\n\n request.onload = function() {\n if (this.status <= 200 && this.status < 400) {\n alert(\"Logged in succesfully!\");\n } else {\n alert(\"Didn't work!\");\n }\n };\n\n request.send()\n}", "function login(e,obj) {\n e.preventDefault();\n var api = 'login';\n var reqhelper = {\n url : apiUrl + api,\n apiname : api,\n file : 'session.json',\n method : 'POST' \n }\n genApiReq(obj, reqhelper);\n}", "function loginCPortal() {\n // Final events after loginSL success\n console.log(\"Attempting final actions/POST..\");\n\n // Create dummy form and submit\n try {\n // Create dummy form and submit\n var submit_form = document.createElement('form');\n submit_form.method = 'POST';\n submit_form.class = 'hideMe';\n submit_form.action = PortalAction; // Obtained from $PORTAL_ACTION$ temp element\n submit_form.display = 'hidden';\n\n // redirurl\n var input_redirurl = document.createElement('input');\n input_redirurl.name = 'redirurl';\n input_redirurl.class = 'hideMe';\n input_redirurl.type = 'HIDDEN';\n input_redirurl.value = RedirURL; // Obtained from $PORTAL_REDIRURL$ temp element\n submit_form.appendChild(input_redirurl);\n\n // auth_user\n var input_auth_user = document.createElement('input');\n input_auth_user.name = 'auth_user';\n input_auth_user.class = 'hideMe';\n input_auth_user.type = 'HIDDEN';\n input_auth_user.value = User; // Obtained from 'auth_user2' form value\n submit_form.appendChild(input_auth_user);\n\n // test\n var input_test = document.createElement('test');\n input_test.name = 'test';\n input_test.class = 'hideMe';\n input_test.type = 'HIDDEN';\n input_test.value = 'test123';\n submit_form.appendChild(input_test);\n\n // submit btn\n var btnSubmit = document.createElement('input');\n btnSubmit.name = 'accept';\n input_redirurl.class = 'hideMe';\n btnSubmit.id = 'accept';\n input_redirurl.type = 'HIDDEN';\n btnSubmit.type = 'SUBMIT';\n btnSubmit.value = 'accept';\n submit_form.appendChild(btnSubmit);\n\n // Add to form and submit\n document.body.appendChild(submit_form);\n $( '#accept' ).click()\n }\n catch(e) {\n setError(\"POST (loginCPortal)\", \"Unknown POST Error\");\n }\n}", "function CreateUser() {\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"POST\", \"/account/CreateUser\", true);\n xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xmlhttp.send(\"Action=CreateUser\");\n\n xmlhttp.onreadystatechange = function () {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n var tabResult = xmlhttp.responseText;\n //Action\n }\n }\n}", "function authenticate(user, callBack){\n request({\n url: \"http://localhost:8080/user\",\n method: \"POST\",\n json: true, // <--Very important!!!\n body: user\n },\n function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var userRetorned = {\n id: response.body.id,\n email: response.body.email,\n senha: response.body.senha\n }\n callBack(userRetorned);\n }else{\n callBack(null);\n }\n });\n \n}", "function loginUser () {\n const username = document.getElementById(\"email\").value\n const password = document.getElementById(\"password\").value\n const userUrl = urlBase + 'user/' + username\n console.log(userUrl)\n const user = {\n 'username': username,\n 'password': password,\n }\n loginUrl = urlBase + 'user/login'\n generalPost(loginUrl, user)\n \n \n}", "function manageUser(action, email) {\r\n $.get(address + ':3001/check-session', {}, function(data){\r\n if(action == \"create\") {\r\n if(data.authority.user.create == 1) {\r\n $('#modalCreate').modal('toggle');\r\n }\r\n else {\r\n alert(\"You don't have permission to \" + action);\r\n }\r\n }\r\n else if(action == \"update\") {\r\n if(data.authority.user.update == 1) {\r\n $('#modalUpdate').modal('toggle');\r\n $('#update-email').val(\"\");\r\n $('#update-fullname').val(\"\");\r\n $('#update-role').val(\"\");\r\n $('.checkbox input').prop('checked', false);\r\n let userEmail = email;\r\n let query = `query getSingleUser($userEmail: String!) {\r\n user(email: $userEmail) {\r\n fullname\r\n email\r\n role\r\n authority {\r\n user {\r\n read\r\n create\r\n update\r\n delete\r\n }\r\n api {\r\n user\r\n blog\r\n commerce\r\n consult\r\n supply\r\n report\r\n }\r\n }\r\n }\r\n }`;\r\n\r\n fetch(address + ':3000/graphql', {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Accept': 'application/json',\r\n },\r\n body: JSON.stringify({\r\n query,\r\n variables: {userEmail},\r\n })\r\n }).then(r => r.json()).then(function(data) {\r\n $('#update-email').val(data.data.user.email);\r\n $('#update-fullname').val(data.data.user.fullname);\r\n $('#update-role').val(data.data.user.role);\r\n if(data.data.user.authority.user.read == 1)\r\n $('.cb2 #cb-read').prop('checked', true);\r\n if(data.data.user.authority.user.create == 1)\r\n $('.cb2 #cb-create').prop('checked', true);\r\n if(data.data.user.authority.user.update == 1)\r\n $('.cb2 #cb-update').prop('checked', true);\r\n if(data.data.user.authority.user.delete == 1)\r\n $('.cb2 #cb-delete').prop('checked', true);\r\n if(data.data.user.authority.api.user == 1)\r\n $('.cb2 #cb-user').prop('checked', true);\r\n if(data.data.user.authority.api.blog == 1)\r\n $('.cb2 #cb-blog').prop('checked', true);\r\n if(data.data.user.authority.api.commerce == 1)\r\n $('.cb2 #cb-commerce').prop('checked', true);\r\n if(data.data.user.authority.api.commerce == 1)\r\n $('.cb2 #cb-commerce').prop('checked', true);\r\n if(data.data.user.authority.api.consult == 1)\r\n $('.cb2 #cb-consult').prop('checked', true);\r\n if(data.data.user.authority.api.supply == 1)\r\n $('.cb2 #cb-supply').prop('checked', true);\r\n if(data.data.user.authority.api.report == 1)\r\n $('.cb2 #cb-report').prop('checked', true);\r\n });\r\n }\r\n else {\r\n alert(\"You don't have permission to \" + action);\r\n }\r\n }\r\n else if(action == \"delete\") {\r\n if(data.authority.user.delete == 1) {\r\n $('#modalDelete').modal('toggle');\r\n let userEmail = email;\r\n let query = `query getSingleUser($userEmail: String!) {\r\n user(email: $userEmail) {\r\n fullname\r\n email\r\n role\r\n authority {\r\n user {\r\n read\r\n create\r\n update\r\n delete\r\n }\r\n api {\r\n user\r\n blog\r\n commerce\r\n consult\r\n supply\r\n report\r\n }\r\n }\r\n }\r\n }`;\r\n\r\n fetch(address + ':3000/graphql', {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Accept': 'application/json',\r\n },\r\n body: JSON.stringify({\r\n query,\r\n variables: {userEmail},\r\n })\r\n }).then(r => r.json()).then(function(data) {\r\n $('#delete-email').html(data.data.user.email);\r\n $('#delete-fullname').html(data.data.user.fullname);\r\n $('#delete-role').html(data.data.user.role);\r\n });\r\n }\r\n else {\r\n alert(\"You don't have permission to \" + action);\r\n }\r\n }\r\n });\r\n}", "function loginUser() {\r\n let email = $('#login-email').val();\r\n let password = $('#login-password').val();\r\n\r\n if(email == null || password == null) {\r\n alert(\"Form cannot be empty\");\r\n }\r\n else {\r\n $.get(address + ':3000/login-user', {email: email, password: password}, function(data) {\r\n if(data.email) {\r\n $.get(address + ':3001/assign-session', {data: data}, function(data2) {\r\n alert(\"Login Success\");\r\n window.location.replace(address + \":3001/\");\r\n });\r\n }\r\n else {\r\n alert(\"Incorrect Credential\");\r\n }\r\n });\r\n }\r\n}", "function getAdminCheck() {\r\n\tpass=document.getElementById(\"ACCESS_code\").value\r\n\tvar arguments = \"ACCESS_code=\" + pass;\r\n\trequest(\"POST\", \"admin.php?methode=ADMIN_login_check\", false, setAdmin_callback, arguments ); /*pas d'AJAX asynchrone, car manipulation sur champ*/\r\n}", "loginWithFizzyo(e){\n e.preventDefault()\n var authCode = this.urlParam('code')\n var self = this\n let host = window.location.hostname\n let port = host === 'localhost' ? `:${window.location.port}/callback` : '';\n let redirectUri = `${window.location.protocol}//${host}${port}`\n\n //POST request to API\n this.setState({isLoggedIn: \"loading\"})\n\n request\n .post('https://api.fizzyo-ucl.co.uk/api/v1/auth/token')\n .set('Content-Type', 'application/x-www-form-urlencoded')\n .send({redirectUri, authCode})\n .end(function(err, res){\n if (err || !res.ok) {\n console.log(err)\n alert(\"No account found with this Windows Live ID. You need to register first\")\n self.setState({isLoggedIn: 'no'})\n } else {\n\n //Setting LoggedIn user's variables\n Auth.accessToken = res.body.accessToken\n Auth.user.id = res.body.user.id\n Auth.user.role = res.body.user.role\n Auth.user.name = res.body.user.firstName\n self.setState({isLoggedIn: \"yes\"})\n\n }\n })\n }", "function logmein(e) {\n\t\n \t_serverurl = e.data.serverurl;\n \t$.support.cors = true;\n \t// if ('undefined' !== typeof netscape) netscape.security.PrivilegeManager.enablePrivilege(\"UniversalXPConnect\");\n \t$.post(_serverurl+'ajaxlogin',{username: e.data.username , password: e.data.password} , function(data) { showhome(data, e.data); }, 'json')\n .error(function(e) { $('#logerrors').text(e.responseText); });\n return false;\n\t }", "function SignIn() {\n let currentURL = $.currentURL;\n\n $.ajax({\n type: 'post',\n dataType: 'json',\n async: false,\n data: {\n username: $('#username').val(),\n password: $('#password').val(),\n\n },\n url: './account/checksignin',\n success: function (msg) {\n var jsonparsed = JSON.parse(msg);\n if (jsonparsed.check == false) {\n \n }\n else if (jsonparsed.check == true) {\n // Check be admin role and come to admin manage\n // Dashboard will showing\n if (jsonparsed.role == \"admin\") {\n window.location.href = \"./admin\";\n }\n // Check be customer role\n // Come the general page with role\n else if (jsonparsed.includes(\"customer\")){\n\n }\n // \n else if (jsonparsed.includes(\"otheruser\")) {\n\n }\n }\n else\n console.log(\"else end\");\n },\n error: function () {\n \n },\n complete: function (rst) {\n if (rst.success) {\n\n }\n else {\n }\n }\n });\n}", "function authenticate(){\n // to handle authentication request\n fetch('http://localhost:3800/users/auth', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n \n },\n body: JSON.stringify({\n email: emailNode.value,\n password: passwordNode.value,\n })\n })\n .then(data => {\n return data.json();\n })\n .then(json => {\n if (json.status === 'success') {\n // to set token for authenticted user \n localStorage.setItem('Token', json.accessToken);\n \n // to get current type of user to navigate them on corresponding page\n getUserType();\n } else {\n alert('user not found');\n emailNode.focus();\n }\n })\n .catch(error => {\n console.log(error);\n }); \n }", "function landing_cmdWorkOrders() {\r\n\r\n // turn on the spinner\r\n console.log(\"WorkOrders fired\");\r\n $('body').addClass('busy');\r\n\r\n var auth = JSON.parse(sessionStorage.getItem(\"auth\"));\r\n var license = JSON.parse(sessionStorage.getItem(\"license\"));\r\n //$(\"#username\").attr(\"data-username\", auth.DisplayName);\r\n\r\n var url = \"https://\" + license.serverroot + \"/DesktopModules/DnnSharp/DnnApiEndpoint/Api.ashx?method=MobileProjectsGetWorkOrderList\";\r\n // now we will authenticate the user\r\n $.ajax({\r\n type: \"GET\",\r\n url: url,\r\n data: { \"UserID\": auth.UserID, \"Token\": auth.Token }\r\n }).done(function(data) {\r\n // process response\r\n sessionStorage.setItem(\"woList\", JSON.stringify(data));\r\n window.location.href = \"wolist.html\";\r\n }).fail(function(data) {\r\n console.log(data);\r\n $(\"#ErrorMessage\").text(\"Unknown Error.\");\r\n var toastID = new bootstrap.Toast($(\"#ErrorDialog\"));\r\n toastID.show();\r\n\r\n }).always(function() {\r\n // turn off the spinner\r\n $('body').removeClass('busy');\r\n });\r\n return true;\r\n\r\n}" ]
[ "0.6590064", "0.652824", "0.6383094", "0.6260846", "0.6256753", "0.62122446", "0.6158254", "0.6145183", "0.6140794", "0.61346704", "0.6130776", "0.61147183", "0.6108653", "0.6082099", "0.6079462", "0.60789156", "0.6070891", "0.6060411", "0.60395044", "0.60038716", "0.598237", "0.597378", "0.59176284", "0.5910696", "0.5907215", "0.589816", "0.589429", "0.5893504", "0.58918744", "0.58891416", "0.58702743", "0.5843562", "0.58392054", "0.5835304", "0.5828132", "0.5820665", "0.5820029", "0.58181816", "0.5812825", "0.58126223", "0.5809586", "0.5805911", "0.5804828", "0.5803893", "0.5803311", "0.5799235", "0.57977855", "0.5795899", "0.57931817", "0.57855546", "0.5780768", "0.57794017", "0.5770553", "0.5763487", "0.5762177", "0.57606375", "0.5748692", "0.57458144", "0.5733494", "0.57264566", "0.57217443", "0.57177144", "0.5706622", "0.57048357", "0.5701485", "0.57012653", "0.56950146", "0.56912404", "0.5688515", "0.56876683", "0.5683", "0.56802326", "0.5672213", "0.5668997", "0.5668628", "0.5667676", "0.56660134", "0.5650752", "0.5647144", "0.5646536", "0.5641559", "0.56388324", "0.5637597", "0.5628786", "0.56249905", "0.5624085", "0.5622863", "0.561756", "0.5612472", "0.56090796", "0.5609061", "0.560827", "0.5606234", "0.56061715", "0.56055826", "0.56017923", "0.5595537", "0.55938995", "0.55905557", "0.55892855" ]
0.63398474
3
Renders an error message
function showError(msg) { const html = `<li><p class="error">${msg}</p></li>`; document.querySelector('#results').innerHTML = html; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _renderError(message) {\r\n el.email_input.addClass('error');\r\n el.email_error.text(message);\r\n }", "function renderErrorMessage() {\n return (\n <ErrorMessage message=\"The data couldn't be loaded!\" />\n );\n }", "_renderErrorText() {\n\t\treturn (\n\t\t\t<Text style={styles.errorText}>{this.state.invalidMessage}</Text>\n\t\t);\n\t}", "function displayError(message) {\n errorMessage.html(message);\n error.show();\n state.change(\"error\");\n }", "@readOnly\n @computed('localError')\n renderErrorMessage (localError) {\n return localError ? `Form renderer error encountered: ${localError}` : ''\n }", "displayError(message) {\n this.error = message;\n }", "function displayError() {\r\n let html = `${addBookmark()}<div id=\"error-message\">${store.error}</div>`;\r\n return html;\r\n}", "renderErrorMsg(error) {\n if (error.email) {\n return <Text style={styles.errorText}>Not a valid email address.</Text>\n } else if (error.minLength) {\n return <Text style={styles.errorText}>Password must be at least {error.minLength} characters.</Text>\n }\n return null\n }", "function error(message) {\n jsav.umsg(message, {\"color\" : \"red\"});\n jsav.umsg(\"<br />\");\n }", "function showErrorMessage(msg) { }", "static renderCompileError(message) {\n const noCreate = !message\n const overlay = this.getErrorOverlay(noCreate)\n if (!overlay) return\n overlay.setCompileError(message)\n }", "function displayError(message) {\n errorElem.textContent = message;\n errorElem.classList.add('show');\n }", "function showError(type, text) {}", "displayError(message) {\n\t\tthis._error.innerText = message;\n\t\tthis._error.classList.add('shown');\n\t}", "function errorHtml(data){\n var success = 'success';\n if (!data.success) {\n success = 'error';\n }\n return '<div class=\"message-'+success+' alert-'+success+'\">'+\n '<div class=\"message\"> <i class=\"icon\"></i> <span>'+data.message+'</span>'+\n '</div>';\n\n }", "function renderMsg(elementId, msg) {\n var $error = $('<div>').text(msg).attr('class', 'error-msg');\n $(elementId).append($error);\n}", "showErrorMessage() {}", "showErrors(message) {\n if(this.errors.length > 0) {\n let error = this.errors.join('');\n message.html(error);\n this.isValid = false;\n this.errors = [];\n }\n else {\n this.isValid = true;\n }\n }", "function error() {\r\n\t\tlet error = document.createElement(\"h3\");\r\n\t\terror.innerHTML = \"Sorry there are no recipes with \"+errorName+\", try again!\";\r\n\t\tdocument.getElementById(\"error\").appendChild(error);\r\n\t}", "function displayError(message)\n\t{\n\t\t// Show message\n\t\tvar message = formWrapper.message(message, {\n\t\t\tappend: false,\n\t\t\tarrow: 'bottom',\n\t\t\tclasses: ['red-gradient'],\n\t\t\tanimate: false\t\t\t\t\t// We'll do animation later, we need to know the message height first\n\t\t});\n\n\t\t// Vertical centering (where we need the message height)\n\t\tcenterForm(currentForm, true, 'fast');\n\n\t\t// Watch for closing and show with effect\n\t\tmessage.on('endfade', function(event)\n\t\t\t\t{\n\t\t\t// This will be called once the message has faded away and is removed\n\t\t\tcenterForm(currentForm, true, message.get(0));\n\n\t\t\t\t}).hide().slideDown('fast');\n\t}", "function displayError() {\n if(originalError instanceof ValidationError) {\n $(\".validation-message--error\").text(`Validation Error: ${originalError.message}`);\n }\n else if(originalError instanceof LocationError) {\n $(\".validation-message--error\").text(`Location Error: ${originalError.message}`);\n }\n else {\n $(\".validation-message--error\").text(`Error: ${originalError.message}`);\n }\n }", "checkForError() {\n if (this.props.error) {\n return <p className=\"error-text\">{this.errorMessage}</p>;\n }\n }", "function show_error(message) {\n\t\t$(\"#error_msg\").text(message);\n}", "renderFormError(inputName) {\n\n if (inputName == 'lastname') {\n if (this.state.lastnameError !='') {\n return (<RkText rkType='danger'> {this.state.lastnameError} </RkText>);\n }\n }\n }", "function returnErrorMessage() {\n $('.result-line').text(\"That is not a valid response\");\n }", "function ShowFormError(message) {\n console.log(\"error message is \" + JSON.stringify(error_message));\n error_message.innerText = message;\n ShowElements(error_message);\n}", "function showErrorMessage(message){\n //Hide the submit button\n submitSection.hide()\n //Show the error section\n errorSection.show()\n errorSection.text(message)\n }", "function errorMessage(message) {\r\n\t$(\"#errorMessageContent\").text(message);\r\n\t$(\"#errorMessage\").css(\"display\", \"flex\");\r\n}", "renderError() {\n return (\n <div id=\"error\">\n <div className=\"alert alert-danger\" role=\"alert\">\n <strong>Warning!</strong> Please intput a positive number &#40; 1 &#45; 1476 &#41;\n </div>\n <button onClick = {this.handleSubmit} className = \"waves-effect waves-light btn-large\"> Try Again </button>\n </div>\n );\n }", "function renderError(errorObject) {\n let alertClass = \"alert alert-danger\";\n let alertP = $(`<p class=\"${alertClass}\">${errorObject.message}</p>`);\n $(\"#viewFeedbackDiv\").append(alertP);\n }", "function updateRelationErrorMsg() {\n relationErrorMsg.innerHTML = relationInput.validationMessage;\n}", "function displayError(el, message){\n\t\t// Create a span element with class text-danger\n\t\tvar $span = $('<span class=\"help-block\">');\n\n\t\t// Add the message passed as argument to the new span\n\t $span.html('<strong>' + message + '<strong>');\n\n\t //Append the span after the input that is not valid\n\t el.after($span);\n\t \n\t // Set the focus \n\t el.focus();\n\n\t // Add class \"has-error to the element's parent\"\n\t el.parent().addClass('has-error');\n\t}", "function error(err) {\r\n notificationElement.style.display = \"block\"\r\n notificationElement.innerHTML = `<p>${err.message}</p>`\r\n}", "_handleError (name, msg) {\n this.view.renderError(name, msg);\n }", "renderFormError(inputName) {\n if (inputName == 'height') {\n if (this.state.heightError !='') {\n return (<RkText rkType='danger' style={{fontSize: 16, marginHorizontal: -5}}> {this.state.heightError} </RkText>);\n }\n }\n }", "function DisplayError(pMsg) {\n let domainArea = document.getElementById('v-token-results');\n domainArea.innerHTML = '';\n let div = document.createElement('div');\n div.setAttribute('class', 'v-errorText');\n let message = document.createTextNode('ERROR: ' + pMsg);\n div.appendChild(message);\n domainArea.appendChild(div);\n }", "function draw_error() {\n\tdocument.getElementById(\"raw_output\").innerHTML = \"ERROR!\";\n}", "function displayError(msg, title){\n\t\tvar htmlString = \"\";\n\t\tif(title && title.length){\n\t\t\thtmlString += \"<h3>\"+title+\"</h3>\";\n\t\t}\n\t\thtmlString += \"<p>\"+msg+\"</p>\";\n\n\t\t$parserErrorDisplay\n\t\t\t.show()\n\t\t\t.html(htmlString);\n\t}", "renderError(){\n if (this.state.error !== false){\n return(\n <div className=\"alert alert-danger\">\n {this.state.error}\n </div>\n )\n }\n }", "function ErrorMessage({ error, visible }) {\n // if there is no error or the element is set to invisible retun null\n if (!visible || !error) return null;\n\n //return an AppText showing the validation error message\n return <AppText style={styles.error}>{error}</AppText>;\n}", "renderError () {\n const { error } = this.state\n return (\n <div className=\"store-errors\">\n <div className=\"store-error\">\n <h5 className=\"title\">{error.title ?? 'Unknown Error'}</h5>\n <span className=\"detail\">{error.detail}</span>\n <br />\n <small className=\"footer\">\n {\n error.code === HttpStatus.UNAUTHORIZED\n ? (\n <>\n {'If you believe this is an error, Please appeal via email: '}\n <a href=\"mailto:[email protected]\">{'[email protected]'}</a>\n </>\n ) : (\n <>\n {'If the problem persists, please contact a techrat via email: '}\n <a href=\"mailto:[email protected]\">{'[email protected]'}</a>\n </>\n )\n }\n </small>\n\n </div>\n </div>\n )\n }", "renderErrorFor(fieldName) {\r\n \tif (this.hasErrorFor(fieldName)) {\r\n\t return (\r\n\t \t<em className=\"error invalid-feedback\"> {this.state.errors[fieldName][0]} </em>\r\n\t )\r\n \t}\r\n }", "function showError(error){\r\n notificationElement.style.display = \"block\";\r\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\r\n}", "function error(msg) {\r\n textFormat(color(0, 0, 100), 50, CENTER);\r\n alert(msg);\r\n}", "function displayError() {\n errorMsgContainer.innerHTML = \"\";\n errorMsg.textContent = \"No results were found.\";\n errorMsgContainer.appendChild(errorMsg);\n studentUL.appendChild(errorMsgContainer);\n }", "formatErrorMessage(message) { return `An error occurred: \\`${message}\\``; }", "renderError(){\n if(this.state.error){\n return (\n <div className=\"error\">\n {this.state.error}\n </div>\n )\n }\n return null;\n }", "function showError() {}", "function displayErrorMessage(message) {\n $('#errorMessage').html(message);\n $('#errorMessage').css('display', 'block');\n}", "function edropx_display_error(element_id, message) {\n\n\t$(\"#\" + element_id).html(\"<div class=\\\"alert alert-danger\\\"><strong>Error:</strong>\" + message + \"</div>\");\n\n}", "renderError({ error, touched }) {\n if (touched && error) {\n return (\n <div className=\"ui error message\">\n <div className=\"header\">{error}</div>\n </div>\n );\n }\n }", "_renderError() {\n return null;\n }", "error(text, dismissable = false){\n this.message(text, 'error', dismissable);\n }", "function drawRegistrationError() {\r\n var container = document.getElementById('welcome');\r\n container.innerHTML = \"<span class='error'>Registration form couldn't load!</span>\" + container.innerHTML;\r\n}", "function displayErrorMsg(error) {\n $(\".errorOverlay\", selector).text(tr(error));\n $(selector).addClass(\"error\");\n }", "function renderErrors(err) {\n const input = document.getElementById('city-input');\n const headline = document.getElementById('city');\n const value = input.value;\n const placeholder = input.placeholder;\n\n if (err.message === 'Error: Empty search') {\n input.placeholder = '🙄';\n setTimeout(() => (input.placeholder = 'Type in something'), 300);\n setTimeout(() => (input.placeholder = placeholder), 1000);\n }\n else {\n input.placeholder = '💩';\n setTimeout(() => (input.placeholder = 'Spell properly'), 300);\n setTimeout(() => (input.value = value), 1000);\n }\n input.value = '';\n headline.textContent = 'Y U NO forecast?';\n console.log(err.message);\n}", "function showError(error)\n{\n notificationElement.style.display=\"block\";\n notificationElement.innerHTML=`<p> ${error.message}</p>`;\n}", "function showError(error){\n notificationElement.style.display = \"block\";\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\n }", "function buildErrorMsgBox(text) {\n return '<div class=\"ui-state-error ui-corner-all search-status-messages\" id=\"error_message\"><p><span class=\"ui-icon ui-icon-alert status-icon\"></span>' + text + '</p></div>';\n}", "function showError(error){\n notificationElement.style.display = \"block\";\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\n}", "function error(err) {\n res.render('login', {message: err.message});\n }", "async function appDisplayErrHandling(m) {\n\n // re-format the message to get rid of the hyperlink\n m = await reconstructStrings(m);\n \n // create a div element\n const errorDiv = document.createElement('div');\n\n // style the text\n errorDiv.style.textAlign = 'center';\n errorDiv.style.position = 'absolute';\n errorDiv.style.top = '50%';\n errorDiv.style.transform = 'translateY(-50%)';\n errorDiv.style.width = '100%';\n errorDiv.style.padding = '15px';\n errorDiv.style.backgroundColor = 'rgba(255, 0, 0, 0.75)';\n errorDiv.style.color = 'rgba(255, 255, 255, 0.75)';\n\n // append text to the element\n errorDiv.innerHTML = m;\n\n document.body.appendChild(errorDiv);\n}", "function showError(error){ \n notificationElement.style.display = \"block\";\n notificationElement.innerHTML = `<p> ${error.message}</p>`;\n}", "function error(msg) {\n inputEl.classList.add('invalid');\n M.toast({\n html: msg,\n displayLength: 4000\n })\n }", "function showErrorMessage() {\n const errorMessage = document.querySelector(\".error--message\");\n errorMessage.innerHTML = `<h1>No Matches for: ${searchInput.value}</h1>`;\n errorMessage.style.display = `inline-block`;\n}", "function renderTicketMessage() {\n res.render('index', {title: 'Ticket Checker', message: message, errorMessage: errorMessage});\n }", "renderAlert() {\n if(this.props.errorMessage) {\n return(\n <div className=\"label1\">\n <strong>Oops!</strong> {this.props.errorMessage}\n </div>\n )\n }\n }", "function error(msg) {\n alertify.alert('<img src=\"/images/cancel.png\" alt=\"Error\">Error!', msg);\n }", "showErrorMessage(message, errorType) {\n this.props.dispatch(Action.getAction(adminActionTypes.SHOW_VALIDATION_MESSAGE, { validationMessage: message, type: errorType.key }));\n }", "renderPostError() {\n if(this.props.postError) {\n return (\n <View>\n <Text style={ styles.errorTextStyle }>\n { this.props.postError }\n </Text>\n </View>\n )\n }\n }", "function errorMessage (text){\n resultLine.textContent = `Error : ${text}`;\n calcScreen.classList.add('error');\n }", "function showError(error) {\r\n notificationElement.style.display = \"block\";\r\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\r\n}", "function showError (error){\n notificationElement.style.display = \"block\";\n notificationElement.innerHTML = `<p> ${error.message}</>`;\n\n}", "function error(msg) {\n\t\t// Update the status DOM object with the error message\n\t\tstatus.innerHTML = typeof msg === 'string' ? msg : 'Failed!';\n\t\tstatus.className = 'alert alert-error';\n\t}", "function createErrorEl() {\n // Creates an element\n var erMsg = document.createElement(\"span\");\n \n // Adds id and style attributes to the element\n erMsg.setAttribute(\"id\", \"errorMessage\");\n erMsg.setAttribute(\"style\", \"color: red\");\n\n // Sets the element text\n erMsg.textContent = \"Please enter a message\";\n\n // Appends the newly created element to the document\n message.parentNode.insertBefore(erMsg, message.nextSibling);\n }", "function displayError(errorText) {\r\n // log the msg for the user to see\r\n logError(errorText);\r\n}", "function errorMessage(message){\n setSpinner(false); // call setSpinner with the parameter - false - so we're hiding the spinner\n document.querySelector(\"#searchResult\").innerHTML = `<p class=\"errorMsg\">${message}</p>`; // replace innerHTML of search result div with the error message\n}", "showError(){\n if(this.state.error.payload !== \"\")\n {\n return(\n <small style={{ color: \"red\", margin:\"auto\"} }> {this.state.error.payload} </small>\n\n )}\n }", "function displayError() {\n\t\t// Hide loading animations\n\t\tdocument.getElementById(\"loadingmeaning\").style.display = \"none\";\n\t\tdocument.getElementById(\"loadinggraph\").style.display = \"none\";\n\t\tdocument.getElementById(\"loadingcelebs\").style.display = \"none\";\n\t\t\n\t\t// Display error at bottom of the page\n\t\tdocument.getElementById(\"errors\").innerHTML =\n\t\t\t\"Sorry, but an error occured during your server request.\";\n\t}", "function mdm_error(message) { document.getElementById(\"error\").innerHTML = 'try again'; }", "function showError(error){\n\tnotificationElement.style.display = \"block\";\n\tnotificationElement.innerHTML = '<p> ${error.message} </p>';\n}", "function showError(error){\n notificationElement.style.display=\"block\";\n notificationElement.innerHTML=`<p>${error.message}</p>`;\n}", "function renderError(req, res, err) {\n\tres.status(err.status || 500);\n\tres.render('error', {\n\t\terr: req.app.get('env') === 'development' ? err.err : {},\n\t\ttitle: err.title,\n\t\terrorMsg: err.message\n\t});\n}", "function showError(error){\n notificationElem.style.display = \"block\";\n notificationElem.innerHTML = `<p> ${error.message} </p>`;\n}", "function renderError(error) {\n render(error.message);\n render(error.code);\n console.log(error.code, error.message);\n capturePDF();\n}", "function showError(error) {\n notificationElement.style.display = \"block\";\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\n}", "function errorMessage() {\n document.querySelector(\"#content\").innerHTML = `\n <div class=\"error\">\n <h1><strong>No recipes found please search again.</strong><h1>\n </div>\n `;\n }", "function showErr(err){\n\tconst outputElem = $('#results');\n\tconst errMsg = (\n\t\t\t`<p class=font>No results found.</p>`\n\t\t);\n\toutputElem.html(errMsg);\n}", "function updateUiError() {\n showElements(statusMessage);\n statusMessage.textContent =\n \"Sorry you have entered invalid value, please try again!\";\n statusMessage.classList.remove(\"success\");\n statusMessage.classList.add(\"error\");\n}", "function displayError(error) {\n displayMessage(error, true);\n\n}", "showErrorMessage (error) {\n let displayError = generateErrorMessage(error);\n\n this.DOMNodes.statusTitle.innerHTML = \"Error!\";\n this.DOMNodes.statusTitle.className = \"error\";\n this.DOMNodes.statusMessage.innerHTML = `<em>${displayError.type}</em>\\n\\n${displayError.message}`;\n\n // Connect any textual references in the error message to the actual referenced text.\n for (let [index, textReferenced] of displayError.references.entries()) {\n let reference = document.getElementById(`reference-${index}`);\n reference.addEventListener(\"mouseover\", () => this.DOMNodes.editor.classList.add(`show-referent-${index}`)); // This is a CSS hack.\n reference.addEventListener(\"mouseleave\", () => this.DOMNodes.editor.classList.remove(`show-referent-${index}`));\n reference.addEventListener(\"click\", () => textReferenced.DOMNode.scrollIntoView({block: \"center\"}));\n textReferenced.DOMNode.classList.add(\"error\");\n textReferenced.DOMNode.classList.add(`referent-${index}`);\n }\n\n this.selectTab(this.tabs[\"status\"]); // Automatically switch to the status tab to display the error.\n }", "function errorMessage() {\n let messageError = \"\";\n messageError += `<p class=\"fw-bold text-center fs-1\">\"Petit problème de connexion au serveur... 🥺\"</p>`\n document.querySelector(\".error\").innerHTML = messageError;\n}", "function showError(error) {\n errorElement.innerText = error;\n\n //check for the username field\n if (!username.value) {\n username.classList = 'username invalid';\n } else {\n username.classList = 'username';\n }\n\n //check for the password field\n if (!password.value) {\n password.classList = 'password invalid';\n } else {\n password.classList = 'password';\n }\n\n //check for the mail field\n if (!mail.value) {\n mail.classList = 'mail invalid';\n } else {\n mail.classList = 'mail';\n }\n}", "function sendErrorMessage(message) {\r\n const messageBox = document.querySelector(\".message2\");\r\n if (message === \"\") {\r\n messageBox.innerHTML = \"\";\r\n return\r\n }\r\n messageBox.innerHTML = \"\";\r\n const divEl = document.createElement(\"div\")\r\n divEl.textContent = `${message}`;\r\n messageBox.appendChild(divEl);\r\n }", "function displayError(msg) {\n $(\"#error-message\").html(msg);\n $(\"#error-wrapper\").show();\n $(\"#results-wrapper\").hide();\n}", "function displayError(error) {\n var errorType = {\n 0: \"Unknown Error\",\n 1: \"Permission denied by user\",\n 2: \"Position is not available\",\n 3: \"Request timed out\"\n };\n \n var errorMessage = errorType[error.code];\n if (error.code == 0 || error.code == 2) {\n errorMessage = errorMessage + \" \" + error.message;\n }\n \n var div = document.getElementById(\"location\");\n div.innerHTML = errorMessage;\n}", "insertErrorMessage(){\n\t\t$(this.element + \"Error\").html(this.errorMessage);\n\t}", "function showError(error){\n notificationElement.style.display = \"block\";\n notificationElement.innerHTML = `<p>${error.message}</p>`;\n}", "function returnErrorText(res, err) {\n let message = (process.env.SHOW_ERROR_DETAIL == 'True') ? err.message : 'An error occurred, please contact your system administrator';\n res.set({ 'Content-Type': 'text/xml' });\n res.status(200).render('ldap_directory/text.ejs', {\n title: 'Error',\n text: message\n });\n}", "function showError() {\n showStatus('error');\n}" ]
[ "0.7736125", "0.76653004", "0.7605062", "0.7235866", "0.71673214", "0.7074343", "0.7071793", "0.7070685", "0.70644355", "0.7006818", "0.7004977", "0.7003859", "0.6997686", "0.69584775", "0.6952036", "0.69118434", "0.69039357", "0.6850194", "0.68473405", "0.68387437", "0.6833929", "0.6811759", "0.6810416", "0.68090844", "0.6755649", "0.6753882", "0.67447", "0.67351604", "0.6720686", "0.6712495", "0.6707564", "0.6699165", "0.6682769", "0.66806245", "0.66787845", "0.66779214", "0.6667498", "0.6658803", "0.6647779", "0.66456294", "0.6637884", "0.6632623", "0.663021", "0.66262907", "0.66128397", "0.6597879", "0.65961987", "0.6591604", "0.6584716", "0.65809333", "0.6580199", "0.65794337", "0.65725976", "0.65724486", "0.6566646", "0.65661085", "0.6565051", "0.6560781", "0.6555693", "0.65505207", "0.6541928", "0.6536766", "0.65305674", "0.65305066", "0.6522421", "0.6521697", "0.650738", "0.6505694", "0.6502233", "0.65005666", "0.6497442", "0.6495579", "0.6494637", "0.64735913", "0.6471534", "0.64698225", "0.6469217", "0.6464663", "0.64601535", "0.64505345", "0.64417547", "0.644048", "0.64367396", "0.64342576", "0.6432697", "0.6412348", "0.6409029", "0.64057547", "0.64045954", "0.64027035", "0.64017123", "0.6400104", "0.6396941", "0.63966256", "0.63945913", "0.6393156", "0.63924897", "0.6391481", "0.6382446", "0.63822454" ]
0.670692
31
Searches for books and returns a promise that resolves a JSON list
function searchForBooks() { let search = document.querySelector('#search-bar').value; // save value of search bar const URL = 'https://www.googleapis.com/books/v1/volumes/?q='; // URL to search const maxResults = '&maxResults=10'; let searchGBooks = `${URL}${search}${maxResults}`; // google books api + search value // set up JSON request let request = new XMLHttpRequest(); request.open('GET', searchGBooks, true); request.onload = function() { if (request.status >= 200 && request.status < 400) { let data = JSON.parse(request.responseText); // Success! here is the JSON data render(data); } else { showError('No matches meet your search. Please try again'); // reached the server but it returned an error } }; request.onerror = function() { // There was a connection error of some sort }; request.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static fetchBooksFromGoogle(searchInput){ //searchInput from Content.js\n return fetch(`https://www.googleapis.com/books/v1/volumes?q=${searchInput}`)\n .then(response => response.json())\n .then(json => {\n return json.items.map(item => this.createBook(item)) //returns an array of objects created from the createBook fn.\n })\n }", "function getAllBooks(){\n fetch(baseURL)\n .then(res => res.json())\n .then(books => listBooks(books))\n }", "async function getBooks(){\n if(!books){\n let result = await MyBooklistApi.bookSearch(\"fiction\", getCurrentDate(), user.username);\n setBooks(result);\n }\n }", "function getBooks() {\n return fetch(`${BASE_URL}/books`).then(res => res.json())\n}", "function getBooks () {\n fetch(bookUrl)\n .then(resp => resp.json())\n .then(books => {\n renderBooks(books);\n window.allBooks = books\n }) //aspirational code to renderBooks(books)\n }", "function findBook(req, res) {\n\n let url = 'https://www.googleapis.com/books/v1/volumes?q=';\n\n if (req.body.search[1] === 'title') { url += `+intitle:${req.body.search[0]}`; }\n\n if (req.body.search[1] === 'author') { url += `+inauthor:${req.body.search[0]}`; }\n\n superagent.get(url)\n\n .then(data => {\n // console.log('data >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', data.body.items[0].volumeInfo);\n\n let books = data.body.items.map(value => {\n return new Book(value);\n });\n // console.log(books);\n res.render('pages/searches/show', { book: books });\n }).catch(error => console.log(error));\n\n}", "function getBooks () {\n\t\t\treturn backendService.getBooks()\n\t\t\t\t.then(function (response) {\n\t\t\t\t\tallBooks = response; // keep a copy of all the books, without filtering.\n\t\t\t\t\treturn allBooks;\n\t\t\t\t});\n\t\t}", "static async find(searchQuery) {\n if (!searchQuery) {\n return [];\n }\n\n const response = await fetch(`https://www.googleapis.com/books/v1/volumes?q=${searchQuery}`, {\n method: 'GET',\n });\n\n if (!response.ok) {\n throw new Error(\"Error Fetching Books\");\n }\n\n const payload = await response.json();\n return payload.items || [];\n }", "async function getBooks() {\r\n\ttry{\r\n\t\t// lean() transforms mongoose object to json object\r\n\t\tconst data = await newBoek.find().lean();\r\n\t\treturn data;\r\n\t} catch (error) {\r\n\t\tconsole.log('getBooks failed ' + error);\r\n\t}\r\n}", "getBooks() {\n return this.service.sendGetRequest(this.books);\n }", "searchFor(query) {\n return BooksAPI.search(query).then(results => results && !results.error ? results : []).then((results) => {\n return results.map(book => {\n const shelvedBookIndex = this.state.books.findIndex(shelvedBook => shelvedBook.id===book.id)\n var shelf;\n if (shelvedBookIndex === -1) {\n shelf = 'none';\n } else shelf = this.state.books[shelvedBookIndex].shelf;\n return Object.assign({shelf}, book);\n }) \n })\n }", "function listBooks() {\n return initDB('thr').then(function(db) {\n var books = [];\n return visitRecords(db, 'books', function(cursor) {\n var book = cursor.value;\n books.push({ID: book.ID, title: book.title});\n }).then(function() {\n return books;\n });\n });\n }", "function load_books( search, silent ){\n\t\tvar rq = connect('GET', 'index.php?q=/books', { search: search });\n\n\t\trq.done(function(response){\n\t\t\t// Procura o elemento container (.library-grid)\n\t\t\tvar grid = $(\".library-grid\");\n\t\t\tvar categories = {};\n\t\t\t// Remove todo o conteúdo dentro dele;\n\t\t\tgrid\n\t\t\t\t.hide()\n\t\t\t\t.html('');\n\t\t\t// Para cada registro encontrado, cria um card\n\t\t\tfor (var x in response.data){\n\t\t\t\tvar book = response.data[x];\n\t\t\t\tvar card = build_book_card( book );\n\n\t\t\t\t// check category\n\t\t\t\tif (typeof categories[book.category_id] == 'undefined'){\n\t\t\t\t\tcategories[book.category_id] = build_category_section({\n\t\t\t\t\t\tid: book.category_id,\n\t\t\t\t\t\tname: book.category\n\t\t\t\t\t});\n\n\t\t\t\t\tgrid.append( categories[book.category_id] );\n\t\t\t\t}\n\n\t\t\t\t// esconde o card visualmente\n\t\t\t\tcategories[book.category_id]\n\t\t\t\t\t.children('.book-list')\n\t\t\t\t\t.append(card);\n\t\t\t}\n\n\t\t\t// show result\n\t\t\tgrid.fadeIn();\n\n\t\t\tdelete categories;\n\t\t});\n\n\t\tif (!silent){\n\t\t\trq.fail(notify_error);\n\t\t}\n\t\t\n\t\treturn rq;\n\t}", "function loadBooks() {\n\n\t// We return the promise that axios gives us\n\treturn axios.get(apiBooksUrl)\n\t\t.then(response => response.data) // turns to a promise of books\n\t\t.catch(error => {\n\t\t\tconsole.log(\"AJAX request finished with an error :(\");\n\t\t\tconsole.error(error);\n\t\t});\n}", "function getBooks(bibleParam, callback) {\n var dfd = $.Deferred();\n bible = bibleParam;\n // if default books found use it\n var booksPath = bible.defaultIndex ? (baseUrl + '/defaults/books/' + bible.defaultIndex + '.bz2') : (baseUrl + bible.dbpath + '/' + 'books.bz2');\n $.when(getBzData(booksPath)).then(d => {\n dfd.resolve(books = d);\n });\n return dfd.promise();\n }", "searchBooks() {\n\t\tif (this.state.query === '' || this.state.query === undefined) {\n\t\t\treturn this.setState({ searchResults: [] })\n\t\t}\n\t\tBooksAPI.search(this.state.query.trim()).then(matches => {\n\t\t\tif (matches.error) {\n\t\t\t\treturn this.setState({ searchResults: [] })\n\t\t\t} else {\n\t\t\t\t// If book already on a shelf, update shelf status in search results\n\t\t\t\tmatches.forEach(b => {\n\t\t\t\t\tconst listBook = this.state.books.filter(myBook => myBook.id === b.id)\n\t\t\t\t\tif (listBook.length) {\n\t\t\t\t\t\tb.shelf = listBook[0].shelf\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\treturn this.setState({ searchResults: matches })\n\t\t}})\n\t}", "async function getListOfBooks() {\n let find = await Book.find();\n\n return (find);\n}", "async getBooks() {\n if(this.props.currentUser) {\n var bookIdList = this.props.currentUser[\"library\"][\"to_read_list\"];\n if(bookIdList === null) {\n bookIdList = [];\n this.setState({isLoading: false});\n }\n\n var bookList = [];\n\n // Get details from Cache or API and add to list - skip if not available\n for (let i = 0; i < bookIdList.length; i++) {\n var book = await this.props.getBookDetails(bookIdList[i]);\n if(book === null) {\n continue;\n }\n\n if(this.state.searchString === \"\" || (this.state.searchString !== \"\" && ((book.Title.toLowerCase().indexOf(this.state.searchString.toLowerCase()) !== -1) || book.Authors.join(\"\").toLowerCase().indexOf(this.state.searchString.toLowerCase()) !== -1))) {\n bookList.push(book);\n }\n\n }\n await this.setState({toReadList: bookList, isLoading: false});\n\n // Add books to cache\n this.props.addBooksToCache(bookList);\n } else {\n this.setState({isLoading: false});\n }\n\n }", "@action\n getBooks(currentSearchText) {\n ApiService.getBooks()\n .then((res) => {\n if (!res) throw res.error;\n let searchItems = [];\n console.log(currentSearchText);\n console.log(res.items);\n for (let i=0; i < res.items.length; i++) {\n let title = res.items[i].volumeInfo.title;\n\n if (title.toLowerCase().indexOf(currentSearchText) !== -1) {\n searchItems.push(res.items[i]);\n }\n }\n console.log(searchItems);\n this.booksInfo = res.items;\n if (searchItems.length > 0) {\n this.searchResult = searchItems;\n this.isFoundResult = true;\n this.book = {};\n } else {\n this.searchResult = {};\n this.book = {};\n this.isFoundResult = false;\n }\n })\n .catch((e) => {\n new ErrorHandler(e);\n });\n }", "getBooks(title) {\n return this.service.sendGetRequest(this.books + '/' + title.value);\n }", "function getBooks(){\n fetch('http://localhost:3000/books')\n .then(resp => resp.json())\n .then(book => book.forEach(title))\n}", "async function loadBooks() {\n const response = await api.get('books');\n setBooks(response.data);\n }", "async function findBook (id) {\n const booksEndpoint = `${cors}${baseUrl}details/?id=${id}&authorization=${key}&detaillevel=${detail}&p=jeugd&output=json`;\n const books = await fetchData(booksEndpoint, config);\n // const findData = books.find((data) => data.id == id);\n return books;\n // https://medium.com/poka-techblog/simplify-your-javascript-use-map-reduce-and-filter-bd02c593cc2d\n}", "function handleBookSearch () {\n // console.log(\"googleKey\", googleKey);\n axios.get(\"https://www.googleapis.com/books/v1/volumes?q=intitle:\" + book + \"&key=\" + googleKey + \"&maxResults=40\")\n .then(data => {\n const result = data.data.items[0];\n setResults(result);\n setLoad(true);\n setLoaded(false);\n })\n .catch(err => {\n console.log('Couldnt reach API', err);\n });\n }", "function getBooks() {\n $.ajax({\n url: 'http://127.0.0.1:8000/book/',\n method: 'GET'\n }).done(function (response) {\n setBooks(response);\n });\n }", "async function getAllBooks () {\n console.log('book')\n const books = await fetchData(endpoint, config);\n // console.log(books)\n render.allBooks(books);\n}", "async function getBooksWithSearch(type, date) {\n try{\n let result = await MyBooklistApi.bookSearch(type, date, user.username);\n setBooks(result);\n return true;\n }\n catch(e){\n return e;\n }\n }", "function loadBooks() {\n API.getBooks()\n .then((res) => setBooks(res.data))\n .catch((err) => console.log(err));\n }", "getAllBooks() {\n return new Promise((resolve, reject) => {\n // Make an API call to get all books currently in my shelves and set the state when the response is ready\n BooksAPI.getAll().then((books) => {\n this.setState({ books })\n resolve()\n }).catch((err) => {\n reject(err)\n })\n })\n }", "function getBooksFromGoogleAPI(searchURL){\n\t$.ajax({\n\t\turl: searchURL,\n\t\tsuccess: function(data){\n\t\t\tvar temphtml = '';\n\t\t\tsearchResult = data;\n\t\t\tfor(var i = 0; i < 5 && i < data['totalItems']; i++){\n\t\t\t\tvar title = data.items[i].volumeInfo.title;\n\t\t\t\tvar author = \"\";\n\t\t\t\tif(data.items[i].volumeInfo.hasOwnProperty('authors')){\n\t\t\t\t\tauthor = 'By: ' + data.items[i].volumeInfo.authors[0];\n\t\t\t\t}\n\t\t\t\ttemphtml += '<a class=\"list-group-item list-group-item-action flex-column align-items-start\" href=\"#\">';\n\t\t\t\ttemphtml += '<div class=\"d-flex w-100 justify-content-between\">';\n\t\t\t\ttemphtml += '<h5 class=\"mb-1\">' + title + '</h5></div>';\n\t\t\t\ttemphtml += '<p class=\"mb-1\">' + author + '</p>';\n\t\t\t\ttemphtml += '<p class=\"sr-only\" id=\"index\">' + i + '</p>';\n\t\t\t\ttemphtml += '</a>';\n\t\t\t}\n\t\t\t$(\"#navSearchResults\").html(temphtml).removeClass(\"d-none\");\n\t\t}\n\t});\n}", "function getBooks() {\n clubID = this.value;\n // console.log('clubID', clubID);\n fetch('/get_books_in_genre?clubID=' + clubID)\n .then(function (response) {\n return response.json();\n }).then(function (json) {\n // console.log('GET response', json);\n if (json.length > 0) {\n set_book_select(json);\n };\n });\n}", "function getBookshelves() {\n bookshelfDb.get()\n .then(results => {\n return results;\n })\n}", "function loadBooks() {\n const data = {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n credentials: 'include',\n // Authorization: 'Kinvey ' + localStorage.getItem('authToken'),\n };\n\n fetch(url, data)\n .then(handler)\n .then(displayBooks)\n .catch((err) => {\n console.warn(err);\n });\n }", "function searchBook(e) {\n e.preventDefault();\n API.searchBook({searchRequest:searchTerm})\n .then(res => {\n setBooks(res.data);\n })\n .catch(err => {\n console.log(err);\n });\n \n }", "function searchBooks(req, res, next){\n\tlet reqURL = url.parse(req.url, true);\n\t\n\t//parse the search criteria from the URL\n\tlet category = reqURL.query.category;\n\tlet key = reqURL.query.searchwords;\n\n\tlet query = 'SELECT * FROM book WHERE LOWER(' + category + ') = LOWER($1) ORDER BY book_id ASC;'\n\n\tif(category == 'Vendor ID'){\n\t\tquery = 'SELECT * FROM book WHERE book_id = $1 ORDER BY book_id ASC;'\n\t}\n\n\t//query the database to find the matching books\n\tdb.any(query, [key])\n .then(function(data) {\n\n \t//form an object for the Template Engine\n\t\tlet booksObj = {books: data};\n\n\t\t//send the appropriate data based on the request's Accept header\n\t\tres.format({\n\n\t\t\t//render the partial HTML page to display the matching books\n\t\t\t'text/html': function(){\n\t\t\t\tres.render(\"listBooks\", booksObj, function(err, html){\n\t\t\t\t\tif(err){\n\t\t\t\t\t\tres.status(500).send(\"Database error rendering HTML page\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tres.writeHead(200, { 'Content-Type': 'text/html' });\n\t\t\t\t\tres.end(html);\n\t\t\t\t});\n\t\t\t},\n\n\t\t\t//or send books as a JSON string\n\t\t\t'application/json': function(){\n\t\t\t\tres.json(data);\n\t\t\t},\n\t\t})\n\n });\n}", "function listBooks(response, request) {\n\n var authorID = request.params.authorID;\n\n return memory.authors[authorID].books\n \n \n}", "function returnBooks(res){\n myLibrary.books = [];\n res.items.forEach(function(item) {\n //if price is undefined, then define price at 0\n if(item.saleInfo.listPrice == undefined){\n item.saleInfo[\"listPrice\"] = {amount: null};\n }\n\n //check if price is exist, if yes then create new book\n if (item.saleInfo.listPrice){\n // Book constructor is in book.js\n let temp = new Book(item.volumeInfo.title,\n item.volumeInfo.description,\n item.volumeInfo.imageLinks.smallThumbnail,\n item.saleInfo.listPrice.amount,\n item.volumeInfo.authors,\n item.volumeInfo.previewLink\n );\n myLibrary.books.push(temp);\n }\n\n });\n //print each book on webpage\n myLibrary.printBooks();\n highlightWords();\n}", "function getApi(event) {\n\n console.log(topicSearched);\n var requestUrl = \"https://www.googleapis.com/books/v1/volumes?q=\" + topicSearched;\n fetch(requestUrl)\n .then(function (response) {\n if (response.status === 400) {\n // || Message displaying that city is invalid\n return;\n } else {\n return response.json();\n }\n })\n .then(function (response) {\n saveSearchItem();\n console.log(searchInput);\n console.log(response);\n console.log(response);\n for (var i = 0; i < response.items.length; i++) {\n var bookCard = document.createElement('li');\n bookCard.setAttribute('class', 'card cell small-2 result-card');\n\n var linkBook = document.createElement('a');\n linkBook.href = response.items[i].volumeInfo.infoLink;\n linkBook.setAttribute('target', '_blank');\n bookCard.append(linkBook);\n\n var thumbImg = document.createElement('img');\n thumbImg.setAttribute('alt', `${response.items[i].volumeInfo.title}`)\n thumbImg.src = response.items[i].volumeInfo.imageLinks.thumbnail;\n linkBook.append(thumbImg);\n\n var favoriteEl = document.createElement('span');\n favoriteEl.setAttribute('class', 'label warning');\n favoriteEl.textContent = 'Favorite Me';\n bookCard.append(favoriteEl);\n\n var isbnNumber = document.createElement('span');\n isbnNumber.textContent = response.items[i].volumeInfo.industryIdentifiers[0].identifier;\n console.log(response.items[i].volumeInfo.industryIdentifiers[0].identifier);\n console.log(isbnNumber.textContent);\n isbnNumber.setAttribute('style', 'display: none');\n bookCard.append(isbnNumber);\n\n resultsList.append(bookCard);\n\n console.log(response.items[i].volumeInfo.infoLink);\n console.log(resultCard);\n }\n if (searchInput != \"\") {\n console.log(searchInput);\n } else {\n (function (response) {\n console.log(searchInput)\n })\n }\n });\n\n}", "async function getListOfBooks(query) {\n console.log(query);\n let find = await Book.find(query);\n console.log(find);\n return (find);\n}", "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res =>\n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function getBooks() {\n fetch(\"http://localhost:3000/books\")\n .then(res => res.json())\n .then(books => showBooks(books))\n .catch(err => console.log(err))\n}", "getSearchResults(query) {\n //if search_query is not empty\n if(query !== \"\" || this.props.searchQuery){\n BooksAPI.search(query, 10).then((found) => {\n if(found.length && this.props.searchQuery) {\n //set book shelf attribute to search resutl\n this.props.onUpdateNewBooks(found.map((book) => {\n //if does not include remove it from search result\n book.shelf = this.getShelf(book)\n return book\n })//.map\n )\n } else {\n searchComesUpWithNothing = \"We could not find any books for you with this parameters\"\n this.props.onUpdateNewBooks(null)\n }\n })//.then\n } else {\n this.props.onUpdateNewBooks(null)\n }//if else\n }", "function searchGoogleBooksAPI(query) {\n API.searchBook(query)\n .then(res => {\n console.log(\"API - Results:\", res.data.items)\n setBooks(res.data.items);\n })\n .catch(err => console.log(err));\n }", "function searchBook(title) {\n const bookData = getListOfBook();\n const searchResult = [];\n for (let data of bookData) {\n if (data.title.includes(title)) {\n searchResult.unshift(data);\n }\n }\n renderBookList(true, searchResult);\n}", "function bookSearch(){\n ...\n\n $.AJAX({\n url: \"https://www.googleapis.com/books/v1/volumes?q=\" + search,\n dataType: \"json\",\n\n success: function(data) {\n console.log(data)\n },\n type: 'GET'\n });\n }", "function getBook(authorName, authorSurname, library) {\n\n let listOfBooks = Object.values(library);\n let consulta = [];\n\n\n for (let book of listOfBooks) {\n if (book.author.name === authorName && book.author.surname === authorSurname) {\n consulta.push(book.title)\n }\n }\n return console.log(consulta)\n}", "function getBooks() {\n //Get the <div id='results'> that holds the list\n var results = document.getElementById('results');\n //Get the <div id='results'> that holds the list\n var results = document.getElementById('results');\n //Cleaning the previous result if any\n if (results.childNodes[0] != undefined) {\n results.removeChild(results.childNodes[0])\n }\n //Creating a new unordered list <ul>\n const colletion = document.createElement('ul')\n //Set the classe to the <ul>\n colletion.setAttribute('class', 'collection col s6 offset-s2')\n //Add to the DIV id\n results.appendChild(colletion)\n // Get the input\n const book = document.getElementById('search').value\n\n fetch('https://www.googleapis.com/books/v1/volumes?q=' + book + '&key=AIzaSyCfxVfRWs5eLZEwwiZemvp1iAwyAaHBHUQ')\n .then(response => {\n return response.json()\n })\n .then(data => {\n //If there is at least one result loop through all of them \n if (data.totalItems > 0) {\n for (i = 0; i < data.totalItems; i++) {\n //Those are the components to build materializecss collection component\n //See more at : https://materializecss.com/collections.html\n //Create a <li>\n const list = document.createElement('li')\n //Create a <span>\n const span = document.createElement('span')\n //Create a <p>\n const p = document.createElement('p')\n //Create a <img>\n const img = document.createElement('img')\n //Create a <li>\n const a = document.createElement('a')\n //Create a <i>\n const button = document.createElement('i')\n //Defining classes to the components for the collections\n list.setAttribute('class', 'collection-item avatar')\n span.setAttribute('class', 'title')\n img.setAttribute('class', 'circle')\n a.setAttribute('class', 'btn-floating btn-large waves-effect waves-light red')\n button.setAttribute('class', 'material-icons')\n //If there is a image thumgbail, define it as a logo\n if (data.items[i].volumeInfo.imageLinks != undefined) {\n img.setAttribute('src', data.items[i].volumeInfo.imageLinks.smallThumbnail)\n }\n //Defining the material-icons for the button\n button.innerText = 'shop';\n //The info variable stores the information of the book\n //First, add the title to it\n var info = \"Title: \" + data.items[i].volumeInfo.title\n //Store the title to pass it to the Amazon url\n title = data.items[i].volumeInfo.title\n //If there is a author add it to the info\n if (data.items[i].volumeInfo.authors != undefined) {\n info = info + '\\n Author: ' + data.items[i].volumeInfo.authors[0];\n //Store the author to pass it to the Amazon url\n author = data.items[i].volumeInfo.authors[0];\n }\n //If there is a publisher add it to the info\n if (data.items[i].volumeInfo.publisher != undefined) {\n info = info + '\\n Publisher: ' + data.items[i].volumeInfo.publisher;\n publisher = data.items[i].volumeInfo.publisher;\n }\n //If there is a category add it to the info\n if (data.items[i].volumeInfo.categories != undefined) {\n info = info + '\\n Category: ' + data.items[i].volumeInfo.categories[0];\n }\n //If there is a published date add it to the info\n if (data.items[i].volumeInfo.publishedDate != undefined) {\n var date = data.items[i].volumeInfo.publishedDate\n info = info + '\\n Year: ' + date.substring(0, 4);\n }\n // <a> is the red cicle button \n a.setAttribute('style', 'margin-top: -80px')\n // This link will send the usar to the amazon site to buy the book\n a.setAttribute('href', 'https://www.amazon.co.uk/s?k=' + title + \" \" + author + '&ref=nb_sb_noss_2')\n // To open a new window\n a.setAttribute('target', '_blank')\n //Add all the info regarding the book to the <p>\n p.innerText = info\n // Nesting the elements as:\n // <li> \n // ----<img>\n // ----<p>\n // ----<a><i>\n list.appendChild(img)\n list.appendChild(p)\n p.appendChild(a)\n colletion.appendChild(list)\n a.appendChild(button)\n }\n //If no books were found, display an message to the user\n } else {\n const error = document.createElement('p')\n error.setAttribute('style', \"color: white; text-align: center\")\n error.innerText = 'Please, try again! \\n Your search returned 0 item! :(';\n colletion.appendChild(error)\n }\n }\n )\n //If any error occurs, display a red error message to the user\n .catch(err => {\n console.log(err)\n const error = document.createElement('p')\n if (err.code != undefined) {\n error.setAttribute('style', \"color: red\")\n error.innerText = err.message;\n colletion.appendChild(error)\n }\n\n })\n}", "async function getAllBooks(){\n let books = await Book.find({});\n let bookObjArray = [];\n if(books[0] !== undefined){\n for(let i=0; i<books.length; i++){ //For each result\n bookObj = new BookClass( //Convert to a book obj\n books[i]._id, books[i].authorForename, books[i].authorSurname,\n books[i].bookName, books[i].stockPrice, books[i].sellingPrice,\n books[i].stockAmount, books[i].synopsis, books[i].genres, books[i].image\n );\n bookObjArray.push(bookObj); //Then add to array\n }\n return bookObjArray;\n }else{return null;} //Return null if no results\n}", "getAllBooks(url = this.baseUrl) {\r\n return fetch(url).then(response => response.json())\r\n }", "function loadBooks() {\n API.getBooks()\n .then(res => {\n console.log(res.data)\n setBooks(res.data)\n })\n .catch(err => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res =>\n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res => {\n setBooks(res.data);\n // console.log(res);\n })\n .catch(err => console.log(err.response));\n }", "function booksInBookshelf(id) {\n// var db = ScriptDb.getMyDb();\n var dbShelf = ParseDb.getMyDb(applicationId, restApiKey, \"bookshelf\");\n var dbGen = ParseDb.getMyDb(applicationId, restApiKey, \"book_generic\");\n var books = []; \n var bookshelf = dbShelf.load(id);\n \n for (var i = 0 ; i < bookshelf.books.length ; i++) {\n books.push(dbGen.load(bookshelf.books[i]));\n }\n Logger.log(\"books queried\");\n return books;\n}", "function getBooks(request, response,next) {\n bookDb.get()\n .then(results => {\n if(results.length === 0){\n response.render('pages/searches/new');\n }else{\n response.render('pages/index', {books: results})\n }\n })\n .catch( next );\n}", "function getBooksData(searchTerm)\n{\n const settings = {\n url: BOOKS_SEARCH_URL,\n data: {\n q: `${searchTerm}`,\n maxResults: 6,\n startIndex: 0\n },\n dataType: 'json',\n type: 'GET',\n success: displayData\n };\n\n $.get(settings);\n}", "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function fetchBooks(url){\n return fetch(url)\n .then(resp => resp.json())\n}", "async getAllBooks(parent,args,ctx,info){\n return await ctx.db.query.books({\n where : {active:true}\n },`{\n id\n title\n author\n publisher {\n name\n discount\n }\n category{\n name\n }\n type {\n name\n }\n images {\n src\n }\n mrp\n sku\n }`);\n \n }", "getBooks(){\n fetch('/books').then(response=>{response.json().then(data=>{\n console.log(data)\n this.setState({foundBooks:data})\n })})\n }", "getBooksFromXmlResponse(xmlResponse, goodreadsUserId) {\n return new Promise((resolve, reject) => {\n xml2js.parseString(xmlResponse, (err, result) => {\n if (err) {\n console.log(`[goodreads][${goodreadsUserId}]: Error parsing XML`);\n reject(err);\n return;\n }\n const books = [];\n if (!result || !result.GoodreadsResponse) {\n console.log(\"Found no GoodreadsResponse in xml2js result.\");\n resolve(books);\n return;\n }\n const reviews = this.getXmlProperty(result.GoodreadsResponse, \"reviews\");\n if (!reviews || !reviews.review) {\n resolve(books);\n return;\n }\n for (let review of reviews.review) {\n const grBook = this.getXmlProperty(review, \"book\", null /* defaultValue */);\n const book = {\n title: this.getXmlProperty(grBook, \"title\"),\n isbn: this.getXmlProperty(grBook, \"isbn\"),\n isbn13: this.getXmlProperty(grBook, \"isbn13\"),\n goodreadsUrl: this.getXmlProperty(grBook, \"link\"),\n imageUrl: this.getXmlProperty(grBook, \"image_url\", null /* defaultValue */),\n author: this.getAuthorForBook(grBook),\n };\n book.imageUrl =\n this.maybeGetFallbackCoverUrl(book.imageUrl, book.isbn);\n books.push(book);\n }\n resolve(books);\n });\n });\n }", "function getBooks(callback){\n\n db.collection('books').find().toArray(function(err, data) {\n console.log(data)\n if(!err){\n console.log(err);\n\n data.forEach(function(element){\n booksIndex.push(element)\n });\n console.log('ICICICICICI')\n callback();\n } else {\n console.log(err)\n callback()\n }\n })\n}", "function getBooks() {\n let request = new XMLHttpRequest();\n request.open('GET', 'http://localhost:7000/books');\n request.addEventListener('load', function () {\n // responseText is a property of the request object\n // (that name was chosen for us)\n let response = JSON.parse(request.responseText);\n let books = response.books;\n let parent = document.querySelector('main ul');\n\n for (let i = 0; i < books.length; ) {\n let element = document.createElement('li');\n element.textContent = books[i].title;\n\n // append to parent\n parent.appendChild(element);\n }\n });\n request.send();\n}", "function getBookContent() {\n\tvar queryURL = 'https://www.googleapis.com/books/v1/volumes?q=' + searchTerm;\n\t$.ajax({\n\t\turl: queryURL,\n\t\tmethod: 'GET'\n\t}).then(function (response) {\n\t\tbookRating = response.items[0].volumeInfo.averageRating;\n\t\tvar bookPosterURL = response.items[0].volumeInfo.imageLinks.thumbnail;\n\t\tbookPoster = $('<img>');\n\t\tbookPoster.attr('src', bookPosterURL);\n\t\tbookTitle = response.items[0].volumeInfo.title;\n\t\tbookPlot = response.items[0].volumeInfo.description;\n\t\tsetContent();\n\t});\n}", "getBooks() {\n API.getBooks(this.state.q).then((result) => {\n const bookArry = [];\n result.data.forEach(book => {\n bookArry.push(book);\n });\n this.setState({ books: bookArry })\n console.log(bookArry);\n })\n }", "function getBooksInCategory(category) {\n// var db = ScriptDb.getMyDb();\n// var db_categories = ParseDb.getMyDb(applicationId, restApiKey, \"list_categories\");\n var db_gen = ParseDb.getMyDb(applicationId, restApiKey, \"book_generic\");\n \n var books = [];\n \n var query = db_gen.query({});\n while (query.hasNext()) {\n var book = query.next();\n if (category == \"\" || category == null || book.category == category) {\n books.push(book); \n }\n }\n \n return books;\n}", "function getBooks(books, callback) {\n if (Array.isArray(books)) {\n var arr = [];\n var i = -1;\n var len = books.length;\n var concatArr = [];\n\n if (typeof callback === 'function') {\n for (i = 0; i < len; i++) {\n arr.push(createArray(books[i]));\n if (arr.length > 0) {\n concatArr = concatArr.concat(arr[i]);\n }\n\n }\n }\n\n return concatArr;\n }\n }", "searchBook(search) {\n this.jsonLog('searchBook sending data', search);\n this.setState({waitingSearch: true});\n this.bookCtrl.searchBook(search, (err, resp) => {\n if (err) {this.error(err);}\n else {\n var searchResults = resp.items;\n this.log('searchBook with ' + search + ' response OK');\n this.log('items.length ' + resp.items.length);\n this.setState({\n searchResults: searchResults,\n waitingSearch: false\n });\n }\n });\n }", "function loadBooks(res) {\n console.log(res.data)\n setBooks(res.data.data)\n }", "getAllBooks() {\n return axios.get(`${url}/allBooks`);\n }", "function search(criteria) {\n\tif (criteria.isbn) { // by ISBN\n\t\treturn Book.findByISBN(criteria.isbn);\n\t} else if (criteria.title) { // by title\n\t\treturn Book.findByTitle(criteria.title);\n\t} else if (criteria.course) { // by course\n\t\treturn Book.findByCourse(criteria.course);\n\t} else {\n\t\treturn Promise.resolve();\n\t}\n}", "queryBooks(query) {\n fetch('https://www.googleapis.com/books/v1/volumes?q='+ query).then((response)=>{\n response.json().then((data)=>{\n this.setState({\n // googleBooks: data.items[0].volumeInfo\n googleBooks: data.items\n })\n\n console.log(this.state.googleBooks);\n\n })\n }).catch((error)=>console.log(error))\n }", "function getAuthorListJSON(author, eventCallback) {\r\n\r\n\tvar book_details={};\r\n\tvar rank_count = 1;\r\n\tauthorencode = author.replace(' ','+');\r\n\r\n\trequest.get({\r\n\t\turl: \"https://www.googleapis.com/books/v1/volumes?q=\" + authorencode +\"&orderBy=relevance&key=APIKEY\"\r\n\t\t}, function(err, response, body) {\r\n\r\n\t\t\tvar list_of_books = [];\r\n\t\t\tvar list_of_titles = [];\r\n\r\n\t\t\tif (body){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tbody = JSON.parse(body);\r\n\t\t\t\t}catch(e){\r\n\t\t\t\t\tvar list_of_books = [];\r\n\t\t\t\t\teventCallback(list_of_books);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\r\n\t\t\tif (body.totalItems === 0){\r\n\t\t\t\tstringify(list_of_books);\r\n\t\t\t\teventCallback(list_of_books);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tfor (var i = 0,length = body.items.length; i < length; i++ ) {\r\n\r\n\t\t\t\tvar book_details={};\r\n\r\n\t\t\t\tvar title = body.items[i].volumeInfo.title;\r\n\t\t\t\tbook_details.title = title;\r\n\t\t\t\tbook_details.titleupper = title.toUpperCase();\r\n\t\t\t\tconsole.log(book_details.title);\r\n\t\t\t\t\r\n\t\t\t\tif (list_of_titles.indexOf(body.items[i].volumeInfo.title)> 0) { \t\t\t\t\r\n\t\t\t\t\tcontinue; \r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (typeof body.items[i].volumeInfo.authors=== 'undefined') { \t\t\t\t\r\n\t\t\t\t\tcontinue; \r\n\t\t\t\t}\r\n\r\n\t\t\t\tlist_of_titles[i] = body.items[i].volumeInfo.title;\r\n\r\n\t\t\t\tvar author_string = \"\"; \r\n\t\t\t\tvar author_array = body.items[i].volumeInfo.authors;\r\n\t\t\t\tvar author_array_upper = [];\r\n\r\n\t\t\t\tfor (var a = 0, alength = author_array.length; a < alength; a++){\r\n\t\t\t\t\tauthor_array_upper[a] = author_array[a].toUpperCase();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (author_array_upper.indexOf(author.toUpperCase())< 0) { \r\n\t\t\t\t\t//console.log(\"Excluded: \" + book_details.title);\t\t\t\t\t\r\n\t\t\t\t\tcontinue; \r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor (var k = 0, klength = author_array.length; k < klength; k++){\r\n\t\t\t\t\tauthor_string = author_string + author_array[k] + \" and \" ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tauthor_string = author_string.slice(0, -5);\r\n\t\t\t\tbook_details.author = author_string;\t\t\t\t\r\n\t\t\t\tbook_details.contributor = \"by \" + author_string;\r\n\r\n\r\n\t\t\t\tbook_details.author = author_string;\t\t\t\t\r\n\t\t\t\tbook_details.contributor = \"by \" + author_string;\r\n\t\t\t\t\r\n\t\t\t\tbook_details.rank = rank_count;\r\n\t\t\t\trank_count++;\r\n\r\n\t\t\t\tvar isbns_string = \"\";\r\n\t\t\t\tvar isbns_array = body.items[i].volumeInfo.industryIdentifiers;\r\n\r\n\t\t\t\tfor (var j = 0, jlength = isbns_array.length; j < jlength; j++){\r\n\t\t\t\t\tif (isbns_array[j].type === 'ISBN_10'){\r\n\t\t\t\t\t\tbook_details.primary_isbn10 = isbns_array[j].identifier;\r\n\t\t\t\t\t\tisbns_string = isbns_string + isbns_array[j].identifier + ',';\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbook_details.primary_isbn13 = isbns_array[j].identifier;\r\n\t\t\t\t\t\tisbns_string = isbns_string + isbns_array[j].identifier + ',';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tisbns_string = isbns_string.slice(0, -1);\r\n\r\n\t\t\t\tbook_details.isbns_string = isbns_string;\r\n\r\n\t\t\t\tbook_details.contributor_alt = \"\";\r\n\r\n\t\t\t\tif (typeof body.items[i].volumeInfo.publishedDate !== 'undefined') { \r\n\t\t\t\t\t//published_date = body.items[i].volumeInfo.publishedDate;\r\n\t\t\t\t\tvar published_date = new Date(body.items[i].volumeInfo.publishedDate);\r\n\t\t\t\t\tvar date_string = monthNames[published_date.getMonth()] + \" \" + published_date.getFullYear();\r\n\t\t\t\t\tbook_details.contributor_alt = \"published in \" + date_string;\r\n\t\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\t\tvar description = \". No description available.\";\r\n\t\t\t\t\r\n\t\t\t\tif (typeof(body.items[i].searchInfo) !=='undefined'){\r\n\t\t\t\t\tif (typeof(body.items[i].searchInfo.textSnippet) !=='undefined'){\r\n\t\t\t\t\t\tdescription = \". Here's a brief description of the book, \" + body.items[i].searchInfo.textSnippet;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbook_details.description = book_details.title + description;\r\n\t\t\t\t\r\n\r\n\t\t\t\tlist_of_books[i] = book_details;\r\n\t\t\t}\r\n\r\n\t\t\tlist_of_books = list_of_books.filter(function(n){ return n != undefined }); \r\n\t\t\tstringify(list_of_books);\r\n\t\t\t//console.log(list_of_books);\r\n\r\n\t\t\teventCallback(list_of_books);\r\n\t\t}).on('err', function (e) {\r\n console.log(\"Got error: \", e);\r\n });\r\n\r\n}", "findBook(searchBook) {\n return this.state.books.find(book => book.id === searchBook.id);\n }", "function httpGetAllBooks(req, res) {\n if (isBooksEmpty()) return res.status(400).json({\n error: 'There are currently no books'\n })\n\n const books = getBooks()\n return res.status(200).json(books)\n}", "static getBooks() {\n\t\tlet books;\n\t\tif (localStorage.getItem(\"books\") === null) {\n\t\t\tbooks = [];\n\t\t} else {\n\t\t\tbooks = JSON.parse(localStorage.getItem(\"books\"));\n\t\t}\n\t\treturn books;\n\t}", "function searchBooksByAuthor (books, input) {\n // array to hold books found\n const result = []\n\n // loop through books\n for(let i = 0; i < books.length; i++) {\n // in case it finds a match on authors and author entered by the user\n if((books[i].authors).toUpperCase().includes(input.toUpperCase())) {\n // adds book to books array\n result.push(books[i]);\n }\n }\n // in case there's no match\n if (result.length === 0)\n console.log(\"No results. Please type author again or search for title.\");\n\n return result\n}", "async function getBooksPlease(){\n const userInput =document.querySelector(\".entry\").value;\n apiUrl = `https://www.googleapis.com/books/v1/volumes?q=${userInput}`;\n const fetchBooks = await fetch(`${apiUrl}`);\n const jsonBooks = await fetchBooks.json();\n contentContainer.innerHTML= \"\";\n //console.log(jsonBooks)\n \n for (const book of jsonBooks.items) {\n const bookcontainer =document.createElement(\"div\");\n bookcontainer.className = \"book-card\"\n const bookTitle =document.createElement(\"h3\");\n const bookImage =document.createElement(\"img\");\n const bookAuthor =document.createElement(\"h3\");\n bookAuthor.innerHTML = book.volumeInfo.authors[0]\n bookTitle.innerText = book.volumeInfo.title\n bookImage.src = book.volumeInfo.imageLinks.thumbnail\n bookcontainer.append(bookImage, bookTitle, bookAuthor)\n contentContainer.append(bookcontainer)\n \n }\n}", "static async fetchAllBookings() {\n return api.get('/booking').then((response) => {\n return response.data.map((b) => new Booking(b));\n });\n }", "async getBooksToRead(goodreadsUserId) {\n console.log(`[goodreads][${goodreadsUserId}]: Requesting books on \"to-read\" shelf.`);\n let books = [];\n let pageIndex = 1;\n // Max out requesting 10 pages.\n /* eslint-disable no-await-in-loop */\n while (pageIndex < MAX_GOODREADS_PAGES) {\n const booksForPage =\n await this.getBooksToReadForPage(goodreadsUserId, pageIndex, BOOKS_PER_PAGE);\n if (booksForPage.length === 0) {\n // Reached the end, have all results.\n break;\n }\n books = books.concat(booksForPage);\n console.log(`[goodreads][${goodreadsUserId}]: Found ${books.length} books so far...`);\n pageIndex++;\n }\n /* eslint-enable no-await-in-loop */\n console.log(`[goodreads][${goodreadsUserId}]: Found ${books.length} books on the \"to-read\" shelf.`);\n return books;\n }", "function getBookstores(geocoderSearchResult) {\n\n return new Promise(function(resolve, reject) {\n if (geocoderSearchResult.geometry.location) {\n map.setCenter(geocoderSearchResult.geometry.location);\n // Create a list and display all the results.\n var cll = geocoderSearchResult.geometry.location.lat() + \",\" + geocoderSearchResult.geometry.location.lng();\n var foursquareQuery = \"https://api.foursquare.com/v2/venues/explore?client_id=F0XYIB113FEQQVQFFK5DGZ4V5PJBZA2DRNAXHFUW1G3UBE3N&client_secret=ZYY5PZ15D02DLZ0D3RGBADODPBC1KMKX4ZIQ4XNDNLUKBKEB&v=20140701&ll=\" + cll + \"&radius=1000&query=books&venuePhotos=1&limit=50\";\n getBooksRequest = new XMLHttpRequest();\n if (!getBooksRequest) {\n alert('Giving up getBookstores:( Cannot create an XMLHTTP instance');\n return false;\n }\n getBooksRequest.open('GET', foursquareQuery);\n getBooksRequest.responseType = 'text';\n getBooksRequest.onload = function() {\n if (getBooksRequest.status === 200) {\n resolve(getBooksRequest.response);\n } else {\n reject(Error('Request did not load successfully' + getBooksRequest.statusText));\n }\n\n };\n getBooksRequest.onerror = function() {\n reject(Error('There was a network error'));\n };\n\n getBooksRequest.send();\n } // if ends\n });\n}", "function scrapeBrewerySearchBA(html) {\n return new Promise((resolve, reject) => {\n var breweryObjs = [];\n if (html !== undefined) {\n var $ = cheerio.load(html);\n \n // One beer listing\n var li = $('#ba-content ul li').eq(0);\n\n // Brewery details\n var brewery = li.children('a').eq(0),\n brewery_name = brewery.text(),\n brewery_url = brewery.attr('href'),\n brewery_location = brewery.find('span').text();\n\n // Data to return\n var data = {\n name: brewery_name,\n brewery_location: brewery_location,\n brewery_url: brewery_url\n };\n\n // Add to beer array\n breweryObjs.push(data);\n }\n \n resolve(breweryObjs); \n\n });\n}", "function createSearch(request, response) {\n let url = \"https://www.googleapis.com/books/v1/volumes?q=\";\n\n console.log(request.body);\n console.log(request.body.search);\n\n if (request.body.search[1] === \"title\") {\n url += `+intitle:${request.body.search[0]}`;\n }\n if (request.body.search[1] === \"author\") {\n url += `+inauthor:${request.body.search[0]}`;\n }\n\n // WARNING: won't work as is. Why not?\n // superagent.get(url)\n // .then(apiResponse => console.log(util.inspect(apiResponse.body.items, {showhidden: false, depth: null})))\n // .then(results => response.render('pages/searches/show', {searchResults: results})\n // )}\n superagent\n .get(url)\n .then(apiResponse =>\n apiResponse.body.items.map(bookResult => new Book(bookResult.volumeInfo))\n )\n .then(results =>\n response.render(\"pages/searches/show\", { searchResults: results })\n );\n}", "function searchBooks () {\n var dataStr = $( '#searchData' ).prop( 'value' );\n dataStr = dataStr.replace( / /g, '+' );\n\n $.ajax( {\n type: 'GET',\n url: 'https://openlibrary.org/search.json?q=' + dataStr,\n dataType: 'json',\n success: function ( data ) {\n \n if ( data.num_found > 0 ) {\n var dataList = data.docs;\n \n for ( var i = 0; ( i < dataList.length ) && ( i < 200 ); i++ ) {\n var itemNode = $( '<div class=\"searchItem\"></div>' );\n\n itemNode.click( { olidList: dataList[i].edition_key },\n searchBookOLIDs );\n\n if ( dataList[i].cover_i ) {\n var imgStr = '<img src=\"https://covers.openlibrary.org/b/id/';\n itemNode.append( imgStr + dataList[i].cover_i + '-S.jpg\">' );\n }\n\n itemNode.append( '<div><h1></h1><p></p></div>' );\n\n if ( dataList[i].title_suggest ) {\n itemNode.children( 'div' ).children( 'h1' )\n .append( dataList[i].title_suggest );\n }\n\n if ( dataList[i].author_name ) {\n itemNode.children( 'div' ).children( 'h1' )\n .append( ', by ' + dataList[i].author_name.join( ', ' ) );\n }\n\n if ( dataList[i].edition_key.length > 1 ) {\n itemNode.children( 'div' ).children( 'p' )\n .append( dataList[i].edition_key.length +\n ' editions. Click to view.' );\n } else {\n itemNode.children( 'div' ).children( 'p' )\n .append( dataList[i].edition_key.length +\n ' edition. Click to view.' );\n }\n\n $( '#mCSB_3_container' ).append(itemNode);\n }\n } else {\n var itemNode = $( '<h1 style=\"font-size:1em;\">No results found</h1>' );\n $( '#mCSB_3_container' ).append(itemNode);\n }\n },\n } );\n}", "fetchBooks ({ commit }, queryObj) {\n const query = queryGenerator(queryObj)\n return this.$axios\n .$get('/book?' + query)\n .then(\n (res) => {\n commit('SETBOOKS', res.book)\n },\n (err) => {\n // eslint-disable-next-line no-console\n console.log(err)\n }\n )\n }", "mergedResult(books, shelvedBooks) {\n return books.map(book => shelvedBooks.find(s => s.id === book.id) || book)\n }", "function getSimilarBooksJSON(related_items,eventCallback) {\r\n\r\n\tvar list_of_books = [];\r\n\tvar list_of_titles = [];\r\n\tvar rank_count = 1;\r\n\tvar completed_requests = 0;\r\n\tvar getlength = related_items.length\r\n\r\n\tif (related_items.length > 5){\r\n\t\tgetlength = 5;\r\n\t}\r\n\r\n\tfor (var i = 0,length = getlength; i < length; i++ ) {\r\n\t\r\n\t\trequest.get({\r\n\t\t\turl: \"https://www.googleapis.com/books/v1/volumes?q=\" + related_items[i].ASIN +\"&orderBy=relevance&key=APIKEY\"\r\n\t\t\t}, function(err, response, body) {\r\n\t\t\t\t\r\n\r\n\t\t\tif (body){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tbody = JSON.parse(body);\r\n\t\t\t\t}catch(e){\r\n\t\t\t\t\tvar empty_array = [];\r\n\t\t\t\t\teventCallback(empty_array);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\r\n\t\t\t\t//console.log(body)\r\n\t\t\t\tcompleted_requests++;\r\n\t\t\t\tvar book_details={};\r\n\t\t\t\tvar title;\r\n\r\n\t\t\t\ttitle = body.items[0].volumeInfo.title ;\r\n\t\t\t\tif (list_of_titles.indexOf(title)> 0) { \t\t\t\t\r\n\t\t\t\t\treturn; \r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (typeof body.items[0].volumeInfo.authors=== 'undefined') { \t\t\t\t\r\n\t\t\t\t\treturn; \r\n\t\t\t\t}\r\n\r\n\t\t\t\tlist_of_titles[i] = title;\r\n\t\t\t\tbook_details.title = title;\t\r\n\t\t\t\tbook_details.titleupper = title.toUpperCase();\r\n\r\n\t\t\t\tvar author_string = \"\"; \r\n\t\t\t\tvar author_array = body.items[0].volumeInfo.authors;\r\n\t\t\t\t\r\n\t\t\t\tfor (var k = 0, klength = author_array.length; k < klength; k++){\r\n\t\t\t\t\tauthor_string = author_string + author_array[k] + \" and \" ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tauthor_string = author_string.slice(0, -5);\r\n\t\t\t\tbook_details.author = author_string;\t\t\t\t\r\n\t\t\t\tbook_details.contributor = \"by \" + author_string;\r\n\r\n\t\t\t\tvar isbns_string = \"\";\r\n\t\t\t\tvar isbns_array = body.items[0].volumeInfo.industryIdentifiers;\r\n\r\n\t\t\t\tfor (var j = 0, jlength = isbns_array.length; j < jlength; j++){\r\n\t\t\t\t\tif (isbns_array[j].type === 'ISBN_10'){\r\n\t\t\t\t\t\tbook_details.primary_isbn10 = isbns_array[j].identifier;\r\n\t\t\t\t\t\tisbns_string = isbns_string + isbns_array[j].identifier + ',';\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbook_details.primary_isbn13 = isbns_array[j].identifier;\r\n\t\t\t\t\t\tisbns_string = isbns_string + isbns_array[j].identifier + ',';\r\n\t\t\t\t\t}\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tisbns_string = isbns_string.slice(0, -1);\r\n\t\t\t\tbook_details.isbns_string = isbns_string;\r\n\r\n\t\t\t\tvar description = \". No description available.\";\r\n\t\t\t\t\t\t\r\n\t\t\t\tif (typeof(body.items[0].searchInfo) !=='undefined'){\r\n\t\t\t\t\tif (typeof(body.items[0].searchInfo.textSnippet) !=='undefined'){\r\n\t\t\t\t\t\tdescription = \". Here's a brief description of the book, \" + body.items[0].searchInfo.textSnippet;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbook_details.description = book_details.title + description;\r\n\r\n\t\t\t\tbook_details.description = book_details.title + \", \" + book_details.contributor + description;\r\n\t\t\t\t\t\r\n\r\n\t\t\t\tbook_details.rank = rank_count;\r\n\t\t\t\tlist_of_books[rank_count-1] = book_details;\r\n\t\t\t\trank_count++;\r\n\r\n\t\t\t\tconsole.log(\"book details title:\" + book_details.title);\r\n\t\t\t\tconsole.log(\"list of books count:\" + list_of_books.length);\r\n\r\n\t\t\t\tconsole.log(completed_requests);\r\n\t\t\t\tconsole.log(getlength);\r\n\t\t\t\t\tif (completed_requests === getlength) {\r\n\t\t\t\t\t\t// All download done, process responses array\r\n\t\t\t\t\t\tstringify(list_of_books);\r\n\r\n\t\t\t\t\t\teventCallback(list_of_books);\r\n\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}).on('err', function (e) {\r\n \tconsole.log(\"Got error: \", e);}\r\n\t\t\r\n\t\t\r\n\t\t);\r\n\t}\r\n\r\n}", "function findBook(){\n\t//get book from input\n let book = getBook();\n //send request to url\n let urlLink = createURL(book);\n sendRequest(urlLink);\n}", "getbooks() {\n let books;\n if (!localStorage.getItem(\"books\")) {\n books = [];\n } else {\n books = JSON.parse(localStorage.getItem(\"books\"));\n }\n\n return books;\n }", "addBook (req, res) {\n console.log(req.body)\n // get parameter values sent from front end\n var title = req.body.title,\n author = req.body.author,\n // encode user input for inclusion within URL\n encodedTitle = encodeURIComponent(title),\n encodedAuthor = encodeURIComponent(author),\n // get book details from API\n url = `https://www.googleapis.com/books/v1/volumes?q=intitle:${encodedTitle}+inauthor:${encodedAuthor}&maxResults=1`\n // get JSON data to fill in specific book data\n fetch(url).then(response => response.json())\n .then(data => {\n // only one result is returned to reduce data load, but it still is returned as an Array\n var bookInfo = data.items[0]\n // include data retrieved from JSON API in book fields\n var key = booksRef.push({\n title: title,\n author: author,\n year: bookInfo.volumeInfo.publishedDate.split('-')[0],\n description: bookInfo.volumeInfo.description,\n url: makeURLSecure(bookInfo.volumeInfo.infoLink),\n imgUrl: makeURLSecure(bookInfo.volumeInfo.imageLinks.thumbnail)\n })\n // must send some response back\n res.send(key)\n res.end()\n })\n .catch(error => console.log(error))\n }", "function loadSearchedBooks(searchTerm){\n var b = firebase.firestore().collection('books')\n console.log(b.doc)\n \n firebase.firestore().collection('books')\n .where('status','==',\"available\")\n .get()\n .then(function(querySnapshot){\n var resultingHTML = `\n <div class=\"row buydiv\">\n \n <div id=\"searchbar\">\n <div id=\"searchbar\">\n <input type=\"search\" id=\"mySearch\" name=\"q\"\n placeholder=\"Search for books..\" size=\"28\">\n <button onclick=\"loadSearchedBooks('mySearch')\">Search</button>\n </div>\n \n </br>\n </div>`\n querySnapshot.forEach(function(doc){\n var data = doc.data()\n var status= data.status\n console.log(searchTerm)\n if(data.title.includes(searchTerm)){ \n if (status == \"in_progress\"){\n var status= \"In Progress\";\n console.log(status);\n }\n for(var c in pictureshash){\n if (c== data.title){\n var imgsrc= pictureshash[c][0];\n console.log(imgsrc);\n \n }\n }\n resultingHTML += `<div class=\"row buydiv\">\n <div class=\"media tm-flexbox-ie-fix tm-width-ie-fix book\">\n <div class=\"tm-media-img-container\">\n <div class=\"text-center pt-31 pb-31 tm-timeline-date tm-bg-green\">${status}</div>\n <img class=\"d-flex img-fluid\" src=\"${imgsrc}\">\n </div>\n \n <div class=\"media-body tm-flexbox-ie-fix tm-width-ie-fix tm-bg-light-gray\">\n <div class=\"p-5\">\n <h1 class=\"mb-4 mt-0 tm-timeline-item-title\">Book Title: ${data.title}</h1>\n <h2 class=\"mb-4\">Seller Email: <p id=\"selleremail\">${data.seller}</p></h2>\n <h2 class=\"mb-4\">Course Name: ${data.course}</h2>\n <h2 class=\"mb-4\">Price: $${data.price}</h2>\n <h2 class=\"mb-4\">Condition: ${data.condition}</h2>\n \n </div>\n </div>\n <h2></h2>\n <a class=\"btn btn-primary tm-button-rounded tm-button-no-border tm-button-normal tm-button-timeline\" onclick=\"email()\">Buy Book</a> \n \n </div>\n </div> <!-- row -->`\n }\n /*\n This is where you would create an HTML element for a card \n Each loop creates a new element\n Equivalent to the \"resultingHTML\" tag in Jeff's app\n */\n })\n document.getElementById('results_html').innerHTML = resultingHTML\n\n })\n}", "function fetchBooks() {\n const allBooks = fetch('/book-list').then(response => response.json());\n const loginStatus = fetch('/login-status').then(response => response.json());\n const userBooks = loginStatus.then((loginStatus) => {\n if (loginStatus.isLoggedIn) {\n return fetch(`/user-book?user=${loginStatus.username}`)\n .then(response => response.json())\n .then((userBookList) => {\n const userBookMap = {};\n userBookList.forEach((userBook) => {\n userBookMap[userBook.bookId] = userBook;\n });\n return userBookMap;\n });\n } else {\n return {};\n }\n });\n\n Promise.all([allBooks, userBooks, loginStatus])\n .then(response => {\n const [allBooks, userBooks, loginStatus] = response;\n const bookContainer = document.getElementById('book-container');\n if (allBooks.length === 0) {\n bookContainer.innerHTML = '<p>There are no books yet.</p>';\n return;\n }\n bookContainer.innerHTML = '';\n\n allBooks.forEach((book) => {\n const bookDiv = buildBookDiv(book);\n const userBook = userBooks[book.id] || {bookId: book.id};\n const addToShelfDiv = buildAddToShelfDiv(userBook, loginStatus);\n\n bookDiv.appendChild(addToShelfDiv);\n bookContainer.appendChild(bookDiv);\n return bookDiv;\n });\n\n window.onclick = (event) => {\n if (!event.target.matches('.add-to-shelf-button')) {\n const dropdowns = document.getElementsByClassName(\"dropdown\");\n for (const dropdown of dropdowns) {\n dropdown.classList.add('hidden');\n }\n }\n }\n });\n}", "static getBooks() {\n let books;\n if (localStorage.getItem('books') === null) {\n books = [];\n } else {\n books = JSON.parse(localStorage.getItem('books'));\n }\n return books;\n }", "static getBooks() {\n let books;\n if (localStorage.getItem(\"books\") === null) {\n books = [];\n } else {\n books = JSON.parse(localStorage.getItem(\"books\"));\n }\n return books;\n }", "function getBook(title) {\n var book = null;\n var url = 'https://www.goodreads.com/book/title.xml?key=' + key + '&title=' + title;\n\n request(url, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n xml2js(body, function (error, result) {\n if (!error) {\n // Extract just the fields that we want to work with. This minimizes the session footprint and makes it easier to debug.\n var b = result.GoodreadsResponse.book[0];\n book = { id: b.id, title: b.title, ratings_count: b.ratings_count, average_rating: b.average_rating, authors: b.authors };\n }\n else {\n book = { error: error };\n }\n });\n }\n else {\n book = { error: error };\n }\n });\n\n // Wait until we have a result from the async call.\n deasync.loopWhile(function() { return !book; });\n\n return book;\n}", "function searchGoogleBooks(query) {\n API.search(query)\n .then(res => setResults(res.data.items))\n .catch(err => console.log(err));\n }", "function getBookChapterList(bookId) {\n db.get(bookId).then(function(doc) {\n createChaptersList(doc.chapters.length);\n }).catch(function(err) {\n console.log('Error: While retrieving document. ' + err);\n });\n\n}", "static getBooks(){\n let books;\n\n // check for books not stored in local storage? \n // create empty books : add those books to books\n if(localStorage.getItem('books') === null){\n books = [];\n }else{\n books = JSON.parse(localStorage.getItem('books'));\n }\n return books;\n }", "static getBooks() {\n let books;\n if (localStorage.getItem('books') === null) {\n books = [];\n } else {\n books = JSON.parse(localStorage.getItem('books'));\n }\n\n return books;\n }" ]
[ "0.75175136", "0.7494004", "0.7488836", "0.73757017", "0.7338291", "0.72797626", "0.7185815", "0.7152663", "0.7123591", "0.7060718", "0.69794357", "0.6972407", "0.695269", "0.69059235", "0.6902264", "0.68974143", "0.68718773", "0.68557054", "0.6849961", "0.68407655", "0.6790868", "0.67846566", "0.6770188", "0.6763992", "0.6742942", "0.6720458", "0.665543", "0.6646837", "0.66423523", "0.66335976", "0.6612256", "0.6546204", "0.6533003", "0.6527765", "0.6522821", "0.6521725", "0.651649", "0.651108", "0.64934963", "0.64916104", "0.64916104", "0.64873827", "0.64839464", "0.6481102", "0.6450773", "0.64481884", "0.643935", "0.643903", "0.6436057", "0.6435568", "0.6435521", "0.6427185", "0.6424013", "0.64064986", "0.63978535", "0.6397757", "0.6390709", "0.6370162", "0.6366901", "0.63647085", "0.6342232", "0.63259774", "0.6277153", "0.62678784", "0.6261419", "0.6249366", "0.6231774", "0.62287045", "0.6209969", "0.6207605", "0.61973834", "0.6191854", "0.6182844", "0.6170373", "0.6170084", "0.61320585", "0.61287063", "0.61261773", "0.6109613", "0.61064696", "0.6104651", "0.6102985", "0.6095047", "0.609477", "0.60841066", "0.6081056", "0.6069196", "0.6063875", "0.6057478", "0.60447985", "0.60427016", "0.6033613", "0.6033509", "0.60279256", "0.60268277", "0.6022649", "0.6014676", "0.6004787", "0.59999204", "0.5991825" ]
0.70438933
10
}); checks if the checkbox is checked
function checkUser(user) { user.checked = !user.checked; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verificaCheckboxes(checkbox){\n\treturn checkbox == true;\n}", "function checkboxChecked(input) {\n if (input.checked){\n return true;\n } return false;\n}", "function isChecked($chkbx) {\n return $chkbx.is(':checked');\n}", "function checkRegisterForActivities() {\n\n const checkBoxes = $(\"input[type='checkbox']\");\n\n let isABoxChecked = false;\n\n $.each(checkBoxes, function (index, checkbox) {\n if(checkbox.checked) {\n\n isABoxChecked = true;\n\n } else {\n\n $(\"p#select-activity\").show().text(\"Must check one box before submitting\");\n }\n });\n\n if(isABoxChecked) {\n $(\"p#select-activity\").hide();\n return true;\n } else {\n\n return false;\n\n }\n\n\n}", "function checkboxChecked(){\n if ($('input[type=checkbox]', this).is(':checked')) { \n $(this).addClass('checked');\n } else {\n $(this).removeClass('checked');\n }\n }", "function checkTerms(e) {\n //If someone clicked on the checkbox, it will return true. \n\tif (check.checked == true) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n} //End CheckTerms //", "function validateCheck() {\n\t\tif ($('input[type=checkbox]:checked').length <= 0) {\n\t\t\t$('#alert_check').text('Please select atleast one interest ');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_check').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function checkBox(){\n if($(\"action\" && \"sci-fi\").checked){\n genreValue = $(\"action\" && \"sci-fi\").value;\n \n \n }\n }", "function ui_isChecked(id_ckbox){\n\tvar _ckbox = ui_getObjById(id_ckbox);\n\tif (_ckbox.checked){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n\n}", "function checkChecked(){\n let checked = false;\n activities.each(function(index,e){\n if($(e).is(\":checked\")){\n checked = true;\n }\n });\n if(checked){\n $(\".cbox-warn\").hide();\n }else{\n $(\".cbox-warn\").show();\n }\n return checked;\n}", "function checkBox(checkbox){\r\n\t\tcheckbox.checked=true;\r\n\t\ttriggerEvent(checkbox);\r\n}", "function tarkistaLeima(checkbox) {\n if (checkbox.checked) {\n return true;\n } else {\n return false;\n }\n }", "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\n\t\t\t\tif($(this).hasClass(\"stab\")){\n\t\t\t\t\tself.generateExploreResults(false);\n\t\t\t\t}\n\t\t\t}", "function reactToCheckbox() {\n\tif(student.checked) {\n\t \t$(\"#student_info\").removeClass(\"hidden\").hide().slideDown();\n\t \tdocument.getElementById(\"schoolname\").required = true;\n\t document.getElementById(\"grade\").required = true;\n\t}\n\telse {\n\t\t$(\"#student_info\").slideUp();\n\t\tdocument.getElementById(\"schoolname\").required = false;\n\t document.getElementById(\"grade\").required = false;\n\t}\n}", "function OptionCheck() {\n $('.tree-form').submit(function(event) {\n /* Act on the event */\n event.preventDefault();\n if ($('input[type=checkbox]:checked').length > 0 === false) {\n $('.ActivityError').removeClass('is-hidden')\n } else if ($('input[type=checkbox]:checked').length > 0 === true) {\n $('.ActivityError').addClass('is-hidden')\n }\n });\n\n }", "function checked() {\r\n var cbx = popup.find(\"#markallrecipients\");\r\n return cbx.prop('checked');\r\n }", "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\t\t\t\t$(this).trigger(\"change\");\n\t\t\t}", "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\t\t\t\t$(this).trigger(\"change\");\n\t\t\t}", "isChecked() {\n return this.hasAnyAttribute('checked');\n }", "function checkClicked() {\n \n}", "function verificaReprovacaoDistribuicao(box){\n if(box.checked){\n show_distribuicao = true;\n show_repetencia = false;\n $('#ckb_reprovacao').prop('checked', false);\n $('#ckb_distribuicao').prop('checked', true);\n showDistribuicaoReprovacao();\n showLegendasRepetencia(false);\n showLegendasDesempenho(false);\n mostrarAgrupamento(false);\n }else{\n mostrarAgrupamento(true);\n show_distribuicao = false;\n show_repetencia();\n\n }\n atualizarCheckBox(); \n}", "function CheckboxFunction() {\n var checkBox = document.getElementById(\"checkActive\");\n \n if (checkBox.checked == true) {\n //Model.SelectedListItem.Active=true;\n\n console.log(checkBox.checked);\n } else {\n // Model.SelectedListItem.Active=false;\n }\n \n}", "function CheckboxSelect(position){\n var check = position.checked ;\n console.log(position);\n if(check == true){\n position.value = \"Yes\";\n }else{\n position.value = \"No\";\n }\n}", "function checkSelected() {\n\t\tvar all = $(\"input.select-all\")[0];\n\t\tvar total = $(\"input.select-item\").length;\n\t\tvar len = $(\"input.select-item:checked:checked\").length;\n\t\tconsole.log(\"total:\"+total);\n\t\tconsole.log(\"len:\"+len);\n\t\tall.checked = len===total;\n\t}", "function addCheckBoxListener(){\n\n $(\"input:checkbox\").on('click', function() {\n\n var $box = $(this);\n if ($box.is(\":checked\") ) {\n\n var group = \"input:checkbox[name='\" + $box.attr(\"name\") + \"']\";\n\n if($box.attr(\"name\") != 'topping'){\n $(group).prop(\"checked\", false);\n }\n $box.prop(\"checked\", true);\n \n } else {\n $box.prop(\"checked\", false);\n }\n updatePrice();\n });\n\n}", "function is_checked(id) {\n\treturn $(\"#\" + id).is(\":checked\");\n}", "function inspectBox()\n{\n if (oCheckbox.checked)\n {\n alert(\"The box is checked.\");\n } else {\n alert(\"The box is not checked at the moment.\");\n }\n}", "function fCheckBox(e)\n\t{\n\t\tvar id = e.target.id;\n\t\tvar checked = document.getElementById(id).checked;\n\t\tif (checked == true)\n\t\t{\n\t\t\t// item was checked. save new site assignment for this user\n\t\t\taddMarkerCluster(id);\n\t\t\t//alert(\"Checkbox #id=\"+id+\" was clicked and checked.\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// item was unchecked. remove this site assignment for this user\n\t\t\tmarkerClusterArr[id].clearMarkers();\n\t\t\t//alert(\"Checkbox #id=\"+id+\" was clicked and unchecked.\");\n\t\t}\n\t}", "function editInsuranceAccepted () {\n var vehicleClassIndependentDriver = document.getElementById('taxi_driver_office_profile_vehicle_vehicleClass');\n var checkboxInsuranceAccepted = document.getElementById('taxi_driver_office_profile_insuranceAccepted');\n\n $(vehicleClassIndependentDriver).change( function(){\n var vehicleClassVal = $(this).val();\n\n if ( vehicleClassVal <= 0) {\n $(checkboxInsuranceAccepted).removeAttr('checked');\n // $(checkboxInsuranceAccepted).attr('checked',false);\n // alert('Мало');\n } else {\n // $(checkboxInsuranceAccepted).attr('checked', 'checked');\n $(checkboxInsuranceAccepted).attr('checked', true);\n // alert('Норм');\n }\n return true;\n });\n \n }", "function isAllEntered() {\n var chekboxes = document.getElementsByName('source');\n var ch = false;\n for (var i = 0, length = chekboxes.length; i < length; i++) {\n if (chekboxes[i].checked) {\n ch = true;\n break;\n }\n }\n if (!ch) {\n document.getElementById('checkMandatory').style.color = \"red\";\n document.getElementById('checkMandatory').style.display = \"block\";\n }\n return ch;\n}", "function validateCheckbox(){\n\t\t\tvar checkboxes = document.getElementsByName('InvisibleCompany');\n\t\t\tvar selected = \"\";\n\t\t\tfor (var i=0; i<checkboxes.length; i++) {\n\t\t\t if (checkboxes[i].checked) {\n\t\t\t \t//find a radio (checkbox) that is checked by the user\n\t\t\t SendChangeVisibleCompany(checkboxes[i].value);\n\t\t\t return;\n\t\t\t }\n\t\t\t}\n\t\t\talert(\"no stocks selected\");\n\t\t\t\n\t\t}", "function onCheckboxClick( input ) {\n var assignmentTaskId = parseInt($(input).attr('data-assignment-task'));\n var studentId = parseInt($(input).attr('data-student'));\n\n var checked = false;\n if( $(input).is(':checked') )\n checked = true;\n\n socket.emit(\"studentAssignmentTaskEvent\", {\n \"studentId\": studentId,\n \"assignmentTaskId\": assignmentTaskId,\n \"eventType\": \"finishedTask\",\n \"name\": assignmentTaskId,\n \"data\": checked\n });\n\n if($(\"input[type='checkbox']:checked\").length == $(\"input[type='checkbox']\").length ) {\n $(\"#assignmentCompleteId\").removeClass('uk-hidden');\n }\n else {\n $(\"#assignmentCompleteId\").addClass('uk-hidden');\n }\n}", "function ui_setChecked(id_ckbox){\n\tvar _ckbox = ui_getObjById(id_ckbox);\n\t_ckbox.checked = true;\n}", "function estaSeleccionado(obj) { \r\n check = false;\r\n if(isNaN(obj.length)) {\r\n check = obj.checked;\r\n }\r\n else {\r\n longitud = obj.length; \t\t\r\n for(i = 0; i < longitud; i++) {\r\n if(obj[i].checked == true) {\r\n check = true;\r\n break;\r\n }\r\n }\r\n }\r\n return check;\r\n}", "function celdaCheckbox(obj,parametrostrue,parametrosfalse){\n\tif(!obj.checked){\n\t\tsubmitajax(archivo+parametrostrue);\n\t}\n\telse\n\t{\n\t\tsubmitajax(archivo+parametrosfalse);\n\t}\n\t\n}", "function specialAccommodations() {\n if ($(\"#special_accommodations_toggle_on\").is(\":checked\") || $(\"#special_accommodations_toggle_off\").is(\":checked\")) {\n if($('#special_accomodations_text').val().trim().length > 0) {\n $('#checkbox2').show(\"slide\", { direction: \"up\" }, 500);\n $('#step_3').prop('disabled', false);\n $('#step_3').removeClass('bg-disable');\n $('#bg-legend_3').removeClass('bg-legend');\n $('#step_3').css(\"background\",\"rgb(237,203,180)\");\n $(\"#rock\").addClass('clickable');\n }\n }\n}", "function estaSeleccionado(obj) { \n check = false;\n if(isNaN(obj.length)) {\n check = obj.checked;\n }\n else {\n longitud = obj.length; \t\t\n for(i = 0; i < longitud; i++) {\n if(obj[i].checked == true) {\n check = true;\n break;\n }\n }\n }\n return check;\n}", "check() {\r\n $.each(model.attendance, function(name, days) {\r\n var studentRow = $('tbody .name-col:contains(\"' + name + '\")').parent('tr'),\r\n dayChecks = $(studentRow).children('.attend-col').children('input');\r\n \r\n dayChecks.each(function(i) {\r\n $(this).prop('checked', days[i]);\r\n });\r\n });\r\n }", "function isCheckedInput(input) {\n return input.checked;\n}", "function validateactivity () {\n for (var i = 0; i < checkboxes.length; i++) {\n if (checkboxes[i].checked) {\n return true;\n } \n }\n}", "function checkboxInputChange(e) { //cambia il valore della checkbox\n setChecked((prevChecked) => !prevChecked);\n console.log(checked);\n }", "function checkSelected() {\n var all = $(\"input.select-all\")[0];\n var total = $(\"input.select-item\").length;\n var len = $(\"input.select-item:checked:checked\").length;\n console.log(\"total:\" + total);\n console.log(\"len:\" + len);\n all.checked = len === total;\n }", "function IsChecked2(field)\n{\n\tif (field.checked)\n\t{return false;}\n\telse\n\t{return true;}\n}", "function checkCheckbox(id_d,message)\r\n{\r\n\tif(document.getElementById(id_d).checked)\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\telse\r\n\t{\r\n\t\ttakeCareOfMsg(message);\r\n\t\treturn false;\r\n\t}\r\n}", "function checkBox () {\n for (i=0; i <= allCheckArray.length-1; i++) {\n if (allCheckArray[i].checked) {\n checkBoxResult = true;\n break;\n } else {\n checkBoxResult = false;\n }\n }\n}", "function check_msg()\n {\n var a = $(\"[name='mno_cb[]']:checked\").length;\n if(a == 0)\n {\n alert(\"Please select atleast one checkbox\");\n return false;\n }\n else\n {\n $('.login-window').trigger(\"click\");\n }\n }", "function checksvdone(element) {\n $(`#${element}`).prop(\"checked\") === true ? $('.modal-visitresult-container').show() : (\n $('.modal-visitresult-container').hide(),\n $(\"#visitresult\").val(\"\")\n )\n}", "function detChecked()\r\n{\r\n\tvar dln = $(\"input[id ^= _detl_deli_chek]:checked\").length;\r\n\tvar rln = $(\"input[id ^= chkRowKeys]:checked\").length;\r\n\tif ( dln > 0 || rln > 0)\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "setToscheckbox() {\n\n if (config.debug==true) { console.log(\"in BecomeOwnerApp/setToscheckbox\"); }\n\n if (this.state.toschecked)\n {\n //unchecked\n this.setState({toschecked: false});\n\n }\n else\n {\n //checked\n this.setState({toschecked: true});\n this.setState({ forgottochecktos: false });\n }\n }", "function helper_checkboxChecked(id) {\n \n const index = (id.substring(id.indexOf('m')+1)-1);\n const chkbox = document.getElementById(id);\n const items = userList.items;\n let originalCheck = items[index][1], currentCheck = false;\n \n if (chkbox.checked) { currentCheck = true; } \n else if (!chkbox.checked) { currentCheck = false; }\n \n if (originalCheck !== currentCheck) {\n document.getElementById('saveList').disabled = false;\n edited = true;\n }\n \n return edited;\n }", "check(e) {\n // let checkbox = e.target;\n this.createCookies();\n }", "function indicateChecked() {\r\n\t\t\t\tcheckbox.checked = true;\r\n\t\t\t\ttaskElement.classList.add(\"checked\");\r\n\t\t\t\ttaskElement.classList.add(\"crossout\");\r\n\t\t\t}", "function checkBoxValidator(){\n if ($(bucheckboxes).is(':checked')) {\n return true;\n } else {\n if ($(bucheckboxes).first().parent()[0].nextElementSibling) {\n $(bucheckboxes).first().parent()[0].nextElementSibling.remove();\n }\n $(bucheckboxes).first().parent().after('<span class=\"text-danger align-center\" style=\"display:block;\">At least <b>ONE</b> Authorization Scope should be selected</span>');\n return false;\n }\n}", "function unit_chkboxchange(status) {\r\n\tfor (i in trackerunitchk) {\r\n\t\t$(trackerunitchk[i]).checked = status;\r\n\t}\r\n}", "checkToggle(){\n \n\n //asing checkbox value to a internal prop\n this.state.checked = document.getElementById(\"cbox\" + this.state.id).checked\n \n if (typeof this.state.callbackCheck == 'function') {\n \n //callbak\n this.state.callbackCheck(this.state.id,this.state.checked)\n\n\n } else {\n console.log(\"no set check callback\")\n }\n //redundant\n // \n // cbox.checked =this.state.checked;\n\n }", "function validateCheckbox(classKeo) {\n\tvar anychecked = false;\n\t$(\".\"+classKeo).each(function(){\n\t\tif($(this).is(':checked')) {\n\t\t\tanychecked = true;\n\t\t}\n\t});\n\tif(anychecked) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function school_chck(){\n\nif(document.getElementById('schoolcheckterm').checked==false){\n\t\tdocument.getElementById(\"schoolcheckboxerror\").style.display=\"block\";\n\t\t\treturn false;\n\t\t}\n\t\t\telse{\n\t\t\tdocument.getElementById(\"schoolcheckboxerror\").style.display=\"none\";\n\t\t\t\t\n\t\t\t}\n\n\n\n}", "function checkedTest() {\n cy.get('[name=\"terms\"]')\n .not('have.checked')\n .click()\n .should('have.checked')\n }", "isThisCheckboxLabeless() {\n return this.type==='checkbox' && typeof this.label===\"undefined\";\n }", "function indicateChecked() {\r\n\t\t\tcheckbox.checked = true;\r\n\t\t\ttaskElement.classList.add(\"checked\");\r\n\t\t\ttaskElement.classList.add(\"crossout\");\r\n\t\t}", "function updateCheckbox(data){\n if (data > 0) {\n $(\"#editNegativeSupport\").prop('checked', true);\n } \n}", "function checkChange() {\n if (document.getElementById('ewcheckbox').checked) setModification();\n else resetModification();\n}", "function checkbox(id,estado) {\n $(\"#customCheck\" + id).click(function () {\n accionesCheck(id,estado);\n });\n if (estado) {\n $(\"#customCheck\" + id).prop(\"checked\", true);\n $(\"#titulo\" + id).addClass(\"tachado\");\n $(\"#Fecha\" + id).addClass(\"tachado\");\n $(\"#des\" + id).addClass(\"tachado\");\n }\n}", "function checkedAll()\n\t{\n\t \t var pollchecks = document.getElementsByTagName(\"INPUT\");\n\t\t var _return = false;\t \n\t\t for (var i = 0; i < pollchecks.length; i++)\n\t\t {\t\t\t\n\t\t\tif(pollchecks[i].type == \"checkbox\")\n\t\t\t{\n\t\t\t\t pollchecks[i].checked = true ;\n\t\t\t\t\n\t\t\t}\n\t\t }\n\t\t \n\t}", "function companyToggle(){\n if($('#company_name_toggle_on').is(\":checked\") || $('#company_name_toggle_off').is(\":checked\")) {\n $('#checkbox2').show(\"slide\", { direction: \"up\" }, 1000);\n $('#step_3').prop('disabled', false);\n $('#step_3').removeClass('bg-disable');\n $('#bg-legend_3').removeClass('bg-legend');\n $('#step_3').css(\"background\",\"rgb(237,203,180)\");\n $(\"#rock\").addClass('clickable');\n }\n}", "handleCheck() {\n this.checked = !this.checked;\n }", "function loadChecked() {\n\tvar html = '';\n\tfor (var i = 0; i < selected.length; i++) {\n\t\tvar checkbox = document.getElementById(selected[i]);\n\t\t\thtml += '<input type=\"checkbox\" checked name=\"chooses\" value=\"'\n\t\t\t\t\t+ selected[i] + '\">';\n\t\t$('#' + selected[i]).prop('checked', true);\n\t}\n\t$('#addcheckbox').html(html);\n\n\t// set check all\n\tif (isCheckAll()) {\n\t\t$('#inputSelectAll').prop('checked', true);\n\t}\n}", "function setSelected()\n {\n ($('.all_products').is(\":checked\") ? $('.products_checkbox').prop(\"checked\", true) : $('.products_checkbox').prop(\"checked\", false))\n }", "function controlarChk(){\n\n if( $(this).is(':checked') ){\n\t // Hacer algo si el checkbox ha sido seleccionado\n\t\t$(\"#imgP\").attr(\"disabled\",false);\n\t } else {\n\t // Hacer algo si el checkbox ha sido deseleccionado\n\t \t$(\"#imgP\").attr(\"disabled\",true);\n\t }\n\t\n}//end controlarChk", "function checkboxCheck (e) {\n\tlet progressBarContainer = document.querySelector(\"#progressBarContainer\")\n\tprogressBarContainer.innerHTML = \"\";\n\tif (e.target.checked == true) {\n\t\ttoDoList.done++\n\t\tchangeColorOnCheck(e)\n\t} else {\n\t\ttoDoList.done--\n\t\tchangeColorOnCheck(e)\n\t} \n\tcreateProgressBar()\n\tsave()\n}", "function checkAccepted(){\n // if it is checked, update user's realtime database data that they accept the Explanatory Statement\n if (checkbox.checked){\n window.location.href = \"./chatbot.html\"\n } else {\n // if the tickbox is not ticked, display error message\n tick_warning.hidden = false\n }\n}", "function qll_utility_boxchecked()\r\n{\r\n\t$(\"#remember\").attr('checked','checked');\r\n}", "function listenToCheckbox() {\n $('input[type=\"checkbox\"].quizMulti').on('change', (e) => {\n let type = 'mc'; // set type to 'mc' (multiple choice)\n if (!$(e.currentTarget).prop('checked')) {\n // If the .quizMulti is checked, set type to 'sa' (single answer)\n type = 'sa';\n }\n // Populate and call the change confirmation modal\n popChangeConfModal(type, e.currentTarget);\n });\n}", "function deleteAssignmentCheck() {\r\n //Button Handler\r\n ///If the checkbix is checked, enable the button\r\n if($(\"#assignment-delete-check\").prop('checked')) {\r\n $(\"#delete-assignment-btn\").removeAttr(\"disabled\");\r\n } else {\r\n ///If not then disable the button\r\n $(\"#delete-assignment-btn\").attr(\"disabled\", \"disabled\");;\r\n }\r\n}", "function checkBox(){\n\n var checkbox = document.getElementsByClassName(\"VfPpkd-muHVFf-bMcfAe\");\n if (checkbox.length > 0){ \n console.log(\"Checkbox found\");\n setTimeout(checkboxClick, 200, checkbox[0], checkboxOK);\n }\n else{\n console.log(\"erasure: no checkbox\");\n }\n}", "function check(){\r\n if (document.getElementById(\"metamorphosis\").checked){\r\n alert(\"Correct! There is one individual with 3 life stages.\");\r\n }\r\n else if (document.getElementById('evolution').checked){\r\n alert(\"Try again. Think about how many individuals there are and how many life stages each individual has.\"); \r\n }\r\n\r\n }", "function validarChkbx(input){\n\tvar bool=true;\n\tif($(':checkbox').is(\":checked\")){\n\t\treturn bool\n\t}else{\n\t\tvar span_nombre = $(\"<span class='error'>\" + \"Este botón es obligatorio\" + \"</span>\");\n\t\t$(':checkbox').parent().append(span_nombre);\n\t\tbool = false\n\t}\n\treturn bool\n}", "_onChange() {\n let checked = this.execute(\"is checked\");\n return this.args.onChange(checked, this);\n }", "function student_terms(){\n\nif(document.getElementById('trm_cond').checked==false){\n\t\tdocument.getElementById(\"checkboxerror\").style.display=\"block\";\n\t\t\treturn false;\n\t\t}\n\t\t\telse{\n\t\t\tdocument.getElementById(\"checkboxerror\").style.display=\"none\";\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t}\n\n}", "function updatePopupConciseState() {\n concisePopups = ($(\"[name='concisePopups']\").attr(\"checked\") == \"checked\");\n}", "function registerCheck(){\n\n\tvar length = $('.activities input:checked').length;\n\tif(length > 0){\n\t\t$('.activities span').removeClass('error_show').addClass('error');\n\t\t$('.activities legend').css({'margin-bottom': '1.125em'});\n\t\treturn true;\n\t}\n\telse{\n\t\t$('.activities span').removeClass('error').addClass('error_show');\n\t\t$('.activities legend').css({'margin-bottom': '0em'});\n\t\t//$(\"label[for='\" + $('#mail').attr('id') + \"']\").text(\"Email: (please provide a valid email)\").addClass('error_show');\n\t\treturn false;\n\t}\n}", "function selChkTodos(form, chkNombre, boo) {\r\n\tfor(i=0; n=form.elements[i]; i++) \r\n\t\tif (n.type == \"checkbox\" && n.name == chkNombre) n.checked = boo;\r\n}", "function terms_changed(termsCheckBox) {\r\n //If the checkbox has been checked\r\n if (termsCheckBox.checked) {\r\n //Set the disabled property to FALSE and enable the button.\r\n document.getElementById(\"submit_button\").disabled = false;\r\n } else {\r\n //Otherwise, disable the submit button.\r\n document.getElementById(\"submit_button\").disabled = true;\r\n }\r\n }", "function checkedGestionControlbyMail(){\n\tif(checkedN == \"checked\")\n\t\t{\n\t\t\tconsole.log('toto1');\n\t\t\tpreInscriptionNoGood();\n\t\t}\n\t\telse if (checkedP == \"checked\")\n\t\t{\n\t\t\tconsole.log('toto2');\n\t\t\tcliendNoGood();\n\t\t}\n\t\telse if (checkedI == \"checked\")\n\t\t{\n\t\t\telementManquant1=\"\";\t\n\t\t}\t\n\t\telse\n\t\t{\n\t\t\tconsole.log('toto3');\t\n\t\t\tinscriptionNoGood();\n\t\t}\n}", "function ckClick(ck) {\n var tbl = document.getElementById('tblPerson');\n var boxes = tbl.getElementsByTagName('input');\n // first unchecked ckAll\n if (!ck.checked)\n document.getElementById('ckAll').checked = \"\";\n else\n for (var i = 1; i < boxes.length; ++i)\n if (boxes[i].checked )\n continue;\n else\n break;\n\n if (i == boxes.length)\n document.getElementById('ckAll').checked = \"checked\";\n\n}", "handleSoupChange(e) {\n console.log(\"kkkkkkkkkkkkkkk\", e.target.checked);\n if (e.target.checked) this.setState({ soupIsReady: true });\n else this.setState({ soupIsReady: false });\n }", "function checkNoOptinChoosen()\n {\n if (0 === $('#ftven_formabo_form').find('input[checked=\"checked\"]').length) {\n messageBox(false, 'Vous devez sélectionner au moins 1 abonnement');\n return false;\n } else {\n return true;\n }\n }", "function checkDefault() {\n\t\tvar $checkBoxes = $(\"#checkboxes input[type='checkbox']\");\n\t\tif (!$checkBoxes.is(\":checked\", false)) {\n\t\t\t$checkBoxes.prop(\"checked\", true);\n\t\t}\n\t}", "function handleCheckBox(checkbox) {\n switch (checkbox) {\n case \"cbAdmin\":\n setCheckedTypeAdmin(!checkedTypeAdmin);\n break;\n\n case \"cbAttendance\":\n setCheckedTypeAttendance(!checkedTypeAttendance);\n break;\n\n default:\n break;\n }\n }", "onCheckboxChange(){\n this.onCheckboxChanged();\n }", "function checkConditions() {\n let checkbox = document.getElementById(\"conditions\");\n if (checkbox.checked == true) {\n console.log(\"true\");\n document.getElementById('validateTermsConditions').classList.add('button--primary');\n }\n else {\n document.getElementById('validateTermsConditions').classList.remove('button--primary');\n console.log(\"false\");\n }\n}", "function InputCheck() {\r\n var x = document.getElementById(\"check\").checked;\r\n var age1 = document.getElementById(\"age1\").checked;\r\n var age2 = document.getElementById(\"age2\").checked;\r\n\r\n if (x == true && (age1 == true || age2 == true)) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "function chkTodos()\r\n{\r\n $(\":checkbox\").not(\"#chkTodos\").each(function(){\r\n if(this.checked)\r\n this.checked = false;\r\n else\r\n this.checked = true;\r\n });\r\n}", "function terms_changed(termsCheckBox){\r\n //If the checkbox has been checked\r\n if(termsCheckBox.checked){\r\n //Set the disabled property to FALSE and enable the button.\r\n document.getElementById(\"submit_button\").disabled = false;\r\n } else{\r\n //Otherwise, disable the submit button.\r\n document.getElementById(\"submit_button\").disabled = true;\r\n }\r\n}", "function check() {\r\n\t\tvar status;\r\n\t\tstatus = checkStatus.getValue();\r\n\t\tif (status == '1') {\r\n\t\t\tExt.get('checkBtn').dom.disabled = false\r\n\t\t\tExt.get('cancelBtn').dom.disabled = true\r\n\t\t} else if (status == '2') {\r\n\t\t\tExt.get('checkBtn').dom.disabled = true\r\n\t\t\tExt.get('cancelBtn').dom.disabled = false\r\n\t\t}\r\n\t}", "function cbChange(obj) {\nvar instate=(obj.checked);\n var cbs = document.getElementsByClassName(\"cb\");\n for (var i = 0; i < cbs.length; i++) {\n cbs[i].checked = false;\n }\n if(instate)obj.checked = true;\n}", "function checkSearchSubmitBtn() {\r\n // Hide add to collection button in collection modal when no collections are selected\r\n var checkboxes = $(\"#collectionSearchObjects > input\");\r\n var submitButt = $(\".collectionSearchSubmit\");\r\n\r\n if (checkboxes.is(\":checked\")) {\r\n submitButt.show();\r\n isAnyChecked = 1;\r\n }\r\n else {\r\n submitButt.hide();\r\n isAnyChecked = 0;\r\n }\r\n}", "function validateTC(){\n\tvar retval = jQuery('#terms-conditions').is(':checked');\n\trequiredAction('#terms-conditions',retval);\n\treturn retval;\n}", "function changing_status(checkbox,checkall){\n $(document).on('click',checkbox, function(){\n var checked = $(this).is(':checked');\n if(checked){\n if (checkbox=='.activity_ad_checkbox') {\n if($(\".activity_checkbox:checked\").length >0){\n $(this).prop(\"checked\",true);\n if($(checkbox).length == $(checkbox+\":checked\").length) {\n $(checkall).prop(\"checked\", true);\n }\n }else{\n $(this).prop(\"checked\",false);\n alert('Please checked atleast one main service to get extra services !');\n }\n }else if (checkbox=='.activity_checkbox') {\n $(this).prop(\"checked\",true);\n if ($(this).hasClass('stampling') && ($('.schedule').is(':checked')==false)) {\n alert('Schedule should be turn on when Stampling on. ');\n $('.schedule').prop(\"checked\",true);\n }\n if($(checkbox).length == $(checkbox+\":checked\").length) {\n $(checkall).prop(\"checked\", true);\n }\n\n }\n }else{\n if (checkbox=='.activity_ad_checkbox') {\n $(this).prop(\"checked\",false);\n if($(checkbox).length != $(checkbox+\":checked\").length) {\n $(checkall).prop(\"checked\", false);\n }\n }else if (checkbox=='.activity_checkbox') {\n $(this).prop(\"checked\",false);\n if($(checkbox).length != $(checkbox+\":checked\").length) {\n $(checkall).prop(\"checked\", false);\n }\n if ($(this).hasClass('schedule') && ($('.stampling').is(':checked'))) {\n alert('Stampling should be turn off when Schedule off.');\n $('.stampling').prop(\"checked\",false);\n }\n if ($(checkbox+\":checked\").length==0) {\n $('.activity_ad_checkbox').prop('checked',false);\n $('#activity_ad_all').prop('checked',false);\n }\n\n\n }\n\n }\n\n CalculateTotalCost();\n\n });\n\n }", "_onChange() {\n let checked = this.execute('is checked');\n return this.attrs.onChange(checked, this);\n }" ]
[ "0.7582328", "0.7393126", "0.7355029", "0.7231854", "0.72032493", "0.71553993", "0.7020631", "0.7011731", "0.69948685", "0.6987756", "0.69863343", "0.6958427", "0.6926474", "0.6907392", "0.6819139", "0.6793804", "0.6745936", "0.6745936", "0.67210746", "0.66970086", "0.6690196", "0.66900736", "0.6685967", "0.6680435", "0.66601914", "0.66553503", "0.6655246", "0.66532695", "0.6649854", "0.66364396", "0.66215956", "0.6612377", "0.66094166", "0.65844685", "0.6583976", "0.65797144", "0.6574498", "0.65618956", "0.655824", "0.65581423", "0.6528765", "0.6523061", "0.6510666", "0.6497162", "0.6494851", "0.6481017", "0.6479809", "0.6475932", "0.6466574", "0.6463922", "0.64639187", "0.6439673", "0.64319247", "0.64218855", "0.641783", "0.6409181", "0.64086187", "0.6401718", "0.64001286", "0.6398566", "0.63984096", "0.6396676", "0.639344", "0.6380712", "0.6374568", "0.6368551", "0.63509005", "0.63501966", "0.63415504", "0.6339817", "0.6330691", "0.63273126", "0.63190633", "0.63094866", "0.6304008", "0.62988454", "0.62967235", "0.6296718", "0.62959003", "0.62934446", "0.62906504", "0.62901247", "0.62897813", "0.62887263", "0.62882674", "0.62794685", "0.6271482", "0.6270123", "0.6268888", "0.6266604", "0.6265221", "0.6264663", "0.6264516", "0.62621725", "0.6261262", "0.6256397", "0.6250989", "0.6248277", "0.62477285", "0.6237856" ]
0.64635587
51
checks if the home is checked
function checkHome(user) { user.home = !user.home; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pols_is_home(){\r\n\treturn (this.is_home || this.door_uid == 'home_interior' || this.door_uid == 'home_exterior') ? true : false;\r\n}", "function returnHomeDetection(){\n if (state === 'piano' || state === 'guitar'){\n if(mouseIsPressed){\n if (mouseX > 25 && mouseX < 75 &&\n mouseY > 25 && mouseY < 75){\n state = 'menu';\n }\n }\n }\n}", "function checkHomeDataFilled() {\n\t\t\tif (vm.flags.booknowSectionfieldsValid != true) {\n\t\t\t\t//$state.go('home');\n\t\t\t\twindow.location = \"/web/CustPortal/\";\n\t\t\t}\n\t\t}", "function isHome() {\n var siteStructure = siteVars.config['a' + siteVars.id].pertinent.siteStructure,\n currentView = $('.view:visible').first().attr('id');\n switch (siteStructure) {\n case 'master categories':\n return currentView === 'masterCategoriesView';\n case 'categories':\n return currentView === 'categoriesView';\n default:\n return currentView === 'keywordListView';\n }\n}", "function isHome() {\n var url = window.location.pathname.split('/')\n\n verb(\"isHome: \" + url[2] === \"home\")\n return url[2] === \"home\"\n}", "function homeClick() {\n\n\tif ($(\"#home\").hasClass(\"current-item\") == false)\n\t{\n\t\t// add class to $(\"#home\"), delete for others\n\t\t$(\"#states\").removeClass();\n\t\t$(\"#msgs\").removeClass();\n\t\t$(\"#home\").addClass(\"current-item\");\n\n\t\tshowDiv(\"main-body\");\n\t}\n}", "function isUserAtHomeScreen() {\n var $homeScreenContainer = $(\"#HomeScreenContainer\");\n var isHomeScreen = null;\n if ($homeScreenContainer.length === 0) {\n isHomeScreen = false;\n } else {\n isHomeScreen = true;\n }\n\n return isHomeScreen;\n }", "function iAmInHome(){\n const path = window.location.pathname.split('/');\n const actualPage = path[path.length-1];\n if(['index.html',''].includes(actualPage)) return true;\n else return false;\n}", "function go_home() {\n\tconfirm( t('confirm_go_home'), function(ch) {\n\tif (ch == 1) {\n\t\t$(\"button.icon-home\").attr(\"disabled\", true);\n\n\t\tvar shipment = {\n\t\t\tshipment_id: '',\n\t\t\tpieces: '',\n\t\t\tweight: '',\n\t\t\tpick_up: '',\n\t\t\tdestination: '',\n\t\t\tdamaged: false\n\t\t};\n\n\t\tfill_shipment_data(shipment);\n\n\t\taction ='';\n\t\t$('#damage_info').val('');\n\t\t$('#id-shipment-value').val('');\n\t\treset_image_box();\n\t\treset_image_pod();\n\t\treset_signature();\n\t\tcurrent_shipment.length = 0;\n\t\tship_info.length = 0;\n\t\tinstruction.length = 0;\n\t\tdimensions = '';\n\t\tname = '';\n\t\tdest_phone = '';\n\t\tclear_current();\n\n\t\tshow('page-home');\n\t\t$(\"button.icon-home\").removeAttr(\"disabled\");\n\t}}, t('confirm_go_home_title') ); \n}", "function home(){\r\n\tif(screenOn === false){\r\n\t\tpower();\r\n\t}else{\r\n\t\t//If the menu is open\r\n\t\tappMenuOpen = false;\r\n\t\t$(\"#app-menu\").attr(\"style\", \"display: none;\");\r\n\r\n\t\t$(\"#bottom-menu-bar\").attr(\"style\",\"display: block;\");\r\n\r\n\t\trecentAppsOpen = false;\r\n\t\t$(\"#recent-apps-screen\").attr(\"style\", \"display: none;\");\r\n\r\n\t\t// Hides call screen\r\n\t\t$(\"#call-screen\").attr(\"style\",\"display: none;\");\r\n\r\n\t\t//Hides notification-box\r\n\t\t$(\"#notification-box\").css(\"display\", \"none\");\r\n\r\n\t\t//if the camera app is open:\r\n\t\t$(\"#camera-screen\").css(\"display\", \"none\");\r\n\t}\r\n}", "function isHomePage() {\r\n\treturn !!(page.match(/^((\\?|home\\.php).*)?$/));\r\n}", "function isHomePage() {\r\n\treturn !!(page.match(/^((\\?|home\\.php).*)?$/));\r\n}", "function isHomePage() {\r\n\treturn !!(page.match(/^((\\?|home\\.php).*)?$/));\r\n}", "function gohome(){\n mouse_down = false;\n clearinfo();\n if (track_obj && track_obj != 'home'){\n track_obj['highlighted'] = false;\n }\n track_obj = 'home';\n}", "function goHome() {\n WinJS.log && WinJS.log(\"You are home.\", \"sample\", \"status\");\n }", "function goHome() {\n if (element[\"flexGrid\"].style.display === \"none\") {\n element[\"flexGrid\"].style.display = \"grid\";\n element[\"stats\"].style.display = \"none\";\n element[\"developerOptions\"].style.display = \"none\";\n element[\"help\"].style.display = \"none\";\n if (gameData.duckchosen === -1) {\n element[\"chooseDuck\"].style.display = \"block\";\n } else {\n element[\"chooseDuck\"].style.display = \"none\";\n }\n } \n}", "isUserHomePageLoaded() {\n return this.userSettingsIcon.waitForExist();\n }", "function checkFirstVisit(){\n\t\t\tif (!localStorage.reinzCheck) {\n\t\t\t navIndicator();\n\t\t\t localStorage.reinzCheck = 'yes';\n\t\t\t}\n\t\t}", "function checkMenu(){\n var locationItem = $location.search().ss;\n var locationSection = $location.search().s;\n var item = _.findWhere(service.parts.items[locationSection], {name: locationItem });\n\n if(!item){\n $location.replace();\n service.flags.active.section = null;\n service.flags.active.item = null;\n $location.search(\"s\", null);\n $location.search(\"ss\", null);\n }\n }", "function handleHomeChange(e) {\n setHomeTeam(e.target.value);\n }", "function isHome() {\n\tvar regex = /^(\\/sobaryton.github.io)?(\\/(index.html)?)?$/i;\n\treturn regex.test(window.location.pathname);\n}", "function do_show_home(element){\n\t\t if($('div#content_bottom').text().trim().length == 0){\n\t\t\t$(element).click();\n\t\t\t// console.log($(element));\n\t\t\t\n\t\t }\n }", "function navigateToHome() {\n\tclearIntervalTimers();\n\tvar pathName = $(location).attr('pathname');\n\tremoveMessageFromDivId();\n\tremoveSuccessOrFailureStrip();\n\tvar fundingSourceTypes_JsonType=\"\";\n\tif($('#editCardForm').is(':visible')){\n\t\t\tfundingSourceTypes_JsonType = getFundingSource(\"editCardForm\");\n\t\tif(isEditCardFieldsChanged(fundingSourceTypes_JsonType)){\n\t\t\tshowAnimatedPopup('editCardOnManagesCard', 'editcardCredPopUp');\n\t\t} else {\n\t\t\t/* Checking for if user clicked home tab in locator page then s/he should move to main_payment_page */\n\t\t\tmoveToMainPage(pathName);\n\t\t}\n\t}else if ($('#addPaymentCardForm').is(':visible')) {\n\t\t\tfundingSourceTypes_JsonType = getFundingSource(\"addPaymentCardForm\");\n\t\tif (isValueInAddCardFormFields(\"addCardForm\" + fundingSourceTypes_JsonType)) { \n\t\t\tshowAnimatedPopup('editCardOnManagesCard', 'editcardCredPopUp');\n\t\t} else {\n\t\t\t/* Checking for if user clicked home tab in locator page then s/he should move to main_payment_page */\n\t\t\tmoveToMainPage(pathName);\n\t\t}\n\t} else if ($('#edit_profile_area').is(':visible')){\n\t\tif (isEditProfileFieldsChanged()) {\n\t\t\tshowAnimatedPopup('editCardOnManagesCard', 'editcardCredPopUp');\n\t\t} else {\n\t\t\t/* Checking for if user clicked home tab in locator page then s/he should move to main_payment_page */\n\t\t\tmoveToMainPage(pathName);\n\t\t}\n\t} else if ($('#edit_profile_security_area').is(':visible')) {\n\t\tif (isUserSecurityFieldsChanged()) {\n\t\t\tshowAnimatedPopup('editCardOnManagesCard', 'editcardCredPopUp');\n\t\t} else {\n\t\t\t/* Checking for if user clicked home tab in locator page then s/he should move to main_payment_page */\n\t\t\tmoveToMainPage(pathName);\n\t\t}\n\t} else{\n\t\t/* Checking for if user clicked home tab in locator page then s/he should move to main_payment_page */\n\t\tmoveToMainPage(pathName);\n\t}\t /*mainPaymentPageResize();*/\n\t$('#clearOnClickBtn').unbind( \"click\" );\n\t$('#clearOnClickBtn').click(function(event){\n\t\t/* Checking for if user clicked home tab in locator page then s/he should move to main_payment_page */\n\t\tmoveToMainPage(pathName);\n\t});\n}", "function tohome(loc) {\n\tvar url = \"index.html\";\n\tif (loc == \"non-payment\") // if the logo button is clicked in non payment pages , it will directly direct to homepage\n\t{\n\t\twindow.location.href = url;\n\t}\n\telse // if logo button is clicked in payment page then user has to confirm to leave the page\n\t{\n\t\tif (window.confirm(\"Are you sure you want to leave?\")) {\n\t\t\twindow.location.href = url;\n\t\t}\n\t\telse {\n\t\t\tdie();\n\t\t}\n\t}\n}", "function checkPage(){\n\n\t\tvar page_id = $(\".navigation ul li.active a\").attr(\"href\").split(\"#\")[1];\n\n\t\tgoto_page(page_id);\n\n\t}", "onNobodyHome() {\n throw new NotImplementedException();\n }", "function GoHome() {\t\n\t// If is not close to home\n\tif (distanceFrom(spawnPoint) > 1) {\n\t\tenemyState = resetting;\n\t\t\n\t\tDebug.Log(\"Going home!\");\n\t\t// If is looking at spawn move\n\t\tif (LookAt(enemy.transform, spawnPoint, false, 0)) {\n\t\t\tmoveTowards(spawnPoint);\n\t\t}\n\t// If close to home\n\t} else {\n\t\tWander();\n\t\t//transform.rotation = Quaternion.Euler(0, 0, 0);\n\t}\n}", "function goToHome() {\n if ($state.is('home')) $state.reload();\n else $state.go('home');\n }", "_homeButtonPressed() {\n this._broadcast(MESSAGE_TYPES.PILL_HOME_PRESSED, this.get('pillData'));\n }", "function verifyUserNavigatedToHomePage(){\n cy.get(homePageControls.categoriesList).should('be.visible');\n}", "function setHome() {\n var homeAddress = $(\"#user-location\").val();\n if (homeAddress == \"\") {\n return;\n } else {\n localStorage.setItem(\"home-address\", JSON.stringify(homeAddress));\n $(\"#user-location\").val(\"\");\n }\n }", "function checkHash() {\n if(window.location.href.indexOf(\"unity\") > -1) {\n currentState = pageStates.UNITY;\n }\n else if (window.location.href.indexOf(\"custom\") > -1) {\n currentState = pageStates.CUSTOM;\n }\n else if (window.location.href.indexOf(\"web\") > -1) {\n currentState = pageStates.WEB;\n }\n else\n {\n currentState = pageStates.DEFAULT;\n }\n}", "function secure_home( ) {\n this\n .chkpt('secure_home')\n .down()\n .box(blocks.bedrock, 7, 1, 6) // bedrock floor\n .up()\n .box(blocks.air, 7, 5, 6) // clear area first\n .up(2)\n .fwd()\n .right()\n .box(blocks.bedrock, 5, 1, 4) // bedrock ceiling\n .left()\n .back()\n .down(2)\n .box0( blocks.bedrock, 7, 2, 6) // 4 walls\n .up(2)\n .prism0( blocks.stairs.cobblestone, 7, 6) // add a roof\n .down()\n .right(4)\n .back()\n .wallsign(['nothing','to see','here'])\n .fwd()\n .move('secure_home')\n .right(3)\n .fwd(4)\n .up()\n .hangtorch() // place a torch on wall\n .move('secure_home')\n .right()\n .fwd(3)\n .bed() // place a bed against left wall\n .fwd()\n .right(4)\n .box(blocks.furnace) // place a furnace against right wall\n .move('secure_home');\n}", "function returnHome() {\n $state.go(constants.states.soon);\n }", "function chk(homescreenbox){\n homescreenbox = homescreenbox.toString();\n if (homescreenbox.includes(\"Akal Takht\")) {\n return true;\n }\n\n }", "function returnToHome(){\n\t\n}", "function ath(){\n (function(a, b, c) {\n if (c in b && b[c]) {\n var d, e = a.location,\n f = /^(a|html)$/i;\n a.addEventListener(\"click\", function(a) {\n d = a.target;\n while (!f.test(d.nodeName)) d = d.parentNode;\n \"href\" in d && (d.href.indexOf(\"http\") || ~d.href.indexOf(e.host)) && (a.preventDefault(), e.href = d.href)\n }, !1);\n $('.add-to-home').addClass('disabled');\n $('body').addClass('is-on-homescreen');\n }\n })(document, window.navigator, \"standalone\")\n }", "function homeInquirer() {\n inquirer\n .prompt({\n name: \"home\",\n type: \"list\",\n message: \"Would you like to go back to home screen?\",\n choices: ['Yes', \"No, exit the app!\"]\n })\n .then(function(answer) {\n if(answer.home === 'Yes') {\n appStart()\n } else {\n process.exit() \n }\n })\n}", "function checkIfUserInitialized() {\n if (currentuser) {\n loadHomePage();\n } else {\n updateCurrentUser().then(function () {\n loadHomePage();\n }).catch(function () {\n loadSettingsPage();\n });\n }\n}", "function backToHomeView () {\n currentFolder = -1\n showOneContainer(homeContain)\n fetchSingleUser(currentUser)\n }", "function gotoHome(){\n\t\t$('#session').hide();\n\t\t$('#container').show();\n\t\t//stop listening to accelerometer\n\t\tnavigator.accelerometer.clearWatch(watchID);\n\t}", "checkIfUserIsLoggedIn(){\n if(this.props.locateApplication.isLoggedIn){\n return true;\n }\n return false;\n }", "processGoHome() {\n window.todo.model.goHome();\n }", "function goHome() {\r\n if (controls.getObject().position.z < -3000) {\r\n activeGroup.parent.position.y -= 25;\r\n activeGroup.parent.position.z += -100;\r\n while (controls.getObject().position.z < -3400) {\r\n moveBackward = true;\r\n transitionLoop();\r\n moveBackward = false;\r\n }\r\n } else {\r\n activeGroup.children[0].position.y -= 25;\r\n activeGroup.children[0].position.z += -100;\r\n while (controls.getObject().position.z < -2000) {\r\n moveBackward = true;\r\n transitionLoop();\r\n moveBackward = false;\r\n }\r\n }\r\n homeCtx.active = true;\r\n homeCtx.clearRect(0, 0, home.width, home.height);\r\n locationGradient(homeCtx, home);\r\n homeCtx.strokeText(\"HOME\", 10, 35);\r\n level1Ctx.clearRect(0, 0, locationLevel1.width, locationLevel1.height);\r\n level2Ctx.clearRect(0, 0, locationLevel2.width, locationLevel2.height);\r\n locationLevel1.style.display = \"none\";\r\n locationLevel2.style.display = \"none\";\r\n hideAllChildren();\r\n}", "function handleHome(e){\n e.preventDefault()\n dispatch(getGames(e.target.value))\n setCurrentPage(1)\n}", "function checkPage(){\n\n if($location.path()==\"/home\"){\n $scope.page='order';\n $location.path('/order'); // redirects /home to /order\n }\n else if($location.path()==\"/order\"){\n $scope.page='order';\n }\n else if($location.path()==\"/cart\"){\n $scope.page='cart';\n }\n else if($location.path()==\"/confirmation\"){\n getConfirmation(); // call function to retrieve confirmation variables\n $scope.page='confirmation';\n }\n else{\n $scope.page='order';\n }\n }", "'click .homeReminder'(){\n if (homeReminderBool == null){\n homeReminderBool = true;\n } else {\n homeReminderBool = !homeReminderBool;\n }\n }", "function checkInput(){\n \n if (searchInp.value != \"\"){\n initialLocation = false;\n console.log(\"init\", initialLocation);\n }\n \n else {\n initialLocation = true;\n console.log(\"init\", initialLocation); \n }\n }", "function checkStorage(changelocation)\n{\n //console.log(changelocation && window.location.href.indexOf(\"home.html\")<0);\n var login = getStorage(\"login\");\n var pass = getStorage(\"password\");\n var selected_org = getStorage(\"organization\");\n var selected_inst = getStorage(\"instance\");\n\n if (!login || !pass)\n {\n window.location.replace(\"login.html\");\n return false;\n }\n else\n {\n if (!selected_org || !selected_inst)\n {\n if (window.location.href.indexOf(\"login.html\")<0)\n {\n window.location.replace(\"login.html\");\n return false;\n }\n }\n else\n {\n if (changelocation && window.location.href.indexOf(\"home.html\")<0)\n {\n window.location.replace(\"home.html\");\n return false;\n }\n }\n }\n return true;\n}", "function checkHandHome(){\n //Making frame\n var frame = controller.frame();\n\n //Als er handen in beeld zijn\n if(frame.hands.length > 0)\n {\n window.location.href = '/start' \n }\n //If theres no hands in the frame\n else{\n console.log('no hands')\n }\n}", "goHome() {\n clearInterval(this.intervalHandle);\n clearInterval(this.comboHandle);\n }", "function home(){\r\n\t\tif(document.getElementById(\"allbooks\").innerHTML == \"\"){\r\n\t\t\tsearchData(\"books\", allBooks);\r\n\t\t}\r\n\t}", "function needsControls() {\n for(let taskName in allTasksObject) {\n if(allTasksObject[getHomeName(taskName)]) {\n return true;\n }\n }\n return false;\n }", "function desktopSite() {\n // Uses an element only visable on desktop site\n return $(\"#aboutBack\").is(\":visible\");\n}", "function go_home() {\n\tdocument.getElementById(\"display-screen\").innerHTML = loading;\n\tx_home_page(\"\", do_display);\t\t\t\t\n}", "function showHome() {\n homeSection.css(\"display\", \"block\");\n mysqlSection.css(\"display\", \"none\");\n dmsSection.css(\"display\", \"none\");\n\n homeLink.addClass(\"active\");\n mysqlLink.removeClass(\"active\");\n dmsLink.removeClass(\"active\");\n}", "function testHomeButton() {\n var urlBarText = browser.ui.navBar.urlBarText;\n \n // Open the test page and store the URL bar text as our expected value\n browser.openURL(LOCAL_TEST_PAGE);\n expectedURLBarText = urlBarText.getText()\n \n // Reset browser tabs and verify the page has changed\n browser.resetTabs();\n assert.notEqual(urlBarText.getText(), expectedURLBarText);\n \n // Click on the home button and verify that we loaded the page we expect\n browser.ui.navBar.homeButton.click();\n browser.waitForPageLoad();\n assert.equal(urlBarText.getText(), expectedURLBarText);\n}", "function checkFocus() {\n if (store.getState().battleState == 'BATTLE_ON' && store.getState().autoPause == 'ON' && store.getState().manualPaused != true) {\n if(document.hasFocus()) {\n isUserFocusOnThePage = true;\n } else {\n isUserFocusOnThePage = false;\n isUserFocusOnTheGame = false;\n }\n\n if(isUserFocusOnThePage == true && isUserFocusOnTheGame == true && store.getState().isGamePaused == true) {\n resumeGameStateChangeStarter();\n } else if (store.getState().isGamePaused == false){\n if (isUserFocusOnThePage == false || isUserFocusOnTheGame == false) {\n pauseGameStateChangeStarter();\n }\n }\n }\n }", "function activePageCheck() {\n\n const currentPage = window.location.hash.substr(1);\n const activeNavItem = navBox.querySelector(`[href=\"#${currentPage}\"]`);\n if(!activeNavItem) {return}\n previousPage[0].classList.toggle(\"active\");\n activeNavItem.classList.toggle(\"active\");\n\n \n}", "function checkUserStatus() {\n if (firebase.auth().currentUser === null) { loadLoginPage(); }\n else { loadHomePage(); }\n }", "goHome() {\n\t\t__WEBPACK_IMPORTED_MODULE_7__stores_storeActions__[\"a\" /* default */].clearTags();\n\t\t__WEBPACK_IMPORTED_MODULE_7__stores_storeActions__[\"a\" /* default */].clearFilteredApps();\n\t\t__WEBPACK_IMPORTED_MODULE_7__stores_storeActions__[\"a\" /* default */].clearApp();\n\t\tthis.setState({\n\t\t\tactiveApp: null,\n\t\t\tforceSearch: false\n\t\t});\n\t}", "function showHomePage()\r\n{\r\n\t$('.home input').val('');\r\n\r\n\t$('.home').fadeIn(3000, function() {\r\n\t\t$(this).find('input').focus();\r\n\t});\r\n\r\n\t$('.home input').off('change.home').on('change.home',function(e){\r\n \t var input = $(this);\r\n\t\tlocalStorage.setItem('mainFocus',input.val());\r\n\r\n\t\tinput.hide();\r\n\t\t$('.home .mainFocus').show();\r\n\t\t$('.home .mainFocus p').html(input.val());\r\n\t});\r\n\r\n\t$('.home #btnClose').off('click.home').on('click.home', function(e){\r\n\t\t\tlocalStorage.removeItem('mainFocus');\r\n\t\t\t$('.home input').val(\"\").show().focus();\r\n\t\t\t$('.home .mainFocus').hide();\r\n\t});\r\n\t\r\n\tupdateTime();\r\n\tupdateWeather();\r\n}", "function homeHandler(event)\n\t\t{\n\t\t\tg.reinit();\n\t\t\thideButtons(this);\n\t\t}", "function walkHome(){\r\n\tbackground(0);\r\n\tfirstOption.hide();\r\n\tsecondOption.hide();\r\n\tuserName.hide();\r\n\r\n\t//change the text for the title\r\n\ttitle.html(\"You have gone home. Good Night.\");\r\n\r\n\t//startOver = createA(\"index.html\", \"Start Over\")\r\n\t//firstOption.mousePressed(startOver);\r\n}", "function onMenuKeyDown() {\n\n //if ($(\"#Home-layout\").css(\"display\") == \"none\") {\n // if ($(\"#Login-home\").css(\"display\") != \"none\") {\n // return false;\n // }\n // else {\n // window.location = \"#Home-layout\";\n // }\n //}\n\n }", "function tryShowHomescreenSection(evt) {\n if (isAppEventForHomescreen(evt) && scannedHomescreens) {\n updateHomescreenCount(evt);\n } else {\n scanForHomescreens();\n }\n }", "checkIsBusy() { \r\n const self = this;\r\n\r\n let isRunning = false;\r\n\r\n self.menus.forEach( menu => {\r\n if ( menu.name in self.actions ) {\r\n isRunning = true;\r\n }\r\n } );\r\n\r\n return isRunning;\r\n }", "checkUser() {\n let doesExit = false\n this.state.admin.forEach(x => {\n if(x.email === this.state.email) {\n doesExit = true;\n }\n });\n return doesExit;\n }", "function displayChosenCoinHomeButton() {\n $(\".coinBlock > .toggle>input\").prop(\"checked\", false);\n for (const chosenCoin of chosenCoins) {\n $(`.coinBlockOf${chosenCoin}>div>input`).prop(\"checked\", true);\n $(`.coinBlockOf${chosenCoin}>div`).removeClass(\"off\");\n }\n }", "goHome() {\n\t\tthis.setState({\n\t\t\tsearchValue: \"\"\n\t\t}, this.props.goHome);\n\t}", "function checkPage() {\n var path = window.location.pathname;\n if (path.search('/$') == -1\n && path.search('index.html') == -1\n && path.search('signup.html') == -1)\n {\n if (isLoggedIn()) {\n if (path.search('/personal/') == -1 && path.search(sessionStorage['usertype']) == -1) {\n window.location.assign('../personal/courses.html');\n return;\n }\n }\n else {\n window.location.assign('../index.html');\n return;\n }\n } else if (isLoggedIn()) {\n window.location.assign('personal/courses.html');\n return;\n }\n}", "function onHomeClick(e) {\n\ttry {\n\t\tAlloy.Globals.NAVIGATION_CONTROLLER.closeWindow('manageScreen');\n\t\tvar parentWindow = Alloy.Globals.NAVIGATION_CONTROLLER.getCurrentWindow();\n\t\tif (parentWindow != null && parentWindow.windowName === \"newHomeScreen\") {\n\t\t\tparentWindow.window.refreshHomeScreen();\n\t\t}\n\n\t} catch(ex) {\n\t\tcommonFunctions.handleException(\"manageScreen\", \"homeClick\", ex);\n\t}\n}", "function isHotnessVote() {\n return location.href.indexOf( \"show=hotness\" ) != -1;\n }", "function goBackHome()\n{\n\tswitch(state){\n\t\tcase \"watershed\":\n\t\t\tZepto(\".watershed-wrapper\").fadeOut(\"medium\");\n\t\t\tbreak;\n\n\t\tcase \"nearshore\":\n\t\t\tZepto(\".nearshore-wrapper\").fadeOut(\"medium\");\n\t\t\tbreak;\n\n\t\tcase \"openwater\":\n\t\t\tZepto(\".openwater-wrapper\").fadeOut(\"medium\");\n\t\t\tbreak;\n\n\t\tcase \"deepwater\":\n\t\t\tZepto(\".deepwater-wrapper\").fadeOut(\"medium\");\n\t\t\tbreak;\n\t}\n\n\tZepto(\".lakeareas-wrapper\").fadeIn(\"medium\");\n\tstate = \"lakeAreas\";\n}", "isFullView() {\n let currentPath = this.props.children.props.route.path;\n return (currentPath == Constants.selectedAdminTab.count) || (currentPath == Constants.selectedAdminTab.sites ||(currentPath == Constants.selectedAdminTab.manageEmail) ||(currentPath == Constants.selectedAdminTab.checkIn));\n }", "async wmHome() {\n\n // get wu mei user's info about authority and exists or not\n const userId = this.ctx.params.userId;\n let level = await this.service.userswm.query({ wmUserId: userId }, ['wmUserLvl']);\n level = level && +level.wmuserlvl || 1;\n\n // wu mei user is manager\n if (level === this.app.config.userLevel.manager) {\n const assigned = await this.service.counterUser.count({ userId }, ['id']);\n if (assigned) {\n this.ctx.redirect(`/public/checker.html?userId=${userId}`);\n return;\n }\n\n this.ctx.redirect(`/public/checkout.html?userId=${userId}`);\n return;\n }\n\n // wu mei user is store manager\n if (level === this.app.config.userLevel.storeManager) {\n this.ctx.redirect(`/public/storeManager.html?userId=${userId}`);\n return;\n }\n\n // wu mei user is district manager\n if (level === this.app.config.userLevel.districtManager) {\n const assigned = await this.service.shopUser.count({ userId }, ['id']);\n if (assigned) { \n this.ctx.redirect(`/public/districtManager.html?userId=${userId}`);\n return;\n }\n \n this.ctx.redirect(`/public/addShop.html?userId=${userId}`);\n return;\n }\n\n redirect('/public/404.html');\n }", "function selectHome() {\n $(\"#home\").on(\"click\", function () {\n $(\"#scheduleImg\").addClass(\"hidden\");\n $(\".contacts\").addClass(\"hidden\");\n $(\".emails\").removeClass(\"hidden\");\n $(\".nav\").removeClass(\"hidden\");\n $(\".files\").addClass(\"hidden\");\n $(\"#search\").addClass(\"hidden\");\n });\n}", "function checkHash() {\r\n if (location.hash && $this.find(location.hash).length) {\r\n toggleState(true);\r\n return true;\r\n }\r\n }", "function slider_home() {\n\tif ($('.canhcam-slider-1 .list-items').length) {\n\t\t$(\".canhcam-slider-1 .list-items\").slick({\n\t\t\tautoplay: true,\n\t\t\t// slickPlay: true,\n\t\t\t// slickPause: true,\n\t\t\tautoplaySpeed: 4000,\n\t\t\tdots: false,\n\t\t\tinfinite: true,\n\t\t\tspeed: 600,\n\t\t\tarrows: false,\n\t\t\tslidesToShow: 1,\n\t\t\tslidesToScroll: 1,\n\t\t\t// customPaging: function(slider, i) {\n\t\t\t// var thumb = $(slider.$slides[i]).data('thumb');\n\t\t\t// return '<a><p> ' + thumb + '</p></a>';\n\t\t\t// },\n\t\t});\n\t}\n\n}", "clickHome() {\n this.I.waitForElement(this.homeLink);\n\n this.I.say(`${LOG_TAG} Clicking on the home button`);\n this.I.click(this.homeLink);\n\n this.I.wait(1);\n\n this.I.say(`${LOG_TAG} Clicking on the confirm button`);\n this.I.click('SIM');\n\n const dashboardPage = require('./../dashboardPage');\n dashboardPage._init();\n dashboardPage.isLoaded();\n return dashboardPage;\n }", "function checkPage(){\n if (document.title == \"Student Dashboard\"){\n console.log(\"We Are On The Student Dashboard\");\n return true;\n }\n else{\n console.log(\"We Are Not On The Student Dashboard\");\n return false;\n }\n}", "function clickHome(){\r\n window.location.href = \"/\";\r\n}", "function appIsGuest() {\n if (location.pathname.match(/guest/) !== null) {\n return true; //guest\n }\n return false; //not guest\n }", "function checkSearchState() {\n //check latest state\n if ($rootScope.$state.current.name == 'home.search') {\n return {\n status: true,\n queryString: $rootScope.$stateParams.queryString || \"\"\n }\n } else if ($rootScope.stateHistory.length > 0) {\n //check if previous state was search and current state is post\n if ($rootScope.stateHistory[$rootScope.stateHistory.length - 1].hasOwnProperty('home.search') && $rootScope.$state.current.name == 'home.post') {\n //checking the previous state\n return {\n status: true,\n queryString: $rootScope.stateHistory[$rootScope.stateHistory.length - 1]['home.search'].queryString\n }\n } else {\n return {\n status: false\n }\n }\n } else {\n return {\n status: false\n }\n }\n }", "function home() {\n\t\t\tself.searchText('');\n\t\t\tconfigData.page = 1;\n\t\t\tgetPhotos();\n\t\t}", "function check_page_state() {\n\n //if no user_data or state data, skip it\n if (typeof(user_data) == 'undefined' || typeof(user_data.navstate) == 'undefined') {\n return false;\n }\n\n //no vc\n if (typeof(vc_info.vc) == 'undefined' || vc_info.vc=='dist/user/data' || vc_info.vc=='dist/user/map' || vc_info.vc=='user/map') {\n return false;\n }\n\n\n //vc and page must be the same for this to hold water\n //if(user_data.page!=vc_info.vc) {return;}\n\n //check the current navstate key\n newkey = user_data.navstate;\n expected_page = typeof(order_map[newkey])==\"undefined\" ? null : order_map[newkey];\n current_page = vc_info.vc;\n\n if(expected_page!=null && current_page!=expected_page) {\n redirect(expected_page);\n console.log(\"Force navigating to \"+expected_page);\n } else if(newkey==0) {\n return check_lost_state();\n }\n\n return;\n}", "checkAlreadyLoggedIn(props) {\n if (/\\/(amc-sign-up|appraiser-sign-up|login)/.test(this.props.location.pathname)) {\n return props.auth.get('user') && !props.auth.get('signingUp');\n }\n }", "check() {\n let isLoggedIn = this.Storage.getFromStore('isLoggedIn');\n\n if(isLoggedIn) {\n return true;\n }\n\n return false;\n }", "function redirectHome() {\n cleanUp();\n $state.go('app.home');\n }", "function checkHugo(){\n \n\tif ($(\"#cover-0\").is(\":checked\") && $(\"#sim-0\").is(\":checked\") && $(\"#pass-0\").is(\":checked\") && $(\"#cancel-0\").is(\":checked\")){\n\t\t\n\t\thideHugoFunc(\".hugo-1111\");\t// all - 1111\n\n\t//Three Active\t\n\n\t} else if ($(\"#cover-0\").is(\":checked\") && $(\"#sim-0\").is(\":checked\") && $(\"#pass-0\").is(\":checked\")) {\n\t\t\n\t\thideHugoFunc(\".hugo-1110\");\t// 1110\n\n\t} else if ($(\"#cover-0\").is(\":checked\") && $(\"#sim-0\").is(\":checked\") && $(\"#cancel-0\").is(\":checked\")) {\n\t\t\n\t\thideHugoFunc(\".hugo-1101\");\t// 1101\n\n\t} else if ($(\"#cover-0\").is(\":checked\") && $(\"#pass-0\").is(\":checked\") && $(\"#cancel-0\").is(\":checked\")) {\n\t\t\n\t\thideHugoFunc(\".hugo-1011\");\t// 1011\n\n\t} else if ($(\"#sim-0\").is(\":checked\") && $(\"#pass-0\").is(\":checked\") && $(\"#cancel-0\").is(\":checked\")) {\n\t\t\n\t\thideHugoFunc(\".hugo-0111\");\t// 0111\t\n\n\t//Two Active\t\n\n\t} else if ($(\"#cover-0\").is(\":checked\") && $(\"#sim-0\").is(\":checked\")) {\n\t\t\n\t\thideHugoFunc(\".hugo-1100\");\t// 1100\t\n\n\t} else if ($(\"#cover-0\").is(\":checked\") && $(\"#pass-0\").is(\":checked\")) {\n\t\t\n\t\thideHugoFunc(\".hugo-1010\");\t// 1010\t\t\n\n\t} else if ($(\"#cover-0\").is(\":checked\") && $(\"#cancel-0\").is(\":checked\")) {\n\t\t\n\t\thideHugoFunc(\".hugo-1001\");\t// 1001\n\n\t} else if ($(\"#sim-0\").is(\":checked\") && $(\"#cancel-0\").is(\":checked\")) {\n\t\t\n\t\thideHugoFunc(\".hugo-0101\");\t// 0101\n\n\t} else if ($(\"#sim-0\").is(\":checked\") && $(\"#pass-0\").is(\":checked\")) {\n\t\t\n\t\thideHugoFunc(\".hugo-0110\");\t// 0110\n\n\t} else if ($(\"#pass-0\").is(\":checked\") && $(\"#cancel-0\").is(\":checked\")) {\n\t\t\n\t\thideHugoFunc(\".hugo-0011\");\t// 0011\t\t\n\n\t//One Active\n\n\t} else if ($(\"#cover-0\").is(\":checked\")) {\n\t\t\n\t\thideHugoFunc(\".hugo-1000\");\t// 1000\t\n\n\t} else if ($(\"#sim-0\").is(\":checked\")) {\n\t\t\n\t\thideHugoFunc(\".hugo-0100\");\t// 0100\n\n\t} else if ($(\"#pass-0\").is(\":checked\")) {\n\t\t\n\t\thideHugoFunc(\".hugo-0010\");\t// 0010\t\t\n\n\t} else if ($(\"#cancel-0\").is(\":checked\")) {\n\t\t\n\t\thideHugoFunc(\".hugo-0001\");\t// 0001\n\n\t//None\t\n\n\t} else {\n\n\t\thideHugoFunc(\".hugo-0000\");\t// default - 0000\n\n\t}\n\t\n\tif ($(\"#cover-0\").is(\":checked\")) {\n\t\t$(\"#addon-1\").addClass(\"showAddOn\");\n\t} else {\n\t\t$(\"#addon-1\").removeClass(\"showAddOn\");\n\t}\n\t\n\tif ($(\"#sim-0\").is(\":checked\")) {\n\t\t$(\"#addon-2\").addClass(\"showAddOn\");\n\t} else {\n\t\t$(\"#addon-2\").removeClass(\"showAddOn\");\n\t}\t\n\t\n\tif ($(\"#pass-0\").is(\":checked\")) {\n\t\t$(\"#addon-3\").addClass(\"showAddOn\");\n\t} else {\n\t\t$(\"#addon-3\").removeClass(\"showAddOn\");\n\t}\t\n\n\tif ($(\"#cancel-0\").is(\":checked\")) {\n\t\t$(\"#addon-4\").addClass(\"showAddOn\");\n\t} else {\n\t\t$(\"#addon-4\").removeClass(\"showAddOn\");\n\t}\n}", "function renderHomePage() {\n var items = $('.cvt-report li');\n if (items) {\n items.remove();\n }\n \n var page = $('.home');\n page.addClass('visible');\n }", "function checkVisits(){\n\t\tif(localStorage.visits == 1){\n\t\t\t//No class will be toggled, the popup will remain invisible to user and screenreader.\n\t\t\tconsole.log(\"User has visited this site before.\");\n\t\t}else{\n\t\t\tsetTimeout(makeVisible, 3000); //Delays the popup for 3 seconds\n\t\t\tconsole.log(\"User has never visited this site before.\");\n\t\t}\n\t}", "isValidHome(id, rect){\n var self = this;\n var iteration = this.props.reduxLayout.map(function(entry){\n if(entry.get(\"id\") != id){\n var cRect = self.prepRect(entry);\n if(self.intersects(rect, cRect,0)) {\n return false\n }\n else if(rect.left<0 || rect.top<0 || rect.left + rect.width > self.props.reduxScreenWidth || rect.top + rect.height > self.props.reduxScreenHeight){\n return false;\n }\n else return true;\n }\n });\n if(iteration.includes(false)) return false;\n else return true;\n }", "function testHomePage() {\n // Just enter LE Page\n var activeAuctionsList,\n activeAuction,\n loginDialog,\n dialogButtons,\n cancelLoginButton,\n regButton,\n regCloseButton;\n\n controller.open(PAGE_SOURCE);\n controller.waitForPageLoad();\n controller.sleep(15000);\n\n // Check active auctions panel on home page\n activeAuctionsList = controller.tabs.activeTab.querySelectorAll(\".trip-item-wrapper\");\n\n // Transform a node into an element\n activeAuction = new elementslib.Elem(activeAuctionsList[0]);\n\n controller.click(activeAuction);\n\n dialogButtons = controller.tabs.activeTab.querySelectorAll(\".x-btn-center\");\n cancelLoginButton = new elementslib.Elem(dialogButtons[14]);\n\n controller.waitForElement(cancelLoginButton, 5000);\n controller.click(cancelLoginButton);\n\n regButton = new elementslib.Selector(controller.tabs.activeTab,\n\t \".registration-button-center\");\n controller.click(regButton);\n controller.waitForPageLoad();\n\n regCloseButton = new elementslib.Selector(controller.tabs.activeTab, \".x-tool-close\");\n controller.click(regCloseButton);\n}", "function checkAuthorised() {\n var loggedIn = isLoggedIn();\n $q.when(loggedIn, function (res) {\n if (res.data === false) {\n state.go('home');\n }\n });\n }", "function is_it_salty_in_here(home) {\n // create request to create a new session\n fetch(\"https://fiber.salt.ch/en\", {\n method: 'GET'\n });\n\n return fetch(\"https://fiber.salt.ch/fiber-ui-service/public/eligibility/fiber/address/check\", {\n method: 'POST',\n credentials: 'include',\n headers: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': 'application/json',\n\t\t\t\t'User-Agent': '(Comparis-Fiber-Checker github/b401)'\n },\n body: JSON.stringify(home)\n })\n .then(response => response.json())\n .catch(error => {\n console.log(error);\n });\n}", "homeClicked() {\n this.props.navChanged(\"Home\");\n }", "function check() {\n if (sessionStorage.getItem('type') == null) {\n //returns the user to the index page if not a valid user\n window.location.href = \"index.html\";\n }\n \n}", "async function home(evt) {\n evt.preventDefault();\n hidePageComponents();\n currentUser = await checkForUser();\n\n if (currentUser.userId !== undefined) {\n hidePageComponents();\n $graphs.show();\n $links.show();\n $logoutBtn.show();\n $userBtn.text(`Profile (${currentUser.username})`);\n $userBtn.show();\n } else {\n $loginContainer.show();\n $welcome.show();\n $loginBtn.show();\n $loginForm.show();\n $signupBtn.show();\n $loginBtn.addClass(\"border-bottom border-start border-3 rounded\");\n }\n}", "doHomework() {\n this.homeworkDone = true;\n }" ]
[ "0.7579653", "0.7010302", "0.69425005", "0.6913471", "0.6874251", "0.6720546", "0.6662882", "0.6454105", "0.6404019", "0.63230604", "0.63128626", "0.63128626", "0.63128626", "0.6297328", "0.6294323", "0.62893623", "0.6123589", "0.6112723", "0.6093868", "0.604046", "0.600343", "0.5948485", "0.592323", "0.5904777", "0.5900516", "0.5877773", "0.58615214", "0.58256954", "0.58189183", "0.5786394", "0.5777806", "0.5773069", "0.5769013", "0.5754683", "0.5752534", "0.57284796", "0.5727403", "0.5727097", "0.57213545", "0.5709536", "0.5671039", "0.56600827", "0.56567025", "0.56547296", "0.56472725", "0.5646745", "0.56420404", "0.562888", "0.5621752", "0.5618568", "0.56166965", "0.56154585", "0.56111926", "0.5610661", "0.56063855", "0.5591024", "0.5586297", "0.558275", "0.55825436", "0.557412", "0.55628645", "0.555947", "0.5556498", "0.5553468", "0.5552212", "0.55456", "0.5545527", "0.5545032", "0.5532768", "0.55324453", "0.552581", "0.55142105", "0.54924715", "0.5489023", "0.54860616", "0.54844695", "0.548059", "0.54665494", "0.54592913", "0.5457687", "0.5452995", "0.54368603", "0.54359037", "0.54313266", "0.54160154", "0.5415671", "0.54114646", "0.54088795", "0.54063964", "0.5398986", "0.53888714", "0.53873605", "0.5380023", "0.53695065", "0.536934", "0.53673184", "0.5366051", "0.5365567", "0.5360069", "0.5359064" ]
0.75523907
1
checks if all fields are filled in correct and adds a shift
function addShifts() { var data = { selectedDates: [], shifts: [] }; vm.message = null; data.selectedDates = vm.selectedDates; if (data.selectedDates.length == 0) { vm.message = { 'title': 'No dates selected', 'content': 'Please select at least one date.', 'icon': 'fa-exclamation', 'type': 'alert-danger' } } else { for (var i = 0; i < vm.users.length; i++) { if (vm.users[i].checked) { data.shifts.push({ userId: vm.users[i].id, shiftId: vm.users[i].newShift, home: (vm.users[i].home == undefined) ? 0 : vm.users[i].home, description: vm.users[i].description }); } } if (data.shifts.length == 0) { vm.message = { 'title': 'No users selected', 'content': 'Please select at least one user.', 'icon': 'fa-exclamation', 'type': 'alert-danger' } } else { vm.dataLoading = true; Api.shifts.add(data).then(function () { vm.message = { 'title': 'Selected users are planned', 'content': 'The selected users are planned for the selected dates.', 'icon': 'fa-check', 'type': 'alert-success' }; for (var i = 0; i < vm.users.length; i++) { vm.users[i].checked = false; vm.users[i].newShift = null; vm.users[i].home = null; vm.users[i].description = null; } // Dirty hax, destroys datepicker and build it up again instead of clearing. datepicker.datepicker('destroy'); datepicker.datepicker({ multidate: true, todayHighlight: true, startDate: startDate }); }).finally(function () { vm.dataLoading = false; }); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validate() {\n let posOfSpace = this.ins.indexOf(\" \");\n let operandRS = \"\";\n let operandRT = \"\";\n let operandRD = \"\";\n let SHAMT = \"\";\n if (this.operator == \"jr\") {\n operandRS = this.ins.substring(posOfSpace + 1, this.ins.length);\n }\n else if (this.operator == \"sll\" || this.operator == \"srl\" || this.operator == \"sra\") {\n let operands = this.ins.substring(posOfSpace + 1, this.ins.length).split(\",\", 3);\n operandRD = operands[0];\n operandRT = operands[1];\n SHAMT = operands[2];\n }\n else {\n let operands = this.ins.substring(posOfSpace + 1, this.ins.length).split(\",\", 3);\n operandRD = operands[0];\n operandRS = operands[1];\n operandRT = operands[2];\n }\n let patt1 = /^[0-9]+$/;\n let patt2 = /^[a-z0-9]+$/;\n let patt3 = /^(\\+)?\\d+$/;\n if ((!(SHAMT == \"\" || patt3.test(SHAMT))) || (patt3.test(SHAMT) && +SHAMT >= 32)) {\n this.errMsg = this.errMsg + \"Error 209: Invalid shift amount. -- \" + this.getIns() + \"\\n\";\n return false;\n }\n let operands = [operandRS, operandRT, operandRD];\n let i;\n for (i = 0; i < operands.length; i++) {\n let operand = operands[i].substring(1, operands[i].length);\n if (operands[i].charAt(0) == \"$\" && patt1.test(operand) && +operand > 31) {\n this.errMsg = this.errMsg + \"Error 210: Invalid operand. -- \" + this.getIns() + \"\\n\";\n return false;\n }\n else if (operands[i] == \"\" || (operands[i].charAt(0) == \"$\" && patt1.test(operand) && +operand <= 31)) {\n continue;\n }\n else if (operands[i].charAt(0) == \"$\" && patt2.test(operand)) {\n if (MapForRegister_1.MapForRegister.getMap().has(operand)) {\n let operandID = MapForRegister_1.MapForRegister.getMap().get(operand);\n if (operandID == undefined) {\n this.errMsg = this.errMsg + \"Error 211: Invalid operand. -- \" + this.getIns() + \"\\n\";\n return false;\n }\n else {\n this.ins = this.ins.replace(operand, operandID);\n }\n }\n else {\n this.errMsg = this.errMsg + \"Error 212: Invalid operand. -- \" + this.getIns() + \"\\n\";\n return false;\n }\n }\n else {\n this.errMsg = this.errMsg + \"Error 213: Invalid operand. -- \" + this.getIns() + \"\\n\";\n return false;\n }\n }\n return true;\n }", "function addShift()\r\n{\r\n if(validatetime())\r\n {\r\n var startString = form.starttime.value;\r\n var endString = form.endtime.value;\r\n\r\n var startMoment = moment(startString, \"HH:mm\");\r\n var endMoment = moment(endString, \"HH:mm\");\r\n\r\n // return difference in hours as a float\r\n var difference = endMoment.diff(startMoment, 'hours', true);\r\n\r\n // Account for breaks (add in error checking for no break added)\r\n var breakString = form.breakMin.value;\r\n var breakLengthString = form.breakLength.value;\r\n\r\n // Convert break to float\r\n var breakFloat = parseFloat(breakString);\r\n\r\n // Check if break is applied\r\n if (difference > breakFloat)\r\n {\r\n // Convert break in minutes to break to hours\r\n var breakLengthFloat = (parseFloat(breakLengthString) / 60);\r\n\r\n // Apply to shift\r\n difference = difference - breakLengthFloat;\r\n }\r\n\r\n // Output difference\r\n totalHours = totalHours + difference;\r\n document.getElementById(\"hours\").innerHTML = totalHours.toFixed(2);\r\n\r\n // Get total pay\r\n var payRateString = form.payrate.value;\r\n // Determine which list is being used to select pay\r\n\r\n\r\n // Find pay for shift\r\n var shiftPay = parseFloat(payRateString) * difference;\r\n\r\n // Add to total pay\r\n totalPay = totalPay + shiftPay;\r\n\r\n // Update HTML\r\n document.getElementById(\"pay\").innerHTML = \"$\" + totalPay.toFixed(2);\r\n \r\n // Update table\r\n updateTable(startString, endString, difference.toFixed(2), payRateString, shiftPay.toFixed(2));\r\n\r\n // Save minimum break and break length to google storage\r\n chrome.storage.sync.set({'shift': breakString, 'break': breakLengthString}, function() {\r\n console.log('Min shift length saved as' + breakString);\r\n console.log('Break length saved as' + breakLengthString);\r\n });\r\n }\r\n}", "updateShift(delta) {\n\t\tthis.shift = constrain(this.shift+delta, -56*this.whiteKeyWidth+1199, 0);\n\t}", "function ShiftForm() {\n const [input, setInput] = useState({\n people: \"\",\n pay: \"\",\n startTime: \"\",\n endTime: \"\",\n department: \"\",\n role: \"\",\n });\n\n const [days, setDays] = useState({\n monday: false,\n tuesday: false,\n wednesday: false,\n thursday: false,\n friday: false,\n saturday: false,\n sunday: false,\n });\n\n const [error, setError] = useState({\n department: \"\",\n role: \"\",\n people: \"\",\n pay: \"\",\n errorStart: \"\",\n errorEnd: \"\",\n days: \"\",\n });\n\n const departments = [\"kitchen\", \"service\", \"bagels\"];\n const roles = [\n { role: \"chef\", department: \"kitchen\" },\n { role: \"sous chef\", department: \"kitchen\" },\n { role: \"cashier\", department: \"service\" },\n { role: \"line\", department: \"service\" },\n { role: \"expo\", department: \"service\" },\n { role: \"starters\", department: \"bagels\" },\n { role: \"dough\", department: \"bagels\" },\n { role: \"production\", department: \"bagels\" },\n ];\n\n const handleChange = (e) => {\n setInput({ ...input, [e.target.name]: e.target.value });\n validateInput(e);\n };\n\n const handleChangeDay = (e) => {\n const dayStatus = days[e.target.name];\n setDays({ ...days, [e.target.name]: !dayStatus });\n validateDaysInput(e);\n };\n\n const handleBlur = (e) => {\n e.target.name === \"pay\" && error.pay === \"\"\n ? handleBlurPay(e)\n : validateInput(e);\n };\n\n const handleBlurPay = (e) => {\n setInput({ ...input, pay: FormatNumToDollars(e.target.value) });\n };\n\n const validateInput = (e) => {\n let errorMessage = GetErrorMessage(e.target.name, e.target.value);\n setError({ ...error, [e.target.name]: errorMessage });\n };\n\n const validateDaysInput = (e) => {\n let numDaysChecked = getNumDaysChecked();\n if (e.target.checked === true || numDaysChecked > 1) {\n setError({ ...error, days: \"\" });\n } else if (numDaysChecked === 1 && e.target.checked === false) {\n setError({\n ...error,\n days: \"Select at least one day.\",\n });\n }\n };\n\n const getNumDaysChecked = () => {\n let numDaysChecked = 0;\n Object.entries(days).forEach((day) => {\n let dayBoolean = day[1];\n if (dayBoolean === true) numDaysChecked++;\n });\n return numDaysChecked;\n };\n\n const handleDelete = () => {};\n\n const handleSave = (e) => {\n e.preventDefault();\n validateAllInputs();\n };\n\n const validateAllInputs = () => {\n let errors = {\n days: GetErrorMessage(\"days\", days),\n };\n\n Object.keys(input).forEach((key) => {\n errors[key] = GetErrorMessage(key, input[key]);\n });\n\n setError(errors);\n };\n\n return (\n <main className=\"main\">\n <form className=\"form\">\n <fieldset className=\"fieldset_form\">\n <FormDeleteButton handleDelete={handleDelete} />\n <ShiftFormDepartment\n handleChange={(e) => handleChange(e)}\n value={input.department}\n options={departments}\n error={error.department}\n />\n <ShiftFormRole\n handleChange={(e) => handleChange(e)}\n value={input.role}\n department={input.department}\n options={roles}\n error={error.role}\n />\n <ShiftFormPeople\n handleChange={(e) => handleChange(e)}\n value={input.people}\n error={error.people}\n handleBlur={handleBlur}\n />\n <ShiftFormPay\n handleChange={(e) => handleChange(e)}\n value={input.pay}\n error={error.pay}\n handleBlur={handleBlur}\n />\n <ShiftFormTime\n handleChange={(e) => handleChange(e)}\n startTime={input.startTime}\n endTime={input.endTime}\n errorStart={error.startTime}\n errorEnd={error.endTime}\n />\n <ShiftFormDays\n days={days}\n handleChangeDay={(e) => handleChangeDay(e)}\n error={error.days}\n />\n <FormSaveButton handleSave={handleSave} />\n </fieldset>\n </form>\n </main>\n );\n}", "_validateITOInfoForm(form)\r\n\t{\r\n\t\tvar availableShiftList=[];\r\n\t\tvar ito={};\r\n\t\tvar result=true;\r\n\t\tvar self=this;\r\n\t\t\r\n\t\tif (form.itoId.value==\"\")\r\n\t\t\tito.itoid=form.postName.value+\"_\"+form.joinDate.value;\r\n\t\telse\t\r\n\t\t\tito.itoid=form.itoId.value;\r\n\t\tito.itoname=form.itoName.value;\r\n\t\tito.postName=form.postName.value;\r\n\t\tito.workingHourPerDay=form.workingHourPerDay.value;\r\n\t\tito.joinDate=new Date(self.adminUtility.getUTCDateObj(form.joinDate.value));\r\n\t\tito.leaveDate=new Date(self.adminUtility.getUTCDateObj(form.leaveDate.value));\r\n\t\t\r\n\t\tif ($(\"input[name='availableShiftList']:checked\").length==0)\r\n\t\t\tthrow \"Please select an available shift type.\";\r\n\t\telse\r\n\t\t{\r\n\t\t\tform.availableShiftList.forEach(function(inputItem){\r\n\t\t\t\tif (inputItem.checked)\r\n\t\t\t\t\tavailableShiftList.push(inputItem.value);\r\n\t\t\t});\r\n\t\t\tito.availableShiftList=availableShiftList;\r\n\t\t\tif ($(form).find(\"input[name='blackListShiftPatternList']\").length==0)\r\n\t\t\t{\r\n\t\t\t\tthrow \"Black Listed Shift Type must be included.\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tvar shiftType;\r\n\t\t\t\tresult=true;\r\n\t\t\t\tfor (var i=0;i<$(form.blackListShiftPatternList).length;i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar blackListShiftPatternList=$(form.blackListShiftPatternList)[i].value.split(\",\");\r\n\t\t\t\t\tfor (var j=0;j<blackListShiftPatternList.length;j++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tshiftType=blackListShiftPatternList[j];\r\n\t\t\t\t\t\tif ($.inArray(shiftType,availableShiftList)==-1)\r\n\t\t\t\t\t\t{\t\r\n\t\t\t\t\t\t\tresult=false;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (result==false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$(form.blackListShiftPatternList)[i].focus();\r\n\t\t\t\t\t\tthrow \"Invalid shift type entered.\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\tif (result==true)\r\n\t\t\t\t{\r\n\t\t\t\t\tito.blackListedShiftPatternList=[];\r\n\t\t\t\t\tfor (var i=0;i<$(form.blackListShiftPatternList).length;i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tito.blackListedShiftPatternList.push($(form.blackListShiftPatternList)[i].value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn ito;\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t}\r\n\t}", "function checkEntriesValidity() {\n var entry;\n for (var i = 0; i < sched_id; i++) {\n var entry = \"SCHEDULE_INPUT\";\n\n if (i != 0) {\n // update ids\n entry += i;\n entry_t = document.getElementById(entry);\n if (entry_t !== null) {\n\n if (entry_t.value == \"\") {\n alert(\"ERROR: PLEASE ENTER VALID PLACES BEFORE ADDING MORE ROWS\");\n return false;\n }\n }\n }\n else {\n // take as is\n entry_t = document.getElementById(entry);\n if (entry_t.value == \"\") {\n alert(\"ERROR: PLEASE ENTER VALID TIMES BEFORE ADDING MORE ROWS\");\n return false;\n }\n\n }\n }\n return true;\n}", "function fillAccountNo(thisField) \n{\n if (thisField.value.length < 12) {\n if (thisField.value.charAt(0) == \"0\") {\n var temp = \"00000000000\" + thisField.value ;\n thisField.value = temp.substring(temp.length-12);\n }\n }\n return true ;\n}", "handleSave() {\n const { employeeAdjacentShifts, startTime, endTime, employeeID, index } = this.state\n const currentShift = employeeAdjacentShifts[1];\n const previousShiftEndTime = employeeAdjacentShifts[0] ? moment(employeeAdjacentShifts[0].end_time) : null;\n const nextShiftStartTime = employeeAdjacentShifts[2] ? moment(employeeAdjacentShifts[2].start_time) : null;\n const updatedStartTime = Utils.getUpdatedTimeInMoment(currentShift.start_time, startTime);\n const updatedEndTime = Utils.getUpdatedTimeInMoment(currentShift.end_time, endTime);\n\n //check if shift times are updated\n const currentShiftStartTime = currentShift.start_time;\n const currentShiftEndTime = currentShift.end_time;\n if (moment(currentShiftStartTime).diff(updatedStartTime, 'minutes') == 0 &&\n moment(currentShiftEndTime).diff(updatedEndTime, 'minutes') == 0) {\n //shift times are not updated\n this.handleClose();\n } else {\n //shift times have been updated\n let showError = null;\n let errorMsg = Constants.VALIDATION_BACK_TO_BACK;\n if (previousShiftEndTime) {\n showError = this.compareShiftTime(updatedStartTime, previousShiftEndTime);\n }\n\n if (!showError && nextShiftStartTime) {\n showError = this.compareShiftTime(nextShiftStartTime, updatedEndTime);\n }\n\n if (!showError) {\n const diff = updatedEndTime.diff(updatedStartTime, 'minutes') / 60;\n if (diff > 8.5) {\n showError = true;\n errorMsg = Constants.VALIDATION_MAX_SHIFT_TIME;\n } else if (diff <= currentShift.break_duration / 3600) {\n showError = true;\n errorMsg = Constants.VALIDATION_ALLOCATE_PREFIX + currentShift.break_duration / 3600 + Constants.VALIDATION_ALLOCATE_SUFFIX;\n }\n }\n\n if (!showError) {\n //time ranges are valid, proceed to save\n this.props.updateEmployeeShift(employeeID, index, updatedStartTime.format(Constants.DATE_TIME_FORMAT), updatedEndTime.format(Constants.DATE_TIME_FORMAT));\n } else {\n this.setState({\n showError,\n errorMsg\n })\n }\n }\n }", "function update_meta_and_breakdown_info(shift_info, meta, breakdown_info) {\n var day = moment(shift_info.day, 'MMMM Do YYYY').format('ddd')\n //Clock in\n if (shift_info.actualStart.status == \"arrived late\") {\n meta.arrivedLate++;\n breakdown_info.punctual_day[day].notPunctual++;\n meta.timeSaved += shift_info.actualStart.diffInt;\n } else if (shift_info.actualStart.status == \"arrived early\") {\n meta.timeSaved -= shift_info.actualStart.diffInt;\n if (shift_info.actualStart.diffInt < 30) {\n //forgive being 0-30 minutes early for shift\n meta.punctual++;\n breakdown_info.punctual_day[day].punctual++;\n shift_info.actualStart.status = \"on time\"\n } else {\n meta.arrivedEarly++;\n breakdown_info.punctual_day[day].notPunctual++;\n }\n } else if (shift_info.actualStart.status == \"no time clocked\") {\n meta.didNotClock++;\n } else {\n meta.punctual++;\n breakdown_info.punctual_day[day].punctual++;\n }\n\n //Clock out\n if (shift_info.actualFinish.status == \"left late\") {\n meta.punctual++;\n breakdown_info.punctual_day[day].punctual++;\n meta.timeSaved -= shift_info.actualFinish.diffInt;\n if (shift_info.actualFinish.diffInt < 30) {\n //don't worry about leaving 0-30 min late\n shift_info.actualFinish.status = \"on time\"\n }\n } else if (shift_info.actualFinish.status == \"left early\") {\n meta.leftEarly++;\n breakdown_info.punctual_day[day].notPunctual++;\n meta.timeSaved += shift_info.actualFinish.diffInt;\n } else if (shift_info.actualFinish.status == \"no time clocked\") {\n meta.didNotClock++;\n } else {\n meta.punctual++;\n breakdown_info.punctual_day[day].punctual++;\n }\n}", "function user_reminder_new_address() {\n //IF ALL FIELDS OF [NEW ADDRESS] ARE SET\n if ($('#new_street').val() != \"\" &&\n $('#new_zipcode').val() != \"\" &&\n $('#new_city').val() != \"\" &&\n $('#new_unit').val() != \"\" && \n $('#new_state').val() != \"\") {\n //IF NAME, PHONE OR EMAIL ARE NOT SET\n if ($('#first_name').val() == \"\" ||\n $('#last_name').val() == \"\" ||\n $('#telephone').val() == \"\" ||\n $('#email').val() == \"\") {\n //SHOW ALERT\n $('#alert-forgotten').removeClass('hide');\n };\n //true = new address\n check_all_inputs(true);\n }\n}", "function shouldShift(comm_arr, event){\n \n if((!inLiveHours()) && (comm_arr.length > 0)){\n var workHours = ('workHours' in comm_arr[0]) ? comm_arr[0].workHours : true //if no workHours field is set, assume it needs to be processed only in work hours\n \n if(workHours){\n console.log('shifting event');\n shiftEvents([event])\n return true\n }\n }\n \n return false\n}", "function makeShift () {\n insertToTextField(firstString);\n setTimeout (function () {\n insertToTextField(publicKeyString);\n }, 6000);;\n \n }", "shiftLeft() {\n for (let line of this.cells) {\n for (let i = 0; i < line.length - 1; i++) {\n line[i].setType(line[i + 1].type);\n }\n line[line.length - 1].setType(BeadType.default);\n }\n }", "function checkFields() {\n\t$('#appointmentInput > input').keyup(function() {\n\n var empty = false;\n $('#appointmentInput > input').each(function() {\n if ($(this).val() == '') {\n empty = true;\n }\n });\n \n if (!empty) {\n \t$('#saveAppointment').removeAttr('disabled'); \n }\n });\n}", "function isHoursNew(field,name)\n{\n\tvar str =field.value;\n\tif(isNaN(str) || str.substring(0,1)==\"-\" || str.substring(0,1)==\"+\")\n\t{\n\t\talert(\"\\n\"+name+\" field accepts numbers and decimals only. Enter a valid time value.\");\n\t\tfield.select();\n\t\tfield.focus();\n\t\treturn false;\n\t}\n\t/*if(str<0)\n\t{\n\t\talert(\"You have entered Invalid Hours, Please enter a value between 0 and 24.\");\n\t\tfield.select();\n\t\tfield.focus();\n\t\treturn false;\n\t}*/\n\treturn true;\n}", "function pwSuiteFieldsFilled() {\n return (!($(\".currentPW\").val().length === 0) && (!($('#newSuite').val().length === 0)))\n}", "function fixInconsistentFields(records) {\n var fields = findIncompleteFields(records);\n patchMissingFields(records, fields);\n }", "function validateInputs() {\n\n let isValid = true;\n\n if (workoutType === \"resistance\") {\n if (nameInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (weightInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (setsInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (repsInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (resistanceDurationInput.value.trim() === \"\") {\n isValid = false;\n }\n } else if (workoutType === \"cardio\") {\n if (cardioNameInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (durationInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (distanceInput.value.trim() === \"\") {\n isValid = false;\n }\n }\n\n if (isValid) {\n completeButton.removeAttribute(\"disabled\");\n addButton.removeAttribute(\"disabled\");\n } else {\n completeButton.setAttribute(\"disabled\", true);\n addButton.setAttribute(\"disabled\", true);\n }\n }", "function checkFieldsOfBoardManager() {\n if($(\"#input-board-size-tile:invalid, #input-board-nb-tiles:invalid\").length === 0) {\n if($(__RESET_BUTTON__).attr(\"disabled\"))\n $(__RESET_BUTTON__).attr(\"disabled\", false);\n } else {\n if(!$(__RESET_BUTTON__).attr(\"disabled\"))\n $(__RESET_BUTTON__).attr(\"disabled\", true);\n }\n if($(\"#input-board-time-between-generations:invalid\").length === 0) {\n if(nbTiles !== 0 && $(__RUN_BUTTON__).attr(\"disabled\"))\n $(__RUN_BUTTON__).attr(\"disabled\", false);\n } else {\n if(!$(__RUN_BUTTON__).attr(\"disabled\"))\n $(__RUN_BUTTON__).attr(\"disabled\", true);\n }\n}", "_setRequiredFields() {\n const that = this;\n\n if (!that.requiredFields || !that.requiredFields.length) {\n return;\n }\n\n const currentValue = that.value;\n let reqGroup = [];\n\n for (let i = 0; i < that.requiredFields.length; i++) {\n const reqField = that.requiredFields[i],\n field = that.fields.find(field => field.dataField === reqField);\n\n if (field) {\n let valueRecords = [];\n\n if (currentValue) {\n let i = 0;\n\n //Doing a lookup on the value for records that contain 'requiredFields'\n //Modifies the value dynamically\n while (i < currentValue.length) {\n const val = currentValue[i];\n\n if (Array.isArray(val)) {\n let r = 0;\n\n while (r < val.length) {\n let record = val[r];\n\n if (record && record[0] === field.dataField) {\n valueRecords.push(record);\n val.splice(r > 0 ? r - 1 : r, 2);\n continue;\n }\n\n r++;\n }\n }\n\n if (!val.length) {\n currentValue.splice(i, 2);\n continue;\n }\n\n i++;\n }\n }\n\n //Check if group records exist inside value\n if (valueRecords) {\n for (let r = 0; r < valueRecords.length; r++) {\n reqGroup.push(valueRecords[r]);\n reqGroup.push('and');\n }\n }\n else {\n //If no records create a placeholder\n reqGroup.push([reqField]);\n reqGroup.push('and');\n }\n }\n }\n\n //Remove the lastly added 'and' condition\n if (typeof reqGroup[reqGroup.length - 1] === 'string') {\n reqGroup.pop();\n }\n\n //Add the Required Fields on Top of the value\n that.value.unshift(reqGroup, 'and')\n }", "static calculatePossibleFields() {\n // Findes des eigenen Königs\n let unmovedKingField = this.findFirstField(Figure.FIGURETYPES.King, chessGame.activePlayerColor);\n let numberLegalHittableFields = 0;\n for (let row of chessGame.fields) {\n for (let field of row) {\n // Aussortieren der gegnerischen Figuren\n if (field.isOccupied && field.figure.color.equals(chessGame.activePlayerColor)) {\n // begehbare Felder der Figur berechnen\n let hittableFields = HittableFieldsCalculator.getHittableFields(field);\n let trueHittableFields = [];\n\n // Überprüfung, ob das Feld der König ist\n let isKing = field.figure.figureType === Figure.FIGURETYPES.King;\n for (let hittableField of hittableFields) {\n // Kurzzeitiges Bewegen der Figur während die alte Position gespeichert bleibt\n let oldFieldFigure = field.figure;\n let oldHittableFieldFigure = hittableField.figure;\n chessGame.move(field, hittableField);\n // Wenn das Feld der König ist wird überprüft, ob die begehbaren Felder tatsächlich begehbar sind; wenn das der Fall ist wird das Feld den begehbaren Felder hinzugefügt\n // Wenn das Feld nicht der König ist wird überprüft, ob der Zug den König Schach setzt; wenn das nicht der Fall ist wird das Feld den begehbaren Felder hinzugefügt\n if (!chessGame.getAllFieldsUnderAttack().has(isKing ? hittableField : unmovedKingField))\n trueHittableFields.push(hittableField);\n\n // Der Zug wird rückgängig gemacht\n field.figure = oldFieldFigure;\n hittableField.figure = oldHittableFieldFigure;\n }\n // die begehbaren Felder werden in der Figur gespeichert und die Anzahl der begehbaren Felder werden berechnet\n field.figure.hittableFields = trueHittableFields;\n numberLegalHittableFields += trueHittableFields.length;\n }\n }\n }\n // die Anzahl der möglichen Züge wird berechnet\n chessGame.numPossibleMoves = numberLegalHittableFields;\n }", "function employeeShiftHandler(event) {\n // shiftColumns creates an array of each column\n const shiftColumns = event.currentTarget.children[0].children;\n // stores the target of the user as a variable\n let currentTarget = event.target;\n\n // creates an empty shift object\n let shift = {};\n\n // creates variables that will be stored inside the shift object\n let employee_id = employeeInfo.id;\n let shift_date;\n let start_time;\n let end_time;\n\n // ensures that an employee has been picked before allowing changes to be made to the schedule\n if (!employee_id) {\n $('#choose-employee-modal').modal('show');\n return;\n }\n\n // creates variables that track the date of the shift and whether it is morning or afternoon\n let day;\n // sets the variable as either morning or afternoon depending on the id of the target\n let timeOfDay = currentTarget.id.split('-')[1];\n\n // console.log(shiftColumns[0].id);\n // console.log(currentTarget);\n\n // loops through the columns and finds the column that matches the parent of the target whether morning or afternoon\n for (let i = 0; i < shiftColumns.length; i++) {\n if (currentTarget.parentNode.id == shiftColumns[i].id) {\n day = shiftColumns[i].id;\n }\n }\n \n // this checks which day has been picked and sets the shift_date variable based on which day was chosen\n if (day === 'sunday') {\n shift_date = sunday.format('YYYY-MM-DD');\n } else if (day === 'monday') {\n shift_date = monday.format('YYYY-MM-DD');\n } else if (day === 'tuesday') {\n shift_date = tuesday.format('YYYY-MM-DD');\n } else if (day === 'wednesday') {\n shift_date = wednesday.format('YYYY-MM-DD');\n } else if (day === 'thursday') {\n shift_date = thursday.format('YYYY-MM-DD');\n } else if (day === 'friday') {\n shift_date = friday.format('YYYY-MM-DD');\n } else if (day === 'saturday') {\n shift_date = saturday.format('YYYY-MM-DD');\n }\n\n // checks which time of day was chosen and then appends a shift button to that column\n if (timeOfDay === 'morning') {\n // sets the start time and end time of the morning shift\n start_time = '10:00:00';\n end_time = '16:00:00';\n\n // below creates the button that is appended to the column\n let p = document.createElement('p');\n p.classList.add('badge', 'badge-dark', 'p-1');\n p.innerText = start_time + ' - ' + end_time;\n\n let button = document.createElement('button');\n button.classList.add('btn', 'btn-danger', 'p-1');\n button.setAttribute('id', 'shift-delete');\n button.setAttribute('type', 'button');\n button.setAttribute('style', 'background: transparent; border: 0;');\n\n let i = document.createElement('i');\n i.classList.add('bi', 'bi-trash');\n\n button.appendChild(i);\n p.appendChild(button);\n\n // checks if there is a button already appended and if so does not append a new one\n if (currentTarget.textContent) {\n return;\n }\n\n currentTarget.appendChild(p);\n } else if (timeOfDay === 'afternoon') {\n // sets the start time and end time as afternoon\n start_time = '16:00:00';\n end_time = '22:00:00'\n\n // creates the button that is appended to the column\n let p = document.createElement('p');\n p.classList.add('badge', 'badge-dark', 'p-1');\n p.innerText = start_time + ' - ' + end_time;\n\n let button = document.createElement('button');\n button.classList.add('btn', 'btn-danger', 'p-1');\n button.setAttribute('id', 'shift-delete');\n button.setAttribute('type', 'button');\n button.setAttribute('style', 'background: transparent; border: 0;');\n\n let i = document.createElement('i');\n i.classList.add('bi', 'bi-trash');\n\n button.appendChild(i);\n p.appendChild(button);\n\n // if there is already a appended to the column will prevent creating a duplicate\n if (currentTarget.textContent) {\n return;\n }\n\n currentTarget.appendChild(p);\n\n }\n \n // adds all of the variables to the shift object\n shift.employee_id = employee_id;\n shift.shift_date = shift_date;\n shift.start_time = start_time;\n shift.end_time = end_time;\n\n // ensures that all parts of the shift object exist and then pushes the shift to the shift rray\n if (shift.employee_id && shift.shift_date && shift.start_time && shift.end_time) {\n shiftArr.push(shift);\n } else {\n return;\n }\n \n // console.log(shiftArr);\n}", "pushIfNotCheck(possibleMoveList, fieldList, x, y, fromField, checkForCheck) {\n const cField = this.getField(fieldList, x, y)\n if (cField !== 'NA') {\n\n let everyPossibleMove = []\n\n if (checkForCheck) {\n let newFields = this.deepCopy2dArray(fieldList)\n let movePossible = false\n\n for(let i = 0; i < newFields.length; i++) {\n let fieldRow = newFields[i];\n for(let j = 0; j < fieldRow.length; j++) {\n if(fieldRow[j].getX() === x && fieldRow[j].getY() === y) {\n if (fieldRow[j].getPiece() === 'empty' || (fieldRow[j].getPiece() !== 'empty' && fieldRow[j].getPiece().getColor() !== this.getColor())) {\n movePossible = true\n fieldRow[j].setPiece(this)\n }\n }\n }\n }\n\n if (movePossible) {\n for(let i = 0; i < newFields.length; i++) {\n let fieldRow = newFields[i];\n for(let j = 0; j < fieldRow.length; j++) {\n if(fieldRow[j].getX() === fromField.getX() && fieldRow[j].getY() === fromField.getY()) {\n fieldRow[j].setPiece('empty')\n }\n }\n }\n everyPossibleMove = this.getEveryPossibleEnemyMove(newFields, false, fromField.getPiece().getColor())\n }\n }\n\n // return if check\n for (const move of everyPossibleMove) {\n if (move.x === x && move.y === y) return\n }\n\n if (cField.getPiece() !== 'empty') {\n if (cField.getPiece().getColor() !== this.getColor()) {\n possibleMoveList.push({x: cField.getX(), y: cField.getY()})\n }\n } else {\n possibleMoveList.push({x: cField.getX(), y: cField.getY()})\n }\n }\n }", "function validateInputs() {\n let isValid = true;\n\n if (workoutType === \"resistance\") {\n if (nameInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (weightInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (setsInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (repsInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (resistanceDurationInput.value.trim() === \"\") {\n isValid = false;\n }\n } else if (workoutType === \"cardio\") {\n if (cardioNameInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (durationInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (distanceInput.value.trim() === \"\") {\n isValid = false;\n }\n }\n\n if (isValid) {\n completeButton.removeAttribute(\"disabled\");\n addButton.removeAttribute(\"disabled\");\n } else {\n completeButton.setAttribute(\"disabled\", true);\n addButton.setAttribute(\"disabled\", true);\n }\n}", "fieldFormater (e) {\n const {STORE_NUMBER, TRANSACTION_NUMBER, REGISTER_NUMBER} = fieldNames;\n const {name, value} = e.target;\n const minLimit = ((name === STORE_NUMBER) || (name === TRANSACTION_NUMBER)) ? 4 : 2;\n\n if (isNaN(value) || value === '') {\n return;\n }\n\n if ([STORE_NUMBER, REGISTER_NUMBER, TRANSACTION_NUMBER].find((field) => field === name)) {\n let val = value;\n while (val.length < minLimit) {\n val = '0' + val;\n }\n this.props.change(name, val);\n }\n }", "function insertNewRecords(sourceSheet) {\n // Append items to database sheet\n var content = sourceSheet.getRange(recordRange).getValues();\n var userName = getCurrentUser();\n var inputDate = sourceSheet.getRange(inputDateCell).getValue();\n for (var i = 0; i < content.length; i++) {\n if (content[i][content[i].length - 1] == \"OK\") { // Record is Ok to submit flag:\n content[i][content[i].length - 2] = timeStringToFloat(content[i][content[i].length - 2]);\n databaseSheet.appendRow([userName, inputDate].concat(content[i].slice(0, content[i].length - 1)));\n }\n }\n // Append items to attendance sheet\n var attendData = sourceSheet.getRange(attendRange).getValues();\n attendData[0][attendData[0].length - 1] = timeStringToFloat(attendData[0][attendData[0].length - 1]);\n attandenceSheet.appendRow([userName, inputDate].concat(attendData[0]));\n SpreadsheetApp.getUi().alert('登録完了');\n}", "function shiftTiles() {\n //Mover\n for (var i = 0; i < level.columns; i++) {\n for (var j = level.rows - 1; j >= 0; j--) {\n //De baixo pra cima\n if (level.tiles[i][j].type == -1) {\n //Insere um radomico\n level.tiles[i][j].type = getRandomTile();\n } else {\n //Move para o valor que está armazenado\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j + shift)\n }\n }\n //Reseta o movimento daquele tile\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function checkInputBlankFields() {\n\t\tif ($(\"#txtOldPassword\").val() == \"\" ){\n\t\t\treturn oldPasswordBlank;\n\t\t} else if ($(\"#txtNewPassword\").val() == \"\"){\n\t\t\treturn newPasswordBlank;\n\t\t} else if ($(\"#txtNewPasswordConfirm\").val() == \"\") {\n\t\t\treturn newPasswordConfirmBlank;\n\t\t} else {\n\t\t\treturn \"\";\n\t\t}\n\t}", "function validateFields(){\n\tif(!getValue('nombreID')\n\t\t|| !getValue('contactoID') \n\t\t|| !getValue('estadoID')\n\t\t|| !getValue('ciudadID') \n\t\t|| !getValue('shortDesc') \n\t\t|| !getValue('longDesc')\n\t\t|| !isChecked('lblCheck'))\n\t\treturn 0;\n\telse\n\t\treturn 1;\n}", "function prePopulateRMFields(){\n\ttry{\n\t\tvar alreadyPrepopulated = false;\n\t\tif(!alreadyPrepopulated){\n\t\t\tvar userNameElements = document.getElementsByName(\"userName\");\n\t\t\tuserNameElements = getActiveElements(userNameElements);\n\t\t\tvar userNameValue = getUserNameValue();\n\t\t\tif(userNameValue!=\"\"){\n\t\t\t\tfor(i=0;i<userNameElements.length;i++){\n\t\t\t\t\tuserNameElements[i].value = userNameValue;\n\t\t\t\t\talreadyPrepopulated = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(!alreadyPrepopulated){\n\t\t\tvar npaElements = document.getElementsByName(\"npa\");\n\t\t\tvar nxxElements = document.getElementsByName(\"nxx\");\n\t\t\tvar lineNumber = document.getElementsByName(\"lineNumber\");\n\t\t\tvar npaNxxLineArray = getTNValue();\n\t\t\tnpaElements = getActiveElements(npaElements);\n\t\t\tnxxElements = getActiveElements(nxxElements);\n\t\t\tlineNumber = getActiveElements(lineNumber);\n\t\t\tif(npaElements.length>0 && nxxElements.length>0 && lineNumber.length>0){\n\t\t\t\tif(!(npaNxxLineArray[0] == \"\" || npaNxxLineArray[1] == \"\"\n\t\t\t\t\t\t\t\t\t|| npaNxxLineArray[2] == \"\")){\n\t\t\t\t\tfor(i=0;i<npaElements.length;i++){\n\t\t\t\t\t\tnpaElements[i].value = npaNxxLineArray[0];\n\t\t\t\t\t\tnxxElements[i].value = npaNxxLineArray[1];\n\t\t\t\t\t\tlineNumber[i].value = npaNxxLineArray[2];\n\t\t\t\t\t}\n\t\t\t\t\talreadyPrepopulated = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!alreadyPrepopulated){\n\t\t\tvar addressLineElements = document.getElementsByName(\"add1\");\n\t\t\tvar unitTypeElements = document.getElementsByName(\"unitT\");\n\t\t\tvar unitNumberElements = document.getElementsByName(\"unitNumber\");\n\t\t\tvar cityElements = document.getElementsByName(\"city\");\n\t\t\tvar addressStateElements = document.getElementsByName(\"addressState\");\n\t\t\tvar addresszipElements = document.getElementsByName(\"addresszip\");\n\t\t\taddressLineElements = getActiveElements(addressLineElements);\n\t\t\tunitTypeElements = getActiveElements(unitTypeElements);\n\t\t\tunitNumberElements = getActiveElements(unitNumberElements);\n\t\t\tcityElements = getActiveElements(cityElements);\n\t\t\taddressStateElements = getActiveElements(addressStateElements);\n\t\t\taddresszipElements = getActiveElements(addresszipElements);\n\t\t\tvar addressArray = getAddressValue();\n\t\t\tif(addressArray[0]!=\"\"){\n\t\t\t\tfor(i=0;i<addressLineElements.length;i++){\n\t\t\t\t\taddressLineElements[i].value = addressArray[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(addressArray[1]!=\"\"){\n\t\t\t\tfor(i=0;i<unitTypeElements.length;i++){\n\t\t\t\t\tunitTypeElements[i].value = addressArray[1];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(addressArray[2]!=\"\"){\n\t\t\t\tfor(i=0;i<unitNumberElements.length;i++){\n\t\t\t\t\tunitNumberElements[i].value = addressArray[2];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(addressArray[3]!=\"\"){\n\t\t\t\tfor(i=0;i<cityElements.length;i++){\n\t\t\t\t\tcityElements[i].value = addressArray[3];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(addressArray[4]!=\"\"){\n\t\t\t\tfor(i=0;i<addressStateElements.length;i++){\n\t\t\t\t\taddressStateElements[i].value = addressArray[4];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(addressArray[5]!=\"\"){\n\t\t\t\tfor(i=0;i<addresszipElements.length;i++){\n\t\t\t\t\taddresszipElements[i].value = addressArray[5];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!alreadyPrepopulated){\n\t\t\tvar zipCodeElements = document.getElementsByName(\"addresszip\");\n\t\t\tzipCodeElements = getActiveElements(zipCodeElements);\n\t\t\tvar zipValue = getZipValue();\n\t\t\tif(zipValue!=\"\"){\n\t\t\t\tfor(i=0;i<zipCodeElements.length;i++){\n\t\t\t\t\tzipCodeElements[i].value = zipValue;\n\t\t\t\t\talreadyPrepopulated = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(alreadyPrepopulated){ \t\t\t\n\t\t\tvar rmCheckBoxes = document.getElementsByName(\"rememberMe\");\n\t\t\tfor (i=0; i<rmCheckBoxes.length; i++){\n\t\t\t\t\trmCheckBoxes[i].checked=alreadyPrepopulated;\n\t\t\t\t}\n\t\t}\n\t\t\n\t}catch(e){}\n}", "function shiftDown(){\r\n for(let r = 4; r < 24; r++){\r\n for(let c = 0; c < 10; c++){\r\n if (board[r][c] !== \"#ffffff\" && (r+1<24)){\r\n if(board[r+1][c] === \"#ffffff\"){\r\n board[r+1][c] = board[r][c];\r\n board[r][c] = \"#ffffff\";\r\n }\r\n }\r\n }\r\n }\r\n checkForSpace();\r\n}", "function SectionmissingField(check){\n\t\tconsole.log('checking fields')\n\t\tif(check === false){\n\t\t\t$('#fillSection').empty(); //for when user does nor fill fields properly\n\t\t\t$('#fillSection').append('Please fill in area with *.');\n\t\t} else {\n\t\t\tconsole.log('Inputs are complete');\n\t\t\tPostInformation();\n\t\t}\n\t}", "function saveAndReturn2() {\n // grabbing itemID from add form\n var add = SpreadsheetApp.getActive().getSheetByName('Add');\n var itemID = add.getRange('C17').getDisplayValue();\n var state = add.getRange('C19').getDisplayValue();\n \n var lastID = '';\n var checkOut = SpreadsheetApp.getActive().getSheetByName('Check Out');\n var values = checkOut.getRange(1, 1, checkOut.getLastRow(), checkOut.getLastColumn()).getDisplayValues();\n for (var i=0; i<values.length; i++) {\n if (values[i][2] == itemID) {\n // capture last user who checked the item out (if it has been)\n // this is all *ASSUMING* that the user who broke it/lost it is bringing it back\n lastID = values[i][0];\n }\n }\n \n // if info has been entered, then append\n if (itemID != '' && state != '') {\n // append info if it has all been entered\n var messy = SpreadsheetApp.getActive().getSheetByName('Missing/Broken');\n messy.appendRow([lastID, IDtoUser(lastID), itemID, inventory(itemID), new Date(), state]);\n if (lastID != '') {\n // effectively check item in if it hasn't already, but it HAS been checked out\n triggerYes(itemID);\n }\n }\n // changes state of condition in inventory\n changeCondition(itemID, state);\n \n // erasing entered info so it's ready for next entry\n add.getRange('C17:D19').clearContent();\n \n // takes user back to the enter form\n reset();\n}", "function checkAllRequiredFieldsHaveInput(){\n $('#user-table ._REQUIRED').each(function(index, thisEntry){ \n if($(thisEntry).val() == \"\") { \n $(thisEntry).addClass('MISSING');\n } else {\n $(thisEntry).removeClass('MISSING');\n }\n });\n \n \n \n //We only need to enable the the save button if there are NO missing\n //The bool returns are only for some needs\n console.log($('#user-table .MISSING').length + \" : \" + $('#user-table ._DELUSER').length + \" : \" + $('#user-table ._EDITED').length);\n if ( ($('#user-table ._NEWUSER').length > 0 || $('#user-table ._DELUSER').length > 0 || $('#user-table ._EDITED').length > 0 ) && $('#user-table .MISSING').length == 0 ) {\n $('#submit-user-changes').prop('disabled', false);\n\n } else { \n $('#submit-user-changes').prop('disabled', true);\n\n }\n \n \n \n}", "function checkForSpace(){\r\n for(let i = 4; i < 24; i++){\r\n for(let j = 0; j < 10; j++){\r\n if (board[i][j] !== \"#ffffff\" && (i+1<24)){\r\n if(board[i+1][j] === \"#ffffff\"){\r\n shiftDown();\r\n }\r\n }\r\n }\r\n }\r\n}", "function isFieldInRightFormat(field) {\n if (field.value == \"\") return (true);\n var valid = true;\n switch (field.COMETFormat) {\n case \"C\" :\n field.value = field.value.toUpperCase();\n break;\n case \"F1\" :\n var num = formatFloat(field.value,1);\n if (num == \"\") valid = false;\n else field.value = num;\n break;\n case \"F\" :\n var num = formatFloat(field.value,2);\n if (num == null) valid = false;\n else field.value = num;\n break;\n case \"F4\" :\n var num = formatFloat(field.value,4);\n if (num == null) valid = false;\n else field.value = num;\n break;\n case \"N\" : \n if ((typeof parent.COMETMain.MDSValidation==\"undefined\"))\n { \n var num = formatNumeric(field.value);\n if (num == null) valid = false;\n else field.value = num; \n } \n else\n { \n var fieldContent=field.value;\n\t if(fieldContent.indexOf(\"-\")>-1) \n\t {\t \t \n\t var newContent=\"\";\t \n\t\t\t for(i=0; i<field.maxLength; i++) \n\t\t\t {\n\t\t\t\t newContent=newContent + \"-\"; \n\t\t\t }\n\t\t\t field.value=newContent; \t\t\t\n\t\t\t valid=true; \t\t\t\n\t }\n\t else\n\t {\n\t\t var num = formatNumeric(field.value);\n\t\t if (num == null) \n\t\t {\n\t\t valid = false;\n\t\t }\n\t\t else \n\t\t {\t\t \n\t\t field.value = num;\n\t\t }\t \n }\n }\n break;\n case \"D\" :\n var date = formatDate(field.value); \n if (date < 0 || (!isDateSmallerThanMaxDate(date)) || (!isDateBiggerThanMinDate(date)) ) valid = false;\n else field.value = date;\n break;\n case \"DAY\":\n var date = formatDay(field.value);\n if (date < 0) valid = false;\n else field.value = date;\n break;\n case \"M\" :\n var month = formatMonth(field.value);\n if (month < 0) valid = false;\n else {\n var monthWithDay=month.substring(0,2) + '/01' + month.substring(2);\n if (!isDateBiggerThanMinDate(monthWithDay) || !isDateSmallerThanMaxDate(monthWithDay)) valid = false;\n }\n if (valid!=false)\n field.value = month;\n break;\n case \"DMY\" :\n var date = formatDateMonthYear(field.value);\n if (date < 0) valid = false;\n else field.value = date;\n break;\n case \"H\" :\n var hour = formatHour(field.value);\n if (hour < 0) valid = false;\n else field.value = hour;\n break;\n case \"MI\" :\n var min = formatMinutes(field.value);\n if (min < 0) valid = false;\n else field.value = min;\n break;\n case \"T\" :\n var time=formatTime(field.value);\n if (time < 0) valid=false;\n else field.value = time;\n break;\n case \"SSN\" :\n var ssn = formatSSN(field.value);\n if (ssn < 0) valid=false;\n else field.value = ssn;\n break;\n case \"PHONE\" :\n var phone = formatPhone(field.value);\n if (phone < 0) valid=false;\n else field.value=phone;\n break;\n case \"ZIP\" :\n var zip = formatZip(field.value);\n if (zip < 0) valid=false;\n else field.value = zip;\n break;\n\tcase \"AN\":\n\t\t// new case AN (Alpha Numeric) defined under ticket 55947 (David V.)\t\n\t\t// check for Blank Value is added under ticket 55947 (David V.)\n\t\tif (isFieldBlank(field))\n\t\t{\n\t\t\tvalid=false; \n\t\t\tbreak;\n\t\t}\n\t\ttempFieldValue=field.value; \t\t\t\t\t\t\n\t\ttempFieldValue=(tempFieldValue).replace(/^\\s*|\\s*$/g,'');\t\t\t\n\t\tif(!(tempFieldValue==''))\n\t\t{\t\n\t\t\tvar regex=/^[0-9a-zA-Z]+$/;\n\t\t\tif(!regex.test(field.value)) valid=false; \t\t\t\t \t\n\t\t}\n\t\t// Added below to check for all spaces entered then tempFieldvalue will equal null ticket 55947 (Tracy A)\n\t\tif(tempFieldValue=='') valid=false;\n\t \tbreak; \n\t case \"DW\":\n\t \t// in the next round this needs refactoring to get it with the program:) \n\t\tvar fieldValue=field.value; \n\t\t // We are checking is the * or the ? mark exist if they do not exist then we \n\t\t // do a regular date check \n\t\tif((!doesTheCharacterExists(\"*\", fieldValue)) && (!doesTheCharacterExists(\"?\", fieldValue)))\n\t\t{\n\t\t\t// need refactoring here \n\t\t\tvar date = formatDate(field.value); \n \t\tif (date < 0 || (!isDateSmallerThanMaxDate(date)) || (!isDateBiggerThanMinDate(date)) ) valid = false;\n \t\telse field.value = date;\n\t\t}\n\t\telse\n\t\t{\n\t \tvar asciiValue; \n\t\t \tfor(var charIndex=0; charIndex < fieldValue.length; charIndex++) \n\t\t\t{\n\t\t\t\tasciiValue=fieldValue.charCodeAt(charIndex); \n\t\t\t\tif(!((asciiValue==47) || (asciiValue==63) || (asciiValue>47 && asciiValue<58) || (asciiValue==42) ||(asciiValue==32)))\n\t\t\t\t{\n\t\t\t\t\tvalid=false; \n\t\t\t\t\tcharIndex=fieldValue.length; \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t \tbreak; \n case \"SIGN\" :\n // new case SIGN (Signature) defined under ticket 51898 (Yaniv)\t\n\t\t// Currently do nothing but preventing JS error\n break;\n default :\n if (field.value.match(eval(field.COMETFormat)) == null) valid = false;\n break;\n }\n return (valid);\n}", "addRequiredRuleToFields() {\n Object.values(this.props.fields).forEach(field => {\n if (field.required === true || typeof field.required === 'string') {\n const newFields = this.props.fields\n newFields[field.name].rules.push('isRequired')\n this.setState({ fields: newFields })\n }\n })\n }", "function validatetime()\r\n{\r\n if(form.payrate.value == \"select\")\r\n {\r\n alert(\"Please select pay rate\");\r\n form.payrate.focus();\r\n return false;\r\n }\r\n\r\n // regular expression to match required time format\r\n re = /^\\d{1,2}:\\d{2}$/;\r\n\r\n // check start time\r\n if(form.starttime.value == '') \r\n {\r\n alert(\"Please enter shift start time\");\r\n form.starttime.focus();\r\n return false;\r\n }\r\n else if(!form.starttime.value.match(re))\r\n {\r\n alert(\"Invalid time format: \" + form.starttime.value);\r\n form.starttime.focus();\r\n return false;\r\n }\r\n // check end time\r\n else if(form.endtime.value == '')\r\n {\r\n alert(\"Please enter shift end time\");\r\n form.endtime.focus();\r\n return false;\r\n }\r\n else if(!form.endtime.value.match(re)) \r\n {\r\n alert(\"Invalid time format: \" + form.endtime.value);\r\n form.endtime.focus();\r\n return false;\r\n }\r\n return true;\r\n}", "function checkForBlank (event) {\n let target = event.target.id,\n inputField = document.getElementById(target);\n if (inputField.value == \"\") {\n switch (target) {\n case \"keyForLeft\":\n directionKey[0] = defaultDirectionKey[0]\n break;\n\n case \"keyForUp\":\n directionKey[1] = defaultDirectionKey[1]\n break;\n\n case \"keyForRight\":\n directionKey[2] = defaultDirectionKey[2]\n break;\n \n case \"keyForDown\":\n directionKey[3] = defaultDirectionKey[3]\n break;\n default:\n console.log(\"something went wrong\");\n }\n }\n}", "function validateShiftResponse(data) {\n // Something happens with Shapeshift? We should not hit\n // this statement never.\n if (_.isUndefined(data) || data === null) {\n throw new Error('unableToGetDepositAddress');\n }\n\n // Does Shapeshift return an error? :(\n if(!_.isUndefined(data.error)) {\n // Let's raise the exception to be handled on the catch block\n throw new Error(data.error); // handled on the catch block\n }\n }", "function pwFieldsFilled() {\n return (!($(\"#currentPW\").val().length === 0) &&\n !($(\"#newPW\").val().length === 0) &&\n !($(\"#confirmPW\").val().length === 0));\n}", "function shiftleft(num){\n for(i=0;i<17;i++){\n var index = i+1;\n var toelement = \"tape\"+num+\"elem\"+i;\n var fromelement = \"tape\"+num+\"elem\"+ index;\n $('#'+toelement).html($('#'+fromelement).html()); \n }\n \n \n if (num===1){\n var newindex = tapeindex + 9;\n var edge = \"tape\"+num+\"elem16\";\n if (newindex >= tape1edit.length){\n $('#'+edge).html(\" \");\n }\n else{\n $('#'+edge).html(tape1edit[newindex]);\n }\n tapeindex = tapeindex + 1; \n }\n if (num===2){\n var newindex = tape2index + 9;\n var edge = \"tape\"+num+\"elem16\";\n if (newindex >= tape2edit.length){\n $('#'+edge).html(\" \");\n }\n else{\n $('#'+edge).html(tape2edit[newindex]);\n }\n tape2index = tape2index + 1; \n }\n if (num===3){\n var newindex = tape3index + 9;\n var edge = \"tape\"+num+\"elem16\";\n if (newindex >= tape3edit.length){\n $('#'+edge).html(\" \");\n }\n else{\n $('#'+edge).html(tape3edit[newindex]);\n }\n tape3index = tape3index + 1; \n }\n \n\n \n}", "storeShiftData() {\r\n let dragObj = this.dragObj;\r\n let dragedBtn = dragObj.elem.getElementsByClassName(this.options.dragBtnClassName)[0];\r\n let coords = this.getCoords(dragedBtn);\r\n dragObj.shiftX = dragObj.downX - coords.left;\r\n dragObj.shiftY = dragObj.downY - coords.top;\r\n dragObj.avatar.classList.add('dragged');\r\n //It's added Name width to shifX\r\n dragObj.shiftX += dragObj.avatar.firstElementChild.offsetWidth;\r\n }", "addTrip (newTripTime, newTripDistance, newTripDuration) {\n let newTripDateTime = new Date(newTripTime)\n // FEATURE 10: Validate inputs\n // Check if the date given is valid\n if (newTripDateTime == 'Invalid Date') {\n return\n }\n // check that the distance is not 0\n // distance can only be a number input, handled through HTML field\n if (newTripDistance <= 0) {\n return\n }\n // check that the duration is not 0\n // distance can only be a whole number input, handled through HTML field\n if (newTripDuration <= 0) {\n return\n } else { // If all fields are valid add the trip\n // FEATURE 13: Provide default values\n // ID value automatically assigned\n const newID = this.allMyTrips.length + 1\n const aNewTrip = new Trip(newID, newTripTime, newTripDistance, newTripDuration)\n this.allMyTrips.push(aNewTrip)\n }\n }", "_calShiftCount(shift,itoId)\r\n\t{\r\n\t\tvar myShift=shift.toUpperCase();\r\n\t\t\r\n\t\tvar result=eval(\"(this.shift\"+myShift+\"Count[\\\"\"+itoId+\"\\\"]==null)\");\r\n\t\tif (result)\r\n\t\t\teval(\"this.shift\"+myShift+\"Count[\\\"\"+itoId+\"\\\"]=1;\");\r\n\t\telse\r\n\t\t\teval(\"this.shift\"+myShift+\"Count[\\\"\"+itoId+\"\\\"]++;\");\r\n\t\t\t\r\n\t\tthis.essentialShiftTemp=this.essentialShiftTemp.replace(shift,\"\");\r\n\t}", "function isValidInputs() {\n\tvar totalQtyToShip = Number($(\"totalQty\").innerHTML);\n\tvar totalAvailableQty = Number($(\"totalAvailableQty\").innerHTML);\n\t\n\tif (totalQtyToShip > Number($v(\"qtyToPick\"))) {\n\t\talert(messagesData.shipMoreThanQtyToPick);\n\t\treturn false;\n\t} else if (\"Y\" === $v(\"originInspectionRequired\") && totalQtyToShip != Number($v(\"qtyToPick\"))) {\n\t\talert(messagesData.partialShipOIOrder);\n\t\treturn false;\n\t} else if (\"Y\" === $v(\"mfgDateRequired\")) {\n\t\tfor (var curRowId = 1; curRowId <= beanGrid.getRowsNum(); curRowId++)\n\t\t\tif (isWhitespace(cellValue(curRowId, \"dateOfManufacture\")) && cellValue(curRowId, \"allocated\") === 'true') {\n\t\t\t\talert(messagesData.valueRequiredOnRow.replace(\"{0}\", messagesData.dateOfManufacture).replace(\"{1}\", curRowId));\n\t\t\t\treturn false;\n\t\t\t}\n\t}\n\t\n\treturn true;\n}", "async saveShift() {\n if (this.state.startTime == '' || this.state.endTime == '') {\n Alert.alert('Please choose your working time');\n }else if (this.state.startDate > this.state.endDate) {\n Alert.alert('Please check your begin and end working date');\n }\n else {\n var flag = '';\n\n try {\n if(this.state.selected_id) {\n // update\n flag = 'updated';\n this.update(this.state.selected_id);\n }else {\n // save\n flag = 'saved';\n this.save();\n }\n } catch (error) {\n console.log(error);\n }\n\n Alert.alert('Your shift successfully ' + flag + ' !');\n this.props.navigation.goBack();\n }\n }", "function insertMissingDays(index) {\n if (data[index-1] == undefined) {\n return;\n }\n\n currDay = data[index][0].split('-')[2];\n currMonth = data[index][0].split('-')[1];\n currYear = data[index][0].split('-')[0];\n\n currDayInt = parseInt(currDay);\n currMonthInt = parseInt(currMonth);\n currYearInt = parseInt(currYear);\n\n nextDay = data[index-1][0].split('-')[2];\n nextMonth = data[index-1][0].split('-')[1];\n nextYear = data[index-1][0].split('-')[0];\n\n nextDayInt = parseInt(nextDay);\n nextMonthInt = parseInt(nextMonth);\n nextYearInt = parseInt(nextYear);\n\n console.log(index, currDayInt, nextDayInt);\n\n if (currMonth != nextMonth || (currDayInt - nextDayInt != 1 && currDayInt > 1)) {\n\n monthLength = (nextMonthInt % 2 == 0) ? 30 : 31; // this is wrong lol\n newMonth = nextMonth;\n if (nextDayInt+1 > 31) {\n nextDayInt = 0;\n newMonth = currMonth;\n }\n\n newDay = (nextDayInt+1).toString().length == 1 ? '0' + (nextDayInt+1) : (nextDayInt+1);\n newRecord = [currYear+'-'+newMonth+'-'+newDay, 0];\n data.splice(index, 0, newRecord);\n\n console.log('inserting missing day... !', newRecord);\n\n insertMissingDays(index+1);\n }\n\n }", "function checkFields() {\r\n\tif($(\"#serieName\").val() != \"\" && $(\"#serieDay\").val() != \"\" \r\n\t\t\t&& $(\"#serieUrl\").val() != \"\" && $(\"#serieDate\").val() != \"\") {\r\n\t\treturn true;\r\n\t}\r\n\telse {\r\n\t\treturn false;\r\n\t}\r\n}", "function validateFields(){\n\n for(var key in errorStates.keys){\n errorStates.set(key, false);\n var answer= $(\"#input_\" + key).val();\n\n if(!answer){\n errorStates.set(key, true);\n }\n }\n var password = $(\"#input_4\").val();\n if (password.length < 6) {\n errorStates.set(4, true);\n }\n}", "function addShiftTypeDOM(shiftType) {\r\n var id = shiftType.id;\r\n var fullName = shiftType.fullName;\r\n var shortName = shiftType.shortName;\r\n var startTime = shiftType.startTime;\r\n var endTime = shiftType.endTime;\r\n var secondStartTime = shiftType.secondStartTime;\r\n var secondEndTime = shiftType.secondEndTime;\r\n var shiftDuration = shiftType.shiftDuration;\r\n var breakDuration = shiftType.breakDuration;\r\n var isRegularShift = shiftType.isRegularShift;\r\n var isEndOnNextDay = shiftType.isEndOnNextDay;\r\n\r\n var canBeOnWorkDay = shiftType.canBeOnWorkDay;\r\n var canBeOnRestDay = shiftType.canBeOnRestDay;\r\n var canBeOnDoubleShiftRegime = shiftType.canBeOnDoubleShiftRegime;\r\n var canBeOnTripleShiftRegime = shiftType.canBeOnTripleShiftRegime;\r\n //var canBeOnFirstWorkDayAfterRestDay = shiftType.canBeOnFirstWorkDayAfterRestDay;\r\n //var canBeOnFirstRestDayAfterWorkDay = shiftType.canBeOnFirstRestDayAfterWorkDay;\r\n var canBeOnLastWorkDayBeforeRestDay = shiftType.canBeOnLastWorkDayBeforeRestDay;\r\n var canBeOnLastRestDayBeforeWorkDay = shiftType.canBeOnLastRestDayBeforeWorkDay;\r\n\r\n var newRow = $('<div class=\"shiftTypeFullCont\" shiftType_id=\"' + id + '\">' +\r\n ' <div class=\"row\">' +\r\n ' <label class=\"form-control col-sm-3 shift-type-label\">Пълно описание</label>' +\r\n ' <label class=\"form-control col-sm-1 shift-type-label\">Кр. изп.</label>' +\r\n ' <label class=\"form-control col-sm-1 shift-type-label\">Начало</label>' +\r\n ' <label class=\"form-control col-sm-1 shift-type-label\">Край</label>' +\r\n ' <label class=\"form-control col-sm-1 shift-type-label\">Второ начало</label>' +\r\n ' <label class=\"form-control col-sm-1 shift-type-label\">Втори край</label>' +\r\n ' <label class=\"form-control col-sm-1 shift-type-label\">Продълж.</label>' +\r\n ' <label class=\"form-control col-sm-1 shift-type-label\">Почивка</label>' +\r\n ' <label class=\"form-control col-sm-1 shift-type-label\">Ежедневна</label>' +\r\n ' <label class=\"form-control col-sm-1 shift-type-label\">Следв. ден</label>' +\r\n ' </div>' +\r\n ' <div class=\"row shiftType-container\" shiftType_id=\"' + id + '\">' +\r\n ' <input type=\"text\" class=\"updateFullNameClass form-control col-sm-3\" value=\"' + fullName + '\" oldData=\"' + fullName + '\"/>' +\r\n ' <input type=\"text\" class=\"updateShortNameClass form-control col-sm-1\" value=\"' + shortName + '\" oldData=\"' + shortName + '\"/>' +\r\n ' <input type=\"text\" class=\"updateStartTime timepicker-input form-control col-sm-1 center-text\" value=\"' + startTime + '\" oldData=\"' + startTime + '\" id=\"startTime_' + startTime + '\"/>' +\r\n ' <input type=\"text\" class=\"updateEndTime timepicker-input form-control col-sm-1 center-text\" value=\"' + endTime + '\" oldData=\"' + endTime + '\" id=\"endTime_' + endTime + '\"/>' +\r\n ' <input type=\"text\" class=\"updateSecondStartTime timepicker-input form-control col-sm-1 center-text\" value=\"' + secondStartTime + '\" oldData=\"' + secondStartTime + '\" id=\"secondStartTime_' + secondStartTime + '\"/>' +\r\n ' <input type=\"text\" class=\"updateSecondEndTime timepicker-input form-control col-sm-1 center-text\" value=\"' + secondEndTime + '\" oldData=\"' + secondEndTime + '\" id=\"secondEndTime_' + secondEndTime + '\"/>' +\r\n ' <input type=\"text\" class=\"updateShiftDuration timepicker-input form-control col-sm-1 center-text\" value=\"' + shiftDuration + '\" oldData=\"' + shiftDuration + '\" id=\"shiftDuration_' + shiftDuration + '\"/>' +\r\n ' <input type=\"text\" class=\"updateBreakDuration timepicker-input form-control col-sm-1 center-text\" value=\"' + breakDuration + '\" oldData=\"' + breakDuration + '\" id=\"breakDuration_' + breakDuration + '\"/>' +\r\n ' <div class=\"updateIsRegularShift form-control col-sm-1 center-text boolean-input-owner\" data=\"' + isRegularShift + '\"><i class=\"fa pickable ' + (isRegularShift ? 'fa-check' : 'fa-times') + '\" aria-hidden=\"true\"></i></div>' +\r\n ' <div class=\"updateIsEndOnNextDay form-control col-sm-1 center-text boolean-input-owner\" data=\"' + isEndOnNextDay + '\"><i class=\"fa pickable ' + (isEndOnNextDay ? 'fa-check' : 'fa-times') + '\" aria-hidden=\"true\"></i></div>' +\r\n ' </div>' +\r\n ' <div class=\"row\">' +\r\n ' <label class=\"form-control col-sm-3 shift-type-label\" style=\"visibility: hidden\"></label>' +\r\n ' <label class=\"form-control col-sm-1 shift-type-label\">работни дни</label>' +\r\n ' <label class=\"form-control col-sm-1 shift-type-label\">почивни дни</label>' +\r\n ' <label class=\"form-control col-sm-1 shift-type-label\">двусменен режим</label>' +\r\n ' <label class=\"form-control col-sm-1 shift-type-label\">трисменен режим</label>' +\r\n ' <label class=\"form-control col-sm-1 shift-type-label\">последен работен</label>' +\r\n ' <label class=\"form-control col-sm-1 shift-type-label\">последен почивен</label>' +\r\n ' </div>' +\r\n ' <div class=\"row shiftType-container\" shiftType_id=\"' + id + '\">' +\r\n ' <input style=\"visibility: hidden\" type=\"text\" class=\"form-control col-sm-3\" disabled/>' +\r\n ' <div class=\"form-control col-sm-1 center-text boolean-input-owner\" id=\"updateCanBeOnWorkDay_' + id + '\" data=\"' + canBeOnWorkDay + '\"><i class=\"fa pickable ' + (canBeOnWorkDay ? 'fa-check' : 'fa-times') + '\" aria-hidden=\"true\"></i></div>' +\r\n ' <div class=\"form-control col-sm-1 center-text boolean-input-owner\" id=\"updateCanBeOnRestDay_' + id + '\" data=\"' + canBeOnRestDay + '\"><i class=\"fa pickable ' + (canBeOnRestDay ? 'fa-check' : 'fa-times') + '\" aria-hidden=\"true\"></i></div>' +\r\n ' <div class=\"form-control col-sm-1 center-text boolean-input-owner\" id=\"updateCanBeOnDoubleShiftRegime_' + id + '\" data=\"' + canBeOnDoubleShiftRegime + '\"><i class=\"fa pickable ' + (canBeOnDoubleShiftRegime ? 'fa-check' : 'fa-times') + '\" aria-hidden=\"true\"></i></div>' +\r\n ' <div class=\"form-control col-sm-1 center-text boolean-input-owner\" id=\"updateCanBeOnTripleShiftRegime_' + id + '\" data=\"' + canBeOnTripleShiftRegime + '\"><i class=\"fa pickable ' + (canBeOnTripleShiftRegime ? 'fa-check' : 'fa-times') + '\" aria-hidden=\"true\"></i></div>' +\r\n ' <div class=\"form-control col-sm-1 center-text boolean-input-owner\" id=\"updateCanBeOnLastWorkDayBeforeRestDay_' + id + '\" data=\"' + canBeOnLastWorkDayBeforeRestDay + '\"><i class=\"fa pickable ' + (canBeOnLastWorkDayBeforeRestDay ? 'fa-check' : 'fa-times') + '\" aria-hidden=\"true\"></i></div>' +\r\n ' <div class=\"form-control col-sm-1 center-text boolean-input-owner\" id=\"updateCanBeOnLastRestDayBeforeWorkDay_' + id + '\" data=\"' + canBeOnLastRestDayBeforeWorkDay + '\"><i class=\"fa pickable ' + (canBeOnLastRestDayBeforeWorkDay ? 'fa-check' : 'fa-times') + '\" aria-hidden=\"true\"></i></div>' +\r\n ' </div>' +\r\n ' <hr>' +\r\n ' </div>')\r\n .on('keyup', keyUpFunctionShiftType);\r\n\r\n $('#shiftTypeList').append(newRow);\r\n\r\n setBooleanInput($(newRow).find('.updateIsRegularShift'));\r\n setBooleanInput($(newRow).find('.updateIsEndOnNextDay'));\r\n\r\n setBooleanInput($('#updateCanBeOnWorkDay_' + id));\r\n setBooleanInput($('#updateCanBeOnRestDay_' + id));\r\n setBooleanInput($('#updateCanBeOnDoubleShiftRegime_' + id));\r\n setBooleanInput($('#updateCanBeOnTripleShiftRegime_' + id));\r\n //setBooleanInput($('#updateCanBeOnFirstWorkDayAfterRestDay_' + id));\r\n //setBooleanInput($('#updateCanBeOnFirstRestDayAfterWorkDay_' + id));\r\n setBooleanInput($('#updateCanBeOnLastWorkDayBeforeRestDay_' + id));\r\n setBooleanInput($('#updateCanBeOnLastRestDayBeforeWorkDay_' + id));\r\n\r\n hideAddShiftTypesInputs();\r\n}", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n level.tiles[i][j].isNew = true;\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function checkInputFields() {\n if(player1Name.value.length > 0 || player1Guess.value.length > 0 || player2Name.value.length > 0 || player2Guess.value.length > 0){\n clearButton.disabled = false;\n } else {\n clearButton.disabled = true;\n }\n }", "function check_event_hour(){\n\tif ( $('#event_starts_at_4i').val() >= $('#event_ends_at_4i').val() && $('#event_ends_at_4i').val().length > 0) {\n\t\t\tvar number = parseInt( $('#event_starts_at_4i').val() )+ 1;\n\t\t\tif (number.toString().length == 1){\n\t\t\t\tif ( parseInt( $('#event_starts_at_4i').val()) != 0) {\n\t\t\t\t\t$('#event_ends_at_4i').val(\"0\"+number.toString());\n\t\t\t\t} else {\n\t\t\t\t\t$('#event_ends_at_4i').val(number.toString()+\"0\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$('#event_ends_at_4i').val(parseInt( $('#event_starts_at_4i').val() )+ 1);\t\n\t\t\t}\n\t}\n}", "fixMove(nextMove, previousMove) {\n\n // ensures that next move doesn't simply revert the previous\n if (nextMove === 0 && previousMove === 1) {\n nextMove = 2;\n } else if (nextMove === 1 && previousMove === 0) {\n nextMove = 3;\n } else if (nextMove === 2 && previousMove === 3) {\n nextMove = 0;\n } else if (nextMove === 3 && previousMove === 2) {\n nextMove = 1;\n }\n\n // ensures that the next move will be legal\n // (there are also safeguards against this in moveTile{Direction})\n if (nextMove === 0 && emptyTileIndex <= 3) {\n nextMove += 1;\n } else if (nextMove === 1 && emptyTileIndex > 11 ) {\n nextMove -= 1;\n }\n if (nextMove === 2 && emptyTileIndex % 4 === 0) {\n nextMove += 1;\n } else if (nextMove === 3 && [3, 7, 11, 15].includes(emptyTileIndex)) {\n nextMove -= 1;\n }\n\n return nextMove;\n }", "function checkEmptyFields(){\n \t\n \t\n\t\t\ttry {\n\t\t\t\tif (document.getElementById(\"source-opt\").selectedIndex == 0) {\n\t\t\t\t\talert(\"Select Source\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (document.getElementById(\"destination-opt\").selectedIndex == 0) {\n\t\t\t\t\talert(\"Select Destination\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\n\t\t\t\tif (document.getElementById(\"dropPoint-opt\").selectedIndex == 0) {\n\t\t\t\t\talert(\"Select DropPoint\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (document.getElementById(\"timeSlot-opt\").selectedIndex == 0) {\n\t\t\t\t\talert(\"Select TimeSlot\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\n\t\t\t\tbookARideButtonClicked();\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\talert(e.message);\n\t\t\t\tjsExceptionHandling(e);\n\t\t\t}\n }", "function shiftChangeHandler(index, fieldChanged, newValue){\n\n if(fieldChanged!==\"workers\"){\n\n setPeriod((prevState)=>{\n let newTempState={...prevState}\n newTempState.shift_set[index][fieldChanged] = newValue\n return newTempState\n })\n } else {\n setPeriod((prevState)=>{\n let newTempState={...prevState}\n newTempState.shift_set[index]['users'] = newValue.map((item)=>groupMembersByUsername[item])\n\n return newTempState\n })\n }\n }", "function validateInputAdd()\n\t\t{\n\t\t\t\n\t\t\tvar courseName = document.getElementById(\"course_name\").value;\n\t\t\tvar courseL1 = document.getElementById(\"lDay1\").value.toUpperCase();\n\t\t\tvar courseL2 = document.getElementById(\"lDay2\").value.toUpperCase();\n\t\t\tvar startLec = document.getElementById(\"startL\").value;\n\t\t\tvar endLec = document.getElementById(\"endL\").value;\n\t\t\tvar courseT1 = document.getElementById(\"tDay1\").value.toUpperCase();\n\t\t\tvar courseT2 = document.getElementById(\"tDay2\").value.toUpperCase();\n\t\t\tvar startTut = document.getElementById(\"startT\").value;\n\t\t\tvar endTut = document.getElementById(\"endT\").value;\n\t\t\tvar courseLab1 = document.getElementById(\"labDay1\").value.toUpperCase();\n\t\t\tvar startLab = document.getElementById(\"startLab\").value;\n\t\t\tvar endLab = document.getElementById(\"endLab\").value;\n\t\t\tvar courseSemester = getSelectedSemester(\"semester\");\n\t\t\t\t\n\t\t\t\n\t\t\tvar validL1 = validDay(courseL1, \"lDay1\");\n\t\t\tvar validL2 = validDay(courseL2, \"lDay2\");\n\t\t\tvar validStartL = validTime(startLec, \"startL\");\n\t\t\tvar validEndL = validTime(endLec, \"endL\");\n\t\t\tvar validT1 = validDay(courseT1, \"tDay1\");\n\t\t\tvar validT2 = validDay(courseT2, \"tDay2\");\n\t\t\tvar validStartTut = validTime(startTut, \"startT\");\n\t\t\tvar validEndTut = validTime(endTut, \"endT\");\n\t\t\tvar validLab = validDay(courseLab1, \"labDay1\");\n\t\t\tvar validStartLab = validTime(startLab, \"startLab\");\n\t\t\tvar validEndLab = validTime(endLab, \"endLab\");\n\t\t\t\n\t\t\t\n\t\t\tvar isSemesterSelected = selectedSemester(\"semester\");\n\t\t\tvar lectureRequired = nonEmptyInput(courseL1, \"lDay1\");\n\t\t\tvar lectureStartRequired = nonEmptyInput(startLec, \"startL\");\n\t\t\tvar lectureEndRequired = nonEmptyInput(endLec, \"endL\");\n\t\t\tvar inputNonEmpty = lectureRequired && lectureStartRequired && lectureEndRequired;\n\t\t\t\n\t\t\tvar validInput = validL1 && validL2 && validStartL && validEndL && validT1 && validT2 && validStartTut && validEndTut && validLab && validStartLab && validEndLab && isSemesterSelected && inputNonEmpty;\n\t\t\t\n\t\t\treturn validInput;\n\t\t\t\n\t\t}", "function checkInning() {\n\tconsole.log('[checkInning] Inside checkInning');\n\t// bepalen van de stand....\n\tvar hTotalRun = 0;\n\tvar vTotalRun = 0 ;\n\n\tfor (i = 1; i < vRun.length; i++) { //starten bij index 1)\n\t\tvTotalRun = vTotalRun + vRun[i];\n\t}\t\n\tfor (i = 1; i < hRun.length; i++) { //starten bij index 1)\n\t\thTotalRun = hTotalRun + hRun[i];\n\t}\n\n\n\tif (inning <= maxInnings) {\n\t\tif (numOuts >= 3) { // dubbelspel met 2 nullen ??\n\t\t\tsendMessage('3-OUTS Change fields')\n\t\t\tconsole.log('[checkInning] 3-OUTS Change fields');\n\t\t\tif (vAtBat) {\n\t\t\t\tif (inning == maxInnings && vTotalRun < hTotalRun) {\n\t\t\t\t\t\thRun[inning] = 'X';\n\t\t\t\t\t\tendOfGame = true;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvAtBat = false;\n\t\t\t\t\t\thAtBat = true;\n\t\t\t\t\t\thRun[inning] = 0;\n\t\t\t\t\t\thitsInning = 0;\n\t\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (inning == maxInnings) {\n\t\t\t\t\t// nog geen extra innings bij gelijke stand\n\t\t\t\t\tendOfGame = true;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\thAtBat = false;\n\t\t\t\t\tvAtBat = true;\n\t\t\t\t\tinning++;\n\t\t\t\t\tvRun[inning] = 0;\n\t\t\t\t\thitsInning = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (i = 0; i <= 3; i++) {\n\t\t\t\tbaseRunners[i] = 0;\n\t\t\t}\n\t\t\tnumOuts = 0;\n\t\t\tnewBatter();\n\t\t\t/* if (objHand.length > 6 || objOtherHand.length > 6) {\n\t\t\t\tatBatStatus = 'decrease'\n\t\t\t\tsendMessage('decrease to 6 cards');\n\t\t\t\t// ??? moet dat wisselen van die spelers ???\n\t\t\t\tturnHome ? $(\"#home\").val(atBatStatus) : $(\"#visitor\").val(atBatStatus);\n\t\t\t} */\n\t\t\t$('#hNB').hide(); // NB-knoppen verwijderen\n\t\t\t$('#vNB').hide();\n\t\t\t$('#hRP').hide(); // RP knoppen verwijderen\n\t\t\t$('#vRP').hide();\t\t\t\n\t\t}\n\t} else {\n\t\tendOfGame = true;\n\t\t// gameOver(); in playCard wordt op endOfGame gecheckt en doorgestuurd naar gameOver\n\t}\n}", "function check3(){\n\t\t\tif(W.spaces[num2].val == \"\"){\n\t\t\t\tend = check5(num3, bool, W.spaces[num2]);\n\t\t\t\tif(end){\n\t\t\t\t\tif(Player == 0){\n\t\t\t\t\t\tW.spaces[num2].val = \"x\";\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tW.spaces[num2].val = \"o\";\n\t\t\t\t\t}\n\t\t\t\t\tend = false;\n\t\t\t\t\taddLine();\n\t\t\t\t\tline2 = 0;\n\t\t\t\t\tcheck4();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "static validateFields(newTask) {\n if (newTask.name === \"\") {\n return { flag: false, field: 0 };\n }\n if (newTask.description === \"\") {\n return { flag: false, field: 1 };\n }\n return { flag: true, field: -1 };\n }", "function validateMove(gamePreMove){\r\n let flatGamePostMove = [...gameBoard[0], ...gameBoard[1], ...gameBoard[2], ...gameBoard[3]];\r\n for (let i = 0; i < 16; i++){\r\n if (gamePreMove[i] !== flatGamePostMove[i]){\r\n randomSpawnNumber();\r\n break;\r\n } else if (i === 15 && gamePreMove[i] === flatGamePostMove[i]){\r\n console.log(\"Move is invalid\");\r\n }\r\n }\r\n}", "function preAddOccupantValidations() {\r\n\r\n var selRowid = riskListGrid1.recordset(\"ID\").value;\r\n var selSlotId = riskListGrid1.recordset(\"CSLOTID\").value;\r\n var selRiskTypeCode = riskListGrid1.recordset(\"CRISKTYPECODE\").value;\r\n var selRiskBaseRecordId = riskListGrid1.recordset(\"CRISKBASERECORDID\").value;\r\n var sTransEffectiveDate = policyHeader.lastTransactionInfo.transEffectiveFromDate;\r\n var transactionCode = policyHeader.lastTransactionInfo.transactionCode;\r\n var isValid = true;\r\n var isOOswipChangeRecordExist = false;\r\n var ooswipChangeRowId;\r\n\r\n first(riskListGrid1);\r\n while (!riskListGrid1.recordset.eof) {\r\n var sEffFromDate = riskListGrid1.recordset(\"CRISKEFFECTIVEFROMDATE\").value;\r\n var sEffToDate = riskListGrid1.recordset(\"CRISKEFFECTIVETODATE\").value;\r\n\r\n //Chck if Slot is already occupied\r\n if (riskListGrid1.recordset(\"CSLOTID\").value == selSlotId &&\r\n riskListGrid1.recordset(\"CRISKTYPECODE\").value == selRiskTypeCode &&\r\n getRealDate(sEffFromDate) <= getRealDate(sTransEffectiveDate) &&\r\n getRealDate(sEffToDate) > getRealDate(sTransEffectiveDate)) {\r\n if (riskListGrid1.recordset(\"CRISKNAME\").value != \"VACANT\" ||\r\n ((parseInt(riskListGrid1.recordset(\"CENTITYID\").value)) > 0) &&\r\n (riskListGrid1.recordset(\"CRECORDMODECODE\").value == \"TEMP\")) {\r\n isValid = false;\r\n break;\r\n }\r\n }\r\n\r\n // Check OOSWIP\r\n if (transactionCode == \"OOSENDORSE\" &&\r\n riskListGrid1.recordset(\"CRISKBASERECORDID\").value == selRiskBaseRecordId &&\r\n (riskListGrid1.recordset(\"CRECORDMODECODE\").value == \"TEMP\" ||\r\n riskListGrid1.recordset(\"CRECORDMODECODE\").value == \"REQUEST\")) {\r\n isOOswipChangeRecordExist = true;\r\n ooswipChangeRowId = riskListGrid1.recordset(\"ID\").value;\r\n }\r\n next(riskListGrid1);\r\n }\r\n\r\n // Go to first row to avoid unknown error in getRow function\r\n first(riskListGrid1);\r\n\r\n if (isOOswipChangeRecordExist) {\r\n // Go to changed row\r\n getRow(riskListGrid1, ooswipChangeRowId);\r\n }\r\n else {\r\n // Go back to original row\r\n getRow(riskListGrid1, selRowid);\r\n }\r\n\r\n // Alert messages based on validation result\r\n if (transactionCode == \"OOSENDORSE\" && !isOOswipChangeRecordExist) {\r\n handleError(getMessage(\"pm.addSlotOccupant.ooswipCheck.error\"));\r\n isValid = false;\r\n }\r\n else if (!isValid) {\r\n handleError(getMessage(\"pm.addSlotOccupant.slotOccupied.error\"));\r\n }\r\n return isValid;\r\n}", "function isValid(board, prevBoard) {\n var numRows = board.length;\n var numCols = board[0].length;\n\n // These variables check for valid letter placement\n var newRow = -1;\n var newCol = -1;\n var hasNewWord = false;\n\n // These variables hold the created words\n var horizWord = {\n word: '',\n isNew: false\n };\n var vertWord = [];\n for (var i = 0; i < numCols; i ++) {\n vertWord.push({\n word: '',\n isNew: false\n });\n }\n\n // Iterate over all the squares on the board\n for (var row = 0; row < numRows; row ++) {\n for (var col = 0; col < numCols; col ++) {\n // This checks for added (new) letters\n if (board[row][col] != prevBoard[row][col]) {\n // The two next if statements check if the letter addition is valid\n // We cannot have two separate words entered in the same play\n if ((hasNewWord && horizWord.word === '' && vertWord[col].word === '')\n || (newRow !== -1 && newCol !== -1 && row !== newRow && col !== newCol)) { \n console.log(\"Two Separates\");\n return false;\n }\n if (newRow === -1 && newCol === -1) {\n newRow = row;\n newCol = col;\n }\n hasNewWord = true;\n\n\n // This will mark the word as containing a new addition \n // so we know which words to check\n horizWord.isNew = true;\n vertWord[col].isNew = true;\n }\n\n // If the letter is '' then this indicates the end of a word\n // so reset both horizWord and vertWord \n // and check the added words that are not just single letters\n if (board[row][col] === '') {\n if (horizWord.word.length > 1 && horizWord.isNew) {\n if (!isValidWord(horizWord.word)) return false;\n } \n if (vertWord[col].word.length > 1 && vertWord[col].isNew) {\n if (!isValidWord(vertWord[col].word)) return false;\n }\n\n // Reset the corresponding words\n horizWord.word = '';\n horizWord.isNew = false;\n vertWord[col].word = '';\n vertWord[col].isNew = false;\n }\n // This will add the letter to the appropriate word\n else {\n horizWord.word += board[row][col];\n vertWord[col].word += board[row][col];\n }\n }\n\n // Checks for horizontal edge cases\n if (horizWord.word !== '') {\n if (horizWord.word.length > 1 && horizWord.isNew) {\n if (!isValidWord(horizWord.word)) return false;\n }\n horizWord.word = '';\n horizWord.isNew = false;\n }\n }\n \n // Check for vertical edge cases\n for (var col = 0; col < numCols; col ++) {\n if (vertWord[col].word.length > 1 && vertWord[col].isNew) {\n if (!isValidWord(vertWord[col].word)) return false;\n }\n }\n\n return true;\n}", "function check_new(area_id) {\n var new_row = {};\n var error = false;\n new_row.name = $(\"#\"+area_id+\" .add-class input.name\").val();\n new_row.note = parseFloat($(\"#\"+area_id+\" .add-class input.note\").val());\n new_row.weight = parseFloat($(\"#\"+area_id+\" .add-class input.weight\").val());\n unmark_error($(\"#\"+area_id+\" .add-class input.note\"));\n unmark_error($(\"#\"+area_id+\" .add-class input.weight\"));\n if (Number.isNaN(new_row.note) || new_row.note < 1.0 || new_row.note > 4.0) {\n mark_error($(\"#\"+area_id+\" .add-class input.note\"));\n error = true;\n } \n if (Number.isNaN(new_row.weight) || new_row.weight <= 0) {\n mark_error($(\"#\"+area_id+\" .add-class input.weight\"));\n error = true;\n }\n if (!error) {\n register_row(area_id, new_row);\n return true;\n }\n return false;\n}", "function checkTimesValidity() {\n var times = [];\n var from_t;\n var to_t;\n for (var i = 0; i < current_row; i++) {\n var to = \"to\";\n var from = \"from\";\n\n if (i != 0) {\n // update ids\n to += i;\n from += i;\n from_t = document.getElementById(from);\n to_t = document.getElementById(to);\n if (from_t.value == \"\" || to_t.value == \"\") {\n alert(\"ERROR: PLEASE ENTER VALID TIMES BEFORE ADDING MORE ROWS\");\n return false;\n }\n times.push([from_t.value, to_t.value])\n }\n else {\n // take as is\n from_t = document.getElementById(from);\n to_t = document.getElementById(to);\n if (from_t.value == \"\" || to_t.value == \"\") {\n alert(\"ERROR: PLEASE ENTER VALID TIMES BEFORE ADDING MORE ROWS\");\n return false;\n }\n times.push([from_t.value, to_t.value])\n }\n }\n times.sort(compare);\n if (times.length > 1) {\n\n for (var j = 1; j < times.length; j++) {\n\n if (times[j][0] <= times[j-1][1] && times[j][0] >= times[j-1][0]) {\n alert(\"ENTRIES OVERLAP: PLEASE MAKE SURE NONE OF YOUR ACTIVITIES OVERLAP IN TIME\")\n return false;\n }\n\n }\n\n }\n\n return true;\n\n}", "function timeShiftvalidateSingleVertex(vertex, logger) {\n\tconst vertexName = vertex.name;\n\tlet isOk = true;\n\n\t// ------------------------------------------\n\t// - Check for timeshift config, if not set default value\n\t// ------------------------------------------\n\tif (!vertex.time_shift) {\n\t\tvertex.time_shift = {\n\t\t\t\"start\": vertex.tdg.count_all\n\t\t};\n\t}\n\n\n\n\t// ------------------------------------------\n\t// - Check attributes\n\t// ------------------------------------------\n\tif (!vertex.time_shift.start) {\n\t\tconst err = {\n\t\t\t\"message\": `The timeShift config does not have a 'start' attribute`,\n\t\t\t\"config\": vertex.time_shift\n\t\t};\n\t\tlogger.error(err);\n\t\tisOk = false;\n\t}\n\n\t// ------------------------------------------\n\t// - Validate the distribution count\n\t// ------------------------------------------\n\tconst countAll = vertex.tdg.count_all;\n\n\tlet sum = vertex.time_shift.start;\n\tif (vertex.time_shift.add) {\n\t\tsum += vertex.time_shift.add;\n\t}\n\n\tif (sum !== countAll) {\n\t\tconst err = {\n\t\t\t\"message\": `The sum of the changes is ${sum} but the overall amount of data is ${countAll}. Both values should be the same size`,\n\t\t\t\"config\": vertex.time_shift\n\t\t};\n\t\tlogger.error(err);\n\t\tisOk = false;\n\t}\n\n\tif (vertex.time_shift.remove) {\n\t\t// remove must not be greater than start+add\n\t\tconst remove = vertex.time_shift.remove;\n\t\tif (remove > sum) {\n\t\t\tconst err = {\n\t\t\t\t\"message\": `The amount of removes '${remove}' must not be greater than the amaount of available elements '${sum}' (start + add)`,\n\t\t\t\t\"config\": vertex.time_shift\n\t\t\t};\n\t\t\tlogger.error(err);\n\t\t\tisOk = false;\n\t\t}\n\n\t\tif (vertex.time_shift.recur) {\n\t\t\tconst recur = vertex.time_shift.recur;\n\n\t\t\tif (recur > remove) {\n\t\t\t\tconst err = {\n\t\t\t\t\t\"message\": `The amount of recurrence '${recur}' must not be greater than the amount of the removes '${remove}'`,\n\t\t\t\t\t\"config\": vertex.time_shift\n\t\t\t\t};\n\t\t\t\tlogger.error(err);\n\t\t\t\tisOk = false;\n\t\t\t}\n\t\t}\n\n\n\t} else {\n\t\tif (vertex.time_shift.recur) {\n\t\t\tconst err = {\n\t\t\t\t\"message\": `The attribute recur only works if there are removes defined`,\n\t\t\t\t\"config\": vertex.time_shift\n\t\t\t};\n\t\t\tlogger.error(err);\n\t\t\tisOk = false;\n\t\t}\n\t}\n\n\treturn isOk;\n}", "function verify_inputs(){\n if(document.getElementById(\"Split_By\").value == ''){\n return false;\n }\n if(document.getElementById(\"Strength\").value == ''){\n return false;\n }\n if(document.getElementById(\"Venue\").value == ''){\n return false;\n }\n if(document.getElementById(\"season_type\").value == ''){\n return false;\n }\n if(document.getElementById(\"adjustmentButton\").value == ''){\n return false;\n }\n\n return true\n }", "function saveRecord() {\n\n var customer_id_elem = document.getElementsByClassName(\"customer_id\");\n var mpex_1kg_elem = document.getElementsByClassName(\"1kg_new\");\n var mpex_old_1kg_elem = document.getElementsByClassName(\"old_1kg_new\");\n var mpex_3kg_elem = document.getElementsByClassName(\"3kg_new\");\n var mpex_old_3kg_elem = document.getElementsByClassName(\"old_3kg_new\");\n var mpex_5kg_elem = document.getElementsByClassName(\"5kg_new\");\n var mpex_old_5kg_elem = document.getElementsByClassName(\"old_5kg_new\");\n var mpex_500g_elem = document.getElementsByClassName(\"500g_new\");\n var mpex_old_500g_elem = document.getElementsByClassName(\"old_500g_new\");\n var mpex_b4_elem = document.getElementsByClassName(\"b4_new\");\n var mpex_old_b4_elem = document.getElementsByClassName(\"old_b4_new\");\n var mpex_c5_elem = document.getElementsByClassName(\"c5_new\");\n var mpex_old_c5_elem = document.getElementsByClassName(\"old_c5_new\");\n var mpex_dl_elem = document.getElementsByClassName(\"dl_new\");\n var mpex_old_dl_elem = document.getElementsByClassName(\"old_dl_new\");\n\n\n for (var x = 0; x < customer_id_elem.length; x++) {\n\n var update = false;\n\n if (mpex_1kg_elem[x].value != mpex_old_1kg_elem[x].value || mpex_3kg_elem[x].value != mpex_old_3kg_elem[x].value || mpex_5kg_elem[x].value != mpex_old_5kg_elem[x].value || mpex_500g_elem[x].value != mpex_old_500g_elem[x].value || mpex_b4_elem[x].value != mpex_old_b4_elem[x].value || mpex_c5_elem[x].value != mpex_old_c5_elem[x].value || mpex_dl_elem[x].value != mpex_old_dl_elem[x].value) {\n\n var customer_record = nlapiLoadRecord('customer', customer_id_elem[x].value);\n var mpex_invoicing = customer_record.getFieldValue('custentity_mpex_invoicing_cycle')\n\n if (mpex_1kg_elem[x].value != mpex_old_1kg_elem[x].value) {\n if (mpex_1kg_elem[x].value == '0') {\n customer_record.setFieldValue('custentity_mpex_1kg_price_point_new', null);\n } else {\n customer_record.setFieldValue('custentity_mpex_1kg_price_point_new', mpex_1kg_elem[x].value);\n }\n\n\n\n }\n if (mpex_3kg_elem[x].value != mpex_old_3kg_elem[x].value) {\n if (mpex_3kg_elem[x].value == '0') {\n customer_record.setFieldValue('custentity_mpex_3kg_price_point_new', null);\n } else {\n customer_record.setFieldValue('custentity_mpex_3kg_price_point_new', mpex_3kg_elem[x].value);\n }\n\n\n\n }\n if (mpex_5kg_elem[x].value != mpex_old_5kg_elem[x].value) {\n if (mpex_5kg_elem[x].value == '0') {\n customer_record.setFieldValue('custentity_mpex_5kg_price_point_new', null);\n } else {\n customer_record.setFieldValue('custentity_mpex_5kg_price_point_new', mpex_5kg_elem[x].value);\n }\n\n }\n if (mpex_500g_elem[x].value != mpex_old_500g_elem[x].value) {\n if (mpex_500g_elem[x].value == '0') {\n customer_record.setFieldValue('custentity_mpex_500g_price_point_new', null);\n } else {\n customer_record.setFieldValue('custentity_mpex_500g_price_point_new', mpex_500g_elem[x].value);\n }\n\n }\n if (mpex_b4_elem[x].value != mpex_old_b4_elem[x].value) {\n if (mpex_b4_elem[x].value == '0') {\n customer_record.setFieldValue('custentity_mpex_b4_price_point_new', null);\n } else {\n customer_record.setFieldValue('custentity_mpex_b4_price_point_new', mpex_b4_elem[x].value);\n }\n\n }\n if (mpex_c5_elem[x].value != mpex_old_c5_elem[x].value) {\n if (mpex_c5_elem[x].value == '0') {\n customer_record.setFieldValue('custentity_mpex_c5_price_point_new', null);\n } else {\n customer_record.setFieldValue('custentity_mpex_c5_price_point_new', mpex_c5_elem[x].value);\n }\n\n }\n if (mpex_dl_elem[x].value != mpex_old_dl_elem[x].value) {\n if (mpex_dl_elem[x].value == '0') {\n customer_record.setFieldValue('custentity_mpex_dl_price_point_new', null);\n } else {\n customer_record.setFieldValue('custentity_mpex_dl_price_point_new', mpex_dl_elem[x].value);\n }\n\n\n }\n if (isNullorEmpty(mpex_invoicing) || mpex_invoicing == 1) {\n customer_record.setFieldValue('custentity_mpex_price_point_start_date', nextMonth());\n } else if (mpex_invoicing == 2) {\n customer_record.setFieldValue('custentity_mpex_price_point_start_date', nextWeek());\n }\n\n customer_record.setFieldValue('custentity_mpex_price_date_update', getDate());\n nlapiSubmitRecord(customer_record)\n }\n }\n\n return true;\n\n}", "ValidateRoute(route){  \n let plant_id=route.plantID;\n let gps_id=route.gpsID;\n let legArray=route.legs;\n //Do I need to validate if the routeID is unique?\n // validate gpsID and plantID\n if(!global.GpsIdList.includes(gps_id) || !global.PlantIdList.includes(plant_id)) \n {\n return -1; // illegal gpsID or plantID\n }\n\n for(let i=0;i<legArray.length;i++){\n \n //============number data type\n //let routeID = legArray[i].routeID; // maybe the Karmax will give a RouteID or just use the Row number of new route\n let startLocationID = legArray[i].StartLocationID;\n let endLocationID = legArray[i].EndLocationID;\n let variableCost = legArray[i].VariableCost;\n let fixedCost = legArray[i].FixedCost;\n let estimatedCost = legArray[i].EstimatedCost;\n //=============DateTime string\n let expectedArrivalTime = legArray[i].ExpectedArrivalTime;\n let expectedDepartureTime = legArray[i].ExpectedDepartureTime;\n //===validate number date type, make sure it is a number or a string of number\n if(isNaN(startLocationID)||isNaN(endLocationID)||isNaN(variableCost)||isNaN(fixedCost)||isNaN(estimatedCost)){\n console.log(`InsertLegs()==>Expected a number, make sure the data type!`);\n return -2; // illegal locationID or Cost Data type .\n };\n \n // ===check if locationID is legal\n\n if(!global.LocationIdList.includes(startLocationID)||!global.LocationIdList.includes(endLocationID)){\n console.log(`InsertLegs()==>locationID doesn't exist!`);\n return -3; // illegal locationID value. \n } \n\n //===validate DateTime string\n\n if (i<legArray.length-1){ //not the last leg\n if(!this.IsDateTime(expectedArrivalTime)||!this.IsDateTime(expectedDepartureTime)){\n console.log(`InsertLegs()==>Expected a DateTime, make sure the data type!`);\n return -4; // Data type has error.\n } \n }else{ // For the last leg, the ExpectedDepartureTime will be ignored\n if(!this.IsDateTime(expectedArrivalTime)){\n console.log(`InsertLegs()==>Expected a DateTime, make sure the data type!`);\n return -4; }// Data type has error.\n }\n } \n\n return 1; // Passed ! Good! \n }", "function table_of_legal_moves1() {\n var i, j, t,\n n = 11,\n b = [],\n m = [];\n for (i = 0; i < n; i += 1) {\n b[i] = [];\n for (j = 0; j < n; j += 1) {\n b[i][j] = 0;\n }\n }\n for (j = 4; j < 7; j += 1) {\n b[2][j] = j - 3;\n }\n for (j = 3; j < 8; j += 1) {\n b[3][j] = j + 1;\n }\n for (j = 2; j < 9; j += 1) {\n b[4][j] = j + 7;\n }\n for (j = 2; j < 9; j += 1) {\n b[5][j] = j + 14;\n }\n for (j = 2; j < 9; j += 1) {\n b[6][j] = j + 21;\n }\n for (j = 3; j < 8; j += 1) {\n b[7][j] = j + 27;\n }\n for (j = 4; j < 7; j += 1) {\n b[8][j] = j + 31;\n }\n for (i = 0; i <= nfields; i += 1) {\n m[i] = [];\n }\n for (i = 0; i < n; i += 1) {\n for (j = 0; j < n; j += 1) {\n if (b[i][j]) {\n t = [];\n if (b[i - 2][j] !== 0) {\n t.push([b[i - 1][j], b[i - 2][j]]);\n }\n if (b[i + 2][j] !== 0) {\n t.push([b[i + 1][j], b[i + 2][j]]);\n }\n if (b[i][j - 2] !== 0) {\n t.push([b[i][j - 1], b[i][j - 2]]);\n }\n if (b[i][j + 2] !== 0) {\n t.push([b[i][j + 1], b[i][j + 2]]);\n }\n m[b[i][j]] = t;\n }\n }\n }\n return m;\n }", "function changeinFields(currRecord) {\n\tvar flag = 0;\n\tvar oldrecord = nlapiGetOldRecord(); \n\tnlapiLogExecution('DEBUG','customer ', currRecord.getFieldText('entity')+ ' : diff : '+oldrecord.getFieldText('entity'));\n\tif(currRecord.getFieldText('entity') != oldrecord.getFieldText('entity'))\n\t{ return flag = 1; }\n\t\n\t//nlapiLogExecution('DEBUG','exchangerate ', currRecord.getFieldValue('exchangerate')+ ' : diff : '+oldrecord.getFieldValue('exchangerate'));\n\tif(currRecord.getFieldValue('exchangerate') != oldrecord.getFieldValue('exchangerate')) \n\t{ return flag = 1; }\n\t\n\tnlapiLogExecution('DEBUG','shipaddress ', currRecord.getFieldValue('shipaddress')+ ' : diff : '+oldrecord.getFieldValue('shipaddress'));\n\tif(currRecord.getFieldValue('shipaddress') != oldrecord.getFieldValue('shipaddress')) \n\t{ return flag = 1; }\n\t\n\t//nlapiLogExecution('DEBUG','trandate ', currRecord.getFieldValue('trandate')+ ' : diff : '+oldrecord.getFieldValue('trandate'));\n\tif(currRecord.getFieldValue('trandate') != oldrecord.getFieldValue('trandate')) \n\t{ return flag = 1; }\n\t\n\t//nlapiLogExecution('DEBUG','discounttotal ', currRecord.getFieldValue('discounttotal')+ ' : diff : '+oldrecord.getFieldValue('discounttotal'));\n\tif(currRecord.getFieldValue('discounttotal') != oldrecord.getFieldValue('discounttotal')) \n\t{ return flag = 1; }\n\t\n\tnlapiLogExecution('DEBUG','subtotal ', currRecord.getFieldValue('subtotal')+ ' : diff : '+oldrecord.getFieldValue('subtotal'));\n\tif(currRecord.getFieldValue('subtotal') != oldrecord.getFieldValue('subtotal')) \n\t{ return flag = 1; }\n\t\n\tnlapiLogExecution('DEBUG','itemcount ', currRecord.getLineItemCount('item')+ ' : diff : '+oldrecord.getLineItemCount('item'));\n\tif(currRecord.getLineItemCount('item') != oldrecord.getLineItemCount('item')) \n\t{ return flag = 1; }\n\t\n\tif(currRecord.getLineItemCount('item') == oldrecord.getLineItemCount('item')) { //if count of old record and current record lines are same then compare their field values\n\t\tfor( var n = 1; n <= currRecord.getLineItemCount('item'); n++) {\n\t\t\tvar itemintId = currRecord.getLineItemValue('item','item',n);\n\t\t\tvar olditemintId = oldrecord.getLineItemValue('item','item',n);\n\t\t\tnlapiLogExecution('DEBUG','itemintId ', itemintId+ ' : diff : '+olditemintId);\n\t\t\tif(itemintId != olditemintId) \n\t\t\t{ return flag = 1; }\n\t\t\tvar ItemCode = currRecord.getLineItemText('item','item',n);\n\t\t\tvar oldItemCode = oldrecord.getLineItemText('item','item',n);\n\t\t\tif(ItemCode != 'Description' && oldItemCode != 'Description') {\n\t\t\t\tvar CommodityCode = currRecord.getLineItemValue('item','custcol_spk_commodity_taxcode',n);\n\t\t\t\tvar oldCommodityCode = oldrecord.getLineItemValue('item','custcol_spk_commodity_taxcode',n);\n\t\t\t\tif(CommodityCode != oldCommodityCode) { return flag = 1; }\n\t\t\t\t\n\t\t\t\tvar TaxCode = currRecord.getLineItemValue('item','taxcode',n);\n\t\t\t\tvar oldTaxCode = oldrecord.getLineItemValue('item','taxcode',n);\n\t\t\t\tif(TaxCode != oldTaxCode) { return flag = 1; }\n\t\t\t\t\n\t\t\t\tvar AccountingCode = currRecord.getLineItemValue('item','custcol_spk_itemincomeaccnum',n);\n\t\t\t\tvar oldAccountingCode = oldrecord.getLineItemValue('item','custcol_spk_itemincomeaccnum',n);\n\t\t\t\tif(AccountingCode != oldAccountingCode) { return flag = 1; }\n\t\t\t\t\n\t\t\t\tvar BundleFlag = currRecord.getLineItemValue('item','custcol_bundle',n);\n\t\t\t\tvar oldBundleFlag = oldrecord.getLineItemValue('item','custcol_bundle',n);\n\t\t\t\tif(BundleFlag != oldBundleFlag) { return flag = 1; }\n\t\t\t\t\n\t\t\t\tvar BaseBundleCode = currRecord.getLineItemValue('item','custcol_spk_basebundlecode',n);\n\t\t\t\tvar oldBaseBundleCode = oldrecord.getLineItemValue('item','custcol_spk_basebundlecode',n);\n\t\t\t\tif(BaseBundleCode != oldBaseBundleCode) { return flag = 1; }\n\t\t\t\t\n\t\t\t\tvar Amount = currRecord.getLineItemValue('item','amount',n);\n\t\t\t\tvar oldAmount = oldrecord.getLineItemValue('item','amount',n);\n\t\t\t\tif(Amount != oldAmount) { return flag = 1; }\n\t\t\t\t\n\t\t\t\t//nlapiLogExecution('DEBUG','ItemCode :'+ItemCode,' CommodityCode :'+CommodityCode+ ' Amount :'+Amount+ ' BundleFlag :'+BundleFlag+' BaseBundleCode :'+BaseBundleCode);\n\t\t\t\t//nlapiLogExecution('DEBUG','oldItemCode :'+oldItemCode,' oldCommodityCode :'+oldCommodityCode+ ' oldAmount :'+oldAmount+ ' oldBundleFlag :'+oldBundleFlag+' oldBaseBundleCode :'+oldBaseBundleCode);\n\t\t\t}\n\t\t}\n\t}\n\treturn flag;\n}", "function forward() {\n\n // Need to do check to string 05($1) off of the register in order to check it properly\n // also need to deal with clearing off forwarding registers when the user cancels the skip-to method.\n var oneArray;\n var twoArray;\n var threeArray;\n var fourArray;\n var temp;\n\n //Checks if the rect10 is not white\n if(document.getElementById('rect10').getAttribute(\"fill\") != \"#ffffff\") {\n\n //Checks if the rect15 is white and if rect14 is not white\n if (document.getElementById('rect15').getAttribute('fill') == \"#ffffff\" && document.getElementById('rect14').getAttribute('fill') != \"#ffffff\") {\n\n console.log(\"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!INCHECK FOR SECOND ROW OF THINGGIES\");\n oneArray = document.getElementById(\"slot1\").textContent.split(\" \");\n twoArray = document.getElementById(\"slot2\").textContent.split(\" \");\n threeArray = document.getElementById(\"slot3\").textContent.split(\" \");\n oneArray[1] = oneArray[1].substring(0,oneArray[1].length-1);\n twoArray[2] = twoArray[2].substring(0,twoArray[2].length-1);\n twoArray[1] = twoArray[1].substring(0,twoArray[1].length-1);\n threeArray[2] = threeArray[2].substring(0,threeArray[2].length-1);\n\n //Checks if the 1st register in oneArray is equal to the second in threeArray\n if (oneArray[1] == threeArray[2]) {\n\n console.log(\"FIRST IF THE SAME AS THE SECOND OF THRIRD\");\n document.getElementById('slot2a').textContent = \"\" + oneArray[1];\n document.getElementById('slot2a').setAttribute('fill', document.getElementById('slot1').getAttribute('fill'));\n\n //Checks if the 1st register in oneArray is equal to the third in threeArray\n } else if (oneArray[1] == threeArray[3]) {\n\n console.log(\"FIRST IS SAME AS THIRD OF THIRD\");\n document.getElementById('slot2a').textContent = \"\" + oneArray[1];\n document.getElementById('slot2a').setAttribute('fill', document.getElementById('slot1').getAttribute('fill'));\n\n }\n // Checks if the rect15 is not white\n } else if (document.getElementById('rect15').getAttribute('fill') != \"#ffffff\"){\n document.getElementById('slot2a').textContent = \"\";\n document.getElementById('slot2b').textContent = \"\";\n document.getElementById('slot3a').textContent = \"\";\n document.getElementById('slot3a').setAttribute('fill', \"beige\");\n document.getElementById('slot3b').textContent = \"\";\n document.getElementById('slot3b').setAttribute('fill', \"beige\");\n oneArray = document.getElementById(\"slot1\").textContent.split(\" \");\n twoArray = document.getElementById(\"slot2\").textContent.split(\" \");\n threeArray = document.getElementById(\"slot3\").textContent.split(\" \");\n var loadTemp, tempValue, allValue, i;\n\n //Checks that the 3rd register in oneArray is undefined and that slot1 is not a noop\n if(oneArray[3] == undefined && document.getElementById('slot1').textContent != \"noop\") {\n\n loadTemp = oneArray[2].split(\"\");\n tempValue = \"\";\n allValue = \"\";\n i = 0;\n //stripping off offset and ().\n while (loadTemp[i] != '(') {\n\n tempValue = tempValue + \"\" + loadTemp[i];\n i++;\n\n }\n\n while (i < loadTemp.length) {\n\n allValue = allValue + \"\" + loadTemp[i];\n i++;\n\n }\n\n oneArray[2] = allValue;\n oneArray[2] = oneArray[2].substring(0, oneArray[2].length - 1);\n oneArray[2] = oneArray[2].substring(1, oneArray[2].length);\n oneArray[1] = oneArray[1].substring(0, oneArray[1].length - 1);\n\n } else {\n\n //Checks if slot1 is not a noop\n if (document.getElementById('slot1').textContent != \"noop\") {\n\n oneArray[1] = oneArray[1].substring(0, oneArray[1].length - 1);\n\n }\n\n }\n\n // checks if the 3rd register of twoArray is undefined and if slot2 is not a noop\n if(twoArray[3] == undefined && document.getElementById('slot2').textContent != \"noop\") {\n\n if (document.getElementById('slot2').textContent != \" \") {\n\n //Stripping offset and ()\n loadTemp = twoArray[2].split(\"\");\n\n tempValue = \"\";\n allValue = \"\";\n i = 0;\n\n while (loadTemp[i] != '(') {\n\n tempValue = tempValue + \"\" + loadTemp[i];\n i++;\n\n }\n\n while (i < loadTemp.length) {\n\n allValue = allValue + \"\" + loadTemp[i];\n i++;\n\n }\n\n twoArray[2] = allValue;\n twoArray[2] = twoArray[2].substring(0, twoArray[2].length - 1);\n twoArray[2] = twoArray[2].substring(1, twoArray[2].length);\n twoArray[1] = twoArray[1].substring(0, twoArray[1].length - 1);\n\n }\n\n } else {\n\n //Checks if slot2 is not a noop\n if (document.getElementById('slot2').textContent != \"noop\") {\n\n twoArray[2] = twoArray[2].substring(0, twoArray[2].length - 1);\n twoArray[1] = twoArray[1].substring(0, twoArray[1].length - 1);\n\n }\n\n }\n\n //checks if the 3rd register of threeArray and that is slot3 is not a noop\n if(threeArray[3] == undefined && document.getElementById('slot3').textContent != \"noop\") {\n\n //Checks if the slot3 is not equal to \" \"\n if (document.getElementById('slot3').textContent != \" \") {\n\n //Stripping offset and ()\n loadTemp = threeArray[2].split(\"\");\n\n tempValue = \"\";\n allValue = \"\";\n i = 0;\n\n while (loadTemp[i] != '(') {\n\n tempValue = tempValue + \"\" + loadTemp[i];\n i++;\n\n }\n\n while (i < loadTemp.length) {\n\n allValue = allValue + \"\" + loadTemp[i];\n i++;\n\n }\n\n threeArray[2] = allValue;\n threeArray[2] = threeArray[2].substring(0, threeArray[2].length - 1);\n threeArray[2] = threeArray[2].substring(1, threeArray[2].length);\n threeArray[1] = threeArray[1].substring(0, threeArray[1].length - 1);\n\n }\n\n } else {\n\n //Checks if slot3 is not a noop\n if (document.getElementById('slot3').textContent != \"noop\") {\n\n threeArray[2] = threeArray[2].substring(0, threeArray[2].length - 1);\n threeArray[1] = threeArray[1].substring(0, threeArray[1].length - 1);\n\n }\n\n }\n\n //Checks if the destination register of one is equal to the parts of two and if slot1 is not a noop\n if ((oneArray[1] == twoArray[2] || oneArray[1] == twoArray[3]) && document.getElementById('slot1').textContent != \"noop\") {\n\n document.getElementById('slot2a').textContent = \"\" + oneArray[1];\n document.getElementById('slot2a').setAttribute('fill', document.getElementById('slot1').getAttribute('fill'));\n\n }\n\n //Checks if the destination register of two is equal to the parts of three and if slot2 is not a noop\n if ((twoArray[1] == threeArray[2] || twoArray[1] == threeArray[3]) && document.getElementById('slot2').textContent != \"noop\") {\n\n document.getElementById('slot3a').textContent = \"\" + twoArray[1];\n document.getElementById('slot3a').setAttribute('fill', document.getElementById('slot2').getAttribute('fill'));\n\n }\n\n //Checks if the destination register of one is equal to the parts of three and if slot1 is not a noop\n if ((oneArray[1] == threeArray[2] || oneArray[1] == threeArray[3]) && document.getElementById('slot1').textContent != \"noop\") {\n\n document.getElementById('slot3b').textContent = \"\" + oneArray[1];\n document.getElementById('slot3b').setAttribute('fill', document.getElementById('slot1').getAttribute('fill'));\n\n }\n\n }\n\n }\n\n}", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function checkTime()\r\n { \r\n var pass = false;\r\n var ids = [\"#time_mon\", \"#time_tue\", \"#time_wed\", \"#time_thu\", \"#time_fri\", \"#time_sat\", \"#time_sun\"]; \r\n for(i in ids){\r\n if($(ids[i]).val()){ //the user input something here\r\n pass = true; //set true for now. To flag that at least a day is available\r\n //check if the entered format is correct\r\n var reg = new RegExp(/^\\d{4}$/);\r\n var arr = $(ids[i]).val().split(' '); //split into time frame chunks \r\n for(j in arr){ \r\n var temp = arr[j].split('-'); //get a specific time\r\n if(reg.test(temp[0]) && reg.test(temp[1])){ //if the tokens are true\r\n //check if the timeslots are within 24 hours \r\n if(temp[0] <= 2400 && temp[1] <= 2400){\r\n pass = true; \r\n// alert(temp[0]);\r\n// alert(temp[1]);\r\n }\r\n else{\r\n pass = false;\r\n }\r\n }\r\n else{\r\n var day = ids[i].split('_')[1];\r\n// alert(day); \r\n if(day == \"wed\"){\r\n day += \"nesday\";\r\n }\r\n else if(day == \"thu\"){\r\n day += \"rsday\";\r\n }\r\n else if(day == \"tue\"){\r\n day += \"sday\";\r\n }\r\n else if(day == \"sat\"){\r\n day += \"urday\";\r\n }\r\n else{\r\n day += \"day\";\r\n } \r\n day = \"Please fix your availability on \" + day;\r\n alert(day); //alert user as to what is wrong \r\n $(ids[i]).focus();\r\n pass = false;\r\n return pass;\r\n }\r\n }\r\n } \r\n } \r\n if(pass == false){\r\n alert(\"Something went wrong with your availability.\");\r\n $(\"#time_mon\").focus(); \r\n }\r\n return pass;\r\n }", "function add_days_with_exact_four(data_array, number_of_people_on_each_day_shift) {\n var dates = find_days_with_exact_four_nones(data_array, number_of_people_on_each_day_shift);\n for (var i = 0; i < dates.length; i++) {\n for (var j = 0; j < data_array.length; j++) {\n if( data_array[j][dates[i]] == shift_type.none.index ) data_array[j][dates[i]] = shift_type.day.index;\n }\n }\n return data_array;\n}", "function reveal_blanks( w, h )\n{\n var h_new, w_new, i;\n\treveal( w, h );\n for( i = 0; i < 8; i++ )\n {\n h_new = h + h_mod[ i ];\n w_new = w + w_mod[ i ];\n if( h_new >= 0 && h_new < h_input && w_new >= 0 && w_new < w_input && minefield[w_new][h_new] != -1)\n {\n reveal( w_new, h_new );\n if( minefield[ w_new ][ h_new ] == \"0\")\n {\n minefield[ w_new ][ h_new ] = -1; // handled\n reveal_blanks( w_new, h_new ); // recursive call\n }\n }\n }\n}", "function validar_add_riesgo1(){\r\n\t\r\n\tif(document.getElementById('sel_alcance_add').value=='-1'){\r\n\t\tmostrarDiv('error_alcance');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('txt_descripcion').value==''){\r\n\t\tmostrarDiv('error_descripcion');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('txt_estrategia').value==''){\r\n\t\tmostrarDiv('error_estrategia');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('txt_fecha_deteccion_add').value==''){\r\n\t\tmostrarDiv('error_fecha_deteccion');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('sel_impacto').value=='-1'){\r\n\t\tmostrarDiv('error_impacto');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('sel_probabilidad').value=='-1'){\r\n\t\tmostrarDiv('error_probabilidad');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('sel_estado_add').value=='-1'){\r\n\t\tmostrarDiv('error_estado_add');\t\r\n\t\treturn false;\r\n\t}\t\r\n\tdocument.getElementById('frm_add_riesgo1').action='?mod=riesgos&niv=1&task=saveAdd';\r\n\tdocument.getElementById('frm_add_riesgo1').submit();\r\n}", "checkMatrizPositionAndPutShip(row ,column ,insertionType ,shipSize)\n {\n\n /* insertionType = 0 : horizontal\n insertionType = 1 : vertical\n */\n\n //Counter\n let count = 0;\n\n //Saving row and column for insertion.\n let rowSaved = row;\n let columnSaved = column;\n\n //If there is someone there returns false.\n let isNotAvailable = this.checkIfIsThere( row , column);\n if(isNotAvailable)\n {\n return false;\n }\n\n //Check horizontal insertion ====================================================================================================\n if (insertionType == 0)\n {\n //Here we walk on columns\n while (count < shipSize)\n {\n //Check if reach the maximum range of the matriz\n if(this.checkIfMatrizMaxiumWasReached(column))\n {\n return false;\n }\n\n //Check if there is something diferent from 0 inside the given position.\n isNotAvailable = this.checkIfIsThere( row , column);\n if(isNotAvailable)\n {\n return false;\n }\n\n //Increment only the column to walk horitonzaly right in matriz.\n column++;\n count++;\n }\n\n //Reseting for insertion\n count = 0;\n column = columnSaved;\n //Put ship number there\n while (count < shipSize)\n {\n mapMatriz[row][column] = shipSize;\n column++;\n count++;\n }\n\n //Went through everything so inserted correctly.\n return true;\n }\n\n //Check vertical insertion =======================================================================================================\n if (insertionType == 1)\n {\n //Here we walk on columns or J\n while (count < shipSize)\n {\n //Check if reach the maximum range of the matriz\n if(this.checkIfMatrizMaxiumWasReached(row))\n {\n return false;\n }\n\n //Check if there is something diferent from 0 inside the given position.\n isNotAvailable = this.checkIfIsThere( row , column);\n if(isNotAvailable)\n {\n return false;\n }\n\n //Increment only the column to walk horitonzaly right in matriz.\n row++;\n count++;\n }\n\n //Reseting for insertion\n count = 0;\n row = rowSaved;\n\n //Put ship number there\n while (count < shipSize)\n {\n mapMatriz[row][column] = shipSize;\n row++;\n count++;\n }\n\n //Went through everything so inserted correctly.\n return true;\n }\n\n\n }", "function RequiredFieldHandler(eventInfo) {\n var app = UiApp.createApplication();\n var par = eventInfo.parameter;\n var submitButton = app.getElementById('Submit');\n \n var ss = SpreadsheetApp.openById(ssKey);\n var sheet = ss.getSheetByName('Fields');\n var range = sheet.getDataRange();\n var values = range.getValues();\n var lastRow = range.getLastRow();\n \n var allOK = true;\n \n for (var i = 1; i < lastRow; i++) {\n if (values[i][8] == \"X\") {\n var test = par[values[i][2]];\n var badInput = app.getElementById(values[i][2]);\n badInput.setStyleAttribute('borderColor', 'LightGray').setStyleAttribute('borderWidth', '1px');\n if (test == \"\" || undefined) { \n allOK = false;\n badInput.setStyleAttribute('borderColor', 'red').setStyleAttribute('borderWidth', '3px');\n \n }\n }\n }\n \n \n if (allOK == true) {submitButton.setEnabled(true);}\n else if (allOK == false) {submitButton.setEnabled(false);}\n \n return app;\n \n}", "function valid(campo1, campo2, campo3, campo4, campo5, campo6, campo7, campo8, campo9, campo10, campo11, campo12, campo13, campo14){\nerro = false;\n\tif (campo1 != null){\n\t\tif (campo1.value == \"\"){\n\t\t\terro = true;\n\t\t\tcampo1.focus();\n\t\t}\n\t\telse if (campo2 != null){\n\t\t\tif (campo2.value == \"\"){\n\t\t\t\terro = true;\n\t\t\t\tcampo2.focus();\n\t\t\t}\n\t\t\telse if (campo3 != null){\n\t\t\t\tif (campo3.value == \"\"){\t\t\n\t\t\t\t\terro = true;\n\t\t\t\tcampo3.focus();\n\t\t\t\t}\n\t\t\t\telse if (campo4 != null){\n\t\t\t\t\tif (campo4.value == \"\"){\t\t\n\t\t\t\t\t\terro = true;\n\t\t\t\t\t\tcampo4.focus();\n\t\t\t\t\t}\n\t\t\t\t\telse if (campo5 != null){\n\t\t\t\t\t\tif (campo5.value == \"\"){\t\t\n\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\tcampo5.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (campo6 != null){\n\t\t\t\t\t\t\tif (campo6.value == \"\"){\t\t\n\t\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\t\tcampo6.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (campo7 != null){\n\t\t\t\t\t\t\t\tif (campo7.value == \"\"){\t\t\n\t\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\t\tcampo7.focus();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (campo8 != null){\n\t\t\t\t\t\t\t\t\tif (campo8.value == \"\"){\t\t\n\t\t\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\t\t\tcampo8.focus();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if (campo9 != null){\n\t\t\t\t\t\t\t\t\t\tif (campo9.value == \"\"){\t\t\n\t\t\t\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\t\t\t\tcampo9.focus();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (campo10 != null){\n\t\t\t\t\t\t\t\t\t\t\tif (campo10.value == \"\"){\t\t\n\t\t\t\t\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\t\t\t\t\tcampo10.focus();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse if (campo11 != null){\n\t\t\t\t\t\t\t\t\t\t\t\tif (campo11.value == \"\"){\t\t\n\t\t\t\t\t\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\t\t\t\t\t\tcampo11.focus();\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\telse if (campo12 != null){\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (campo12.value == \"\"){\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\tcampo12.focus();\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\telse if (campo13 != null){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (campo13.value == \"\"){\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcampo13.focus();\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\telse if (campo14 != null){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (campo14.value == \"\"){\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\terro = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcampo14.focus();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\tif (erro==false){\n\t\treturn salvar();\n\t}\n\telse{\n\t\talert(\"Favor preencher todos os campos requeridos. \\n Vou indica-lo!\");\n\t\treturn false;\n\t}\n}", "function validateFields(fields){\n\tvar errors = 0;\n\t$.each(fields, function(i,arr){\n\t\tif($(arr[0]).val() == ''){\n\t\t\terrors += 1;\n\t\t\taddRedBorder(arr[0], null);\n\t\t}else{\n\t\t\tremoveRedBorder(arr[0]);\n\t\t}\n\t});\n\treturn errors;\n}", "function checkForBlankField(fname,lname,email,phone,address,uname,pass,confirmPass){\n\t\n\t// Nested if statements to check one by one\n\t// Returns whether is empty or not\n\t// Alert to inform user by highlighting borders and display an error message\n\tif(fname ==null || fname==\"\"){\n\t\t// Reset fields\n\t\tresetFields();\n\t\t// Highlights borders and displays error message\n\t\tdocument.getElementById(\"fnameError\").style.color = \"#F6482B\";\n\t\tdocument.getElementById(\"fname\").style.border = \"3px solid red\";\n\t\treturn false;\n\t}else if(lname == null || lname == \"\"){\n\t\tresetFields();\n\t\t\n\t\tdocument.getElementById(\"lnameError\").style.color = \"red\";\n\t\tdocument.getElementById(\"lname\").style.border = \"3px solid red\";\n\t\treturn false;\n\t}else if(email == null || email==\"\"){\n\t\tresetFields();\n\t\t\n\t\tdocument.getElementById(\"emailError\").style.color = \"red\";\n\t\tdocument.getElementById(\"email\").style.border = \"3px solid red\";\n\t\treturn false;\n\t}else if(phone == null || phone==\"\"){\n\t\tresetFields();\n\t\t\n\t\tdocument.getElementById(\"phoneError\").style.color = \"red\";\n\t\tdocument.getElementById(\"phone\").style.border = \"3px solid red\";\n\t\t\n\t\treturn false;\n\t}else if(address == null || address ==\"\"){\n\t\tresetFields();\n\t\t\n\t\tdocument.getElementById(\"addError\").style.color = \"red\";\n\t\tdocument.getElementById(\"address\").style.border = \"3px solid red\";\n\t\t\n\t\treturn false;\n\t}else if(uname == null || uname ==\"\"){\n\t\tresetFields();\n\t\t\n\t\tdocument.getElementById(\"usernameError\").style.color = \"red\";\n\t\tdocument.getElementById(\"uname\").style.border = \"3px solid red\";\n\t\treturn false;\n\t}else if(pass ==null || pass==\"\"){\n\t\tresetFields();\n\t\t\n\t\tdocument.getElementById(\"passError\").style.color = \"red\";\n\t\tdocument.getElementById(\"pword\").style.border = \"3px solid red\";\n\t\treturn false;\n\t}else if(confirmPass == null || confirmPass==\"\"){\n\t\tresetFields();\n\t\t\n\t\tdocument.getElementById(\"confirmPassError\").style.color = \"red\";\n\t\tdocument.getElementById(\"cpword\").style.border = \"3px solid red\";\n\t\treturn false;\n\t}else{\n\t\t\n\t\tresetFields();\n\t\t\n\t\treturn true;\n\t}\n\t\n\n\t\n}", "function checkUpdate()\n{\n\t// Collect input fields.\n\tvar inputs = $(\"#startCity, #startState, #endCity, #endState\");\n\n\t// Make sure they all contain values.\n\tif (inputs[0].value != \"\" && inputs[1].value != \"\" && inputs[2].value != \"\" && inputs[3].value != \"\")\n\t{\n\t\tupdate();\n\t}\n}", "function validateInputs() {\n let isValid = true;\n\n // validation for resistance workouts\n if (workoutType === \"resistance\") {\n // name of workout is required (cannot be empty string)\n if (nameInput.value.trim() === \"\") {\n isValid = false;\n }\n // weights are required\n if (weightInput.value.trim() === \"\") {\n isValid = false;\n }\n // sets are required\n if (setsInput.value.trim() === \"\") {\n isValid = false;\n }\n // reps are required\n if (repsInput.value.trim() === \"\") {\n isValid = false;\n }\n // duration is required\n if (resistanceDurationInput.value.trim() === \"\") {\n isValid = false;\n }\n } // validation for cardio workouts\n else if (workoutType === \"cardio\") {\n // name is required input\n if (cardioNameInput.value.trim() === \"\") {\n isValid = false;\n }\n // duration is required input \n if (durationInput.value.trim() === \"\") {\n isValid = false;\n }\n // distance is required input\n if (distanceInput.value.trim() === \"\") {\n isValid = false;\n }\n }\n // if all inputs for workout are valid,\n // enable buttons to \"complete\" the workout or \"add exercise\"\n if (isValid) {\n completeButton.removeAttribute(\"disabled\");\n addButton.removeAttribute(\"disabled\");\n } else {\n completeButton.setAttribute(\"disabled\", true);\n addButton.setAttribute(\"disabled\", true);\n }\n}", "function move_mac(num,mac,next_mac)\n{\n\tvar str=\"\";\n str=mac.value.length;\n\n\tif(str == \"2\")\n\t{\n\t\tif(num != \"6\")\n\t\t\tfield_focus(next_mac,\"**\");\n\t}\n}", "function shiftToLeft(arr, ind){\n if(arr.length >= 3 && arr[ind+1] && arr[ind+2]){\n var temp1 = arr[ind+1];\n var temp2 = arr[ind+2];\n arr[ind+2] = arr[ind];\n arr[ind+1] = temp2;\n arr[ind] = temp1;\n return arr;\n }else{\n console.log(\"out of bounds\");\n }\n}", "function validarFormModifyDates() {\n const cuTorre = document.forms[\"modifyDatePosition\"][\"torreCU\"];\n const serialTorre = document.forms[\"modifyDatePosition\"][\"torreSerial\"];\n const cuMoni = document.forms[\"modifyDatePosition\"][\"moniCU\"];\n const serialMoni = document.forms[\"modifyDatePosition\"][\"moniSerial\"];\n\n // Los campos no pueden ser vaciós.\n if (cuTorre.value == \"\" || cuTorre.value.length <= 3 || serialTorre.value == \"\" || serialTorre.value.length <= 3 || cuMoni.value == \"\" || cuMoni.value.length <= 3 || serialMoni.value == \"\" || serialMoni.value.length <= 3) {\n snackbar(\"Los campos no deben ser vacios y no deden ser inferiores a 4 caracteres.\");\n return false;\n }else {\n console.log(\"Datos correctos (por ahora)\");\n saveChanges(cuTorre.value, serialTorre.value, cuMoni.value, serialMoni.value, buttonSave.value);\n }\n}", "function rpad(staff, nrFill, add_char) {\r\n var i, string = staff.toString();\r\n\r\n for (i = string.length; i < nrFill; ++i) {\r\n string += add_char;\r\n }\r\n return string;\r\n }", "function checkReqFields() {\n \n}", "function validateInputs() {\n // setting the isValid variable to true \n let isValid = true;\n\n // if the user chooses resistance \n if (workoutType === \"resistance\") {\n\n // if the name input of exercise form is left blank \n if (nameInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the weight input of exercise form is left blank \n if (weightInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the sets input of the exercise form is left blank \n if (setsInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the reps input of the exercise form is left blank \n if (repsInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the resistance input of the exercise form is left blank \n if (resistanceDurationInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the user chooses resistance \n } else if (workoutType === \"cardio\") {\n\n // if the name input of the exercise form is left blank \n if (cardioNameInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the duration input of the exercise form is left blank \n if (durationInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the distance input of the exercise form is left blank \n if (distanceInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n }\n\n // if isValid is true \n if (isValid) {\n // enable the complete and add exercise button \n completeButton.removeAttribute(\"disabled\");\n addButton.removeAttribute(\"disabled\");\n\n // if isValid is false \n } else {\n // disable the complete and add exercise button \n completeButton.setAttribute(\"disabled\", true);\n addButton.setAttribute(\"disabled\", true);\n }\n}", "function shiftTiles() {\n // Shift tiles\n \n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n \n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function editaData( campo, evt )\r\n{\r\n retornaEstadosTeclas( evt );\r\n tecla = retornaKeyCode( evt );\r\n //verifica se usuário digitou tecla de atalho para inserir data atual no campo.\r\n if( tecla == 104 || tecla == 72 ) // 104 = h, 72 = H\r\n {\r\n hoje = new Date(dataServidor);\r\n dataDeHoje = ( ( hoje.getDate( ) + 100 ).toString( ) ).substring( 1, 3 ) + \"/\";\r\n dataDeHoje += ( ( hoje.getMonth( ) + 101 ).toString( ) ).substring( 1, 3 ) + \"/\";\r\n dataDeHoje += hoje.getFullYear( );\r\n campo.value = dataDeHoje;\r\n cancelaEvento( evt );\r\n try{campo.onchange( );}catch(ERROR){};\r\n return true;\r\n }\r\n //se campo estiver preenchido, aciona atalhos para somar e subtrair dias da data.\r\n if( campo.value.length == 10 )\r\n {\r\n //Se o usuario digitar Shift + '+', acrescenta 30 dias a data\r\n if( shift && tecla == 43 )\r\n {\r\n campo.value = operaData( campo.value, 30 );\r\n cancelaEvento( evt );\r\n try{campo.onchange( );}catch(ERROR){};\r\n return true;\r\n }\r\n //Se o usuario digitar '+', acrescenta 1 dia a data\r\n else if( tecla == 43 )\r\n {\r\n campo.value = operaData( campo.value, 1 );\r\n cancelaEvento( evt );\r\n try{campo.onchange( );}catch(ERROR){};\r\n return true;\r\n }\r\n //Se o usuario digitar Shift + '-', subtrai 30 dias da data\r\n if( shift && tecla == 45 )\r\n {\r\n campo.value = operaData( campo.value, -30 );\r\n cancelaEvento( evt );\r\n try{campo.onchange( );}catch(ERROR){};\r\n return true;\r\n }\r\n //Se o usuario digitar '-', subtrai 1 dia da data\r\n else if( tecla == 45 )\r\n {\r\n campo.value = operaData( campo.value, -1 );\r\n cancelaEvento( evt );\r\n try{campo.onchange( );}catch(ERROR){};\r\n return true;\r\n }\r\n }\r\n mascara( campo, evt, \"99/99/9999\" );\r\n}", "function getGameShift() {\r\n if (level > 0 && level < stages.length - 1) {\r\n gameShift += 2;\r\n }\r\n else {\r\n gameShift = finalStageKeys[0];\r\n }\r\n }", "function validateDoorFill(door, wall) {\n var spaceToRemove = wall.rightFiller + wall.leftFiller;\n if (wall.boxHeader == \"Left\" || wall.boxHeader == \"Right\") {\n spaceToRemove += BOXHEADER_LENGTH;\n }\n else if (wall.boxHeader == \"Both\") {\n spaceToRemove += BOXHEADER_LENGTH*2;\n }\n\n if ((wall.length - spaceToRemove) < door.fwidth) {\n errorMessageArea.innerHTML = \"This wall is too small to have a door of width \" + door.fwidth + \". Please try again.\";\n return false;\n }\n\n if (wall.mods.length > 0) {\n errorMessageArea.innerHTML = \"Fill cannot be used on a wall with existing doors. Please empty the wall first.\";\n return false;\n }\n\n return true;\n}", "function checkOverlap (shifts) {\n var width = 0;\n _.each(shifts, function (shift, i) {\n width += (shift.end-shift.start)\n });\n if (width > 1440) {\n return true;\n } else {\n return false;\n }\n }", "function checkfield(field) { \n\t// this is a horrible, horrible patch but still brilliant (the chosen two has done it again)\n\t// its purpose is to be able to ignore the login fields that are empty when the user and pass are as session variables\n if(usingSession && (field.name == 'user_id' || field.name == 'user_passwd')){\n\t\treturn false;\n\t}\n if (field.value=='') {\n field.focus();\n //alert (\"Field \" + field.name + \" required!\");\n if (document.getElementById('msg').innerHTML != \"Field \" + field.name + \" required!\")\n\t\t\tdocument.getElementById('msg').innerHTML = \"Field \" + field.name + \" required!\";\n // showfade('msg',1000);\n showfade('msg',fadeConstant);\n //window.location.reload();\n clear_table(document.getElementById('caltable'),true);\n // exit;\n return true;\n }\n return false;\n \n}", "fill() {\n for (let i = 0; i < 9; i++) {\n for (let j = 0; j < 9; j++) {\n if (this.board[i][j] == 0) {\n for (let k = 1; k <= 9; k++) {\n if (this.isValid(i, j, k)) {\n this.board[i][j] = k;\n if (this.fill()) {\n return true;\n } \n else {\n this.board[i][j] = 0;\n \n }\n }\n }\n return false;\n \n }\n }\n }\n return true;\n }", "function rltshift () {\n}", "function shiftUp() {\n for (let i =0; i < width; i++){\n let one = boxes[i].innerHTML;\n let two = boxes[i + width].innerHTML;\n let three = boxes[i + (width * 2)].innerHTML;\n let four = boxes[i + (width * 3)].innerHTML;\n let column = [parseInt(one), parseInt(two), parseInt(three), parseInt(four)];\n \n let filterColumn = column.filter(num => num);\n let missing = 4 - filterColumn.length;\n let empty = Array(missing).fill(0);\n let newColumn = empty.concat(empty);\n \n boxes[i].innerHtml = newColumn[0];\n boxes[i + width].innerHtml = newColumn[1];\n boxes[i + (width * 2)].innerHtml = newColumn[2];\n boxes[i + (width * 3)].innerHtml = newColumn[3];\n }\n}", "function checkIfValidInputs()\n{\n // Resets all red boxes\n unRedAll();\n // Check if textboxes are empty\n let result = 0;\n result += emptyShippingBoxes();\n \n let totalLeft = getNonDollar(\"checkoutTotalPrice\");\n // total 0 means that gift card covers entire cost, so\n // no need to enter billing and cc info\n if (totalLeft != 0)\n result += emptyBillingBoxes();\n if (result > 0)\n {\n alert(\"Please enter all necessary information\");\n return false;\n }\n // Now Checks if inputs are correct\n result += validateEmail(\"email\");\n result += checkNumbers(\"zip\",5);\n // Same idea as above with the if then loops\n if (totalLeft != 0)\n {\n result += checkNumbers(\"cvv\",3);\n if (document.getElementById(\"myCheck\").checked != true)\n result += checkNumbers(\"billingzip\",5);\n }\n if (result > 0)\n {\n alert(\"Please fix your information\");\n return false;\n }\n return true;\n}" ]
[ "0.5441441", "0.53938884", "0.5322467", "0.5271386", "0.5195142", "0.51111794", "0.51102453", "0.5105889", "0.5055036", "0.50256604", "0.50220543", "0.49944246", "0.4986251", "0.4978929", "0.4972423", "0.4956473", "0.4892646", "0.4843977", "0.48373464", "0.48100588", "0.47943908", "0.47884792", "0.47780073", "0.47704053", "0.47534746", "0.4748414", "0.47241828", "0.4713151", "0.47070172", "0.4691353", "0.46741763", "0.46708742", "0.46671298", "0.46648458", "0.4660998", "0.465738", "0.46519125", "0.46439385", "0.46429673", "0.46402594", "0.46393493", "0.4634475", "0.46248376", "0.46184596", "0.46168855", "0.46023417", "0.4592575", "0.458792", "0.45868862", "0.45831078", "0.45717207", "0.45701653", "0.45689404", "0.45677236", "0.45616487", "0.4553823", "0.4545018", "0.45378694", "0.4533841", "0.453321", "0.4532339", "0.4531574", "0.45293236", "0.45280984", "0.45233113", "0.45206", "0.45170003", "0.4515936", "0.45103848", "0.45060083", "0.45056224", "0.45035017", "0.4500329", "0.4498713", "0.44972438", "0.4495917", "0.44942775", "0.44912595", "0.44861737", "0.4484806", "0.44746363", "0.44736648", "0.44723848", "0.44615176", "0.44586745", "0.44575873", "0.44570768", "0.44486636", "0.4444806", "0.4444017", "0.44436622", "0.44405502", "0.44367123", "0.4436422", "0.4435085", "0.4433844", "0.44336376", "0.4430732", "0.44247088", "0.44236565", "0.442252" ]
0.0
-1
Need to change days counter to hr,min,ss
render() { return !this.props.showPollStatsLoader && !this.props.showWrongAddressModal ? ( <Grid> <div className="pollstats-grid"> <Row> <Col xs={12} sm={12} md={12} lg={12}> <div className="poll-started-text">Poll started at</div> </Col> </Row> <Row> <Col xs={12} sm={6} md={8} lg={8}> <div className="voter-logic">{this.props.voterBaseLogic}</div> </Col> <Col xs={12} sm={6} md={4} lg={4}> <div className="poll-start-time">{new Date(parseInt(this.props.startTime) * 1000).toDateString()}</div> </Col> </Row> <Row> <Col lg={6}> <Popup hoverable on={["hover", "click"]} style={style} trigger={ <div onClick={this.handleAllActivities} className="poll-name"> {this.props.pollName} </div> } content={<h1 className="large">View Activiy Log</h1>} position="top center" /> </Col> <Col lg={6} /> </Row> <Row className="poll-type-end"> <Col xs={12} sm={6} md={6} lg={6}> <div className="poll-type">{this.props.pollType}</div> </Col> <Col xs={12} sm={6} md={6} lg={6}> <div className="poll-end"> {new Date().getTime() > new Date(parseInt(this.props.endTime) * 1000).getTime() ? ( <div>Ended on {new Date(parseInt(this.props.endTime) * 1000).toDateString()}</div> ) : ( <div className="poll-ends-in"> Poll ends in: {Math.ceil((new Date(parseInt(this.props.endTime) * 1000).getTime() - new Date().getTime()) / (1000 * 3600 * 24))}{" "} days </div> )} </div> </Col> </Row> <div className="proposals">{this.populateProposals()}</div> <Row> <Col lg={9} /> <Col lg={3}> <div> <Popup hoverable on={["hover", "click"]} style={style} position="top center" trigger={ <div onClick={this.handleAllDetailedVoters} className="total-voters"> Total Voters: {this.props.totalVoteCast} </div> } content={<h1 className="large">View All Voters</h1>} /> </div> </Col> </Row> {this.props.proposals.length > 1 ? ( <div> <Row> <Col xs={12} sm={12} md={12} lg={12}> <div className="poll-leader-text">Poll Leader</div> </Col> </Row> <Row> <Col xs={12} sm={12} md={12} lg={12}> <div className="poll-leader-vote-share"> <div className="poll-leader-name">{this.props.pollLeader.name}</div> <div className="vote-share">({this.props.pollLeader.percent}% Vote Share)</div> </div> </Col> </Row> </div> ) : ( <div> <Row> <Col xs={12} sm={12} md={12} lg={12}> <div className="poll-leader-text">Status</div> </Col> </Row> <Row> <Col xs={12} sm={12} md={12} lg={12}> <div className="poll-leader-vote-share"> <div className="poll-leader-name"> Consensus in favour of {this.props.pollLeader.name} is {this.props.pollLeader.percent}% </div> </div> </Col> </Row> </div> )} </div> </Grid> ) : ( <Loader active={this.props.showPollStatsLoader} /> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setCounter() {\n\n\t\tvar h = 0, m = 0, s = 0, d = 0, day = 0, ct = (new Date().getTime()/1000)|0;\n\n\t\tif (ut > ct) d = ut - ct;\n\t\telse d = ct - ut;\n\t\t\n\t\tday = Math.floor(d / 86400);\n\t\td -= day * 86400;\n\t\th = Math.floor(d / 3600);\n\t\td -= h * 3600;\n\t\tm = Math.floor(d / 60);\n\t\td -= m * 60;\n\t\ts = d;\n\n\t\tif(h<10)h='0'+h;\n\t\tif(m<10)m='0'+m;\n\t\tif(s<10)s='0'+s;\n\n\t\t// 8d14h45m26s\n\t\t// var str = (day==0?'':day+'.')+(h==\"00\"?\"\":h+\":\")+m+\":\"+s;\n\t\tvar str = (day==0?'':day+'<span>d</span>')+(h==\"00\"?\"\":h+\"<span>h</span>\")+m+\"<span>m</span>\"+s+\"<span>s</span>\";\n\n\t\t$(\"#rtime\").html(str);\t\t\n\t}", "function fn() {\r\n let hours = Number.parseInt(counter / 3600);//\"Number.parseInt\" string ko no. mai convert kardega\r\n let RemSeconds = counter % 3600;\r\n let mins = Number.parseInt(RemSeconds / 60);\r\n let seconds = RemSeconds % 60;\r\n hours = hours < 10 ? `0${hours}` : hours;\r\n mins = mins < 10 ? `0${mins}` : mins;\r\n seconds = seconds < 10 ? `0${seconds}` : seconds;\r\n\r\n timings.innerText = `${hours}:${mins}:${seconds}`;\r\n counter++;\r\n }", "function xsCountDown() {\r\n var endTIme = new Date('2018-8-17');\r\n var nowTime = new Date();\r\n\r\n var timeLeft = endTIme - nowTime;\r\n var days = Math.floor(timeLeft / 1000 / 60 / 60 / 24);\r\n var hours = Math.floor((timeLeft / 1000 / 60 / 60) - (days * 24));\r\n var minuts = Math.floor((timeLeft / 1000 / 60) - (days * 24 * 60) - (hours * 60));\r\n var second = Math.floor((timeLeft / 1000) - (days * 24 * 60 * 60) - (hours * 60 * 60) - (minuts * 60));\r\n\r\n if (hours < \"10\") { hours = \"0\" + hours }\r\n if (minuts < \"10\") { minuts = \"0\" + minuts }\r\n if (second < \"10\") { second = \"0\" + second }\r\n\r\n $(\"#xs_days\").html(days);\r\n $(\"#xs_hours\").html(hours);\r\n $(\"#xs_minuts\").html(minuts);\r\n $(\"#xs_second\").html(second);\r\n }", "function timerCycle() {\n\n /*HERE CONVERT THE VALUE OF TIMER TO integar FOR CONDITION PUT ZERO BEFOR TIMER(hr,mint,sec) WORK */\n milsec = parseInt(milsec);\n sec = parseInt(sec);\n mint = parseInt(mint);\n hr = parseInt(hr);\n\n\n milsec += 1;\n if (milsec < 10) {\n milsec = '0' + '0' + milsec;\n } else\n if (milsec < 100)\n\n milsec = '0' + milsec;\n\n\n if (milsec == 999) {\n milsec = 0;\n sec += 1;\n }\n\n\n if (sec < 10) {\n sec = '0' + sec;\n }\n\n if (sec === 60) {\n mint += 1\n sec = 0;\n }\n if (mint < 10) {\n mint = '0' + mint;\n }\n\n if (mint === 60) {\n hr += 1;\n mint = 0;\n sec = 0;\n }\n if (hr < 10) {\n hr = '0' + hr;\n }\n\n Timer.innerHTML = hr + ':' + mint + ':' + sec + '.' + milsec;\n\n\n}", "function timer() {\n seconds++\n\n if (seconds == 60) {\n seconds = 0;\n minute++\n }\n\n if (minute == 60) {\n minute = 00;\n hour++\n }\n\n var format = count(hour) + ':' + count(minute) + ':' + count(seconds);\n document.getElementById(\"counter\").innerText = format;\n}", "function timer() {\n sec += 1;\n if (sec === 60) {\n min += 1;\n sec = 0;\n }\n\n for (let i = 0; i < timeEl.length; i++) {\n timeEl[i].innerText = min.pad(2) + \":\" + sec.pad(2);\n }\n }", "function compute_display() {\n var s = seconds % 60;\n var m = Math.floor(seconds / 60) % 60;\n var h = Math.floor(seconds / 3600);\n ss.html((s < 10 ? '0' : '') + s);\n mm.html((m < 10 ? '0' : '') + m);\n hh.html((h < 10 ? '0' : '') + h);\n }", "function start_counting(){\r\n\tvar counter = hours + \":\" + minutes + \":\" + seconds;\r\n\tseconds += 1;\r\n\tif (seconds == 60) {\r\n\t\tminutes += 1;\r\n\t\tseconds = 0;\r\n\t\tif (minutes == 60){\r\n\t\t\thours += 1;\r\n\t\t\tminutes = 0;\r\n\t\t}\r\n\t}\r\n\tdocument.getElementById(\"counter\").innerHTML = counter;\r\n}", "function countT() {\n ++Seconds;\n var hour = Math.floor(Seconds /3600);\n var minute = Math.floor((Seconds - hour*3600)/60);\n var xseconds = Seconds - (hour*3600 + minute*60);\n document.getElementById(\"time\").innerHTML = hour + \":\" + minute + \":\" + xseconds;\n}", "function formatCounter(timeSeconds) {\n \tvar timeString;\n \tif (timeSeconds < 60) {\n \t\ttimeString = Math.floor(timeSeconds) + \"s\";\n \t} else if (timeSeconds < 3600) {\n \t\ttimeString = Math.floor(timeSeconds / 60) + \"m \" + Math.floor(timeSeconds % 60) + \"s\";\n \t} else {\n \t\ttimeString = Math.floor(timeSeconds / 3600) + \"h \" + Math.floor((timeSeconds % 3600) / 60) + \"m \" + Math.floor(timeSeconds % 60) + \"s\";\n \t}\n\n \treturn timeString;\n}", "function start_counting(){\n\tvar counter = hours + \":\" + minutes + \":\" + seconds;\n\tseconds += 1;\n\tif (seconds == 60) {\n\t\tminutes += 1;\n\t\tseconds = 0;\n\t\tif (minutes == 60){\n\t\t\thours += 1;\n\t\t\tminutes = 0;\n\t\t}\n\t}\n\tdocument.getElementById(\"counter\").innerHTML = counter;\n}", "function updateTime(){\n timer.count += 1000\n $('#timer').text(new Date(timer.count).toLocaleTimeString(undefined, {\n minute: '2-digit',\n second: '2-digit'\n }))\n}", "function timer()\n {\n count = count - 1;\n if (count<10) {\n $(\"#dd-sec\").html('0'+count);\n } else {\n $(\"#dd-sec\").html(count);\n }\n if (count == 0) {\n minutes = minutes - 1;\n if (minutes < 10 && minutes >= 0) {\n $(\"#dd-min\").html('0'+minutes);\n }\n if (minutes > 10) {\n $(\"#dd-min\").html(minutes);\n }\n if (minutes < 0) {\n hours = hours - 1;\n if (hours < 10 && hours >=0) {\n $(\"#dd-hours\").html('0'+hours);\n }\n if (hours>10) {\n $(\"#dd-hours\").html('0'+hours);\n }\n if (hours < 0 ) {\n\n end = 1;\n clearTimeout(counter);\n }\n if (end) { minutes = '00';}\n else {\n minutes = 59;\n }\n $(\"#dd-min\").html(minutes);\n }\n if (end) { count = '00';}\n else {\n count = 59;\n }\n \n $(\"#dd-sec\").html(count);\n }\n }", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function secondCount () {\n var dateTime = moment().format('dddd, MMMM Do YYYY, h:mm:ss a');\n $('#currentDay').text(dateTime);\n }", "function time()\n{\n var dayS = document.getElementById(\"days\").innerHTML ; \n var hourS = document.getElementById(\"hours\").innerHTML ; \n var minS = document.getElementById(\"mins\").innerHTML ; \n var secS= document.getElementById(\"secs\").innerHTML ; \n var day = parseInt(days);\n var hour = parseInt(hourS);\n var min = parseInt(minS);\n var sec = parseInt(secS);\n if(sec == 0)\n {\n document.getElementById(\"secs\").innerHTML = 59 ;\n if(min == 0)\n {\n document.getElementById(\"mins\").innerHTML = 59 ; \n \n if(hour == 0)\n {\n document.getElementById(\"hours\").innerHTML = 23 ; \n day = day - 1 ; \n document.getElementById(\"days\").innerHTML = day ;\n }\n else{\n hour = hour - 1 ; \n document.getElementById(\"hours\").innerHTML = hour ;\n\n }\n \n \n \n }\n else{\n min = min - 1 ; \n document.getElementById(\"mins\").innerHTML = min ;\n\n }\n \n \n \n }\n \n else{\n sec = sec - 1 ; \n document.getElementById(\"secs\").innerHTML = sec ;\n \n }\n \n \n \n \n \n \n}", "function tCycle(){\r\n if(intvl == false){\r\n sec = parseInt(sec);\r\n min = parseInt(min);\r\n hr = parseInt(hr);\r\n\r\n sec++;\r\n if(sec == 60){ \r\n min++;\r\n sec = 0;\r\n }\r\n\r\n if(min == 60){\r\n hr++;\r\n sec = 0;\r\n min = 0;\r\n }\r\n\r\n if(sec < 10 || sec == 0){\r\n sec = '0' + sec;\r\n }\r\n\r\n if(min < 10 || min == 0){\r\n min = '0' + min;\r\n }\r\n\r\n if(hr < 10 || hr == 0){\r\n hr = '0' + hr;\r\n }\r\n\r\n time.innerHTML = hr + 'h:' + min + 'm:' + sec + 's';\r\n\r\n setTimeout(tCycle, 1000)\r\n\r\n } \r\n}", "function t(e,t,i){var n={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},s=\" \";return(e%100>=20||e>=100&&e%100===0)&&(s=\" de \"),e+s+n[i]}", "function buildTime() {\n\t++sec;\n\tminTotal = pad(parseInt(sec / 60));\n\tsecTotal = pad(sec % 60);\n\ttextTime = minTotal + \":\" + secTotal;\n\ttimerCount.innerHTML = textTime;\n}", "function convertTime(timeCounter){\n\thr = Math.floor(timeCounter/60/60);\n\tmin = Math.floor((timeCounter/60)%60);\n\tsec = timeCounter % 60;\n}", "function t(e,t,n){var a={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+a[n]}", "function t(e,t,n){var a={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+a[n]}", "function t(e,t,n){var a={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+a[n]}", "function t(e,t,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},r=\" \";if(e%100>=20||e>=100&&e%100===0){r=\" de \"}return e+r+i[n]}", "function t(e,t,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+i[n]}", "function t(e,t,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+i[n]}", "function t(e,t,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+i[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+r[n]}", "function updateClock(){\n var t = getTimeRemaining(endtime); // calculate endtime date - current date and return a date object with days, hours, minutes, and seconds\n \n daysSpan.innerHTML = t.days; //display number of days\n hoursSpan.innerHTML = ('0' + t.hours).slice(-2); //use negative to slice from end of string. when number is 024, the 0 will be sliced, return 24. When number is 09, slice will return 09. \n minutesSpan.innerHTML = ('0' + t.minutes).slice(-2);\n secondsSpan.innerHTML = ('0' + t.seconds).slice(-2);\n \n if(t.total <=0){\n clearInterval(timeinterval);\n }\n }", "function countUpTimer(){\n let t = document.getElementById(\"timerText\");\n\n seconds = timeCounter % 60;\n if (seconds<10){\n seconds = \"0\" + seconds ;\n }\n minutes = parseInt(timeCounter / 60);\n if (minutes<10){\n minutes = \"0\" + minutes ;\n }\n\n t.textContent = minutes + \":\" + seconds ;\n timeCounter++;\n}", "function timer() {\n var time_now = new Date(),\n time_delta = day_z - time_now;\n if (time_delta < 0) {\n time_delta = 0;\n }\n var time_day = Math.floor(time_delta / 86400000),\n time_ost = time_delta - Math.floor(time_delta / 86400000) * 86400000,\n time_hrs = Math.floor(time_ost / 3600000);\n time_ost = time_ost - Math.floor(time_ost / 3600000) * 3600000;\n var time_min = Math.floor(time_ost / 60000);\n time_ost = time_ost - Math.floor(time_ost / 60000) * 60000;\n var time_sec = Math.floor(time_ost / 1000);\n if (time_day < 10) {\n time_day = '0' + time_day;\n }\n if (time_hrs < 10) {\n time_hrs = '0' + time_hrs;\n }\n if (time_min < 10) {\n time_min = '0' + time_min;\n }\n if (time_sec < 10) {\n time_sec = '0' + time_sec;\n }\n $('.seconds').text(time_sec);\n $('.hours').text(time_hrs);\n $('.mins').text(time_min);\n $('.days').text(time_day);\n if (time_delta == 0) {\n clearInterval(akcia_interval);\n }\n}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";if(e%100>=20||e>=100&&e%100===0){o=\" de \"}return e+o+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},a=\" \";return(e%100>=20||e>=100&&e%100===0)&&(a=\" de \"),e+a+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},a=\" \";return(e%100>=20||e>=100&&e%100===0)&&(a=\" de \"),e+a+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},a=\" \";return(e%100>=20||e>=100&&e%100===0)&&(a=\" de \"),e+a+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},a=\" \";return(e%100>=20||e>=100&&e%100===0)&&(a=\" de \"),e+a+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},a=\" \";return(e%100>=20||e>=100&&e%100===0)&&(a=\" de \"),e+a+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},a=\" \";if(e%100>=20||e>=100&&e%100===0){a=\" de \"}return e+a+r[n]}", "function countTimer() {\n ++totalSeconds;\n let minute = Math.floor(totalSeconds/60);\n let seconds = totalSeconds - (minute*60);\n let time = minute + \":\" + seconds;\n document.getElementById(\"timer\").innerHTML = time;\n }", "function setTime() {\n\t++secondsCounter; //incrementer\n\ttimerSeconds.innerHTML = pad(secondsCounter % 60);\n\ttimerMinutes.innerHTML = pad(parseInt(secondsCounter / 60));\n}", "function t(e,t,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},a=\" \";return(e%100>=20||e>=100&&e%100===0)&&(a=\" de \"),e+a+i[n]}", "function countUp() {\n timeCounter = setInterval(function() {\n second++;\n if (second == 59) {\n second = 00;\n min++;\n }\n if (second > 9) {\n zeroPlaceholder = '';\n } else if (second < 9) {\n zeroPlaceholder = 0;\n }\n timer.innerText = `Your time is: ${min}:${zeroPlaceholder}${second}`;\n }, 1000);\n}", "function t(e,t,r){var n={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+n[r]}", "function stopwatch(){\r\n\r\n seconds++;\r\n\r\n if(seconds / 60 === 1){\r\n seconds = 0; \r\n minutes ++;\r\n\r\n if(minutes /60 ===1){\r\n minutes = 0;\r\n hours++;\r\n }\r\n }\r\n\r\n //adding 0 before one digit charachters\r\n if (seconds <10) {\r\n displaySeconds = \"0\" + seconds.toString();\r\n }\r\n else{\r\n displaySeconds = seconds;\r\n }\r\n\r\n if(minutes <10) {\r\n displayMinutes = \"0\" + minutes.toString();\r\n }\r\n else{\r\n displayMinutes = minutes;\r\n }\r\n\r\n if(hours <10){\r\n displayHours = \"0\" +hours.toString();\r\n }\r\n else{\r\n displayHours = hours;\r\n }\r\n\r\n //display\r\n document.getElementById(\"display\").innerHTML = displayHours + \":\" + displayMinutes + \":\" + displaySeconds;\r\n}", "function increment() {\n\tdate.setSeconds(date.getSeconds() + 1);\n\tvar seconds = date.getSeconds();\n\tif (seconds < 10) {\n\t\tseconds = \"0\" + seconds;\t\n\t}\n\ttimeArea[0].innerHTML = date.getMinutes() + \":\" + seconds;\n}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function updateTimes() {\n $('.minutes').each(function (idx) {\n var t = $(this).text().split(':');\n var time = parseInt(t[0]) * 60 + parseInt(t[1]);\n //Is not measured, may fall slightly out of sync\n time += 1;\n var min = ~~(time / 60);\n var sec = (time % 60);\n var secondsString = ('00' + sec).slice(-2);\n $(this).text(`${min}:${secondsString}`);\n });\n}", "function update_counter() {\n let time = remaining_time(); //get the time object\n\n //adds zero in front of the time measure unit if it displays less than 2 symbols\n function add_zero(measure_unit) {\n let unit; //variable needed to store different data from the time object depending on function argument\n\n if (measure_unit == hours){\n unit = time.hours; //stores the hours\n } else if (measure_unit == minutes) {\n unit = time.minutes; //stores the minutes\n } else if (measure_unit == seconds) {\n unit = time.seconds; //stores the seconds\n }\n\n //function returns additional zero symbol if 'unit' variable value are less than 10\n return (unit < 10) ? measure_unit.innerText = '0' + unit : measure_unit.innerText = unit;\n }\n\n //if delta time is over stops update function and display zero to every time measure unit\n if (time.total < 0) {\n clearInterval(update_time);\n time.hours = time.minutes = time.seconds = 0;\n }\n\n //adding zero to every displayed measure unit\n add_zero(hours);\n add_zero(minutes);\n add_zero(seconds);\n }", "function counter(finish_date, hours_container, minutes_container, seconds_container) {\n let end_date = finish_date; //define the end date\n\n //tis function returns the time object contains delta time, hours, minutes, seconds\n function remaining_time() {\n let delta_time = Date.parse(end_date) - Date.parse(new Date()), //get quantity of the milliseconds from now to the end date\n seconds = Math.floor((delta_time/1000) % 60), //get seconds\n minutes = Math.floor((delta_time/1000/60) % 60), //get minutes\n hours = Math.floor((delta_time/1000/60/60)); //get hours\n\n //the time object\n return {\n 'total': delta_time,\n 'hours': hours,\n 'minutes': minutes,\n 'seconds': seconds\n }\n }\n\n //setting up the countdown_timer function\n function set_counter() {\n let hours = document.querySelector(hours_container), //define the hours element\n minutes = document.querySelector(minutes_container), //define the minutes element\n seconds = document.querySelector(seconds_container), //define the seconds element\n update_time = setInterval(update_counter, 1000); //set countdown_timer update time equal 1s\n\n //update countdown_timer function\n function update_counter() {\n let time = remaining_time(); //get the time object\n\n //adds zero in front of the time measure unit if it displays less than 2 symbols\n function add_zero(measure_unit) {\n let unit; //variable needed to store different data from the time object depending on function argument\n\n if (measure_unit == hours){\n unit = time.hours; //stores the hours\n } else if (measure_unit == minutes) {\n unit = time.minutes; //stores the minutes\n } else if (measure_unit == seconds) {\n unit = time.seconds; //stores the seconds\n }\n\n //function returns additional zero symbol if 'unit' variable value are less than 10\n return (unit < 10) ? measure_unit.innerText = '0' + unit : measure_unit.innerText = unit;\n }\n\n //if delta time is over stops update function and display zero to every time measure unit\n if (time.total < 0) {\n clearInterval(update_time);\n time.hours = time.minutes = time.seconds = 0;\n }\n\n //adding zero to every displayed measure unit\n add_zero(hours);\n add_zero(minutes);\n add_zero(seconds);\n }\n }\n\n //initialize countdown_timer set up\n set_counter();\n }", "function e(t,e,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},i=\" \";return(t%100>=20||t>=100&&t%100===0)&&(i=\" de \"),t+i+r[n]}", "function e(t,e,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},i=\" \";return(t%100>=20||t>=100&&t%100===0)&&(i=\" de \"),t+i+r[n]}", "function e(t,e,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},i=\" \";return(t%100>=20||t>=100&&t%100===0)&&(i=\" de \"),t+i+r[n]}", "function e(t,e,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},i=\" \";return(t%100>=20||t>=100&&t%100===0)&&(i=\" de \"),t+i+r[n]}", "function r(i,l,c){var f={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"s\\u0103pt\\u0103m\\xE2ni\",MM:\"luni\",yy:\"ani\"},p=\" \";return(i%100>=20||i>=100&&i%100==0)&&(p=\" de \"),i+p+f[c]}", "function wrapper(){\nconst date = new Date();\nlet hour = date.getHours();\nconst min = date.getMinutes();\ntoday.textContent = date.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit'\n \n});\nconsole.log(hour);\n\nsetInterval(wrapper, 1000)\n}", "function day() {\r\n if (days.value == 0) {\r\n clearInterval(intervalHandle1);\r\n return display1.innerHTML = \"00\";\r\n }\r\n if (hours.value < 1) {\r\n days.value -= 1;\r\n hours.value = 23;\r\n }\r\n if (days.value < 10) {\r\n return display1.innerHTML = `0${days.value}`;\r\n }\r\n return display1.innerHTML = `${days.value}`;\r\n}", "function t(e,t,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},s=\" \";return(e%100>=20||e>=100&&e%100===0)&&(s=\" de \"),e+s+i[n]}", "function time_report(s){ // turn seconds into a Xm Xs string; if >1 hr, return Xh Xm string\n if(s>3600) {\n var hours=Math.floor(s/3600);\n return hours.toFixed(0)+\"h \"+Math.floor((s-(hours*3600))/60).toFixed(0)+\"m\";\n }\n return Math.floor((s/60)).toFixed(0)+\"m \"+(s%60).toFixed(0)+\"s\"\n}", "function increment(){\n //converts seconds, etc. if necessary\n millis --;\n if(millis == 0 && sec == 0 && min == 0 && hr == 0 && day == 0){\n clearInterval(intervalID);\n alert(\"YOUR TIMER IS FINISHED\");\n }else if(millis < 0){\n millis = 99\n sec --;\n }else if(sec < 0){\n sec = 59;\n min --;\n }else if(min < 0){\n min = 59;\n hr --;\n }else if(hr < 0){\n hr = 23;\n day --;\n }else{\n document.getElementById(\"days\").innerHTML = day;\n document.getElementById(\"hours\").innerHTML = hr;\n document.getElementById(\"minutes\").innerHTML = min;\n document.getElementById(\"seconds\").innerHTML = sec;\n }\n}", "function countDownClock()\n {\n let today = new Date();\n let timeOut = new Date(`January 01, ${toYear} 00:00:00`);\n \n let currentTime = today.getTime();\n let time = timeOut.getTime();\n \n let remTime = time - currentTime;\n \n let sec = Math.floor(remTime/1000);\n let min = Math.floor(sec/60);\n let hrs = Math.floor(min/60);\n let days = Math.floor(hrs/24);\n \n hrs%=24;\n min%=60;\n sec%=60;\n \n days = (days > 0) ? \"\"+days : \"0\";//one linear record of the conditional instruction\n \n if (hrs < 10) \n {\n hrs = \"0\"+hrs ;\n } \n \n else if (hrs > 0)\n {\n hrs = \"\"+hrs;\n }\n else\n {\n hrs = \"00\"\n }\n \n if (min < 10) \n {\n min = \"0\"+min;\n }\n \n else if (min > 0)\n {\n min = \"\"+min;\n }\n else \n {\n min = \"00\";\n }\n \n if (sec < 10)\n {\n sec = \"0\"+sec ;\n } \n else if (sec > 0)\n {\n sec = \"\"+sec;\n }\n else\n {\n sec = \"00\";\n }\n \n document.getElementById('days').innerHTML=days;\n document.getElementById('hrs').innerHTML =hrs;\n document.getElementById('min').innerHTML =min;\n document.getElementById('sec').innerHTML =sec;\n \n let OutTime = setTimeout(countDownClock, 1000);\n\n if (days === 0 && hrs === \"00\" && min === \"00\" && sec === \"00\")\n {\n return clearTimeout(OutTime);\n }\n \n }", "function timer(c){\n\tfor (i = 0; i < $(c).length; i++){\n\t\tif ($(c)[i].innerHTML.split(\" \")[1]==\"PM\") {\n\t\t\t$(c)[i].innerHTML = parseInt($(c)[i].innerHTML.split(\" \")[0].split(\":\")[0])+12 + \":\" + $(c)[i].innerHTML.split(\" \")[0].split(\":\")[1];\n\t\t}\n\t\telse {\n\t\t\t$(c)[i].innerHTML = $(c)[i].innerHTML.split(\" \")[0]\n\t\t}\n\t\t};\n}", "function timeStart() {\r\n secSaved = ++centiSec;\r\n sec = secSaved / 60;\r\n secHtml.innerText = parseInt(sec);\r\n secSaved = secSaved % 60;\r\n centiSecHtml.innerText = secSaved;\r\n}", "function countdownRemain(seconds) {\n const minutes = Math.floor(seconds / 60);\n const hours = Math.floor(minutes / 60);\n const days = Math.floor(hours / 24);\n const remainingSeconds = Math.floor(seconds % 60);\n const remainingMinutes = Math.floor(minutes % 60);\n const remaininghours = Math.floor(hours % 24);\n\n const remainDisplay = `${hours < 10 ? '0' : ''}${hours} : ${remainingMinutes < 10 ? '0' : ''}${remainingMinutes} : ${remainingSeconds < 10 ? '0' : ''}${remainingSeconds}`;\n document.title = remainDisplay;\n displayCountdownRemain.innerHTML = '<div id=\"days\"><h2>' + `${days < 10 ? '0' : ''}${days} ` + '</h2><span>Days</span> </div><div><h2>' + `${remaininghours < 10 ? '0' : ''}${remaininghours} ` + '</h2><span>Hours</span> </div><div><h2>' + `${remainingMinutes < 10 ? '0' : ''}${remainingMinutes}` + '</h2><span>Minutes</span></div><div><h2>' + `${remainingSeconds < 10 ? '0' : ''}${remainingSeconds}` + '</h2><span>Second</span></div>';\n\n\n if (hours < 24) {\n var daysss = document.getElementById('days');\n daysss.style.display = \"none\";\n fill.style.width = \"100%\"; // i don't know how\n }\n\n}", "function ConvertSecondsComments(seconds, mode, x){\n\n\t//converting seconds into a number\n\tseconds = parseFloat(seconds);\n\n\tvar result = \"\";\n\n\t//getting days\n\tvar days = parseInt(seconds / 86400);\n\n\t//getting hours\n\tvar hours = parseInt((seconds - (86400 * days)) / 3600);\n\tif(hours <= 9){\n\t\thours = '0'+hours;\n\t}\n\n\tvar middle = (86400 * days) + (3600 * hours);\n\n\t//getting minutes\n\tvar minutes = parseInt( (seconds - middle ) / 60);\n\tif(minutes <= 9){\n\t\tminutes = '0'+minutes;\n\t}\n\n\t//constructing the return text\n\tresult = \"<span class='localize' translate-key='38'>Day </span> \"+days+\" , \" + hours+\":\"+minutes;\n\n\treturn result;\n\n}", "function refresh_time(duration) {\n var mm = Math.floor(Math.floor(duration) / 60) + \"\";\n var ss = Math.ceil(Math.floor(duration) % 60) + \"\";\n\n if (mm.length < 2) { mm = \"0\" + mm; }\n if (ss.length < 2) { ss = \"0\" + ss; }\n container.html(mm + \":\" + ss);\n\n }", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100==0)&&(o=\" de \"),e+o+r[n]}", "function t(e,t,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+i[n]}", "function t(e,t,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+i[n]}", "function t(e,t,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+i[n]}", "function t(e,t,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+i[n]}", "function t(e,t,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+i[n]}", "function t(e,t,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+i[n]}", "function t(e,t,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+i[n]}", "function Pd(i,ee,te){var se=\" \";return(i%100>=20||i>=100&&i%100==0)&&(se=\" de \"),i+se+{mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[te]}", "function timeCounting(){\n\t\ttimer = setInterval(function(){\n\t\t\tsec +=1;\n\t\t\tif(sec <60){\n\t\t\t\t$(\".seconds\").text(sec + \"s\");\n\t\t\t} else if(sec ===60){\n\t\t\t\tmin += 1;\n\t\t\t\tsec = 0;\n\t\t\t\t$(\".minutes\").css('visibility', 'visible');\n\t $(\".colon-two\").css('visibility', 'visible');\n\t $(\".seconds\").text(sec + \"s\");\n\t $(\".minutes\").text(min + \"m\");\n\t sec += 1;\n\t\t\t}\t\n\t\t\t// console.log(sec);\n\t\t},1000)\n\t\t\t\n\t}", "function e(t,e,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},a=\" \";if(t%100>=20||t>=100&&t%100===0){a=\" de \"}return t+a+r[n]}", "function t(e,t,n){var a={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+a[n]}", "function t(e,t,n){var a={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+a[n]}" ]
[ "0.74514526", "0.7045619", "0.69533354", "0.668919", "0.66706455", "0.6627813", "0.65582544", "0.6508881", "0.6508864", "0.6498927", "0.64893025", "0.64841175", "0.64326555", "0.63925225", "0.63925225", "0.63925225", "0.63925225", "0.6379587", "0.636687", "0.6353825", "0.6353743", "0.63455486", "0.63105565", "0.62969005", "0.62969005", "0.62959003", "0.62956655", "0.6293319", "0.6293319", "0.6293319", "0.62834877", "0.62834877", "0.62732726", "0.6272635", "0.62705564", "0.62679255", "0.62644833", "0.62644833", "0.62644833", "0.62644833", "0.62644833", "0.626231", "0.6259842", "0.6256565", "0.6254689", "0.625238", "0.62480086", "0.6247341", "0.62385035", "0.6230536", "0.6230536", "0.6230536", "0.6230536", "0.6230536", "0.6230536", "0.6230536", "0.6230536", "0.6230536", "0.6230536", "0.6230536", "0.6230536", "0.6230536", "0.6230536", "0.6230536", "0.6230536", "0.6230536", "0.6230536", "0.6230536", "0.6230536", "0.62180746", "0.62135", "0.6212504", "0.62053746", "0.62053746", "0.62053746", "0.62053746", "0.6195116", "0.61917824", "0.61884874", "0.6176614", "0.6174605", "0.6170254", "0.6169788", "0.61672753", "0.61597556", "0.6158463", "0.61572915", "0.6155489", "0.61529064", "0.614956", "0.614956", "0.614956", "0.614956", "0.614956", "0.614956", "0.61484265", "0.61481345", "0.6145395", "0.6144284", "0.61433476", "0.61433476" ]
0.0
-1
In practice, most of the dynamically generated GLSL code is generated in an arbitrary order, so check only that they have the same set of lines.
function expectEqualUnordered(array1, array2) { // slice in case other tests do expect lines in a particular order. expect(array1.slice().sort()).toEqual(array2.slice().sort()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "is_shader_generated() { return this.shader_generated }", "validate() {\n if (gl.getParameter(gl.CURRENT_PROGRAM) != this.shader_loc) {\n console.log(this.constructor.name +\n '.validate(): shader program at this.shader_loc not in use! ' + this.index);\n return false;\n }\n if (gl.getParameter(gl.ARRAY_BUFFER_BINDING) != this.vbo_loc) {\n console.log(this.constructor.name +\n '.validate(): vbo at this.vbo_loc not in use! ' + this.index);\n return false;\n }\n return true;\n }", "vertex_glsl_code () {}", "function checkFragmentShader(shaderCode, lint = false) {\n if (!gl) {\n return;\n }\n let shader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(shader, shaderCode);\n gl.compileShader(shader);\n let infoLog = gl.getShaderInfoLog(shader);\n let result = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n let ret = [];\n if (!result) {\n console.log(infoLog);\n var errors = infoLog.split(/\\r|\\n/);\n for (let error of errors){\n var splitResult = error.split(\":\")\n ret.push( {\n message: splitResult[3] + splitResult[4],\n character: splitResult[1],\n line: splitResult[2]\n })\n }\n }\n \n if (result) {\n console.log(\"did update\");\n _fragmentShader = shaderCode;\n isDirty = true;\n }\n\n return ret;\n}", "async function processMainShaderCode() {\n // somehow, this makes it work?\n await sleep(1);\n let funclist = funcs;\n let textlist = [];\n\n // parse each equation, then add the necessary uniforms to `variables`\n hideVariables();\n for (let i in funclist) {\n let e = funclist[i];\n if (e.value === undefined) {continue;}\n let eq = latex2GLSL(e.value);\n console.log(\"Parsed equation: \" + eq);\n let vars = eq.matchAll(/u_(([a-zA-Z]|\\\\[a-zA-Z]+)(_([a-zA-Z0-9]+))?)\\b/g);\n for (let v of vars) {\n let name = v[0].replace(/\\\\/g, \"\");// just the entire match2\n let latexname = v[0].slice(2).replace(new RegExp(`(${v[4]})`), \"{$1}\");// change back to latex\n if (!(name == \"u_phi_0\")) // to allow it to be a constant\n addVariable(name, latexname);\n }\n textlist.push(eq);\n }\n // add in variables as uniforms\n let sourcecode = format(data.loadedShaderCode, {variables: getVariables()});\n\n // custom preprocessor to handle the changes for each function\n while (sourcecode.indexOf(\"FOREACH\") >= 0) {\n let index = sourcecode.indexOf(\"FOREACH\");\n let start = index + \"FOREACH\".length;\n while (sourcecode[start] != \"{\") {\n start++;\n }\n let level = 1;\n let end = start;\n while (level > 0) {\n end++;\n if (sourcecode[end] == \"{\") {\n level++;\n }\n if (sourcecode[end] == \"}\") {\n level--;\n }\n }\n let inner = sourcecode.substr(start + 1, end - start - 2);\n\n // loop through each equation, substituting in the necessary variables\n let replace = \"\";\n for (let i in textlist) {\n let eq = textlist[i];\n // default to not solid\n let ineq = \"false\";\n\n if (eq.match(/(<|>|<=|>=)/)) {\n var tempList = eq.split(/(<=|>=)/);\n if (tempList.length == 1){\n tempList = eq.split(/(<|>)/);\n }\n if (tempList.length > 3) {\n return \"error\";\n }\n ineq = `${eq}`;\n eq = `(${tempList[0]}) - (${tempList[2]})`;\n }\n replace += format(inner, {i:i,eq:eq,ineq:ineq,MAX_I:textlist.length});\n }\n sourcecode = sourcecode.slice(0, index) + replace + sourcecode.slice(end + 1);\n }\n mainShader.code = sourcecode;\n data.didChange = true;\n }", "_drawLines(lines) {\n const webgl = this.webgl;\n lines.forEach((line) => {\n if (line.visible) {\n webgl.useProgram(this._progLine);\n const uscale = webgl.getUniformLocation(this._progLine, \"uscale\");\n webgl.uniformMatrix2fv(uscale, false, new Float32Array([\n line.scaleX * this.gScaleX * (this.gLog10X ? 1 / Math.log(10) : 1),\n 0,\n 0,\n line.scaleY * this.gScaleY * this.gXYratio * (this.gLog10Y ? 1 / Math.log(10) : 1),\n ]));\n const uoffset = webgl.getUniformLocation(this._progLine, \"uoffset\");\n webgl.uniform2fv(uoffset, new Float32Array([line.offsetX + this.gOffsetX, line.offsetY + this.gOffsetY]));\n const isLog = webgl.getUniformLocation(this._progLine, \"is_log\");\n webgl.uniform2iv(isLog, new Int32Array([this.gLog10X ? 1 : 0, this.gLog10Y ? 1 : 0]));\n const uColor = webgl.getUniformLocation(this._progLine, \"uColor\");\n webgl.uniform4fv(uColor, [line.color.r, line.color.g, line.color.b, line.color.a]);\n webgl.bufferData(webgl.ARRAY_BUFFER, line.xy, webgl.STREAM_DRAW);\n webgl.drawArrays(line.loop ? webgl.LINE_LOOP : webgl.LINE_STRIP, 0, line.webglNumPoints);\n }\n });\n }", "render() {\n const canvas = this.canvas;\n const dataset = this.currentDataset;\n\n canvas.width = dataset.width;\n canvas.height = dataset.height;\n\n let ids = null;\n if (this.expressionAst) {\n const idsSet = new Set([]);\n const getIds = (node) => {\n if (typeof node === 'string') {\n // ids should not contain unary operators\n idsSet.add(node.replace(new RegExp(/[+-]/, 'g'), ''));\n }\n if (typeof node.lhs === 'string') {\n idsSet.add(node.lhs.replace(new RegExp(/[+-]/, 'g'), ''));\n } else if (typeof node.lhs === 'object') {\n getIds(node.lhs);\n }\n if (typeof node.rhs === 'string') {\n idsSet.add(node.rhs.replace(new RegExp(/[+-]/, 'g'), ''));\n } else if (typeof node.rhs === 'object') {\n getIds(node.rhs);\n }\n };\n getIds(this.expressionAst);\n ids = Array.from(idsSet);\n }\n\n let program = null;\n\n if (this.gl) {\n const gl = this.gl;\n gl.viewport(0, 0, dataset.width, dataset.height);\n\n if (this.expressionAst) {\n const vertexShaderSourceExpressionTemplate = `\n attribute vec2 a_position;\n attribute vec2 a_texCoord;\n uniform mat3 u_matrix;\n uniform vec2 u_resolution;\n varying vec2 v_texCoord;\n void main() {\n // apply transformation matrix\n vec2 position = (u_matrix * vec3(a_position, 1)).xy;\n // convert the rectangle from pixels to 0.0 to 1.0\n vec2 zeroToOne = position / u_resolution;\n // convert from 0->1 to 0->2\n vec2 zeroToTwo = zeroToOne * 2.0;\n // convert from 0->2 to -1->+1 (clipspace)\n vec2 clipSpace = zeroToTwo - 1.0;\n gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);\n // pass the texCoord to the fragment shader\n // The GPU will interpolate this value between points.\n v_texCoord = a_texCoord;\n }`;\n const expressionReducer = (node) => {\n if (typeof node === 'object') {\n if (node.op === '**') {\n // math power operator substitution\n return `pow(${expressionReducer(node.lhs)}, ${expressionReducer(node.rhs)})`;\n }\n if (node.fn) {\n return `(${node.fn}(${expressionReducer(node.lhs)}))`;\n }\n return `(${expressionReducer(node.lhs)} ${node.op} ${expressionReducer(node.rhs)})`;\n } else if (typeof node === 'string') {\n return `${node}_value`;\n }\n return `float(${node})`;\n };\n\n const compiledExpression = expressionReducer(this.expressionAst);\n\n // Definition of fragment shader\n const fragmentShaderSourceExpressionTemplate = `\n precision mediump float;\n // our texture\n uniform sampler2D u_textureScale;\n\n // add all required textures\n${ids.map(id => ` uniform sampler2D u_texture_${id};`).join('\\n')}\n\n uniform vec2 u_textureSize;\n uniform vec2 u_domain;\n uniform float u_noDataValue;\n uniform bool u_clampLow;\n uniform bool u_clampHigh;\n // the texCoords passed in from the vertex shader.\n varying vec2 v_texCoord;\n void main() {\n${ids.map(id => ` float ${id}_value = texture2D(u_texture_${id}, v_texCoord)[0];`).join('\\n')}\n float value = ${compiledExpression};\n\n if (value == u_noDataValue)\n gl_FragColor = vec4(0.0, 0, 0, 0.0);\n else if ((!u_clampLow && value < u_domain[0]) || (!u_clampHigh && value > u_domain[1]))\n gl_FragColor = vec4(0, 0, 0, 0);\n else {\n float normalisedValue = (value - u_domain[0]) / (u_domain[1] - u_domain[0]);\n gl_FragColor = texture2D(u_textureScale, vec2(normalisedValue, 0));\n }\n }`;\n program = createProgram(gl, vertexShaderSource, fragmentShaderSourceExpressionTemplate);\n gl.useProgram(program);\n\n gl.uniform1i(gl.getUniformLocation(program, 'u_textureScale'), 0);\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, this.textureScale);\n for (let i = 0; i < ids.length; ++i) {\n const location = i + 1;\n const id = ids[i];\n const ds = this.datasetCollection[id];\n if (!ds) {\n throw new Error(`No such dataset registered: '${id}'`);\n }\n gl.uniform1i(gl.getUniformLocation(program, `u_texture_${id}`), location);\n gl.activeTexture(gl[`TEXTURE${location}`]);\n gl.bindTexture(gl.TEXTURE_2D, ds.textureData);\n }\n } else {\n program = this.program;\n gl.useProgram(program);\n // set the images\n gl.uniform1i(gl.getUniformLocation(program, 'u_textureData'), 0);\n gl.uniform1i(gl.getUniformLocation(program, 'u_textureScale'), 1);\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, dataset.textureData);\n gl.activeTexture(gl.TEXTURE1);\n gl.bindTexture(gl.TEXTURE_2D, this.textureScale);\n }\n const positionLocation = gl.getAttribLocation(program, 'a_position');\n const domainLocation = gl.getUniformLocation(program, 'u_domain');\n const displayRangeLocation = gl.getUniformLocation(\n program, 'u_display_range'\n );\n const applyDisplayRangeLocation = gl.getUniformLocation(\n program, 'u_apply_display_range'\n );\n const resolutionLocation = gl.getUniformLocation(program, 'u_resolution');\n const noDataValueLocation = gl.getUniformLocation(program, 'u_noDataValue');\n const clampLowLocation = gl.getUniformLocation(program, 'u_clampLow');\n const clampHighLocation = gl.getUniformLocation(program, 'u_clampHigh');\n const matrixLocation = gl.getUniformLocation(program, 'u_matrix');\n\n gl.uniform2f(resolutionLocation, canvas.width, canvas.height);\n gl.uniform2fv(domainLocation, this.domain);\n gl.uniform2fv(displayRangeLocation, this.displayRange);\n gl.uniform1i(applyDisplayRangeLocation, this.applyDisplayRange);\n gl.uniform1i(clampLowLocation, this.clampLow);\n gl.uniform1i(clampHighLocation, this.clampHigh);\n gl.uniform1f(noDataValueLocation, this.noDataValue);\n gl.uniformMatrix3fv(matrixLocation, false, this.matrix);\n\n const positionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n gl.enableVertexAttribArray(positionLocation);\n gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);\n\n setRectangle(gl, 0, 0, canvas.width, canvas.height);\n\n // Draw the rectangle.\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n } else if (this.ctx) {\n const ctx = this.ctx;\n const w = canvas.width;\n const h = canvas.height;\n\n const imageData = ctx.createImageData(w, h);\n\n const trange = this.domain[1] - this.domain[0];\n const steps = this.colorScaleCanvas.width;\n const csImageData = this.colorScaleCanvas.getContext('2d').getImageData(0, 0, steps, 1).data;\n let alpha;\n\n const data = dataset.data;\n\n for (let y = 0; y < h; y++) {\n for (let x = 0; x < w; x++) {\n const i = (y * w) + x;\n // TODO: Possible increase of performance through use of worker threads?\n\n let c = Math.floor(((data[i] - this.domain[0]) / trange) * (steps - 1));\n alpha = 255;\n if (c < 0) {\n c = 0;\n if (!this.clampLow) {\n alpha = 0;\n }\n } else if (c > 255) {\n c = 255;\n if (!this.clampHigh) {\n alpha = 0;\n }\n }\n // NaN values should be the only values that are not equal to itself\n if (data[i] === this.noDataValue || data[i] !== data[i]) {\n alpha = 0;\n } else if (this.applyDisplayRange\n && (data[i] < this.displayRange[0] || data[i] >= this.displayRange[1])) {\n alpha = 0;\n }\n\n const index = ((y * w) + x) * 4;\n imageData.data[index + 0] = csImageData[c * 4];\n imageData.data[index + 1] = csImageData[(c * 4) + 1];\n imageData.data[index + 2] = csImageData[(c * 4) + 2];\n imageData.data[index + 3] = Math.min(alpha, csImageData[(c * 4) + 3]);\n }\n }\n\n ctx.putImageData(imageData, 0, 0); // at coords 0,0\n }\n }", "cacheGLUniformLocations() {\nvar ssuLoc, ssuaLoc;\n//----------------------\nssuLoc = (unm) => {\nreturn this.skinningShader.getUniformLocation(unm);\n};\nssuaLoc = function(uanm) {\nreturn ssuLoc(`${uanm}[0]`);\n};\nthis.uniformMVMat = ssuLoc(\"ModelViewMat\");\nthis.uniformMVPMat = ssuLoc(\"ModelViewProjMat\");\nif (this.DO_TRX_BONE_UNIFORMS) {\nif (!this.TEST_CPU_TRX_TO_MAT) {\nif (this.USE_TEXTURES) {\nthis.uniformSkelXformsWidth = ssuLoc(\"SkelXformsWidth\");\nthis.uniformSkelXformsHeight = ssuLoc(\"SkelXformsHeight\");\nthis.uniformSkelXforms = ssuLoc(\"SkelXforms\");\nif (this.DO_ARM_TWISTS) {\nthis.uniformBoneTwistWidth = ssuLoc(\"BoneTwistWidth\");\nthis.uniformBoneTwistHeight = ssuLoc(\"BoneTwistHeight\");\nthis.uniformBoneTwistData = ssuLoc(\"BoneTwistData\");\n}\n} else {\nthis.uniformSkelXforms = ssuaLoc(\"SkelXforms\");\nif (this.DO_ARM_TWISTS) {\nthis.uniformBoneTwistData = ssuaLoc(\"BoneTwistData\");\n}\n}\n} else {\nthis.uniformBones = ssuaLoc(\"Bones\");\n}\n} else {\nthis.uniformBones = ssuaLoc(\"Bones\");\n}\nthis.uniformMorphWeights = ssuLoc(\"MorphWeights\");\nreturn this.uniformTexture = ssuLoc(\"Texture\");\n}", "shared_glsl_code() // ********* SHARED CODE, INCLUDED IN BOTH SHADERS *********\r\n { return `precision mediump float;\r\n const int N_LIGHTS = 2; // We're limited to only so many inputs in hardware. Lights are costly (lots of sub-values).\r\n uniform float ambient, diffusivity, specularity, smoothness, animation_time, attenuation_factor[N_LIGHTS];\r\n uniform bool GOURAUD, COLOR_NORMALS, USE_TEXTURE; // Flags for alternate shading methods\r\n uniform vec4 lightPosition[N_LIGHTS], lightColor[N_LIGHTS], shapeColor;\r\n varying vec3 N, E; // Specifier \"varying\" means a variable's final value will be passed from the vertex shader \r\n varying vec2 f_tex_coord; // on to the next phase (fragment shader), then interpolated per-fragment, weighted by the \r\n varying vec4 VERTEX_COLOR; // pixel fragment's proximity to each of the 3 vertices (barycentric interpolation).\r\n varying vec3 L[N_LIGHTS], H[N_LIGHTS];\r\n varying float dist[N_LIGHTS];\r\n \r\n vec3 phong_model_lights( vec3 N )\r\n { vec3 result = vec3(0.0);\r\n for(int i = 0; i < N_LIGHTS; i++)\r\n {\r\n float attenuation_multiplier = 1.0 / (1.0 + attenuation_factor[i] * (dist[i] * dist[i]));\r\n float diffuse = max( dot(N, L[i]), 0.0 );\r\n float specular = pow( max( dot(N, H[i]), 0.0 ), smoothness );\r\n\r\n result += attenuation_multiplier * ( shapeColor.xyz * diffusivity * diffuse + lightColor[i].xyz * specularity * specular );\r\n }\r\n return result;\r\n }\r\n `;\r\n }", "function is_program_output(key)\n {\n return [\"color\", \"position\", \"point_size\",\n \"gl_FragColor\", \"gl_Position\", \"gl_PointSize\"].indexOf(key) != -1;\n }", "function glsl(hljs) {\n return {\n name: 'GLSL',\n keywords: {\n keyword:\n // Statements\n 'break continue discard do else for if return while switch case default ' +\n // Qualifiers\n 'attribute binding buffer ccw centroid centroid varying coherent column_major const cw ' +\n 'depth_any depth_greater depth_less depth_unchanged early_fragment_tests equal_spacing ' +\n 'flat fractional_even_spacing fractional_odd_spacing highp in index inout invariant ' +\n 'invocations isolines layout line_strip lines lines_adjacency local_size_x local_size_y ' +\n 'local_size_z location lowp max_vertices mediump noperspective offset origin_upper_left ' +\n 'out packed patch pixel_center_integer point_mode points precise precision quads r11f_g11f_b10f '+\n 'r16 r16_snorm r16f r16i r16ui r32f r32i r32ui r8 r8_snorm r8i r8ui readonly restrict ' +\n 'rg16 rg16_snorm rg16f rg16i rg16ui rg32f rg32i rg32ui rg8 rg8_snorm rg8i rg8ui rgb10_a2 ' +\n 'rgb10_a2ui rgba16 rgba16_snorm rgba16f rgba16i rgba16ui rgba32f rgba32i rgba32ui rgba8 ' +\n 'rgba8_snorm rgba8i rgba8ui row_major sample shared smooth std140 std430 stream triangle_strip ' +\n 'triangles triangles_adjacency uniform varying vertices volatile writeonly',\n type:\n 'atomic_uint bool bvec2 bvec3 bvec4 dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 ' +\n 'dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 double dvec2 dvec3 dvec4 float iimage1D iimage1DArray ' +\n 'iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer ' +\n 'iimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray ' +\n 'image2DRect image3D imageBuffer imageCube imageCubeArray int isampler1D isampler1DArray ' +\n 'isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D ' +\n 'isamplerBuffer isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 mat2 mat2x2 mat2x3 ' +\n 'mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 sampler1D sampler1DArray ' +\n 'sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray sampler2DArrayShadow ' +\n 'sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow sampler3D ' +\n 'samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow ' +\n 'image1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray uimage2DRect ' +\n 'uimage3D uimageBuffer uimageCube uimageCubeArray uint usampler1D usampler1DArray ' +\n 'usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D ' +\n 'samplerBuffer usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 vec2 vec3 vec4 void',\n built_in:\n // Constants\n 'gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize gl_MaxClipDistances gl_MaxClipPlanes ' +\n 'gl_MaxCombinedAtomicCounterBuffers gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms ' +\n 'gl_MaxCombinedImageUnitsAndFragmentOutputs gl_MaxCombinedTextureImageUnits gl_MaxComputeAtomicCounterBuffers ' +\n 'gl_MaxComputeAtomicCounters gl_MaxComputeImageUniforms gl_MaxComputeTextureImageUnits ' +\n 'gl_MaxComputeUniformComponents gl_MaxComputeWorkGroupCount gl_MaxComputeWorkGroupSize ' +\n 'gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers gl_MaxFragmentAtomicCounters ' +\n 'gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents gl_MaxFragmentInputVectors ' +\n 'gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers ' +\n 'gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents ' +\n 'gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits ' +\n 'gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents ' +\n 'gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset ' +\n 'gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms ' +\n 'gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits ' +\n 'gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents ' +\n 'gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters ' +\n 'gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents ' +\n 'gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents ' +\n 'gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits ' +\n 'gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors ' +\n 'gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs gl_MaxVertexImageUniforms ' +\n 'gl_MaxVertexOutputComponents gl_MaxVertexOutputVectors gl_MaxVertexTextureImageUnits ' +\n 'gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffset ' +\n // Variables\n 'gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial ' +\n 'gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color ' +\n 'gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord ' +\n 'gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor ' +\n 'gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial ' +\n 'gl_FrontSecondaryColor gl_GlobalInvocationID gl_InstanceID gl_InvocationID gl_Layer gl_LightModel ' +\n 'gl_LightSource gl_LocalInvocationID gl_LocalInvocationIndex gl_ModelViewMatrix ' +\n 'gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose ' +\n 'gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose ' +\n 'gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 ' +\n 'gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 ' +\n 'gl_Normal gl_NormalMatrix gl_NormalScale gl_NumSamples gl_NumWorkGroups gl_ObjectPlaneQ ' +\n 'gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn gl_Point gl_PointCoord ' +\n 'gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn gl_ProjectionMatrix gl_ProjectionMatrixInverse ' +\n 'gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask ' +\n 'gl_SampleMaskIn gl_SamplePosition gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter ' +\n 'gl_TexCoord gl_TextureEnvColor gl_TextureMatrix gl_TextureMatrixInverse gl_TextureMatrixInverseTranspose ' +\n 'gl_TextureMatrixTranspose gl_Vertex gl_VertexID gl_ViewportIndex gl_WorkGroupID gl_WorkGroupSize gl_in gl_out ' +\n // Functions\n 'EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive abs acos acosh all any asin ' +\n 'asinh atan atanh atomicAdd atomicAnd atomicCompSwap atomicCounter atomicCounterDecrement ' +\n 'atomicCounterIncrement atomicExchange atomicMax atomicMin atomicOr atomicXor barrier ' +\n 'bitCount bitfieldExtract bitfieldInsert bitfieldReverse ceil clamp cos cosh cross ' +\n 'dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward findLSB findMSB ' +\n 'floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan ' +\n 'greaterThanEqual groupMemoryBarrier imageAtomicAdd imageAtomicAnd imageAtomicCompSwap ' +\n 'imageAtomicExchange imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad ' +\n 'imageSize imageStore imulExtended intBitsToFloat interpolateAtCentroid interpolateAtOffset ' +\n 'interpolateAtSample inverse inversesqrt isinf isnan ldexp length lessThan lessThanEqual log ' +\n 'log2 matrixCompMult max memoryBarrier memoryBarrierAtomicCounter memoryBarrierBuffer ' +\n 'memoryBarrierImage memoryBarrierShared min mix mod modf noise1 noise2 noise3 noise4 ' +\n 'normalize not notEqual outerProduct packDouble2x32 packHalf2x16 packSnorm2x16 packSnorm4x8 ' +\n 'packUnorm2x16 packUnorm4x8 pow radians reflect refract round roundEven shadow1D shadow1DLod ' +\n 'shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj shadow2DProjLod sign sin sinh ' +\n 'smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture texture1D texture1DLod ' +\n 'texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj texture2DProjLod ' +\n 'texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod ' +\n 'textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset ' +\n 'textureLod textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset ' +\n 'textureProjLod textureProjLodOffset textureProjOffset textureQueryLevels textureQueryLod ' +\n 'textureSize transpose trunc uaddCarry uintBitsToFloat umulExtended unpackDouble2x32 ' +\n 'unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 unpackUnorm2x16 unpackUnorm4x8 usubBorrow',\n literal: 'true false'\n },\n illegal: '\"',\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'meta',\n begin: '#', end: '$'\n }\n ]\n };\n}", "function glsl(hljs) {\n return {\n name: 'GLSL',\n keywords: {\n keyword:\n // Statements\n 'break continue discard do else for if return while switch case default ' +\n // Qualifiers\n 'attribute binding buffer ccw centroid centroid varying coherent column_major const cw ' +\n 'depth_any depth_greater depth_less depth_unchanged early_fragment_tests equal_spacing ' +\n 'flat fractional_even_spacing fractional_odd_spacing highp in index inout invariant ' +\n 'invocations isolines layout line_strip lines lines_adjacency local_size_x local_size_y ' +\n 'local_size_z location lowp max_vertices mediump noperspective offset origin_upper_left ' +\n 'out packed patch pixel_center_integer point_mode points precise precision quads r11f_g11f_b10f '+\n 'r16 r16_snorm r16f r16i r16ui r32f r32i r32ui r8 r8_snorm r8i r8ui readonly restrict ' +\n 'rg16 rg16_snorm rg16f rg16i rg16ui rg32f rg32i rg32ui rg8 rg8_snorm rg8i rg8ui rgb10_a2 ' +\n 'rgb10_a2ui rgba16 rgba16_snorm rgba16f rgba16i rgba16ui rgba32f rgba32i rgba32ui rgba8 ' +\n 'rgba8_snorm rgba8i rgba8ui row_major sample shared smooth std140 std430 stream triangle_strip ' +\n 'triangles triangles_adjacency uniform varying vertices volatile writeonly',\n type:\n 'atomic_uint bool bvec2 bvec3 bvec4 dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 ' +\n 'dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 double dvec2 dvec3 dvec4 float iimage1D iimage1DArray ' +\n 'iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer ' +\n 'iimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray ' +\n 'image2DRect image3D imageBuffer imageCube imageCubeArray int isampler1D isampler1DArray ' +\n 'isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D ' +\n 'isamplerBuffer isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 mat2 mat2x2 mat2x3 ' +\n 'mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 sampler1D sampler1DArray ' +\n 'sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray sampler2DArrayShadow ' +\n 'sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow sampler3D ' +\n 'samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow ' +\n 'image1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray uimage2DRect ' +\n 'uimage3D uimageBuffer uimageCube uimageCubeArray uint usampler1D usampler1DArray ' +\n 'usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D ' +\n 'samplerBuffer usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 vec2 vec3 vec4 void',\n built_in:\n // Constants\n 'gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize gl_MaxClipDistances gl_MaxClipPlanes ' +\n 'gl_MaxCombinedAtomicCounterBuffers gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms ' +\n 'gl_MaxCombinedImageUnitsAndFragmentOutputs gl_MaxCombinedTextureImageUnits gl_MaxComputeAtomicCounterBuffers ' +\n 'gl_MaxComputeAtomicCounters gl_MaxComputeImageUniforms gl_MaxComputeTextureImageUnits ' +\n 'gl_MaxComputeUniformComponents gl_MaxComputeWorkGroupCount gl_MaxComputeWorkGroupSize ' +\n 'gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers gl_MaxFragmentAtomicCounters ' +\n 'gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents gl_MaxFragmentInputVectors ' +\n 'gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers ' +\n 'gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents ' +\n 'gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits ' +\n 'gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents ' +\n 'gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset ' +\n 'gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms ' +\n 'gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits ' +\n 'gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents ' +\n 'gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters ' +\n 'gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents ' +\n 'gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents ' +\n 'gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits ' +\n 'gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors ' +\n 'gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs gl_MaxVertexImageUniforms ' +\n 'gl_MaxVertexOutputComponents gl_MaxVertexOutputVectors gl_MaxVertexTextureImageUnits ' +\n 'gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffset ' +\n // Variables\n 'gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial ' +\n 'gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color ' +\n 'gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord ' +\n 'gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor ' +\n 'gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial ' +\n 'gl_FrontSecondaryColor gl_GlobalInvocationID gl_InstanceID gl_InvocationID gl_Layer gl_LightModel ' +\n 'gl_LightSource gl_LocalInvocationID gl_LocalInvocationIndex gl_ModelViewMatrix ' +\n 'gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose ' +\n 'gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose ' +\n 'gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 ' +\n 'gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 ' +\n 'gl_Normal gl_NormalMatrix gl_NormalScale gl_NumSamples gl_NumWorkGroups gl_ObjectPlaneQ ' +\n 'gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn gl_Point gl_PointCoord ' +\n 'gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn gl_ProjectionMatrix gl_ProjectionMatrixInverse ' +\n 'gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask ' +\n 'gl_SampleMaskIn gl_SamplePosition gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter ' +\n 'gl_TexCoord gl_TextureEnvColor gl_TextureMatrix gl_TextureMatrixInverse gl_TextureMatrixInverseTranspose ' +\n 'gl_TextureMatrixTranspose gl_Vertex gl_VertexID gl_ViewportIndex gl_WorkGroupID gl_WorkGroupSize gl_in gl_out ' +\n // Functions\n 'EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive abs acos acosh all any asin ' +\n 'asinh atan atanh atomicAdd atomicAnd atomicCompSwap atomicCounter atomicCounterDecrement ' +\n 'atomicCounterIncrement atomicExchange atomicMax atomicMin atomicOr atomicXor barrier ' +\n 'bitCount bitfieldExtract bitfieldInsert bitfieldReverse ceil clamp cos cosh cross ' +\n 'dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward findLSB findMSB ' +\n 'floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan ' +\n 'greaterThanEqual groupMemoryBarrier imageAtomicAdd imageAtomicAnd imageAtomicCompSwap ' +\n 'imageAtomicExchange imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad ' +\n 'imageSize imageStore imulExtended intBitsToFloat interpolateAtCentroid interpolateAtOffset ' +\n 'interpolateAtSample inverse inversesqrt isinf isnan ldexp length lessThan lessThanEqual log ' +\n 'log2 matrixCompMult max memoryBarrier memoryBarrierAtomicCounter memoryBarrierBuffer ' +\n 'memoryBarrierImage memoryBarrierShared min mix mod modf noise1 noise2 noise3 noise4 ' +\n 'normalize not notEqual outerProduct packDouble2x32 packHalf2x16 packSnorm2x16 packSnorm4x8 ' +\n 'packUnorm2x16 packUnorm4x8 pow radians reflect refract round roundEven shadow1D shadow1DLod ' +\n 'shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj shadow2DProjLod sign sin sinh ' +\n 'smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture texture1D texture1DLod ' +\n 'texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj texture2DProjLod ' +\n 'texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod ' +\n 'textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset ' +\n 'textureLod textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset ' +\n 'textureProjLod textureProjLodOffset textureProjOffset textureQueryLevels textureQueryLod ' +\n 'textureSize transpose trunc uaddCarry uintBitsToFloat umulExtended unpackDouble2x32 ' +\n 'unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 unpackUnorm2x16 unpackUnorm4x8 usubBorrow',\n literal: 'true false'\n },\n illegal: '\"',\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'meta',\n begin: '#', end: '$'\n }\n ]\n };\n}", "function glsl(hljs) {\n return {\n name: 'GLSL',\n keywords: {\n keyword:\n // Statements\n 'break continue discard do else for if return while switch case default ' +\n // Qualifiers\n 'attribute binding buffer ccw centroid centroid varying coherent column_major const cw ' +\n 'depth_any depth_greater depth_less depth_unchanged early_fragment_tests equal_spacing ' +\n 'flat fractional_even_spacing fractional_odd_spacing highp in index inout invariant ' +\n 'invocations isolines layout line_strip lines lines_adjacency local_size_x local_size_y ' +\n 'local_size_z location lowp max_vertices mediump noperspective offset origin_upper_left ' +\n 'out packed patch pixel_center_integer point_mode points precise precision quads r11f_g11f_b10f ' +\n 'r16 r16_snorm r16f r16i r16ui r32f r32i r32ui r8 r8_snorm r8i r8ui readonly restrict ' +\n 'rg16 rg16_snorm rg16f rg16i rg16ui rg32f rg32i rg32ui rg8 rg8_snorm rg8i rg8ui rgb10_a2 ' +\n 'rgb10_a2ui rgba16 rgba16_snorm rgba16f rgba16i rgba16ui rgba32f rgba32i rgba32ui rgba8 ' +\n 'rgba8_snorm rgba8i rgba8ui row_major sample shared smooth std140 std430 stream triangle_strip ' +\n 'triangles triangles_adjacency uniform varying vertices volatile writeonly',\n type:\n 'atomic_uint bool bvec2 bvec3 bvec4 dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 ' +\n 'dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 double dvec2 dvec3 dvec4 float iimage1D iimage1DArray ' +\n 'iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer ' +\n 'iimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray ' +\n 'image2DRect image3D imageBuffer imageCube imageCubeArray int isampler1D isampler1DArray ' +\n 'isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D ' +\n 'isamplerBuffer isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 mat2 mat2x2 mat2x3 ' +\n 'mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 sampler1D sampler1DArray ' +\n 'sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray sampler2DArrayShadow ' +\n 'sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow sampler3D ' +\n 'samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow ' +\n 'image1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray uimage2DRect ' +\n 'uimage3D uimageBuffer uimageCube uimageCubeArray uint usampler1D usampler1DArray ' +\n 'usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D ' +\n 'samplerBuffer usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 vec2 vec3 vec4 void',\n built_in:\n // Constants\n 'gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize gl_MaxClipDistances gl_MaxClipPlanes ' +\n 'gl_MaxCombinedAtomicCounterBuffers gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms ' +\n 'gl_MaxCombinedImageUnitsAndFragmentOutputs gl_MaxCombinedTextureImageUnits gl_MaxComputeAtomicCounterBuffers ' +\n 'gl_MaxComputeAtomicCounters gl_MaxComputeImageUniforms gl_MaxComputeTextureImageUnits ' +\n 'gl_MaxComputeUniformComponents gl_MaxComputeWorkGroupCount gl_MaxComputeWorkGroupSize ' +\n 'gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers gl_MaxFragmentAtomicCounters ' +\n 'gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents gl_MaxFragmentInputVectors ' +\n 'gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers ' +\n 'gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents ' +\n 'gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits ' +\n 'gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents ' +\n 'gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset ' +\n 'gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms ' +\n 'gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits ' +\n 'gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents ' +\n 'gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters ' +\n 'gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents ' +\n 'gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents ' +\n 'gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits ' +\n 'gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors ' +\n 'gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs gl_MaxVertexImageUniforms ' +\n 'gl_MaxVertexOutputComponents gl_MaxVertexOutputVectors gl_MaxVertexTextureImageUnits ' +\n 'gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffset ' +\n // Variables\n 'gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial ' +\n 'gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color ' +\n 'gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord ' +\n 'gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor ' +\n 'gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial ' +\n 'gl_FrontSecondaryColor gl_GlobalInvocationID gl_InstanceID gl_InvocationID gl_Layer gl_LightModel ' +\n 'gl_LightSource gl_LocalInvocationID gl_LocalInvocationIndex gl_ModelViewMatrix ' +\n 'gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose ' +\n 'gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose ' +\n 'gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 ' +\n 'gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 ' +\n 'gl_Normal gl_NormalMatrix gl_NormalScale gl_NumSamples gl_NumWorkGroups gl_ObjectPlaneQ ' +\n 'gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn gl_Point gl_PointCoord ' +\n 'gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn gl_ProjectionMatrix gl_ProjectionMatrixInverse ' +\n 'gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask ' +\n 'gl_SampleMaskIn gl_SamplePosition gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter ' +\n 'gl_TexCoord gl_TextureEnvColor gl_TextureMatrix gl_TextureMatrixInverse gl_TextureMatrixInverseTranspose ' +\n 'gl_TextureMatrixTranspose gl_Vertex gl_VertexID gl_ViewportIndex gl_WorkGroupID gl_WorkGroupSize gl_in gl_out ' +\n // Functions\n 'EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive abs acos acosh all any asin ' +\n 'asinh atan atanh atomicAdd atomicAnd atomicCompSwap atomicCounter atomicCounterDecrement ' +\n 'atomicCounterIncrement atomicExchange atomicMax atomicMin atomicOr atomicXor barrier ' +\n 'bitCount bitfieldExtract bitfieldInsert bitfieldReverse ceil clamp cos cosh cross ' +\n 'dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward findLSB findMSB ' +\n 'floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan ' +\n 'greaterThanEqual groupMemoryBarrier imageAtomicAdd imageAtomicAnd imageAtomicCompSwap ' +\n 'imageAtomicExchange imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad ' +\n 'imageSize imageStore imulExtended intBitsToFloat interpolateAtCentroid interpolateAtOffset ' +\n 'interpolateAtSample inverse inversesqrt isinf isnan ldexp length lessThan lessThanEqual log ' +\n 'log2 matrixCompMult max memoryBarrier memoryBarrierAtomicCounter memoryBarrierBuffer ' +\n 'memoryBarrierImage memoryBarrierShared min mix mod modf noise1 noise2 noise3 noise4 ' +\n 'normalize not notEqual outerProduct packDouble2x32 packHalf2x16 packSnorm2x16 packSnorm4x8 ' +\n 'packUnorm2x16 packUnorm4x8 pow radians reflect refract round roundEven shadow1D shadow1DLod ' +\n 'shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj shadow2DProjLod sign sin sinh ' +\n 'smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture texture1D texture1DLod ' +\n 'texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj texture2DProjLod ' +\n 'texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod ' +\n 'textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset ' +\n 'textureLod textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset ' +\n 'textureProjLod textureProjLodOffset textureProjOffset textureQueryLevels textureQueryLod ' +\n 'textureSize transpose trunc uaddCarry uintBitsToFloat umulExtended unpackDouble2x32 ' +\n 'unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 unpackUnorm2x16 unpackUnorm4x8 usubBorrow',\n literal: 'true false'\n },\n illegal: '\"',\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'meta',\n begin: '#',\n end: '$'\n }\n ]\n };\n}", "function glsl(hljs) {\n return {\n name: 'GLSL',\n keywords: {\n keyword:\n // Statements\n 'break continue discard do else for if return while switch case default ' +\n // Qualifiers\n 'attribute binding buffer ccw centroid centroid varying coherent column_major const cw ' +\n 'depth_any depth_greater depth_less depth_unchanged early_fragment_tests equal_spacing ' +\n 'flat fractional_even_spacing fractional_odd_spacing highp in index inout invariant ' +\n 'invocations isolines layout line_strip lines lines_adjacency local_size_x local_size_y ' +\n 'local_size_z location lowp max_vertices mediump noperspective offset origin_upper_left ' +\n 'out packed patch pixel_center_integer point_mode points precise precision quads r11f_g11f_b10f ' +\n 'r16 r16_snorm r16f r16i r16ui r32f r32i r32ui r8 r8_snorm r8i r8ui readonly restrict ' +\n 'rg16 rg16_snorm rg16f rg16i rg16ui rg32f rg32i rg32ui rg8 rg8_snorm rg8i rg8ui rgb10_a2 ' +\n 'rgb10_a2ui rgba16 rgba16_snorm rgba16f rgba16i rgba16ui rgba32f rgba32i rgba32ui rgba8 ' +\n 'rgba8_snorm rgba8i rgba8ui row_major sample shared smooth std140 std430 stream triangle_strip ' +\n 'triangles triangles_adjacency uniform varying vertices volatile writeonly',\n type:\n 'atomic_uint bool bvec2 bvec3 bvec4 dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 ' +\n 'dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 double dvec2 dvec3 dvec4 float iimage1D iimage1DArray ' +\n 'iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer ' +\n 'iimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray ' +\n 'image2DRect image3D imageBuffer imageCube imageCubeArray int isampler1D isampler1DArray ' +\n 'isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D ' +\n 'isamplerBuffer isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 mat2 mat2x2 mat2x3 ' +\n 'mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 sampler1D sampler1DArray ' +\n 'sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray sampler2DArrayShadow ' +\n 'sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow sampler3D ' +\n 'samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow ' +\n 'image1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray uimage2DRect ' +\n 'uimage3D uimageBuffer uimageCube uimageCubeArray uint usampler1D usampler1DArray ' +\n 'usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D ' +\n 'samplerBuffer usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 vec2 vec3 vec4 void',\n built_in:\n // Constants\n 'gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize gl_MaxClipDistances gl_MaxClipPlanes ' +\n 'gl_MaxCombinedAtomicCounterBuffers gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms ' +\n 'gl_MaxCombinedImageUnitsAndFragmentOutputs gl_MaxCombinedTextureImageUnits gl_MaxComputeAtomicCounterBuffers ' +\n 'gl_MaxComputeAtomicCounters gl_MaxComputeImageUniforms gl_MaxComputeTextureImageUnits ' +\n 'gl_MaxComputeUniformComponents gl_MaxComputeWorkGroupCount gl_MaxComputeWorkGroupSize ' +\n 'gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers gl_MaxFragmentAtomicCounters ' +\n 'gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents gl_MaxFragmentInputVectors ' +\n 'gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers ' +\n 'gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents ' +\n 'gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits ' +\n 'gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents ' +\n 'gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset ' +\n 'gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms ' +\n 'gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits ' +\n 'gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents ' +\n 'gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters ' +\n 'gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents ' +\n 'gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents ' +\n 'gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits ' +\n 'gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors ' +\n 'gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs gl_MaxVertexImageUniforms ' +\n 'gl_MaxVertexOutputComponents gl_MaxVertexOutputVectors gl_MaxVertexTextureImageUnits ' +\n 'gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffset ' +\n // Variables\n 'gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial ' +\n 'gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color ' +\n 'gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord ' +\n 'gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor ' +\n 'gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial ' +\n 'gl_FrontSecondaryColor gl_GlobalInvocationID gl_InstanceID gl_InvocationID gl_Layer gl_LightModel ' +\n 'gl_LightSource gl_LocalInvocationID gl_LocalInvocationIndex gl_ModelViewMatrix ' +\n 'gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose ' +\n 'gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose ' +\n 'gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 ' +\n 'gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 ' +\n 'gl_Normal gl_NormalMatrix gl_NormalScale gl_NumSamples gl_NumWorkGroups gl_ObjectPlaneQ ' +\n 'gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn gl_Point gl_PointCoord ' +\n 'gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn gl_ProjectionMatrix gl_ProjectionMatrixInverse ' +\n 'gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask ' +\n 'gl_SampleMaskIn gl_SamplePosition gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter ' +\n 'gl_TexCoord gl_TextureEnvColor gl_TextureMatrix gl_TextureMatrixInverse gl_TextureMatrixInverseTranspose ' +\n 'gl_TextureMatrixTranspose gl_Vertex gl_VertexID gl_ViewportIndex gl_WorkGroupID gl_WorkGroupSize gl_in gl_out ' +\n // Functions\n 'EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive abs acos acosh all any asin ' +\n 'asinh atan atanh atomicAdd atomicAnd atomicCompSwap atomicCounter atomicCounterDecrement ' +\n 'atomicCounterIncrement atomicExchange atomicMax atomicMin atomicOr atomicXor barrier ' +\n 'bitCount bitfieldExtract bitfieldInsert bitfieldReverse ceil clamp cos cosh cross ' +\n 'dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward findLSB findMSB ' +\n 'floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan ' +\n 'greaterThanEqual groupMemoryBarrier imageAtomicAdd imageAtomicAnd imageAtomicCompSwap ' +\n 'imageAtomicExchange imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad ' +\n 'imageSize imageStore imulExtended intBitsToFloat interpolateAtCentroid interpolateAtOffset ' +\n 'interpolateAtSample inverse inversesqrt isinf isnan ldexp length lessThan lessThanEqual log ' +\n 'log2 matrixCompMult max memoryBarrier memoryBarrierAtomicCounter memoryBarrierBuffer ' +\n 'memoryBarrierImage memoryBarrierShared min mix mod modf noise1 noise2 noise3 noise4 ' +\n 'normalize not notEqual outerProduct packDouble2x32 packHalf2x16 packSnorm2x16 packSnorm4x8 ' +\n 'packUnorm2x16 packUnorm4x8 pow radians reflect refract round roundEven shadow1D shadow1DLod ' +\n 'shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj shadow2DProjLod sign sin sinh ' +\n 'smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture texture1D texture1DLod ' +\n 'texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj texture2DProjLod ' +\n 'texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod ' +\n 'textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset ' +\n 'textureLod textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset ' +\n 'textureProjLod textureProjLodOffset textureProjOffset textureQueryLevels textureQueryLod ' +\n 'textureSize transpose trunc uaddCarry uintBitsToFloat umulExtended unpackDouble2x32 ' +\n 'unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 unpackUnorm2x16 unpackUnorm4x8 usubBorrow',\n literal: 'true false'\n },\n illegal: '\"',\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'meta',\n begin: '#',\n end: '$'\n }\n ]\n };\n}", "shared_glsl_code() // ********* SHARED CODE, INCLUDED IN BOTH SHADERS *********\n { return `precision mediump float;\n `;\n }", "function loadShader( _gl, _shaderSrc, canvas ) {\n\n\tvar vertString = \"\";\n\n\tif(_shaderSrc.vertURL){\n\t\tvertString = fetchHTTP( _shaderSrc.vertURL );\n\t} else {\n vertString =\n\"attribute mediump vec2 a_position;\\n\\\nattribute mediump vec2 a_texcoord;\\n\\\nvarying mediump vec2 CoronaTexCoord;\\n\\\nvoid main() {\\n\\\ngl_Position = vec4(a_position, 0.0, 1.0);\\n\\\nCoronaTexCoord = a_texcoord;\\n\\\n}\\n\\\n\";\n\t}\n\n\tvar fragString = \"\\\n#define P_DEFAULT highp\\n\\\n#define P_RANDOM highp\\n\\\n#define P_POSITION mediump\\n\\\n#define P_NORMAL mediump\\n\\\n#define P_UV mediump\\n\\\n#define P_COLOR lowp\\n\\\n#define FRAGMENT_SHADER_SUPPORTS_HIGHP 1\\n\\\nvarying mediump vec2 CoronaTexCoord; uniform P_RANDOM vec4 v_ColorScale; uniform P_RANDOM vec4 CoronaVertexUserData; uniform highp vec2 u_full_resolution;uniform sampler2D CoronaSampler0;uniform sampler2D CoronaSampler1;uniform highp vec2 u_mouse;uniform highp float CoronaTotalTime; \\\nhighp vec4 CoronaColorScale(highp vec4 c) { return v_ColorScale*c; } P_DEFAULT float CoronaDeltaTime=0.02; uniform P_UV vec4 CoronaTexelSize; P_POSITION vec2 CoronaContentScale = vec2(1.0,1.0); \\n\\\nP_COLOR vec4 FragmentKernel( P_UV vec2 position );\\nvoid main(){gl_FragColor = FragmentKernel(CoronaTexCoord);}\\n\";\n\n\terrorLineOffset = fragString.split(/\\r\\n|\\r|\\n/).length\n\n\n if (_shaderSrc.fragSTR){\n\t\tfragString += _shaderSrc.fragSTR;\n\t} else if(_shaderSrc.fragURL){\n\t\tfragString += fetchHTTP( _shaderSrc.fragURL );\n\t} else {\n\t\tfragString += \"P_COLOR vec4 FragmentKernel( P_UV vec2 texCoord ){P_COLOR vec4 ret = vec4(texCoord.x, texCoord.y, abs(sin(CoronaTotalTime)), 1); return CoronaColorScale(ret);}\";\n\t}\n\n\tvar vertexShader = createShader(_gl, vertString, _gl.VERTEX_SHADER, canvas);\n\tvar fragmentShader = createShader(_gl, fragString , _gl.FRAGMENT_SHADER, canvas);\n\n\tif(!fragmentShader){\n\t\tfragmentShader = createShader(_gl, \"void main(){\\n\\\n\tgl_FragColor = vec4(1.0);\\n\\\n}\" , _gl.FRAGMENT_SHADER, canvas);\n\t}\n\n\t// Create and use program\n\tvar program = createProgram( _gl, [vertexShader, fragmentShader]);\n\t_gl.useProgram(program);\n\n\t// Delete shaders\n\t// _gl.detachShader(program, vertexShader);\n // _gl.detachShader(program, fragmentShader);\n // _gl.deleteShader(vertexShader);\n // _gl.deleteShader(fragmentShader);\n\n\treturn program;\n}", "function comparison(){\n\n var a1,a2,a3,a4,b1,b2,b3,b4,hint1,hint2,hint3,hint4;\n a1 = row[nbrOfRows].h1;\n a2 = row[nbrOfRows].h2;\n a3 = row[nbrOfRows].h3;\n a4 = row[nbrOfRows].h4;\n b1 = row[0].h1;\n b2 = row[0].h2;\n b3 = row[0].h3;\n b4 = row[0].h4;\n\n\n correctPosition=0; //Nbr of correct colors on correct position\n if (a1 == b1){correctPosition++;a1=1;b1=0;hint1=1}\n if (a2 == b2){correctPosition++;a2=1;b2=0;hint2=1}\n if (a3 == b3){correctPosition++;a3=1;b3=0;hint3=1}\n if (a4 == b4){correctPosition++;a4=1;b4=0;hint4=1}\n\n correctColour=0; //Nbr of correct colors on wrong position\n if (a1 == b2){correctColour++;a1=1;b2=0}\n if (a1 == b3){correctColour++;a1=1;b3=0}\n if (a1 == b4){correctColour++;a1=1;b4=0}\n\n if (a2 == b1){correctColour++;a2=1;b1=0}\n if (a2 == b3){correctColour++;a2=1;b3=0}\n if (a2 == b4){correctColour++;a2=1;b4=0}\n\n if (a3 == b1){correctColour++;a3=1;b1=0}\n if (a3 == b2){correctColour++;a3=1;b2=0}\n if (a3 == b4){correctColour++;a3=1;b4=0}\n\n if (a4 == b1){correctColour++;a4=1;b1=0}\n if (a4 == b2){correctColour++;a4=1;b2=0}\n if (a4 == b3){correctColour++;a4=1;b3=0}\n\n //Draw the hints on the side of the board\n var p = 9*box+4.8;\n for (i=0;i<4;i++){\n if (i<correctPosition){\n ctx.drawImage(red,p,selectedHole.y+8,box/2.5,box/2.5)}\n else if (i<correctPosition+correctColour){ctx.drawImage(white,p,selectedHole.y+8,box/2.5,box/2.5)}\n else {ctx.drawImage(empty,p,selectedHole.y+8,box/2.5,box/2.5)}\n p += 16.8;\n }\n \n if (correctPosition == 4){ // If colors correspond than we display the \"victory\" box\n document.getElementById(\"victoryMenu\").style.visibility=\"visible\";\n ctx.drawImage(row[0].h1,box*3,box*23,box,box);\n ctx.drawImage(row[0].h2,box*5,box*23,box,box);\n ctx.drawImage(row[0].h3,box*7,box*23,box,box);\n ctx.drawImage(row[0].h4,box*9,box*23,box,box);\n selectedHole.y = undefined; selectedHole.x = undefined;\n }\n else if (nbrOfRows == 11) { //If the colors are wrong and the it's the 11th row we display the \"defeat\" box\n document.getElementById(\"defeatMenu\").style.visibility=\"visible\";\n ctx.drawImage(row[0].h1,box*3,box*23,box,box);\n ctx.drawImage(row[0].h2,box*5,box*23,box,box);\n ctx.drawImage(row[0].h3,box*7,box*23,box,box);\n ctx.drawImage(row[0].h4,box*9,box*23,box,box);\n selectedHole.y = undefined; selectedHole.x = undefined;\n\n }\n\n document.getElementById(\"pts\").innerHTML=(-nbrOfRows+12)\n}", "constructor(gl, vsPath, fsPath, vsSource, fsSource, vsSubs, fsSubs) {\nvar a, i, j, k, ref, ref1, shprog, sz, u, vsfsStr;\nthis.gl = gl;\nthis.vsPath = vsPath;\nthis.fsPath = fsPath;\nthis.vsSource = vsSource;\nthis.fsSource = fsSource;\nthis.vsSubs = vsSubs;\nthis.fsSubs = fsSubs;\n//----------\nthis._prog = null; // WebGL program.\nthis._vs = null; // WebGL vertex shader.\nthis._fs = null; // WebGL fragment shader.\nthis._nUniforms = -1; // Number of uniforms.\nthis._uniforms = {}; // Uniform locations.\nthis._nAttributes = -1; // Number of attributes.\nthis._attributes = {}; // Attribute locations.\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: Max Vert Uniforms: ${this.gl.getParameter(this.gl.MAX_VERTEX_UNIFORM_VECTORS)}`);\n}\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: Max Frag Uniforms: ${this.gl.getParameter(this.gl.MAX_FRAGMENT_UNIFORM_VECTORS)}`);\n}\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: Vert source: ${this.vsSource}`);\n}\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: Frag source: ${this.fsSource}`);\n}\n// Load vertex and fragment shaders, performing substitutions if any.\nthis._vs = this._loadShader(this.vsPath, this.vsSource, this.vsSubs);\nthis._fs = this._loadShader(this.fsPath, this.fsSource, this.fsSubs);\n// Create and link the program\nshprog = this.gl.createProgram();\nif (this._vs && this._fs) {\nthis.gl.attachShader(shprog, this._vs);\nif (this._fs) {\nthis.gl.attachShader(shprog, this._fs);\n}\n// Keep Chrome happy\nthis.gl.bindAttribLocation(shprog, 0, \"BindPos\");\nthis.gl.linkProgram(shprog);\n}\nvsfsStr = `VrtxS=${this.vsPath} FragS=${this.fsPath}`;\nif (this.gl.getProgramParameter(shprog, this.gl.LINK_STATUS)) {\nif (typeof lggr.info === \"function\") {\nlggr.info(`Shader: Program using: ${vsfsStr} created`);\n}\nthis._prog = shprog;\n} else {\nlggr.warn(`Shader: Program using: ${vsfsStr} failed to link: ${this.gl.getProgramInfoLog(shprog)}`);\nthis.gl.deleteProgram(shprog);\nthis._vs = this._fs = null;\n}\nif (this._prog) {\n// Grab uniforms.\nthis._nUniforms = this.gl.getProgramParameter(this._prog, this.gl.ACTIVE_UNIFORMS);\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: ${this._nUniforms} Uniform Variables used ####`);\n}\nsz = 0;\nfor (i = j = 0, ref = this._nUniforms; (0 <= ref ? j < ref : j > ref); i = 0 <= ref ? ++j : --j) {\nu = this.gl.getActiveUniform(this._prog, i);\nthis._uniforms[u.name] = this.gl.getUniformLocation(this._prog, u.name);\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: ${u.name} size ${(this.gl.getActiveUniform(this._prog, i)).size}`);\n}\nsz += (this.gl.getActiveUniform(this._prog, i)).size;\n}\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: ${sz} Shader Uniforms used ####`);\n}\n// Grab attributes.\nthis._nAttributes = this.gl.getProgramParameter(this._prog, this.gl.ACTIVE_ATTRIBUTES);\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: ${this._nAttributes} Active Attributes`);\n}\nfor (i = k = 0, ref1 = this._nAttributes; (0 <= ref1 ? k < ref1 : k > ref1); i = 0 <= ref1 ? ++k : --k) {\na = this.gl.getActiveAttrib(this._prog, i);\nthis._attributes[a.name] = this.gl.getAttribLocation(this._prog, a.name);\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: ${a.name}: ${this._attributes[a.name]}`);\n}\n}\n}\nthis.DO_CHECK_LOC_NAME = false;\n}", "function setupShaders() {\n \n // define fragment shader in essl using es6 template strings\n // here you need to take care of color attibutes\n var fShaderCode = `#version 300 es\n precision highp float;\n\n out vec4 FragColor;\n in vec4 oColor;\n\n void main(void) {\n FragColor = oColor; // all fragments are white\n }\n `;\n \n // define vertex shader in essl using es6 template strings\n // have in/out for vertex colors \n var vShaderCode = `#version 300 es\n in vec3 vertexPosition;\n in vec3 vertexColor;\n\n out vec4 oColor;\n\n void main(void) {\n gl_Position = vec4(vertexPosition, 1.0); // use the untransformed position\n oColor = vec4(vertexColor, 1.0);\n }\n `;\n \n try {\n // console.log(\"fragment shader: \"+fShaderCode);\n var fShader = gl.createShader(gl.FRAGMENT_SHADER); // create frag shader\n gl.shaderSource(fShader,fShaderCode); // attach code to shader\n gl.compileShader(fShader); // compile the code for gpu execution\n\n // console.log(\"vertex shader: \"+vShaderCode);\n var vShader = gl.createShader(gl.VERTEX_SHADER); // create vertex shader\n gl.shaderSource(vShader,vShaderCode); // attach code to shader\n gl.compileShader(vShader); // compile the code for gpu execution\n \n if (!gl.getShaderParameter(fShader, gl.COMPILE_STATUS)) { // bad frag shader compile\n throw \"error during fragment shader compile: \" + gl.getShaderInfoLog(fShader); \n gl.deleteShader(fShader);\n } else if (!gl.getShaderParameter(vShader, gl.COMPILE_STATUS)) { // bad vertex shader compile\n throw \"error during vertex shader compile: \" + gl.getShaderInfoLog(vShader); \n gl.deleteShader(vShader);\n } else { // no compile errors\n var shaderProgram = gl.createProgram(); // create the single shader program\n gl.attachShader(shaderProgram, fShader); // put frag shader in program\n gl.attachShader(shaderProgram, vShader); // put vertex shader in program\n gl.linkProgram(shaderProgram); // link program into gl context\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { // bad program link\n throw \"error during shader program linking: \" + gl.getProgramInfoLog(shaderProgram);\n } else { // no shader program link errors\n gl.useProgram(shaderProgram); // activate shader program (frag and vert)\n vertexPositionAttrib = gl.getAttribLocation(shaderProgram, \"vertexPosition\"); \n gl.enableVertexAttribArray(vertexPositionAttrib); // input to shader from array\n // set up vertexColorAttrib from vertexColor\n vertexColorAttrib = gl.getAttribLocation(shaderProgram, \"vertexColor\"); \n gl.enableVertexAttribArray(vertexColorAttrib)\n\n } // end if no shader program link errors\n } // end if no compile errors\n } // end try \n \n catch(e) {\n console.log(e);\n } // end catch\n} // end setup shaders", "function setupShaders() {\n \n // define fragment shader in essl using es6 template strings\n var fShaderCode = `\n \tprecision mediump float;\n\n \tvarying vec3 vColor;\n\n void main(void) {\n \t//gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); // all fragments are white\n gl_FragColor = vec4(vColor,1.0); // give the fragment that color\n }\n `;\n \n // define vertex shader in essl using es6 template strings\n var vShaderCode = `\n attribute vec3 vertexPosition;\n attribute vec3 vertexColor;\n\n uniform mat4 uMVMatrix;\n uniform mat4 uPMatrix;\n\n varying vec3 vColor;\n\n void main(void) {\n gl_Position = uPMatrix * uMVMatrix * vec4(vertexPosition, 1.0); // use the untransformed position\n //gl_Position = vec4(vertexPosition, 1.0);\n vColor = vertexColor;\n }\n `;\n \n try {\n // console.log(\"fragment shader: \"+fShaderCode);\n var fShader = gl.createShader(gl.FRAGMENT_SHADER); // create frag shader\n gl.shaderSource(fShader,fShaderCode); // attach code to shader\n gl.compileShader(fShader); // compile the code for gpu execution\n\n // console.log(\"vertex shader: \"+vShaderCode);\n var vShader = gl.createShader(gl.VERTEX_SHADER); // create vertex shader\n gl.shaderSource(vShader,vShaderCode); // attach code to shader\n gl.compileShader(vShader); // compile the code for gpu execution\n\n if (!gl.getShaderParameter(fShader, gl.COMPILE_STATUS)) { // bad frag shader compile\n throw \"error during fragment shader compile: \" + gl.getShaderInfoLog(fShader); \n gl.deleteShader(fShader);\n } else if (!gl.getShaderParameter(vShader, gl.COMPILE_STATUS)) { // bad vertex shader compile\n throw \"error during vertex shader compile: \" + gl.getShaderInfoLog(vShader); \n gl.deleteShader(vShader);\n } else { // no compile errors\n shaderProgram = gl.createProgram(); // create the single shader program\n gl.attachShader(shaderProgram, fShader); // put frag shader in program\n gl.attachShader(shaderProgram, vShader); // put vertex shader in program\n gl.linkProgram(shaderProgram); // link program into gl context\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { // bad program link\n throw \"error during shader program linking: \" + gl.getProgramInfoLog(shaderProgram);\n } else { // no shader program link errors\n gl.useProgram(shaderProgram); // activate shader program (frag and vert)\n vertexPositionAttrib = gl.getAttribLocation(shaderProgram, \"vertexPosition\"); // get pointer to vertex shader input\n gl.enableVertexAttribArray(vertexPositionAttrib); // input to shader from array\n console.log('before enable');\n vertexColorAttrib = gl.getAttribLocation(shaderProgram, \"vertexColor\");\n gl.enableVertexAttribArray(vertexColorAttrib);\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n mat4.identity(mvMatrix);\n mat4.identity(perspective);\n //mat4.perspective(pMatrix, 90*(3.14/180), 600/600, 0.5, 1.5);\n //mat4.lookAt(mvMatrix, eye, lookAt, lookUp);\n } // end if no shader program link errors\n } // end if no compile errors\n } // end try \n \n catch(e) {\n console.log(e);\n } // end catch\n} // end setup shaders", "function runOneTest(gl, info) {\n var passMsg = info.passMsg\n debug(\"\");\n debug(\"test: \" + passMsg);\n\n var consoleDiv = document.getElementById(\"console\");\n\n if (info.vShaderSource === undefined) {\n if (info.vShaderId) {\n info.vShaderSource = document.getElementById(info.vShaderId).text;\n } else {\n info.vShader = 'defaultVertexShader';\n info.vShaderSource = defaultVertexShader;\n }\n }\n if (info.fShaderSource === undefined) {\n if (info.fShaderId) {\n info.fShaderSource = document.getElementById(info.fShaderId).text;\n } else {\n info.fShader = 'defaultFragmentShader';\n info.fShaderSource = defaultFragmentShader;\n }\n }\n\n var vLabel = (info.vShaderSource == defaultVertexShader ? \"default\" : \"test\") + \" vertex shader\";\n var fLabel = (info.fShaderSource == defaultFragmentShader ? \"default\" : \"test\") + \" fragment shader\";\n\n var vSource = info.vShaderPrep ? info.vShaderPrep(info.vShaderSource) :\n info.vShaderSource;\n\n wtu.addShaderSource(consoleDiv, vLabel, vSource);\n\n // Reuse identical shaders so we test shared shader.\n var vShader = vShaderDB[vSource];\n if (!vShader) {\n vShader = wtu.loadShader(gl, vSource, gl.VERTEX_SHADER);\n if (info.vShaderTest) {\n if (!info.vShaderTest(vShader)) {\n testFailed(\"[vertex shader test] \" + passMsg);\n return;\n }\n }\n // As per GLSL 1.0.17 10.27 we can only check for success on\n // compileShader, not failure.\n if (!info.ignoreResults && info.vShaderSuccess && !vShader) {\n testFailed(\"[unexpected vertex shader compile status] (expected: \" +\n info.vShaderSuccess + \") \" + passMsg);\n }\n // Save the shaders so we test shared shader.\n if (vShader) {\n vShaderDB[vSource] = vShader;\n }\n }\n\n var debugShaders = gl.getExtension('WEBGL_debug_shaders');\n if (debugShaders && vShader) {\n wtu.addShaderSource(consoleDiv, vLabel + \" translated for driver\",\n debugShaders.getTranslatedShaderSource(vShader));\n }\n\n var fSource = info.fShaderPrep ? info.fShaderPrep(info.fShaderSource) :\n info.fShaderSource;\n\n wtu.addShaderSource(consoleDiv, fLabel, fSource);\n\n // Reuse identical shaders so we test shared shader.\n var fShader = fShaderDB[fSource];\n if (!fShader) {\n fShader = wtu.loadShader(gl, fSource, gl.FRAGMENT_SHADER);\n if (info.fShaderTest) {\n if (!info.fShaderTest(fShader)) {\n testFailed(\"[fragment shader test] \" + passMsg);\n return;\n }\n }\n //debug(fShader == null ? \"fail\" : \"succeed\");\n // As per GLSL 1.0.17 10.27 we can only check for success on\n // compileShader, not failure.\n if (!info.ignoreResults && info.fShaderSuccess && !fShader) {\n testFailed(\"[unexpected fragment shader compile status] (expected: \" +\n info.fShaderSuccess + \") \" + passMsg);\n return;\n }\n\n // Safe the shaders so we test shared shader.\n if (fShader) {\n fShaderDB[fSource] = fShader;\n }\n }\n\n if (debugShaders && fShader) {\n wtu.addShaderSource(consoleDiv, fLabel + \" translated for driver\",\n debugShaders.getTranslatedShaderSource(fShader));\n }\n\n if (vShader && fShader) {\n var program = gl.createProgram();\n gl.attachShader(program, vShader);\n gl.attachShader(program, fShader);\n\n if (vSource.indexOf(\"vPosition\") >= 0) {\n gl.bindAttribLocation(program, 0, \"vPosition\");\n }\n if (vSource.indexOf(\"texCoord0\") >= 0) {\n gl.bindAttribLocation(program, 1, \"texCoord0\");\n }\n gl.linkProgram(program);\n var linked = (gl.getProgramParameter(program, gl.LINK_STATUS) != 0);\n if (!linked) {\n var error = gl.getProgramInfoLog(program);\n log(\"*** Error linking program '\"+program+\"':\"+error);\n }\n if (!info.ignoreResults && linked != info.linkSuccess) {\n testFailed(\"[unexpected link status] \" + passMsg);\n return;\n }\n } else {\n if (!info.ignoreResults && info.linkSuccess) {\n testFailed(\"[link failed] \" + passMsg);\n return;\n }\n }\n\n if (parseInt(wtu.getUrlOptions().dumpShaders)) {\n var vInfo = {\n shader: vShader,\n shaderSuccess: info.vShaderSuccess,\n label: vLabel,\n source: vSource\n };\n var fInfo = {\n shader: fShader,\n shaderSuccess: info.fShaderSuccess,\n label: fLabel,\n source: fSource\n };\n wtu.dumpShadersInfo(gl, window.location.pathname, passMsg, vInfo, fInfo);\n }\n\n if (!info.render) {\n testPassed(passMsg);\n return;\n }\n\n gl.useProgram(program);\n wtu.setupUnitQuad(gl);\n wtu.clearAndDrawUnitQuad(gl);\n\n var div = document.createElement(\"div\");\n div.className = \"testimages\";\n wtu.insertImage(div, \"result\", wtu.makeImageFromCanvas(gl.canvas));\n div.appendChild(document.createElement('br'));\n consoleDiv.appendChild(div);\n wtu.checkCanvas(gl, [0, 255, 0, 255], \"should be green\", 0);\n}", "@autobind\n shaderLoad() {\n this.shadersLoaded++;\n\n if (this.shadersLoaded === 2) {\n this.loadColors();\n }\n }", "fragment_glsl_code() {\n return (\n this.shared_glsl_code() +\n `\n varying vec2 f_tex_coord;\n uniform sampler2D texture;\n uniform float animation_time;\n \n \n void main(){\n // Sample the texture image in the correct place:\n float t= animation_time;\n if (t >= 20.0)\n {\n t=t-20.0;\n }\n vec2 new_coor=vec2(f_tex_coord.x-0.05*t,f_tex_coord.y);\n \n vec4 tex_color = texture2D( texture, new_coor);\n \n if( tex_color.w < .01 ) discard;\n // Compute an initial (ambient) color:\n gl_FragColor = vec4( ( tex_color.xyz + shape_color.xyz ) * ambient, shape_color.w * tex_color.w ); \n // Compute the final color with contributions from lights:\n gl_FragColor.xyz += phong_model_lights( normalize( N ), vertex_worldspace );\n } `\n );\n }", "function error() {\n // cleans the screen paints canvas \n gl.clear( gl.COLOR_BUFFER_BIT );\n console.log(\"error = \" + index);\n gl.uniform4fv(colLoc, flatten(BLACK));\n \n drawLoop();\n \n console.log(\"error draw the good stuff first\");\n // set fragment shader variable fColour to RED draw the lines \n // that represents the last segement that does not meet criteria\n gl.uniform4fv(colLoc, flatten(RED));\n gl.drawArrays(gl.LINE_STRIP, index - 1, 2);\n console.log(\"error now draw the bad stuff\");\n}", "function setupShaders() {\n\n // define vertex shader in essl using es6 template strings\n var vShaderCode = `\n attribute vec3 vertexPosition;\n attribute vec3 vertexNormal;\n attribute vec3 ambient;\n attribute vec3 diffuse;\n attribute vec3 specular;\n attribute float specularExponent;\n attribute float shapeNum;\n\n uniform vec3 eyePos;\n uniform vec3 lightPos;\n uniform vec3 lightColor;\n uniform mat4 projMatrix;\n uniform mat4 viewMatrix;\n uniform mat4 xformMatrix;\n uniform float currentShape;\n\n varying lowp vec4 vColor;\n\n void main(void) {\n vec3 N = normalize(vertexNormal); // normal vector\n vec3 L = normalize(lightPos - vertexPosition); // light vector\n vec3 V = normalize(eyePos - vertexPosition); // view vector\n vec3 H = normalize(L + V);\n \n vec3 color;\n for (int i = 0; i < 3; i++) {\n color[i] = ambient[i] * lightColor[0]; // ambient term\n color[i] += diffuse[i] * lightColor[1] * dot(N, L); // diffuse term\n color[i] += specular[i] * lightColor[2] * pow(dot(N, H), specularExponent); // specular term\n\n // Clamp color\n if (color[i] > 1.0) {\n color[i] = 1.0;\n } else if (color[i] < 0.0) {\n color[i] = 0.0;\n }\n }\n\n if (shapeNum == currentShape) {\n gl_Position = projMatrix * viewMatrix * xformMatrix * vec4(vertexPosition, 1.0); // use transform matrix\n } else {\n gl_Position = projMatrix * viewMatrix * mat4(1.0) * vec4(vertexPosition, 1.0); // use untransformed position\n }\n\n vColor = vec4(color, 1.0);\n }\n `;\n \n // define fragment shader in essl using es6 template strings\n var fShaderCode = `\n varying lowp vec4 vColor;\n\n void main(void) {\n gl_FragColor = vColor;\n }\n `;\n \n try {\n // console.log(\"fragment shader: \"+fShaderCode);\n var fShader = gl.createShader(gl.FRAGMENT_SHADER); // create frag shader\n gl.shaderSource(fShader,fShaderCode); // attach code to shader\n gl.compileShader(fShader); // compile the code for gpu execution\n\n // console.log(\"vertex shader: \"+vShaderCode);\n var vShader = gl.createShader(gl.VERTEX_SHADER); // create vertex shader\n gl.shaderSource(vShader,vShaderCode); // attach code to shader\n gl.compileShader(vShader); // compile the code for gpu execution\n \n if (!gl.getShaderParameter(fShader, gl.COMPILE_STATUS)) { // bad frag shader compile\n throw \"error during fragment shader compile: \" + gl.getShaderInfoLog(fShader); \n gl.deleteShader(fShader);\n } else if (!gl.getShaderParameter(vShader, gl.COMPILE_STATUS)) { // bad vertex shader compile\n throw \"error during vertex shader compile: \" + gl.getShaderInfoLog(vShader); \n gl.deleteShader(vShader);\n } else { // no compile errors\n var shaderProgram = gl.createProgram(); // create the single shader program\n gl.attachShader(shaderProgram, fShader); // put frag shader in program\n gl.attachShader(shaderProgram, vShader); // put vertex shader in program\n gl.linkProgram(shaderProgram); // link program into gl context\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { // bad program link\n throw \"error during shader program linking: \" + gl.getProgramInfoLog(shaderProgram);\n } else { // no shader program link errors\n gl.useProgram(shaderProgram); // activate shader program (frag and vert)\n\n // Setup attributes\n vertexPositionAttrib = gl.getAttribLocation(shaderProgram, \"vertexPosition\"); // get pointer to vertex shader input\n gl.enableVertexAttribArray(vertexPositionAttrib); // input to shader from array\n\n vertexNormalAttrib = gl.getAttribLocation(shaderProgram, \"vertexNormal\");\n gl.enableVertexAttribArray(vertexNormalAttrib);\n\n vertexAmbientAttrib = gl.getAttribLocation(shaderProgram, \"ambient\");\n gl.enableVertexAttribArray(vertexAmbientAttrib);\n\n vertexDiffuseAttrib = gl.getAttribLocation(shaderProgram, \"diffuse\");\n gl.enableVertexAttribArray(vertexDiffuseAttrib);\n\n vertexSpecularAttrib = gl.getAttribLocation(shaderProgram, \"specular\");\n gl.enableVertexAttribArray(vertexSpecularAttrib);\n\n vertexSpecExpAttrib = gl.getAttribLocation(shaderProgram, \"specularExponent\");\n gl.enableVertexAttribArray(vertexSpecExpAttrib);\n\n vertexShapeNumAttrib = gl.getAttribLocation(shaderProgram, \"shapeNum\");\n gl.enableVertexAttribArray(vertexShapeNumAttrib);\n\n // Setup uniforms\n eyePosUniform = gl.getUniformLocation(shaderProgram, 'eyePos');\n gl.uniform3fv(eyePosUniform, eye);\n\n mat4.perspective(projectionMatrix, glMatrix.toRadian(90), 1, 0.1, 100);\n projMatrixUniform = gl.getUniformLocation(shaderProgram, 'projMatrix');\n gl.uniformMatrix4fv(projMatrixUniform, gl.FALSE, projectionMatrix);\n \n var center = vec3.create();\n vec3.add(center, eye, lookAt);\n mat4.lookAt(viewMatrix, eye, center, upVector);\n viewMatrixUniform = gl.getUniformLocation(shaderProgram, 'viewMatrix');\n gl.uniformMatrix4fv(viewMatrixUniform, gl.FALSE, viewMatrix);\n\n // mat4.identity(transformMatrix);\n xformMatrixUniform = gl.getUniformLocation(shaderProgram, 'xformMatrix');\n gl.uniformMatrix4fv(xformMatrixUniform, gl.FALSE, transformMatrix);\n\n lightPosUniform = gl.getUniformLocation(shaderProgram, 'lightPos');\n gl.uniform3fv(lightPosUniform, lightPos);\n\n lightColorUniform = gl.getUniformLocation(shaderProgram, 'lightColor');\n gl.uniform3fv(lightColorUniform, lightColor);\n\n currentShapeUniform = gl.getUniformLocation(shaderProgram, 'currentShape');\n gl.uniform1f(currentShapeUniform, shapeNum);\n } // end if no shader program link errors\n } // end if no compile errors\n } // end try \n \n catch(e) {\n console.log(e);\n } // end catch\n} // end setup shaders", "shared_glsl_code() // ********* SHARED CODE, INCLUDED IN BOTH SHADERS *********\n { return `precision mediump float;\n const int N_LIGHTS = 2; // We're limited to only so many inputs in hardware. Lights are costly (lots of sub-values).\n uniform float ambient, diffusivity, specularity, smoothness, animation_time, attenuation_factor[N_LIGHTS];\n uniform bool GOURAUD, COLOR_NORMALS, USE_TEXTURE; // Flags for alternate shading methods\n uniform vec4 lightPosition[N_LIGHTS], lightColor[N_LIGHTS], shapeColor;\n varying vec3 N, E; // Specifier \"varying\" means a variable's final value will be passed from the vertex shader \n varying vec2 f_tex_coord; // on to the next phase (fragment shader), then interpolated per-fragment, weighted by the \n varying vec4 VERTEX_COLOR; // pixel fragment's proximity to each of the 3 vertices (barycentric interpolation).\n varying vec3 L[N_LIGHTS], H[N_LIGHTS];\n varying float dist[N_LIGHTS];\n varying vec4 shadowPos;\n \n vec3 phong_model_lights( vec3 N )\n { vec3 result = vec3(0.0);\n for(int i = 0; i < N_LIGHTS; i++)\n {\n float attenuation_multiplier = 1.0 / (1.0 + attenuation_factor[i] * (dist[i] * dist[i]));\n float diffuse = max( dot(N, L[i]), 0.0 );\n float specular = pow( max( dot(N, H[i]), 0.0 ), smoothness );\n\n result += attenuation_multiplier * ( shapeColor.xyz * diffusivity * diffuse + lightColor[i].xyz * specularity * specular );\n }\n return result;\n }\n `;\n }", "function checkShaderErrorMsg(_gl, shader, shaderString) {\n if (!_gl.getShaderParameter(shader, _gl.COMPILE_STATUS)) {\n return [_gl.getShaderInfoLog(shader), addLineNumbers(shaderString)].join('\\n');\n }\n}", "fragment_glsl_code() {\n return this.shared_glsl_code() + `\n varying vec2 f_tex_coord;\n uniform sampler2D texture;\n uniform float animation_time;\n \n void main(){\n // Sample the texture image in the correct place:\n vec2 current_coord = f_tex_coord - 2.5 * animation_time;\n vec4 tex_color = texture2D( texture, current_coord );\n if( tex_color.w < .01 ) discard;\n // Compute an initial (ambient) color:\n gl_FragColor = vec4( ( tex_color.xyz + shape_color.xyz ) * ambient, shape_color.w * tex_color.w ); \n // Compute the final color with contributions from lights:\n gl_FragColor.xyz += phong_model_lights( normalize( N ), vertex_worldspace );\n } `;\n }", "async function countIntersections(lines) {\n const { STORAGE, UNIFORM, COPY_DST, COPY_SRC } = GPUBufferUsage\n\n // Setup the WebGPU device and adapter\n const adapter = await navigator.gpu.requestAdapter()\n const device = await adapter.requestDevice()\n\n // Encode the input lines into a flat 32-bit integer array\n const input = new Int32Array(lines.flat())\n\n // Determine the bounding box of all lines\n const sizeX = Math.max(...input.filter((_, ix) => ix % 2 == 0)) + 1\n const sizeY = Math.max(...input.filter((_, ix) => ix % 2 == 1)) + 1\n\n // Create the GPU-side buffers\n const argBytes = 3 * 4\n const inputBytes = input.byteLength\n const argBuffer = device.createBuffer({ size: argBytes, usage: UNIFORM | COPY_DST })\n const inputBuffer = device.createBuffer({ size: inputBytes, usage: STORAGE | COPY_DST })\n const tempBuffer = device.createBuffer({ size: sizeX * sizeY * 4, usage: STORAGE })\n const resultBuffer = device.createBuffer({ size: 4, usage: STORAGE | COPY_SRC })\n\n // Compile the WGSL shader code into a pipeline\n const module = device.createShaderModule({ code: kernel })\n const pipeline = device.createComputePipeline({\n compute: { module: module, entryPoint: \"main\" },\n })\n\n // Create a bind group that binds resources like buffers or textures\n // to the shader inputs ie. `[[group(X), binding(Y)]]` definitions.\n const bindGroup = device.createBindGroup({\n layout: pipeline.getBindGroupLayout(0),\n entries: [\n { binding: 0, resource: { buffer: argBuffer } },\n { binding: 1, resource: { buffer: inputBuffer } },\n { binding: 2, resource: { buffer: tempBuffer } },\n { binding: 3, resource: { buffer: resultBuffer } },\n ],\n })\n\n // Upload arguments and input data. The argument order must match the\n // layout of `ArgBuffer` in the shader.\n const numLines = input.length / 4\n const args = [sizeX, sizeY, numLines]\n uploadData(device, [\n { buffer: argBuffer, data: new Uint32Array(args) },\n { buffer: inputBuffer, data: input },\n ])\n\n // Start encoding the commands to `pass`.\n const encoder = device.createCommandEncoder()\n const pass = encoder.beginComputePass()\n\n // Encode the single dispatch we need to do. X count is 1 since the\n // uses that dimension only to loop over line cells. Y is the number\n // of 8 line groups we want to process.\n pass.setPipeline(pipeline)\n pass.setBindGroup(0, bindGroup)\n pass.dispatch(1, Math.ceil(numLines / 8))\n pass.endPass()\n\n // Submit to actually start processing on the GPU.\n const commands = encoder.finish()\n device.queue.submit([commands])\n\n // Download the resulting count from the GPU. `downloadData()` uses\n // `GPUBuffer.mapAsync()` internally that waits for the previous\n // commands to complete on the GPU.\n const resultData = await downloadData(device, resultBuffer, 0, 4)\n const resultArray = new Uint32Array(resultData)\n const result = resultArray[0]\n\n // According to the spec we could use `device.destroy()` to release\n // all the resources but it doesn't seem to be available at the moment?\n const resources = [argBuffer, inputBuffer, tempBuffer, resultBuffer]\n resources.forEach(r => r.destroy())\n\n return result\n}", "function compareLines(line1, line2){\n if ((line1.x1 == line2.x1) && (line1.y1 == line2.y1) && (line1.x2 == line2.x2) && (line1.y2 == line2.y2)){\n return true;\n }\n else{\n return false;\n }\n}", "updateLines(lines) {\n const webgl = this.webgl;\n lines.forEach((line) => {\n if (line.visible) {\n webgl.useProgram(this.progThinLine);\n const uscale = webgl.getUniformLocation(this.progThinLine, \"uscale\");\n webgl.uniformMatrix2fv(uscale, false, new Float32Array([\n line.scaleX * this.gScaleX,\n 0,\n 0,\n line.scaleY * this.gScaleY * this.gXYratio,\n ]));\n const uoffset = webgl.getUniformLocation(this.progThinLine, \"uoffset\");\n webgl.uniform2fv(uoffset, new Float32Array([line.offsetX + this.gOffsetX, line.offsetY + this.gOffsetY]));\n const uColor = webgl.getUniformLocation(this.progThinLine, \"uColor\");\n webgl.uniform4fv(uColor, [line.color.r, line.color.g, line.color.b, line.color.a]);\n webgl.bufferData(webgl.ARRAY_BUFFER, line.xy, webgl.STREAM_DRAW);\n webgl.drawArrays(line.loop ? webgl.LINE_LOOP : webgl.LINE_STRIP, 0, line.webglNumPoints);\n }\n });\n }", "function checkLines() {\n for (var y = 0; y < dimention[1]; y++) {\n var lineComplete = field[y].every(function(cell, x) {\n return field[y][x] === field[y][(x + 1) % dimention[0]];\n });\n // ..and if so, blow the line up\n if (lineComplete) {\n if (debug) { Render.drawState(field); debugger; }\n for (var x = 0; x < dimention[0]; x++) {\n field[y][x] = Render.isNeutral(x, y) ? 0 : -field[y][x];\n }\n if (debug) { Render.drawState(field); debugger; }\n // ..and make all top blocks fall\n if (dir === 1) { // ..down\n for (var row = y - 1; row >= 0; row--) {\n moveLineDown(row);\n }\n } else { // ..up\n for (var row = y + 1; row < dimention[1]; row++) {\n moveLineDown(row);\n }\n }\n if (debug) { Render.drawState(field); debugger; }\n }\n }\n }", "function checkToLines(){\n\n\tvar stackFromHorizontal = [];\n\tvar stackFromVertical\t= [];\n\tvar temp = null;\n\n\tfor(var i = 0; i < rn.globalVars.GRID_WIDTH; i++)\n\t\tfor(var j = 0; j < rn.globalVars.GRID_HEIGHT; j++){\n\t\t\n\t\t\t// We need check first horizontal and than vertical or this is will be NULL\n\t\t\tif(Globals.game.aGame[i][j] != null){\n\t\t\t\ttemp = checkHorizontal(i, j, Globals.game.aGame[i][j].type);\n\t\t\t\tif(temp != null)\n\t\t\t\t\tstackFromHorizontal.push(temp);\n\t\t\t}\n\t\t\t\n\t\t\tif(Globals.game.aGame[i][j] != null){\n\t\t\t\ttemp = checkVertical(i, j, Globals.game.aGame[i][j].type);\n\t\t\t\tif(temp != null)\n\t\t\t\t\tstackFromVertical.push(temp);\n\t\t\t}\t\t\t\t\t\n\t\t}\n\t\t\n\t\tdeleteSelectedTiles(stackFromHorizontal, stackFromVertical);\n\t\t\t\t\n\t\tif(stackFromHorizontal.length >= 3 || stackFromVertical.length >= 3)\n\t\t\trn.callFunction(\"wow\");\n\t\t\n\t\t\n\t\tif(stackFromHorizontal.length != 0 || stackFromVertical.length !=0){\n\t\t\tupdatePositions();\n\t\t\treturn true;\t\n\t\t}\n\t\telse rn.callFunction(\"updateGameState\", \"play\");\t\t\t\n}", "function vs() {\n return \"\\n uniform mat4 uModelMatrix;\\n uniform mat4 uViewMatrix;\\n uniform mat4 uProjMatrix;\\n\\n attribute vec3 aPos;\\n attribute vec2 aTexCoord;\\n attribute vec4 aColor;\\n\\n varying vec4 vColor;\\n varying vec2 vTexCoord;\\n\\n void main(void) {\\n gl_Position = uProjMatrix * uViewMatrix * ( uModelMatrix * vec4( aPos, 1.0 ) );\\n vTexCoord = aTexCoord;\\n vColor = vec4(aColor.rgb, 1.0);\\n }\\n\";\n}", "function generateGlsl (transforms, shaderParams) {\n\n // transform function that outputs a shader string corresponding to gl_FragColor\n var fragColor = () => ''\n // var uniforms = []\n // var glslFunctions = []\n transforms.forEach((transform) => {\n var inputs = formatArguments(transform, shaderParams.uniforms.length)\n // console.log('inputs', inputs, transform)\n inputs.forEach((input) => {\n if(input.isUniform) shaderParams.uniforms.push(input)\n })\n\n // add new glsl function to running list of functions\n if(!contains(transform, shaderParams.glslFunctions)) shaderParams.glslFunctions.push(transform)\n\n // current function for generating frag color shader code\n var f0 = fragColor\n if (transform.transform.type === 'src') {\n fragColor = (uv) => `${shaderString(uv, transform.name, inputs, shaderParams)}`\n } else if (transform.transform.type === 'coord') {\n fragColor = (uv) => `${f0(`${shaderString(uv, transform.name, inputs, shaderParams)}`)}`\n } else if (transform.transform.type === 'color') {\n fragColor = (uv) => `${shaderString(`${f0(uv)}`, transform.name, inputs, shaderParams)}`\n } else if (transform.transform.type === 'combine') {\n // combining two generated shader strings (i.e. for blend, mult, add funtions)\n var f1 = inputs[0].value && inputs[0].value.transforms ?\n (uv) => `${generateGlsl(inputs[0].value.transforms, shaderParams)(uv)}` :\n (inputs[0].isUniform ? () => inputs[0].name : () => inputs[0].value)\n fragColor = (uv) => `${shaderString(`${f0(uv)}, ${f1(uv)}`, transform.name, inputs.slice(1), shaderParams)}`\n } else if (transform.transform.type === 'combineCoord') {\n // combining two generated shader strings (i.e. for modulate functions)\n var f1 = inputs[0].value && inputs[0].value.transforms ?\n (uv) => `${generateGlsl(inputs[0].value.transforms, shaderParams)(uv)}` :\n (inputs[0].isUniform ? () => inputs[0].name : () => inputs[0].value)\n fragColor = (uv) => `${f0(`${shaderString(`${uv}, ${f1(uv)}`, transform.name, inputs.slice(1), shaderParams)}`)}`\n\n\n }\n })\n// console.log(fragColor)\n // break;\n return fragColor\n}", "function setupShaders() {\r\n \r\n // define fragment shader in essl using es6 template strings\r\n var fShaderCode = `\r\n precision mediump float;\r\n varying vec4 v_Color;\r\n void main(void) {\r\n gl_FragColor = v_Color; // all fragments are white\r\n }\r\n `;\r\n \r\n // define vertex shader in essl using es6 template strings\r\n var vShaderCode = `\r\n attribute vec3 vertexPosition;\r\n attribute vec3 diffuse;\r\n attribute vec3 ambient;\r\n attribute vec3 specular;\r\n varying vec4 v_Color;\r\n uniform mat4 uModelMatrix; // the model matrix\r\n uniform mat4 view; // the view matrix\r\n uniform mat4 projection;\r\n uniform mat4 modelMatrix;\r\n uniform mat4 viewMatrix;\r\n // Apply lighting effect\r\n attribute highp vec3 Norm;\r\n attribute highp vec3 Half;\r\n attribute highp vec3 Light;\r\n attribute highp float n;\r\n\r\n void main(void) {\r\n // position \r\n gl_Position = projection * view * uModelMatrix * vec4(vertexPosition, 1.0);\r\n //color\r\n float NdotL = dot(normalize(vec3(view * uModelMatrix * vec4(Norm, 0.0))), normalize(vec3(view * uModelMatrix * vec4(Light, 0.0))));\r\n float NdotH = dot(normalize(vec3(view * uModelMatrix * vec4(Norm, 0.0))), normalize(vec3(view * uModelMatrix * vec4(Half, 0.0))));\r\n float maxNdotL = max(NdotL, 0.0);\r\n float maxNdotH = max(NdotH, 0.0);\r\n v_Color = vec4(ambient, 1.0) + vec4(diffuse * maxNdotL, 1.0) + vec4(specular * pow(maxNdotH, n), 1.0);\r\n \r\n }\r\n `;\r\n \r\n try {\r\n // console.log(\"fragment shader: \"+fShaderCode);\r\n var fShader = gl.createShader(gl.FRAGMENT_SHADER); // create frag shader\r\n gl.shaderSource(fShader,fShaderCode); // attach code to shader\r\n gl.compileShader(fShader); // compile the code for gpu execution\r\n\r\n // console.log(\"vertex shader: \"+vShaderCode);\r\n var vShader = gl.createShader(gl.VERTEX_SHADER); // create vertex shader\r\n gl.shaderSource(vShader,vShaderCode); // attach code to shader\r\n gl.compileShader(vShader); // compile the code for gpu execution\r\n \r\n if (!gl.getShaderParameter(fShader, gl.COMPILE_STATUS)) { // bad frag shader compile\r\n throw \"error during fragment shader compile: \" + gl.getShaderInfoLog(fShader); \r\n gl.deleteShader(fShader);\r\n } else if (!gl.getShaderParameter(vShader, gl.COMPILE_STATUS)) { // bad vertex shader compile\r\n throw \"error during vertex shader compile: \" + gl.getShaderInfoLog(vShader); \r\n gl.deleteShader(vShader);\r\n } else { // no compile errors\r\n var shaderProgram = gl.createProgram(); // create the single shader program\r\n gl.attachShader(shaderProgram, fShader); // put frag shader in program\r\n gl.attachShader(shaderProgram, vShader); // put vertex shader in program\r\n gl.linkProgram(shaderProgram); // link program into gl context\r\n\r\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { // bad program link\r\n throw \"error during shader program linking: \" + gl.getProgramInfoLog(shaderProgram);\r\n } else { // no shader program link errors\r\n gl.useProgram(shaderProgram); // activate shader program (frag and vert)\r\n vertexPositionAttrib = // get pointer to vertex shader input\r\n gl.getAttribLocation(shaderProgram, \"vertexPosition\"); \r\n modelMatrixULoc = gl.getUniformLocation(shaderProgram, \"uModelMatrix\"); // ptr to mmat\r\n view = gl.getUniformLocation(shaderProgram, \"view\"); // ptr to mmat\r\n projection = gl.getUniformLocation(shaderProgram, \"projection\"); // ptr to mmat\r\n\r\n gl.enableVertexAttribArray(vertexPositionAttrib); // input to shader from array\r\n //color\r\n diffuse = gl.getAttribLocation(shaderProgram, 'diffuse');\r\n gl.enableVertexAttribArray(diffuse);\r\n ambient = gl.getAttribLocation(shaderProgram, 'ambient');\r\n gl.enableVertexAttribArray(ambient);\r\n specular = gl.getAttribLocation(shaderProgram, 'specular');\r\n gl.enableVertexAttribArray(specular);\r\n\r\n //vectors\r\n Norm = gl.getAttribLocation(shaderProgram, 'Norm');\r\n gl.enableVertexAttribArray(Norm);\r\n Light = gl.getAttribLocation(shaderProgram, 'Light');\r\n gl.enableVertexAttribArray(Light);\r\n Half = gl.getAttribLocation(shaderProgram, 'Half');\r\n gl.enableVertexAttribArray(Half);\r\n n = gl.getAttribLocation(shaderProgram, 'n');\r\n gl.enableVertexAttribArray(n);\r\n } // end if no shader program link errors\r\n } // end if no compile errors\r\n } // end try \r\n \r\n catch(e) {\r\n console.log(e);\r\n } // end catch\r\n} // end setup shaders", "fragment_glsl_code() {\n // ********* FRAGMENT SHADER *********\n return (\n this.shared_glsl_code() +\n `\n varying vec2 f_tex_coord;\n uniform sampler2D texture;\n\n void main()\n { // Sample the texture image in the correct place:\n vec4 tex_color = texture2D( texture, f_tex_coord );\n if( tex_color.w < .01 ) discard;\n // Slightly disturb normals based on sampling the same image that was used for texturing:\n vec3 bumped_N = N + tex_color.rgb - .5*vec3(1,1,1);\n // Compute an initial (ambient) color:\n gl_FragColor = vec4( ( tex_color.xyz + shape_color.xyz ) * ambient, shape_color.w * tex_color.w ); \n // Compute the final color with contributions from lights:\n gl_FragColor.xyz += phong_model_lights( normalize( bumped_N ), vertex_worldspace );\n } `\n );\n }", "vertex_glsl_code() {\n // ********* VERTEX SHADER *********\n return this.shared_glsl_code() + `\n varying vec2 f_tex_coord;\n attribute vec3 position, normal, offset; \n // Position is expressed in object coordinates.\n attribute vec2 texture_coord;\n \n uniform mat4 model_transform;\n uniform mat4 projection_camera_model_transform;\n \n void main(){ \n // The vertex's final resting place (in NDCS):\n vec3 temp = offset;\n temp[1] = mod(temp[1], 5.0);\n gl_Position = projection_camera_model_transform * vec4(position + temp, 1.0 );\n // The final normal vector in screen space.\n N = normalize( mat3( model_transform ) * normal / squared_scale);\n vertex_worldspace = ( model_transform * vec4( position, 1.0 ) ).xyz;\n // Turn the per-vertex texture coordinate into an interpolated variable.\n f_tex_coord = texture_coord;\n } `;\n }", "vertex_glsl_code() {\n // ********* VERTEX SHADER *********\n return this.shared_glsl_code() + `\n varying vec2 f_tex_coord;\n attribute vec3 position, normal, offset; \n // Position is expressed in object coordinates.\n attribute vec2 texture_coord;\n \n uniform mat4 model_transform;\n uniform mat4 projection_camera_model_transform;\n \n void main(){ \n // The vertex's final resting place (in NDCS):\n vec3 temp = offset;\n temp[1] = mod(temp[1], 0.7);\n gl_Position = projection_camera_model_transform * vec4(position + temp, 1.0 );\n // The final normal vector in screen space.\n N = normalize( mat3( model_transform ) * normal / squared_scale);\n vertex_worldspace = ( model_transform * vec4( position, 1.0 ) ).xyz;\n // Turn the per-vertex texture coordinate into an interpolated variable.\n f_tex_coord = texture_coord;\n } `;\n }", "setUniforms(uniformArray){\n let uniformLocationNames = this.vertexShader.getUniformLocationNames().concat(this.fragmentShader.getUniformLocationNames());\n\n let uniforms = [];\n uniforms.push(...uniformArray.getUniversalUniform());\n uniforms.push(...uniformArray.getPerObjectUniform());\n\n for(let name of uniformLocationNames){\n\n if(name.slice(0, name.length - 1) === \"u_sampler\"){\n gl.uniform1i(this.uniformLocations[name + \"Loc\"], name.substr(name.length - 1, 1));\n continue;\n }\n\n let index = this.findIndexUniform(name, uniforms);\n if(index === -1) throw Error(\"Property \" + name + \" not found in uniformArray object\");\n\n if(uniforms[index].getProperty().search(\"1\") != -1){\n gl[\"uniform\" + uniforms[index].getProperty()](this.uniformLocations[name + \"Loc\"], uniforms[index].getValue());\n\n } else if(uniforms[index].getProperty().search(\"2\") != -1) {\n\n let valueArray = uniforms[index].getValue();\n gl[\"uniform\" + uniforms[index].getProperty()](this.uniformLocations[name + \"Loc\"], valueArray[0], valueArray[1]);\n } else if(uniforms[index].getProperty().search(\"3fv\") != -1){\n gl[\"uniform\" + uniforms[index].getProperty()](this.uniformLocations[name + \"Loc\"], false, uniforms[index].getValue());\n\n } else if(uniforms[index].getProperty().search(\"3f\") != -1){\n let valueArray = uniforms[index].getValue();\n gl[\"uniform\" + uniforms[index].getProperty()](this.uniformLocations[name + \"Loc\"], valueArray[0], valueArray[1], valueArray[2]);\n\n } else if(uniforms[index].getProperty().search(\"4fv\") != -1){\n gl[\"uniform\" + uniforms[index].getProperty()](this.uniformLocations[name + \"Loc\"], false, uniforms[index].getValue());\n }\n }\n }", "vertex_glsl_code() {\n // ********* VERTEX SHADER *********\n return this.shared_glsl_code() + `\n varying vec2 f_tex_coord;\n attribute vec3 position, normal, offset; \n // Position is expressed in object coordinates.\n attribute vec2 texture_coord;\n \n uniform mat4 model_transform;\n uniform mat4 projection_camera_model_transform;\n \n void main(){ \n // The vertex's final resting place (in NDCS):\n vec3 temp = offset;\n temp[1] = mod(temp[1], 1.5);\n gl_Position = projection_camera_model_transform * vec4(position + temp, 1.0 );\n // The final normal vector in screen space.\n N = normalize( mat3( model_transform ) * normal / squared_scale);\n vertex_worldspace = ( model_transform * vec4( position, 1.0 ) ).xyz;\n // Turn the per-vertex texture coordinate into an interpolated variable.\n f_tex_coord = texture_coord;\n } `;\n }", "function formatCode( shader ) {\n return shader.split( '\\n' ).map( appendLine ).join( '\\n' );\n}", "function compareByGeneratedPositionsInflated(mappingA,mappingB){var cmp=mappingA.generatedLine-mappingB.generatedLine;if(cmp!==0){return cmp;}cmp=mappingA.generatedColumn-mappingB.generatedColumn;if(cmp!==0){return cmp;}cmp=strcmp(mappingA.source,mappingB.source);if(cmp!==0){return cmp;}cmp=mappingA.originalLine-mappingB.originalLine;if(cmp!==0){return cmp;}cmp=mappingA.originalColumn-mappingB.originalColumn;if(cmp!==0){return cmp;}return strcmp(mappingA.name,mappingB.name);}", "function u$3(u,c){const p=u.vertex.code,v=u.fragment.code;1!==c.output&&3!==c.output||(u.include(r$9,{linearDepth:!0}),u.include(t$b,c),u.include(e$9,c),u.include(e$7,c),u.include(c$6,c),u.vertex.uniforms.add(\"cameraNearFar\",\"vec2\"),u.varyings.add(\"depth\",\"float\"),c.hasColorTexture&&u.fragment.uniforms.add(\"tex\",\"sampler2D\"),p.add(t$i`void main(void) {\nvpos = calculateVPos();\nvpos = subtractOrigin(vpos);\nvpos = addVerticalOffset(vpos, localOrigin);\ngl_Position = transformPositionWithDepth(proj, view, vpos, cameraNearFar, depth);\nforwardTextureCoordinates();\n}`),u.include(r$h,c),v.add(t$i`\n void main(void) {\n discardBySlice(vpos);\n ${c.hasColorTexture?t$i`\n vec4 texColor = texture2D(tex, vuv0);\n discardOrAdjustAlpha(texColor);`:\"\"}\n outputDepth(depth);\n }\n `)),2===c.output&&(u.include(r$9,{linearDepth:!1}),u.include(o$8,c),u.include(l$5,c),u.include(t$b,c),u.include(e$9,c),c.hasColorTexture&&u.fragment.uniforms.add(\"tex\",\"sampler2D\"),u.vertex.uniforms.add(\"viewNormal\",\"mat4\"),u.varyings.add(\"vPositionView\",\"vec3\"),p.add(t$i`\n void main(void) {\n vpos = calculateVPos();\n vpos = subtractOrigin(vpos);\n ${0===c.normalType?t$i`\n vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:\"\"}\n vpos = addVerticalOffset(vpos, localOrigin);\n gl_Position = transformPosition(proj, view, vpos);\n forwardTextureCoordinates();\n }\n `),u.include(c$6,c),u.include(r$h,c),v.add(t$i`\n void main() {\n discardBySlice(vpos);\n ${c.hasColorTexture?t$i`\n vec4 texColor = texture2D(tex, vuv0);\n discardOrAdjustAlpha(texColor);`:\"\"}\n\n ${3===c.normalType?t$i`\n vec3 normal = screenDerivativeNormal(vPositionView);`:t$i`\n vec3 normal = normalize(vNormalWorld);\n if (gl_FrontFacing == false) normal = -normal;`}\n gl_FragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);\n }\n `)),4===c.output&&(u.include(r$9,{linearDepth:!1}),u.include(t$b,c),u.include(e$9,c),c.hasColorTexture&&u.fragment.uniforms.add(\"tex\",\"sampler2D\"),p.add(t$i`void main(void) {\nvpos = calculateVPos();\nvpos = subtractOrigin(vpos);\nvpos = addVerticalOffset(vpos, localOrigin);\ngl_Position = transformPosition(proj, view, vpos);\nforwardTextureCoordinates();\n}`),u.include(c$6,c),u.include(r$h,c),u.include(r$e),v.add(t$i`\n void main() {\n discardBySlice(vpos);\n ${c.hasColorTexture?t$i`\n vec4 texColor = texture2D(tex, vuv0);\n discardOrAdjustAlpha(texColor);`:\"\"}\n outputHighlight();\n }\n `));}", "function updateBuffers3(){\n //everytime i+3 means change the y coordinate for the top butters, here i starts form 1!\n for(var i = 1; i < 16; i=i+3){\n if (i==13) {continue;};\n triangleVerticestop[i] = triangleVerticestop[i] - 0.03*Math.sin(2*Math.PI*((framecount)/ 20.0));\n }\n //the repeat vertex, should be the same pace with the bottom\n triangleVerticestop[13] = triangleVerticestop[13] + 0.03*Math.sin(2*Math.PI*((framecount)/ 20.0));\n \n \n for(var i = 16; i < triangleVerticestop.length; i=i+3){\n triangleVerticestop[i] = triangleVerticestop[i] - 0.03*Math.sin(2*Math.PI*((framecount)/ 20.0));\n }\n \n //everytime i+3 means change the y coordinate for the bommon butters, here i starts form 1!\n for(var i = 1; i < 16; i=i+3){\n if (i==13) {continue};\n triangleVerticesmid[i] = triangleVerticesmid[i] + 0.03*Math.sin(2*Math.PI*((framecount)/ 20.0));\n }\n\n //the repeat vertex, should be the same pace with the top fan \n triangleVerticesmid[13] = triangleVerticesmid[13] -0.03*Math.sin(2*Math.PI*((framecount)/ 20.0)); \n \n for(var i = 16; i < triangleVerticestop.length; i=i+3){\n triangleVerticesmid[i] = triangleVerticesmid[i] + 0.03*Math.sin(2*Math.PI*((framecount)/ 20.0));\n }\n //update the top buffers new positions\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffertop);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVerticestop), gl.DYNAMIC_DRAW);\n vertexPositionBuffertop.itemSize = 3;\n vertexPositionBuffertop.numberOfItems = 8;\n //update the bottom buffers new positions \n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffermid);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVerticesmid), gl.DYNAMIC_DRAW);\n vertexPositionBuffermid.itemSize = 3;\n vertexPositionBuffermid.numberOfItems = 8;\n\n\n}", "fragment_glsl_code() {\n return this.shared_glsl_code() + `\n varying vec2 f_tex_coord;\n uniform sampler2D texture;\n uniform float animation_time;\n \n void main(){\n // Sample the texture image in the correct place:\n vec2 current_coord = f_tex_coord + 0.1 * animation_time;\n // vec2 current_coord = f_tex_coord - 2.5 * animation_time;\n vec4 tex_color = texture2D( texture, current_coord );\n if( tex_color.w < .01 ) discard;\n // Compute an initial (ambient) color:\n gl_FragColor = vec4( ( tex_color.xyz + shape_color.xyz ) * ambient, shape_color.w * tex_color.w ); \n // Compute the final color with contributions from lights:\n gl_FragColor.xyz += phong_model_lights( normalize( N ), vertex_worldspace );\n } `;\n }", "generate({ width, height, uSpan, vSpan, isUVRepeat = false, flipTextureCoordinateY = false, material }) {\n var positions = [];\n for (let i = 0; i <= vSpan; i++) {\n for (let j = 0; j <= uSpan; j++) {\n positions.push((j / uSpan - 1 / 2) * width);\n positions.push(0);\n positions.push((i / vSpan - 1 / 2) * height);\n }\n }\n var indices = [];\n for (let i = 0; i < vSpan; i++) {\n let degenerate_left_index = 0;\n let degenerate_right_index = 0;\n for (let j = 0; j <= uSpan; j++) {\n indices.push(i * (uSpan + 1) + j);\n indices.push((i + 1) * (uSpan + 1) + j);\n if (j === 0) {\n degenerate_left_index = (i + 1) * (uSpan + 1) + j;\n }\n else if (j === uSpan) {\n degenerate_right_index = (i + 1) * (uSpan + 1) + j;\n }\n }\n indices.push(degenerate_right_index);\n indices.push(degenerate_left_index);\n }\n var normals = [];\n for (let i = 0; i <= vSpan; i++) {\n for (let j = 0; j <= uSpan; j++) {\n normals.push(0);\n normals.push(1);\n normals.push(0);\n }\n }\n var texcoords = [];\n for (let i = 0; i <= vSpan; i++) {\n const i_ = flipTextureCoordinateY ? i : vSpan - i;\n for (let j = 0; j <= uSpan; j++) {\n if (isUVRepeat) {\n texcoords.push(j);\n texcoords.push(i_);\n }\n else {\n texcoords.push(j / uSpan);\n texcoords.push(i_ / vSpan);\n }\n }\n }\n // Check Size\n const attributeCompositionTypes = [_definitions_CompositionType__WEBPACK_IMPORTED_MODULE_1__[\"CompositionType\"].Vec3, _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_1__[\"CompositionType\"].Vec3, _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_1__[\"CompositionType\"].Vec2];\n const attributeSemantics = [_definitions_VertexAttribute__WEBPACK_IMPORTED_MODULE_2__[\"VertexAttribute\"].Position, _definitions_VertexAttribute__WEBPACK_IMPORTED_MODULE_2__[\"VertexAttribute\"].Normal, _definitions_VertexAttribute__WEBPACK_IMPORTED_MODULE_2__[\"VertexAttribute\"].Texcoord0];\n const primitiveMode = _definitions_PrimitiveMode__WEBPACK_IMPORTED_MODULE_3__[\"PrimitiveMode\"].TriangleStrip;\n const attributes = [new Float32Array(positions), new Float32Array(normals), new Float32Array(texcoords)];\n let sumOfAttributesByteSize = 0;\n attributes.forEach(attribute => {\n sumOfAttributesByteSize += attribute.byteLength;\n });\n const indexSizeInByte = indices.length * 2;\n // Create Buffer\n const buffer = _core_MemoryManager__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getInstance().createBufferOnDemand(indexSizeInByte + sumOfAttributesByteSize, this);\n // Index Buffer\n const indicesBufferView = buffer.takeBufferView({ byteLengthToNeed: indexSizeInByte /*byte*/, byteStride: 0, isAoS: false });\n const indicesAccessor = indicesBufferView.takeAccessor({\n compositionType: _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_1__[\"CompositionType\"].Scalar,\n componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_5__[\"ComponentType\"].UnsignedShort,\n count: indices.length\n });\n for (let i = 0; i < indices.length; i++) {\n indicesAccessor.setScalar(i, indices[i], {});\n }\n // VertexBuffer\n const attributesBufferView = buffer.takeBufferView({ byteLengthToNeed: sumOfAttributesByteSize, byteStride: 0, isAoS: false });\n const attributeAccessors = [];\n const attributeComponentTypes = [];\n attributes.forEach((attribute, i) => {\n attributeComponentTypes[i] = _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_5__[\"ComponentType\"].fromTypedArray(attributes[i]);\n const accessor = attributesBufferView.takeAccessor({\n compositionType: attributeCompositionTypes[i],\n componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_5__[\"ComponentType\"].fromTypedArray(attributes[i]),\n count: attribute.byteLength / attributeCompositionTypes[i].getNumberOfComponents() / attributeComponentTypes[i].getSizeInBytes()\n });\n accessor.copyFromTypedArray(attribute);\n attributeAccessors.push(accessor);\n });\n const attributeMap = new Map();\n for (let i = 0; i < attributeSemantics.length; i++) {\n attributeMap.set(attributeSemantics[i], attributeAccessors[i]);\n }\n this.setData(attributeMap, primitiveMode, material, indicesAccessor);\n }", "get additionalVertexShader() {\n return `\n void paintgl_additional() {\n }\n `;\n }", "function fs() {\n return \"\\n precision highp float;\\n uniform sampler2D uSampler;\\n varying vec4 vColor;\\n varying vec2 vTexCoord;\\n void main(void) {\\n vec4 color = texture2D( uSampler, vec2( vTexCoord.s, vTexCoord.t ) ) * vec4( vColor.rgb, 1.0 );\\n \\tif ( color.a < 0.1 ) discard;\\n \\tgl_FragColor = vec4( color.rgb, vColor.a );\\n }\\n\";\n}", "function setupShaders() {\n \n // define vertex shader in essl using es6 template strings\n var vShaderCode = `\n attribute vec3 aVertexPosition; // vertex position\n uniform mat4 upvmMatrix; // the project view model matrix\n\n void main(void) {\n \n // vertex position\n gl_Position = upvmMatrix * vec4(aVertexPosition, 1.0);\n }\n `;\n \n // define fragment shader in essl using es6 template strings\n var fShaderCode = `\n precision mediump float; // set float to medium precision\n \n // material properties\n uniform vec3 uDiffuse; // the diffuse reflectivity\n \n void main(void) {\n gl_FragColor = vec4(uDiffuse, 1.0); \n }\n `;\n \n try {\n var fShader = gl.createShader(gl.FRAGMENT_SHADER); // create frag shader\n gl.shaderSource(fShader,fShaderCode); // attach code to shader\n gl.compileShader(fShader); // compile the code for gpu execution\n\n var vShader = gl.createShader(gl.VERTEX_SHADER); // create vertex shader\n gl.shaderSource(vShader,vShaderCode); // attach code to shader\n gl.compileShader(vShader); // compile the code for gpu execution\n \n if (!gl.getShaderParameter(fShader, gl.COMPILE_STATUS)) { // bad frag shader compile\n throw \"error during fragment shader compile: \" + gl.getShaderInfoLog(fShader); \n gl.deleteShader(fShader);\n } else if (!gl.getShaderParameter(vShader, gl.COMPILE_STATUS)) { // bad vertex shader compile\n throw \"error during vertex shader compile: \" + gl.getShaderInfoLog(vShader); \n gl.deleteShader(vShader);\n } else { // no compile errors\n var shaderProgram = gl.createProgram(); // create the single shader program\n gl.attachShader(shaderProgram, fShader); // put frag shader in program\n gl.attachShader(shaderProgram, vShader); // put vertex shader in program\n gl.linkProgram(shaderProgram); // link program into gl context\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { // bad program link\n throw \"error during shader program linking: \" + gl.getProgramInfoLog(shaderProgram);\n } else { // no shader program link errors\n gl.useProgram(shaderProgram); // activate shader program (frag and vert)\n \n // locate and enable vertex attributes\n vPosAttribLoc = gl.getAttribLocation(shaderProgram, \"aVertexPosition\"); // ptr to vertex pos attrib\n gl.enableVertexAttribArray(vPosAttribLoc); // connect attrib to array\n \n // locate vertex uniforms\n pvmMatrixULoc = gl.getUniformLocation(shaderProgram, \"upvmMatrix\"); // ptr to pvmmat\n \n // locate fragment uniforms\n colorULoc = gl.getUniformLocation(shaderProgram, \"uDiffuse\"); // ptr to diffuse\n\n } // end if no shader program link errors\n } // end if no compile errors\n } // end try \n \n catch(e) {\n console.log(e);\n } // end catch\n} // end setup shaders", "function loadTriangles(inputTriangles) {\n if (inputTriangles != String.null) { \n triBufferSize = 0;\n var whichSetVert; // index of vertex in current triangle set\n var whichSetTri; // index of triangle in current triangle set\n var coordArray = []; // 1D array of vertex coords for WebGL\n var colorArray = [];\n var colToAdd = vec3.create() //color to push to col array parametric calculation\n var indexArray = []; // 1D array for indeces\n var vtxBufferSize = 0; // number of vertices in the vertex buffer\n var vtxToAdd =[] // vtx coords to add to the coord array\n var indexOffset = vec3.create(); //the index offset in the current set\n var triToAdd = vec3.create()\n\n \n // loop over sets\n for (var whichSet=0; whichSet<inputTriangles.length; whichSet++) {\n // keep track of offset\n vec3.set(indexOffset, vtxBufferSize, vtxBufferSize, vtxBufferSize);\n // set up the vertex coord array\n for (whichSetVert=0; whichSetVert<inputTriangles[whichSet].vertices.length; whichSetVert++){\n vtxToAdd = inputTriangles[whichSet].vertices[whichSetVert];\n coordArray.push(vtxToAdd[0], vtxToAdd[1], vtxToAdd[2]);\n //coordArray = coordArray.concat(inputTriangles[whichSet].vertices[whichSetVert]);\n // console.log(inputTriangles[whichSet].vertices[whichSetVert]);\n var Ld = inputTriangles[whichSet].material.diffuse;\n colorArray.push(Ld[0], Ld[1], Ld[2]);\n }\n // add element to color array\n var La = inputTriangles[whichSet].material.ambient;\n var Ld = inputTriangles[whichSet].material.diffuse;\n var Ls = inputTriangles[whichSet].material.specular;\n var n = inputTriangles[whichSet].material.n;\n\n var BA = vec3.create(); \n var CA = vec3.create(); \n var N = vec3.create(); \n \n var V0 = vec3.fromValues(coordArray[whichSet], coordArray[whichSet+1], coordArray[whichSet+2]);\n var V1 = vec3.fromValues(coordArray[whichSet+3], coordArray[whichSet+4], coordArray[whichSet+5]);\n var V2 = vec3.fromValues(coordArray[whichSet+6], coordArray[whichSet+7], coordArray[whichSet+8]);\n \n //console.log(V0);\n vec3.sub(BA, coordArray[0], vtxToAdd[0]);\n vec3.sub(CA, vtxToAdd[2], vtxToAdd[0]);\n\n vec3.cross(N, BA, CA);\n\n var L = vec3.fromValues(-3, 1, 0.5);\n var L_norm = vec3.create();\n vec3.normalize(L_norm, L);\n\n var V = vec3.fromValues(0, 0, 1);\n \n var H = vec3.create();\n var H_norm = vec3.create();\n vec3.add(H, L, V);\n vec3.normalize(H_norm ,H);\n\n var NxL = vec3.dot(N, L_norm);\n var NxH = vec3.dot(N, H_norm);\n\n var KLa = vec3.create();\n vec3.scale(KLa, La, 0.2);\n\n var KLd = vec3.create();\n var LdxNxL = vec3.create();\n vec3.scale(LdxNxL, KLd, NxL);\n vec3.scale(KLd, LdxNxL, 0.6);\n\n var KLs = vec3.create();\n var LsxNxH = vec3.create();\n vec3.scale(LsxNxH, KLs, NxH);\n vec3.scale(KLs, LsxNxH, 0.2);\n\n var add1 = vec3.create();\n //var add2 = vec3.create();\n vec3.add(add1, KLa, KLd);\n vec3.add(colToAdd, add1, KLs); \n\n //colToAdd = KLa+ KLd + KLs;//change it up\n //console.log(colToAdd);\n //colorArray.push(colToAdd[0] ,colToAdd[1], colToAdd[2]);\n //colorArray.push(colToAdd[0] ,colToAdd[1], colToAdd[2]);\n //colorArray.push(colToAdd[0] ,colToAdd[1], colToAdd[2]);\n \n // set up triangle index array adjusting offset\n for (whichSetTri=0; whichSetTri<inputTriangles[whichSet].triangles.length; whichSetTri++) {\n vec3.add(triToAdd, indexOffset, inputTriangles[whichSet].triangles[whichSetTri]);\n indexArray.push(triToAdd[0], triToAdd[1], triToAdd[2]);\n }\n\n // loop over inputTriangles[whichSet].triangles\n vtxBufferSize += inputTriangles[whichSet].vertices.length;\n triBufferSize += inputTriangles[whichSet].triangles.length;\n // keep track of vertex and traingle buffer sizes\n\n } // end for each triangle set \n triBufferSize *= 3;\n // console.log(coordArray.length);\n\n // send the vertex coords to webGL\n vertexBuffer = gl.createBuffer(); // init empty vertex coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(coordArray),gl.STATIC_DRAW); // coords to that buffer\n \n // send color indeces to webGL\n colorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(colorArray),gl.STATIC_DRAW); // coords to that buffer\n\n // send triangle indeces to webGL\n triangleBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffer); // activate that buffer\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indexArray), gl.STATIC_DRAW); // coords to that buffer\n\n\n } // end if triangles found\n} // end load triangles", "fragment_glsl_code() {\n return this.shared_glsl_code() + `\n varying vec2 f_tex_coord;\n uniform sampler2D texture;\n uniform float animation_time;\n void main(){\n // Sample the texture image in the correct place:\n vec2 current_coord = f_tex_coord - vec2(0.5, 0.5);\n float PI = 3.1415926;\n float angle = -PI * animation_time / 60.0;\n // float angle = 10.0 * PI * animation_time / 60.0;\n mat2 rotation = mat2(cos(angle), -sin(angle), sin(angle), cos(angle)); \n current_coord = rotation * current_coord;\n current_coord = current_coord + vec2(0.5, 0.5);\n vec4 tex_color = texture2D( texture, current_coord );\n if( tex_color.w < .01 ) discard;\n // Compute an initial (ambient) color:\n gl_FragColor = vec4( ( tex_color.xyz + shape_color.xyz ) * ambient, shape_color.w * tex_color.w ); \n // Compute the final color with contributions from lights:\n gl_FragColor.xyz += phong_model_lights( normalize( N ), vertex_worldspace );\n } `;\n }", "function createShader(gl, type, source, name) {\n let shader = gl.createShader(type);\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n let success = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if (success) {\n return shader;\n }\n console.error(\"compile error in shader \" + name);\n const log = gl.getShaderInfoLog(shader)\n const loglines = log.split(/\\r\\n|\\n/);\n const sourcelines = source.split(/\\r\\n|\\n/);\n loglines.forEach((line => {\n // parse out the line & column?\n //0(846) : warning C7022: unrecognized profile specifier \"...\"\n //0(846) : error C0502: syntax error at token \"...\"\n console.error(line)\n const matches = line.match(/\\d+\\((\\d+)\\)/)\n if (matches && matches.length > 1) {\n const sourceline = matches[1]-1\n const from = Math.max(0, sourceline-1)\n const to = Math.min(sourcelines.length-1, sourceline+1)\n for (i=from; i<=to; i++) console.error(i==sourceline?\"-->\":\" \", sourcelines[i])\n }\n }))\n gl.deleteShader(shader);\n return undefined;\n}", "function handleLoadedWorld(data, index) {\r\n var lines = data.split(\"\\n\");\r\n var vertexCount = 0;\r\n var vertexPositions = [];\r\n var vertexTextureCoords = [];\r\n for (var i in lines) {\r\n var vals = lines[i].replace(/^\\s+/, \"\").split(/\\s+/);\r\n if (vals.length == 5 && vals[0] != \"//\") {\r\n // It is a line describing a vertex; get X, Y and Z first\r\n vertexPositions.push(parseFloat(vals[0]));\r\n vertexPositions.push(parseFloat(vals[1]));\r\n vertexPositions.push(parseFloat(vals[2]));\r\n\r\n // And then the texture coords\r\n vertexTextureCoords.push(parseFloat(vals[3]));\r\n vertexTextureCoords.push(parseFloat(vals[4]));\r\n\r\n vertexCount += 1;\r\n }\r\n }\r\n\r\n vertexPositionBuffers[index] = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffers[index]);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexPositions), gl.STATIC_DRAW);\r\n vertexPositionBuffers[index].itemSize = 3;\r\n vertexPositionBuffers[index].numItems = vertexCount;\r\n\r\n vertexTextureCoordBuffers[index] = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexTextureCoordBuffers[index]);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexTextureCoords), gl.STATIC_DRAW);\r\n vertexTextureCoordBuffers[index].itemSize = 2;\r\n vertexTextureCoordBuffers[index].numItems = vertexCount;\r\n\r\n document.getElementById(\"loadingtext\").textContent = \"\";\r\n}", "function loadTriangles() {\n var inputTriangles = getJSONFile(INPUT_TRIANGLES_URL,\"triangles\"); console.log(inputTriangles);\n\n if (inputTriangles != String.null) { \n var whichSetVert; // index of vertex in current triangle set\n var whichSetTri; // index of triangle in current triangle set\n var coordArray = []; // 1D array of vertex coords for WebGL\n var indexArray = []; // 1D array of vertex indices for WebGL\n var diffColorArray = []; //1D array of colors for WebGL\n var vtxBufferSize = 0; // the number of vertices in the vertex buffer\n var vtxToAdd = []; // vtx coords to add to the coord array\n var indexOffset = vec3.create(); // the index offset for the current set\n var triToAdd = vec3.create(); // tri indices to add to the index array\n \n for (var whichSet=0; whichSet<inputTriangles.length; whichSet++) {\n vec3.set(indexOffset,vtxBufferSize,vtxBufferSize,vtxBufferSize); // update vertex offset\n console.log(\"indexOffset:: \"+indexOffset);\n var colorToAdd = inputTriangles[whichSet].material.diffuse;\n // set up the vertex coord array\n for (whichSetVert=0; whichSetVert<inputTriangles[whichSet].vertices.length; whichSetVert++) {\n vtxToAdd = inputTriangles[whichSet].vertices[whichSetVert];\n coordArray.push(vtxToAdd[0],vtxToAdd[1],vtxToAdd[2]); \n diffColorArray.push(colorToAdd[0], colorToAdd[1], colorToAdd[2]);\t\n } // end for vertices in set\n //console.log(coordArray);\n // set up the triangle index array, adjusting indices across sets\n for (whichSetTri=0; whichSetTri<inputTriangles[whichSet].triangles.length; whichSetTri++) {\n vec3.add(triToAdd,indexOffset,inputTriangles[whichSet].triangles[whichSetTri]); console.log(\"triToAdd:: \"+triToAdd); \n indexArray.push(triToAdd[0],triToAdd[1],triToAdd[2]); console.log(\"indexArray:: \"+indexArray);\n } // end for triangles in set\n //console.log(indexArray);\n vtxBufferSize += inputTriangles[whichSet].vertices.length; // total number of vertices\n console.log(\"vtxBufferSize:: \"+vtxBufferSize);\n triBufferSize += inputTriangles[whichSet].triangles.length; // total number of tris\n console.log(\"triBufferSize:: \"+triBufferSize);\n\n //get diffused colors\n } // end for each triangle set \n triBufferSize *= 3; // now total number of indices\n console.log(\"triBufferSize:: \"+triBufferSize);\n //console.log('diffColorArray:: '+diffColorArray.length);\n //console.log(\"coordinates: \"+coordArray.length);\n // console.log(\"numverts: \"+vtxBufferSize);\n // console.log(\"indices: \"+indexArray.toString());\n // console.log(\"numindices: \"+triBufferSize);\n \n // send the vertex coords to webGL\n vertexBuffer = gl.createBuffer(); // init empty vertex coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(coordArray),gl.STATIC_DRAW); // coords to that buffer\n console.log(coordArray);\n //send the diffuse colors to WebGL\n colorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER,colorBuffer);\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(diffColorArray),gl.STATIC_DRAW);\n \n // send the triangle indices to webGL\n triangleBuffer = gl.createBuffer(); // init empty triangle index buffer\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffer); // activate that buffer\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,new Uint16Array(indexArray),gl.STATIC_DRAW); // indices to that buffer\n\n \n\n } // end if triangles found\n} // end load triangles", "function triangleCheck(lineA, lineB , lineC) {\n if (((lineA < lineB + lineC)&&(lineA > Math.abs(lineB - lineC)))||((lineB < lineA + lineC)&&(lineB > Math.abs(lineA - lineC)))||((lineC < lineB + lineC)&&(lineC > Math.abs(lineB - lineA)))){\n return true;\n }\n return false;\n}", "function checkLine () {\r\n let lineCount = 0;\r\n\r\n for ( let y = 0; y < FIELD_ROW; y++ ) {\r\n //Variable to see if a line is completed\r\n let isCompleted = true;\r\n\r\n //Check the completion\r\n for ( let x = 0; x < FIELD_COLUMN; x++ ) {\r\n //If NO block is found, it means the line is not completed yet\r\n if ( !field[y][x] ) {\r\n isCompleted = false;\r\n break;\r\n }\r\n }\r\n\r\n //Clear a completed line\r\n if ( isCompleted ) {\r\n lineCount++;\r\n\r\n for ( let newY = y; 0 < newY; newY-- ) {\r\n for ( let newX = 0; newX < FIELD_COLUMN; newX++ ) {\r\n //A new line will be updated as the upper line\r\n field[ newY ][ newX ] = field[ newY-1 ][ newX ];\r\n }\r\n }\r\n }\r\n }\r\n}", "function checkLine() {\n for (var y = yGridAmount - 1; y > 0; y--) {\n var rowCheck = [];\n for (var x = 0; x < xGridAmount; x++) {\n if (gridCellOccupied[x][y] == true) {\n rowCheck.push(x);\n }\n }\n if (rowCheck.length == xGridAmount) {\n lineDeletion(y);\n evaluateMove(\"line\");\n lineCounter++;\n LevelSystem();\n }\n }\n}", "function vertexShaderOther()\n{\n return [\"varying vec3 color;\",\n \"varying vec2 uvCoordinates;\",\n \"uniform mat4 customPointMatrix;\",\n \"uniform mat4 customNormalMatrix;\",\n \"uniform vec3 customColor;\",\n \"void main() {\",\n \"uvCoordinates = uv;\",\n \"vec4 wsPos = customPointMatrix * vec4(position, 1.0);\",\n \"vec3 wsNorm = \",\n \"(customNormalMatrix * vec4(normal, 0.0)).xyz;\",\n \"gl_Position = projectionMatrix * modelViewMatrix * wsPos;\",\n \"float diffDot = \",\n \"dot(normalize(wsNorm), -normalize(wsPos.xyz));\",\n \"color = vec3(0.15, 0.15, 0.3) * customColor;\",\n \"color += clamp(diffDot, 0.0, 1.0) * customColor;\",\n \"}\"].join(\"\\n\");\n}", "function createProgram(gl, vertexShaderID, fragmentShaderID) {\n function getTextContent( elementID ) {\n // This nested function retrieves the text content of an\n // element on the web page. It is used here to get the shader\n // source code from the script elements that contain it.\n var element = document.getElementById(elementID);\n var node = element.firstChild;\n var str = \"\";\n while (node) {\n if (node.nodeType == 3) // this is a text node\n str += node.textContent;\n node = node.nextSibling;\n }\n return str;\n }\n try {\n var vertexShaderSource = getTextContent( vertexShaderID );\n var fragmentShaderSource = getTextContent( fragmentShaderID );\n }\n catch (e) {\n throw \"Error: Could not get shader source code from script elements.\";\n }\n var vsh = gl.createShader( gl.VERTEX_SHADER );\n gl.shaderSource(vsh,vertexShaderSource);\n gl.compileShader(vsh);\n if ( ! gl.getShaderParameter(vsh, gl.COMPILE_STATUS) ) {\n throw \"Error in vertex shader: \" + gl.getShaderInfoLog(vsh);\n }\n var fsh = gl.createShader( gl.FRAGMENT_SHADER );\n gl.shaderSource(fsh, fragmentShaderSource);\n gl.compileShader(fsh);\n if ( ! gl.getShaderParameter(fsh, gl.COMPILE_STATUS) ) {\n throw \"Error in fragment shader: \" + gl.getShaderInfoLog(fsh);\n }\n var prog = gl.createProgram();\n gl.attachShader(prog,vsh);\n gl.attachShader(prog, fsh);\n gl.linkProgram(prog);\n if ( ! gl.getProgramParameter( prog, gl.LINK_STATUS) ) {\n throw \"Link error in program: \" + gl.getProgramInfoLog(prog);\n }\n return prog;\n}", "function checkFullLineInCurrentCalculationArea(){\n\n playerLevelEnvironment.fullLines = [];\n let fullLineFound = false;\n\n const numberOfRows = currentCalculationArea.length;\n const numberOfColumns = currentCalculationArea[0].length;\n\n // let's check all rows for full lines\n let numberOfFilledRectanglesInRow;\n let isRectangleFilled;\n for (let i = 0; i < numberOfRows; i++) {\n numberOfFilledRectanglesInRow = 0;\n for (let j = 0; j < numberOfColumns; j++) {\n isRectangleFilled = currentCalculationArea[i][j];\n if (isRectangleFilled > 0) {\n numberOfFilledRectanglesInRow++;\n }\n }\n if (numberOfFilledRectanglesInRow === numberOfColumns) {\n // we've found a full line in row i\n fullLineFound = true;\n playerLevelEnvironment.fullLines.push(i);\n }\n }\n if (fullLineFound === true) {\n playerLevelEnvironment.playAreaMode = 'fullLineRemoveAnimation';\n let numberOfNewLinesCleared = playerLevelEnvironment.fullLines.length;\n let numberOfLinesCleared = statRelated.increaseNumberOfLinesCleared(numberOfNewLinesCleared);\n let pointsReceived = statRelated.calculatePointsReceived(numberOfNewLinesCleared, playerLevelEnvironment.gameLevel);\n playerLevelEnvironment.points += pointsReceived;\n\n chat.sayPointsReceived(pointsReceived, numberOfNewLinesCleared);\n if (\n Math.round(numberOfLinesCleared / gameLevelEnvironment.numberOfLinesNeedsToBeClearedToIncreaseGameSpeed) !==\n Math.round((numberOfLinesCleared-numberOfNewLinesCleared) / gameLevelEnvironment.numberOfLinesNeedsToBeClearedToIncreaseGameSpeed)\n ) {\n playerLevelEnvironment.gameLevel++;\n playerLevelEnvironment.fallingSpeed = playerLevelEnvironment.fallingSpeed + 0.5;\n chat.sayLevelIncreased(playerLevelEnvironment.gameLevel);\n }\n }\n }", "function checkLength(){\n\t\tif (inputOrder.length == colorOrder.length){\n\t\t\ttoString();\n\t\t\tcheckOrder();\n\t\t} else {\n\t\t\tinputSequence++\n\t\t}\n\t}", "function d$2(o,r){o.include(o$7),o.vertex.include(r$b,r),o.varyings.add(\"vPositionWorldCameraRelative\",\"vec3\"),o.varyings.add(\"vPosition_view\",\"vec3\"),o.vertex.uniforms.add(\"uTransform_WorldFromModel_RS\",\"mat3\"),o.vertex.uniforms.add(\"uTransform_WorldFromModel_TH\",\"vec3\"),o.vertex.uniforms.add(\"uTransform_WorldFromModel_TL\",\"vec3\"),o.vertex.uniforms.add(\"uTransform_WorldFromView_TH\",\"vec3\"),o.vertex.uniforms.add(\"uTransform_WorldFromView_TL\",\"vec3\"),o.vertex.uniforms.add(\"uTransform_ViewFromCameraRelative_RS\",\"mat3\"),o.vertex.uniforms.add(\"uTransform_ProjFromView\",\"mat4\"),o.vertex.code.add(t$i`vec3 positionWorldCameraRelative() {\nvec3 rotatedModelPosition = uTransform_WorldFromModel_RS * positionModel();\nvec3 transform_CameraRelativeFromModel = dpAdd(\nuTransform_WorldFromModel_TL,\nuTransform_WorldFromModel_TH,\n-uTransform_WorldFromView_TL,\n-uTransform_WorldFromView_TH\n);\nreturn transform_CameraRelativeFromModel + rotatedModelPosition;\n}\nvec3 position_view() {\nreturn uTransform_ViewFromCameraRelative_RS * positionWorldCameraRelative();\n}\nvoid forwardPosition() {\nvPositionWorldCameraRelative = positionWorldCameraRelative();\nvPosition_view = position_view();\ngl_Position = uTransform_ProjFromView * vec4(vPosition_view, 1.0);\n}\nvec3 positionWorld() {\nreturn uTransform_WorldFromView_TL + vPositionWorldCameraRelative;\n}`),o.fragment.uniforms.add(\"uTransform_WorldFromView_TL\",\"vec3\"),o.fragment.code.add(t$i`vec3 positionWorld() {\nreturn uTransform_WorldFromView_TL + vPositionWorldCameraRelative;\n}`);}", "function loadVertices(){\n VertexBuffer = gl.createBuffer()\n gl.bindBuffer(gl.ARRAY_BUFFER, VertexBuffer)\n let vertexPoints = [\n -0.5, -0.5, -0.5, -0.5, 0.5, -0.5, 0.5, -0.5, -0.5,\n -0.5, 0.5, -0.5, 0.5, 0.5, -0.5, 0.5, -0.5, -0.5,\n\n -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, -0.5, 0.5, 0.5,\n -0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, 0.5,\n\n -0.5, 0.5, -0.5, -0.5, 0.5, 0.5, 0.5, 0.5, -0.5,\n -0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, -0.5,\n\n -0.5, -0.5, -0.5, 0.5, -0.5, -0.5, -0.5, -0.5, 0.5,\n -0.5, -0.5, 0.5, 0.5, -0.5, -0.5, 0.5, -0.5, 0.5,\n\n -0.5, -0.5, -0.5, -0.5, -0.5, 0.5, -0.5, 0.5, -0.5,\n -0.5, -0.5, 0.5, -0.5, 0.5, 0.5, -0.5, 0.5, -0.5,\n\n 0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, -0.5, 0.5,\n 0.5, -0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5 ]\n VertexBuffer.itemSize = 3\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexPoints), gl.STATIC_DRAW)\n VertexBuffer.numberOfItems = vertexPoints.length /VertexBuffer.itemSize\n}", "function line_conflicts(line, axisName){\n var counted = new Array();\n var total = 0;\n for (var i = 0; i < line.length; i++){\n var tile = line[i];\n if (tile){\n var goal = tile[\"goal\"+axisName];\n // console.log(goal);\n if (goal < i){\n for (var j = i - 1; j >= goal; j--){\n // console.log(\"left\");\n var token = String(Math.min(i, j)) + String(Math.max(i, j));\n if (counted.indexOf(token) == -1 && line[j]){\n total += 2;\n counted.push(token);\n }\n }\n }else if (goal > i){\n for (var j = i + 1; j <= goal; j++){\n // console.log(\"right\");\n var token = String(Math.min(i, j)) + String(Math.max(i, j));\n if (counted.indexOf(token) == -1 && line[j]){\n total += 2;\n counted.push(token);\n }\n }\n }\n }\n }\n return total;\n}", "function checkForLineIssues(orientation) {\n for (let i = 0; i < orientation.length; i++) {\n if (orientation[i] == orientation[i - 1]) {\n return false;\n }\n }\n return true;\n}", "function glsl() {\n\n return {\n\n transform(code, id) {\n\n if (/\\.glsl$/.test(id) === false) return;\n\n var transformedCode = 'export default ' + JSON.stringify(\n code\n .replace(/[ \\t]*\\/\\/.*\\n/g, '') // remove //\n .replace(/[ \\t]*\\/\\*[\\s\\S]*?\\*\\//g, '') // remove /* */\n .replace(/\\n{2,}/g, '\\n') // # \\n+ to \\n\n ) + ';';\n return {\n code: transformedCode,\n map: {\n mappings: ''\n }\n };\n\n }\n\n };\n\n}", "function j$2(j){const E=new n$8,O=E.vertex.code,_=E.fragment.code;return E.vertex.uniforms.add(\"proj\",\"mat4\").add(\"view\",\"mat4\").add(\"camPos\",\"vec3\").add(\"localOrigin\",\"vec3\"),E.include(o$7),E.varyings.add(\"vpos\",\"vec3\"),E.include(e$9,j),E.include(n$9,j),E.include(t$f,j),0!==j.output&&7!==j.output||(E.include(o$8,j),E.include(r$9,{linearDepth:!1}),j.offsetBackfaces&&E.include(e$8),j.instancedColor&&E.attributes.add(\"instanceColor\",\"vec4\"),E.varyings.add(\"vNormalWorld\",\"vec3\"),E.varyings.add(\"localvpos\",\"vec3\"),j.multipassTerrainEnabled&&E.varyings.add(\"depth\",\"float\"),E.include(t$b,j),E.include(a$5,j),E.include(r$7,j),E.include(r$6,j),E.vertex.uniforms.add(\"externalColor\",\"vec4\"),E.varyings.add(\"vcolorExt\",\"vec4\"),O.add(t$i`\n void main(void) {\n forwardNormalizedVertexColor();\n vcolorExt = externalColor;\n ${j.instancedColor?\"vcolorExt *= instanceColor;\":\"\"}\n vcolorExt *= vvColor();\n vcolorExt *= getSymbolColor();\n forwardColorMixMode();\n\n if (vcolorExt.a < ${t$i.float(o$f)}) {\n gl_Position = vec4(1e38, 1e38, 1e38, 1.0);\n }\n else {\n vpos = calculateVPos();\n localvpos = vpos - view[3].xyz;\n vpos = subtractOrigin(vpos);\n vNormalWorld = dpNormal(vvLocalNormal(normalModel()));\n vpos = addVerticalOffset(vpos, localOrigin);\n gl_Position = transformPosition(proj, view, vpos);\n ${j.offsetBackfaces?\"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, camPos);\":\"\"}\n }\n ${j.multipassTerrainEnabled?t$i`depth = (view * vec4(vpos, 1.0)).z;`:\"\"}\n forwardLinearDepth();\n forwardTextureCoordinates();\n }\n `)),7===j.output&&(E.include(c$6,j),E.include(r$h,j),j.multipassTerrainEnabled&&(E.fragment.include(a$6),E.include(r$c,j)),E.fragment.uniforms.add(\"camPos\",\"vec3\").add(\"localOrigin\",\"vec3\").add(\"opacity\",\"float\").add(\"layerOpacity\",\"float\"),E.fragment.uniforms.add(\"view\",\"mat4\"),j.hasColorTexture&&E.fragment.uniforms.add(\"tex\",\"sampler2D\"),E.fragment.include(i$7),_.add(t$i`\n void main() {\n discardBySlice(vpos);\n ${j.multipassTerrainEnabled?t$i`terrainDepthTest(gl_FragCoord, depth);`:\"\"}\n ${j.hasColorTexture?t$i`\n vec4 texColor = texture2D(tex, vuv0);\n ${j.textureAlphaPremultiplied?\"texColor.rgb /= texColor.a;\":\"\"}\n discardOrAdjustAlpha(texColor);`:t$i`vec4 texColor = vec4(1.0);`}\n ${j.attributeColor?t$i`\n float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:t$i`\n float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));\n `}\n\n gl_FragColor = vec4(opacity_);\n }\n `)),0===j.output&&(E.include(c$6,j),E.include(l$4,j),E.include(o$6,j),E.include(r$h,j),j.receiveShadows&&E.include(i$9,j),j.multipassTerrainEnabled&&(E.fragment.include(a$6),E.include(r$c,j)),E.fragment.uniforms.add(\"camPos\",\"vec3\").add(\"localOrigin\",\"vec3\").add(\"ambient\",\"vec3\").add(\"diffuse\",\"vec3\").add(\"opacity\",\"float\").add(\"layerOpacity\",\"float\"),E.fragment.uniforms.add(\"view\",\"mat4\"),j.hasColorTexture&&E.fragment.uniforms.add(\"tex\",\"sampler2D\"),E.include(r$a,j),E.include(a$4,j),E.fragment.include(i$7),_.add(t$i`\n void main() {\n discardBySlice(vpos);\n ${j.multipassTerrainEnabled?t$i`terrainDepthTest(gl_FragCoord, depth);`:\"\"}\n ${j.hasColorTexture?t$i`\n vec4 texColor = texture2D(tex, vuv0);\n ${j.textureAlphaPremultiplied?\"texColor.rgb /= texColor.a;\":\"\"}\n discardOrAdjustAlpha(texColor);`:t$i`vec4 texColor = vec4(1.0);`}\n vec3 viewDirection = normalize(vpos - camPos);\n ${1===j.pbrMode?\"applyPBRFactors();\":\"\"}\n float ssao = evaluateAmbientOcclusionInverse();\n ssao *= getBakedOcclusion();\n\n float additionalAmbientScale = _oldHeuristicLighting(vpos + localOrigin);\n vec3 additionalLight = ssao * lightingMainIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;\n ${j.receiveShadows?\"float shadow = readShadowMap(vpos, linearDepth);\":1===j.viewingMode?\"float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);\":\"float shadow = 0.0;\"}\n vec3 matColor = max(ambient, diffuse);\n ${j.attributeColor?t$i`\n vec3 albedo_ = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));\n float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:t$i`\n vec3 albedo_ = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));\n float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));\n `}\n ${t$i`\n vec3 shadedNormal = normalize(vNormalWorld);\n albedo_ *= 1.2;\n vec3 viewForward = - vec3(view[0][2], view[1][2], view[2][2]);\n float alignmentLightView = clamp(dot(-viewForward, lightingMainDirection), 0.0, 1.0);\n float transmittance = 1.0 - clamp(dot(-viewForward, shadedNormal), 0.0, 1.0);\n float treeRadialFalloff = vColor.r;\n float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);\n additionalLight += backLightFactor * lightingMainIntensity;`}\n ${1===j.pbrMode||2===j.pbrMode?1===j.viewingMode?t$i`vec3 normalGround = normalize(vpos + localOrigin);`:t$i`vec3 normalGround = vec3(0.0, 0.0, 1.0);`:t$i``}\n ${1===j.pbrMode||2===j.pbrMode?t$i`\n float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * lightingMainIntensity[2];\n vec3 shadedColor = evaluateSceneLightingPBR(shadedNormal, albedo_, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:\"vec3 shadedColor = evaluateSceneLighting(shadedNormal, albedo_, shadow, 1.0 - ssao, additionalLight);\"}\n gl_FragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);\n ${j.OITEnabled?\"gl_FragColor = premultiplyAlpha(gl_FragColor);\":\"\"}\n }\n `)),E.include(u$3,j),E}", "function checkDraw(squares) {\n let draw = null;\n const lines = [\n [0, 1, 2],\n [3, 4, 5],\n [6, 7, 8]\n ];\n for (let i=0; i<lines.length; i++) {\n const [a, b, c] = lines[i];\n if (squares[a] === null || squares[b] === null || squares[c] === null) {\n draw = false\n i = lines.length\n } else {\n draw = true\n }\n }\n return draw\n}", "function generated(node) {\n var position = optional(optional(node).position)\n var start = optional(position.start)\n var end = optional(position.end)\n\n return !start.line || !start.column || !end.line || !end.column\n}", "function renderSomething() {\n var v = [\n \"attribute vec2 aVertexPosition;\",\n \"void main() {\",\n \"gl_Position = vec4(aVertexPosition, 0.0, 1.0);\",\n \"}\",\n ].join(\"\\n\");\n\n var f = [\n \"#ifdef GL_ES\",\n \"precision highp float;\",\n \"#endif\",\n \"uniform vec4 uColor;\",\n \"void main() {\",\n \"gl_FragColor = uColor;\",\n \"}\",\n ].join(\"\\n\");\n\n var vs = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vs, v);\n gl.compileShader(vs);\n\n var fs = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fs, f);\n gl.compileShader(fs);\n\n var program = gl.createProgram();\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n\n\n // Setup Geometry\n var vertices = new Float32Array([-0.5, -0.5, 0.5, -0.5, 0.0, 0.5 // Triangle-Coordinates\n ]);\n\n var vbuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vbuffer);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n\n var itemSize = 2; // we have 2 coordinates (x,y)\n var numItems = vertices.length / itemSize; // number of triangles\n\n // Viewport\n gl.viewport(0, 0, width, height);\n gl.clearColor(0, 0, 0.8, 1);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n // Setup Geometry:\n gl.useProgram(program);\n\n program.uColor = gl.getUniformLocation(program, \"uColor\");\n gl.uniform4fv(program.uColor, [0.8, 0.0, 0.0, 1.0]);\n\n program.aVertexPosition = gl.getAttribLocation(program, \"aVertexPosition\");\n gl.enableVertexAttribArray(program.aVertexPosition);\n gl.vertexAttribPointer(program.aVertexPosition, itemSize, gl.FLOAT, false, 0, 0);\n\n // Draw:\n gl.drawArrays(gl.TRIANGLES, 0, numItems);\n //context.drawImage(canvas,10,20);\n\n}", "function checkLines() {\n\tvar concurrentLines = 1;\n\tvar lineFound = false;\n\tvar fullRow = true;\n\tvar r = rows - 1;\n\tvar c = columns - 1;\n\t\n\t// Checking rows one by one from bottom to top to find full lines.\n\twhile(r >= 0) {\n\t\twhile(c >= 0) {\n\t\t\t// If a square is \"empty\" then the line can't be full so move on to next row.\n\t\t\tif(gameData[r][c] == 0) {\n\t\t\t\tfullRow = false;\n\t\t\t\tc = -1;\n\t\t\t}\n\t\t\tc--;\n\t\t}\n\t\t// If all the squares were \"full\" call function to remove the line, add score, and add cleared lines. ConcurrentLines used as a multiplier on score when multiple lines cleared at once.\n\t\tif(fullRow == true) {\n\t\t\tzeroRow(r);\n\t\t\tscore += (100 * concurrentLines);\n\t\t\tr++;\n\t\t\tlineFound = true;\n\t\t\tcurrentLines++;\n\t\t\tconcurrentLines++;\n\t\t}\n\t\t\n\t\tfullRow = true;\n\t\tc = columns - 1;\n\t\tr--;\n\t}\n\tif(lineFound) {\n\t\tlineSpan.innerHTML = currentLines.toString();\n\t\tdocument.getElementById(\"points\").innerHTML = score.toString();\n\t\t// If your current score is higher than the old highscore from server, update the \"personal best\" while playing.\n\t\tif (score > highscore) {\n\t\t\thighscore = score;\n\t\t\tdocument.getElementById(\"highscore\").innerHTML = score.toString();\n\t\t}\n\t}\n}", "checkForMatch() {\n\n // Matching horizontal lines\n if(this._topLeft.textContent === 'X' || this._topLeft.textContent === '0') {\n \n if(this._topLeft.textContent === this._topMiddle.textContent && this._topMiddle.textContent === this._topRight.textContent) {\n this._topLeft.style.backgroundColor = 'green'\n this._topMiddle.style.backgroundColor = 'green'\n this._topRight.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n\n if(this._middleLeft.textContent === 'X' || this._middleLeft.textContent === '0') {\n \n if(this._middleLeft.textContent === this._middleMiddle.textContent && this._middleMiddle.textContent === this._middleRight.textContent) {\n this._middleLeft.style.backgroundColor = 'green'\n this._middleMiddle.style.backgroundColor = 'green'\n this._middleRight.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n\n if(this._bottomLeft.textContent === 'X' || this._bottomLeft.textContent === '0') {\n \n if(this._bottomLeft.textContent === this._bottomMiddle.textContent && this._bottomMiddle.textContent === this._bottomRight.textContent) {\n this._bottomLeft.style.backgroundColor = 'green'\n this._bottomMiddle.style.backgroundColor = 'green'\n this._bottomRight.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n\n // Matching vertical lines\n if(this._topLeft.textContent === 'X' || this._topLeft.textContent === '0') {\n \n if(this._topLeft.textContent === this._middleLeft.textContent && this._middleLeft.textContent == this._bottomLeft.textContent) {\n this._topLeft.style.backgroundColor = 'green'\n this._middleLeft.style.backgroundColor = 'green'\n this._bottomLeft.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n\n if(this._topMiddle.textContent === 'X' || this._topMiddle.textContent === '0') {\n \n if(this._topMiddle.textContent === this._middleMiddle.textContent && this._middleMiddle.textContent == this._bottomMiddle.textContent) {\n this._topMiddle.style.backgroundColor = 'green'\n this._middleMiddle.style.backgroundColor = 'green'\n this._bottomMiddle.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n\n if(this._topRight.textContent === 'X' || this._topRight.textContent === '0') {\n \n if(this._topRight.textContent === this._middleRight.textContent && this._middleRight.textContent == this._bottomRight.textContent) {\n this._topRight.style.backgroundColor = 'green'\n this._middleRight.style.backgroundColor = 'green'\n this._bottomRight.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n \n // Matching diagonal lines\n if(this._middleMiddle.textContent === 'X' || this._middleMiddle.textContent === '0') {\n \n if(this._topLeft.textContent === this._middleMiddle.textContent && this._middleMiddle.textContent === this._bottomRight.textContent) {\n this._topLeft.style.backgroundColor = 'green'\n this._middleMiddle.style.backgroundColor = 'green'\n this._bottomRight.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n\n if(this._topRight.textContent === this._middleMiddle.textContent && this._middleMiddle.textContent === this._bottomLeft.textContent) {\n this._topRight.style.backgroundColor = 'green'\n this._middleMiddle.style.backgroundColor = 'green'\n this._bottomLeft.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n }", "function n$7(n,a){const r=n.fragment;r.uniforms.add(\"normalTexture\",\"sampler2D\"),r.uniforms.add(\"normalTextureSize\",\"vec2\"),a.vertexTangets?(n.attributes.add(\"tangent\",\"vec4\"),n.varyings.add(\"vTangent\",\"vec4\"),2===a.doubleSidedMode?r.code.add(t$i`mat3 computeTangentSpace(vec3 normal) {\nfloat tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;\nvec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);\nvec3 bitangent = cross(normal, tangent) * tangentHeadedness;\nreturn mat3(tangent, bitangent, normal);\n}`):r.code.add(t$i`mat3 computeTangentSpace(vec3 normal) {\nfloat tangentHeadedness = vTangent.w;\nvec3 tangent = normalize(vTangent.xyz);\nvec3 bitangent = cross(normal, tangent) * tangentHeadedness;\nreturn mat3(tangent, bitangent, normal);\n}`)):(n.extensions.add(\"GL_OES_standard_derivatives\"),r.code.add(t$i`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) {\nvec3 Q1 = dFdx(pos);\nvec3 Q2 = dFdy(pos);\nvec2 stx = dFdx(st);\nvec2 sty = dFdy(st);\nfloat det = stx.t * sty.s - sty.t * stx.s;\nvec3 T = stx.t * Q2 - sty.t * Q1;\nT = T - normal * dot(normal, T);\nT *= inversesqrt(max(dot(T,T), 1.e-10));\nvec3 B = sign(det) * cross(normal, T);\nreturn mat3(T, B, normal);\n}`)),0!==a.attributeTextureCoordinates&&(n.include(u$5,a),r.code.add(t$i`\n vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {\n vtc.uv = uv;\n ${a.supportsTextureAtlas?\"vtc.size = normalTextureSize;\":\"\"}\n vec3 rawNormal = textureLookup(normalTexture, vtc).rgb * 2.0 - 1.0;\n return tangentSpace * rawNormal;\n }\n `));}", "function initLine(s){\n VertexPositionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, VertexPositionBuffer);\n vertices = [\n 0.0, 0.0, 0.0,\n 0.0, s, 0.0\n ];\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n VertexPositionBuffer.itemSize = 3;\n VertexPositionBuffer.numItems = 2;\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, VertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(0);\n\n}", "function $ff3de9b532b6c26c$var$glsl(hljs) {\n return {\n name: \"GLSL\",\n keywords: {\n keyword: // Statements\n \"break continue discard do else for if return while switch case default attribute binding buffer ccw centroid centroid varying coherent column_major const cw depth_any depth_greater depth_less depth_unchanged early_fragment_tests equal_spacing flat fractional_even_spacing fractional_odd_spacing highp in index inout invariant invocations isolines layout line_strip lines lines_adjacency local_size_x local_size_y local_size_z location lowp max_vertices mediump noperspective offset origin_upper_left out packed patch pixel_center_integer point_mode points precise precision quads r11f_g11f_b10f r16 r16_snorm r16f r16i r16ui r32f r32i r32ui r8 r8_snorm r8i r8ui readonly restrict rg16 rg16_snorm rg16f rg16i rg16ui rg32f rg32i rg32ui rg8 rg8_snorm rg8i rg8ui rgb10_a2 rgb10_a2ui rgba16 rgba16_snorm rgba16f rgba16i rgba16ui rgba32f rgba32i rgba32ui rgba8 rgba8_snorm rgba8i rgba8ui row_major sample shared smooth std140 std430 stream triangle_strip triangles triangles_adjacency uniform varying vertices volatile writeonly\",\n type: \"atomic_uint bool bvec2 bvec3 bvec4 dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 double dvec2 dvec3 dvec4 float iimage1D iimage1DArray iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer iimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray image2DRect image3D imageBuffer imageCube imageCubeArray int isampler1D isampler1DArray isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D isamplerBuffer isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 mat2 mat2x2 mat2x3 mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 sampler1D sampler1DArray sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray sampler2DArrayShadow sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow sampler3D samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow image1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray uimage2DRect uimage3D uimageBuffer uimageCube uimageCubeArray uint usampler1D usampler1DArray usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D samplerBuffer usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 vec2 vec3 vec4 void\",\n built_in: // Constants\n \"gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize gl_MaxClipDistances gl_MaxClipPlanes gl_MaxCombinedAtomicCounterBuffers gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms gl_MaxCombinedImageUnitsAndFragmentOutputs gl_MaxCombinedTextureImageUnits gl_MaxComputeAtomicCounterBuffers gl_MaxComputeAtomicCounters gl_MaxComputeImageUniforms gl_MaxComputeTextureImageUnits gl_MaxComputeUniformComponents gl_MaxComputeWorkGroupCount gl_MaxComputeWorkGroupSize gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers gl_MaxFragmentAtomicCounters gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents gl_MaxFragmentInputVectors gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs gl_MaxVertexImageUniforms gl_MaxVertexOutputComponents gl_MaxVertexOutputVectors gl_MaxVertexTextureImageUnits gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffset gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial gl_FrontSecondaryColor gl_GlobalInvocationID gl_InstanceID gl_InvocationID gl_Layer gl_LightModel gl_LightSource gl_LocalInvocationID gl_LocalInvocationIndex gl_ModelViewMatrix gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_Normal gl_NormalMatrix gl_NormalScale gl_NumSamples gl_NumWorkGroups gl_ObjectPlaneQ gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn gl_Point gl_PointCoord gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn gl_ProjectionMatrix gl_ProjectionMatrixInverse gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask gl_SampleMaskIn gl_SamplePosition gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter gl_TexCoord gl_TextureEnvColor gl_TextureMatrix gl_TextureMatrixInverse gl_TextureMatrixInverseTranspose gl_TextureMatrixTranspose gl_Vertex gl_VertexID gl_ViewportIndex gl_WorkGroupID gl_WorkGroupSize gl_in gl_out EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive abs acos acosh all any asin asinh atan atanh atomicAdd atomicAnd atomicCompSwap atomicCounter atomicCounterDecrement atomicCounterIncrement atomicExchange atomicMax atomicMin atomicOr atomicXor barrier bitCount bitfieldExtract bitfieldInsert bitfieldReverse ceil clamp cos cosh cross dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward findLSB findMSB floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan greaterThanEqual groupMemoryBarrier imageAtomicAdd imageAtomicAnd imageAtomicCompSwap imageAtomicExchange imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad imageSize imageStore imulExtended intBitsToFloat interpolateAtCentroid interpolateAtOffset interpolateAtSample inverse inversesqrt isinf isnan ldexp length lessThan lessThanEqual log log2 matrixCompMult max memoryBarrier memoryBarrierAtomicCounter memoryBarrierBuffer memoryBarrierImage memoryBarrierShared min mix mod modf noise1 noise2 noise3 noise4 normalize not notEqual outerProduct packDouble2x32 packHalf2x16 packSnorm2x16 packSnorm4x8 packUnorm2x16 packUnorm4x8 pow radians reflect refract round roundEven shadow1D shadow1DLod shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj shadow2DProjLod sign sin sinh smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture texture1D texture1DLod texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj texture2DProjLod texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset textureLod textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset textureProjLod textureProjLodOffset textureProjOffset textureQueryLevels textureQueryLod textureSize transpose trunc uaddCarry uintBitsToFloat umulExtended unpackDouble2x32 unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 unpackUnorm2x16 unpackUnorm4x8 usubBorrow\",\n literal: \"true false\"\n },\n illegal: '\"',\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: \"meta\",\n begin: \"#\",\n end: \"$\"\n }\n ]\n };\n}", "function Shader(vertexSource, fragmentSource) {\n\t\t// Allow passing in the id of an HTML script tag with the source\n\n\n\t\tfunction followScriptTagById(id) {\n\t\t\tvar element = document.getElementById(id);\n\t\t\treturn element ? element.text : id;\n\t\t}\n\t\tvertexSource = followScriptTagById(vertexSource);\n\t\tfragmentSource = followScriptTagById(fragmentSource);\n\n\t\t// Headers are prepended to the sources to provide some automatic functionality.\n\t\tvar header = '\\\n uniform mat3 gl_NormalMatrix;\\\n uniform mat4 gl_ModelViewMatrix;\\\n uniform mat4 gl_ProjectionMatrix;\\\n uniform mat4 gl_ModelViewProjectionMatrix;\\\n uniform mat4 gl_ModelViewMatrixInverse;\\\n uniform mat4 gl_ProjectionMatrixInverse;\\\n uniform mat4 gl_ModelViewProjectionMatrixInverse;\\\n ';\n\t\tvar vertexHeader = header + '\\\n attribute vec4 gl_Vertex;\\\n attribute vec4 gl_TexCoord;\\\n attribute vec3 gl_Normal;\\\n attribute vec4 gl_Color;\\\n vec4 ftransform() {\\\n return gl_ModelViewProjectionMatrix * gl_Vertex;\\\n }\\\n ';\n\t\tvar fragmentHeader = '\\\n precision highp float;\\\n ' + header;\n\n\t\t// Check for the use of built-in matrices that require expensive matrix\n\t\t// multiplications to compute, and record these in `usedMatrices`.\n\t\tvar source = vertexSource + fragmentSource;\n\t\tvar usedMatrices = {};\n\t\tregexMap(/\\b(gl_[^;]*)\\b;/g, header, function(groups) {\n\t\t\tvar name = groups[1];\n\t\t\tif(source.indexOf(name) != -1) {\n\t\t\t\tvar capitalLetters = name.replace(/[a-z_]/g, '');\n\t\t\t\tusedMatrices[capitalLetters] = LIGHTGL_PREFIX + name;\n\t\t\t}\n\t\t});\n\t\tif(source.indexOf('ftransform') != -1) usedMatrices.MVPM = LIGHTGL_PREFIX + 'gl_ModelViewProjectionMatrix';\n\t\tthis.usedMatrices = usedMatrices;\n\n\t\t// The `gl_` prefix must be substituted for something else to avoid compile\n\t\t// errors, since it's a reserved prefix. This prefixes all reserved names with\n\t\t// `_`. The header is inserted after any extensions, since those must come\n\t\t// first.\n\n\n\t\tfunction fix(header, source) {\n\t\t\tvar replaced = {};\n\t\t\tvar match = /^((\\s*\\/\\/.*\\n|\\s*#extension.*\\n)+)\\^*$/.exec(source);\n\t\t\tsource = match ? match[1] + header + source.substr(match[1].length) : header + source;\n\t\t\tregexMap(/\\bgl_\\w+\\b/g, header, function(result) {\n\t\t\t\tif(!(result in replaced)) {\n\t\t\t\t\tsource = source.replace(new RegExp('\\\\b' + result + '\\\\b', 'g'), LIGHTGL_PREFIX + result);\n\t\t\t\t\treplaced[result] = true;\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn source;\n\t\t}\n\t\tvertexSource = fix(vertexHeader, vertexSource);\n\t\tfragmentSource = fix(fragmentHeader, fragmentSource);\n\n\t\t// Compile and link errors are thrown as strings.\n\n\n\t\tfunction compileSource(type, source) {\n\t\t\tvar shader = gl.createShader(type);\n\t\t\tgl.shaderSource(shader, source);\n\t\t\tgl.compileShader(shader);\n\t\t\tif(!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n\t\t\t\tthrow 'compile error: ' + gl.getShaderInfoLog(shader);\n\t\t\t}\n\t\t\treturn shader;\n\t\t}\n\t\tthis.program = gl.createProgram();\n\t\tgl.attachShader(this.program, compileSource(gl.VERTEX_SHADER, vertexSource));\n\t\tgl.attachShader(this.program, compileSource(gl.FRAGMENT_SHADER, fragmentSource));\n\t\tgl.linkProgram(this.program);\n\t\tif(!gl.getProgramParameter(this.program, gl.LINK_STATUS)) {\n\t\t\tthrow 'link error: ' + gl.getProgramInfoLog(this.program);\n\t\t}\n\t\tthis.attributes = {};\n\t\tthis.uniformLocations = {};\n\n\t\t// Sampler uniforms need to be uploaded using `gl.uniform1i()` instead of `gl.uniform1f()`.\n\t\t// To do this automatically, we detect and remember all uniform samplers in the source code.\n\t\tvar isSampler = {};\n\t\tregexMap(/uniform\\s+sampler(1D|2D|3D|Cube)\\s+(\\w+)\\s*;/g, vertexSource + fragmentSource, function(groups) {\n\t\t\tisSampler[groups[2]] = 1;\n\t\t});\n\t\tthis.isSampler = isSampler;\n\t}", "function checkLineChanged(currLine){\n if (currLine != prevLine){\n return true;\n }\n return false;\n}", "function createProgram(gl, vertexShaderID, fragmentShaderID) {\n function getTextContent( elementID ) {\n var element = document.getElementById(elementID);\n var node = element.firstChild;\n var str = \"\";\n while (node) {\n if (node.nodeType == 3) // this is a text node\n str += node.textContent;\n node = node.nextSibling;\n }\n return str;\n }\n try {\n var vertexShaderSource = getTextContent( vertexShaderID );\n var fragmentShaderSource = getTextContent( fragmentShaderID );\n }\n catch (e) {\n throw \"Error: Could not get shader source code from script elements.\";\n }\n var vsh = gl.createShader( gl.VERTEX_SHADER );\n gl.shaderSource(vsh,vertexShaderSource);\n gl.compileShader(vsh);\n if ( ! gl.getShaderParameter(vsh, gl.COMPILE_STATUS) ) {\n throw \"Error in vertex shader: \" + gl.getShaderInfoLog(vsh);\n }\n var fsh = gl.createShader( gl.FRAGMENT_SHADER );\n gl.shaderSource(fsh, fragmentShaderSource);\n gl.compileShader(fsh);\n if ( ! gl.getShaderParameter(fsh, gl.COMPILE_STATUS) ) {\n throw \"Error in fragment shader: \" + gl.getShaderInfoLog(fsh);\n }\n var prog = gl.createProgram();\n gl.attachShader(prog,vsh);\n gl.attachShader(prog, fsh);\n gl.linkProgram(prog);\n if ( ! gl.getProgramParameter( prog, gl.LINK_STATUS) ) {\n throw \"Link error in program: \" + gl.getProgramInfoLog(prog);\n }\n return prog;\n}", "function checkKey(e) {\n //alert(e.keyCode);\n switch (e.keyCode) {\n //red\n case 49:\n render(\"red\");\n break;\n //green\n case 50:\n render(\"green\");\n break;\n //blue\n case 51:\n render(\"blue\");\n break;\n //random color\n case 52:\n render(\"random\");\n break;\n //favourite color\n case 53:\n render(\"favourite\");\n break;\n //triangle\n case 84:\n squareTryangleCircle = \"trinagle\";\n var colors = [1, 0, 0, 1, 0, 0, 1, 0, 0];\n\n var bufferId = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, bufferId);\n gl.bufferData(gl.ARRAY_BUFFER, points, gl.STATIC_DRAW);\n\n var aPosition = gl.getAttribLocation(program, \"aPosition\");\n gl.vertexAttribPointer(aPosition, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(aPosition);\n\n cBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, cBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW); //new Float32Array(colors)\n\n var aColor = gl.getAttribLocation(program, \"aColor\");\n //3 points colors?\n gl.vertexAttribPointer(aColor, 3, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(aColor);\n\n render();\n break;\n // square\n case 83:\n squareTryangleCircle = \"square\";\n var colors = [0, 1, 1, 0, 1, 1, 0.5, 0, 1, .6, .1, 1];\n\n var bufferId = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, bufferId);\n gl.bufferData(gl.ARRAY_BUFFER, pointsSquare, gl.STATIC_DRAW);\n\n var aPosition = gl.getAttribLocation(program, \"aPosition\");\n gl.vertexAttribPointer(aPosition, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(aPosition);\n\n cBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, cBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW); //new Float32Array(colors)\n\n var aColor = gl.getAttribLocation(program, \"aColor\");\n gl.vertexAttribPointer(aColor, 3, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(aColor);\n\n render();\n break;\n // circle\n case 67:\n squareTryangleCircle = \"circle\";\n var colors = [1, 0, 1, 1, 0, 1];\n var numPoints = 100;\n for (var i = 0; i < numPoints; i++)colors.push(1, 0, 1);\n\n\n var bufferId = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, bufferId);\n gl.bufferData(gl.ARRAY_BUFFER, flatten(circlePoints), gl.STATIC_DRAW);\n\n var aPosition = gl.getAttribLocation(program, \"aPosition\");\n gl.vertexAttribPointer(aPosition, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(aPosition);\n\n cBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, cBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW); //new Float32Array(colors)\n\n var aColor = gl.getAttribLocation(program, \"aColor\");\n //3 points colors?\n gl.vertexAttribPointer(aColor, 3, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(aColor);\n\n render(\"favourite\");\n break;\n }\n}", "function checkLines(){\n for(var r = 0; r < ROWS - 1; r++){\n for(var c = 1; c < COLS - 1; c++){\n if(grid[r][c] === -1){\n break;\n }\n if(c === COLS - 2){\n clearLine(r);\n }\n }\n }\n}", "function readDataFile(fileText) {\n // Split the file text into individual lines\n var lines = fileText.split(/\\r\\n|\\r|\\n/);\n \n // Initialize some arrays to keep track of vertices, line \n // indices, and triangle indices\n var vertices = [];\n var linds = [];\n var trinds = [];\n \n // Loop through each line\n for( var i = 0; i < lines.length; ++i ) {\n // Split the line by whitespace\n var tokens = lines[i].split(\" \");\n \n // If there weren't 3 tokens on the line, we don't care about it\n if( tokens.length !== 3 ) {\n continue;\n }\n \n // If there were, we have a new vertex, update all arrays\n linds.push( linds.length );\n if( ((vertices.length / 3) + 1) % 4 !== 0 ) {\n trinds.push( vertices.length / 3 );\n }\n vertices.push( tokens[0], tokens[1], tokens[2] );\n }\n \n // Bind and set the data of the vbo\n gl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n vbo.length = vertices.length;\n \n // Bind and set the data of the lineIndices buffer\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, lineIndices);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(linds), gl.STATIC_DRAW);\n lineIndices.length = linds.length;\n \n // Bind and set the data of the triangle Indices buffer\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triIndices);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(trinds), gl.STATIC_DRAW);\n triIndices.length = trinds.length;\n \n // Finally, display the results of the computation\n display();\n}", "function compareByGeneratedPositionsDeflated(mappingA,mappingB,onlyCompareGenerated){var cmp=mappingA.generatedLine-mappingB.generatedLine;if(cmp!==0){return cmp;}cmp=mappingA.generatedColumn-mappingB.generatedColumn;if(cmp!==0||onlyCompareGenerated){return cmp;}cmp=strcmp(mappingA.source,mappingB.source);if(cmp!==0){return cmp;}cmp=mappingA.originalLine-mappingB.originalLine;if(cmp!==0){return cmp;}cmp=mappingA.originalColumn-mappingB.originalColumn;if(cmp!==0){return cmp;}return strcmp(mappingA.name,mappingB.name);}", "vertex_glsl_code() {\n // ********* VERTEX SHADER *********\n return (\n this.shared_glsl_code() +\n `\n varying vec2 f_tex_coord;\n attribute vec3 position, normal; // Position is expressed in object coordinates.\n attribute vec2 texture_coord;\n \n uniform mat4 model_transform;\n uniform mat4 projection_camera_model_transform;\n\n void main()\n { // The vertex's final resting place (in NDCS):\n gl_Position = projection_camera_model_transform * vec4( position, 1.0 );\n // The final normal vector in screen space.\n N = normalize( mat3( model_transform ) * normal / squared_scale);\n \n vertex_worldspace = ( model_transform * vec4( position, 1.0 ) ).xyz;\n // Turn the per-vertex texture coordinate into an interpolated variable.\n f_tex_coord = texture_coord;\n } `\n );\n }", "function compareByGeneratedPositionsInflated(mappingA, mappingB) {\n\t\t var cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t\t if (cmp !== 0) {\n\t\t return cmp;\n\t\t }\n\t\n\t\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t\t if (cmp !== 0) {\n\t\t return cmp;\n\t\t }\n\t\n\t\t cmp = strcmp(mappingA.source, mappingB.source);\n\t\t if (cmp !== 0) {\n\t\t return cmp;\n\t\t }\n\t\n\t\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t\t if (cmp !== 0) {\n\t\t return cmp;\n\t\t }\n\t\n\t\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t\t if (cmp !== 0) {\n\t\t return cmp;\n\t\t }\n\t\n\t\t return strcmp(mappingA.name, mappingB.name);\n\t\t}", "function GLSLBench({ element, url, spec }) {\n let anyErrors = false;\n\n let errorCallback = (errorText) => {\n throw new Error(errorText);\n };\n\n function error(errorText) {\n anyErrors = true;\n errorCallback(errorText);\n }\n\n this.onError = (callback) => {\n errorCallback = callback;\n };\n\n let render;\n let shader;\n let frameBuffers;\n let frameNumber;\n let resolution;\n\n const mousePos = {\n x: 0, y: 0, rel_x: 0, rel_y: 0\n };\n\n if (!element) {\n return error('Missing attribute: (DOM) element');\n }\n\n // try to initialize WebGL\n const container = element;\n const canvas = document.createElement('canvas');\n const gl = canvas.getContext('webgl');\n\n if (gl === null) {\n return error('Unable to initialize WebGL. Your browser or machine may not support it.');\n }\n\n // changed when the shader starts\n this.running = false;\n this.stop = () => {};\n\n this.destroy = () => {\n this.stop();\n if (canvas) canvas.parentNode.removeChild(canvas);\n };\n\n this.captureImage = (callback) => {\n if (!this.running && this.resume) {\n // if stopped, must render a new frame before capture\n this.captureCallback = (data) => {\n callback(data);\n this.stop();\n };\n this.resume();\n } else {\n this.captureCallback = callback;\n }\n };\n\n container.appendChild(canvas);\n\n const VERTEX_SHADER_SOURCE = `\n precision highp float;\n precision highp int;\n attribute vec3 position;\n\n varying vec3 pos;\n void main() {\n pos = position;\n gl_Position = vec4( position, 1.0 );\n }\n `;\n\n const RAW_FRAGMENT_SHADER_PREFIX = `${[\n 'precision highp float;',\n 'precision highp int;'\n ].join('\\n')}\\n`;\n\n function finalFragCoord(flipY = false) {\n return flipY ? 'vec2(gl_FragCoord.x/resolution.x, 1.0 - gl_FragCoord.y/resolution.y)' : 'gl_FragCoord.xy / resolution.xy';\n }\n\n function buildCopyFragmentShader(flipY = false) {\n return `\n uniform sampler2D source;\n uniform vec2 resolution;\n void main() {\n gl_FragColor = texture2D(source, ${finalFragCoord(flipY)});\n }`;\n }\n\n function buildGammaCorrectionFragmentShader(flipY = false) {\n return `\n uniform sampler2D source;\n uniform vec2 resolution;\n uniform float gamma;\n void main() {\n vec4 src = texture2D(source, ${finalFragCoord(flipY)});\n gl_FragColor = vec4(pow(src.xyz, vec3(1,1,1) / gamma), src.w);\n }`;\n }\n\n function buildSRGBFragmentShader(flipY = false) {\n return `\n uniform sampler2D source;\n uniform vec2 resolution;\n void main() {\n // https://gamedev.stackexchange.com/a/148088\n vec4 src = texture2D(source, ${finalFragCoord(flipY)});\n vec3 cutoff = vec3(lessThan(src.xyz, vec3(0.0031308)));\n vec3 higher = vec3(1.055)*pow(src.xyz, vec3(1.0/2.4)) - vec3(0.055);\n vec3 lower = src.xyz * vec3(12.92);\n gl_FragColor = vec4(higher * (vec3(1.0) - cutoff) + lower * cutoff, src.w);\n }\n `;\n }\n\n // simple jQuery replacements\n const helpers = {\n getFile(fileUrl, onSuccess, onError) {\n const request = new XMLHttpRequest();\n request.onload = () => {\n if (request.status >= 400) {\n request.onerror(request.statusText);\n } else {\n onSuccess(request.response);\n }\n };\n if (onError) {\n request.onerror = onError;\n } else {\n request.onerror = () => {\n error(`Failed to GET '${fileUrl}'`);\n };\n }\n request.open('get', fileUrl, true);\n request.send();\n },\n\n getJSON(jsonUrl, onSuccess, onError) {\n helpers.getFile(jsonUrl, (data) => {\n let parsed;\n try {\n parsed = JSON.parse(data);\n } catch (err) {\n if (onError) return onError(err.message);\n return error(err.message);\n }\n return onSuccess(parsed);\n }, onError);\n },\n\n isString(x) {\n // https://stackoverflow.com/a/17772086/1426569\n return Object.prototype.toString.call(x) === '[object String]';\n },\n\n isObject(x) {\n // https://stackoverflow.com/a/14706877/1426569\n return !Array.isArray(x) && x === Object(x);\n },\n\n offset(el) {\n const rect = el.getBoundingClientRect();\n return {\n top: rect.top + document.body.scrollTop,\n left: rect.left + document.body.scrollLeft\n };\n }\n };\n\n function generateRandom(distribution, size) {\n // TODO: Math.random is of low quality on older browsers\n // but Xorshift128+ on newer\n\n // from https://stackoverflow.com/a/36481059/1426569\n // Standard Normal variate using Box-Muller transform\n function randnBoxMuller() {\n let u = 0; let\n v = 0;\n while (u === 0) u = Math.random(); // Converting [0,1) to (0,1)\n while (v === 0) v = Math.random();\n return Math.sqrt(-2.0 * Math.log(u)) * Math.cos(2.0 * Math.PI * v);\n }\n\n const generate = () => {\n switch (distribution) {\n case 'uniform':\n return Math.random();\n case 'normal':\n return randnBoxMuller();\n default:\n return error(`invalid random distribution ${distribution}`);\n }\n };\n\n const sample = [];\n for (let i = 0; i < size; ++i) {\n sample.push(generate());\n }\n return sample;\n }\n\n function Shader(shaderParams, shaderFolder) {\n const time0 = new Date().getTime();\n const textures = {};\n this.source = null;\n this.params = shaderParams;\n\n const checkLoaded = () => {\n if (anyErrors) return;\n if (Object.values(textures).filter(x => x === null).length > 0) return;\n if (this.source === null) return;\n init();\n };\n\n const doStart = (shaderSource) => {\n // console.log(shaderSource);\n this.source = shaderSource;\n checkLoaded();\n };\n\n if (shaderParams.source) {\n setTimeout(() => doStart(shaderParams.source), 0);\n } else if (shaderParams.source_path) {\n helpers.getFile(shaderFolder + shaderParams.source_path, doStart);\n } else {\n return error('No shader source code defined');\n }\n\n function buildFixed(value) {\n if (Array.isArray(value)) {\n return new Float32Array(value);\n }\n return value;\n }\n\n function buildRandom(val) {\n // TODO: this encoding is silly\n const parts = val.split('_');\n const distribution = parts[1];\n\n let size = 1;\n if (parts.length > 2) {\n size = parts[2];\n if (parts.length > 3 || size > 4) {\n throw new Error(`invalid random ${val}`);\n }\n }\n\n if (size > 1) {\n return () => new Float32Array(generateRandom(distribution, size));\n }\n return () => generateRandom(distribution, 1)[0];\n }\n\n function buildDynamic(val) {\n switch (val) {\n case 'time':\n return () => (new Date().getTime() - time0) / 1000.0;\n case 'resolution':\n return () => new Float32Array([\n resolution.x,\n resolution.y\n ]);\n case 'mouse':\n return () => new Float32Array([\n mousePos.x,\n mousePos.y\n ]);\n case 'relative_mouse':\n return () => new Float32Array([\n mousePos.rel_x,\n mousePos.rel_y\n ]);\n case 'frame_number':\n return () => frameNumber;\n case 'previous_frame':\n return () => {\n const curBuffer = frameNumber % 2;\n return frameBuffers[1 - curBuffer].attachments[0];\n };\n default:\n if (val.startsWith('random_')) {\n return buildRandom(val);\n }\n\n throw new Error(`invalid uniform mapping ${val}`);\n }\n }\n\n this.uniforms = {};\n\n const loadTexture = (symbol, filename, options = {}) => {\n textures[symbol] = null;\n twgl.createTexture(gl, Object.assign({\n src: filename,\n mag: gl.NEAREST,\n min: gl.NEAREST\n }, options), (err, tex) => {\n if (err) {\n return error(err);\n }\n textures[symbol] = tex;\n this.uniforms[symbol] = tex;\n return checkLoaded();\n });\n };\n\n const loadTextureArray = (textureArray, options = {}) => {\n let array = [...textureArray];\n // flatten\n while (array[0].length > 1) array = array.reduce((a, b) => a.concat(b));\n array = new Float32Array(array);\n\n gl.getExtension('OES_texture_float');\n return twgl.createTexture(gl, Object.assign({\n src: array,\n format: gl.RGBA,\n type: gl.FLOAT,\n mag: gl.NEAREST,\n min: gl.NEAREST,\n wrap: gl.CLAMP_TO_EDGE,\n width: array.length / 4,\n height: 1,\n auto: false\n }, options));\n };\n\n const boundUniforms = {};\n\n Object.keys(shaderParams.uniforms).forEach((key) => {\n const val = shaderParams.uniforms[key];\n\n try {\n if (helpers.isString(val)) {\n const builder = buildDynamic(val);\n boundUniforms[key] = builder;\n } else if (helpers.isObject(val)) {\n if (val.file) {\n loadTexture(key, shaderFolder + val.file);\n } else if (val.data) {\n this.uniforms[key] = loadTextureArray(val.data, {\n width: val.data[0].length,\n height: val.length\n });\n } else if (val.random) {\n const generate = () => new Float32Array(\n generateRandom(val.random.distribution, val.random.size * 4)\n );\n\n const tex = loadTextureArray(generate());\n this.uniforms[key] = tex;\n boundUniforms[key] = () => {\n gl.bindTexture(gl.TEXTURE_2D, tex);\n const internalFormat = gl.RGBA;\n const format = internalFormat;\n const width = val.random.size;\n const height = 1;\n const type = gl.FLOAT;\n gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat,\n width, height, 0, format, type, generate());\n return tex;\n };\n } else if (val.dynamic) {\n boundUniforms[key] = () => buildFixed(val.dynamic());\n } else if (val.default) {\n this.uniforms[key] = buildFixed(val.default);\n } else {\n throw new Error(`invalid uniform ${JSON.stringify(val)}`);\n }\n } else {\n this.uniforms[key] = buildFixed(val);\n }\n } catch (err) {\n error(err.message);\n }\n });\n\n this.update = () => {\n Object.keys(boundUniforms).forEach((key) => {\n this.uniforms[key] = boundUniforms[key]();\n });\n };\n }\n\n function parseShaderErrorWithContext(msg, code) {\n const match = /\\**\\s*ERROR:\\s*\\d+:(\\d+)/.exec(msg);\n const errorLineNo = match && match[1];\n if (errorLineNo) {\n const lines = code.split('\\n');\n const i = parseInt(errorLineNo, 10) - 1;\n const context = [i - 1, i, i + 1].map(j => ({ lineNo: j + 1, line: lines[j] }))\n .filter(x => x.line !== undefined)\n .map(x => `${x.lineNo}: ${x.line}`)\n .join('\\n');\n\n return `${msg}\\n${context}`;\n }\n\n return `Shader error: ${msg}`;\n }\n\n const init = () => {\n this.fragmentShaderSource = RAW_FRAGMENT_SHADER_PREFIX + shader.source;\n const programInfo = twgl.createProgramInfo(gl, [\n VERTEX_SHADER_SOURCE,\n this.fragmentShaderSource\n ], {\n errorCallback: (sourceAndError) => {\n const src = this.fragmentShaderSource;\n const errorMsg = sourceAndError.split('\\n').slice(src.split('\\n').length).join('\\n');\n error(parseShaderErrorWithContext(errorMsg, src));\n }\n });\n\n const flipY = shader.params.flip_y;\n let gamma = shader.params.gamma || 1.0;\n\n let postprocessor;\n if (parseFloat(gamma) === 1.0) {\n postprocessor = twgl.createProgramInfo(gl, [\n VERTEX_SHADER_SOURCE,\n RAW_FRAGMENT_SHADER_PREFIX + buildCopyFragmentShader(flipY)\n ], { errorCallback: error });\n gamma = null;\n } else if (gamma.toUpperCase && gamma.toUpperCase() === 'SRGB') {\n postprocessor = twgl.createProgramInfo(gl, [\n VERTEX_SHADER_SOURCE,\n RAW_FRAGMENT_SHADER_PREFIX + buildSRGBFragmentShader(flipY)\n ], { errorCallback: error });\n gamma = null;\n } else {\n postprocessor = twgl.createProgramInfo(gl, [\n VERTEX_SHADER_SOURCE,\n RAW_FRAGMENT_SHADER_PREFIX + buildGammaCorrectionFragmentShader(flipY)\n ], { errorCallback: error });\n gamma = parseFloat(gamma);\n }\n\n if (!programInfo || !postprocessor) return;\n\n const arrays = {\n position: [-1, -1, 0, 1, -1, 0, -1, 1, 0, -1, 1, 0, 1, -1, 0, 1, 1, 0]\n };\n const bufferInfo = twgl.createBufferInfoFromArrays(gl, arrays);\n\n function checkResize() {\n const width = gl.canvas.clientWidth;\n const height = gl.canvas.clientHeight;\n if (gl.canvas.width !== width\n || gl.canvas.height !== height) {\n gl.canvas.width = width;\n gl.canvas.height = height;\n onResize();\n }\n }\n\n render = (division = 0, nDivisions = 1) => {\n try {\n const firstDivision = division === 0;\n const lastDivision = division === nDivisions - 1;\n checkResize();\n if (shader.params.dynamic_reset && shader.params.dynamic_reset()) {\n frameNumber = 0;\n }\n\n resolution = {\n x: gl.canvas.clientWidth,\n y: gl.canvas.clientHeight\n };\n\n if (firstDivision) {\n shader.update();\n if (anyErrors) return;\n }\n\n gl.useProgram(programInfo.program);\n twgl.setBuffersAndAttributes(gl, programInfo, bufferInfo);\n twgl.setUniforms(programInfo, shader.uniforms);\n\n // TODO: rather undescriptive\n if (!shader.params.monte_carlo && !shader.params.float_buffers) {\n // render directly to screen\n twgl.drawBufferInfo(gl, bufferInfo);\n } else {\n const currentTarget = frameBuffers[frameNumber % 2];\n\n twgl.bindFramebufferInfo(gl, currentTarget);\n\n if (nDivisions > 1) {\n const rowsBegin = Math.floor(division / nDivisions * resolution.y);\n const rowsEnd = Math.floor((division + 1) / nDivisions * resolution.y);\n gl.enable(gl.SCISSOR_TEST);\n gl.scissor(0, rowsBegin, resolution.x, rowsEnd - rowsBegin);\n twgl.drawBufferInfo(gl, bufferInfo);\n gl.disable(gl.SCISSOR_TEST);\n } else {\n twgl.drawBufferInfo(gl, bufferInfo);\n }\n\n // renderer.render( scene, camera, currentTarget );\n\n if (lastDivision && frameNumber % this.refreshEvery === 0) {\n const uniforms = {\n source: currentTarget.attachments[0],\n resolution: [resolution.x, resolution.y]\n };\n\n if (gamma) {\n uniforms.gamma = gamma;\n }\n\n gl.useProgram(postprocessor.program);\n twgl.bindFramebufferInfo(gl, null);\n twgl.setBuffersAndAttributes(gl, postprocessor, bufferInfo);\n twgl.setUniforms(postprocessor, uniforms);\n\n twgl.drawBufferInfo(gl, bufferInfo);\n if (this.captureCallback) {\n this.captureCallback(canvas.toDataURL('image/png', 1));\n this.captureCallback = null;\n }\n }\n }\n if (lastDivision) frameNumber++;\n } catch (err) {\n error(err.message);\n }\n };\n\n if (shader.params.resolution) {\n canvas.width = shader.params.resolution[0];\n canvas.height = shader.params.resolution[1];\n }\n\n onResize();\n\n // TODO: canvas\n document.onmousemove = (e) => {\n mousePos.x = e.pageX - container.offsetLeft;\n mousePos.y = e.pageY - container.offsetTop;\n mousePos.rel_x = mousePos.x / container.offsetWidth;\n mousePos.rel_y = mousePos.y / container.offsetHeight;\n };\n\n animate();\n };\n\n function onResize() {\n const width = gl.drawingBufferWidth;\n const height = gl.drawingBufferHeight;\n\n // console.log(`resize ${width}x${height}`);\n\n // https://webglfundamentals.org/webgl/lessons/webgl-anti-patterns.html\n gl.viewport(0, 0, width, height);\n\n // TODO rather undescriptive\n if (shader.params.monte_carlo || shader.params.float_buffers) {\n const attachments = [{\n format: gl.RGBA,\n type: gl.FLOAT,\n min: gl.NEAREST,\n mag: gl.NEAREST,\n wrap: gl.CLAMP_TO_EDGE\n }];\n\n if (frameBuffers) {\n frameBuffers.forEach(fb => twgl.resizeFramebufferInfo(gl, fb, attachments, width, height));\n } else {\n gl.getExtension('OES_texture_float');\n // TODO: are these always zero or do they have to be initialized?\n frameBuffers = [\n twgl.createFramebufferInfo(gl, attachments, width, height),\n twgl.createFramebufferInfo(gl, attachments, width, height)\n ];\n }\n }\n frameNumber = 0;\n }\n\n this.setLoadProfile = (load) => {\n if (load < 0) {\n this.nDivisions = -load;\n this.refreshEvery = 1;\n this.frameGap = 30;\n } else if (load < 1) {\n this.refreshEvery = 5;\n this.nDivisions = 1;\n this.frameGap = Math.ceil((1.0 - load) * 29) + 1;\n } else {\n this.nDivisions = 1;\n this.refreshEvery = 10;\n this.batchSize = Math.round(load);\n this.frameGap = 0;\n }\n };\n\n this.setLoadProfile(1);\n\n const animate = () => {\n this.running = true;\n if (shader.params.monte_carlo) {\n let nDivisions = this.nDivisions;\n if (!shader.params.batch_size) {\n this.batchSize = 1;\n } else {\n this.batchSize = shader.params.batch_size;\n }\n\n let curDivision = 0;\n const renderFrame = () => {\n if (!this.running) return;\n\n if (curDivision === 0) {\n nDivisions = this.nDivisions;\n }\n for (let i = 0; i < this.batchSize; ++i) {\n render(curDivision, nDivisions);\n curDivision = (curDivision + 1) % nDivisions;\n }\n\n if (this.frameGap > 1) {\n setTimeout(() => {\n if (this.running) requestAnimationFrame(renderFrame);\n }, this.frameGap);\n } else {\n // with small frame gap, render at maximum speed by dropping\n // requestAnimationFrame, which has a high risk of freezing the\n // UI if the GPU cannot keep up\n setTimeout(renderFrame, this.frameGap);\n }\n };\n\n setTimeout(renderFrame, 0);\n\n this.stop = () => {\n this.running = false;\n };\n } else {\n // capped frame rate\n const timer = requestAnimationFrame(animate);\n this.stop = () => {\n cancelAnimationFrame(timer);\n this.running = false;\n };\n render();\n }\n };\n\n this.resume = () => { animate(); };\n\n function startShader({ shaderUrl, shaderSpec }) {\n function getFolderName(str) {\n const parts = str.split('/');\n if (parts.length === 1) return '';\n parts.pop();\n let folder = parts.join('/');\n if (parts.pop() !== '') folder += '/'; // add trailing /\n return folder;\n }\n\n let shaderFolder = '';\n\n function doStart(shaderParams) {\n if (!shaderParams) {\n error('missing shader spec!');\n }\n this.refreshEvery = parseInt(shaderParams.refresh_every || 1, 10);\n shader = new Shader(shaderParams, shaderFolder);\n }\n\n if (shaderUrl) {\n if (shaderSpec) return error(\"can't have both url and spec\");\n shaderFolder = getFolderName(shaderUrl);\n helpers.getJSON(shaderUrl, doStart);\n } else {\n doStart(shaderSpec);\n }\n return null;\n }\n\n startShader({ shaderUrl: url, shaderSpec: spec });\n}", "function glsl() {\n return {\n transform(code, id) {\n if (/\\.glsl$/.test(id) === false) return;\n\n var transformedCode = 'export default ' + JSON.stringify(\n code\n .replace(/[ \\t]*\\/\\/.*\\n/g, '') // remove //\n .replace(/[ \\t]*\\/\\*[\\s\\S]*?\\*\\//g, '') // remove /* */\n .replace(/\\n{2,}/g, '\\n') // # \\n+ to \\n\n ) + ';';\n return {\n code: transformedCode,\n map: {mappings: ''}\n };\n }\n };\n}", "function setupShaders() {\n \n // define vertex shader in essl using es6 template strings\n var vShaderCode = `\n attribute vec3 aVertexPosition; // vertex position\n \n uniform mat4 umMatrix; // the model matrix\n uniform mat4 upvmMatrix; // the project view model matrix\n\n uniform float xtranslate;\n uniform float ytranslate;\n uniform float ztranslate;\n \n varying vec3 vWorldPos; // interpolated world position of vertex\n\n void main(void) {\n \n vec4 vWorldPos4 = umMatrix * vec4(aVertexPosition, 1.0);\n vWorldPos = vec3(vWorldPos4.x,vWorldPos4.y,vWorldPos4.z);\n gl_Position = upvmMatrix * vec4(aVertexPosition[0] + xtranslate, aVertexPosition[1] + ytranslate, aVertexPosition[2] + ztranslate, 1.0);\n }\n `;\n \n // define fragment shader in essl using es6 template strings\n var fShaderCode = `\n precision mediump float; // set float to medium precision\n\n // eye location\n uniform vec3 uEyePosition; // the eye's position in world\n \n // light properties\n uniform vec3 uLightDiffuse; // the light's diffuse color\n uniform vec3 uLightPosition; // the light's position\n \n // material properties\n uniform vec3 uDiffuse; // the diffuse reflectivity\n\n // transparency\n uniform float uTransp;\n \n // geometry properties\n varying vec3 vWorldPos; // world xyz of fragment\n \n void main(void) {\n \n vec3 diffuse = uDiffuse*uLightDiffuse;\n \n vec3 colorOut = diffuse;\n gl_FragColor = vec4(colorOut, uTransp); \n }\n `;\n \n try {\n var fShader = gl.createShader(gl.FRAGMENT_SHADER); // create frag shader\n gl.shaderSource(fShader,fShaderCode); // attach code to shader\n gl.compileShader(fShader); // compile the code for gpu execution\n\n var vShader = gl.createShader(gl.VERTEX_SHADER); // create vertex shader\n gl.shaderSource(vShader,vShaderCode); // attach code to shader\n gl.compileShader(vShader); // compile the code for gpu execution\n \n if (!gl.getShaderParameter(fShader, gl.COMPILE_STATUS)) { // bad frag shader compile\n throw \"error during fragment shader compile: \" + gl.getShaderInfoLog(fShader); \n gl.deleteShader(fShader);\n } else if (!gl.getShaderParameter(vShader, gl.COMPILE_STATUS)) { // bad vertex shader compile\n throw \"error during vertex shader compile: \" + gl.getShaderInfoLog(vShader); \n gl.deleteShader(vShader);\n } else { // no compile errors\n var shaderProgram = gl.createProgram(); // create the single shader program\n gl.attachShader(shaderProgram, fShader); // put frag shader in program\n gl.attachShader(shaderProgram, vShader); // put vertex shader in program\n gl.linkProgram(shaderProgram); // link program into gl context\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { // bad program link\n throw \"error during shader program linking: \" + gl.getProgramInfoLog(shaderProgram);\n } else { // no shader program link errors\n gl.useProgram(shaderProgram); // activate shader program (frag and vert)\n \n // locate and enable vertex attributes\n vPosAttribLoc = gl.getAttribLocation(shaderProgram, \"aVertexPosition\"); // ptr to vertex pos attrib\n gl.enableVertexAttribArray(vPosAttribLoc); // connect attrib to array\n \n // locate vertex uniforms\n mMatrixULoc = gl.getUniformLocation(shaderProgram, \"umMatrix\"); // ptr to mmat\n pvmMatrixULoc = gl.getUniformLocation(shaderProgram, \"upvmMatrix\"); // ptr to pvmmat\n \n // locate fragment uniforms\n var eyePositionULoc = gl.getUniformLocation(shaderProgram, \"uEyePosition\"); // ptr to eye position\n var lightDiffuseULoc = gl.getUniformLocation(shaderProgram, \"uLightDiffuse\"); // ptr to light diffuse\n var lightPositionULoc = gl.getUniformLocation(shaderProgram, \"uLightPosition\"); // ptr to light position\n diffuseULoc = gl.getUniformLocation(shaderProgram, \"uDiffuse\"); // ptr to diffuse\n transpULoc = gl.getUniformLocation(shaderProgram, \"uTransp\"); \n xTransULoc = gl.getUniformLocation(shaderProgram, \"xtranslate\"); \n yTransULoc = gl.getUniformLocation(shaderProgram, \"ytranslate\"); \n zTransULoc = gl.getUniformLocation(shaderProgram, \"ztranslate\"); \n \n // pass global constants into fragment uniforms\n gl.uniform3fv(eyePositionULoc,Eye); // pass in the eye's position\n gl.uniform3fv(lightDiffuseULoc,lightDiffuse); // pass in the light's diffuse emission\n gl.uniform3fv(lightPositionULoc,lightPosition); // pass in the light's position\n } // end if no shader program link errors\n } // end if no compile errors\n } // end try \n \n catch(e) {\n console.log(e);\n } // end catch\n} // end setup shaders", "function _processGLSL(str, inputs, textureSlot) {\n return str\n .replace(/%\\d/g, function (s) {\n return _makeLabel(inputs[s[1]-1]);\n })\n .replace(/\\$TEXTURE/, 'u_textures[' + textureSlot + ']');\n}", "function updateShader(name) {\n var oldparams = shaders[name].parseData.params;\n shaders[name].update();\n for (var i in chain) {\n\tif (chain[i].name != name) continue;\n\tfor (var j in oldparams) {\n\t if (!shaders[name].parseData.params[j] || shaders[name].parseData.params[j] != oldparams[j]) {\n\t\tchain[i].uniforms[j] = undefined;\n\t\t$('#ui-'+chain[i].id+\"-\"+j).remove();\n\t }\n\t}\t\n\tvar gen = generateUI(chain[i]);\n\t$.extend(chain[i].uniforms,gen.deflt);\n\t$('#ui-'+chain[i].id).append(gen.html);\n\tchain[i].updateGLOW();\n }\n}", "function linestringEquals(a, b) {\n if (!a || !b || a.length !== b.length) {\n return false;\n }\n var aLen = a.geometry.coordinates.length;\n var bLen = b.geometry.coordinates.length;\n var aFirst = a.geometry.coordinates[0];\n var bFirst = b.geometry.coordinates[0];\n var aLast = a.geometry.coordinates[aLen - 1];\n var bLast = b.geometry.coordinates[bLen - 1];\n if (aFirst[0] === bFirst[0] && aFirst[1] === bFirst[1] &&\n aLast[0] === bLast[0] && aLast[1] === bLast[1]) {\n return true;\n } else {\n return false;\n }\n }", "function getVShaderCode() {\n return `\n attribute vec3 vertexPosition;\n attribute vec3 vertexNormal;\n attribute vec2 textureUV;\n\n uniform mat4 uMMatrix; // Model transformation\n uniform mat4 uVMatrix; // Viewing transformation\n uniform mat4 uPMatrix; // Projection transformation\n uniform mat3 uNMatrix; // Normal vector transformation\n uniform vec3 uCameraPos; // Camera position\n uniform bool uDoubleSide;\n \n varying vec3 vTransformedNormal;\n varying vec4 vPosition;\n varying vec3 vCameraDirection;\n varying vec2 vTextureUV;\n\n void main(void) {\n vPosition = uMMatrix * vec4(vertexPosition, 1.0);\n vTextureUV = textureUV;\n vCameraDirection = uCameraPos - vPosition.xyz;\n gl_Position = uPMatrix * uVMatrix * vPosition;\n vTransformedNormal = uNMatrix * vertexNormal;\n if(uDoubleSide && dot(vCameraDirection, vTransformedNormal) < 0.0)\n vTransformedNormal = -vTransformedNormal;\n }\n `;\n }", "function getVShaderCode() {\n return `\n attribute vec3 vertexPosition;\n attribute vec3 vertexNormal;\n attribute vec2 textureUV;\n\n uniform mat4 uMMatrix; // Model transformation\n uniform mat4 uVMatrix; // Viewing transformation\n uniform mat4 uPMatrix; // Projection transformation\n uniform mat3 uNMatrix; // Normal vector transformation\n uniform vec3 uCameraPos; // Camera position\n uniform bool uDoubleSide;\n \n varying vec3 vTransformedNormal;\n varying vec4 vPosition;\n varying vec3 vCameraDirection;\n varying vec2 vTextureUV;\n\n void main(void) {\n vPosition = uMMatrix * vec4(vertexPosition, 1.0);\n vTextureUV = textureUV;\n vCameraDirection = uCameraPos - vPosition.xyz;\n gl_Position = uPMatrix * uVMatrix * vPosition;\n vTransformedNormal = uNMatrix * vertexNormal;\n if(uDoubleSide && dot(vCameraDirection, vTransformedNormal) < 0.0)\n vTransformedNormal = -vTransformedNormal;\n }\n `;\n }", "function updateBuffers1(){\n\n //everytime i+3 means change the x coordinate for the top butters\n for(var i = 0; i < 15; i=i+3){\n triangleVerticestop[i] = triangleVerticestop[i] - 0.03*Math.sin(2*Math.PI*((framecount)/ 20.0));\n }\n \n \n for(var i = 15; i < triangleVerticestop.length; i=i+3){\n triangleVerticestop[i] = triangleVerticestop[i] + 0.03*Math.sin(2*Math.PI*((framecount)/ 20.0));\n }\n\n //everytime i+3 means change the x coordinate for the bottom butters\n for(var i = 0; i < 15; i=i+3){\n triangleVerticesmid[i] = triangleVerticesmid[i] + 0.03*Math.sin(2*Math.PI*((framecount)/ 20.0));\n }\n \n \n for(var i = 15; i < triangleVerticestop.length; i=i+3){\n triangleVerticesmid[i] = triangleVerticesmid[i] - 0.03*Math.sin(2*Math.PI*((framecount)/ 20.0));\n }\n\n\n //update the top buffers new positions\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffertop);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVerticestop), gl.DYNAMIC_DRAW);\n vertexPositionBuffertop.itemSize = 3;\n vertexPositionBuffertop.numberOfItems = 8;\n //update the bottom buffers new positions\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffermid);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVerticesmid), gl.DYNAMIC_DRAW);\n vertexPositionBuffermid.itemSize = 3;\n vertexPositionBuffermid.numberOfItems = 8;\n\n}", "function horizontalSymmetry(gameMap){\n \n //We check the first line of squares and compare with the last line of squares\n //Then we check the next line and so forth\n for (let i = 0; i < 4/*gameMap.length/2*/; i++) {\n for (let j = 0; j < gameMap[i].length; j++) {\n if (gameMap[i][j] !== gameMap[gameMap.length - i - 1][j]) {\n return false;\n }\n }\n }\n return true;\n}", "function updateBuffers2(){\n\n //change both x and y coordinates of 4 vertex of the top of Letter 'I'\n for (var i = 3;i < 9; i++) {\n triangleVerticestop[i] = triangleVerticestop[i] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n };\n for (var i = 18;i < 24; i++) {\n triangleVerticestop[i] = triangleVerticestop[i] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20));\n };\n //change both x and y coordinates of 4 vertex of the bommon of Letter 'I'\n for (var i = 3;i < 9; i++) {\n triangleVerticesmid[i] = triangleVerticesmid[i] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n };\n for (var i = 18;i < 24; i++) {\n triangleVerticesmid[i] = triangleVerticesmid[i] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n };\n\n //update the top buffers new positions\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffertop);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVerticestop), gl.DYNAMIC_DRAW);\n vertexPositionBuffertop.itemSize = 3;\n vertexPositionBuffertop.numberOfItems = 8;\n //update the bommon buffers new positions\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffermid);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVerticesmid), gl.DYNAMIC_DRAW);\n vertexPositionBuffermid.itemSize = 3;\n vertexPositionBuffermid.numberOfItems = 8;\n\n}", "function getUnpackAndPreprocessInputShader(gpgpu, inputShapeRC, useFloatTextures) {\n var setOutputSnippet = void 0;\n\n if (useFloatTextures) {\n setOutputSnippet = '\\n void setOutput(float decodedValue) {\\n gl_FragColor = vec4(decodedValue, 0, 0, 0);\\n }\\n ';\n } else {\n setOutputSnippet = '\\n const vec4 floatPowers = vec4(\\n 1.0,\\n 255.0,\\n 255.0 * 255.0,\\n 255.0 * 255.0 * 255.0\\n );\\n\\n const float maxValue = 20000.0;\\n const float minValue = -maxValue;\\n const float range = (maxValue - minValue) / 255.0;\\n\\n const vec2 recipRange = vec2(1.0/range);\\n const vec2 recipRange255 = vec2(1.0/(maxValue - minValue));\\n\\n void setOutput(float decodedValue) {\\n float a = dot(vec2(decodedValue, -minValue), recipRange);\\n float b = fract(a) * 255.0;\\n float c = fract(b) * 255.0;\\n float d = fract(c) * 255.0;\\n gl_FragColor = floor(vec4(a, b, c, d)) / 255.0;\\n }\\n ';\n }\n\n var fragmentShaderSource = '\\n precision highp float;\\n uniform sampler2D source;\\n varying vec2 resultUV;\\n\\n const vec2 inputShapeCR = vec2(' + inputShapeRC[1] + '.0, ' + inputShapeRC[0] + '.0);\\n\\n const vec2 halfCR = vec2(0.5, 0.5);\\n\\n ' + setOutputSnippet + '\\n\\n void main() {\\n vec2 outputCR = floor(gl_FragCoord.xy);\\n\\n vec2 sourceCR = vec2(floor(outputCR[0] / 3.0), outputCR[1]);\\n vec2 sourceUV = (sourceCR + halfCR) / inputShapeCR;\\n\\n vec4 sourceValue = texture2D(source, sourceUV) * 255.0;\\n\\n float channelValue = 0.0;\\n int channel = int(mod(outputCR[0], 3.0));\\n\\n if (channel == 0) {\\n channelValue = sourceValue.r - 103.939;\\n } else if (channel == 1) {\\n channelValue = sourceValue.g - 116.779;\\n } else if (channel == 2) {\\n channelValue = sourceValue.b - 123.68;\\n }\\n\\n setOutput(channelValue);\\n }';\n\n return gpgpu.createProgram(fragmentShaderSource);\n}", "function compareByGeneratedPositionsInflated(mappingA, mappingB) {\n\t var cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = strcmp(mappingA.source, mappingB.source);\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return strcmp(mappingA.name, mappingB.name);\n\t}", "function compareByGeneratedPositionsInflated(mappingA, mappingB) {\n\t var cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = strcmp(mappingA.source, mappingB.source);\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return strcmp(mappingA.name, mappingB.name);\n\t}", "function drawStuff() {\n // /ladowanie shaderow do programu\n var canvas = document.getElementById('MyFirstCanvas');\n var gl = canvas.getContext(\"webgl\");\n console.log(gl);\n if (!gl) {\n console.log('webGl nie bangla');\n return;\n }\n\n gl.viewportwidth = canvas.width;\n gl.viewportheight = canvas.height;\n\n var pixelShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(pixelShader, FSHADER_SOURCE);\n gl.compileShader(pixelShader);\n\n var vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader, VSHADER_SOURCE);\n gl.compileShader(vertexShader);\n\n var program = gl.createProgram();\n\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, pixelShader);\n gl.linkProgram(program);\n\n gl.useProgram(program);\n gl.program = program;\n\n\n // czyszczenie bufora:\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n gl.clearDepth(1.0);\n gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT);\n\n\n var texturedVertices = new Float32Array\n (\n [ // wspolrz.: // wspolrz. tekstury:\n\n // podloze:\n -0.5, -0.5, -0.5, 0.25, 0.25,\n -0.5, -0.5, 0.5, 0.25, 0.5,\n 0.5, -0.5, -0.5, 0.5, 0.25,\n 0.5, -0.5, -0.5, 0.5, 0.25,\n -0.5, -0.5, 0.5, 0.25, 0.5,\n 0.5, -0.5, 0.5, 0.5, 0.5,\n\n // szescian:\n -0.1, -0.1, 0.1, 0.5, 0.5,\n 0.1, -0.1, 0.1, 1.0, 0.5,\n -0.1, -0.1, -0.1, 0.5, 0.75,\n -0.1, -0.1, -0.1, 0.5, 0.75,\n 0.1, -0.1, 0.1, 1.0, 0.5,\n 0.1, -0.1, -0.1, 1.0, 0.75,\n\n -0.1, -0.1, -0.1, 0.5, 0.0,\n 0.1, -0.1, -0.1, 1.0, 0.0,\n -0.1, 0.1, -0.1, 0.5, 0.25,\n -0.1, 0.1, -0.1, 0.5, 0.25,\n 0.1, -0.1, -0.1, 1.0, 0.0,\n 0.1, 0.1, -0.1, 1.0, 0.25,\n\n -0.1, -0.1, 0.1, 0.0, 0.5,\n -0.1, -0.1, -0.1, 0.0, 0.25,\n -0.1, 0.1, 0.1, 0.5, 0.5,\n -0.1, 0.1, 0.1, 0.5, 0.5,\n -0.1, -0.1, -0.1, 0.0, 0.25,\n -0.1, 0.1, -0.1, 0.5, 0.25,\n\n -0.1, -0.1, 0.1, 0.0, 0.25,\n 0.1, -0.1, 0.1, 0.5, 0.25,\n -0.1, 0.1, 0.1, 0.0, 0.0,\n -0.1, 0.1, 0.1, 0.0, 0.0,\n 0.1, -0.1, 0.1, 0.5, 0.25,\n 0.1, 0.1, 0.1, 0.5, 0.0,\n\n 0.1, -0.1, 0.1, 1.0, 0.5,\n 0.1, 0.1, 0.1, 0.5, 0.5,\n 0.1, -0.1, -0.1, 1.0, 0.25,\n 0.1, -0.1, -0.1, 1.0, 0.25,\n 0.1, 0.1, 0.1, 0.5, 0.5,\n 0.1, 0.1, -0.1, 0.5, 0.25,\n\n 0.1, 0.1, 0.1, 0.5, 0.75,\n 0.1, 0.1, -0.1, 0.5, 0.5,\n -0.1, 0.1, 0.1, 0.0, 0.75,\n -0.1, 0.1, 0.1, 0.0, 0.75,\n 0.1, 0.1, -0.1, 0.5, 0.5,\n -0.1, 0.1, -0.1, 0.0, 0.5,\n\n\n // sfera:\n -0.1, -0.1, 0.1, 0.5, 0.5,\n 0.1, -0.1, 0.1, 1.0, 0.5,\n -0.1, -0.1, -0.1, 0.5, 0.75,\n -0.1, -0.1, -0.1, 0.5, 0.75,\n 0.1, -0.1, 0.1, 1.0, 0.5,\n 0.1, -0.1, -0.1, 1.0, 0.75,\n\n -0.1, -0.1, -0.1, 0.5, 0.0,\n 0.1, -0.1, -0.1, 1.0, 0.0,\n -0.1, 0.1, -0.1, 0.5, 0.25,\n -0.1, 0.1, -0.1, 0.5, 0.25,\n 0.1, -0.1, -0.1, 1.0, 0.0,\n 0.1, 0.1, -0.1, 1.0, 0.25,\n\n -0.1, -0.1, 0.1, 0.0, 0.5,\n -0.1, -0.1, -0.1, 0.0, 0.25,\n -0.1, 0.1, 0.1, 0.5, 0.5,\n -0.1, 0.1, 0.1, 0.5, 0.5,\n -0.1, -0.1, -0.1, 0.0, 0.25,\n -0.1, 0.1, -0.1, 0.5, 0.25,\n\n -0.1, -0.1, 0.1, 0.0, 0.25,\n 0.1, -0.1, 0.1, 0.5, 0.25,\n -0.1, 0.1, 0.1, 0.0, 0.0,\n -0.1, 0.1, 0.1, 0.0, 0.0,\n 0.1, -0.1, 0.1, 0.5, 0.25,\n 0.1, 0.1, 0.1, 0.5, 0.0,\n\n 0.1, -0.1, 0.1, 1.0, 0.5,\n 0.1, 0.1, 0.1, 0.5, 0.5,\n 0.1, -0.1, -0.1, 1.0, 0.25,\n 0.1, -0.1, -0.1, 1.0, 0.25,\n 0.1, 0.1, 0.1, 0.5, 0.5,\n 0.1, 0.1, -0.1, 0.5, 0.25,\n\n 0.1, 0.1, 0.1, 0.5, 0.75,\n 0.1, 0.1, -0.1, 0.5, 0.5,\n -0.1, 0.1, 0.1, 0.0, 0.75,\n -0.1, 0.1, 0.1, 0.0, 0.75,\n 0.1, 0.1, -0.1, 0.5, 0.5,\n -0.1, 0.1, -0.1, 0.0, 0.5\n ]\n );\n var N = texturedVertices.length / 6;\n var floorN = 6, cubeN = 36, sphereN = 36;\n\n var FSIZE = texturedVertices.BYTES_PER_ELEMENT; // rozmiar pojedynczego elementu w buforze\n\n\n // tworzenie bufora tekstury:\n var textureBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, textureBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(texturedVertices), gl.STATIC_DRAW);\n\n // tworzenie bufora punktow:\n var vertexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, texturedVertices, gl.STATIC_DRAW);\n\n\n // wyciaganie danych z shadera:\n\n var u_ViewMatrix = gl.getUniformLocation(gl.program, 'u_ViewMatrix'); // macierz perspektywy\n document.onkeydown = function(ev){ keydown(ev, gl, N, u_ViewMatrix, viewMatrix); }; // uruchamiamy obsluge klawiszy\n setLookAt(g_eyeX, g_eyeY, g_eyeZ, 0, 0, 0, 0, 1, 0);\n gl.uniformMatrix4fv(u_ViewMatrix, false, viewMatrix);\n\n var rMatrix = gl.getUniformLocation(gl.program, 'rmatrix'); // macierz rotacji\n gl.uniformMatrix4fv(rMatrix, false, identity);\n\n var tMatrix = gl.getUniformLocation(gl.program, 'tmatrix'); // macierz translacji\n gl.uniformMatrix4fv(tMatrix, false, identity);\n\n var position = gl.getAttribLocation(gl.program, 'position');\n gl.vertexAttribPointer(position, 3, gl.FLOAT, false, FSIZE * 5, 0);\n gl.enableVertexAttribArray(position);\n\n var a_TextCoord = gl.getAttribLocation(gl.program, 'aTexCoord');\n gl.vertexAttribPointer(a_TextCoord, 2, gl.FLOAT, false, FSIZE * 5, FSIZE * 3);\n gl.enableVertexAttribArray(a_TextCoord);\n\n\n // tworzenie tekstur (i rysowanie elementow sceny):\n var floor_u_Sampler = gl.getUniformLocation(gl.program, 'uSampler');\n var floorTexture = gl.createTexture();\n var floorImg = new Image();\n floorImg.src = \"basketStyle.jpg\";\n floorImg.onload = function(){ loadTextureSettings(gl, gl.TEXTURE0, floorTexture, floor_u_Sampler, 0, floorImg); };\n\n console.log(gl.TEXTURE0);\n\n gl.drawArrays(gl.TRIANGLES, 0, floorN);\n\n var cube_u_Sampler = gl.getUniformLocation(gl.program, 'uSampler');\n var cubeTexture = gl.createTexture();\n var cubeImg = new Image();\n cubeImg.src = \"pz_differentWalls.jpg\";\n cubeImg.onload = function(){ loadTextureSettings(gl, gl.TEXTURE1, cubeTexture, cube_u_Sampler, 1, cubeImg); };\n\n console.log(gl.TEXTURE1);\n\n gl.drawArrays(gl.TRIANGLES, floorN, cubeN);\n\n var sphere_u_Sampler = gl.getUniformLocation(gl.program, 'uSampler');\n var sphereTexture = gl.createTexture();\n var sphereImg = new Image();\n sphereImg.src = \"cracked.jpg\";\n sphereImg.onload = function(){ loadTextureSettings(gl, gl.TEXTURE2, sphereTexture, sphere_u_Sampler, 2, sphereImg); };\n\n console.log(gl.TEXTURE2);\n\n gl.drawArrays(gl.TRIANGLES, floorN + cubeN, sphereN);\n\n\n // animowanie sceny:\n var tick = function(){\n animate(gl, u_ViewMatrix, rMatrix, tMatrix, 0.5, floorN, cubeN, sphereN); // uruchamia animacje elementow sceny\n requestAnimationFrame(tick); // request that the browser calls tick\n };\n\n tick();\n}", "function preproc()\n{\n // nodal coordinates as passed to opengl\n let coords = []\n // 3 corner nodes of a face to compute the face normal in the shader\n let As = []\n let Bs = []\n let Cs = []\n // triangles as passed to open gl\n let trias = []\n // displacement vector per vertex to displace said vertex\n let disps = []\n // global min/max to normalize result amplitudes\n let min = 0.0\n let max = 0.0\n // texture coordinates to properly map results per face\n let texcoords = []\n // all four corner nodes to compute the texture mapping\n let corners = []\n\n // for each quad\n for(let i = 0; i < quads.length; ++i) {\n let quad = quads[i]\n // triangulate\n trias.push(4 * i + 0, 4 * i + 1, 4 * i + 2, 4 * i + 0, 4 * i + 2, 4 * i + 3)\n // set texture coordinates\n texcoords.push(\n 0.0, 0.0,\n 0.0, 1.0,\n 1.0, 1.0,\n 1.0, 0.0\n )\n // push coordinates\n coords.push(\n nodes[quad[0]][0],\n nodes[quad[0]][1],\n nodes[quad[0]][2],\n nodes[quad[1]][0],\n nodes[quad[1]][1],\n nodes[quad[1]][2],\n nodes[quad[2]][0],\n nodes[quad[2]][1],\n nodes[quad[2]][2],\n nodes[quad[3]][0],\n nodes[quad[3]][1],\n nodes[quad[3]][2])\n // push A,B and C corner nodes to compute the face normal\n As.push(\n nodes[quad[0]][0] + results[quad[0]][0],\n nodes[quad[0]][1] + results[quad[0]][1],\n nodes[quad[0]][2] + results[quad[0]][2],\n nodes[quad[0]][0] + results[quad[0]][0],\n nodes[quad[0]][1] + results[quad[0]][1],\n nodes[quad[0]][2] + results[quad[0]][2],\n nodes[quad[0]][0] + results[quad[0]][0],\n nodes[quad[0]][1] + results[quad[0]][1],\n nodes[quad[0]][2] + results[quad[0]][2],\n nodes[quad[0]][0] + results[quad[0]][0],\n nodes[quad[0]][1] + results[quad[0]][1],\n nodes[quad[0]][2] + results[quad[0]][2])\n Bs.push(\n nodes[quad[1]][0] + results[quad[1]][0],\n nodes[quad[1]][1] + results[quad[1]][1],\n nodes[quad[1]][2] + results[quad[1]][2],\n nodes[quad[1]][0] + results[quad[1]][0],\n nodes[quad[1]][1] + results[quad[1]][1],\n nodes[quad[1]][2] + results[quad[1]][2],\n nodes[quad[1]][0] + results[quad[1]][0],\n nodes[quad[1]][1] + results[quad[1]][1],\n nodes[quad[1]][2] + results[quad[1]][2],\n nodes[quad[1]][0] + results[quad[1]][0],\n nodes[quad[1]][1] + results[quad[1]][1],\n nodes[quad[1]][2] + results[quad[1]][2])\n Cs.push(\n nodes[quad[2]][0] + results[quad[2]][0],\n nodes[quad[2]][1] + results[quad[2]][1],\n nodes[quad[2]][2] + results[quad[2]][2],\n nodes[quad[2]][0] + results[quad[2]][0],\n nodes[quad[2]][1] + results[quad[2]][1],\n nodes[quad[2]][2] + results[quad[2]][2],\n nodes[quad[2]][0] + results[quad[2]][0],\n nodes[quad[2]][1] + results[quad[2]][1],\n nodes[quad[2]][2] + results[quad[2]][2],\n nodes[quad[2]][0] + results[quad[2]][0],\n nodes[quad[2]][1] + results[quad[2]][1],\n nodes[quad[2]][2] + results[quad[2]][2])\n // push displacements\n disps.push(\n results[quad[0]][0],\n results[quad[0]][1],\n results[quad[0]][2],\n results[quad[1]][0],\n results[quad[1]][1],\n results[quad[1]][2],\n results[quad[2]][0],\n results[quad[2]][1],\n results[quad[2]][2],\n results[quad[3]][0],\n results[quad[3]][1],\n results[quad[3]][2])\n min = [ \n results.reduce( (acc, v) => Math.min(acc, v[0]), 999999),\n results.reduce( (acc, v) => Math.min(acc, v[1]), 999999),\n results.reduce( (acc, v) => Math.min(acc, v[2]), 999999),\n results.reduce( (acc, v) => Math.min(acc, Math.sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2])), 999999)\n ]\n max = [ \n results.reduce( (acc, v) => Math.max(acc, v[0]), -999999),\n results.reduce( (acc, v) => Math.max(acc, v[1]), -999999),\n results.reduce( (acc, v) => Math.max(acc, v[2]), -999999),\n results.reduce( (acc, v) => Math.max(acc, Math.sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2])), 0)\n ]\n let result = state.component\n if(result == 3) {\n let sqr = (x) => x*x;\n corners.push(\n Math.sqrt(sqr(results[quad[0]][0]) + sqr(results[quad[0]][1]) + sqr(results[quad[0]][2])),\n Math.sqrt(sqr(results[quad[1]][0]) + sqr(results[quad[1]][1]) + sqr(results[quad[1]][2])),\n Math.sqrt(sqr(results[quad[2]][0]) + sqr(results[quad[2]][1]) + sqr(results[quad[2]][2])),\n Math.sqrt(sqr(results[quad[3]][0]) + sqr(results[quad[3]][1]) + sqr(results[quad[3]][2])),\n Math.sqrt(sqr(results[quad[0]][0]) + sqr(results[quad[0]][1]) + sqr(results[quad[0]][2])),\n Math.sqrt(sqr(results[quad[1]][0]) + sqr(results[quad[1]][1]) + sqr(results[quad[1]][2])),\n Math.sqrt(sqr(results[quad[2]][0]) + sqr(results[quad[2]][1]) + sqr(results[quad[2]][2])),\n Math.sqrt(sqr(results[quad[3]][0]) + sqr(results[quad[3]][1]) + sqr(results[quad[3]][2])),\n Math.sqrt(sqr(results[quad[0]][0]) + sqr(results[quad[0]][1]) + sqr(results[quad[0]][2])),\n Math.sqrt(sqr(results[quad[1]][0]) + sqr(results[quad[1]][1]) + sqr(results[quad[1]][2])),\n Math.sqrt(sqr(results[quad[2]][0]) + sqr(results[quad[2]][1]) + sqr(results[quad[2]][2])),\n Math.sqrt(sqr(results[quad[3]][0]) + sqr(results[quad[3]][1]) + sqr(results[quad[3]][2])),\n Math.sqrt(sqr(results[quad[0]][0]) + sqr(results[quad[0]][1]) + sqr(results[quad[0]][2])),\n Math.sqrt(sqr(results[quad[1]][0]) + sqr(results[quad[1]][1]) + sqr(results[quad[1]][2])),\n Math.sqrt(sqr(results[quad[2]][0]) + sqr(results[quad[2]][1]) + sqr(results[quad[2]][2])),\n Math.sqrt(sqr(results[quad[3]][0]) + sqr(results[quad[3]][1]) + sqr(results[quad[3]][2])))\n } else {\n corners.push(\n results[quad[0]][result],\n results[quad[1]][result],\n results[quad[2]][result],\n results[quad[3]][result],\n results[quad[0]][result],\n results[quad[1]][result],\n results[quad[2]][result],\n results[quad[3]][result],\n results[quad[0]][result],\n results[quad[1]][result],\n results[quad[2]][result],\n results[quad[3]][result],\n results[quad[0]][result],\n results[quad[1]][result],\n results[quad[2]][result],\n results[quad[3]][result])\n }\n // pick the appropriate min/max per the selected component\n max = max[result]\n min = min[result]\n \n }\n\n return {\n coords: coords,\n trias: trias,\n disps: disps,\n As: As,\n Bs: Bs,\n Cs, Cs,\n min: min,\n max: max,\n texcoords: texcoords,\n corners: corners\n }\n}" ]
[ "0.62029237", "0.6187638", "0.60084486", "0.5905522", "0.57601327", "0.56836784", "0.56501", "0.5631212", "0.55574083", "0.55152416", "0.55132776", "0.55132776", "0.5507565", "0.5507565", "0.55067325", "0.5463627", "0.5441186", "0.54226273", "0.54219776", "0.5414715", "0.54027545", "0.53984565", "0.53965145", "0.5396344", "0.5377429", "0.5376607", "0.53677815", "0.536416", "0.53551", "0.5352553", "0.53493196", "0.53366596", "0.5329997", "0.5327355", "0.53264654", "0.53141624", "0.53000605", "0.52972114", "0.5289991", "0.5289856", "0.5289634", "0.5287687", "0.5286313", "0.52857995", "0.5280363", "0.52801174", "0.5273637", "0.5264451", "0.5263043", "0.52423716", "0.52411795", "0.52329564", "0.52008295", "0.5198458", "0.5195629", "0.517685", "0.51720667", "0.5168752", "0.5163441", "0.5135841", "0.5132254", "0.5109534", "0.5103928", "0.51028675", "0.51014656", "0.509675", "0.50965047", "0.5091804", "0.5086452", "0.50843006", "0.50670236", "0.5065849", "0.5059679", "0.5059481", "0.5054993", "0.5050044", "0.5042704", "0.5028787", "0.502255", "0.5022004", "0.5019548", "0.50058734", "0.50033444", "0.50025463", "0.499977", "0.4991578", "0.49876118", "0.49876082", "0.4987098", "0.4986993", "0.49866384", "0.49857473", "0.49857473", "0.49839064", "0.49771148", "0.49759236", "0.49711186", "0.49709576", "0.49709576", "0.496953", "0.49646115" ]
0.0
-1
Very similar to "hmacsignverify.html".
function testHmac() { var importAlgorithm = {name: 'HMAC', hash: {name: "SHA-256"}}; var algorithm = {name: 'HMAC'}; var key = null; var testCase = { hash: "SHA-256", key: "9779d9120642797f1747025d5b22b7ac607cab08e1758f2f3a46c8be1e25c53b8c6a8f58ffefa176", message: "b1689c2591eaf3c9e66070f8a77954ffb81749f1b00346f9dfe0b2ee905dcc288baf4a92de3f4001dd9f44c468c3d07d6c6ee82faceafc97c2fc0fc0601719d2dcd0aa2aec92d1b0ae933c65eb06a03c9c935c2bad0459810241347ab87e9f11adb30415424c6c7f5f22a003b8ab8de54f6ded0e3ab9245fa79568451dfa258e", mac: "769f00d3e6a6cc1fb426a14a4f76c6462e6149726e0dee0ec0cf97a16605ac8b" }; var keyData = hexStringToUint8Array(testCase.key); var usages = ['sign', 'verify']; var extractable = true; // (1) Import the key return crypto.subtle.importKey('raw', keyData, importAlgorithm, extractable, usages).then(function(result) { key = result; // shouldBe() can only resolve variables in global context. tmpKey = key; shouldEvaluateAsSilent("tmpKey.type", "secret"); shouldEvaluateAsSilent("tmpKey.extractable", true); shouldEvaluateAsSilent("tmpKey.algorithm.name", "HMAC"); shouldEvaluateAsSilent("tmpKey.algorithm.hash.name", testCase.hash); shouldEvaluateAsSilent("tmpKey.algorithm.length", keyData.length * 8); shouldEvaluateAsSilent("tmpKey.usages.join(',')", "sign,verify"); // (2) Sign. var signPromise = crypto.subtle.sign(algorithm, key, hexStringToUint8Array(testCase.message)); // (3) Verify var verifyPromise = crypto.subtle.verify(algorithm, key, hexStringToUint8Array(testCase.mac), hexStringToUint8Array(testCase.message)); // (4) Verify truncated mac (by stripping 1 byte off of it). var expectedMac = hexStringToUint8Array(testCase.mac); var verifyTruncatedPromise = crypto.subtle.verify(algorithm, key, expectedMac.subarray(0, expectedMac.byteLength - 1), hexStringToUint8Array(testCase.message)); var exportKeyPromise = crypto.subtle.exportKey('raw', key); return Promise.all([signPromise, verifyPromise, verifyTruncatedPromise, exportKeyPromise]); }).then(function(result) { // signPromise mac = result[0]; shouldEvaluateAsSilent("bytesToHexString(mac)", testCase.mac); // verifyPromise verifyResult = result[1]; shouldEvaluateAsSilent("verifyResult", true); // verifyTruncatedPromise verifyResult = result[2]; shouldEvaluateAsSilent("verifyResult", false); // exportKeyPromise exportedKeyData = result[3]; shouldEvaluateAsSilent("bytesToHexString(exportedKeyData)", testCase.key); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_verify(req) {\n const { query } = url.parse(req.url, true);\n const { signature, timestamp, nonce, echostr } = query;\n const $token = this.options.secret;\n let $tmpArr = [$token, timestamp, nonce];\n $tmpArr.sort();\n return sha1($tmpArr.join('')) === signature ? echostr : false;\n }", "function sign_verify(message, smesssage, cryptopk,len){\n\tvar bo = libhel.Ntrusign_Verify(message,smesssage,cryptopk,len);\n\treturn bo;\n}", "function verifyHmac (req, res, buf) {\n\tlet hash = req.header('X-Hub-Signature');\n\tlet hmac = crypto.createHmac('sha1', config.webhookSecret);\n\n\thmac.update(buf);\n\n\tlet crypted = 'sha1=' + hmac.digest('hex');\n\n\tif (crypted === hash) {\n\t\t// Valid request, do nothing\n\t\tlog.info(`Webhook signature is valid, jsDelivr update can proceed - providedSignature: ${hash}, calculatedSignature: ${crypted}`);\n\t} else {\n\t\t// Invalid request\n\t\tlog.info(`Webhook signature is NOT VALID, jsDelivr update WILL NOT proceed - providedSignature: ${hash}, calculatedSignature: ${crypted}`);\n\t\tthrow { status: 400, body: 'Wrong signature' };\n\t}\n}", "function verify_webhook_sig(sig, secret, body)\n{\n var hmac = crypto.createHmac('sha1', secret);\n hmac.update(body);\n var digest = hmac.digest('hex');\n return sig == digest;\n}", "verify(signature, msg) {\n const verify = sodium.crypto_auth_hmacsha256_verify(signature, msg, this.key);\n return verify;\n }", "function verifyRequestSignature(req, res, buf) {\n var signature = req.headers[\"x-hub-signature\"];\n if (!signature) {\n // For testing, let's log an error. In production, you should throw an \n // error.\n console.error(\"Couldn't validate the signature.\");\n } else {\n //console.error(\"APP_SECRET\", APP_SECRET);\n //console.error(\"PAGE_ACCESS_TOKEN\", PAGE_ACCESS_TOKEN);\n var elements = signature.split('=');\n var method = elements[0];\n var signatureHash = elements[1];\n var expectedHash = crypto.createHmac('sha1', APP_SECRET)\n .update(buf)\n .digest('hex');\n //console.error(\"expectedHash\", expectedHash);\n //console.error(\"signatureHash\", signatureHash);\n //if (signatureHash != expectedHash) {\n // throw new Error(\"Couldn't validate the request signature.\");\n //}\n }\n}", "function test(){\n\tassert.ok(ostatus.salmon.verify_signature(me, key));\n}", "function verifyRequestSignature(req, res, buf) {\n var signature = req.headers[\"x-hub-signature\"];\n\n if (!signature) {\n // For testing, let's log an error. In production, you should throw an\n // error.\n console.error(\"Couldn't validate the signature.\");\n } else {\n var elements = signature.split('=');\n var method = elements[0];\n var signatureHash = elements[1];\n\n var expectedHash = crypto.createHmac('sha1', APP_SECRET)\n .update(buf)\n .digest('hex');\n console.log(expectedHash);\n\n if (signatureHash != expectedHash) {\n throw new Error(\"Couldn't validate the request signature.\");\n }\n }\n}", "verifyRequestSignature( req, res, buf ) {\n var signature = req.headers[ \"x-hub-signature\" ];\n\n if ( !signature ) {\n // For testing, let's log an error. In production, you should throw an\n // error.\n console.error( \"Couldn't validate the signature.\" );\n } else {\n var elements = signature.split( '=' );\n var method = elements[ 0 ];\n var signatureHash = elements[ 1 ];\n\n var expectedHash = crypto.createHmac( 'sha1', envVars.APP_SECRET )\n .update( buf )\n .digest( 'hex' );\n\n if ( signatureHash != expectedHash ) {\n throw new Error( \"Couldn't validate the request signature.\" );\n }\n }\n }", "function verifyRequestSignature(req, res, buf) {\n var signature = req.headers[\"x-hub-signature\"];\n\n if (!signature) {\n // For testing, let's log an error. In production, you should throw an\n // error.\n console.error(\"Couldn't validate the signature.\");\n } else {\n var elements = signature.split('=');\n var method = elements[0];\n var signatureHash = elements[1];\n\n var expectedHash = crypto.createHmac('sha1', FB_APP_SECRET)\n .update(buf)\n .digest('hex');\n\n if (signatureHash != expectedHash) {\n console.log(signatureHash);\n console.log(expectedHash);\n throw new Error(\"Couldn't validate the request signature.\");\n }\n }\n}", "function verifyRequestSignature(req, res, buf) {\n\tvar signature = req.headers[\"x-hub-signature\"]\n\n\tif (!signature) {\n\t\t// For testing, let's log an error. In production, you should throw an \n\t\t// error.\n\t\tconsole.error(\"Couldn't validate the signature.\")\n\t} else {\n\t\tvar elements = signature.split(\"=\")\n\t\t//var method = elements[0];\n\t\tvar signatureHash = elements[1]\n \n\t\tvar expectedHash = crypto.createHmac(\"sha1\", req.appSecret)\n\t\t\t.update(buf)\n\t\t\t.digest(\"hex\")\n\n\t\tif (signatureHash != expectedHash) {\n\t\t\tthrow new Error(\"Couldn't validate the request signature.\")\n\t\t}\n\t}\n}", "sign(msg) {\n return sodium.crypto_auth_hmacsha256(msg, this.key);\n }", "function verifyRequestSignature(req, res, buf) {\n var signature = req.headers[\"x-hub-signature\"];\n\n if (!signature) {\n // In DEV, log an error. In PROD, throw an error.\n console.error(\"Couldn't validate the signature.\");\n } else {\n var elements = signature.split('=');\n var method = elements[0];\n var signatureHash = elements[1];\n\n var expectedHash = crypto.createHmac('sha1', FB_APP_SECRET)\n .update(buf)\n .digest('hex');\n\n //console.log(\"signatureHash: \" + signatureHash);\n //console.log(\"expectedHash: \" + expectedHash);\n\n if (signatureHash != expectedHash) {\n throw new Error(\"Couldn't validate the request signature.\");\n }\n }\n}", "function sign (str, key) {\n return crypto.createHmac('sha256', key).update(str).digest('base64');\n}", "verifySignature(reqq){\n\tif(reqq.address && reqq.signature){\n\t\tlet memdata=this.mempool.get(reqq.address); \n\t\tconsole.log(memdata.message);\n\t let response= bitcoinmsg.verify(memdata.message, reqq.address, reqq.signature);\n\t return response;\n\t}return false;\n}", "function verifyRequestSignature(req, res, buf) {\n var signature = req.headers[\"x-hub-signature\"];\n\n if (!signature) {\n // For testing, let's log an error. In production, you should throw an \n // error.\n console.error(\"Couldn't validate the signature.\");\n } else {\n var elements = signature.split('=');\n var method = elements[0];\n var signatureHash = elements[1];\n\n var expectedHash = crypto.createHmac('sha1', APP_SECRET)\n .update(buf)\n .digest('hex');\n\n if (signatureHash != expectedHash) {\n throw new Error(\"Couldn't validate the request signature.\");\n }\n }\n}", "function verifyRequestSignature(req, res, buf) {\n var signature = req.headers[\"x-hub-signature\"];\n\n if (!signature) {\n // For testing, let's log an error. In production, you should throw an \n // error.\n console.error(\"Couldn't validate the signature.\");\n } else {\n var elements = signature.split('=');\n var method = elements[0];\n var signatureHash = elements[1];\n\n var expectedHash = crypto.createHmac('sha1', APP_SECRET)\n .update(buf)\n .digest('hex');\n\n if (signatureHash != expectedHash) {\n throw new Error(\"Couldn't validate the request signature.\");\n }\n }\n}", "function verifyRequestSignature(req, res, buf) {\n var signature = req.headers[\"x-hub-signature\"];\n\n if (!signature) {\n // For testing, let's log an error. In production, you should throw an \n // error.\n console.error(\"Couldn't validate the signature.\");\n } else {\n var elements = signature.split('=');\n var method = elements[0];\n var signatureHash = elements[1];\n\n var expectedHash = crypto.createHmac('sha1', APP_SECRET)\n .update(buf)\n .digest('hex');\n\n if (signatureHash != expectedHash) {\n throw new Error(\"Couldn't validate the request signature.\");\n }\n }\n}", "function verifyRequestSignature(req, res, buf) {\n var signature = req.headers[\"x-hub-signature\"];\n\n if (!signature) {\n // For testing, let's log an error. In production, you should throw an \n // error.\n console.error(\"Couldn't validate the signature.\");\n } else {\n var elements = signature.split('=');\n var method = elements[0];\n var signatureHash = elements[1];\n\n var expectedHash = crypto.createHmac('sha1', APP_SECRET)\n .update(buf)\n .digest('hex');\n\n if (signatureHash != expectedHash) {\n throw new Error(\"Couldn't validate the request signature.\");\n }\n }\n}", "function verifyRequestSignature(req, res, buf) {\n var signature = req.headers[\"x-hub-signature\"];\n\n if (!signature) {\n // For testing, let's log an error. In production, you should throw an \n // error.\n console.error(\"Couldn't validate the signature.\");\n } else {\n var elements = signature.split('=');\n var method = elements[0];\n var signatureHash = elements[1];\n\n var expectedHash = crypto.createHmac('sha1', APP_SECRET)\n .update(buf)\n .digest('hex');\n\n if (signatureHash != expectedHash) {\n throw new Error(\"Couldn't validate the request signature.\");\n }\n }\n}", "function verifyRequestSignature(req, res, buf) {\n var signature = req.headers[\"x-hub-signature\"];\n\n if (!signature) {\n // For testing, let's log an error. In production, you should throw an \n // error.\n console.error(\"Couldn't validate the signature.\");\n } else {\n var elements = signature.split('=');\n var method = elements[0];\n var signatureHash = elements[1];\n\n var expectedHash = crypto.createHmac('sha1', APP_SECRET)\n .update(buf)\n .digest('hex');\n\n if (signatureHash != expectedHash) {\n throw new Error(\"Couldn't validate the request signature.\");\n }\n }\n}", "function verifyRequestSignature(req, res, buf) {\n var signature = req.headers[\"x-hub-signature\"];\n\n if (!signature) {\n console.log(\"Couldn't validate the signature.\");\n } else {\n var elements = signature.split(\"=\");\n var signatureHash = elements[1];\n var expectedHash = crypto\n .createHmac(\"sha1\", config.appSecret)\n .update(buf)\n .digest(\"hex\");\n if (signatureHash != expectedHash) {\n throw new Error(\"Couldn't validate the request signature.\");\n }\n }\n}", "function verifyRequestSignature(req, res, buf) {\n var signature = req.headers[\"x-hub-signature\"];\n\n if (!signature) {\n // For testing, let's log an error. In production, you should throw an \n // error.\n console.error(\"Couldn't validate the signature.\");\n }\n else {\n var elements = signature.split('=');\n var method = elements[0];\n var signatureHash = elements[1];\n\n var expectedHash = crypto.createHmac('sha1', APP_SECRET)\n .update(buf)\n .digest('hex');\n\n if (signatureHash != expectedHash) {\n throw new Error(\"Couldn't validate the request signature.\");\n }\n }\n}", "function verifyRequestSignature(req, res, buf) {\n var signature = req.headers[\"x-hub-signature\"];\n\n if (!signature) {\n // For testing, let's log an error. In production, you should throw an\n // error.\n console.error(\"Couldn't validate the signature.\");\n } else {\n var elements = signature.split('=');\n var method = elements[0];\n var signatureHash = elements[1];\n\n var expectedHash = crypto.createHmac('sha1', APP_SECRET)\n .update(buf)\n .digest('hex');\n\n if (signatureHash != expectedHash) {\n throw new Error(\"Couldn't validate the request signature.\");\n }\n }\n}", "function verifyRequestSignature(req, res, buf) {\n var signature = req.headers[\"x-hub-signature\"];\n\n if (!signature) {\n throw new Error(\"Couldn't validate the signature.\");\n } else {\n var elements = signature.split('=');\n var method = elements[0];\n var signatureHash = elements[1];\n\n var expectedHash = crypto.createHmac('sha1', constants.APP_SECRET)\n .update(buf)\n .digest('hex');\n\n if (signatureHash != expectedHash) {\n throw new Error(\"Couldn't validate the request signature.\");\n }\n }\n}", "function verifyRequestSignature(req, res, buf) {\n var signature = req.headers[\"x-hub-signature\"];\n\n if (!signature) {\n // For testing, let's log an error. In production, you should throw an\n // error.\n console.error(\"Couldn't validate the signature.\");\n } else {\n var elements = signature.split('=');\n var method = elements[0];\n var signatureHash = elements[1];\n\n var expectedHash = crypto.createHmac('sha1', APP_SECRET)\n .update(buf)\n .digest('hex');\n\n if (signatureHash != expectedHash) {\n throw new Error(\"Couldn't validate the request signature.\");\n }\n }\n}", "function verifyRequestSignature(req, res, buf) {\n try {\n var signature = req.headers[\"x-hub-signature\"];\n if (!signature) {\n throw new Error(\"Could not find a signature.\");\n } else {\n var elements = signature.split('=');\n var method = elements[0];\n var signatureHash = elements[1];\n var expectedHash = crypto.createHmac('sha1', APP_SECRET).update(buf).digest('hex');\n if (signatureHash != expectedHash) {\n throw new Error(\"Unexpected signature found.\");\n }\n }\n } catch (err) {\n console.error(err);\n throw new Error(err);\n }\n}", "function verifyRequestSignature(req, res, buf) {\n\n const signature = req.headers['x-hub-signature'];\n\n if (!signature) {\n // For testing, let's log an error. In production, you should throw an \n // error.\n console.error(\"Couldn't validate the signature.\");\n } else {\n const elements = signature.split('=');\n const method = elements[0];\n const signatureHash = elements[1];\n\n const expectedHash = crypto.createHmac('sha1', APP_SECRET)\n .update(buf)\n .digest('hex');\n\n if (signatureHash !== expectedHash) {\n throw new Error(\"Couldn't validate the request signature.\");\n }\n }\n}", "function verifyRequestSignature(req, res, buf) {\n var signature = req.headers[\"x-hub-signature\"];\n\n if (!signature) {\n throw new Error('Couldn\\'t validate the signature.');\n } else {\n var elements = signature.split('=');\n var method = elements[0];\n var signatureHash = elements[1];\n\n var expectedHash = crypto.createHmac('sha1', config.FB_APP_SECRET)\n .update(buf)\n .digest('hex');\n\n if (signatureHash != expectedHash) {\n throw new Error(\"Couldn't validate the request signature.\");\n }\n }\n}", "function verifyRequestSignature(req, res, buf) {\n var signature = req.headers[\"x-hub-signature\"];\n\n if (!signature) {\n // For testing, let's log an error. In production, you should throw an\n // error.\n //console.error(\"Couldn't validate the signature.\");\n } else {\n var elements = signature.split('=');\n var method = elements[0];\n var signatureHash = elements[1];\n\n var expectedHash = crypto.createHmac('sha1', config.fbBot.appSecret)\n .update(buf)\n .digest('hex');\n\n if (signatureHash !== expectedHash) {\n throw new Error(\"Couldn't validate the request signature.\");\n }\n }\n}", "function verifyRequestSignature(req, res, buf) {\n var signature = req.headers['x-hub-signature'];\n\n if (!signature) {\n // For testing, let's log an error. In production, you should throw an\n // error.\n console.error('Couldn\\'t validate the signature.');\n } else {\n var elements = signature.split('=');\n var signatureHash = elements[1];\n\n var expectedHash = crypto.createHmac('sha1', APP_SECRET).update(buf).digest('hex');\n\n if (signatureHash != expectedHash) {\n throw new Error('Couldn\\'t validate the request signature.');\n }\n }\n}", "function verifyRequestSignature(req, res, buf) {\n var signature = req.headers['x-hub-signature']\n\n if (!signature) {\n // For testing, let's log an error. In production, you should throw an\n // error.\n console.error(\"Couldn't validate the signature.\")\n } else {\n var elements = signature.split('=')\n var signatureHash = elements[1]\n\n var expectedHash = crypto\n .createHmac('sha1', APP_SECRET)\n .update(buf)\n .digest('hex')\n\n if (signatureHash != expectedHash) {\n throw new Error(\"Couldn't validate the request signature.\")\n }\n }\n}", "function verifyRequestSignature(req, res, buf) {\n\tvar signature = req.headers[\"x-hub-signature\"];\n\n\tif (!signature) {\n\t\t// For testing, let's log an error. In production, you should throw an error.\n\t\tconsole.error(\"Couldn't validate the signature.\");\n\t} else {\n\t\tvar elements = signature.split('=');\n\t\tvar method = elements[0];\n\t\tvar signatureHash = elements[1];\n\n\t\tvar expectedHash = crypto.createHmac('sha1', FB_APP_SECRET)\n\t\t\t\t\t\t\t\t\t\t\t\t.update(buf)\n\t\t\t\t\t\t\t\t\t\t\t\t.digest('hex');\n\n\t\tif (signatureHash != expectedHash) {\n\t\t\tthrow Error(\"Got bad request signature.\");\n\t\t}\n\t}\n}", "function verifyRequestSignature(req, res, buf) {\n\tvar signature = req.headers[\"x-hub-signature\"];\n\n\tif (!signature) {\n\t\tthrow new Error('Couldn\\'t validate the signature.');\n\t} else {\n\t\tvar elements = signature.split('=');\n\t\tvar method = elements[0];\n\t\tvar signatureHash = elements[1];\n\n\t\tvar expectedHash = crypto.createHmac('sha1', config.FB_APP_SECRET)\n\t\t\t.update(buf)\n\t\t\t.digest('hex');\n\n\t\tif (signatureHash != expectedHash) {\n\t\t\tthrow new Error(\"Couldn't validate the request signature.\");\n\t\t}\n\t}\n}", "function verifyRequestSignature(req, res, buf) {\n\tvar signature = req.headers[\"x-hub-signature\"];\n\n\tif (!signature) {\n\t\tthrow new Error('Couldn\\'t validate the signature.');\n\t} else {\n\t\tvar elements = signature.split('=');\n\t\tvar method = elements[0];\n\t\tvar signatureHash = elements[1];\n\n\t\tvar expectedHash = crypto.createHmac('sha1', config.FB_APP_SECRET)\n\t\t\t.update(buf)\n\t\t\t.digest('hex');\n\n\t\tif (signatureHash != expectedHash) {\n\t\t\tthrow new Error(\"Couldn't validate the request signature.\");\n\t\t}\n\t}\n}", "function auth(req, res, next) { \n var signature = req.params.signature;\n var timestamp = req.params.timestamp;\n var nonce = req.params.nonce;\n\n var tmpArr = new Array(TOKEN, timestamp, nonce);\n tmpArr = tmpArr.sort();\n var tmpStr = tmpArr.join(\"\");\n var shasum = crypto.createHash('sha1');\n shasum.update(tmpStr);\n tmpStr = shasum.digest('hex');\n \n res.setHeader('content-type', 'text/plain');\n if(tmpStr == req.params.signature) {\n res.send(200, req.params.echostr);\n console.log('success');\n } else {\n res.send(200, 'error');\n console.log('error');\n }\n\n return next();\n}", "function verifyRequestSignature(req, res, buf) {\n let signature = req.headers[\"x-hub-signature\"];\n if (!signature) {\n //console.error(\"[verifyRequestSignature] La request no contiene la firma de la aplicacion(APP_SECRET).\");\n throw new Error(\"La request no contiene en el encabezado la firma de la aplicacion(APP_SECRET).\");\n }\n console.trace(\"[verifyRequestSignature] Verificando la firma de la aplicacion(APP_SECRET). signature:\", signature);\n\n let elements = signature.split('=');\n // GLOZADA: desuso\n //let method = elements[0];\n let signatureHash = elements[1];\n let expectedHash = crypto.createHmac('sha1', APP_SECRET)\n .update(buf)\n .digest('hex');\n if (signatureHash != expectedHash) {\n //console.error(\"[verifyRequestSignature] La firma de la aplicacion(APP_SECRET) presente en la request no es valida.\");\n throw new Error(\"La firma de la aplicacion(APP_SECRET) presente en la request no es valida.\");\n }\n}", "function checkAuth(key, payload) {\n let msgBuf = Buffer.from(payload, 'utf8');\n\tlet msgHash = \"HMAC \" + crypto.createHmac('sha256', bufSecret).update(msgBuf).digest(\"base64\");\n context.log(msgHash);\n context.log(key);\n return (msgHash === key);\n}", "function checkSignedMessage(req, res) {\n //******************opening the signed message ****/\n const publicKeyRaw = nacl.util.encodeBase64(alicePublic);\n const publicKey =alicePublic;\n const messageUint = nacl.sign.open(signedMessageRaw, alicePublic);\n const messageEncoded = nacl.util.encodeBase64(messageUint);\n if(messageEncoded == publicKeyRaw){\n res.json({\"data\":\"PASSED\",\"message\":messageEncoded })\n }else{\n res.json({data:\"FAILED\",\"message\":messageEncoded})\n }\n}", "function check_go_signature() {\n\tif(action == 'pick-up' || action == 'delivered') {\n\t\tshow('page-signature');\n\t} else {\n\t\tcheck_go_image_pod();\n\t}\n}", "function signSha(swc, options) {\n var pars = [];\n var host = url.parse(swc.config.market.huobi.baseUrl).host;\n for (let item in options.body) {\n pars.push(item + \"=\" + encodeURIComponent(options.body[item]));\n }\n var p = pars.sort().join(\"&\");\n var meta = [options.method, host, options.path, p].join('\\n');\n var hash = HmacSHA256(meta, swc.config.market.huobi.secretKey);\n var Signature = encodeURIComponent(CryptoJS.enc.Base64.stringify(hash));\n // console.log(`Signature: ${Signature}`);\n p += `&Signature=${Signature}`;\n // console.log(p);\n return p;\n}", "function VerifySignature(message) {\n var cipher = message[0]; //TEMP: message components are stored in array\n var signature = message[1];\n var publicSigningKey = message[2];\n console.log(publicSigningKey.verify(cipher, signature));\n}", "function verify (signature, sourceFile, PKinfo, output, quiet, pretty) {\n fs.readFile(sourceFile, (err, message) => {\n if (err) throw err\n var sigInfo = minisign.parseSignature(signature)\n if (minisign.verifySignature(sigInfo, message, PKinfo)) {\n if (!quiet && !pretty) {\n console.log('comment and signature verified.')\n console.log(tPrelude + sigInfo.trustedComment)\n } else if (pretty) {\n console.log(sigInfo.trustedComment.toString())\n }\n if (output) {\n console.log(message.toString())\n }\n process.exit()\n } else {\n if (!quiet) {\n console.log('signature verifaction failed.')\n }\n process.exit(1)\n }\n })\n}", "function generateSignature(merchantTxnId, request) {\n //Need to replace the last part of URL(\"your-vanityUrlPart\") with your Testing/Live URL\n var formPostUrl = \"https://checkout.citruspay.com/ssl/checkout/\"+request.vanityUrl;\n\n //Need to change with your Secret Key\n var secret_key = request.secret_key;\n\n //Need to change with your Vanity URL Key from the citrus panel\n var vanityUrl = request.vanityUrl;\n\n //Need to change with your Order Amount\n var orderAmount = request.orderAmount;\n var currency = \"INR\";\n\n // generate hmac\n var data = vanityUrl+request.orderAmount+request.merchantTxnId+\"INR\";\n console.log(data);\n var hash = CryptoJS.HmacSHA1(data,secret_key).toString();\n console.log(\"hash: \", hash);\n return hash;\n }", "function verifyAuth(msg, auth_token) {\n hmac = crypto.createHmac('sha256', SHARED_KEY);\n hmac.update(msg);\n return auth_token == hmac.digest('base64');\n}", "function getSignature()\n{\n var timeStamp = Math.floor((new Date()).getTime()/1000);\n return (md5(api_key+shared_secret+timeStamp));\n}", "hmac(bytes, dk) {\n var mac = crypto.createHmac('sha256', dk.hmac_key)\n var hmac = mac.update(bytes).digest(); //hex ?\n return hmac;\n }", "function getSignature() {\r\n var encode = \"\"\r\n for(var i = 0; i < arguments.length; i++) {\r\n encode += arguments[i]\r\n }\r\n encode += secret\r\n return Qt.md5(encode)\r\n}", "static verify(data, publicKey, sign){\n if (typeof data !== \"string\") throw new Error(\"Data must be a string\");\n let ic = new iCrypto();\n ic.setRSAKey(\"pubk\", publicKey, \"public\")\n .addBlob(\"sign\", sign)\n .hexToBytes('sign', \"signraw\")\n .addBlob(\"b\", data);\n ic.publicKeyVerify(\"b\", \"sign\", \"pubk\", \"v\");\n return ic.get(\"v\");\n }", "function verifySignatureBox(signature, pub_key) {\n return curve.sign.open(str2buf(signature, 'base64'), pub_key);\n}", "function getSignature() {\n var encode = \"\"\n for(var i = 0; i < arguments.length; i++) {\n encode += arguments[i]\n }\n encode += secret\n return Qt.md5(encode)\n}", "function validateSignature(encodedHeader, encodedPayload, signature) {\n var signingInput = encodedHeader + \".\" + encodedPayload;\n var signed = CryptoJS.HmacSHA256(signingInput, client_secret);\n var encodedSigned = b64tob64u(signed.toString(CryptoJS.enc.Base64));\n return encodedSigned == signature;\n}", "function signTheFile() {\n var plaintext = document.querySelector('.output').value\n // initialize\n var sig = new KJUR.crypto.Signature({\"alg\": \"SHA1withRSA\"});\n // initialize for signature generation\n sig.init(object_2.private_key); // rsaPrivateKey of RSAKey object\n // update data\n sig.updateString(plaintext)\n // calculate signature\n signature = sig.sign()\n alert(\"signature signed.If you will make any changes in given signature it will become invalid\");\n } // end of signTheFile click handler", "function verify (keys, sig, msg) {\n if(isObject(sig))\n throw new Error('signature should be base64 string, did you mean verifyObj(public, signed_obj)')\n return curves[getCurve(keys)].verify(\n u.toBuffer(keys.public || keys),\n u.toBuffer(sig),\n isBuffer(msg) ? msg : new Buffer(msg)\n )\n}", "function show_signature_static_page() {\n\tif (checksameurl(location.href, checkoutpage) == false) {\t// We discard the checkout\n\t\tif (selected_language == 'en') {\n\t\t\tdocument.write('<br/>' + company_name + ' ' + translate_sentence('team') + '.<br/><br/>');\n\t\t} else {\n\t\t\tdocument.write('<br/>' + translate_sentence('team') + ' ' + company_name + '.<br/><br/>');\n\t\t}\n\t}\n}", "decrypt_and_validate_hmac(body) { \n // and determined if it is a request or responce\n var request = true;\n var saletopoirequest = body[\"SaleToPOIRequest\"];\n if (!saletopoirequest) {\n request = false;\n saletopoirequest = body[\"SaleToPOIResponse\"];\n }\n \n // pick up the MessageHeader\n var messageHeader = saletopoirequest[\"MessageHeader\"];\n var payload = saletopoirequest[\"NexoBlob\"];\n var ciphertext = Buffer.from(payload, 'base64');\n \n // Get the SecurityTrailer and its values\n var jsonTrailer = saletopoirequest[\"SecurityTrailer\"];\n var version = jsonTrailer[\"AdyenCryptoVersion\"];\n \n var nonceB64 = jsonTrailer[\"Nonce\"];\n var ivmod = Buffer.from(nonceB64, 'base64');\n \n var keyId = jsonTrailer[\"KeyIdentifier\"];\n var kversion = jsonTrailer[\"KeyVersion\"];\n var hmacB64 = jsonTrailer[\"Hmac\"];\n \n var ret = this.crypt(ciphertext, this.derivedKeys, ivmod, false);\n var json = JSON.parse(ret);\n \n // Base64 decode the received HMAC and compare it to a computed hmac\n // Use a timing safe compare, this is to mitigate a (theoretical) timing based attack\n var receivedmac = Buffer.from(hmacB64, 'base64');\n var hmac = this.hmac(ret, this.derivedKeys);\n \n //console.log(receivedmac);\n //console.log(hmac);\n \n if (receivedmac.length != hmac.length) {\n // console.log(\"HMAC Validation failed - Length mismatch\");\n return;\n }\n var equal = true;\n for (var i = 0; i < hmac.length; i++) {\n if (receivedmac[i] != hmac[i]) {\n equal = false;\n }\n }\n if (!equal) {\n // console.log(\"HMAC Validation failed - Not Equal\");\n return;\n }\n \n return JSON.stringify(json);\n }", "function sign(key, policy, encoding, next) {\n\tvar signature = crypto.createHmac('sha1', process.env.SECRET_ACCESS_KEY).update(encoding).digest('base64');\n\tnext(null, key, policy, encoding, signature);\n}", "function verifySignature(msg, signature, pub_key) {\n //return curve.sign.detached.verify(str2buf(msg, 'ascii'), str2buf(signature, 'base64'), pub_key);\n return curve.sign.detached.verify(msg, str2buf(signature, 'base64'), pub_key);\n}", "function testSign(data) {\n return arCrypt.sign(orgSignKey,data);\n}", "getSignature (config, query, url) {\n // Create hmac instance from your token\n const hmac = crypto.createHmac(\"sha256\", this.token);\n\n // Join white list headers (date, tb-content-sha256) into a single string\n const headers = config.headers;\n const header = [\n `date:${headers.date}`.trim(),\n `tb-content-sha256:${headers['tb-content-sha256']}`.trim()\n ];\n const headerString = header.join('\\n');\n\n // Create a string from hmac encoding\n let string = `${config.method.toUpperCase()}\\n`;\n string = `${string}/api/v1${url.trim()}\\n${query.trim()}\\n${headerString.trim()}\\n${headers['tb-content-sha256'].trim()}`;\n\n hmac.write(string);\n hmac.end();\n\n // Return Authorization header signature\n const signature = hmac.read().toString('hex');\n return `TB1-HMAC-SHA256 ${this.partnerId}:${signature}`;\n }", "function verifyRequestSignature(signingSecret, requestHeaders, body) {\n //console.log(`debuging verify: '${signingSecret}', '${requestHeaders}', '${body}' `)\n // Request signature\n const signature = requestHeaders['x-slack-signature'];\n // Request timestamp\n const ts = parseInt(requestHeaders['x-slack-request-timestamp'], 10);\n\n // Divide current date to match Slack ts format\n // Subtract 5 minutes from current time\n const fiveMinutesAgo = Math.floor(Date.now() / 1000) - (60 * 5);\n\n if (ts < fiveMinutesAgo) {\n console.log('request is older than 5 minutes');\n return false;\n }\n\n const hmac = crypto.createHmac('sha256', signingSecret);\n const [version, hash] = signature.split('=');\n hmac.update(`${version}:${ts}:${body}`);\n\n if (!timingSafeCompare(hash, hmac.digest('hex'))) {\n console.log('request signature is not valid');\n return false;\n }\n\n console.log('request signing verification success');\n return true;\n}", "verifyTrxSignature() {\n const publicKey = this.data.publicKey;\n const publicKeyBuffer = Buffer.from(publicKey, 'hex'); // Need to use a JS buffer object for Crypto's verify function\n const serial = this.serialize(this.data);\n return pubcrypto.verifySignature(serial, this.signature, publicKeyBuffer);\n }", "rsa1_verify(pubkey, data, sign) {\n\t\tconst sig = new rs.KJUR.crypto.Signature({ \"alg\": \"SHA1withRSA\" });\n\t\tsig.init(pubkey);\n\t\tsig.updateString(data);\n\t\tconst is_valid = sig.verify(sign);\n\t\treturn is_valid;\n\t}", "function generateSignedURL(actionName, form, accessKeyId, secretKey, endpoint, version) {\n var url = endpoint + \"?SignatureVersion=1&Action=\" + actionName + \"&Version=\" + encodeURIComponent(version) + \"&\";\n for (var i = 0; i < form.elements.length;++ i) {\n var elementName = form.elements[i].name;\n \n var elementValue = null;\n \n if (form.elements[i].type == 'text') {\n elementValue = form.elements[i].value;\n } else if (form.elements[i].type == 'select-one') {\n elementValue = form.elements[i].options[form.elements[i].selectedIndex].value;\n }\n if (elementValue) {\n url += elementName;\n url += \"=\";\n url += encodeURIComponent(elementValue);\n url += \"&\";\n }\n }\n var timestamp = getNowTimeStamp();\n url += \"Timestamp=\" + encodeURIComponent(timestamp);\n \n url += \"&AWSAccessKeyId=\" + encodeURIComponent(accessKeyId);\n var signature = generateV1Signature(url, secretKey);\n url += \"&Signature=\" + encodeURIComponent(signature);\n \n return url;\n}", "function verifyQRSharedSecret(){\n var authnData = {\n \"authId\": AUTH_ID,\n \"qr\": QR_SHAREDSECRET,\n \"hint\": \"SAVE_QR\" //dont change this value.\n };\n authenticate(authnData);\n}", "function showSignature() {\r\n print(\"Showing signature\");\r\n window.sigCtl.GetSignature(onGetSignature);\r\n function onGetSignature(sigCtlV, sigObjV, status) {\r\n if (window.sdkPtr.ResponseStatus.OK == status) {\r\n var outputFlags = window.sdkPtr.RBFlags.RenderOutputPicture | window.sdkPtr.RBFlags.RenderColor24BPP;\r\n var sigObj = sigObjV;\r\n sigObj.RenderBitmap(SigCaptX_Globals_1.BITMAP_IMAGEFORMAT, sigcaptx_1.HTMLTags.imageBox.clientWidth, sigcaptx_1.HTMLTags.imageBox.clientHeight, SigCaptX_Globals_1.BITMAP_INKWIDTH, SigCaptX_Globals_1.BITMAP_INKCOLOR, SigCaptX_Globals_1.BITMAP_BACKGROUNDCOLOR, outputFlags, SigCaptX_Globals_1.BITMAP_PADDING_X, SigCaptX_Globals_1.BITMAP_PADDING_Y, onRenderBitmap);\r\n }\r\n else {\r\n print(\"Error retrieving signature\");\r\n }\r\n }\r\n function onRenderBitmap(sigObjV, bmpObj, status) {\r\n if (callbackStatusOK(\"Signature Render Bitmap\", status)) {\r\n if (null == sigcaptx_1.HTMLTags.imageBox.firstChild) {\r\n sigcaptx_1.HTMLTags.imageBox.appendChild(bmpObj.image);\r\n }\r\n else {\r\n sigcaptx_1.HTMLTags.imageBox.replaceChild(bmpObj.image, sigcaptx_1.HTMLTags.imageBox.firstChild);\r\n }\r\n if (sigcaptx_1.HTMLTags.chkSigText.checked) {\r\n sigObjV.GetSigText(onGetSigText);\r\n }\r\n else {\r\n SigCaptX_WizSessionCtrl_1.WizardEventController.stop();\r\n }\r\n }\r\n }\r\n // Displays the SigText string in the text box on the HTML document\r\n function onGetSigText(sigObjV, text, status) {\r\n if (callbackStatusOK(\"Signature Render Bitmap\", status)) {\r\n print(\"Sig text successfully obtained: \" + text);\r\n // At this point you can send the contents of \"text\" to the server \r\n // and then validate it at the server end\r\n print(\"Stopping script\");\r\n SigCaptX_WizSessionCtrl_1.WizardEventController.stop();\r\n }\r\n }\r\n }", "getSignedUrl( endpoint, params ) {\n let crypto = window.CryptoJS || null;\n let recvWindow = 100000;\n let timestamp = Date.now() - ( recvWindow / 2 );\n let qstr = this._ajax.serializeData( Object.assign( { recvWindow, timestamp }, params ) );\n let signature = crypto ? crypto.HmacSHA256( qstr, this._apisecret ).toString( crypto.enc.Hex ) : '';\n return this._apiurl + endpoint + '?' + qstr + '&signature=' + signature;\n }", "function b64_hmac_sha1(key, data) { return binb2b64(core_hmac_sha1(key, data));}", "function getComputedSignature(token, payload) {\n var hash = crypto\n .createHmac(\"sha1\", token)\n .update(JSON.stringify(payload), \"utf8\")\n .digest(\"hex\");\n return hash;\n}", "function verifyGitHub(req) {\n if (!req.headers['user-agent'].includes('GitHub-Hookshot')) {\n return false;\n }\n console.log(req.headers['user-agent']);\n var hmac = crypto.createHmac('sha1', secret);\n var digest = 'sha1=' + hmac.update(JSON.stringify(req.body)).digest('hex');\n var checksum = req.headers['x-hub-signature'];\n if (!checksum || !digest || checksum !== digest) {\n console.log(`Request body digest (${digest}) did not match ${'x-hub-signature'} (${checksum})`);\n return false;\n } else {\n console.log(digest);\n return true;\n }\n}", "function hmac(softwareList, keyid) {\n \"use strict\";\n\n}", "function getAuthSig(cb) {\n\tvar authToken = (Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)).toString()\n\tvar sigAndHash = signMsg(authToken)\n\n\tvar toSend = {\n\t\tuserid: userid,\n\t\tsignature: sigAndHash.sig.rpcSig,\n\t\tmode: 1,\n\t\tauthToken: authToken\n\t}\n\n\tfetch(NODE_BASE_URL + '/auth', {\n\t\tmethod: 'POST',\n\t\theaders: getHeaders(),\n\t\tbody: JSON.stringify(toSend)\n\t})\n\t\t.then((res) => {\n\t\t\treturn res.json()\n\t\t})\n\t\t.then((res) => {\n\t\t\tcb(null, res)\n\t\t})\n\t\t.catch((err) => {\n\t\t\t// console.log('gethAuth err', err)\n\t\t\tcb(err, null)\n\t\t})\n}", "function verify(ans) {\r\n\tvar ans = ans.trim().split(\" \").join(\"\").toUpperCase();\r\n\tvar lsalt = \"DKFSIZZEWXGRHUECTRDM\";\r\n\tvar rsalt = \"GWZYNFAEZMHJUEXNOFNJ\";\r\n\tvar hash = CryptoJS.MD5(lsalt + ans + rsalt);\r\n\tvar res = hash == \"e2c4050a0496c9ab3b165766da831263\";\r\n\tif (res) {\r\n\t\tsetCookie(\"answer\", ans, 60*24*30);\r\n\t\tvar hash2 = \"THJXDZCBJLDQQMPWSMUM\" + ans + \"GZFBVHFIMDJGLWMPCKIS\";\r\n\t\tvar aeskey = CryptoJS.MD5(hash2).toString();\r\n\t\tciphertext = \"U2FsdGVkX19Pu0P24xmTrhYYo7aVs99Yh3cW7J/y/QHCYueBQtmgAYqVAgHtw5r1\";\r\n\t\tformurl = CryptoJS.AES.decrypt(ciphertext, aeskey).toString(CryptoJS.enc.Utf8);\r\n\t}\r\n\treturn res;\r\n}", "function Authenticate(){\n var speakeasy = require('speakeasy');\n var key = speakeasy.generateSeceret();\n}", "function verifyURL(challenge, callback) {\n callback({\n \"challenge\": challenge\n });\n}", "function rsa2048Verify(rsaSign,publickey,message){\r\n var sig2 = new KJUR.crypto.Signature({\"alg\": \"SHA1withRSA\"});\r\n sig2.init(publickey);\r\n sig2.updateString(message);\r\n var isValid = sig2.verify(rsaSign);\r\n return isValid;\r\n}", "function sign(req, resp, next) {\n const { url, method = 'GET', params = {}, headers = {} } = req.body\n\n headers['x-bce-date'] = new Date().toISOString()\n const signature = auth.generateAuthorization(method, url, params, headers, undefined, undefined, ['Host'])\n\n headers['Authorization'] = signature\n req.body.headers = headers\n\n next()\n}", "function checkSignature({ hash, ...userData }) {\n // create a hash of a secret that both you and Telegram know. In this case, it is your bot token\n const secretKey = createHash('sha256')\n .update(CONFIG.BOT_TOKEN)\n .digest();\n\n // this is the data to be authenticated i.e. telegram user id, first_name, last_name etc.\n const dataCheckString = Object.keys(userData)\n .sort()\n .map(key => (`${key}=${userData[key]}`))\n .join('\\n');\n\n // run a cryptographic hash function over the data to be authenticated and the secret\n const hmac = createHmac('sha256', secretKey)\n .update(dataCheckString)\n .digest('hex');\n\n // compare the hash that you calculate on your side (hmac) with what Telegram sends you (hash) and return the result\n return hmac === hash;\n}", "sendForVerify(attr){\n Auth.verifyCurrentUserAttribute(attr)\n .then(() => {\n console.log('a verification code is sent');\n }).catch((e) => {\n console.log('failed with error', e);\n });\n }", "computeHMACSHA256(stringToSign) {\n // console.log(`stringToSign: ${JSON.stringify(stringToSign)}`);\n return crypto.createHmac(\"sha256\", this.key).update(stringToSign, \"utf8\").digest(\"base64\");\n }", "computeHMACSHA256(stringToSign) {\n // console.log(`stringToSign: ${JSON.stringify(stringToSign)}`);\n return crypto.createHmac(\"sha256\", this.key).update(stringToSign, \"utf8\").digest(\"base64\");\n }", "function confirmCode(txt) {\n\t\tvar fullHash = hash(\"Multi-Pass Salt - \"+txt);\n\t\treturn fullHash.substring(fullHash.length-4);\n\t}", "function sign(algorithm, key, data, codec) {\n var hash = hash_1.ALGORITHMS[key.algorithm];\n var keyData = typeof key.data === 'string' ?\n encoding_1.utf8.encode(key.data) : key.data;\n var byteData = typeof data === 'string' ?\n codec.encode(data) : data;\n return Promise_1.default.resolve(hmac_1.default(hash, byteData, keyData));\n }", "async show() {\n const ctx = this.ctx;\n await ctx.render('auth/verify');\n }", "checkAuth() { }", "function accSign(hash, acc) {\n return new Promise((resolve, reject) => {\n acc.sign(PASSWD, hash, (err,_sign) => {\n if (err) { console.log(err); reject(err) }\n else { console.log(_sign); resolve(_sign) }\n })\n })\n}", "sign(dataHash) {\n return this.keyPair.sign(dataHash);\n }", "function verify(signature, message, publicKey, htfOpts) {\n const P = normP1(publicKey);\n const Hm = normP2Hash(message, htfOpts);\n const G = G1.ProjectivePoint.BASE;\n const S = normP2(signature);\n // Instead of doing 2 exponentiations, we use property of billinear maps\n // and do one exp after multiplying 2 points.\n const ePHm = pairing(P.negate(), Hm, false);\n const eGS = pairing(G, S, false);\n const exp = Fp12.finalExponentiate(Fp12.mul(eGS, ePHm));\n return Fp12.eql(exp, Fp12.ONE);\n }", "function verify (obj, sig, pk) {\n try {\n let sigBuf = Buffer.from(sig, 'hex')\n let pkBuf = Buffer.from(pk, 'hex')\n let sighash = sodium.crypto_sign_open(sigBuf, pkBuf).toString('hex')\n let objhash = hash(stringify(obj))\n return sighash === objhash\n } catch (e) {\n return false\n }\n}", "async verify() {\n const ctx = this.ctx;\n const id = ctx.params.id;\n const user = await ctx.model.User.findByPk(id);\n\n if (!user) {\n ctx.throw(403, 'Invalid signature.');\n }\n\n if (user.hasVerifiedEmail()) {\n return ctx.redirect(ctx.get('referer'));\n }\n\n const original = `${this.config.url}${ctx.request.path}?expires=${ctx.query.expires}`;\n const signature = crypto\n .createHmac('sha256', this.config.keys)\n .update(original)\n .digest()\n .toString('hex');\n\n if (signature !== ctx.query.signature) {\n ctx.throw(403, 'Invalid signature.');\n }\n\n if (Date.now() > ctx.query.expires) {\n ctx.throw(403, 'Invalid signature.');\n }\n\n await user.markEmailAsVerified();\n ctx.login(user);\n\n ctx.flash('verified', true);\n ctx.redirect(ctx.get('referer'));\n }", "function F(e, t, n) {\n return Promise.resolve().then(function () {\n if (!t || !t.idToken) throw new o.c(\"Only idTokens may be verified\");\n var i = N(t.idToken),\n a = {\n clientId: e.options.clientId,\n issuer: e.options.issuer,\n ignoreSignature: e.options.ignoreSignature\n };\n return Object.assign(a, n), U(e, i.payload, a), 1 != a.ignoreSignature && e.features.isTokenVerifySupported() ? l(e, t.issuer, i.header.kid).then(function (e) {\n return function (e, t) {\n t = Object(r.f)(t);\n var n = {\n name: \"RSASSA-PKCS1-v1_5\",\n hash: {\n name: \"SHA-256\"\n }\n };\n return delete t.use, crypto.subtle.importKey(\"jwk\", t, n, !0, [\"verify\"]).then(function (t) {\n var o = e.split(\".\"),\n i = Object(r.B)(o[0] + \".\" + o[1]),\n a = Object(r.b)(o[2]),\n s = Object(r.B)(a);\n return crypto.subtle.verify(n, t, s, i);\n });\n }(t.idToken, e);\n }).then(function (e) {\n if (!e) throw new o.c(\"The token signature is not valid\");\n if (n && n.accessToken && t.claims.at_hash) return (i = n.accessToken, a = new TextEncoder().encode(i), crypto.subtle.digest(\"SHA-256\", a).then(function (e) {\n var t = new Uint8Array(e).slice(0, 16),\n n = String.fromCharCode.apply(null, t);\n return Object(r.A)(n);\n })).then(function (e) {\n if (e !== t.claims.at_hash) throw new o.c(\"Token hash verification failed\");\n });\n var i, a;\n }).then(function () {\n return t;\n }) : t;\n });\n }", "function verifySignature(caEc, pubHex, mdHex, sigValueHex) {\n\tvar ec_cert = new EC_CERT(caEc);\n\treturn ec_cert.verifySignature(pubHex, mdHex, sigValueHex);\n}", "verifyTOTPToken (request, reply) {\n reply();\n }", "function signRequestBox(data, sign_key) {\n return Buffer.from(curve.sign(data, sign_key)).toString('base64');\n}", "function rstr_hmac(key, data) {\n\t var bkey, ipad, opad, i, hash;\n\t key = (utf8) ? utf8Encode(key) : key;\n\t data = (utf8) ? utf8Encode(data) : data;\n\t bkey = rstr2binb(key);\n\t\n\t if (bkey.length > 16) {\n\t bkey = binb(bkey, key.length * 8);\n\t }\n\t ipad = Array(16), opad = Array(16);\n\t for (i = 0; i < 16; i += 1) {\n\t ipad[i] = bkey[i] ^ 0x36363636;\n\t opad[i] = bkey[i] ^ 0x5C5C5C5C;\n\t }\n\t hash = binb(ipad.concat(rstr2binb(data)), 512 + data.length * 8);\n\t return binb2rstr(binb(opad.concat(hash), 512 + 160));\n\t }", "function hmacify(text, secret) {\n return crypto.createHmac('sha256', secret).update(text).digest('base64');\n }", "calculateHash(nonce) {\n // Your code here\n\n }", "async function checkSignature(signedString, key, data) {\n const digestToCompare = await addSignature(key, data);\n return digestToCompare === signedString;\n}", "sign(data) {\n\t\treturn this.keyPair.sign(cryptoHash(data));\n\t}", "function rstr_hmac(key, data) {\n\t var bkey, ipad, opad, hash, i;\n\t\n\t key = (utf8) ? utf8Encode(key) : key;\n\t data = (utf8) ? utf8Encode(data) : data;\n\t bkey = rstr2binl(key);\n\t if (bkey.length > 16) {\n\t bkey = binl(bkey, key.length * 8);\n\t }\n\t\n\t ipad = Array(16), opad = Array(16);\n\t for (i = 0; i < 16; i += 1) {\n\t ipad[i] = bkey[i] ^ 0x36363636;\n\t opad[i] = bkey[i] ^ 0x5C5C5C5C;\n\t }\n\t hash = binl(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n\t return binl2rstr(binl(opad.concat(hash), 512 + 128));\n\t }" ]
[ "0.6751597", "0.647543", "0.6430366", "0.63804924", "0.63329715", "0.6276386", "0.6275959", "0.6228531", "0.6183792", "0.6110873", "0.61022156", "0.6099994", "0.60733587", "0.60629773", "0.6057935", "0.6057832", "0.6057832", "0.6057832", "0.6057832", "0.6057832", "0.6057832", "0.6051086", "0.6049393", "0.6046481", "0.6033611", "0.6032416", "0.60239905", "0.5995638", "0.5971293", "0.5957313", "0.5951133", "0.5949249", "0.5912645", "0.587943", "0.587943", "0.58749914", "0.58328414", "0.5825582", "0.5786806", "0.577561", "0.575186", "0.5750057", "0.5686734", "0.5674332", "0.5656519", "0.5652779", "0.56321573", "0.56290954", "0.5603516", "0.5561684", "0.5555101", "0.5554957", "0.5502824", "0.550192", "0.5486357", "0.5471648", "0.5471116", "0.54678136", "0.54659057", "0.54592323", "0.5451458", "0.54418224", "0.5441512", "0.5437278", "0.5432579", "0.5430688", "0.542854", "0.5422348", "0.5410162", "0.5397951", "0.53954893", "0.5391655", "0.5390026", "0.53792006", "0.5378984", "0.5378801", "0.53733283", "0.53719944", "0.53640425", "0.5363861", "0.5363861", "0.5363244", "0.53512716", "0.53436494", "0.5337338", "0.53266203", "0.53147596", "0.5307241", "0.53048474", "0.52939963", "0.5285757", "0.5278695", "0.5273725", "0.5273083", "0.5263043", "0.5262327", "0.5259562", "0.52493334", "0.52466583", "0.52457494" ]
0.55532944
52
Very similar to aesgcmencryptdecrypt.hml
function testAesGcm() { var testCase = { "key": "e03548984a7ec8eaf0870637df0ac6bc17f7159315d0ae26a764fd224e483810", "iv": "f4feb26b846be4cd224dbc5133a5ae13814ebe19d3032acdd3a006463fdb71e83a9d5d96679f26cc1719dd6b4feb3bab5b4b7993d0c0681f36d105ad3002fb66b201538e2b7479838ab83402b0d816cd6e0fe5857e6f4adf92de8ee72b122ba1ac81795024943b7d0151bbf84ce87c8911f512c397d14112296da7ecdd0da52a", "cipherText": "fda718aa1ec163487e21afc34f5a3a34795a9ee71dd3e7ee9a18fdb24181dc982b29c6ec723294a130ca2234952bb0ef68c0f3", "additionalData": "aab26eb3e7acd09a034a9e2651636ab3868e51281590ecc948355e457da42b7ad1391c7be0d9e82895e506173a81857c3226829fbd6dfb3f9657a71a2934445d7c05fa9401cddd5109016ba32c3856afaadc48de80b8a01b57cb", "authenticationTag": "4795fbe0", "plainText": "69fd0c9da10b56ec6786333f8d76d4b74f8a434195f2f241f088b2520fb5fa29455df9893164fb1638abe6617915d9497a8fe2" } var key = null; var keyData = hexStringToUint8Array(testCase.key); var iv = hexStringToUint8Array(testCase.iv); var additionalData = hexStringToUint8Array(testCase.additionalData); var tag = hexStringToUint8Array(testCase.authenticationTag); var usages = ['encrypt', 'decrypt']; var extractable = false; var tagLengthBits = tag.byteLength * 8; var algorithm = {name: 'aes-gcm', iv: iv, additionalData: additionalData, tagLength: tagLengthBits}; // (1) Import the key return crypto.subtle.importKey('raw', keyData, algorithm, extractable, usages).then(function(result) { key = result; // shouldBe() can only resolve variables in global context. tmpKey = key; shouldEvaluateAsSilent("tmpKey.type", "secret"); shouldEvaluateAsSilent("tmpKey.extractable", false); shouldEvaluateAsSilent("tmpKey.algorithm.name", "AES-GCM"); shouldEvaluateAsSilent("tmpKey.usages.join(',')", "encrypt,decrypt"); // (2) Encrypt var encryptPromise1 = crypto.subtle.encrypt(algorithm, key, hexStringToUint8Array(testCase.plainText)); var encryptPromise2 = crypto.subtle.encrypt(algorithm, key, hexStringToUint8Array(testCase.plainText)); // (3) Decrypt var decryptPromise1 = crypto.subtle.decrypt(algorithm, key, hexStringToUint8Array(testCase.cipherText + testCase.authenticationTag)); var decryptPromise2 = crypto.subtle.decrypt(algorithm, key, hexStringToUint8Array(testCase.cipherText + testCase.authenticationTag)); return Promise.all([encryptPromise1, encryptPromise2, decryptPromise1, decryptPromise2]); }).then(function(result) { // encryptPromise1, encryptPromise2 for (var i = 0; i < 2; ++i) { cipherText = result[i]; shouldEvaluateAsSilent("bytesToHexString(cipherText)", testCase.cipherText + testCase.authenticationTag); } // decryptPromise1, decryptPromise2 for (var i = 0; i < 2; ++i) { plainText = result[2 + i]; shouldEvaluateAsSilent("bytesToHexString(plainText)", testCase.plainText); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "decrypt(str, settings){}", "function decryptGCM(symmetricKey, ivCiphertextAndTag) {\n const nonce = ivCiphertextAndTag.slice(0, NONCE_LENGTH)\n const ciphertext = ivCiphertextAndTag.slice(NONCE_LENGTH, ivCiphertextAndTag.byteLength - TAG_LENGTH)\n const tag = ivCiphertextAndTag.slice(ivCiphertextAndTag.byteLength - TAG_LENGTH)\n\n const decipher = crypto.createDecipheriv('aes-256-gcm', symmetricKey, nonce)\n decipher.setAuthTag(tag)\n //return decipher.update(ciphertext, 'binary', 'utf8') + decipher.final();\n return Buffer.concat([decipher.update(ciphertext), decipher.final()])\n}", "function decrypt(text){\n var decipher = crypto.createDecipher('aes-256-ctr', clave)\n var dec = decipher.update(text,'hex','utf8')\n dec += decipher.final('utf8');\n return dec;\n }", "function decrypt(text) { \n \n var inmess = Buffer.from(text);\n let ivv = Buffer.from(iv, 'hex'); \n let encryptedText = Buffer.from(inmess, 'hex'); \n let decipher = crypto.createDecipheriv('aes-256-cbc', Buffer.from(key), ivv); \n let decrypted = decipher.update(encryptedText); \n decypted = Buffer.concat([decrypted, decipher.final()]); \n //console.log(decypted.toString());\n var txt=decypted.toString()\n return txt; \n}", "async function encryptMessage(f) {\n //console.log(\"IV\", iv)\n const key = await crypto.subtle.importKey(\n \"jwk\",\n JSON.parse(process.env.AES_KEY),\n { name: \"AES-GCM\" },\n true,\n [\"encrypt\", \"decrypt\"]\n );\n //console.log(key)\n let encoded = getMessageEncoding(f);\n // counter will be needed for decryption\n //counter = crypto.getRandomValues(new Uint8Array(16));\n return await crypto.subtle.encrypt(\n {\n name: \"AES-GCM\",\n iv: iv,\n },\n key,\n encoded\n );\n //console.log(ab2str.ab2str(encrypted));\n //console.log(encrypted);\n}", "function aesEncryption(message, password){\r\n var ciphertext = CryptoJS.AES.encrypt(message, password).toString();\r\n return ciphertext;\r\n}", "decrypt_aes(password, encrypted) {\n\t\tconst decipher = crypto.createDecipher('aes128', password);\n\t\tvar decrypted = decipher.update(encrypted, 'hex', 'utf8');\n\t\tdecrypted += decipher.final('utf8');\n\t\treturn decrypted;\n\t}", "function _newIv(text){\n var newIv = _encode(text.substr(0, 16));\n return newIv[0];\n}", "function aesDecryption(crypted, password){\r\n var bytes = CryptoJS.AES.decrypt(crypted, password);\r\n var originalText = bytes.toString(CryptoJS.enc.Utf8);\r\n return originalText;\r\n}", "crypt(bytes, dk, ivmod, encrypt) {\n \n // xor dk.iv and the iv modifier\n var actualIV = Buffer.alloc(NEXO_IV_LENGTH);\n for (var i = 0; i < NEXO_IV_LENGTH; i++) {\n actualIV[i] = dk.iv[i] ^ ivmod[i];\n }\n \n var cipher;\n if (encrypt) {\n cipher = crypto.createCipheriv('aes-256-cbc', dk.cipher_key, actualIV);\n } else {\n cipher = crypto.createDecipheriv('aes-256-cbc', dk.cipher_key, actualIV);\n }\n \n var data = cipher.update(bytes);\n data = Buffer.concat([data, cipher.final()]);\n \n return data;\n }", "encryptWithkey(buffer, key){\n var cipher = crypto.createCipheriv('aes-256-ecb',key,new Buffer(0));\n var crypted = cipher.update(buffer,'utf8','base64');\n crypted = crypted+ cipher.final('base64');\n console.log('printed: ', crypted);\n return crypted;\n }", "function decrypt_aes(ciphertext, iv, secret_key) {\n var decipher = forge.cipher.createDecipher('AES-CBC', secret_key);\n var encrypted = new forge.util.ByteStringBuffer().putBytes(ciphertext);\n decipher.start({iv: iv});\n decipher.update(encrypted);\n var finished = decipher.finish(); // check 'result' for true/false\n\n return decipher.output.data;\n }", "function decrypt(data,key){\n\tvar decipher = crypto.createDecipher('aes256', key);\n var decrypted = decipher.update(data, 'hex', 'utf-8');\n decrypted += decipher.final('utf-8');\n return decrypted;\n}", "function decryptSymmetric(encryptText, ENCRYPTION_KEY) {\n const algorithm = 'aes-256-ctr';\n let textParts = encryptText.split(':');\n // @ts-ignore\n let iv = Buffer.from(textParts.shift(), 'base64');\n let encryptedText = Buffer.from(textParts.join(':'), 'base64');\n let decipher = crypto_1.default.createDecipheriv(algorithm, Buffer.from(ENCRYPTION_KEY, 'base64'), iv);\n let decrypted = decipher.update(encryptedText);\n decrypted = Buffer.concat([decrypted, decipher.final()]);\n return decrypted.toString();\n}", "decrypt(data, key) {\n if (data.length == 0) {\n return '';\n }\n let aesMode, dataToDecrypt;\n if (data.length % 16 == 0) {\n // ECB\n aesMode = new Aes.ModeOfOperation.ecb(key);\n dataToDecrypt = data;\n } else if (data.length % 16 == 1 && data[0] == '!'.charCodeAt(0)) {\n // CBC\n let iv = data.subarray(1,17);\n aesMode = new Aes.ModeOfOperation.cbc(key, iv);\n dataToDecrypt = data.subarray(17, data.length);\n } else {\n throw new Error(`Unable to decrypt data of length ${data.length}`);\n }\n let decryptedBytes = Aes.padding.pkcs7.strip(aesMode.decrypt(dataToDecrypt));\n return Aes.utils.utf8.fromBytes(decryptedBytes);\n }", "function decryptAESecb(dataBuffer, key, iv) {\n\tvar decipher = crypto.createDecipheriv('aes-128-ecb', key, iv);\n\treturn Buffer.concat([decipher.update(dataBuffer), decipher.final()]).toString();\n}", "function aes_decrypt(ciphertext, enc_key, IV) {\n var ct = CryptoJS.enc.Hex.parse(tlsn_utils.ba2hex(ciphertext));\n var key = CryptoJS.enc.Hex.parse(tlsn_utils.ba2hex(enc_key));\n var iv = CryptoJS.enc.Hex.parse(tlsn_utils.ba2hex(IV));\n var cipherParams = CryptoJS.lib.CipherParams.create({ ciphertext: ct });\n var decrypted = CryptoJS.AES.decrypt(cipherParams, key, { iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.NoPadding });\n return tlsn_utils.wa2ba(decrypted.words);\n}", "function des(keys, message, encrypt, mode, iv, padding) {\n //declaring this locally speeds things up a bit\n const spfunction1 = [0x1010400, 0, 0x10000, 0x1010404, 0x1010004, 0x10404, 0x4, 0x10000, 0x400, 0x1010400, 0x1010404, 0x400, 0x1000404, 0x1010004, 0x1000000, 0x4, 0x404, 0x1000400, 0x1000400, 0x10400, 0x10400, 0x1010000, 0x1010000, 0x1000404, 0x10004, 0x1000004, 0x1000004, 0x10004, 0, 0x404, 0x10404, 0x1000000, 0x10000, 0x1010404, 0x4, 0x1010000, 0x1010400, 0x1000000, 0x1000000, 0x400, 0x1010004, 0x10000, 0x10400, 0x1000004, 0x400, 0x4, 0x1000404, 0x10404, 0x1010404, 0x10004, 0x1010000, 0x1000404, 0x1000004, 0x404, 0x10404, 0x1010400, 0x404, 0x1000400, 0x1000400, 0, 0x10004, 0x10400, 0, 0x1010004];\n const spfunction2 = [-0x7fef7fe0, -0x7fff8000, 0x8000, 0x108020, 0x100000, 0x20, -0x7fefffe0, -0x7fff7fe0, -0x7fffffe0, -0x7fef7fe0, -0x7fef8000, -0x80000000, -0x7fff8000, 0x100000, 0x20, -0x7fefffe0, 0x108000, 0x100020, -0x7fff7fe0, 0, -0x80000000, 0x8000, 0x108020, -0x7ff00000, 0x100020, -0x7fffffe0, 0, 0x108000, 0x8020, -0x7fef8000, -0x7ff00000, 0x8020, 0, 0x108020, -0x7fefffe0, 0x100000, -0x7fff7fe0, -0x7ff00000, -0x7fef8000, 0x8000, -0x7ff00000, -0x7fff8000, 0x20, -0x7fef7fe0, 0x108020, 0x20, 0x8000, -0x80000000, 0x8020, -0x7fef8000, 0x100000, -0x7fffffe0, 0x100020, -0x7fff7fe0, -0x7fffffe0, 0x100020, 0x108000, 0, -0x7fff8000, 0x8020, -0x80000000, -0x7fefffe0, -0x7fef7fe0, 0x108000];\n const spfunction3 = [0x208, 0x8020200, 0, 0x8020008, 0x8000200, 0, 0x20208, 0x8000200, 0x20008, 0x8000008, 0x8000008, 0x20000, 0x8020208, 0x20008, 0x8020000, 0x208, 0x8000000, 0x8, 0x8020200, 0x200, 0x20200, 0x8020000, 0x8020008, 0x20208, 0x8000208, 0x20200, 0x20000, 0x8000208, 0x8, 0x8020208, 0x200, 0x8000000, 0x8020200, 0x8000000, 0x20008, 0x208, 0x20000, 0x8020200, 0x8000200, 0, 0x200, 0x20008, 0x8020208, 0x8000200, 0x8000008, 0x200, 0, 0x8020008, 0x8000208, 0x20000, 0x8000000, 0x8020208, 0x8, 0x20208, 0x20200, 0x8000008, 0x8020000, 0x8000208, 0x208, 0x8020000, 0x20208, 0x8, 0x8020008, 0x20200];\n const spfunction4 = [0x802001, 0x2081, 0x2081, 0x80, 0x802080, 0x800081, 0x800001, 0x2001, 0, 0x802000, 0x802000, 0x802081, 0x81, 0, 0x800080, 0x800001, 0x1, 0x2000, 0x800000, 0x802001, 0x80, 0x800000, 0x2001, 0x2080, 0x800081, 0x1, 0x2080, 0x800080, 0x2000, 0x802080, 0x802081, 0x81, 0x800080, 0x800001, 0x802000, 0x802081, 0x81, 0, 0, 0x802000, 0x2080, 0x800080, 0x800081, 0x1, 0x802001, 0x2081, 0x2081, 0x80, 0x802081, 0x81, 0x1, 0x2000, 0x800001, 0x2001, 0x802080, 0x800081, 0x2001, 0x2080, 0x800000, 0x802001, 0x80, 0x800000, 0x2000, 0x802080];\n const spfunction5 = [0x100, 0x2080100, 0x2080000, 0x42000100, 0x80000, 0x100, 0x40000000, 0x2080000, 0x40080100, 0x80000, 0x2000100, 0x40080100, 0x42000100, 0x42080000, 0x80100, 0x40000000, 0x2000000, 0x40080000, 0x40080000, 0, 0x40000100, 0x42080100, 0x42080100, 0x2000100, 0x42080000, 0x40000100, 0, 0x42000000, 0x2080100, 0x2000000, 0x42000000, 0x80100, 0x80000, 0x42000100, 0x100, 0x2000000, 0x40000000, 0x2080000, 0x42000100, 0x40080100, 0x2000100, 0x40000000, 0x42080000, 0x2080100, 0x40080100, 0x100, 0x2000000, 0x42080000, 0x42080100, 0x80100, 0x42000000, 0x42080100, 0x2080000, 0, 0x40080000, 0x42000000, 0x80100, 0x2000100, 0x40000100, 0x80000, 0, 0x40080000, 0x2080100, 0x40000100];\n const spfunction6 = [0x20000010, 0x20400000, 0x4000, 0x20404010, 0x20400000, 0x10, 0x20404010, 0x400000, 0x20004000, 0x404010, 0x400000, 0x20000010, 0x400010, 0x20004000, 0x20000000, 0x4010, 0, 0x400010, 0x20004010, 0x4000, 0x404000, 0x20004010, 0x10, 0x20400010, 0x20400010, 0, 0x404010, 0x20404000, 0x4010, 0x404000, 0x20404000, 0x20000000, 0x20004000, 0x10, 0x20400010, 0x404000, 0x20404010, 0x400000, 0x4010, 0x20000010, 0x400000, 0x20004000, 0x20000000, 0x4010, 0x20000010, 0x20404010, 0x404000, 0x20400000, 0x404010, 0x20404000, 0, 0x20400010, 0x10, 0x4000, 0x20400000, 0x404010, 0x4000, 0x400010, 0x20004010, 0, 0x20404000, 0x20000000, 0x400010, 0x20004010];\n const spfunction7 = [0x200000, 0x4200002, 0x4000802, 0, 0x800, 0x4000802, 0x200802, 0x4200800, 0x4200802, 0x200000, 0, 0x4000002, 0x2, 0x4000000, 0x4200002, 0x802, 0x4000800, 0x200802, 0x200002, 0x4000800, 0x4000002, 0x4200000, 0x4200800, 0x200002, 0x4200000, 0x800, 0x802, 0x4200802, 0x200800, 0x2, 0x4000000, 0x200800, 0x4000000, 0x200800, 0x200000, 0x4000802, 0x4000802, 0x4200002, 0x4200002, 0x2, 0x200002, 0x4000000, 0x4000800, 0x200000, 0x4200800, 0x802, 0x200802, 0x4200800, 0x802, 0x4000002, 0x4200802, 0x4200000, 0x200800, 0, 0x2, 0x4200802, 0, 0x200802, 0x4200000, 0x800, 0x4000002, 0x4000800, 0x800, 0x200002];\n const spfunction8 = [0x10001040, 0x1000, 0x40000, 0x10041040, 0x10000000, 0x10001040, 0x40, 0x10000000, 0x40040, 0x10040000, 0x10041040, 0x41000, 0x10041000, 0x41040, 0x1000, 0x40, 0x10040000, 0x10000040, 0x10001000, 0x1040, 0x41000, 0x40040, 0x10040040, 0x10041000, 0x1040, 0, 0, 0x10040040, 0x10000040, 0x10001000, 0x41040, 0x40000, 0x41040, 0x40000, 0x10041000, 0x1000, 0x40, 0x10040040, 0x1000, 0x41040, 0x10001000, 0x40, 0x10000040, 0x10040000, 0x10040040, 0x10000000, 0x40000, 0x10001040, 0, 0x10041040, 0x40040, 0x10000040, 0x10040000, 0x10001000, 0x10001040, 0, 0x10041040, 0x41000, 0x41000, 0x1040, 0x1040, 0x40040, 0x10000000, 0x10041000];\n\n //create the 16 or 48 subkeys we will need\n let m = 0;\n let i;\n let j;\n let temp;\n let right1;\n let right2;\n let left;\n let right;\n let looping;\n let cbcleft;\n let cbcleft2;\n let cbcright;\n let cbcright2;\n let endloop;\n let loopinc;\n let len = message.length;\n\n //set up the loops for single and triple des\n const iterations = keys.length === 32 ? 3 : 9; //single or triple des\n if (iterations === 3) {\n looping = encrypt ? [0, 32, 2] : [30, -2, -2];\n } else {\n looping = encrypt ? [0, 32, 2, 62, 30, -2, 64, 96, 2] : [94, 62, -2, 32, 64, 2, 30, -2, -2];\n }\n\n //pad the message depending on the padding parameter\n //only add padding if encrypting - note that you need to use the same padding option for both encrypt and decrypt\n if (encrypt) {\n message = des_addPadding(message, padding);\n len = message.length;\n }\n\n //store the result here\n let result = new Uint8Array(len);\n let k = 0;\n\n if (mode === 1) {\n //CBC mode\n cbcleft = iv[m++] << 24 | iv[m++] << 16 | iv[m++] << 8 | iv[m++];\n cbcright = iv[m++] << 24 | iv[m++] << 16 | iv[m++] << 8 | iv[m++];\n m = 0;\n }\n\n //loop through each 64 bit chunk of the message\n while (m < len) {\n left = message[m++] << 24 | message[m++] << 16 | message[m++] << 8 | message[m++];\n right = message[m++] << 24 | message[m++] << 16 | message[m++] << 8 | message[m++];\n\n //for Cipher Block Chaining mode, xor the message with the previous result\n if (mode === 1) {\n if (encrypt) {\n left ^= cbcleft;\n right ^= cbcright;\n } else {\n cbcleft2 = cbcleft;\n cbcright2 = cbcright;\n cbcleft = left;\n cbcright = right;\n }\n }\n\n //first each 64 but chunk of the message must be permuted according to IP\n temp = (left >>> 4 ^ right) & 0x0f0f0f0f;\n right ^= temp;\n left ^= temp << 4;\n temp = (left >>> 16 ^ right) & 0x0000ffff;\n right ^= temp;\n left ^= temp << 16;\n temp = (right >>> 2 ^ left) & 0x33333333;\n left ^= temp;\n right ^= temp << 2;\n temp = (right >>> 8 ^ left) & 0x00ff00ff;\n left ^= temp;\n right ^= temp << 8;\n temp = (left >>> 1 ^ right) & 0x55555555;\n right ^= temp;\n left ^= temp << 1;\n\n left = left << 1 | left >>> 31;\n right = right << 1 | right >>> 31;\n\n //do this either 1 or 3 times for each chunk of the message\n for (j = 0; j < iterations; j += 3) {\n endloop = looping[j + 1];\n loopinc = looping[j + 2];\n //now go through and perform the encryption or decryption\n for (i = looping[j]; i !== endloop; i += loopinc) {\n //for efficiency\n right1 = right ^ keys[i];\n right2 = (right >>> 4 | right << 28) ^ keys[i + 1];\n //the result is attained by passing these bytes through the S selection functions\n temp = left;\n left = right;\n right = temp ^ (spfunction2[right1 >>> 24 & 0x3f] | spfunction4[right1 >>> 16 & 0x3f] | spfunction6[right1 >>> 8 & 0x3f] | spfunction8[right1 & 0x3f] | spfunction1[right2 >>> 24 & 0x3f] | spfunction3[right2 >>> 16 & 0x3f] | spfunction5[right2 >>> 8 & 0x3f] | spfunction7[right2 & 0x3f]);\n }\n temp = left;\n left = right;\n right = temp; //unreverse left and right\n } //for either 1 or 3 iterations\n\n //move then each one bit to the right\n left = left >>> 1 | left << 31;\n right = right >>> 1 | right << 31;\n\n //now perform IP-1, which is IP in the opposite direction\n temp = (left >>> 1 ^ right) & 0x55555555;\n right ^= temp;\n left ^= temp << 1;\n temp = (right >>> 8 ^ left) & 0x00ff00ff;\n left ^= temp;\n right ^= temp << 8;\n temp = (right >>> 2 ^ left) & 0x33333333;\n left ^= temp;\n right ^= temp << 2;\n temp = (left >>> 16 ^ right) & 0x0000ffff;\n right ^= temp;\n left ^= temp << 16;\n temp = (left >>> 4 ^ right) & 0x0f0f0f0f;\n right ^= temp;\n left ^= temp << 4;\n\n //for Cipher Block Chaining mode, xor the message with the previous result\n if (mode === 1) {\n if (encrypt) {\n cbcleft = left;\n cbcright = right;\n } else {\n left ^= cbcleft2;\n right ^= cbcright2;\n }\n }\n\n result[k++] = left >>> 24;\n result[k++] = left >>> 16 & 0xff;\n result[k++] = left >>> 8 & 0xff;\n result[k++] = left & 0xff;\n result[k++] = right >>> 24;\n result[k++] = right >>> 16 & 0xff;\n result[k++] = right >>> 8 & 0xff;\n result[k++] = right & 0xff;\n } //for every 8 characters, or 64 bits in the message\n\n //only remove padding if decrypting - note that you need to use the same padding option for both encrypt and decrypt\n if (!encrypt) {\n result = des_removePadding(result, padding);\n }\n\n return result;\n} //end of des", "function decrypt(key, data) {\n var decipher = crypto.createDecipher('aes-256-cbc', key);\n var decrypted = decipher.update(data, 'hex', 'utf-8');\n decrypted += decipher.final('utf-8');\n return decrypted;\n}", "function des(keys, message, encrypt, mode, iv, padding) {\n //declaring this locally speeds things up a bit\n const spfunction1 = [\n 0x1010400, 0, 0x10000, 0x1010404, 0x1010004, 0x10404, 0x4, 0x10000, 0x400, 0x1010400,\n 0x1010404, 0x400, 0x1000404, 0x1010004, 0x1000000, 0x4, 0x404, 0x1000400, 0x1000400, 0x10400, 0x10400, 0x1010000,\n 0x1010000, 0x1000404, 0x10004, 0x1000004, 0x1000004, 0x10004, 0, 0x404, 0x10404, 0x1000000, 0x10000, 0x1010404, 0x4,\n 0x1010000, 0x1010400, 0x1000000, 0x1000000, 0x400, 0x1010004, 0x10000, 0x10400, 0x1000004, 0x400, 0x4, 0x1000404,\n 0x10404, 0x1010404, 0x10004, 0x1010000, 0x1000404, 0x1000004, 0x404, 0x10404, 0x1010400, 0x404, 0x1000400,\n 0x1000400, 0, 0x10004, 0x10400, 0, 0x1010004\n ];\n const spfunction2 = [\n -0x7fef7fe0, -0x7fff8000, 0x8000, 0x108020, 0x100000, 0x20, -0x7fefffe0, -0x7fff7fe0,\n -0x7fffffe0, -0x7fef7fe0, -0x7fef8000, -0x80000000, -0x7fff8000, 0x100000, 0x20, -0x7fefffe0, 0x108000, 0x100020,\n -0x7fff7fe0, 0, -0x80000000, 0x8000, 0x108020, -0x7ff00000, 0x100020, -0x7fffffe0, 0, 0x108000, 0x8020, -0x7fef8000,\n -0x7ff00000, 0x8020, 0, 0x108020, -0x7fefffe0, 0x100000, -0x7fff7fe0, -0x7ff00000, -0x7fef8000, 0x8000, -0x7ff00000,\n -0x7fff8000, 0x20, -0x7fef7fe0, 0x108020, 0x20, 0x8000, -0x80000000, 0x8020, -0x7fef8000, 0x100000, -0x7fffffe0,\n 0x100020, -0x7fff7fe0, -0x7fffffe0, 0x100020, 0x108000, 0, -0x7fff8000, 0x8020, -0x80000000, -0x7fefffe0,\n -0x7fef7fe0, 0x108000\n ];\n const spfunction3 = [\n 0x208, 0x8020200, 0, 0x8020008, 0x8000200, 0, 0x20208, 0x8000200, 0x20008, 0x8000008,\n 0x8000008, 0x20000, 0x8020208, 0x20008, 0x8020000, 0x208, 0x8000000, 0x8, 0x8020200, 0x200, 0x20200, 0x8020000,\n 0x8020008, 0x20208, 0x8000208, 0x20200, 0x20000, 0x8000208, 0x8, 0x8020208, 0x200, 0x8000000, 0x8020200, 0x8000000,\n 0x20008, 0x208, 0x20000, 0x8020200, 0x8000200, 0, 0x200, 0x20008, 0x8020208, 0x8000200, 0x8000008, 0x200, 0,\n 0x8020008, 0x8000208, 0x20000, 0x8000000, 0x8020208, 0x8, 0x20208, 0x20200, 0x8000008, 0x8020000, 0x8000208, 0x208,\n 0x8020000, 0x20208, 0x8, 0x8020008, 0x20200\n ];\n const spfunction4 = [\n 0x802001, 0x2081, 0x2081, 0x80, 0x802080, 0x800081, 0x800001, 0x2001, 0, 0x802000,\n 0x802000, 0x802081, 0x81, 0, 0x800080, 0x800001, 0x1, 0x2000, 0x800000, 0x802001, 0x80, 0x800000, 0x2001, 0x2080,\n 0x800081, 0x1, 0x2080, 0x800080, 0x2000, 0x802080, 0x802081, 0x81, 0x800080, 0x800001, 0x802000, 0x802081, 0x81, 0,\n 0, 0x802000, 0x2080, 0x800080, 0x800081, 0x1, 0x802001, 0x2081, 0x2081, 0x80, 0x802081, 0x81, 0x1, 0x2000, 0x800001,\n 0x2001, 0x802080, 0x800081, 0x2001, 0x2080, 0x800000, 0x802001, 0x80, 0x800000, 0x2000, 0x802080\n ];\n const spfunction5 = [\n 0x100, 0x2080100, 0x2080000, 0x42000100, 0x80000, 0x100, 0x40000000, 0x2080000,\n 0x40080100, 0x80000, 0x2000100, 0x40080100, 0x42000100, 0x42080000, 0x80100, 0x40000000, 0x2000000, 0x40080000,\n 0x40080000, 0, 0x40000100, 0x42080100, 0x42080100, 0x2000100, 0x42080000, 0x40000100, 0, 0x42000000, 0x2080100,\n 0x2000000, 0x42000000, 0x80100, 0x80000, 0x42000100, 0x100, 0x2000000, 0x40000000, 0x2080000, 0x42000100,\n 0x40080100, 0x2000100, 0x40000000, 0x42080000, 0x2080100, 0x40080100, 0x100, 0x2000000, 0x42080000, 0x42080100,\n 0x80100, 0x42000000, 0x42080100, 0x2080000, 0, 0x40080000, 0x42000000, 0x80100, 0x2000100, 0x40000100, 0x80000, 0,\n 0x40080000, 0x2080100, 0x40000100\n ];\n const spfunction6 = [\n 0x20000010, 0x20400000, 0x4000, 0x20404010, 0x20400000, 0x10, 0x20404010, 0x400000,\n 0x20004000, 0x404010, 0x400000, 0x20000010, 0x400010, 0x20004000, 0x20000000, 0x4010, 0, 0x400010, 0x20004010,\n 0x4000, 0x404000, 0x20004010, 0x10, 0x20400010, 0x20400010, 0, 0x404010, 0x20404000, 0x4010, 0x404000, 0x20404000,\n 0x20000000, 0x20004000, 0x10, 0x20400010, 0x404000, 0x20404010, 0x400000, 0x4010, 0x20000010, 0x400000, 0x20004000,\n 0x20000000, 0x4010, 0x20000010, 0x20404010, 0x404000, 0x20400000, 0x404010, 0x20404000, 0, 0x20400010, 0x10, 0x4000,\n 0x20400000, 0x404010, 0x4000, 0x400010, 0x20004010, 0, 0x20404000, 0x20000000, 0x400010, 0x20004010\n ];\n const spfunction7 = [\n 0x200000, 0x4200002, 0x4000802, 0, 0x800, 0x4000802, 0x200802, 0x4200800, 0x4200802,\n 0x200000, 0, 0x4000002, 0x2, 0x4000000, 0x4200002, 0x802, 0x4000800, 0x200802, 0x200002, 0x4000800, 0x4000002,\n 0x4200000, 0x4200800, 0x200002, 0x4200000, 0x800, 0x802, 0x4200802, 0x200800, 0x2, 0x4000000, 0x200800, 0x4000000,\n 0x200800, 0x200000, 0x4000802, 0x4000802, 0x4200002, 0x4200002, 0x2, 0x200002, 0x4000000, 0x4000800, 0x200000,\n 0x4200800, 0x802, 0x200802, 0x4200800, 0x802, 0x4000002, 0x4200802, 0x4200000, 0x200800, 0, 0x2, 0x4200802, 0,\n 0x200802, 0x4200000, 0x800, 0x4000002, 0x4000800, 0x800, 0x200002\n ];\n const spfunction8 = [\n 0x10001040, 0x1000, 0x40000, 0x10041040, 0x10000000, 0x10001040, 0x40, 0x10000000,\n 0x40040, 0x10040000, 0x10041040, 0x41000, 0x10041000, 0x41040, 0x1000, 0x40, 0x10040000, 0x10000040, 0x10001000,\n 0x1040, 0x41000, 0x40040, 0x10040040, 0x10041000, 0x1040, 0, 0, 0x10040040, 0x10000040, 0x10001000, 0x41040,\n 0x40000, 0x41040, 0x40000, 0x10041000, 0x1000, 0x40, 0x10040040, 0x1000, 0x41040, 0x10001000, 0x40, 0x10000040,\n 0x10040000, 0x10040040, 0x10000000, 0x40000, 0x10001040, 0, 0x10041040, 0x40040, 0x10000040, 0x10040000, 0x10001000,\n 0x10001040, 0, 0x10041040, 0x41000, 0x41000, 0x1040, 0x1040, 0x40040, 0x10000000, 0x10041000\n ];\n\n //create the 16 or 48 subkeys we will need\n let m = 0;\n let i;\n let j;\n let temp;\n let right1;\n let right2;\n let left;\n let right;\n let looping;\n let cbcleft;\n let cbcleft2;\n let cbcright;\n let cbcright2;\n let endloop;\n let loopinc;\n let len = message.length;\n\n //set up the loops for single and triple des\n const iterations = keys.length === 32 ? 3 : 9; //single or triple des\n if (iterations === 3) {\n looping = encrypt ? [0, 32, 2] : [30, -2, -2];\n } else {\n looping = encrypt ? [0, 32, 2, 62, 30, -2, 64, 96, 2] : [94, 62, -2, 32, 64, 2, 30, -2, -2];\n }\n\n //pad the message depending on the padding parameter\n //only add padding if encrypting - note that you need to use the same padding option for both encrypt and decrypt\n if (encrypt) {\n message = des_addPadding(message, padding);\n len = message.length;\n }\n\n //store the result here\n let result = new Uint8Array(len);\n let k = 0;\n\n if (mode === 1) { //CBC mode\n cbcleft = (iv[m++] << 24) | (iv[m++] << 16) | (iv[m++] << 8) | iv[m++];\n cbcright = (iv[m++] << 24) | (iv[m++] << 16) | (iv[m++] << 8) | iv[m++];\n m = 0;\n }\n\n //loop through each 64 bit chunk of the message\n while (m < len) {\n left = (message[m++] << 24) | (message[m++] << 16) | (message[m++] << 8) | message[m++];\n right = (message[m++] << 24) | (message[m++] << 16) | (message[m++] << 8) | message[m++];\n\n //for Cipher Block Chaining mode, xor the message with the previous result\n if (mode === 1) {\n if (encrypt) {\n left ^= cbcleft;\n right ^= cbcright;\n } else {\n cbcleft2 = cbcleft;\n cbcright2 = cbcright;\n cbcleft = left;\n cbcright = right;\n }\n }\n\n //first each 64 but chunk of the message must be permuted according to IP\n temp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= temp;\n left ^= (temp << 4);\n temp = ((left >>> 16) ^ right) & 0x0000ffff;\n right ^= temp;\n left ^= (temp << 16);\n temp = ((right >>> 2) ^ left) & 0x33333333;\n left ^= temp;\n right ^= (temp << 2);\n temp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= temp;\n right ^= (temp << 8);\n temp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= temp;\n left ^= (temp << 1);\n\n left = ((left << 1) | (left >>> 31));\n right = ((right << 1) | (right >>> 31));\n\n //do this either 1 or 3 times for each chunk of the message\n for (j = 0; j < iterations; j += 3) {\n endloop = looping[j + 1];\n loopinc = looping[j + 2];\n //now go through and perform the encryption or decryption\n for (i = looping[j]; i !== endloop; i += loopinc) { //for efficiency\n right1 = right ^ keys[i];\n right2 = ((right >>> 4) | (right << 28)) ^ keys[i + 1];\n //the result is attained by passing these bytes through the S selection functions\n temp = left;\n left = right;\n right = temp ^ (spfunction2[(right1 >>> 24) & 0x3f] | spfunction4[(right1 >>> 16) & 0x3f] | spfunction6[(right1 >>>\n 8) & 0x3f] | spfunction8[right1 & 0x3f] | spfunction1[(right2 >>> 24) & 0x3f] | spfunction3[(right2 >>> 16) &\n 0x3f] | spfunction5[(right2 >>> 8) & 0x3f] | spfunction7[right2 & 0x3f]);\n }\n temp = left;\n left = right;\n right = temp; //unreverse left and right\n } //for either 1 or 3 iterations\n\n //move then each one bit to the right\n left = ((left >>> 1) | (left << 31));\n right = ((right >>> 1) | (right << 31));\n\n //now perform IP-1, which is IP in the opposite direction\n temp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= temp;\n left ^= (temp << 1);\n temp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= temp;\n right ^= (temp << 8);\n temp = ((right >>> 2) ^ left) & 0x33333333;\n left ^= temp;\n right ^= (temp << 2);\n temp = ((left >>> 16) ^ right) & 0x0000ffff;\n right ^= temp;\n left ^= (temp << 16);\n temp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= temp;\n left ^= (temp << 4);\n\n //for Cipher Block Chaining mode, xor the message with the previous result\n if (mode === 1) {\n if (encrypt) {\n cbcleft = left;\n cbcright = right;\n } else {\n left ^= cbcleft2;\n right ^= cbcright2;\n }\n }\n\n result[k++] = (left >>> 24);\n result[k++] = ((left >>> 16) & 0xff);\n result[k++] = ((left >>> 8) & 0xff);\n result[k++] = (left & 0xff);\n result[k++] = (right >>> 24);\n result[k++] = ((right >>> 16) & 0xff);\n result[k++] = ((right >>> 8) & 0xff);\n result[k++] = (right & 0xff);\n } //for every 8 characters, or 64 bits in the message\n\n //only remove padding if decrypting - note that you need to use the same padding option for both encrypt and decrypt\n if (!encrypt) {\n result = des_removePadding(result, padding);\n }\n\n return result;\n} //end of des", "function des(keys, message, encrypt, mode, iv, padding) {\n //declaring this locally speeds things up a bit\n var spfunction1 = [0x1010400, 0, 0x10000, 0x1010404, 0x1010004, 0x10404, 0x4, 0x10000, 0x400, 0x1010400, 0x1010404, 0x400, 0x1000404, 0x1010004, 0x1000000, 0x4, 0x404, 0x1000400, 0x1000400, 0x10400, 0x10400, 0x1010000, 0x1010000, 0x1000404, 0x10004, 0x1000004, 0x1000004, 0x10004, 0, 0x404, 0x10404, 0x1000000, 0x10000, 0x1010404, 0x4, 0x1010000, 0x1010400, 0x1000000, 0x1000000, 0x400, 0x1010004, 0x10000, 0x10400, 0x1000004, 0x400, 0x4, 0x1000404, 0x10404, 0x1010404, 0x10004, 0x1010000, 0x1000404, 0x1000004, 0x404, 0x10404, 0x1010400, 0x404, 0x1000400, 0x1000400, 0, 0x10004, 0x10400, 0, 0x1010004];\n var spfunction2 = [-0x7fef7fe0, -0x7fff8000, 0x8000, 0x108020, 0x100000, 0x20, -0x7fefffe0, -0x7fff7fe0, -0x7fffffe0, -0x7fef7fe0, -0x7fef8000, -0x80000000, -0x7fff8000, 0x100000, 0x20, -0x7fefffe0, 0x108000, 0x100020, -0x7fff7fe0, 0, -0x80000000, 0x8000, 0x108020, -0x7ff00000, 0x100020, -0x7fffffe0, 0, 0x108000, 0x8020, -0x7fef8000, -0x7ff00000, 0x8020, 0, 0x108020, -0x7fefffe0, 0x100000, -0x7fff7fe0, -0x7ff00000, -0x7fef8000, 0x8000, -0x7ff00000, -0x7fff8000, 0x20, -0x7fef7fe0, 0x108020, 0x20, 0x8000, -0x80000000, 0x8020, -0x7fef8000, 0x100000, -0x7fffffe0, 0x100020, -0x7fff7fe0, -0x7fffffe0, 0x100020, 0x108000, 0, -0x7fff8000, 0x8020, -0x80000000, -0x7fefffe0, -0x7fef7fe0, 0x108000];\n var spfunction3 = [0x208, 0x8020200, 0, 0x8020008, 0x8000200, 0, 0x20208, 0x8000200, 0x20008, 0x8000008, 0x8000008, 0x20000, 0x8020208, 0x20008, 0x8020000, 0x208, 0x8000000, 0x8, 0x8020200, 0x200, 0x20200, 0x8020000, 0x8020008, 0x20208, 0x8000208, 0x20200, 0x20000, 0x8000208, 0x8, 0x8020208, 0x200, 0x8000000, 0x8020200, 0x8000000, 0x20008, 0x208, 0x20000, 0x8020200, 0x8000200, 0, 0x200, 0x20008, 0x8020208, 0x8000200, 0x8000008, 0x200, 0, 0x8020008, 0x8000208, 0x20000, 0x8000000, 0x8020208, 0x8, 0x20208, 0x20200, 0x8000008, 0x8020000, 0x8000208, 0x208, 0x8020000, 0x20208, 0x8, 0x8020008, 0x20200];\n var spfunction4 = [0x802001, 0x2081, 0x2081, 0x80, 0x802080, 0x800081, 0x800001, 0x2001, 0, 0x802000, 0x802000, 0x802081, 0x81, 0, 0x800080, 0x800001, 0x1, 0x2000, 0x800000, 0x802001, 0x80, 0x800000, 0x2001, 0x2080, 0x800081, 0x1, 0x2080, 0x800080, 0x2000, 0x802080, 0x802081, 0x81, 0x800080, 0x800001, 0x802000, 0x802081, 0x81, 0, 0, 0x802000, 0x2080, 0x800080, 0x800081, 0x1, 0x802001, 0x2081, 0x2081, 0x80, 0x802081, 0x81, 0x1, 0x2000, 0x800001, 0x2001, 0x802080, 0x800081, 0x2001, 0x2080, 0x800000, 0x802001, 0x80, 0x800000, 0x2000, 0x802080];\n var spfunction5 = [0x100, 0x2080100, 0x2080000, 0x42000100, 0x80000, 0x100, 0x40000000, 0x2080000, 0x40080100, 0x80000, 0x2000100, 0x40080100, 0x42000100, 0x42080000, 0x80100, 0x40000000, 0x2000000, 0x40080000, 0x40080000, 0, 0x40000100, 0x42080100, 0x42080100, 0x2000100, 0x42080000, 0x40000100, 0, 0x42000000, 0x2080100, 0x2000000, 0x42000000, 0x80100, 0x80000, 0x42000100, 0x100, 0x2000000, 0x40000000, 0x2080000, 0x42000100, 0x40080100, 0x2000100, 0x40000000, 0x42080000, 0x2080100, 0x40080100, 0x100, 0x2000000, 0x42080000, 0x42080100, 0x80100, 0x42000000, 0x42080100, 0x2080000, 0, 0x40080000, 0x42000000, 0x80100, 0x2000100, 0x40000100, 0x80000, 0, 0x40080000, 0x2080100, 0x40000100];\n var spfunction6 = [0x20000010, 0x20400000, 0x4000, 0x20404010, 0x20400000, 0x10, 0x20404010, 0x400000, 0x20004000, 0x404010, 0x400000, 0x20000010, 0x400010, 0x20004000, 0x20000000, 0x4010, 0, 0x400010, 0x20004010, 0x4000, 0x404000, 0x20004010, 0x10, 0x20400010, 0x20400010, 0, 0x404010, 0x20404000, 0x4010, 0x404000, 0x20404000, 0x20000000, 0x20004000, 0x10, 0x20400010, 0x404000, 0x20404010, 0x400000, 0x4010, 0x20000010, 0x400000, 0x20004000, 0x20000000, 0x4010, 0x20000010, 0x20404010, 0x404000, 0x20400000, 0x404010, 0x20404000, 0, 0x20400010, 0x10, 0x4000, 0x20400000, 0x404010, 0x4000, 0x400010, 0x20004010, 0, 0x20404000, 0x20000000, 0x400010, 0x20004010];\n var spfunction7 = [0x200000, 0x4200002, 0x4000802, 0, 0x800, 0x4000802, 0x200802, 0x4200800, 0x4200802, 0x200000, 0, 0x4000002, 0x2, 0x4000000, 0x4200002, 0x802, 0x4000800, 0x200802, 0x200002, 0x4000800, 0x4000002, 0x4200000, 0x4200800, 0x200002, 0x4200000, 0x800, 0x802, 0x4200802, 0x200800, 0x2, 0x4000000, 0x200800, 0x4000000, 0x200800, 0x200000, 0x4000802, 0x4000802, 0x4200002, 0x4200002, 0x2, 0x200002, 0x4000000, 0x4000800, 0x200000, 0x4200800, 0x802, 0x200802, 0x4200800, 0x802, 0x4000002, 0x4200802, 0x4200000, 0x200800, 0, 0x2, 0x4200802, 0, 0x200802, 0x4200000, 0x800, 0x4000002, 0x4000800, 0x800, 0x200002];\n var spfunction8 = [0x10001040, 0x1000, 0x40000, 0x10041040, 0x10000000, 0x10001040, 0x40, 0x10000000, 0x40040, 0x10040000, 0x10041040, 0x41000, 0x10041000, 0x41040, 0x1000, 0x40, 0x10040000, 0x10000040, 0x10001000, 0x1040, 0x41000, 0x40040, 0x10040040, 0x10041000, 0x1040, 0, 0, 0x10040040, 0x10000040, 0x10001000, 0x41040, 0x40000, 0x41040, 0x40000, 0x10041000, 0x1000, 0x40, 0x10040040, 0x1000, 0x41040, 0x10001000, 0x40, 0x10000040, 0x10040000, 0x10040040, 0x10000000, 0x40000, 0x10001040, 0, 0x10041040, 0x40040, 0x10000040, 0x10040000, 0x10001000, 0x10001040, 0, 0x10041040, 0x41000, 0x41000, 0x1040, 0x1040, 0x40040, 0x10000000, 0x10041000];\n\n //create the 16 or 48 subkeys we will need\n var m = 0;\n var i = void 0;\n var j = void 0;\n var temp = void 0;\n var right1 = void 0;\n var right2 = void 0;\n var left = void 0;\n var right = void 0;\n var looping = void 0;\n var cbcleft = void 0;\n var cbcleft2 = void 0;\n var cbcright = void 0;\n var cbcright2 = void 0;\n var endloop = void 0;\n var loopinc = void 0;\n var len = message.length;\n\n //set up the loops for single and triple des\n var iterations = keys.length === 32 ? 3 : 9; //single or triple des\n if (iterations === 3) {\n looping = encrypt ? [0, 32, 2] : [30, -2, -2];\n } else {\n looping = encrypt ? [0, 32, 2, 62, 30, -2, 64, 96, 2] : [94, 62, -2, 32, 64, 2, 30, -2, -2];\n }\n\n //pad the message depending on the padding parameter\n //only add padding if encrypting - note that you need to use the same padding option for both encrypt and decrypt\n if (encrypt) {\n message = des_addPadding(message, padding);\n len = message.length;\n }\n\n //store the result here\n var result = new Uint8Array(len);\n var k = 0;\n\n if (mode === 1) {\n //CBC mode\n cbcleft = iv[m++] << 24 | iv[m++] << 16 | iv[m++] << 8 | iv[m++];\n cbcright = iv[m++] << 24 | iv[m++] << 16 | iv[m++] << 8 | iv[m++];\n m = 0;\n }\n\n //loop through each 64 bit chunk of the message\n while (m < len) {\n left = message[m++] << 24 | message[m++] << 16 | message[m++] << 8 | message[m++];\n right = message[m++] << 24 | message[m++] << 16 | message[m++] << 8 | message[m++];\n\n //for Cipher Block Chaining mode, xor the message with the previous result\n if (mode === 1) {\n if (encrypt) {\n left ^= cbcleft;\n right ^= cbcright;\n } else {\n cbcleft2 = cbcleft;\n cbcright2 = cbcright;\n cbcleft = left;\n cbcright = right;\n }\n }\n\n //first each 64 but chunk of the message must be permuted according to IP\n temp = (left >>> 4 ^ right) & 0x0f0f0f0f;\n right ^= temp;\n left ^= temp << 4;\n temp = (left >>> 16 ^ right) & 0x0000ffff;\n right ^= temp;\n left ^= temp << 16;\n temp = (right >>> 2 ^ left) & 0x33333333;\n left ^= temp;\n right ^= temp << 2;\n temp = (right >>> 8 ^ left) & 0x00ff00ff;\n left ^= temp;\n right ^= temp << 8;\n temp = (left >>> 1 ^ right) & 0x55555555;\n right ^= temp;\n left ^= temp << 1;\n\n left = left << 1 | left >>> 31;\n right = right << 1 | right >>> 31;\n\n //do this either 1 or 3 times for each chunk of the message\n for (j = 0; j < iterations; j += 3) {\n endloop = looping[j + 1];\n loopinc = looping[j + 2];\n //now go through and perform the encryption or decryption\n for (i = looping[j]; i !== endloop; i += loopinc) {\n //for efficiency\n right1 = right ^ keys[i];\n right2 = (right >>> 4 | right << 28) ^ keys[i + 1];\n //the result is attained by passing these bytes through the S selection functions\n temp = left;\n left = right;\n right = temp ^ (spfunction2[right1 >>> 24 & 0x3f] | spfunction4[right1 >>> 16 & 0x3f] | spfunction6[right1 >>> 8 & 0x3f] | spfunction8[right1 & 0x3f] | spfunction1[right2 >>> 24 & 0x3f] | spfunction3[right2 >>> 16 & 0x3f] | spfunction5[right2 >>> 8 & 0x3f] | spfunction7[right2 & 0x3f]);\n }\n temp = left;\n left = right;\n right = temp; //unreverse left and right\n } //for either 1 or 3 iterations\n\n //move then each one bit to the right\n left = left >>> 1 | left << 31;\n right = right >>> 1 | right << 31;\n\n //now perform IP-1, which is IP in the opposite direction\n temp = (left >>> 1 ^ right) & 0x55555555;\n right ^= temp;\n left ^= temp << 1;\n temp = (right >>> 8 ^ left) & 0x00ff00ff;\n left ^= temp;\n right ^= temp << 8;\n temp = (right >>> 2 ^ left) & 0x33333333;\n left ^= temp;\n right ^= temp << 2;\n temp = (left >>> 16 ^ right) & 0x0000ffff;\n right ^= temp;\n left ^= temp << 16;\n temp = (left >>> 4 ^ right) & 0x0f0f0f0f;\n right ^= temp;\n left ^= temp << 4;\n\n //for Cipher Block Chaining mode, xor the message with the previous result\n if (mode === 1) {\n if (encrypt) {\n cbcleft = left;\n cbcright = right;\n } else {\n left ^= cbcleft2;\n right ^= cbcright2;\n }\n }\n\n result[k++] = left >>> 24;\n result[k++] = left >>> 16 & 0xff;\n result[k++] = left >>> 8 & 0xff;\n result[k++] = left & 0xff;\n result[k++] = right >>> 24;\n result[k++] = right >>> 16 & 0xff;\n result[k++] = right >>> 8 & 0xff;\n result[k++] = right & 0xff;\n } //for every 8 characters, or 64 bits in the message\n\n //only remove padding if decrypting - note that you need to use the same padding option for both encrypt and decrypt\n if (!encrypt) {\n result = des_removePadding(result, padding);\n }\n\n return result;\n} //end of des", "function decryption(value) {\n var encryptedBytes = aesjs.utils.hex.toBytes(value);\n var aesCtr = new aesjs.ModeOfOperation.ctr(passKey, new aesjs.Counter(1));\n var decryptedBytes = aesCtr.decrypt(encryptedBytes);\n var decryptedText = aesjs.utils.utf8.fromBytes(decryptedBytes);\n return decryptedText;\n}", "function decryptWithKey(encrypted, key) {\n try {\n const encryptedData = JSON.stringify(Object.assign(JSON.parse(encrypted), { mode: 'gcm' }));\n return sjcl.decrypt(key, encryptedData);\n } catch (err) {\n // console.error('Decryption Error:', err);\n return '';\n }\n}", "decrypt(data) {\n let key = \"2139226343519743\";\n let iv = \"4370627107694550\";\n key = CryptoJS.enc.Utf8.parse(key);\n iv = CryptoJS.enc.Utf8.parse(iv);\n\n let decrypted = CryptoJS.AES.decrypt(\n data, key,\n {\n iv: iv,\n padding: CryptoJS.pad.ZeroPadding\n }\n );\n return decrypted.toString(CryptoJS.enc.Utf8);\n }", "function aesDecrypt(ciphertext, key, iv) {\n\tvar encryptedBytes = aes.utils.hex.toBytes(ciphertext);\n\tvar buffer = Buffer.from(key);\n\tvar aesCTR = new aes.ModeOfOperation.ctr(buffer, iv);\n\tvar decryptedBytes = aesCTR.decrypt(encryptedBytes);\n\tvar decryptedText = aes.utils.utf8.fromBytes(decryptedBytes);\n\treturn decryptedText;\n}", "function decipher(string){\n\n}", "function PgpMimeDecrypt() {\n}", "function decrypt(text){\n var decipher = crypto.createDecipher(algorithm,password)\n var dec = decipher.update(text,'hex','utf8')\n dec += decipher.final('utf8');\n return dec;\n}", "encryptBuffers() {\n //\n }", "static decrypt(data, key) {\n\n const keyAsBytes = aesjs.utils.hex.toBytes(key);\n\n const iv = data['iv'];\n const cipherText = data['cipherText'];\n\n const ivAsBytes = aesjs.utils.hex.toBytes(iv);\n const cipherAsBytes = aesjs.utils.hex.toBytes(cipherText);\n\n const aesOfb = new aesjs.ModeOfOperation.cbc(keyAsBytes, ivAsBytes);\n\n let decryptedBytes = aesOfb.decrypt(cipherAsBytes);\n decryptedBytes = aesjs.padding.pkcs7.strip(decryptedBytes);\n\n return aesjs.utils.utf8.fromBytes(decryptedBytes);\n }", "encrypt(str, settings){}", "function decrypt(raw) {\n // const converted = raw.toString('utf-8') // for debug\n const converted = raw.toString('base64')\n\n const reciverKey = webPushDecipher.reciverKeyBuilder(publicKey,privateKey,authSecret)\n var decrypted = webPushDecipher.decrypt(converted,reciverKey,false)\n return decrypted\n}", "function decrypt(algo, cipherText_b64, iv_b64, passPhrase) {\n console.debug(\"Crypto algo [\" + algo + \"]\");\n if(algo && algo !== \"AES/CTR/NoPadding\") {\n console.warn(\"Only AES/CTR/NoPadding is currently supported. Found algo \" + algo);\n }\n console.debug(\"Deciphering \" + cipherText_b64.length + \" bytes of Base64 with iv_b64=\" + iv_b64 + \", pass=\" + passPhrase);\n // This salt is a Cool-Maze-wide constant.\n // Salt size is 32 bytes == (256 / 8)\n let saltHex = '92d1615c585468f2d6a24cf5c56b53f922ce83f7e45d58a99b82b52fc2eb78e4';\n let saltWords = CryptoJS.enc.Hex.parse(saltHex);\n let iterations = 1000;\n let aesKey = CryptoJS.PBKDF2(\n passPhrase, \n saltWords, \n { keySize: 128/32, iterations: iterations });\n console.debug(\"aesKey.toString(): \" + aesKey.toString());\n\n let cipherWords = CryptoJS.enc.Base64.parse(cipherText_b64);\n console.debug(preview(\"cipherWords=\"+cipherWords, 160) + \"(\" + (\"\"+cipherWords).length + \" chars)\");\n // let ivHex = 'a217f5a0fb926f7009a4c821d76e6788';\n // let ivWords = CryptoJS.enc.Hex.parse(ivHex);\n let ivWords = CryptoJS.enc.Base64.parse(iv_b64);\n console.debug(\"ivWords=\"+ivWords);\n let decryptedWords = CryptoJS.AES.decrypt(\n {\n ciphertext: cipherWords,\n salt: saltWords\n },\n aesKey, \n { \n iv: ivWords, \n padding: CryptoJS.pad.NoPadding,\n mode: CryptoJS.mode.CTR\n });\n //console.debug(decryptedWords);\n //console.debug(\"decryptedWords=\" + decryptedWords);\n //let decrypted = hex2a(decryptedWords.toString());\n // console.debug(\"hex2a(decryptedWords)=\"+hex2a(decryptedWords.toString()));\n //let decrypted = decryptedWords.toString();\n //let decrypted = decryptedWords.toString(CryptoJS.enc.Utf8);\n //let decrypted = decryptedWords.toString(CryptoJS.enc.Latin1);\n //let decrypted = decryptedWords.toString(CryptoJS.enc.Utf16);\n //let decrypted = decryptedWords.toString(CryptoJS.enc.Hex);\n //let decrypted = CryptoJS.enc.Base64.stringify(decryptedWords);\n //console.debug(\"decrypted_ = \" + decrypted);\n return decryptedWords;\n}", "function decryptMessage(msg, pass) {\n\n\tpass = toBinary(pass);\n\n\tvar binPassString = \"\";\n\n\twhile (msg.length > binPassString.length) {\n\n\t\tbinPassString += String(pass);\n\n\t}\n\n\tbinPassString.slice(0, msg.length - 1);\n\n\tvar decipher = xor(msg, binPassString);\n\n\treturn toText(decipher);\n \n}", "decrypt(ciphertext, plaintext) {\n let i;\n let l = 0;\n let r = 0;\n for (i = 0; i < 4; i++) {\n l |= (ciphertext[i] & 0xff) << (24 - i * 8);\n r |= (ciphertext[i + 4] & 0xff) << (24 - i * 8);\n }\n for (i = this.rounds - 1; i > 0; i -= 2) {\n l ^= this.roundFunc(r, this.keySchedule[i]);\n r ^= this.roundFunc(l, this.keySchedule[i - 1]);\n }\n for (i = 0; i < 4; i++) {\n plaintext[3 - i] = Number(r & 0xff);\n plaintext[7 - i] = Number(l & 0xff);\n r >>>= 8;\n l >>>= 8;\n }\n }", "function AesDecryptionWrapper(key, ciphertext)\r\n{\r\n\tvar xorBlock = ciphertext.splice(0, 4);\t\t// get the IV for the first round, encrypted block for the following rounds\r\n\tvar cipher = new AES(key);\r\n\tvar plaintext = new Array();\r\n\r\n\twhile(ciphertext.length > 0) {\r\n\t\tvar cipherBlock = ciphertext.splice(0, 4);\r\n\t\tvar plainBlock = cipher.decrypt_core(cipherBlock);\r\n\t\tplainBlock = XorArrays(plainBlock, xorBlock);\r\n\t\tplaintext = plaintext.concat(plainBlock);\r\n\t\txorBlock = cipherBlock;\r\n\t}\r\n\r\n\treturn plaintext;\r\n}", "function des (key, message, encrypt, mode, iv, padding) {\r\n\t //declaring this locally speeds things up a bit\r\n\t var spfunction1 = new Array (0x1010400,0,0x10000,0x1010404,0x1010004,0x10404,0x4,0x10000,0x400,0x1010400,0x1010404,0x400,0x1000404,0x1010004,0x1000000,0x4,0x404,0x1000400,0x1000400,0x10400,0x10400,0x1010000,0x1010000,0x1000404,0x10004,0x1000004,0x1000004,0x10004,0,0x404,0x10404,0x1000000,0x10000,0x1010404,0x4,0x1010000,0x1010400,0x1000000,0x1000000,0x400,0x1010004,0x10000,0x10400,0x1000004,0x400,0x4,0x1000404,0x10404,0x1010404,0x10004,0x1010000,0x1000404,0x1000004,0x404,0x10404,0x1010400,0x404,0x1000400,0x1000400,0,0x10004,0x10400,0,0x1010004);\r\n\t var spfunction2 = new Array (-0x7fef7fe0,-0x7fff8000,0x8000,0x108020,0x100000,0x20,-0x7fefffe0,-0x7fff7fe0,-0x7fffffe0,-0x7fef7fe0,-0x7fef8000,-0x80000000,-0x7fff8000,0x100000,0x20,-0x7fefffe0,0x108000,0x100020,-0x7fff7fe0,0,-0x80000000,0x8000,0x108020,-0x7ff00000,0x100020,-0x7fffffe0,0,0x108000,0x8020,-0x7fef8000,-0x7ff00000,0x8020,0,0x108020,-0x7fefffe0,0x100000,-0x7fff7fe0,-0x7ff00000,-0x7fef8000,0x8000,-0x7ff00000,-0x7fff8000,0x20,-0x7fef7fe0,0x108020,0x20,0x8000,-0x80000000,0x8020,-0x7fef8000,0x100000,-0x7fffffe0,0x100020,-0x7fff7fe0,-0x7fffffe0,0x100020,0x108000,0,-0x7fff8000,0x8020,-0x80000000,-0x7fefffe0,-0x7fef7fe0,0x108000);\r\n\t var spfunction3 = new Array (0x208,0x8020200,0,0x8020008,0x8000200,0,0x20208,0x8000200,0x20008,0x8000008,0x8000008,0x20000,0x8020208,0x20008,0x8020000,0x208,0x8000000,0x8,0x8020200,0x200,0x20200,0x8020000,0x8020008,0x20208,0x8000208,0x20200,0x20000,0x8000208,0x8,0x8020208,0x200,0x8000000,0x8020200,0x8000000,0x20008,0x208,0x20000,0x8020200,0x8000200,0,0x200,0x20008,0x8020208,0x8000200,0x8000008,0x200,0,0x8020008,0x8000208,0x20000,0x8000000,0x8020208,0x8,0x20208,0x20200,0x8000008,0x8020000,0x8000208,0x208,0x8020000,0x20208,0x8,0x8020008,0x20200);\r\n\t var spfunction4 = new Array (0x802001,0x2081,0x2081,0x80,0x802080,0x800081,0x800001,0x2001,0,0x802000,0x802000,0x802081,0x81,0,0x800080,0x800001,0x1,0x2000,0x800000,0x802001,0x80,0x800000,0x2001,0x2080,0x800081,0x1,0x2080,0x800080,0x2000,0x802080,0x802081,0x81,0x800080,0x800001,0x802000,0x802081,0x81,0,0,0x802000,0x2080,0x800080,0x800081,0x1,0x802001,0x2081,0x2081,0x80,0x802081,0x81,0x1,0x2000,0x800001,0x2001,0x802080,0x800081,0x2001,0x2080,0x800000,0x802001,0x80,0x800000,0x2000,0x802080);\r\n\t var spfunction5 = new Array (0x100,0x2080100,0x2080000,0x42000100,0x80000,0x100,0x40000000,0x2080000,0x40080100,0x80000,0x2000100,0x40080100,0x42000100,0x42080000,0x80100,0x40000000,0x2000000,0x40080000,0x40080000,0,0x40000100,0x42080100,0x42080100,0x2000100,0x42080000,0x40000100,0,0x42000000,0x2080100,0x2000000,0x42000000,0x80100,0x80000,0x42000100,0x100,0x2000000,0x40000000,0x2080000,0x42000100,0x40080100,0x2000100,0x40000000,0x42080000,0x2080100,0x40080100,0x100,0x2000000,0x42080000,0x42080100,0x80100,0x42000000,0x42080100,0x2080000,0,0x40080000,0x42000000,0x80100,0x2000100,0x40000100,0x80000,0,0x40080000,0x2080100,0x40000100);\r\n\t var spfunction6 = new Array (0x20000010,0x20400000,0x4000,0x20404010,0x20400000,0x10,0x20404010,0x400000,0x20004000,0x404010,0x400000,0x20000010,0x400010,0x20004000,0x20000000,0x4010,0,0x400010,0x20004010,0x4000,0x404000,0x20004010,0x10,0x20400010,0x20400010,0,0x404010,0x20404000,0x4010,0x404000,0x20404000,0x20000000,0x20004000,0x10,0x20400010,0x404000,0x20404010,0x400000,0x4010,0x20000010,0x400000,0x20004000,0x20000000,0x4010,0x20000010,0x20404010,0x404000,0x20400000,0x404010,0x20404000,0,0x20400010,0x10,0x4000,0x20400000,0x404010,0x4000,0x400010,0x20004010,0,0x20404000,0x20000000,0x400010,0x20004010);\r\n\t var spfunction7 = new Array (0x200000,0x4200002,0x4000802,0,0x800,0x4000802,0x200802,0x4200800,0x4200802,0x200000,0,0x4000002,0x2,0x4000000,0x4200002,0x802,0x4000800,0x200802,0x200002,0x4000800,0x4000002,0x4200000,0x4200800,0x200002,0x4200000,0x800,0x802,0x4200802,0x200800,0x2,0x4000000,0x200800,0x4000000,0x200800,0x200000,0x4000802,0x4000802,0x4200002,0x4200002,0x2,0x200002,0x4000000,0x4000800,0x200000,0x4200800,0x802,0x200802,0x4200800,0x802,0x4000002,0x4200802,0x4200000,0x200800,0,0x2,0x4200802,0,0x200802,0x4200000,0x800,0x4000002,0x4000800,0x800,0x200002);\r\n\t var spfunction8 = new Array (0x10001040,0x1000,0x40000,0x10041040,0x10000000,0x10001040,0x40,0x10000000,0x40040,0x10040000,0x10041040,0x41000,0x10041000,0x41040,0x1000,0x40,0x10040000,0x10000040,0x10001000,0x1040,0x41000,0x40040,0x10040040,0x10041000,0x1040,0,0,0x10040040,0x10000040,0x10001000,0x41040,0x40000,0x41040,0x40000,0x10041000,0x1000,0x40,0x10040040,0x1000,0x41040,0x10001000,0x40,0x10000040,0x10040000,0x10040040,0x10000000,0x40000,0x10001040,0,0x10041040,0x40040,0x10000040,0x10040000,0x10001000,0x10001040,0,0x10041040,0x41000,0x41000,0x1040,0x1040,0x40040,0x10000000,0x10041000);\r\n\r\n\t //create the 16 or 48 subkeys we will need\r\n\t var keys = des_createKeys (key);\r\n\t var m=0, i, j, temp, right1, right2, left, right, looping;\r\n\t var cbcleft, cbcleft2, cbcright, cbcright2;\r\n\t var endloop, loopinc;\r\n\t var len = message.length;\r\n\t var chunk = 0;\r\n\t //set up the loops for single and triple des\r\n\t var iterations = keys.length == 32 ? 3 : 9; //single or triple des\r\n\t if (iterations == 3) {looping = encrypt ? new Array (0, 32, 2) : new Array (30, -2, -2);}\r\n\t else {looping = encrypt ? new Array (0, 32, 2, 62, 30, -2, 64, 96, 2) : new Array (94, 62, -2, 32, 64, 2, 30, -2, -2);}\r\n\r\n\t //pad the message depending on the padding parameter\r\n\t if (padding == 2) message += \" \"; //pad the message with spaces\r\n\t else if (padding == 1) {temp = 8-(len%8); message += String.fromCharCode (temp,temp,temp,temp,temp,temp,temp,temp); if (temp==8) len+=8;} //PKCS7 padding\r\n\t else if (!padding) message += \"\\0\\0\\0\\0\\0\\0\\0\\0\"; //pad the message out with null bytes\r\n\r\n\t //store the result here\r\n\t result = \"\";\r\n\t tempresult = \"\";\r\n\r\n\t if (mode == 1) { //CBC mode\r\n\t cbcleft = (iv.charCodeAt(m++) << 24) | (iv.charCodeAt(m++) << 16) | (iv.charCodeAt(m++) << 8) | iv.charCodeAt(m++);\r\n\t cbcright = (iv.charCodeAt(m++) << 24) | (iv.charCodeAt(m++) << 16) | (iv.charCodeAt(m++) << 8) | iv.charCodeAt(m++);\r\n\t m=0;\r\n\t }\r\n\r\n\t //loop through each 64 bit chunk of the message\r\n\t while (m < len) {\r\n\t left = (message.charCodeAt(m++) << 24) | (message.charCodeAt(m++) << 16) | (message.charCodeAt(m++) << 8) | message.charCodeAt(m++);\r\n\t right = (message.charCodeAt(m++) << 24) | (message.charCodeAt(m++) << 16) | (message.charCodeAt(m++) << 8) | message.charCodeAt(m++);\r\n\r\n\t //for Cipher Block Chaining mode, xor the message with the previous result\r\n\t if (mode == 1) {if (encrypt) {left ^= cbcleft; right ^= cbcright;} else {cbcleft2 = cbcleft; cbcright2 = cbcright; cbcleft = left; cbcright = right;}}\r\n\r\n\t //first each 64 but chunk of the message must be permuted according to IP\r\n\t temp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= temp; left ^= (temp << 4);\r\n\t temp = ((left >>> 16) ^ right) & 0x0000ffff; right ^= temp; left ^= (temp << 16);\r\n\t temp = ((right >>> 2) ^ left) & 0x33333333; left ^= temp; right ^= (temp << 2);\r\n\t temp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= temp; right ^= (temp << 8);\r\n\t temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);\r\n\r\n\t left = ((left << 1) | (left >>> 31)); \r\n\t right = ((right << 1) | (right >>> 31)); \r\n\r\n\t //do this either 1 or 3 times for each chunk of the message\r\n\t for (j=0; j<iterations; j+=3) {\r\n\t endloop = looping[j+1];\r\n\t loopinc = looping[j+2];\r\n\t //now go through and perform the encryption or decryption \r\n\t for (i=looping[j]; i!=endloop; i+=loopinc) { //for efficiency\r\n\t right1 = right ^ keys[i]; \r\n\t right2 = ((right >>> 4) | (right << 28)) ^ keys[i+1];\r\n\t //the result is attained by passing these bytes through the S selection functions\r\n\t temp = left;\r\n\t left = right;\r\n\t right = temp ^ (spfunction2[(right1 >>> 24) & 0x3f] | spfunction4[(right1 >>> 16) & 0x3f]\r\n\t | spfunction6[(right1 >>> 8) & 0x3f] | spfunction8[right1 & 0x3f]\r\n\t | spfunction1[(right2 >>> 24) & 0x3f] | spfunction3[(right2 >>> 16) & 0x3f]\r\n\t | spfunction5[(right2 >>> 8) & 0x3f] | spfunction7[right2 & 0x3f]);\r\n\t }\r\n\t temp = left; left = right; right = temp; //unreverse left and right\r\n\t } //for either 1 or 3 iterations\r\n\r\n\t //move then each one bit to the right\r\n\t left = ((left >>> 1) | (left << 31)); \r\n\t right = ((right >>> 1) | (right << 31)); \r\n\r\n\t //now perform IP-1, which is IP in the opposite direction\r\n\t temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);\r\n\t temp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= temp; right ^= (temp << 8);\r\n\t temp = ((right >>> 2) ^ left) & 0x33333333; left ^= temp; right ^= (temp << 2);\r\n\t temp = ((left >>> 16) ^ right) & 0x0000ffff; right ^= temp; left ^= (temp << 16);\r\n\t temp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= temp; left ^= (temp << 4);\r\n\r\n\t //for Cipher Block Chaining mode, xor the message with the previous result\r\n\t if (mode == 1) {if (encrypt) {cbcleft = left; cbcright = right;} else {left ^= cbcleft2; right ^= cbcright2;}}\r\n\t tempresult += String.fromCharCode ((left>>>24), ((left>>>16) & 0xff), ((left>>>8) & 0xff), (left & 0xff), (right>>>24), ((right>>>16) & 0xff), ((right>>>8) & 0xff), (right & 0xff));\r\n\r\n\t chunk += 8;\r\n\t if (chunk == 512) {result += tempresult; tempresult = \"\"; chunk = 0;}\r\n\t } //for every 8 characters, or 64 bits in the message\r\n\r\n\t //return the result as an array\r\n\t return result + tempresult;\r\n\t} //end of des", "function decrypt(encrypted) { //Function for decryption of passwords. Uses the aes128 standard with the crypto package\n decryptalgo = crypto.createDecipher('aes128', secret);\n let decrypted = decryptalgo.update(encrypted, 'hex', 'utf8');\n decrypted += decryptalgo.final('utf8');\n return decrypted;\n}", "function decrypt()\n{\n\ttry\n\t{\n\t\tvar algo=\"aes\";\n\t\t\n\t\tif(kony.os.deviceInfo().name == \"blackberry\")\n\t\t\tvar encryptDecryptKey = kony.crypto.newKey(\"passphrase\", 128, {passphrasetext: [\"inputstring1inputstring1\"], subalgo: \"aes\", passphrasehashalgo: \"md5\"});\n\t\telse\n\t\t\tvar encryptDecryptKey = kony.crypto.newKey(\"passphrase\", 128, {passphrasetext: [\"inputstring1\"], subalgo: \"aes\", passphrasehashalgo: \"md5\"});\n\n\t\tvar prptobj= {padding:\"pkcs5\",mode:\"cbc\",initializationvector:\"1234567890123456\"};\n\t\t\n\t\tif(frmCrypto.lblEncrypt.text == \"\" ||frmCrypto.lblEncrypt.text == null || frmCrypto.lblEncrypt.text == \"Please enter the text to encrypt\")\n\t\t{\n\t\t\tfrmCrypto.lblDecrypt.text = \"There is no encrypted text\";\n\t\t\treturn;\n\t\t}\n\t\tvar str = frmCrypto.lblEncrypt.text;\n\t\t//convertToRawBytes is not supported in SPA\n\t\tif(kony.os.deviceInfo().name == \"thinclient\")\n\t\t{\n\t\t\tvar myEncryptedTextRa = myEncryptedTextRaw;\n\t\t}\n\t\telse\n\t\t\tvar myEncryptedTextRa = kony.convertToRawBytes(str.substring(17));\n\t\tvar myClearText = kony.crypto.decrypt(algo,encryptDecryptKey,myEncryptedTextRa,prptobj);\n\t\tif(kony.os.deviceInfo().name == \"WindowsPhone\")\n\t\t\tfrmCrypto.lblDecrypt.text =\"Decrypted text = \"+myClearText;\n\t\telse\n\t\t\tfrmCrypto.lblDecrypt.text =\"Decrypted text = \"+myClearText.toString();\n\t\t\t\t\t\n\t}\n\tcatch(err)\n\t{\n\t\talert(typeof err);\n\t\talert(\"Error in callbackDecryptAes : \"+err );\n\t}\n}", "function des (key, message, encrypt, mode, iv, padding, keys) {\n //declaring this locally speeds things up a bit\n var spfunction1 = new Array (0x1010400,0,0x10000,0x1010404,0x1010004,0x10404,0x4,0x10000,0x400,0x1010400,0x1010404,0x400,0x1000404,0x1010004,0x1000000,0x4,0x404,0x1000400,0x1000400,0x10400,0x10400,0x1010000,0x1010000,0x1000404,0x10004,0x1000004,0x1000004,0x10004,0,0x404,0x10404,0x1000000,0x10000,0x1010404,0x4,0x1010000,0x1010400,0x1000000,0x1000000,0x400,0x1010004,0x10000,0x10400,0x1000004,0x400,0x4,0x1000404,0x10404,0x1010404,0x10004,0x1010000,0x1000404,0x1000004,0x404,0x10404,0x1010400,0x404,0x1000400,0x1000400,0,0x10004,0x10400,0,0x1010004);\n var spfunction2 = new Array (-0x7fef7fe0,-0x7fff8000,0x8000,0x108020,0x100000,0x20,-0x7fefffe0,-0x7fff7fe0,-0x7fffffe0,-0x7fef7fe0,-0x7fef8000,-0x80000000,-0x7fff8000,0x100000,0x20,-0x7fefffe0,0x108000,0x100020,-0x7fff7fe0,0,-0x80000000,0x8000,0x108020,-0x7ff00000,0x100020,-0x7fffffe0,0,0x108000,0x8020,-0x7fef8000,-0x7ff00000,0x8020,0,0x108020,-0x7fefffe0,0x100000,-0x7fff7fe0,-0x7ff00000,-0x7fef8000,0x8000,-0x7ff00000,-0x7fff8000,0x20,-0x7fef7fe0,0x108020,0x20,0x8000,-0x80000000,0x8020,-0x7fef8000,0x100000,-0x7fffffe0,0x100020,-0x7fff7fe0,-0x7fffffe0,0x100020,0x108000,0,-0x7fff8000,0x8020,-0x80000000,-0x7fefffe0,-0x7fef7fe0,0x108000);\n var spfunction3 = new Array (0x208,0x8020200,0,0x8020008,0x8000200,0,0x20208,0x8000200,0x20008,0x8000008,0x8000008,0x20000,0x8020208,0x20008,0x8020000,0x208,0x8000000,0x8,0x8020200,0x200,0x20200,0x8020000,0x8020008,0x20208,0x8000208,0x20200,0x20000,0x8000208,0x8,0x8020208,0x200,0x8000000,0x8020200,0x8000000,0x20008,0x208,0x20000,0x8020200,0x8000200,0,0x200,0x20008,0x8020208,0x8000200,0x8000008,0x200,0,0x8020008,0x8000208,0x20000,0x8000000,0x8020208,0x8,0x20208,0x20200,0x8000008,0x8020000,0x8000208,0x208,0x8020000,0x20208,0x8,0x8020008,0x20200);\n var spfunction4 = new Array (0x802001,0x2081,0x2081,0x80,0x802080,0x800081,0x800001,0x2001,0,0x802000,0x802000,0x802081,0x81,0,0x800080,0x800001,0x1,0x2000,0x800000,0x802001,0x80,0x800000,0x2001,0x2080,0x800081,0x1,0x2080,0x800080,0x2000,0x802080,0x802081,0x81,0x800080,0x800001,0x802000,0x802081,0x81,0,0,0x802000,0x2080,0x800080,0x800081,0x1,0x802001,0x2081,0x2081,0x80,0x802081,0x81,0x1,0x2000,0x800001,0x2001,0x802080,0x800081,0x2001,0x2080,0x800000,0x802001,0x80,0x800000,0x2000,0x802080);\n var spfunction5 = new Array (0x100,0x2080100,0x2080000,0x42000100,0x80000,0x100,0x40000000,0x2080000,0x40080100,0x80000,0x2000100,0x40080100,0x42000100,0x42080000,0x80100,0x40000000,0x2000000,0x40080000,0x40080000,0,0x40000100,0x42080100,0x42080100,0x2000100,0x42080000,0x40000100,0,0x42000000,0x2080100,0x2000000,0x42000000,0x80100,0x80000,0x42000100,0x100,0x2000000,0x40000000,0x2080000,0x42000100,0x40080100,0x2000100,0x40000000,0x42080000,0x2080100,0x40080100,0x100,0x2000000,0x42080000,0x42080100,0x80100,0x42000000,0x42080100,0x2080000,0,0x40080000,0x42000000,0x80100,0x2000100,0x40000100,0x80000,0,0x40080000,0x2080100,0x40000100);\n var spfunction6 = new Array (0x20000010,0x20400000,0x4000,0x20404010,0x20400000,0x10,0x20404010,0x400000,0x20004000,0x404010,0x400000,0x20000010,0x400010,0x20004000,0x20000000,0x4010,0,0x400010,0x20004010,0x4000,0x404000,0x20004010,0x10,0x20400010,0x20400010,0,0x404010,0x20404000,0x4010,0x404000,0x20404000,0x20000000,0x20004000,0x10,0x20400010,0x404000,0x20404010,0x400000,0x4010,0x20000010,0x400000,0x20004000,0x20000000,0x4010,0x20000010,0x20404010,0x404000,0x20400000,0x404010,0x20404000,0,0x20400010,0x10,0x4000,0x20400000,0x404010,0x4000,0x400010,0x20004010,0,0x20404000,0x20000000,0x400010,0x20004010);\n var spfunction7 = new Array (0x200000,0x4200002,0x4000802,0,0x800,0x4000802,0x200802,0x4200800,0x4200802,0x200000,0,0x4000002,0x2,0x4000000,0x4200002,0x802,0x4000800,0x200802,0x200002,0x4000800,0x4000002,0x4200000,0x4200800,0x200002,0x4200000,0x800,0x802,0x4200802,0x200800,0x2,0x4000000,0x200800,0x4000000,0x200800,0x200000,0x4000802,0x4000802,0x4200002,0x4200002,0x2,0x200002,0x4000000,0x4000800,0x200000,0x4200800,0x802,0x200802,0x4200800,0x802,0x4000002,0x4200802,0x4200000,0x200800,0,0x2,0x4200802,0,0x200802,0x4200000,0x800,0x4000002,0x4000800,0x800,0x200002);\n var spfunction8 = new Array (0x10001040,0x1000,0x40000,0x10041040,0x10000000,0x10001040,0x40,0x10000000,0x40040,0x10040000,0x10041040,0x41000,0x10041000,0x41040,0x1000,0x40,0x10040000,0x10000040,0x10001000,0x1040,0x41000,0x40040,0x10040040,0x10041000,0x1040,0,0,0x10040040,0x10000040,0x10001000,0x41040,0x40000,0x41040,0x40000,0x10041000,0x1000,0x40,0x10040040,0x1000,0x41040,0x10001000,0x40,0x10000040,0x10040000,0x10040040,0x10000000,0x40000,0x10001040,0,0x10041040,0x40040,0x10000040,0x10040000,0x10001000,0x10001040,0,0x10041040,0x41000,0x41000,0x1040,0x1040,0x40040,0x10000000,0x10041000);\n\n //create the 16 or 48 subkeys we will need\n var keys = keys || des_createKeys (key);\n var m=0, i, j, temp, temp2, right1, right2, left, right, looping;\n var cbcleft, cbcleft2, cbcright, cbcright2\n var endloop, loopinc;\n var len = message.length;\n var chunk = 0;\n //set up the loops for single and triple des\n var iterations = keys.length == 32 ? 3 : 9; //single or triple des\n if (iterations == 3) {looping = encrypt ? new Array (0, 32, 2) : new Array (30, -2, -2);}\n else {looping = encrypt ? new Array (0, 32, 2, 62, 30, -2, 64, 96, 2) : new Array (94, 62, -2, 32, 64, 2, 30, -2, -2);}\n\n //pad the message depending on the padding parameter\n if (padding == 2) message += \" \"; //pad the message with spaces\n else if (padding == 1) {temp = 8-(len%8); message += String.fromCharCode (temp,temp,temp,temp,temp,temp,temp,temp); if (temp==8) len+=8;} //PKCS7 padding\n else if (!padding) message += \"\\0\\0\\0\\0\\0\\0\\0\\0\"; //pad the message out with null bytes\n\n //store the result here\n var result = \"\";\n var tempresult = \"\";\n\n if (mode == 1) { //CBC mode\n cbcleft = (iv.charCodeAt(m++) << 24) | (iv.charCodeAt(m++) << 16) | (iv.charCodeAt(m++) << 8) | iv.charCodeAt(m++);\n cbcright = (iv.charCodeAt(m++) << 24) | (iv.charCodeAt(m++) << 16) | (iv.charCodeAt(m++) << 8) | iv.charCodeAt(m++);\n m=0;\n }\n\n //loop through each 64 bit chunk of the message\n while (m < len) {\n left = (message.charCodeAt(m++) << 24) | (message.charCodeAt(m++) << 16) | (message.charCodeAt(m++) << 8) | message.charCodeAt(m++);\n right = (message.charCodeAt(m++) << 24) | (message.charCodeAt(m++) << 16) | (message.charCodeAt(m++) << 8) | message.charCodeAt(m++);\n\n //for Cipher Block Chaining mode, xor the message with the previous result\n if (mode == 1) {if (encrypt) {left ^= cbcleft; right ^= cbcright;} else {cbcleft2 = cbcleft; cbcright2 = cbcright; cbcleft = left; cbcright = right;}}\n\n //first each 64 but chunk of the message must be permuted according to IP\n temp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= temp; left ^= (temp << 4);\n temp = ((left >>> 16) ^ right) & 0x0000ffff; right ^= temp; left ^= (temp << 16);\n temp = ((right >>> 2) ^ left) & 0x33333333; left ^= temp; right ^= (temp << 2);\n temp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= temp; right ^= (temp << 8);\n temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);\n\n left = ((left << 1) | (left >>> 31));\n right = ((right << 1) | (right >>> 31));\n\n //do this either 1 or 3 times for each chunk of the message\n for (j=0; j<iterations; j+=3) {\n endloop = looping[j+1];\n loopinc = looping[j+2];\n //now go through and perform the encryption or decryption\n for (i=looping[j]; i!=endloop; i+=loopinc) { //for efficiency\n right1 = right ^ keys[i];\n right2 = ((right >>> 4) | (right << 28)) ^ keys[i+1];\n //the result is attained by passing these bytes through the S selection functions\n temp = left;\n left = right;\n right = temp ^ (spfunction2[(right1 >>> 24) & 0x3f] | spfunction4[(right1 >>> 16) & 0x3f]\n | spfunction6[(right1 >>> 8) & 0x3f] | spfunction8[right1 & 0x3f]\n | spfunction1[(right2 >>> 24) & 0x3f] | spfunction3[(right2 >>> 16) & 0x3f]\n | spfunction5[(right2 >>> 8) & 0x3f] | spfunction7[right2 & 0x3f]);\n }\n temp = left; left = right; right = temp; //unreverse left and right\n } //for either 1 or 3 iterations\n\n //move then each one bit to the right\n left = ((left >>> 1) | (left << 31));\n right = ((right >>> 1) | (right << 31));\n\n //now perform IP-1, which is IP in the opposite direction\n temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);\n temp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= temp; right ^= (temp << 8);\n temp = ((right >>> 2) ^ left) & 0x33333333; left ^= temp; right ^= (temp << 2);\n temp = ((left >>> 16) ^ right) & 0x0000ffff; right ^= temp; left ^= (temp << 16);\n temp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= temp; left ^= (temp << 4);\n\n //for Cipher Block Chaining mode, xor the message with the previous result\n if (mode == 1) {if (encrypt) {cbcleft = left; cbcright = right;} else {left ^= cbcleft2; right ^= cbcright2;}}\n tempresult += String.fromCharCode ((left>>>24), ((left>>>16) & 0xff), ((left>>>8) & 0xff), (left & 0xff), (right>>>24), ((right>>>16) & 0xff), ((right>>>8) & 0xff), (right & 0xff));\n\n chunk += 8;\n if (chunk == 512) {result += tempresult; tempresult = \"\"; chunk = 0;}\n } //for every 8 characters, or 64 bits in the message\n\n //return the result as an array\n return result + tempresult;\n} //end of des", "function wrap(key, data) {\n var aes = new _cipher2.default[\"aes\" + key.length * 8](key);\n var IV = new Uint32Array([0xA6A6A6A6, 0xA6A6A6A6]);\n var P = unpack(data);\n var A = IV;\n var R = P;\n var n = P.length / 2;\n var t = new Uint32Array([0, 0]);\n var B = new Uint32Array(4);\n for (var j = 0; j <= 5; ++j) {\n for (var i = 0; i < n; ++i) {\n t[1] = n * j + (1 + i);\n // B = A\n B[0] = A[0];\n B[1] = A[1];\n // B = A || R[i]\n B[2] = R[2 * i];\n B[3] = R[2 * i + 1];\n // B = AES(K, B)\n B = unpack(aes.encrypt(pack(B)));\n // A = MSB(64, B) ^ t\n A = B.subarray(0, 2);\n A[0] ^= t[0];\n A[1] ^= t[1];\n // R[i] = LSB(64, B)\n R[2 * i] = B[2];\n R[2 * i + 1] = B[3];\n }\n }\n return pack(A, R);\n}", "function wrap(key, data) {\n const aes = new _cipher2.default[\"aes\" + key.length * 8](key);\n const IV = new Uint32Array([0xA6A6A6A6, 0xA6A6A6A6]);\n const P = unpack(data);\n let A = IV;\n const R = P;\n const n = P.length / 2;\n const t = new Uint32Array([0, 0]);\n let B = new Uint32Array(4);\n for (let j = 0; j <= 5; ++j) {\n for (let i = 0; i < n; ++i) {\n t[1] = n * j + (1 + i);\n // B = A\n B[0] = A[0];\n B[1] = A[1];\n // B = A || R[i]\n B[2] = R[2 * i];\n B[3] = R[2 * i + 1];\n // B = AES(K, B)\n B = unpack(aes.encrypt(pack(B)));\n // A = MSB(64, B) ^ t\n A = B.subarray(0, 2);\n A[0] ^= t[0];\n A[1] ^= t[1];\n // R[i] = LSB(64, B)\n R[2 * i] = B[2];\n R[2 * i + 1] = B[3];\n }\n }\n return pack(A, R);\n}", "function decryptWithYourPrivate() {\n decryptMyPrivate();\n}", "function createDecipher() {\n return crypto.createDecipheriv(algoritsymm, Buffer.from(password), initVector);\n }", "function des (key, message, encrypt, mode, iv) {\r\n //declaring this locally speeds things up a bit\r\n var spfunction1 = new Array (0x1010400,0,0x10000,0x1010404,0x1010004,0x10404,0x4,0x10000,0x400,0x1010400,0x1010404,0x400,0x1000404,0x1010004,0x1000000,0x4,0x404,0x1000400,0x1000400,0x10400,0x10400,0x1010000,0x1010000,0x1000404,0x10004,0x1000004,0x1000004,0x10004,0,0x404,0x10404,0x1000000,0x10000,0x1010404,0x4,0x1010000,0x1010400,0x1000000,0x1000000,0x400,0x1010004,0x10000,0x10400,0x1000004,0x400,0x4,0x1000404,0x10404,0x1010404,0x10004,0x1010000,0x1000404,0x1000004,0x404,0x10404,0x1010400,0x404,0x1000400,0x1000400,0,0x10004,0x10400,0,0x1010004);\r\n var spfunction2 = new Array (-0x7fef7fe0,-0x7fff8000,0x8000,0x108020,0x100000,0x20,-0x7fefffe0,-0x7fff7fe0,-0x7fffffe0,-0x7fef7fe0,-0x7fef8000,-0x80000000,-0x7fff8000,0x100000,0x20,-0x7fefffe0,0x108000,0x100020,-0x7fff7fe0,0,-0x80000000,0x8000,0x108020,-0x7ff00000,0x100020,-0x7fffffe0,0,0x108000,0x8020,-0x7fef8000,-0x7ff00000,0x8020,0,0x108020,-0x7fefffe0,0x100000,-0x7fff7fe0,-0x7ff00000,-0x7fef8000,0x8000,-0x7ff00000,-0x7fff8000,0x20,-0x7fef7fe0,0x108020,0x20,0x8000,-0x80000000,0x8020,-0x7fef8000,0x100000,-0x7fffffe0,0x100020,-0x7fff7fe0,-0x7fffffe0,0x100020,0x108000,0,-0x7fff8000,0x8020,-0x80000000,-0x7fefffe0,-0x7fef7fe0,0x108000);\r\n var spfunction3 = new Array (0x208,0x8020200,0,0x8020008,0x8000200,0,0x20208,0x8000200,0x20008,0x8000008,0x8000008,0x20000,0x8020208,0x20008,0x8020000,0x208,0x8000000,0x8,0x8020200,0x200,0x20200,0x8020000,0x8020008,0x20208,0x8000208,0x20200,0x20000,0x8000208,0x8,0x8020208,0x200,0x8000000,0x8020200,0x8000000,0x20008,0x208,0x20000,0x8020200,0x8000200,0,0x200,0x20008,0x8020208,0x8000200,0x8000008,0x200,0,0x8020008,0x8000208,0x20000,0x8000000,0x8020208,0x8,0x20208,0x20200,0x8000008,0x8020000,0x8000208,0x208,0x8020000,0x20208,0x8,0x8020008,0x20200);\r\n var spfunction4 = new Array (0x802001,0x2081,0x2081,0x80,0x802080,0x800081,0x800001,0x2001,0,0x802000,0x802000,0x802081,0x81,0,0x800080,0x800001,0x1,0x2000,0x800000,0x802001,0x80,0x800000,0x2001,0x2080,0x800081,0x1,0x2080,0x800080,0x2000,0x802080,0x802081,0x81,0x800080,0x800001,0x802000,0x802081,0x81,0,0,0x802000,0x2080,0x800080,0x800081,0x1,0x802001,0x2081,0x2081,0x80,0x802081,0x81,0x1,0x2000,0x800001,0x2001,0x802080,0x800081,0x2001,0x2080,0x800000,0x802001,0x80,0x800000,0x2000,0x802080);\r\n var spfunction5 = new Array (0x100,0x2080100,0x2080000,0x42000100,0x80000,0x100,0x40000000,0x2080000,0x40080100,0x80000,0x2000100,0x40080100,0x42000100,0x42080000,0x80100,0x40000000,0x2000000,0x40080000,0x40080000,0,0x40000100,0x42080100,0x42080100,0x2000100,0x42080000,0x40000100,0,0x42000000,0x2080100,0x2000000,0x42000000,0x80100,0x80000,0x42000100,0x100,0x2000000,0x40000000,0x2080000,0x42000100,0x40080100,0x2000100,0x40000000,0x42080000,0x2080100,0x40080100,0x100,0x2000000,0x42080000,0x42080100,0x80100,0x42000000,0x42080100,0x2080000,0,0x40080000,0x42000000,0x80100,0x2000100,0x40000100,0x80000,0,0x40080000,0x2080100,0x40000100);\r\n var spfunction6 = new Array (0x20000010,0x20400000,0x4000,0x20404010,0x20400000,0x10,0x20404010,0x400000,0x20004000,0x404010,0x400000,0x20000010,0x400010,0x20004000,0x20000000,0x4010,0,0x400010,0x20004010,0x4000,0x404000,0x20004010,0x10,0x20400010,0x20400010,0,0x404010,0x20404000,0x4010,0x404000,0x20404000,0x20000000,0x20004000,0x10,0x20400010,0x404000,0x20404010,0x400000,0x4010,0x20000010,0x400000,0x20004000,0x20000000,0x4010,0x20000010,0x20404010,0x404000,0x20400000,0x404010,0x20404000,0,0x20400010,0x10,0x4000,0x20400000,0x404010,0x4000,0x400010,0x20004010,0,0x20404000,0x20000000,0x400010,0x20004010);\r\n var spfunction7 = new Array (0x200000,0x4200002,0x4000802,0,0x800,0x4000802,0x200802,0x4200800,0x4200802,0x200000,0,0x4000002,0x2,0x4000000,0x4200002,0x802,0x4000800,0x200802,0x200002,0x4000800,0x4000002,0x4200000,0x4200800,0x200002,0x4200000,0x800,0x802,0x4200802,0x200800,0x2,0x4000000,0x200800,0x4000000,0x200800,0x200000,0x4000802,0x4000802,0x4200002,0x4200002,0x2,0x200002,0x4000000,0x4000800,0x200000,0x4200800,0x802,0x200802,0x4200800,0x802,0x4000002,0x4200802,0x4200000,0x200800,0,0x2,0x4200802,0,0x200802,0x4200000,0x800,0x4000002,0x4000800,0x800,0x200002);\r\n var spfunction8 = new Array (0x10001040,0x1000,0x40000,0x10041040,0x10000000,0x10001040,0x40,0x10000000,0x40040,0x10040000,0x10041040,0x41000,0x10041000,0x41040,0x1000,0x40,0x10040000,0x10000040,0x10001000,0x1040,0x41000,0x40040,0x10040040,0x10041000,0x1040,0,0,0x10040040,0x10000040,0x10001000,0x41040,0x40000,0x41040,0x40000,0x10041000,0x1000,0x40,0x10040040,0x1000,0x41040,0x10001000,0x40,0x10000040,0x10040000,0x10040040,0x10000000,0x40000,0x10001040,0,0x10041040,0x40040,0x10000040,0x10040000,0x10001000,0x10001040,0,0x10041040,0x41000,0x41000,0x1040,0x1040,0x40040,0x10000000,0x10041000);\r\n\r\n //create the 16 or 48 subkeys we will need\r\n var keys = des_createkeys (key);\r\n var m=0, i, j, temp, temp2, right1, right2, left, right, looping;\r\n var cbcleft, cbcleft2, cbcright, cbcright2\r\n var endloop, loopinc;\r\n var len = message.length;\r\n var chunk = 0;\r\n //set up the loops for single and triple des\r\n var iterations = keys.length == 32 ? 3 : 9; //single or triple des\r\n if (iterations == 3) {looping = encrypt ? new Array (0, 32, 2) : new Array (30, -2, -2);}\r\n else {looping = encrypt ? new Array (0, 32, 2, 62, 30, -2, 64, 96, 2) : new Array (94, 62, -2, 32, 64, 2, 30, -2, -2);}\r\n\r\n message += \"\\0\\0\\0\\0\\0\\0\\0\\0\"; //pad the message out with null bytes\r\n //store the result here\r\n result = \"\";\r\n tempresult = \"\";\r\n\r\n if (mode == 1) { //cbc mode\r\n cbcleft = (iv.charCodeAt(m++) << 24) | (iv.charCodeAt(m++) << 16) | (iv.charCodeAt(m++) << 8) | iv.charCodeAt(m++);\r\n cbcright = (iv.charCodeAt(m++) << 24) | (iv.charCodeAt(m++) << 16) | (iv.charCodeAt(m++) << 8) | iv.charCodeAt(m++);\r\n m=0;\r\n }\r\n\r\n //loop through each 64 bit chunk of the message\r\n while (m < len) {\r\n left = (message.charCodeAt(m++) << 24) | (message.charCodeAt(m++) << 16) | (message.charCodeAt(m++) << 8) | message.charCodeAt(m++);\r\n right = (message.charCodeAt(m++) << 24) | (message.charCodeAt(m++) << 16) | (message.charCodeAt(m++) << 8) | message.charCodeAt(m++);\r\n\r\n //for cipher block chaining mode, xor the message with the previous result\r\n if (mode == 1) {if (encrypt) {left ^= cbcleft; right ^= cbcright;} else {cbcleft2 = cbcleft; cbcright2 = cbcright; cbcleft = left; cbcright = right;}}\r\n\r\n //first each 64 but chunk of the message must be permuted according to ip\r\n temp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= temp; left ^= (temp << 4);\r\n temp = ((left >>> 16) ^ right) & 0x0000ffff; right ^= temp; left ^= (temp << 16);\r\n temp = ((right >>> 2) ^ left) & 0x33333333; left ^= temp; right ^= (temp << 2);\r\n temp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= temp; right ^= (temp << 8);\r\n temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);\r\n\r\n left = ((left << 1) | (left >>> 31));\r\n right = ((right << 1) | (right >>> 31));\r\n\r\n //do this either 1 or 3 times for each chunk of the message\r\n for (j=0; j<iterations; j+=3) {\r\n endloop = looping[j+1];\r\n loopinc = looping[j+2];\r\n //now go through and perform the encryption or decryption\r\n for (i=looping[j]; i!=endloop; i+=loopinc) { //for efficiency\r\n right1 = right ^ keys[i];\r\n right2 = ((right >>> 4) | (right << 28)) ^ keys[i+1];\r\n //the result is attained by passing these bytes through the s selection functions\r\n temp = left;\r\n left = right;\r\n right = temp ^ (spfunction2[(right1 >>> 24) & 0x3f] | spfunction4[(right1 >>> 16) & 0x3f]\r\n | spfunction6[(right1 >>> 8) & 0x3f] | spfunction8[right1 & 0x3f]\r\n | spfunction1[(right2 >>> 24) & 0x3f] | spfunction3[(right2 >>> 16) & 0x3f]\r\n | spfunction5[(right2 >>> 8) & 0x3f] | spfunction7[right2 & 0x3f]);\r\n }\r\n temp = left; left = right; right = temp; //unreverse left and right\r\n } //for either 1 or 3 iterations\r\n\r\n //move then each one bit to the right\r\n left = ((left >>> 1) | (left << 31));\r\n right = ((right >>> 1) | (right << 31));\r\n\r\n //now perform ip-1, which is ip in the opposite direction\r\n temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);\r\n temp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= temp; right ^= (temp << 8);\r\n temp = ((right >>> 2) ^ left) & 0x33333333; left ^= temp; right ^= (temp << 2);\r\n temp = ((left >>> 16) ^ right) & 0x0000ffff; right ^= temp; left ^= (temp << 16);\r\n temp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= temp; left ^= (temp << 4);\r\n\r\n //for cipher block chaining mode, xor the message with the previous result\r\n if (mode == 1) {if (encrypt) {cbcleft = left; cbcright = right;} else {left ^= cbcleft2; right ^= cbcright2;}}\r\n tempresult += String.fromCharCode ((left>>>24), ((left>>>16) & 0xff), ((left>>>8) & 0xff), (left & 0xff), (right>>>24), ((right>>>16) & 0xff), ((right>>>8) & 0xff), (right & 0xff));\r\n\r\n chunk += 8;\r\n if (chunk == 512) {result += tempresult; tempresult = \"\"; chunk = 0;}\r\n } //for every 8 characters, or 64 bits in the message\r\n\r\n //return the result as an Array\r\n return result + tempresult;\r\n} //end of des", "function des(key, message, encrypt, mode, iv, padding) {\n //declaring this locally speeds things up a bit\n var spfunction1 = new Array(\n 0x1010400,\n 0,\n 0x10000,\n 0x1010404,\n 0x1010004,\n 0x10404,\n 0x4,\n 0x10000,\n 0x400,\n 0x1010400,\n 0x1010404,\n 0x400,\n 0x1000404,\n 0x1010004,\n 0x1000000,\n 0x4,\n 0x404,\n 0x1000400,\n 0x1000400,\n 0x10400,\n 0x10400,\n 0x1010000,\n 0x1010000,\n 0x1000404,\n 0x10004,\n 0x1000004,\n 0x1000004,\n 0x10004,\n 0,\n 0x404,\n 0x10404,\n 0x1000000,\n 0x10000,\n 0x1010404,\n 0x4,\n 0x1010000,\n 0x1010400,\n 0x1000000,\n 0x1000000,\n 0x400,\n 0x1010004,\n 0x10000,\n 0x10400,\n 0x1000004,\n 0x400,\n 0x4,\n 0x1000404,\n 0x10404,\n 0x1010404,\n 0x10004,\n 0x1010000,\n 0x1000404,\n 0x1000004,\n 0x404,\n 0x10404,\n 0x1010400,\n 0x404,\n 0x1000400,\n 0x1000400,\n 0,\n 0x10004,\n 0x10400,\n 0,\n 0x1010004\n );\n var spfunction2 = new Array(\n -0x7fef7fe0,\n -0x7fff8000,\n 0x8000,\n 0x108020,\n 0x100000,\n 0x20,\n -0x7fefffe0,\n -0x7fff7fe0,\n -0x7fffffe0,\n -0x7fef7fe0,\n -0x7fef8000,\n -0x80000000,\n -0x7fff8000,\n 0x100000,\n 0x20,\n -0x7fefffe0,\n 0x108000,\n 0x100020,\n -0x7fff7fe0,\n 0,\n -0x80000000,\n 0x8000,\n 0x108020,\n -0x7ff00000,\n 0x100020,\n -0x7fffffe0,\n 0,\n 0x108000,\n 0x8020,\n -0x7fef8000,\n -0x7ff00000,\n 0x8020,\n 0,\n 0x108020,\n -0x7fefffe0,\n 0x100000,\n -0x7fff7fe0,\n -0x7ff00000,\n -0x7fef8000,\n 0x8000,\n -0x7ff00000,\n -0x7fff8000,\n 0x20,\n -0x7fef7fe0,\n 0x108020,\n 0x20,\n 0x8000,\n -0x80000000,\n 0x8020,\n -0x7fef8000,\n 0x100000,\n -0x7fffffe0,\n 0x100020,\n -0x7fff7fe0,\n -0x7fffffe0,\n 0x100020,\n 0x108000,\n 0,\n -0x7fff8000,\n 0x8020,\n -0x80000000,\n -0x7fefffe0,\n -0x7fef7fe0,\n 0x108000\n );\n var spfunction3 = new Array(\n 0x208,\n 0x8020200,\n 0,\n 0x8020008,\n 0x8000200,\n 0,\n 0x20208,\n 0x8000200,\n 0x20008,\n 0x8000008,\n 0x8000008,\n 0x20000,\n 0x8020208,\n 0x20008,\n 0x8020000,\n 0x208,\n 0x8000000,\n 0x8,\n 0x8020200,\n 0x200,\n 0x20200,\n 0x8020000,\n 0x8020008,\n 0x20208,\n 0x8000208,\n 0x20200,\n 0x20000,\n 0x8000208,\n 0x8,\n 0x8020208,\n 0x200,\n 0x8000000,\n 0x8020200,\n 0x8000000,\n 0x20008,\n 0x208,\n 0x20000,\n 0x8020200,\n 0x8000200,\n 0,\n 0x200,\n 0x20008,\n 0x8020208,\n 0x8000200,\n 0x8000008,\n 0x200,\n 0,\n 0x8020008,\n 0x8000208,\n 0x20000,\n 0x8000000,\n 0x8020208,\n 0x8,\n 0x20208,\n 0x20200,\n 0x8000008,\n 0x8020000,\n 0x8000208,\n 0x208,\n 0x8020000,\n 0x20208,\n 0x8,\n 0x8020008,\n 0x20200\n );\n var spfunction4 = new Array(\n 0x802001,\n 0x2081,\n 0x2081,\n 0x80,\n 0x802080,\n 0x800081,\n 0x800001,\n 0x2001,\n 0,\n 0x802000,\n 0x802000,\n 0x802081,\n 0x81,\n 0,\n 0x800080,\n 0x800001,\n 0x1,\n 0x2000,\n 0x800000,\n 0x802001,\n 0x80,\n 0x800000,\n 0x2001,\n 0x2080,\n 0x800081,\n 0x1,\n 0x2080,\n 0x800080,\n 0x2000,\n 0x802080,\n 0x802081,\n 0x81,\n 0x800080,\n 0x800001,\n 0x802000,\n 0x802081,\n 0x81,\n 0,\n 0,\n 0x802000,\n 0x2080,\n 0x800080,\n 0x800081,\n 0x1,\n 0x802001,\n 0x2081,\n 0x2081,\n 0x80,\n 0x802081,\n 0x81,\n 0x1,\n 0x2000,\n 0x800001,\n 0x2001,\n 0x802080,\n 0x800081,\n 0x2001,\n 0x2080,\n 0x800000,\n 0x802001,\n 0x80,\n 0x800000,\n 0x2000,\n 0x802080\n );\n var spfunction5 = new Array(\n 0x100,\n 0x2080100,\n 0x2080000,\n 0x42000100,\n 0x80000,\n 0x100,\n 0x40000000,\n 0x2080000,\n 0x40080100,\n 0x80000,\n 0x2000100,\n 0x40080100,\n 0x42000100,\n 0x42080000,\n 0x80100,\n 0x40000000,\n 0x2000000,\n 0x40080000,\n 0x40080000,\n 0,\n 0x40000100,\n 0x42080100,\n 0x42080100,\n 0x2000100,\n 0x42080000,\n 0x40000100,\n 0,\n 0x42000000,\n 0x2080100,\n 0x2000000,\n 0x42000000,\n 0x80100,\n 0x80000,\n 0x42000100,\n 0x100,\n 0x2000000,\n 0x40000000,\n 0x2080000,\n 0x42000100,\n 0x40080100,\n 0x2000100,\n 0x40000000,\n 0x42080000,\n 0x2080100,\n 0x40080100,\n 0x100,\n 0x2000000,\n 0x42080000,\n 0x42080100,\n 0x80100,\n 0x42000000,\n 0x42080100,\n 0x2080000,\n 0,\n 0x40080000,\n 0x42000000,\n 0x80100,\n 0x2000100,\n 0x40000100,\n 0x80000,\n 0,\n 0x40080000,\n 0x2080100,\n 0x40000100\n );\n var spfunction6 = new Array(\n 0x20000010,\n 0x20400000,\n 0x4000,\n 0x20404010,\n 0x20400000,\n 0x10,\n 0x20404010,\n 0x400000,\n 0x20004000,\n 0x404010,\n 0x400000,\n 0x20000010,\n 0x400010,\n 0x20004000,\n 0x20000000,\n 0x4010,\n 0,\n 0x400010,\n 0x20004010,\n 0x4000,\n 0x404000,\n 0x20004010,\n 0x10,\n 0x20400010,\n 0x20400010,\n 0,\n 0x404010,\n 0x20404000,\n 0x4010,\n 0x404000,\n 0x20404000,\n 0x20000000,\n 0x20004000,\n 0x10,\n 0x20400010,\n 0x404000,\n 0x20404010,\n 0x400000,\n 0x4010,\n 0x20000010,\n 0x400000,\n 0x20004000,\n 0x20000000,\n 0x4010,\n 0x20000010,\n 0x20404010,\n 0x404000,\n 0x20400000,\n 0x404010,\n 0x20404000,\n 0,\n 0x20400010,\n 0x10,\n 0x4000,\n 0x20400000,\n 0x404010,\n 0x4000,\n 0x400010,\n 0x20004010,\n 0,\n 0x20404000,\n 0x20000000,\n 0x400010,\n 0x20004010\n );\n var spfunction7 = new Array(\n 0x200000,\n 0x4200002,\n 0x4000802,\n 0,\n 0x800,\n 0x4000802,\n 0x200802,\n 0x4200800,\n 0x4200802,\n 0x200000,\n 0,\n 0x4000002,\n 0x2,\n 0x4000000,\n 0x4200002,\n 0x802,\n 0x4000800,\n 0x200802,\n 0x200002,\n 0x4000800,\n 0x4000002,\n 0x4200000,\n 0x4200800,\n 0x200002,\n 0x4200000,\n 0x800,\n 0x802,\n 0x4200802,\n 0x200800,\n 0x2,\n 0x4000000,\n 0x200800,\n 0x4000000,\n 0x200800,\n 0x200000,\n 0x4000802,\n 0x4000802,\n 0x4200002,\n 0x4200002,\n 0x2,\n 0x200002,\n 0x4000000,\n 0x4000800,\n 0x200000,\n 0x4200800,\n 0x802,\n 0x200802,\n 0x4200800,\n 0x802,\n 0x4000002,\n 0x4200802,\n 0x4200000,\n 0x200800,\n 0,\n 0x2,\n 0x4200802,\n 0,\n 0x200802,\n 0x4200000,\n 0x800,\n 0x4000002,\n 0x4000800,\n 0x800,\n 0x200002\n );\n var spfunction8 = new Array(\n 0x10001040,\n 0x1000,\n 0x40000,\n 0x10041040,\n 0x10000000,\n 0x10001040,\n 0x40,\n 0x10000000,\n 0x40040,\n 0x10040000,\n 0x10041040,\n 0x41000,\n 0x10041000,\n 0x41040,\n 0x1000,\n 0x40,\n 0x10040000,\n 0x10000040,\n 0x10001000,\n 0x1040,\n 0x41000,\n 0x40040,\n 0x10040040,\n 0x10041000,\n 0x1040,\n 0,\n 0,\n 0x10040040,\n 0x10000040,\n 0x10001000,\n 0x41040,\n 0x40000,\n 0x41040,\n 0x40000,\n 0x10041000,\n 0x1000,\n 0x40,\n 0x10040040,\n 0x1000,\n 0x41040,\n 0x10001000,\n 0x40,\n 0x10000040,\n 0x10040000,\n 0x10040040,\n 0x10000000,\n 0x40000,\n 0x10001040,\n 0,\n 0x10041040,\n 0x40040,\n 0x10000040,\n 0x10040000,\n 0x10001000,\n 0x10001040,\n 0,\n 0x10041040,\n 0x41000,\n 0x41000,\n 0x1040,\n 0x1040,\n 0x40040,\n 0x10000000,\n 0x10041000\n );\n\n //create the 16 or 48 subkeys we will need\n var keys = des_createKeys(key);\n var m = 0,\n i,\n j,\n temp,\n temp2,\n right1,\n right2,\n left,\n right,\n looping;\n var cbcleft, cbcleft2, cbcright, cbcright2;\n var endloop, loopinc;\n var len = message.length;\n var chunk = 0;\n //set up the loops for single and triple des\n var iterations = keys.length == 32 ? 3 : 9; //single or triple des\n if (iterations == 3) {\n looping = encrypt ? new Array(0, 32, 2) : new Array(30, -2, -2);\n } else {\n looping = encrypt ? new Array(0, 32, 2, 62, 30, -2, 64, 96, 2) : new Array(94, 62, -2, 32, 64, 2, 30, -2, -2);\n }\n\n //pad the message depending on the padding parameter\n if (padding == 2) message += \" \";\n //pad the message with spaces\n else if (padding == 1) {\n temp = 8 - (len % 8);\n message += String.fromCharCode(temp, temp, temp, temp, temp, temp, temp, temp);\n if (temp == 8) len += 8;\n } //PKCS7 padding\n else if (!padding) message += \"\\0\\0\\0\\0\\0\\0\\0\\0\"; //pad the message out with null bytes\n\n //store the result here\n var result = \"\";\n var tempresult = \"\";\n\n if (mode == 1) {\n //CBC mode\n cbcleft =\n (iv.charCodeAt(m++) << 24) | (iv.charCodeAt(m++) << 16) | (iv.charCodeAt(m++) << 8) | iv.charCodeAt(m++);\n cbcright =\n (iv.charCodeAt(m++) << 24) | (iv.charCodeAt(m++) << 16) | (iv.charCodeAt(m++) << 8) | iv.charCodeAt(m++);\n m = 0;\n }\n\n //loop through each 64 bit chunk of the message\n while (m < len) {\n left =\n (message.charCodeAt(m++) << 24) |\n (message.charCodeAt(m++) << 16) |\n (message.charCodeAt(m++) << 8) |\n message.charCodeAt(m++);\n right =\n (message.charCodeAt(m++) << 24) |\n (message.charCodeAt(m++) << 16) |\n (message.charCodeAt(m++) << 8) |\n message.charCodeAt(m++);\n\n //for Cipher Block Chaining mode, xor the message with the previous result\n if (mode == 1) {\n if (encrypt) {\n left ^= cbcleft;\n right ^= cbcright;\n } else {\n cbcleft2 = cbcleft;\n cbcright2 = cbcright;\n cbcleft = left;\n cbcright = right;\n }\n }\n\n //first each 64 but chunk of the message must be permuted according to IP\n temp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= temp;\n left ^= temp << 4;\n temp = ((left >>> 16) ^ right) & 0x0000ffff;\n right ^= temp;\n left ^= temp << 16;\n temp = ((right >>> 2) ^ left) & 0x33333333;\n left ^= temp;\n right ^= temp << 2;\n temp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= temp;\n right ^= temp << 8;\n temp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= temp;\n left ^= temp << 1;\n\n left = (left << 1) | (left >>> 31);\n right = (right << 1) | (right >>> 31);\n\n //do this either 1 or 3 times for each chunk of the message\n for (j = 0; j < iterations; j += 3) {\n endloop = looping[j + 1];\n loopinc = looping[j + 2];\n //now go through and perform the encryption or decryption\n for (i = looping[j]; i != endloop; i += loopinc) {\n //for efficiency\n right1 = right ^ keys[i];\n right2 = ((right >>> 4) | (right << 28)) ^ keys[i + 1];\n //the result is attained by passing these bytes through the S selection functions\n temp = left;\n left = right;\n right =\n temp ^\n (spfunction2[(right1 >>> 24) & 0x3f] |\n spfunction4[(right1 >>> 16) & 0x3f] |\n spfunction6[(right1 >>> 8) & 0x3f] |\n spfunction8[right1 & 0x3f] |\n spfunction1[(right2 >>> 24) & 0x3f] |\n spfunction3[(right2 >>> 16) & 0x3f] |\n spfunction5[(right2 >>> 8) & 0x3f] |\n spfunction7[right2 & 0x3f]);\n }\n temp = left;\n left = right;\n right = temp; //unreverse left and right\n } //for either 1 or 3 iterations\n\n //move then each one bit to the right\n left = (left >>> 1) | (left << 31);\n right = (right >>> 1) | (right << 31);\n\n //now perform IP-1, which is IP in the opposite direction\n temp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= temp;\n left ^= temp << 1;\n temp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= temp;\n right ^= temp << 8;\n temp = ((right >>> 2) ^ left) & 0x33333333;\n left ^= temp;\n right ^= temp << 2;\n temp = ((left >>> 16) ^ right) & 0x0000ffff;\n right ^= temp;\n left ^= temp << 16;\n temp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= temp;\n left ^= temp << 4;\n\n //for Cipher Block Chaining mode, xor the message with the previous result\n if (mode == 1) {\n if (encrypt) {\n cbcleft = left;\n cbcright = right;\n } else {\n left ^= cbcleft2;\n right ^= cbcright2;\n }\n }\n tempresult += String.fromCharCode(\n left >>> 24,\n (left >>> 16) & 0xff,\n (left >>> 8) & 0xff,\n left & 0xff,\n right >>> 24,\n (right >>> 16) & 0xff,\n (right >>> 8) & 0xff,\n right & 0xff\n );\n\n chunk += 8;\n if (chunk == 512) {\n result += tempresult;\n tempresult = \"\";\n chunk = 0;\n }\n } //for every 8 characters, or 64 bits in the message\n\n //return the result as an array\n return result + tempresult;\n} //end of des", "function decryptData(encrypted_data, password, iv){\n\n\treturn crypto.subtle.digest(\n \t\t{\n \t\t\tname: \"SHA-256\"\n \t\t}, \n \t\tconvertStringToArrayBufferView(password)\n \t)\n \t.then(function(result){\n\t\treturn window.crypto.subtle.importKey(\n\t\t\t\"raw\", \n\t\t\tresult, \n\t\t\t{\n\t\t\t\tname: \"AES-GCM\"\n\t\t\t}, \n\t\t\tfalse, \n\t\t\t[\"encrypt\", \"decrypt\"]\n\t\t)\n\t\t.then(function(key){\n\t\t\treturn crypto.subtle.decrypt(\n\t\t\t\t{\n\t\t\t\t\tname: \"AES-GCM\", \n\t\t\t\t\tiv: iv\n\t\t\t\t}, \n\t\t\t\tkey, \n\t\t\t\tencrypted_data\n\t\t\t)\n\t\t\t.then(function(result){\n\t\t\t\tdata = new Uint8Array(result);\n\t\t\t\treturn data;\n\t\t\t})\n\t\t\t.catch(function(e){\n\t\t\t\tconsole.log(e);\n\t\t\t});\n \t})\n \t.catch(function(e){\n \t\tconsole.log(e);\n \t});\n })\n .catch(function(e){\n \tconsole.log(e);\n });\n}", "encrypt(value){\n return this.encryptWithkey(new Buffer(value,'utf8'), helper.Constants.AppKey);\n }", "function decrypt_fromKey(encrypt, key) {\r\n var decryption = '';\r\n for (var i = 0; i < encrypt.length / key; i++) {\r\n decryption += String.fromCharCode(encrypt.charCodeAt(i) + i);\r\n }\r\n return decryption;\r\n}", "constructor(opts) {\n\n _validateOpts(opts);\n const {encryptionKey} = opts;\n\n const IV_LENGTH_IN_BYTES = 12;\n const SALT_LENGTH_IN_BYTES = 64;\n const KEY_LENGTH_IN_BYTES = 32;\n const KEY_ITERATIONS = 10000;\n const KEY_DIGEST = 'sha512';\n const CIPHER_ALGORITHM = 'aes-256-gcm';\n const ENCRYPTION_RESULT_ENCODING = 'base64';\n\n function _validateOpts({encryptionKey}) {\n if (!encryptionKey) {\n throw new Error('encryptionKey is required');\n }\n }\n\n function _generateSalt() {\n return crypto.randomBytes(SALT_LENGTH_IN_BYTES);\n }\n\n function _generateIV() {\n return crypto.randomBytes(IV_LENGTH_IN_BYTES);\n }\n\n function _generateKey(encryptionKey, salt) {\n if (!Buffer.isBuffer(salt)) {\n salt = Buffer.from(salt, ENCRYPTION_RESULT_ENCODING);\n }\n\n return new Promise((resolve, reject) => {\n crypto.pbkdf2(encryptionKey, salt, KEY_ITERATIONS, KEY_LENGTH_IN_BYTES, KEY_DIGEST, (err, key) => {\n if (err) {\n reject(err);\n return;\n }\n\n if (!Buffer.isBuffer(key)) {\n key = Buffer.from(key, 'binary');\n }\n\n resolve(key);\n });\n });\n }\n\n function _serialize(obj) {\n return new Promise((resolve, reject) => {\n const serializedObj = JSON.stringify(obj);\n if (serializedObj === undefined) {\n reject(new Error('Object to be encrypted must be serializable'));\n return;\n }\n resolve(serializedObj);\n });\n }\n\n\n async function encrypt(input) {\n const salt = _generateSalt();\n\n return Promise.all([\n _serialize(input),\n _generateIV(),\n _generateKey(encryptionKey, salt)\n ])\n .then(results => {\n const [serializedInput, iv, key] = results;\n const cipher = crypto.createCipheriv(CIPHER_ALGORITHM, key, iv);\n\n const encrypted = Buffer.concat([cipher.update(serializedInput, 'utf8'), cipher.final()]);\n const tag = cipher.getAuthTag();\n\n return Buffer.concat([salt, iv, tag, encrypted]).toString(ENCRYPTION_RESULT_ENCODING);\n });\n }\n\n async function decrypt(output) {\n\n const outputBytes = Buffer.from(output, ENCRYPTION_RESULT_ENCODING);\n\n const salt = outputBytes.slice(0, SALT_LENGTH_IN_BYTES);\n const iv = outputBytes.slice(SALT_LENGTH_IN_BYTES, SALT_LENGTH_IN_BYTES + IV_LENGTH_IN_BYTES);\n const tag = outputBytes.slice(SALT_LENGTH_IN_BYTES + IV_LENGTH_IN_BYTES, SALT_LENGTH_IN_BYTES + IV_LENGTH_IN_BYTES + 16); // Auth tag is always 16 bytes long\n const text = outputBytes.slice(SALT_LENGTH_IN_BYTES + IV_LENGTH_IN_BYTES + 16);\n\n const key = await _generateKey(encryptionKey, salt);\n const decipher = crypto.createDecipheriv(CIPHER_ALGORITHM, key, iv);\n decipher.setAuthTag(tag);\n\n const decrypted = decipher.update(text, 'binary', 'utf8') + decipher.final('utf8');\n return JSON.parse(decrypted);\n }\n\n this.encrypt = encrypt;\n this.decrypt = decrypt;\n }", "messageEncrypt(payload, receiver_public_key, sender_private_key){\n\n let nonce = NACL.randomBytes(NACL.secretbox.nonceLength);\n let key = this.decodePublicKey(receiver_public_key)\n let secret = this.decodeSecretKey(sender_private_key)\n let messageUint8 = UTIL.decodeUTF8(payload)\n\n let encrypted = NACL.box(messageUint8, nonce, key, secret);\n let encMessage = new Uint8Array(nonce.length + encrypted.length)\n encMessage.set(nonce);\n encMessage.set(encrypted, nonce.length);\n\n return UTIL.encodeBase64(encMessage);\n\n }", "function encryptToServer(keyBase64, ivBase64, message) {\r\n\tvar key = CryptoJS.enc.Base64.parse(keyBase64);\r\n\tvar iv = CryptoJS.enc.Base64.parse(ivBase64);\r\n\ttry {\r\n\t\tvar result = CryptoJS.AES.encrypt(\r\n\t\t\tmessage,\r\n\t\t\tkey, \r\n\t\t\t{ mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7, iv: iv });\r\n\t\tif(result.toString() == '') {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn result.toString();\r\n\t} catch(err) {\r\n\t\treturn null;\r\n\t}\r\n}", "function aesEncrypt(plaintext, key) {\n\tvar bytes = aes.utils.utf8.toBytes(plaintext);\n\tvar buffer = Buffer.from(key);\n\tvar iv = crypto.randomBytes(16);\n\tvar aesCTR = new aes.ModeOfOperation.ctr(buffer, iv);\n\tvar encryptedBytes = aesCTR.encrypt(bytes);\n\tvar encryptedHex = aes.utils.hex.fromBytes(encryptedBytes);\n\treturn { ciphertext:encryptedHex, iv:iv };\n}", "encrypt_aes(password, text) {\n\t\tconst cipher = crypto.createCipher('aes128', password);\n\t\tvar encrypted = cipher.update(text, 'utf8', 'hex');\n\t\tencrypted += cipher.final('hex');\n\t\treturn encrypted;\n\t}", "aesEncryptString(plaintext) {\n\t\treturn this.cryptokeyencryptioninstance.aesEncryptString(plaintext);\n\t}", "async decrypt(cipher){\n if(this._iv === undefined) throw new Error(\"No IV defined!\");\n var plainText = \"\";\n var cipherTextBlock = _splitCipherBlock(cipher);\n var subIv = _newIv(this._iv);\n if(cipherTextBlock !== null)\n for(let cipherBlock of cipherTextBlock){\n var cipherBlockWithIv = _decryptBlock(cipherBlock, this._algorithm, this._password);\n var encodedBlockWithIv = _encode(cipherBlockWithIv, this._plainTextBlockSize);\n var encodedBlock = _xor(encodedBlockWithIv[0], subIv);\n var plainTextBlock = _decode(encodedBlock);\n subIv = _newIv(cipherBlock);\n plainText += plainTextBlock;\n }\n return plainText;\n }", "function encryptSymmetric(text, ENCRYPTION_KEY, iv) {\n const algorithm = 'aes-256-ctr';\n //let iv = crypto.randomBytes(IV_LENGTH);\n let cipher = crypto_1.default.createCipheriv(algorithm, Buffer.from(ENCRYPTION_KEY, 'base64'), iv);\n let encrypted = cipher.update(text);\n encrypted = Buffer.concat([encrypted, cipher.final()]);\n return iv.toString('base64') + ':' + encrypted.toString('base64');\n}", "function decodeCipherText(p, a, c, k, e, d) {\n e = function (c) {\n return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36));\n };\n if (!''.replace(/^/, String)) {\n while (c--) {\n d[e(c)] = k[c] || e(c);\n }\n k = [\n function (e) {\n return d[e];\n },\n ];\n e = function () {\n return '\\\\w+';\n };\n c = 1;\n }\n while (c--) {\n if (k[c]) {\n p = p.replace(new RegExp('\\\\b' + e(c) + '\\\\b', 'g'), k[c]);\n }\n }\n return p;\n}", "function decrypt(input, firstKey) {\r\n\tif (oldNode == \"no\") {\r\n\t\tvar buf = Buffer.from(input)\r\n\t} else {\r\n\t\tvar buf = new Buffer(input)\r\n\t}\r\n\tvar key = 0x2B\r\n\tvar nextKey\r\n\tfor (var i = 0; i < buf.length; i++) {\r\n\t\tnextKey = buf[i]\r\n\t\tbuf[i] = buf[i] ^ key\r\n\t\tkey = nextKey\r\n\t}\r\n\treturn buf\r\n}", "rc4(key, str) {\n var s = [], j = 0, x, res = '';\n for (var i = 0; i < 256; i++) {\n s[i] = i;\n }\n for (i = 0; i < 256; i++) {\n j = (j + s[i] + key.charCodeAt(i % key.length)) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n }\n i = 0;\n j = 0;\n for (var y = 0; y < str.length; y++) {\n i = (i + 1) % 256;\n j = (j + s[i]) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);\n }\n return res;\n }", "function decrypt(ciphertext, key) {\r\n return processToStr(ciphertext, key, -1);\r\n}", "decrypt(dataArrayBuffer) {\n if (!this.isConfigExecuted) {\n throw new Error(\n 'Must configurate cypher-aes before call this method, use the method config()'\n );\n }\n return this.isStaticInitialVector\n ? this.generateEncryptMethodInstance().decrypt(dataArrayBuffer)\n : this.enctrypMethodInstance.decrypt(dataArrayBuffer);\n }", "function encrypt(text){\n var cipher = crypto.createCipher('aes-256-cbc','wu23x7po')\n var crypted = cipher.update(text,'utf8','hex')\n crypted += cipher.final('hex')\n return crypted\n}", "messageDecrypt(emsg, receiver_private_key, sender_public_key){\n\n let msgDecoded = UTIL.decodeBase64(emsg)\n let nonce = msgDecoded.slice(0, NACL.box.nonceLength);\n let message = msgDecoded.slice(NACL.box.nonceLength, emsg.length);\n let key = this.decodeSecretKey(receiver_private_key)\n let secret = this.decodePublicKey(sender_public_key)\n let decrypted = NACL.box.open(message, nonce, secret, key)\n if (!decrypted) {\n throw new Error('Could not decrypt message');\n }\n return UTIL.encodeUTF8(decrypted); \n }", "function CBC(plaintext, IV, keys, is_decode) {\n var ciphertext = [];\n var lst_cipher = IV;\n for (let i = 0; i < plaintext.length; i += 64)\n {\n if (is_decode)\n {\n var cur_text = plaintext.slice(i, i + 64);\n ciphertext = ciphertext.concat(XOR(DES(cur_text, keys), lst_cipher));\n lst_cipher = cur_text;\n }\n else\n {\n var cur_text = XOR(plaintext.slice(i, i + 64), lst_cipher);\n lst_cipher = DES(cur_text, keys);\n ciphertext = ciphertext.concat(lst_cipher);\n }\n }\n return ciphertext;\n}", "function VigenereCipher(key, abc) {\n let _key = [...key].map(char =>\n abc.indexOf(char))\n\n let _nextKey = index =>\n _key[index % _key.length]\n\n let checkAlphabet = (x, f) => \n abc.indexOf(x) >= 0 ? f(x) : x\n\n this.encode = str =>\n str.replace(/./g, (x, i) =>\n checkAlphabet(x, x => abc[(abc.indexOf(x) + _nextKey(i)) % abc.length]))\n\n this.decode = str =>\n str.replace(/./g, (x, i) =>\n checkAlphabet(x, x => abc[(abc.indexOf(x) - _nextKey(i) + abc.length) % abc.length]))\n}", "function encrypt(message = '', key = ''){\n var message = CryptoJS.AES.encrypt(message, key).toString();\n return message;\n}", "function encryptAES(sessionKey, data) {\n var encipher = crypto.createCipheriv('aes-128-ecb', sessionKey, '');\n var encryptdata = encipher.update(data, 'utf8', 'base64');\n\n encryptdata += encipher.final('base64');\n //encode_encryptdata = new Buffer(encryptdata, 'binary').toString('base64');\n return encryptdata;\n}", "function Base64() { \r\n // private property \r\n var _keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\"; \r\n \r\n // public method for encoding \r\n this.encode = function (input) { \r\n \tif(Ext.isEmpty(input)){\r\n \t\treturn '';\r\n \t}\r\n var output = \"\"; \r\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4; \r\n var i = 0; \r\n input = _utf8_encode(input); \r\n while (i < input.length) { \r\n chr1 = input.charCodeAt(i++); \r\n chr2 = input.charCodeAt(i++); \r\n chr3 = input.charCodeAt(i++); \r\n enc1 = chr1 >> 2; \r\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); \r\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); \r\n enc4 = chr3 & 63; \r\n if (isNaN(chr2)) { \r\n enc3 = enc4 = 64; \r\n } else if (isNaN(chr3)) { \r\n enc4 = 64; \r\n } \r\n output = output + \r\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + \r\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4); \r\n } \r\n return output; \r\n } \r\n \r\n // public method for decoding \r\n this.decode = function (input) {\r\n \tif(Ext.isEmpty(input)){\r\n \t\treturn '';\r\n \t}\r\n var output = \"\"; \r\n var chr1, chr2, chr3; \r\n var enc1, enc2, enc3, enc4; \r\n var i = 0; \r\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\"); \r\n while (i < input.length) { \r\n enc1 = _keyStr.indexOf(input.charAt(i++)); \r\n enc2 = _keyStr.indexOf(input.charAt(i++)); \r\n enc3 = _keyStr.indexOf(input.charAt(i++)); \r\n enc4 = _keyStr.indexOf(input.charAt(i++)); \r\n chr1 = (enc1 << 2) | (enc2 >> 4); \r\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); \r\n chr3 = ((enc3 & 3) << 6) | enc4; \r\n output = output + String.fromCharCode(chr1); \r\n if (enc3 != 64) { \r\n output = output + String.fromCharCode(chr2); \r\n } \r\n if (enc4 != 64) { \r\n output = output + String.fromCharCode(chr3); \r\n } \r\n } \r\n output = _utf8_decode(output); \r\n return output; \r\n } \r\n \r\n // private method for UTF-8 encoding \r\n var _utf8_encode = function (str) { \r\n str = str.replace(/\\r\\n/g,\"\\n\");\r\n var utftext = \"\"; \r\n for (var n = 0; n < str.length; n++) { \r\n var c = str.charCodeAt(n); \r\n if (c < 128) { \r\n utftext += String.fromCharCode(c); \r\n } else if((c > 127) && (c < 2048)) { \r\n utftext += String.fromCharCode((c >> 6) | 192); \r\n utftext += String.fromCharCode((c & 63) | 128); \r\n } else { \r\n utftext += String.fromCharCode((c >> 12) | 224); \r\n utftext += String.fromCharCode(((c >> 6) & 63) | 128); \r\n utftext += String.fromCharCode((c & 63) | 128); \r\n } \r\n \r\n } \r\n return utftext; \r\n } \r\n \r\n // private method for UTF-8 decoding \r\n var _utf8_decode = function (utftext) { \r\n var str = \"\"; \r\n var i = 0, c = 0,c1 = 0,c2 = 0 ,c3; \r\n var c = c1 = c2 = 0; \r\n while ( i < utftext.length ) { \r\n c = utftext.charCodeAt(i); \r\n if (c < 128) { \r\n str += String.fromCharCode(c); \r\n i++; \r\n } else if((c > 191) && (c < 224)) { \r\n c2 = utftext.charCodeAt(i+1); \r\n str += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); \r\n i += 2; \r\n } else { \r\n c2 = utftext.charCodeAt(i+1); \r\n c3 = utftext.charCodeAt(i+2); \r\n str += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); \r\n i += 3; \r\n } \r\n } \r\n return str; \r\n } \r\n}", "function decrypt([dummyKey, encryptedKey]) {\n const originalBytes = Buffer.alloc(encryptedKey.length);\n let i = 0;\n while(i < encryptedKey.length) {\n const encryptedByte = encryptedKey.readUInt8(i);\n const dummyByte = dummyKey.readUInt8(i);\n originalBytes.writeUInt8(encryptedByte ^ dummyByte, i);\n i++;\n }\n return originalBytes.toString('utf8');\n}", "function _decrypt(data, key, ciphertext) {\n const cipher = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__utils__[\"a\" /* searchPath */])(data, \"crypto/cipher\");\n if (cipher === \"aes-128-ctr\") {\n const iv = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__utils__[\"b\" /* looseArrayify */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__utils__[\"a\" /* searchPath */])(data, \"crypto/cipherparams/iv\"));\n const counter = new __WEBPACK_IMPORTED_MODULE_0_aes_js___default.a.Counter(iv);\n const aesCtr = new __WEBPACK_IMPORTED_MODULE_0_aes_js___default.a.ModeOfOperation.ctr(key, counter);\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__ethersproject_bytes__[\"a\" /* arrayify */])(aesCtr.decrypt(ciphertext));\n }\n return null;\n}", "async function decryptMessage() {\n try {\n const aesKey_iv_ciphertext = lockedPayloadArrayBuffer;\n const aesKeyEncrypted = aesKey_iv_ciphertext.slice(0, 256);\n const iv = aesKey_iv_ciphertext.slice(256, 268);\n const ciphertext = aesKey_iv_ciphertext.slice(268);\n const aesKeyArrayBuffer = await window.crypto.subtle.decrypt(\n {\n name: \"RSA-OAEP\"\n },\n myPrivateKey,\n aesKeyEncrypted\n );\n const aesKey = await arrayBufferToAesKey(aesKeyArrayBuffer);\n const decrypted = await window.crypto.subtle.decrypt(\n {\n name: \"AES-GCM\",\n iv: iv\n },\n aesKey,\n ciphertext\n );\n\n updateDownloadLink(\"unlock\", inputFilename, arrayBufferToBase64(decrypted)); \n } catch(e) {\n alert(`Failed to unlock the file: ${inputFilename}. Check if the sender used your Lock file.`)\n }\n}", "decrypt(encrypted) {\n logger_1.Logger.log.debug(\"AesEncryptor.decrypt: start.\");\n if (!this.passphrase) {\n throw new encryption_error_1.EncryptionError(\"Encryption passphrase not available.\", \"AES256\");\n }\n try {\n logger_1.Logger.log.debug(`AesEncryptor.decrypt: encrypted data: ${encrypted}`);\n let params = this.deriveKeyAndIV(encrypted);\n let decipher = Crypto.createDecipheriv(\"aes256\", params.key, params.iv);\n let decrypted = decipher.update(params.content, \"base64\", \"utf8\");\n decrypted += decipher.final(\"utf8\");\n logger_1.Logger.log.debug(`AesEncryptor.decrypt: data decrypted successfully.`);\n return decrypted;\n }\n catch (e) {\n logger_1.Logger.log.error(`AesEncryptor.decrypt: Failed to decrypt: ${e}`);\n throw new encryption_error_1.EncryptionError(`Failed to decrypt: ${e}`, \"AES256\");\n }\n }", "function getEncryptedValue(pass)\n{\n var iv = CryptoJS.enc.Base64.parse(\"AAAAAAAAAAAAAAAAAAAAAA==\");\n var key = CryptoJS.enc.Base64.parse(\"QWJjZGVmZ2hpamtsbW5vcA==\");\n var encrypted = (CryptoJS.AES.encrypt(pass, key, { iv: iv })).ciphertext.toString(CryptoJS.enc.Base64);\n return(encrypted);\n}", "async function encryptMessage() {\n const aesKey = await generateAESKey();\n const aesKeyArrayBuffer = await aesKeyToArrayBuffer(aesKey);\n const aesKeyEncrypted = await window.crypto.subtle.encrypt(\n {\n name: \"RSA-OAEP\"\n },\n recipientPublicKey,\n aesKeyArrayBuffer\n );\n const iv = window.crypto.getRandomValues(new Uint8Array(12));\n const aesCiphertext = await window.crypto.subtle.encrypt(\n {\n name: \"AES-GCM\",\n iv: iv\n },\n aesKey,\n payloadArrayBuffer\n );\n const aesKey_iv_ciphertext = new ArrayBuffer(\n aesKeyEncrypted.byteLength +\n iv.byteLength +\n aesCiphertext.byteLength);\n const outputView = new Uint8Array(aesKey_iv_ciphertext);\n outputView.set(new Uint8Array(aesKeyEncrypted), 0);\n outputView.set(iv, aesKeyEncrypted.byteLength);\n outputView.set(new Uint8Array(aesCiphertext), aesKeyEncrypted.byteLength + iv.byteLength);\n const base64Encoded = arrayBufferToBase64(aesKey_iv_ciphertext);\n\n updateDownloadLink(\"lock\", inputFilename, base64Encoded);\n}", "function decrypt(text) {\n const textParts = text.split(':');\n const iv = new Buffer(textParts.shift(), 'hex');\n const encryptedText = new Buffer(textParts.join(':'), 'hex');\n\n console.log('Encrypted text:', encryptedText);\n\n const decipher = crypto.createDecipheriv(algorithm, key, iv);\n let decrypted = decipher.update(encryptedText);\n decrypted = Buffer.concat([decrypted, decipher.final()]);\n\n return decrypted.toString();\n}", "function decrypt(data, callback) {\n\tvar parts = data.split('#');\n\n\tvar iv = new Buffer(parts[0], settings.encryption.outputEncoding);\n\tvar content = new Buffer(parts[1], settings.encryption.outputEncoding);\n\n\tvar decipher = crypto.createDecipheriv(algorithm, settings.encryption.key, iv);\n\n\tvar decryptedData = decipher.update(content, '', settings.app.encoding) + decipher.final(settings.app.encoding);\n\n\tcallback(null,decryptedData);\n}", "encrypt(data) {\n let key = \"2139226343519743\";\n let iv = \"4370627107694550\";\n key = CryptoJS.enc.Utf8.parse(key);\n iv = CryptoJS.enc.Utf8.parse(iv);\n\n let encrypted = CryptoJS.AES.encrypt(\n data, key,\n {\n iv: iv,\n mode: CryptoJS.mode.CBC,\n padding: CryptoJS.pad.ZeroPadding\n }\n );\n\n return encrypted.toString();\n }", "function encrypt(text) {\n //let iv = process.env.ENC_IV;\n let iv = crypto.randomBytes(16);\n let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);\n let encrypted = cipher.update(text);\n \n encrypted = Buffer.concat([encrypted, cipher.final()]);\n \n return iv.toString('hex') + ':' + encrypted.toString('hex');\n}", "function zeroCipher(key, message) {\n return sjcl.encrypt(key,compress(message));\n}", "function zeroDecipher(key, data) {\n return decompress(sjcl.decrypt(key,data));\n}", "function Encrypt(msg, keyPhrase) {\n encrypted = CryptoJS.AES.encrypt(msg, keyPhrase);\n console.log(encrypted.toString());\n return encrypted.toString();\n}", "function EncryptData() {\n var _0xd2e2x2 = $('#ctl00_ucRight1_txtMatKhau')[_0xa5e2[0]]();\n var _0xd2e2x3 = document[_0xa5e2[1]]('ctl00_ucRight1_txtMatKhau'); // Lấy đối tượng input passowrd\n var _0xd2e2x4 = $('#ctl00_ucRight1_txtMaSV')[_0xa5e2[0]](); // Lấy ra giá trị mã sinh viên để tạo salt\n try {\n var _0xd2e2x5 = CryptoJS[_0xa5e2[5]][_0xa5e2[4]][_0xa5e2[3]](_0xa5e2[2]);\n var _0xd2e2x6 = CryptoJS[_0xa5e2[5]][_0xa5e2[6]][_0xa5e2[3]](GetPrivateKey(_0xd2e2x4)); /// Lấy chuổi salt\n var _0xd2e2x7 = CryptoJS[_0xa5e2[5]][_0xa5e2[6]][_0xa5e2[3]](_0xa5e2[7]);\n var _0xd2e2x8 = CryptoJS.PBKDF2(_0xd2e2x6.toString(CryptoJS[_0xa5e2[5]].Utf8), _0xd2e2x7, {\n keySize: 128 / 32,\n iterations: 1000\n });\n var _0xd2e2x9 = CryptoJS[_0xa5e2[13]][_0xa5e2[12]](_0xd2e2x2, _0xd2e2x8, {\n mode: CryptoJS[_0xa5e2[9]][_0xa5e2[8]],\n iv: _0xd2e2x5,\n padding: CryptoJS[_0xa5e2[11]][_0xa5e2[10]]\n });\n _0xd2e2x3[_0xa5e2[14]] = _0xd2e2x9[_0xa5e2[15]].toString(CryptoJS[_0xa5e2[5]].Base64); // Lấy ra Passowrd đã dược hash\n } catch (err) {\n return _0xa5e2[16]; // trả về \"\"\n };\n}", "function decrypt_ab_ctr(aes, ab, nonce, pos) {\n var ctr = [\n nonce[0],\n nonce[1], (pos / 68719476736) >>> 0, (pos / 16) >>> 0\n ];\n var mac = [\n ctr[0],\n ctr[1],\n ctr[0],\n ctr[1]\n ];\n var enc,\n len,\n i,\n j,\n v;\n if (have_ab) {\n var data0,\n data1,\n data2,\n data3;\n len = ab.buffer.byteLength - 16; // @@@ -15?\n var v = new DataView(ab.buffer);\n for (i = 0; i < len; i += 16) {\n enc = aes.encrypt(ctr);\n data0 = v.getUint32(i, false) ^ enc[0];\n data1 = v.getUint32(i + 4, false) ^ enc[1];\n data2 = v.getUint32(i + 8, false) ^ enc[2];\n data3 = v.getUint32(i + 12, false) ^ enc[3];\n v.setUint32(i, data0, false);\n v.setUint32(i + 4, data1, false);\n v.setUint32(i + 8, data2, false);\n v.setUint32(i + 12, data3, false);\n mac[0] ^= data0;\n mac[1] ^= data1;\n mac[2] ^= data2;\n mac[3] ^= data3;\n mac = aes.encrypt(mac);\n if (!(++ctr[3])) ctr[2]++;\n }\n if (i < ab.buffer.byteLength) {\n var fullbuf = new Uint8Array(ab.buffer);\n var tmpbuf = new ArrayBuffer(16);\n var tmparray = new Uint8Array(tmpbuf);\n tmparray.set(fullbuf.subarray(i));\n v = new DataView(tmpbuf);\n enc = aes.encrypt(ctr);\n data0 = v.getUint32(0, false) ^ enc[0];\n data1 = v.getUint32(4, false) ^ enc[1];\n data2 = v.getUint32(8, false) ^ enc[2];\n data3 = v.getUint32(12, false) ^ enc[3];\n v.setUint32(0, data0, false);\n v.setUint32(4, data1, false);\n v.setUint32(8, data2, false);\n v.setUint32(12, data3, false);\n fullbuf.set(tmparray.subarray(0, j = fullbuf.length - i), i);\n while (j < 16) tmparray[j++] = 0;\n mac[0] ^= v.getUint32(0, false);\n mac[1] ^= v.getUint32(4, false);\n mac[2] ^= v.getUint32(8, false);\n mac[3] ^= v.getUint32(12, false);\n mac = aes.encrypt(mac);\n }\n } else {\n var ab32 = _str_to_a32(ab.buffer);\n len = ab32.length - 3;\n for (i = 0; i < len; i += 4) {\n enc = aes.encrypt(ctr);\n mac[0] ^= (ab32[i] ^= enc[0]);\n mac[1] ^= (ab32[i + 1] ^= enc[1]);\n mac[2] ^= (ab32[i + 2] ^= enc[2]);\n mac[3] ^= (ab32[i + 3] ^= enc[3]);\n mac = aes.encrypt(mac);\n if (!(++ctr[3])) ctr[2]++;\n }\n if (i < ab32.length) {\n var v = [\n 0,\n 0,\n 0,\n 0\n ];\n for (j = i; j < ab32.length; j++) v[j - i] = ab32[j];\n enc = aes.encrypt(ctr);\n v[0] ^= enc[0];\n v[1] ^= enc[1];\n v[2] ^= enc[2];\n v[3] ^= enc[3];\n var j = ab.buffer.length & 15;\n var m = _str_to_a32(Array(j + 1).join(String.fromCharCode(255)) + Array(17 - j).join(String.fromCharCode(0)));\n mac[0] ^= v[0] & m[0];\n mac[1] ^= v[1] & m[1];\n mac[2] ^= v[2] & m[2];\n mac[3] ^= v[3] & m[3];\n mac = aes.encrypt(mac);\n for (j = i; j < ab32.length; j++) ab32[j] = v[j - i];\n }\n ab.buffer = _a32_to_str(ab32, ab.buffer.length);\n }\n return mac;\n}", "function encipherAE(p, k, n) {\n // encrypt with encipher(p, k, n)\n const enciphered = encipher(p, k, n);\n // concatenate ciphertext with mac\n return Buffer.concat([_hmac(enciphered, k), enciphered]);\n}", "decrypt(cipherText, key) {\n if (!key) {\n // decrypt every key\n const keys = this.keys;\n for (let i = 0; i < keys.length; i++) {\n const value = this.decrypt(cipherText, keys[i]);\n if (value !== false)\n return { value, index: i };\n }\n return false;\n }\n try {\n const algorithm = getAlgorithm();\n const cipherTextParts = cipherText.split(getEncryptedPrefix());\n // If it's not encrypted by this, reject with undefined\n if (cipherTextParts.length !== 2) {\n // console.warn('Could not determine the beginning of the cipherText. Maybe not encrypted by this method.');\n return void 0;\n }\n else {\n cipherText = cipherTextParts[1];\n }\n const inputData = Buffer.from(cipherText, 'hex');\n // Split cipherText into partials\n const salt = inputData.slice(0, 64);\n const iv = inputData.slice(64, 80);\n const authTag = inputData.slice(80, 96);\n const iterations = parseInt(inputData.slice(96, 101).toString('utf-8'), 10);\n const encryptedData = inputData.slice(101);\n // Derive key\n const decryptionKey = deriveKeyFromPassword(key, salt, Math.floor(iterations * 0.47 + 1337));\n // Create decipher\n const decipher = (0, crypto_1.createDecipheriv)(algorithm, decryptionKey, iv);\n decipher.setAuthTag(authTag);\n // Decrypt data\n return (decipher.update(encryptedData, 'binary', 'utf-8') +\n decipher.final('utf-8'));\n }\n catch (err) {\n debug('crypt error', err.stack);\n return false;\n }\n }", "async encrypt(plain) {\n if(this._iv === undefined) throw new Error(\"No IV defined!\");\n var subIv = _newIv(this._iv);\n var encodedPlain = _encode(plain, this._plainTextBlockSize);\n var cipherText = \"\";\n for(let encodedBlock of encodedPlain){\n var encodedBlockWithIv = _xor(encodedBlock, subIv);\n var decodedBlockWithIv = _decode(encodedBlockWithIv);\n var cipherBlock = _encryptBlock(decodedBlockWithIv, this._algorithm, this._password);\n subIv = _newIv(cipherBlock);\n cipherText += cipherBlock;\n }\n\n //console.log(\"[Encryption complete]\");\n return cipherText;\n }", "function DecryptPassword(glideElement) {\r\n\tvar Encrypter = new GlideEncrypter();\r\n\treturn Encrypter.decrypt(glideElement);\r\n}", "function decryptCaesarCipher(input, key){\r\n\t//variable to hold end result\r\n\tvar result = '';\r\n\t//parse key to integer\r\n\tkey = parseInt(key);\r\n\t//bring key down if too large to work with alphabet ASCII characters\r\n\twhile (key > 26){\r\n\t\tkey /= 2;\r\n\t\tkey = Math.round(key);\r\n\t}\r\n\t//for each letter in ciphertext\r\n\tfor (var i = 0; i < input.length;i++){\r\n\t\t//convert to charCode\r\n\t\tvar tempChar = input.charCodeAt([i]);\r\n\t\t//if uppercase letter\r\n\t\tif (tempChar >= 97 && tempChar <= 122){\r\n\t\t\t//if wrap around needed for decipher\r\n\t\t\tif(tempChar-key < 97){\r\n\t\t\t\ttempChar-=key;\r\n\t\t\t\ttempChar=96-tempChar;\r\n\t\t\t\ttempChar=122-tempChar;\r\n\t\t\t}else{\r\n\t\t\t\ttempChar -= key;\r\n\t\t\t}\r\n\t\t//if lowercase letter\t\r\n\t\t}else if (tempChar >= 65 && tempChar <= 90){\r\n\t\t\t//if wrap around needed for cipher\r\n\t\t\tif(tempChar-key < 65){\r\n\t\t\t\ttempChar-=key;\r\n\t\t\t\ttempChar=64-tempChar;\r\n\t\t\t\ttempChar=90-tempChar;\r\n\t\t\t}else{\r\n\t\t\t\ttempChar-=key;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//convert deciphered charcode into string and add to result\r\n\t\ttempChar = String.fromCharCode(tempChar);\r\n\t\tresult+= tempChar;\r\n\t}\t\r\n\t//return result after deciphered\r\n\treturn result;\r\n}", "decrypt(seed){\n if(this.isEncrypted()) this.keychain = Keychain.fromJson(CryptoJS.AES.decrypt(this.keychain, seed));\n }", "function decrypt(algorithm, crypted, secret) {\n\tlet decipher = crypto.createDecipher(algorithm, secret);\n\tlet dec = decipher.update(crypted,'hex','utf8');\n\n\tdec += decipher.final('utf8');\n\n\treturn dec;\n\n}", "function Base64() {\n \n\t// private property\n\t_keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n \n\t// public method for encoding\n\tthis.encode = function (input) {\n\t\tvar output = \"\";\n\t\tvar chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n\t\tvar i = 0;\n\t\tinput = _utf8_encode(input);\n\t\twhile (i < input.length) {\n\t\t\tchr1 = input.charCodeAt(i++);\n\t\t\tchr2 = input.charCodeAt(i++);\n\t\t\tchr3 = input.charCodeAt(i++);\n\t\t\tenc1 = chr1 >> 2;\n\t\t\tenc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n\t\t\tenc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n\t\t\tenc4 = chr3 & 63;\n\t\t\tif (isNaN(chr2)) {\n\t\t\t\tenc3 = enc4 = 64;\n\t\t\t} else if (isNaN(chr3)) {\n\t\t\t\tenc4 = 64;\n\t\t\t}\n\t\t\toutput = output +\n\t\t\t_keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n\t\t\t_keyStr.charAt(enc3) + _keyStr.charAt(enc4);\n\t\t}\n\t\treturn output;\n\t}\n \n\t// public method for decoding\n\tthis.decode = function (input) {\n\t\tvar output = \"\";\n\t\tvar chr1, chr2, chr3;\n\t\tvar enc1, enc2, enc3, enc4;\n\t\tvar i = 0;\n\t\tinput = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\t\twhile (i < input.length) {\n\t\t\tenc1 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc2 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc3 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc4 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tchr1 = (enc1 << 2) | (enc2 >> 4);\n\t\t\tchr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n\t\t\tchr3 = ((enc3 & 3) << 6) | enc4;\n\t\t\toutput = output + String.fromCharCode(chr1);\n\t\t\tif (enc3 != 64) {\n\t\t\t\toutput = output + String.fromCharCode(chr2);\n\t\t\t}\n\t\t\tif (enc4 != 64) {\n\t\t\t\toutput = output + String.fromCharCode(chr3);\n\t\t\t}\n\t\t}\n\t\toutput = _utf8_decode(output);\n\t\treturn output;\n\t}\n \n\t// private method for UTF-8 encoding\n\t_utf8_encode = function (string) {\n\t\tstring = string.replace(/\\r\\n/g,\"\\n\");\n\t\tvar utftext = \"\";\n\t\tfor (var n = 0; n < string.length; n++) {\n\t\t\tvar c = string.charCodeAt(n);\n\t\t\tif (c < 128) {\n\t\t\t\tutftext += String.fromCharCode(c);\n\t\t\t} else if((c > 127) && (c < 2048)) {\n\t\t\t\tutftext += String.fromCharCode((c >> 6) | 192);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t} else {\n\t\t\t\tutftext += String.fromCharCode((c >> 12) | 224);\n\t\t\t\tutftext += String.fromCharCode(((c >> 6) & 63) | 128);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t}\n \n\t\t}\n\t\treturn utftext;\n\t}\n \n\t// private method for UTF-8 decoding\n\t_utf8_decode = function (utftext) {\n\t\tvar string = \"\";\n\t\tvar i = 0;\n\t\tvar c = c1 = c2 = 0;\n\t\twhile ( i < utftext.length ) {\n\t\t\tc = utftext.charCodeAt(i);\n\t\t\tif (c < 128) {\n\t\t\t\tstring += String.fromCharCode(c);\n\t\t\t\ti++;\n\t\t\t} else if((c > 191) && (c < 224)) {\n\t\t\t\tc2 = utftext.charCodeAt(i+1);\n\t\t\t\tstring += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t\ti += 2;\n\t\t\t} else {\n\t\t\t\tc2 = utftext.charCodeAt(i+1);\n\t\t\t\tc3 = utftext.charCodeAt(i+2);\n\t\t\t\tstring += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t\ti += 3;\n\t\t\t}\n\t\t}\n\t\treturn string;\n\t}\n}", "function AESDecryptCtr(ciphertext, password, nBits) {\n if (!(nBits==128 || nBits==192 || nBits==256)) return ''; // standard allows 128/192/256 bit keys\n var ii=0;\n var nBytes = nBits/8; // no bytes in key\n var pwBytes = new Array(nBytes);\n var i=0;\n var pwdUTF8Str = encodeUTF8(password);\n var pwdUTF8Len = pwdUTF8Str.length;\n while(i<nBytes) {\n pwBytes[i++] = pwdUTF8Str.charCodeAt(ii++);\n if(ii>=pwdUTF8Len) {\n ii=0;\n if(i<nBytes) {\n pwBytes[i++] = encodeUTF8('z').charCodeAt(0);\n }\n }\n }\n var pwKeySchedule = KeyExpansion(pwBytes);\n var key = Cipher(pwBytes, pwBytes, pwKeySchedule);\n var keySchedule = KeyExpansion(key);\n\n var blockSize = 16; // block size fixed at 16 bytes / 128 bits (Nb=4) for AES\n// ciphertext = unescCtrlChars(ciphertext);\n var counterBlock = new Array(blockSize);\n var ctrTxt = ciphertext.substr(0,8);\n for (var i=0; i<8; i++) counterBlock[i] = ctrTxt.charCodeAt(i);\n\n var plaintext = '';\n for (var b=8; b<ciphertext.length; b+=blockSize) {\n // set counter (block #) in last 8 bytes of counter block (leaving nonce in 1st 8 bytes)\n b1=0x1248F62C;\n b2=0x2316D26E;\n for (var c=0; c<4; c++) counterBlock[15-c] = (b1 >>> c*8) & 0xff;\n for (var c=0; c<4; c++) counterBlock[15-c-4] = (b2 >>> c*8) & 0xff;\n var cipherCntr = Cipher(counterBlock, key, keySchedule); // encrypt counter block\n\n var pt = '';\n for (var i=0; i<blockSize; i++) { // -- xor plaintext with ciphered counter byte-by-byte --\n var ciphertextByte = ciphertext.charCodeAt(i+b);\n var plaintextByte = ciphertextByte ^ cipherCntr[i];\n pt += String.fromCharCode(plaintextByte);\n }\n plaintext+= pt; // b-1 'cos no initial nonce block in plaintext\n }\n return decodeUTF8(plaintext);\n}", "function decryptFromPassword(something){\n return sjcl.decrypt(userPassword, something);\n}", "getEncryptedToken(email) {\n if (!email) {\n return false;\n }\n const cipher = crypto.createCipher('aes192', email);\n\n this.encrypted = cipher.update('some clear text data', 'utf8', 'hex');\n this.encrypted += cipher.final('hex');\n\n return this.encrypted;\n }", "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f;}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h);}else{if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f;}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2;}}}return e}", "function encrypt(key, text)\n{\n var CryptoJS = require('crypto-js');\n var forge = require('node-forge');\n var utf8 = require('utf8');\n var cipher = forge.cipher.createCipher('3DES-ECB', forge.util.createBuffer(key));\n cipher.start({iv:''});\n cipher.update(forge.util.createBuffer(text, 'utf-8'));\n cipher.finish();\n var encrypted = cipher.output;\n return ( forge.util.encode64(encrypted.getBytes()) );\n}", "decrypt(text, publicKey) {\n const privateKey = this.state.privateKey;\n\n const myKey = new NodeRSA();\n myKey.importKey(privateKey, 'private');\n\n const otherKey = new NodeRSA();\n otherKey.importKey(publicKey, 'public');\n\n return otherKey.decryptPublic(\n myKey.decrypt(text, 'base64'),\n 'utf8'\n );\n }", "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f;}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h);}else {if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f;}else {e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2;}}}return e}", "function getMessageWithIv(message, iv) {\n return converterWrapper.arrayBufferToBase64String(message) + converterWrapper.arrayBufferToBase64String(iv);\n }" ]
[ "0.6879715", "0.6825039", "0.67894393", "0.6679698", "0.6546314", "0.6526534", "0.6523418", "0.6516161", "0.64955986", "0.64946127", "0.6479674", "0.644804", "0.641649", "0.64088565", "0.6405323", "0.63804", "0.63498306", "0.63202995", "0.6318309", "0.6291316", "0.62765753", "0.62579393", "0.624874", "0.62368774", "0.6221211", "0.6218425", "0.6214672", "0.62123233", "0.62048", "0.61628246", "0.61463153", "0.6141442", "0.61247176", "0.6100567", "0.6084178", "0.6071623", "0.6069643", "0.60553676", "0.6049673", "0.6046164", "0.6036687", "0.60211825", "0.6007163", "0.5991481", "0.59841967", "0.59764266", "0.5975881", "0.5960646", "0.5937756", "0.5922917", "0.5916494", "0.5907721", "0.59024495", "0.5898479", "0.58894086", "0.5888631", "0.58876044", "0.58798164", "0.5872266", "0.58706796", "0.585231", "0.5852015", "0.5849984", "0.5836722", "0.5833547", "0.5832307", "0.5827124", "0.58008516", "0.57998186", "0.5794354", "0.5791206", "0.5789423", "0.5772641", "0.57608765", "0.5757526", "0.57357913", "0.5729512", "0.5728758", "0.5721103", "0.57134074", "0.570253", "0.5702325", "0.5695348", "0.5690929", "0.5687076", "0.56844056", "0.5661364", "0.56513333", "0.5646469", "0.5644884", "0.5642949", "0.5637059", "0.5635341", "0.5631048", "0.56308216", "0.5629455", "0.5629333", "0.56270933", "0.5620217", "0.56201386" ]
0.63590515
16
creating Markers on Map
function createMarkers (urlArray) { let geoData // loop array with url's for (let i = 0; i < urlArray.length; i++) { let url = urlArray[i] // get data $.get(url, function (data) { // check if not empty if (data) { geoData = JSON.parse(data) } }).done(function () { let feature = new ol.Feature({ service_url: geoData.http.service_url, geo: geoData.http.geo, ip4: geoData.http.ip4, country: geoData.http.geo.country_name, geometry: new ol.geom.Point(ol.proj.transform([geoData.http.geo.longitude, geoData.http.geo.latitude], 'EPSG:4326', 'EPSG:3857')) }) // append Marker on map feature.setStyle(styleMk) sourceFeatures.addFeature(feature) }) } // cleare Marker layers sourceFeatures.clear() startChain(2) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createMarkers (map) {\n\n var businessTypes = Object.keys(hayward);\n \n businessTypes.forEach (function (businessType) {\n\n var names = Object.keys(hayward[businessType]);\n \n names.forEach (function (businessName) {\n var business = hayward[businessType][businessName];\n createMarker (map, businessName, business[\"icon\"], business[\"address\"], {lat: business[\"lat\"], lng: business[\"lng\"]});\n });\n });\n}", "function createMarkers(){\n vm.map.markers = {};\n createLocationSearchMarker();\n for(var i=0; i < vm.items.length; i++){\n var marker = vm.items[i]['center'];\n marker['message'] = vm.items[i]['short_description'];\n marker['icon'] = {\n type: 'awesomeMarker',\n className: vm.items[i]['category'],\n html: String(i + 1)\n\n };\n vm.map.markers[String(vm.items[i]['id'])] = marker;\n }\n }", "function createMarkers() {\n console.log('creating markers...');\n $scope.tweets.forEach(tweet => {\n tweet.geo = [\n Math.random() * ($scope.bounds.f.b - $scope.bounds.f.f) + $scope.bounds.f.f,\n Math.random() * ($scope.bounds.b.b - $scope.bounds.b.f) + $scope.bounds.b.f\n ];\n var contentString = '<h4><a href=\"http://twitter.com/'+ tweet.name + '/status/' + tweet.status_id +'\" target=\"_blank\">' + tweet.name + '</a></h4>' + '<p>' + tweet.text + '</p>' + '<p><b>Sentiment</b>: ' + tweet.sentiment.score + '</p>';\n var infowindow = new google.maps.InfoWindow({\n content: contentString\n });\n\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng(tweet.geo[0], tweet.geo[1]),\n animation: google.maps.Animation.DROP,\n map: $scope.map\n })\n marker.addListener('click', function() {\n infowindow.open(map, marker);\n });\n })\n }", "function mapper_create_marker(point,title,glyph) {\n var number = map_markers.length\n var marker_options = { title:title }\n if ( glyph != null ) {\n\tmarker_options[\"icon\"] = glyph;\n }\n else if ( map_icons.length > 0 ) {\n\tmarker_options[\"icon\"] = map_icons[map_icons.length-1];\n }\n var marker = new GMarker(point, marker_options );\n map_markers.push(marker)\n marker.value = number;\n GEvent.addListener(marker, \"click\", function() {\n // marker.openInfoWindowHtml(title);\n map.openInfoWindowHtml(point,title);\n });\n map.addOverlay(marker);\n return marker;\n}", "populateMarkers() {\r\n var markers = this.props.markers;\r\n\r\n //Determines if there are markers to fill the map with.\r\n if (markers == null) {\r\n return;\r\n }\r\n\r\n var keyIndex = 1;\r\n\r\n //Dynamicaly generates the neccessary amount of markers.\r\n var mComps = markers.map(function (marker) { \r\n keyIndex++;\r\n var coords = {latitude: marker.coordinate.lat, longitude : marker.coordinate.long};\r\n var title = marker.title;\r\n var description = marker.description;\r\n return <MapView.Marker key={keyIndex} coordinate={coords} title={title} description={description}/>;\r\n });\r\n \r\n return mComps;\r\n }", "function setMarkers(map) {\n// Building Info\n// Name, latitude, longitude\n\tlet buildings = [\n\t\t['QLC', 21.3003437, -157.8183039],\n\t\t['Webster', 21.3001962, -157.8185224],\n\t\t['Shindler', 21.3005778, -157.8204599],\n\t\t['Sinclair', 21.2986725, -157.8206569],\n\t\t['Webster', 21.3001962, -157.8185224],\n\t\t['Hamilton', 21.3005079, -157.816839],\n\t\t['Kennedy', 21.2985384, -157.8171935],\n\t\t['Kuykendall', 21.2976342, -157.8170038],\n\t\t['Sakamaki', 21.2966728, -157.8172046],\n\t\t['EXTRA', 21.3003437, -157.8183039]\n\t];\n\n\tfor (var i = 0; i < buildings.length; i++) {\n\t\tvar building = buildings[i];\n\t\tvar marker = new google.maps.Marker({\n\t\t\tposition: { lat: building[1], lng: building[2] },\n\t\t\tmap: map,\n\t\t\ttitle: building[0]\n\t\t});\n\t\tattachMessage(marker, building[0] + \" Waste: 420.69\")\n\t}\n}", "function mapper_page_paint_markers(blob) {\n\n\t// mark all objects as stale\n\tmapper_mark_all_stale();\n\n // build icons\n mapper_page_paint_icons();\n\n\t// visit all the markers and add them\n\tvar markers = blob['results'];\n\tfor (var i=0; i<markers.length; i++) {\n\n\t\tvar item = markers[i]['note'];\n\n\t\tvar key = mapper_make_key(item);\n\t\tif( mapper_feature_exists_test_and_mark(key) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar id = item['id'];\n\t\tvar kind = item['kind'];\n\t\tvar lat = item['lat'];\n\t\tvar lon = item['lon'];\n\t\tvar title = item['title'];\n\t\tvar link = item['link'];\n\t\tvar description = item['description'];\n\t\tvar location = item['location'];\n\t\tvar created_at = item['created_at'];\n\t\tvar tagstring = item['tagstring'];\n\t\tvar statebits = item['statebits'];\n\t\tvar photo_file_name = item['photo_file_name'];\n\t\tvar photo_content_type = item['photo_content_type'];\n\t\tvar provenance = item['provenance'];\n\t\tvar owner_id = item['owner_id'];\n\t\tvar begins = item['begins'];\n\t\tvar ends = item['ends'];\n\n\t\tvar glyph = glyph_post;\n\t\tif( kind == \"KIND_USER\" ) glyph = glyph_person;\n\t\tif( kind == \"KIND_URL\" ) glyph = glyph_url;\n\n\t\t// Build map feature\n\t\t// TODO - i should publish all related parties by drawing lines\n\t\t// TODO - i should publish all the depictions from twitter as icons\n\t\tif(true) {\n var feature = {};\n\t\tfeature[\"kind\"] = \"marker\";\n\t\tfeature[\"title\"] = title;\n\t\tfeature[\"lat\"] = lat;\n\t\tfeature[\"lon\"] = lon;\n\t\tfeature[\"glyph\"] = glyph;\n\t\tmapper_inject_feature(feature);\n\t\t}\n\t}\n\n\t// sweep the ones that are not part of this display\n\tmapper_hide_stale();\n}", "renderMarkers(map, maps, lat, long) {\n let marker = new maps.Marker({\n position: {lat: lat, lng: long},\n map,\n title: this.props.name\n });\n }", "function addMkrs(locations, map) {\n var mkr, index;\n for(index = 0; index < locations.length; ++index) {\n mkr = new google.maps.Marker({\n position: locations[index],\n map: map\n });\n }\n}", "function addMkrs(locations, map) {\n var mkr, index;\n for(index = 0; index < locations.length; ++index) {\n mkr = new google.maps.Marker({\n position: locations[index],\n map: map\n });\n }\n}", "function setMarkers(map) {\n for (var i = 0; i < cities.length; i++) {\n var city = cities[i];\n var marker = new google.maps.Marker({\n position: { lat: city[1], lng: city[2] },\n map: map,\n title: city[0],\n zIndex: city[3]\n });\n }\n }", "function initMap() {\n //center the map\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 11,\n center: {lat: 39.98, lng: -83.0}\n });\n\n for (var i = 0; i < l; i++) {\n markerM[i] = new google.maps.Marker({\n position: {lat: safeCenters[i].lat, lng: safeCenters[i].lng},\n title: safeCenters[i].name,\n animation: google.maps.Animation.DROP,\n map: map\n });\n attachContent(markerM[i], contentString(i));\n }\n }", "function createMarkers() {\n // Creates marker cluster group to aggregate markers neatly when map user zooms out\n var markerClusters = L.markerClusterGroup();\n\n // Loops through data arrays\n for (var i = 0; i < 11; i++) {\n // Declares string variable to hold icon URLs\n var iconURL = \"\";\n // Extracts attributes needed to define markers\n var lat = coordinates[i][1];\n var lon = coordinates[i][0];\n var type = types[i];\n var name = names[i];\n var photo = photos[i];\n var url = urls[i];\n // Calls getIcon() to select icon based on pet type\n iconURL = getIcon(type);\n // Creates pawIcon object\n var pawIcon = L.icon({\n iconUrl: iconURL,\n iconSize: [60, 50]\n });\n\n // Adds a new marker to the cluster group and binds a pop-up\n markerClusters.addLayer(L.marker([lat, lon], { icon: pawIcon })\n .bindPopup(`<img src=${photo} width=\"300\" height=\"250\"<br><br><br><center><strong><a style=\"font-size: 20px\" href=${url} target=\"_blank\">Meet ${name}</a></strong></center>`));\n } // close for loop\n\n // Calls createMap function, passing in the marker layer group.\n createMap(markerClusters);\n }", "function handleMapMarkers(parks){\n parks.forEach(park => {\n let marker = new google.maps.Marker({\n map: map,\n draggable: true,\n animation: google.maps.Animation.Drop,\n position: { lat: parseFloat(park.latitude), lng: parseFloat(park.longitude) }, // parseFloat as json lat/long are stored as strings\n title: park.name,\n label: park.name\n });\n \n })\n}", "function initMap() {\n\n // Create a map object\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 30.741482, lng: 76.768066},\n zoom: 13\n });\n // Create colors for the markers\n defaultIcon = makeMarkerIcon(\"0091ff\");\n highlightedIcon = makeMarkerIcon(\"FFFF24\");\n\n // Populate the Markers array\n for (var i = 0; i < initialList.length; i++) {\n var place = initialList[i].place;\n var position = {lat: initialList[i].lat, lng: initialList[i].lng};\n var category = initialList[i].category;\n var id = initialList[i].id;\n var marker = new google.maps.Marker({\n map: map,\n position: position,\n title: place,\n id: id,\n icon: defaultIcon,\n category: category,\n animation: google.maps.Animation.DROP\n });\n markers.push(marker);\n };\n // Get information about the markers from Forequare API.\n tempMarkers = tempMarkers.concat(markers);\n getMarkersData();\n}", "function createMarkers() {\n // Create an normal icon\n const normalIcon = makeMarkerIcon('ff0000');\n // Create an selected icon, when clicked or hover over it\n const selectedIcon = makeMarkerIcon('00ff00');\n // Create an Info Window\n const markerInfoWindow = new google.maps.InfoWindow();\n // Create all markers from initialPlaces array\n initialPlaces.forEach(function(place, index){\n const marker = new google.maps.Marker({\n position: place.coordinates,\n title: place.name,\n animation: google.maps.Animation.DROP,\n icon: normalIcon,\n id: index\n });\n // Push this marker to the array of markers.\n markers.push(marker);\n // Bounce the marker once and open an info window when click on a specific marker.\n marker.addListener('click', function(){\n bounceMarker(this);\n createInfoWindow(this, markerInfoWindow);\n });\n // Bounce the marker once and open an info window when click the item in the list that corresponds to a marker.\n document.getElementsByTagName(\"li\")[index].addEventListener('click', function(){\n // When select the marker from the list center map Window\n //on the marker.\n map.setCenter(marker.getPosition());\n bounceMarker(marker);\n createInfoWindow(marker, markerInfoWindow);\n });\n // When hover over an marker change it to selectedIcon.\n marker.addListener('mouseover', function(){\n this.setIcon(selectedIcon);\n });\n // When leave out the mouse over an marker change it to normalIcon.\n marker.addListener('mouseout', function(){\n this.setIcon(normalIcon);\n });\n });\n}", "function _createMarker() {\n this.mapMarker = {\n image: new Surface({\n classes: this.options.classes.concat(['marker', 'image']),\n properties: {\n backgroundSize: 'contain'\n }\n }),\n mod: new MapModifier({\n mapView: this.mapView,\n position: this.options.mapView.mapOptions.center\n }),\n lc: new LayoutController({\n layout: function(context, size) {\n var marker = this.options.marker;\n var backSize = [marker.size[0], marker.size[1] - marker.pinSize[1]];\n var top = -marker.size[1];\n context.set('back', {\n size: backSize,\n translate: [backSize[0] / -2, top, 1]\n });\n var imageSize = [this.options.marker.size[0] - (this.options.marker.borderWidth * 2), this.options.marker.size[0] - (this.options.marker.borderWidth * 2)];\n context.set('image', {\n size: imageSize,\n translate: [imageSize[0] / -2, top + ((backSize[1] - imageSize[1]) / 2), 2]\n });\n context.set('pin', {\n size: marker.pinSize,\n translate: [marker.pinSize[0] / -2, top + backSize[1], 1]\n });\n }.bind(this),\n dataSource: {\n back: new Surface({\n classes: this.options.classes.concat(['marker', 'back'])\n }),\n pin: new Surface({\n classes: this.options.classes.concat(['marker', 'pin']),\n content: '<div></div>'\n })\n }\n })\n };\n this.add(this.mapMarker.mod).add(this.mapMarker.lc);\n this.mapMarker.lc.insert('image', this.mapMarker.image);\n}", "createMapMarkers() {\n if (!this.props.all) {\n return null;\n }\n const GoogleMapMarkers = this.props.all.map(marker => {\n return (\n <Marker\n key={`marker_${marker.id}`}\n lat={marker.lat}\n lng={marker.lng}\n marker={marker}\n />\n );\n });\n return GoogleMapMarkers;\n }", "function setMarkers(map) {\n\n // defines the clickable region of the icon\n // no real use yet\n // var shape = {\n // coords: [1, 1, 1, 20, 18, 20, 18, 1],\n // type: 'poly'\n // };\n\n for (var i=0; i<pins.length; i++) {\n // object (one pin)\n var pin = pins[i];\n\n var status = pin.fields.status;\n\n if (status === 'Barrier')\n var url = '/static/img/map-marker-barrier.png';\n else if (status === 'In Progress')\n var url = '/static/img/map-marker-in-progress.png';\n else if (status === 'Resolved')\n var url = '/static/img/map-marker-resolved.png';\n else if (status === 'Best Practice')\n var url = '/static/img/map-marker-best-practice.png';\n else\n var url = '/static/img/map-marker.png';\n\n var image = {\n url: url\n // size: new google.maps.Size(20, 32),\n // origin: new google.maps.Point(0, 0),\n // anchor: new google.maps.Point(0, 32)\n };\n\n if (pin.fields.address != null)\n var address = pin.fields.address;\n else\n var address = '';\n\n if (pin.fields.date_updated != null)\n var date = pin.fields.date_updated;\n else\n var date = '';\n\n // data of a detailed window\n var contentString = '<div id=\"content\" style=\"color: black\">'+\n '<div id=\"siteNotice\">'+\n '</div>'+\n '<h1 id=\"firstHeading\" class=\"firstHeading\">' + pin.fields.tag + '</h1>'+\n '<div id=\"bodyContent\">'+\n '<div><b>Status: </b>'+ status +'</div>'+\n '<div><b>Description: </b>'+ pin.fields.description +'</div>'+\n '<div><b>Address: </b>'+ address +'</div>'+\n '<div><b>Date created: </b>'+ pin.fields.date_created.slice(0,10) + \" \" + pin.fields.date_created.slice(11,19) +'</div>'+\n '<div><b>Date updated: </b>'+ date.slice(0,10) + \" \" + date.slice(11,19) +'</div>'+\n '<div><a href=\"/pins/' + (i+1) + '\">See more</a>' +\n '</div>'+\n '</div>';\n\n var infowindow = new google.maps.InfoWindow({\n content: contentString,\n maxWidth: 450\n });\n\n // creating the marker\n var marker = new google.maps.Marker({\n position: {\n lat: pin.fields.location_latitude, \n lng: pin.fields.location_longitude\n },\n map: map,\n icon: image,\n infowindow: infowindow,\n // shape: shape,\n // title: pin[0],\n zIndex: i // determines which pin is on top if they overlap\n });\n\n // listener for clicking on a pin\n marker.addListener('click', function() {\n this.infowindow.open(map, this);\n });\n\n\n }\n}", "function makeMarkers(arr) {\n $scope.markers = [];\n var ret = arr.map(function(e) {\n return $scope.markers.push({\n id: $scope.markers.length,\n coords: {\n latitude: e.lat,\n longitude: e.lng,\n },\n options: {\n label: e.name,\n title: e.name,\n MarkerLabel: {\n // text: 'Test text'\n }\n }\n // title: e.name\n });\n });\n return $scope.markers;\n }", "function initMap(){\n let places = {\n newDelhi: {lat:28.38, lng:77.12},\n newjersey: {lat:39.833851,lng:-74.871826},\n chicago: {lat:41.881832,lng: -87.623177}\n };\n\n let map = new google.maps.Map(document.getElementById('map'), {\n zoom: 4,\n center: places.chicago\n });\n\n\n let marker1 = new google.maps.Marker({\n position: places.newDelhi,\n map: map\n });\n let marker2 = new google.maps.Marker({\n position: places.chicago,\n map: map\n });\n let marker3 = new google.maps.Marker({\n position: places.newjersey,\n map: map\n });\n\n}", "function setMarkersMap(markers, map)\n{\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(map);\n }\n}", "createMarkers(array) {\r\n this._createMarkers(array);\r\n }", "function createMarkers(places, map) {\n\n var bounds = new google.maps.LatLngBounds();\n\n for (var i = 0, place; place = places[i]; i++) {\n var image = {\n url: place.icon,\n size: new google.maps.Size(71, 71),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(17, 34),\n scaledSize: new google.maps.Size(25, 25)\n };\n\n var marker = new google.maps.Marker({\n map: map,\n icon: image,\n title: place.name,\n position: place.geometry.location\n });\n bounds.extend(place.geometry.location);\n }\n //reposition map\n map.fitBounds(bounds);\n }", "function showMarkers() {\n setAllMap(map);\n}", "function setMarkersOnMap(map) {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(map);\n }\n // console.log(markers[0]);\n}", "function showMarkers() {\n setAllMap(map);\n}", "function showMarkers() {\n setAllMap(map);\n}", "function showMarkers() {\n setAllMap(map);\n}", "function showMarkers() {\n setAllMap(map);\n }", "function demoMap() {\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 14,\n center: {lat: 40.10908, lng: -88.22101},\n\n });\n setMarkers(map);\n}", "function showMarkers() {\n\n setAllMap(map);\n\n}", "function markerTest() {\n $.getJSON(\"http://localhost:9000\" + \"/getTowers\", function (marker){\n $.each(marker,function(i, mark) {\n\n\n var iconBase = 'https://maps.google.com/mapfiles/kml/shapes/';\n var addmark = new google.maps.Marker({\n position: loadpos = {\n lat: mark.latCoordDD,\n lng: mark.longCoordDD\n },\n map: map,\n icon: iconBase + 'schools_maps.png'})\n addmark.setPosition(loadpos);\n })\n})}", "function initMap() {\r\n // Setting the location\r\n var home = {lat: 51.606801, lng: -0.557771};\r\n\r\n // Initializing map and options\r\n var map = new google.maps.Map(document.getElementById('map'), {\r\n zoom: 8,\r\n center: home\r\n });\r\n\r\n var featureOpts = [\r\n {\r\n stylers: [\r\n { hue: '#23F68C' },\r\n { gamma: 0.3 },\r\n { weight: 0.5 }\r\n ]\r\n },\r\n {\r\n elementType: 'labels',\r\n stylers: [\r\n { visibility: 'on' }\r\n ]\r\n },\r\n {\r\n elementType: 'labels.text.fill',\r\n stylers: [\r\n { color: '#f6238d' }\r\n ]\r\n },\r\n {\r\n featureType: 'water',\r\n stylers: [\r\n { color: '#f6238d' }\r\n ]\r\n }\r\n ];\r\n\r\n map.setOptions({\r\n styles: featureOpts\r\n })\r\n\r\n\r\n // Creating the marker object\r\n var marker = new google.maps.Marker({\r\n position: home,\r\n map: map\r\n });\r\n}", "function createMarkers(fetchedData, map, imageName, id, file) {\n const img = new Image(50, 50);\n img.onerror = console.error;\n img.src = file;\n img.onload = () =>\n map.addImage(imageName, img, { pixelRatio: window.devicePixelRatio });\n\n if (!map.getLayer(id)) {\n map.addLayer({\n id: id,\n type: \"symbol\",\n source: {\n type: \"geojson\",\n data: {\n type: \"FeatureCollection\",\n features: fetchedData,\n },\n },\n layout: {\n \"icon-image\": imageName,\n \"icon-size\": 1,\n \"icon-allow-overlap\": true,\n },\n });\n }\n}", "function markPlaces(name, rating, latitude, longitude, inDesLat, inDesLong, iconPix) {\n const options = {\n zoom: 11,\n center: {lat:parseFloat(inDesLat[0]),lng:parseFloat(inDesLong[0])},\n }\n let map = new google.maps.Map(document.getElementById('map'), options);\n //Places a marker on each location\n for (let i = 0; i <= latitude.length; i++) {\n let marker = new google.maps.Marker({\n position:{lat: parseFloat(latitude[i]), lng: parseFloat(longitude[i])},\n map: map,\n icon: {\n url: iconPix,\n optimized: false}\n });\n\n let headName = `<h2>${name[i]}</h2>`;\n let url = headName.link(`https://www.google.com/search?q=${name[i]}&aqs=chrome.0.0l4.25261j0j8&sourceid=chrome&ie=UTF-8/`);\n\n let infoWindow = new google.maps.InfoWindow({\n content: url+ `<h2>Rating: ${rating[i]}</h2>`+'<h4>*If the rating is 0, it may mean that there is no rating for this location</h4>'\n });\n\n marker.addListener('click', function(){\n infoWindow.open(map, marker);\n });\n \n }\n}", "function markPlaces(name, rating, latitude, longitude, inDesLat, inDesLong, iconPix) {\n const options = {\n zoom: 11,\n center: {lat:parseFloat(inDesLat[0]),lng:parseFloat(inDesLong[0])},\n }\n let map = new google.maps.Map(document.getElementById('map'), options);\n //Places a marker on each location\n for (let i = 0; i <= latitude.length; i++) {\n let marker = new google.maps.Marker({\n position:{lat: parseFloat(latitude[i]), lng: parseFloat(longitude[i])},\n map: map,\n icon: {\n url: iconPix,\n optimized: false}\n });\n\n let headName = `<h2>${name[i]}</h2>`;\n let url = headName.link(`https://www.google.com/search?q=${name[i]}&aqs=chrome.0.0l4.25261j0j8&sourceid=chrome&ie=UTF-8/`);\n\n let infoWindow = new google.maps.InfoWindow({\n content: url+ `<h2>Rating: ${rating[i]}</h2>`+'<h4>*If the rating is 0, it may mean that there is no rating for this location</h4>'\n });\n\n marker.addListener('click', function(){\n infoWindow.open(map, marker);\n });\n \n }\n}", "function createMap()\n{\n\t mymap = L.map('mapid').setView([-43.48898, 172.54045], 13);\n\n\tL.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpandmbXliNDBjZWd2M2x6bDk3c2ZtOTkifQ._QA7i5Mpkd_m30IGElHziw', {\n\t\tmaxZoom: 18,\n\t\tattribution: 'Map data &copy; <a href=\"http://openstreetmap.org\">OpenStreetMap</a> contributors, ' +\n\t\t\t'<a href=\"http://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, ' +\n\t\t\t'Imagery © <a href=\"http://mapbox.com\">Mapbox</a>',\n\t\tid: 'mapbox.streets'\n\t}).addTo(mymap);\n\n\tg_layer_searchedMarks = L.layerGroup();\n g_layer_searchedMarks.addTo(mymap);\n \n\tg_layer_exploreMarks = L.layerGroup();\n g_layer_exploreMarks.addTo(mymap);\n \n\tg_layer_recommendedMarks = L.layerGroup();\n g_layer_recommendedMarks.addTo(mymap);\n \n \n\tg_layer_journalMarks = L.layerGroup();\n g_layer_journalMarks.addTo(mymap);\n \n g_layer_journalPath = L.polyline([], {\n \tcolor: 'blue',\n \tweight: 3,\n \topacity: 0.5,\n \tsmoothFactor: 1\n });\n g_layer_journalPath.addTo(mymap);\n}", "function initMap() {\n\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 10,\n center: {lat: 41.7072608, lng: 45.0963375},\n scrollwheel: false\n });\n\n setMarkers(map);\n}", "function initMap(data, mapNum) {\n\n let center = centerOfMap(data, mapNum);\n\n const map = new google.maps.Map(document.getElementById('map'), {\n zoom: 11,\n center: center\n });\n\n for (let point of data) {\n if(point.map_id == mapNum) {\n let tempPosition = {lat: point.latitude, lng: point.longitude};\n marker = new google.maps.Marker({\n position: tempPosition,\n map: map\n });\n }\n }\n\n}", "SetMarkers(allData) {\n allData.forEach((item) => {\n this.MAPMarker.SetMapMarker(item.marker, this.DrawnMap);\n });\n }", "function initMap() {\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 13,\n center: {lat: 36.1212, lng: -115.1697}\n });\n setMarkers(map);\n}", "function setMarkers(map, locations) {\n var markers = [];\n var image = new google.maps.MarkerImage('/img/map-marker.png', null, null, null, new google.maps.Size(28,42));\n for (var i = 0; i < locations.length; i++) {\n var point = locations[i];\n var myLatlng = new google.maps.LatLng(point[0], point[1]);\n var marker = new google.maps.Marker({\n position : myLatlng,\n map : map,\n icon : image,\n title : point[3].head,\n zIndex : point[2]\n });\n marker.infoContent = point[3];\n markers.push(marker);\n }\n return markers;\n }", "function addMarkersAndSetViewBounds() {\n const group = new H.map.Group();\n map.addObject(group);\n\n const reports = []\n let bubbles = [];\n\n group.addEventListener('tap', function (evt) {\n // event target is the marker itself, group is a parent event target\n // for all objects that it contains\n\n evt.stopPropagation();\n\n bubbles.forEach((bubble) => {\n ui.removeBubble(bubble)\n });\n\n var bubble = new H.ui.InfoBubble(evt.target.getPosition(), {\n // read custom data\n content: evt.target.getData()\n });\n\n bubbles.push(bubble);\n\n // show info bubble\n setTimeout(function(){ ui.addBubble(bubble); }, 10);\n\n }, false);\n const markerSize = pixelRatio !== 1 ? {size: {w: 75, h: 75}} : {size: {w: 32, h: 32}}\n //change marker colour based on condition\n const iconPhysical = new H.map.Icon('https://res.cloudinary.com/khaotyl/image/upload/v1560161914/icons8-marker-32_gbpv0n.png', markerSize);\n const iconVerbal = new H.map.Icon('https://res.cloudinary.com/khaotyl/image/upload/v1560163227/icons8-marker-32_3_tvjayi.png', markerSize);\n const iconFeeling = new H.map.Icon('https://res.cloudinary.com/khaotyl/image/upload/v1560161914/icons8-marker-32_2_ggypsx.png', markerSize);\n\n actualMarkers.forEach((marker) => {\n if (marker.type == \"Physical\") {\n var markerObject = new H.map.Marker({lat:marker.lat, lng:marker.lng}, {icon: iconPhysical})\n } else if(marker.type == \"Verbal\") {\n var markerObject = new H.map.Marker({lat:marker.lat, lng:marker.lng}, {icon: iconVerbal})\n } else {\n var markerObject = new H.map.Marker({lat:marker.lat, lng:marker.lng}, {icon: iconFeeling})\n }\n\n // markerObject.setData('div');\n markerObject.setData(marker.infoWindow);\n reports.push(markerObject);\n });\n\n group.addObjects(reports);\n // get geo bounding box for the group and set it to the map\n map.setViewBounds(group.getBounds());\n\n\n }", "function addMarkers( count ) {\n var bounds = mapstraction.getBounds();\n var sw = bounds.getSouthWest();\n var ne = bounds.getNorthEast();\n while ( count-- ) {\n var ll = new mxn.LatLonPoint( sw.lat + ( ( ne.lat - sw.lat ) * Math.random() ), sw.lon + ( ( ne.lon - sw.lon ) * Math.random() ) );\n var marker = new mxn.Marker(ll);\n\n var number = Math.round( 86400000 * Math.random() );\n var d = new Date();\n d.setTime( d.getTime() - (86400000/2) + number);\n var h = d.getHours(); if (h < 10) { h = \"0\" + h; }\n var m = d.getMinutes(); if (m < 10) { m = \"0\" + m; }\n\n var el = document.createElement('h1');\n el.appendChild( document.createTextNode(h + ':' + m));\n\n marker.setInfoBubble(el);\n marker.setAttribute( 'date', d );\n mapstraction.addMarker( marker );\n }\n}", "function initMap(cordinates) {\n console.log(\"initmar\", cordinates);\n var location = cordinates[0];\n var map = new google.maps.Map(\n document.getElementById('map'), { zoom: 12, center: location });\n\n for (var i = 0; i < cordinates.length; i++) {\n\n var marker = new google.maps.Marker({ position: cordinates[i], map: map });\n }\n }", "function createMarkers(issues) {\n for(var i=0; i<issues.length; i++){\n mapCtrl.markers.push({\n lat: issues[i].location.coordinates[1],\n lng: issues[i].location.coordinates[0],\n issue: issues[i]\n });\n }\n }", "function createMarker( location_in, index_in ) {\n var mark = new google.maps.Marker( { position: location_in, map: map } );\n marker[ index_in ] = mark;\n }", "function addMapMarkers(poisToAdd) {\n _.each(poisToAdd, function(poi) {\n // We use a base64 encoded id as the marker id, since Angular Leaflet does not accept '-' in marker's id.\n bigMap.config.markers[btoa(poi.properties.id)] = {\n layer: 'markers',\n lat : poi.geometry.coordinates[1],\n lng : poi.geometry.coordinates[0],\n icon : MapIcons.get(poi.properties.theme)\n };\n })\n }", "function showMarkers() {\n\t\t\t \n\t\t\t setAllMap(map);\n\t\t\t\n\t\t\t}", "function initMarkers() {\n\t\tvar markers = new OpenLayers.Layer.Markers(\"Marcadores de gasolineras\");\n\t\topenMap.addLayer(markers);\n\t\t// Aprovechamos para calcular los objetos lonlat\n\t\tgasoleProcess(theGasole.info, function(s) {\n\t\t\tif (s.g) s.ll = reprojectLatLon(s.g);\t// LonLat en metros\n\t\t})\n\t\topenMap.events.register(\"zoomend\", markers, drawMarkers);\n openMap.events.register(\"moveend\", markers, drawMarkers);\n\t\treturn markers;\n\t}", "function initMap() {\n // The location of Uluru\n var bm = {lat: 41.086065, lng: 29.043930};\n var nh = {lat: 41.086613, lng: 29.045489};\n // The map, centered at Uluru\n var map = new google.maps.Map(\n document.getElementById('map'), {zoom: 14, center: bm});\n // The marker, positioned at Uluru\n var bm_marker = new google.maps.Marker({position: bm, map: map, label: 'BM', title: 'BM Buillding B (-2th) floor (for workshops)'});\n var nh_marker = new google.maps.Marker({position: nh, map: map, label: 'NH', title: 'New Hall 105'});\n }", "function initMap() {\n var centerTarget = {lat: Number(item.mapY) ,lng: Number(item.mapX)};\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 12,\n center: centerTarget\n });\n\n new google.maps.Marker({\n position: centerTarget,\n map: map,\n icon: '/APIcamp/img/marker.png'\n });\n }", "function setMapOnAll(map) {\r\n for (var i = 0; i < MAP_MARKERS.length; i++) {\r\n MAP_MARKERS[i].setMap(map);\r\n }\r\n}", "function showMarkers() {\n\t setAllMap(map);\n\t}", "function showMarkers() {\n\t setAllMap(map);\n\t}", "function addMarker(coordinates, map){\n //Create marker and render it on map\n var marker = new google.maps.Marker({\n position: coordinates,\n map: map,\n icon: \"http://\" + window.location.host+\"/static/img/mapIcons/marker/black\" +\n ($scope.wayPoints.length + 1) + \".png\"\n });\n\n //Add marker on list\n $scope.mapMarkers.push(marker);\n }", "function initMap() {\n\n // Constructor creates a new map - only center and zoom are required.\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 37.386052, lng: -122.083851},\n zoom: 15\n });\n let defaultIcon = makeMarkerIcon('0091ff');\n\n let largeInfowindow = new google.maps.InfoWindow();\n currentInfoWindow = largeInfowindow;\n // The following group uses the location array to create an array of markers on initialize.\n for (let i = 0; i < places.length; i++) {\n // Get the position from the location array.\n let position = places[i].location;\n let title = places[i].name;\n // Create a marker per location, and put into markers array.\n let marker = new google.maps.Marker({\n position: position,\n title: title,\n animation: google.maps.Animation.DROP,\n icon: defaultIcon,\n id: i\n });\n // Push the marker to array of markers.\n marker.setMap(map);\n markers.push(marker);\n // Create an onclick event to open the large infowindow at each marker.\n marker.addListener('click', function() {\n\n if (currentMarker){\n currentMarker.setAnimation(null);\n }\n currentMarker = this;\n getYelpData();\n });\n }\n}", "function showMarkers(map) {\n setAllMap(map);\n}", "function place_markers_on_map(map, places) {\n map_ll_bounds = map.getBounds();\n var sw_lat = map_ll_bounds.getSouthWest().lat();\n var sw_lng = map_ll_bounds.getSouthWest().lng();\n var ne_lat = map_ll_bounds.getNorthEast().lat();\n var ne_lng = map_ll_bounds.getNorthEast().lng();\n // console.log(\"this: \" + this);\n // console.log(\"map ll bounds: \" + map_ll_bounds.toString());\n //\tconsole.log(\"i place position: \" + i + \" \" + places[i].name + \" \" + places[i].\n for (var i = 0; i < places.length; i++) {\n var side_marker_position = // new google.maps.LatLng(0.95*sw_lat + 0.05*ne_lat, sw_lng + (i+0.5)*(ne_lng-sw_lng)/(places.length-1));\n new google.maps.LatLng(ne_lat + (i + 2) * (sw_lat - ne_lat) / (places.length + 3), 0.9 * sw_lng + 0.1 * ne_lng);\n\n var the_place_position = places[i].marker_position.latlng;\n // control directin of animation with the following two positions:\n var init_marker_position = side_marker_position;\n var dest_marker_position = the_place_position;\n var the_marker = new MarkerWithLabel({\n position: init_marker_position,\n draggable: true,\n raiseOnDrag: false,\n map: map,\n // labelAnchor: new google.maps.Point(40, -9),\n labelContent: places[i].name,\n // labelAnchor: new google.maps.Point(50, -10),\n labelAnchor: new google.maps.Point(72, 9),\n labelClass: \"labels\",\n // the CSS class for the label\n labelStyle: {\n opacity: 1,\n fontSize: 20\n },\n icon: spot,\n placed: false,\n // true after the marker has been correctly placed.\n side_position: side_marker_position,\n place_position: the_place_position,\n starting_position: init_marker_position,\n destination_position: dest_marker_position,\n });\n google.maps.event.addListener(the_marker, 'mouseup', function() {\n console.log(\"marker mouseup: \" + this.labelContent + \". Position: \" + this.position);\n });\n google.maps.event.addListener(the_marker, 'click', function() {\n console.log(\"marker click: \" + this.labelContent + \". Position: \" + this.position);\n animateMarker(this);\n });\n }\n}", "function init () {\n myMap = new ymaps.Map(\"map\", {\n center: [55.76, 37.64], // Сoordinate center of map\n zoom: 16 // Map zoom\n });\n marker = new ymaps.Placemark([55.76, 37.64], {\n hintContent: 'Расположение', // text when cursor on marker\n balloonContent: 'Вход за поворотом' // text when click on marker\n });\n myMap.geoObjects.add(marker);\n }", "function showMarkers() {\n setMapOnAll(map);\n \n }", "function updateMarkers() {}", "function initMarkers() {\n\tmodel.museumsData.forEach(function(museum, id) {\n \tvar position = museum.location;\n \tvar title = museum.name;\n \tvar favStatus = viewModel.getMuseum(id).fav();\n \tvar icon, icons;\n\n \tif (storageAvailable && favStatus) {\n \t\ticon = markerIcons.fav.def;\n \t\ticons = markerIcons.fav;\n \t} else {\n \t\ticon = markerIcons.def.def;\n \t\ticons = markerIcons.def;\n \t}\n\n \tvar marker = new google.maps.Marker({\n \tposition: position,\n \ttitle: title,\n \tanimation: google.maps.Animation.DROP,\n \t// storing index is useful for identifying individually passed\n \t// marker objects and their corresponding Museum objects\n \tid: id,\n \ticon: icon,\n \t// used to update and revert icon appearance when `selectMarker`\n \t// and `deselectMarker` are called\n \ticons: icons\n \t});\n\n \t// set marker click functionality\n \tmarker.addListener('click', function() {\n \tselectMarker(this);\n \t});\n\n \t// add marker to `markers`\n \tmarkers.push(marker);\n\t});\n\n\t// for adjusting viewport to contain all visible markers\n\tbounds = new google.maps.LatLngBounds();\n\n markers.forEach(function(marker) {\n \t// add marker to map (make visible)\n\t\tmarker.setMap(map);\n\t\tbounds.extend(marker.position);\n\t});\n\n\t// adjust viewport bounds\n\tmap.fitBounds(bounds);\n}", "function createMapMarker (name, lat, lng) {\n var bounds = window.mapBounds;\n var marker = new google.maps.Marker({\n position: {lat: lat, lng: lng},\n title: name,\n visible: true,\n map: map\n });\n infowindow = new google.maps.InfoWindow({\n content: infoWindowContentString\n });\n // if infowindow is closed animation is stopped\n google.maps.event.addListener(infowindow, 'closeclick', function() {\n for (var mm = 0; mm < allMyMarkers.length; mm++) {\n // remove animation from marker\n allMyMarkers[mm].marker.setAnimation(null);\n }\n map.fitBounds(window.mapBounds);\n });\n\n bounds.extend(new google.maps.LatLng(lat, lng));\n map.fitBounds(bounds);\n map.setCenter(bounds.getCenter());\n // listen to click on marker\n google.maps.event.addListener(marker, 'click', function() {\n for (var mm = 0; mm < allMyMarkers.length; mm++) {\n // remove animation and info window from other animated marker\n allMyMarkers[mm].marker.setAnimation(null);\n allMyMarkers[mm].infowindow.close();\n }\n // place animated marker in the center of the map\n map.setCenter(marker.getPosition());\n // open infowindow for clicked marker\n infowindow.open(map, marker);\n if (marker.getAnimation() !== null) {\n marker.setAnimation(null);\n } else {\n // get Wikipedia info for clicked marker\n getWikipediaInfo(marker.title);\n // animate clicked marker\n marker.setAnimation(google.maps.Animation.BOUNCE);\n }\n });\n return {marker: marker, infowindow: infowindow};\n }", "function renderMarkers (data,map) {\n let image = {\n url: 'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png',\n // This marker is 20 pixels wide by 32 pixels high.\n size: new google.maps.Size(20, 32),\n // The origin for this image is (0, 0).\n origin: new google.maps.Point(0, 0),\n // The anchor for this image is the base of the flagpole at (0, 32).\n anchor: new google.maps.Point(0, 32)\n };\n let shape = {\n coords: [1, 1, 1, 20, 18, 20, 18, 1],\n type: 'poly'\n };\n marker = new google.maps.Marker({\n position: new google.maps.LatLng(`${data.restaurant.location.latitude}`,`${data.restaurant.location.longitude}`),\n map: map,\n icon: image,\n shape: shape,\n title: `${data.restaurant.name}`\n });\n console.log(marker);\n infoBox(data,marker,map);\n return marker;\n}", "function placeMarkers(lat, lng) {\n let customMarker1 = new google.maps.LatLng(lat - 0.00015, lng + 0.0015)\n let customMarker2 = new google.maps.LatLng(lat + 0.00010, lng - 0.0010)\n let customMarker3 = new google.maps.LatLng(lat + 0.00028, lng + 0.0019)\n let customMarker4 = new google.maps.LatLng(lat - 0.00019, lng - 0.0010)\n let customMarker5 = new google.maps.LatLng(lat - 0.00015, lng + 0.0030)\n\n let marker1 = new google.maps.Marker({\n position: customMarker1,\n title: \"Cheap Here\",\n animation: google.maps.Animation.DROP,\n icon: \"images/cheap.png\",\n map: map,\n venueInfo: {\n venueName: \"Bacchus Bar Restaurant And Pool\",\n venueImage: \"images/places/bacchus.JPG\",\n venueDescription: \"This place is so cheap!! Buy one and get one free SPIRIT!\",\n venueLocation: \"Podium Level, Rydges South Bank, Grey & Glenelg Sts., South Brisbane QLD 4101\",\n drinkPrice: \"Am4zing\"\n }\n })\n\n let marker2 = new google.maps.Marker({\n position: customMarker2,\n title: \"Quiet Place\",\n animation: google.maps.Animation.DROP,\n icon: \"images/not-busy.png\",\n map: map,\n venueInfo: {\n venueName: \"Cloudland\",\n venueImage: \"images/places/cloudland.jpg\",\n venueDescription: \"Only few people here! Very quiet and relaxed\",\n venueLocation: \"641 Ann St, Fortitude Valley QLD 4006\"\n }\n })\n\n let marker3 = new google.maps.Marker({\n position: customMarker3,\n title: \"Expensive Here\",\n animation: google.maps.Animation.DROP,\n icon: \"images/expensive.png\",\n map: map,\n venueInfo: {\n venueName: \"The Fringe Bar\",\n venueImage: \"images/places/fringebar.jpg\",\n venueDescription: \"This place totally rips you off!! Don't pay 15 bucks for a beer!\",\n venueLocation: \"Ann St & Constance Street, Fortitude Valley QLD 4006\",\n drinkPrice: \"This 15 ridiculous\"\n }\n })\n\n let marker4 = new google.maps.Marker({\n position: customMarker4,\n title: \"Too Crowded\",\n animation: google.maps.Animation.DROP,\n icon: \"images/group.png\",\n map: map,\n venueInfo: {\n venueName: \"Jade Buddha\",\n venueImage: \"images/places/jadeBuddha.jpg\",\n venueDescription: \"Packed with people here, if you wanna experience a human hamburger I definitely recommend you to come here :)\",\n venueLocation: \"14/1 Eagle St, Brisbane City QLD 4000\"\n }\n })\n\n let marker5 = new google.maps.Marker({\n position: customMarker5,\n title: \"Happy Hour\",\n animation: google.maps.Animation.DROP,\n icon: \"images/happy-hour.png\",\n map: map,\n venueInfo: {\n venueName: \"Mick O'Malley's Irish Pub\",\n venueImage: \"images/places/mick-omalleys.jpg\",\n venueDescription: \"Happy Hour from 3 - 4pm! Everything so cheap!\",\n venueLocation: \"171-209 Queen St, Brisbane City QLD 4000\",\n drinkPrice: \"ch3ap\"\n }\n })\n\n //Click listeners for the markers\n marker1.addListener('click', showEventPost)\n marker2.addListener('click', showEventPost)\n marker3.addListener('click', showEventPost)\n marker4.addListener('click', showEventPost)\n marker5.addListener('click', showEventPost)\n}", "function placeMarker(latLng, map) {\n let marker = new google.maps.Marker({\n position: latLng,\n label: labels[labelIndex++ % labels.length],\n map: map\n });\n markers.push(marker);\n }", "function setMarkers(map) {\n\n var image = {\n url: 'images/flag.png',\n /* This marker is 20 pixels wide by 32 pixels high. */\n size: new google.maps.Size(20, 32),\n /* The origin for this image is (0, 0). */\n origin: new google.maps.Point(0, 0),\n /* The anchor for this image is the base of the flagpole at (0, 32). */\n anchor: new google.maps.Point(0, 32)\n };\n /* Shapes define the clickable region of the icon. The type defines an HTML\n <area> element 'poly' which traces out a polygon as a series of X,Y points.\n The final coordinate closes the poly by connecting to the first coordinate. */\n var shape = {\n coords: [1, 1, 1, 20, 18, 20, 18, 1],\n type: 'poly'\n };\n for (var i = 0; i < localListing[selectedCity][selectedCategory].length; i++) {\n var localList = localListing[selectedCity][selectedCategory][i];\n\n /* Add the circle for this city to the map. */\n var cityCircle = new google.maps.Circle({\n strokeColor: '#00FF00',\n strokeOpacity: 0.2,\n strokeWeight: 2,\n fillColor: '#0000FF',\n fillOpacity: 0.1,\n map: map,\n center: citymap[selectedCity].center,\n radius: Math.sqrt(citymap[selectedCity].population) * 7\n });\n\n cityCircles.push(cityCircle);\n\n /* InfoWindow content */\n var content = '<div id=\"iw-container\">' +\n '<div class=\"iw-title\">' + localList[0] + '</div>' +\n '<div class=\"iw-content\">' +\n '<div class=\"iw-subTitle\">Details</div>' +\n '<img src=\"images/listing_image.jpg\" alt=\"'+localList[0]+'\" height=\"115\">' +\n '<p>' + localList[3] + '</p>' +\n '<div class=\"iw-subTitle\">Contacts</div>' +\n '<p>' + selectedCity + '<br>' +\n '<br>Phone. +91 1800 320 600<br>e-mail: [email protected]<br></p>' +\n '</div>' +\n '<div class=\"iw-bottom-gradient\"></div>' +\n '</div>';\n\n\n infowindow = new google.maps.InfoWindow({\n content: content,\n maxWidth: 350\n });\n var marker = new google.maps.Marker({\n position: {\n lat: localList[1],\n lng: localList[2]\n },\n map: map,\n icon: image,\n shape: shape,\n title: localList[0],\n zIndex: localList[4]\n });\n\n infoWindows.push(infowindow)\n markers.push(marker);\n (function(infowindow, marker) {\n marker.addListener('click', function() {\n infowindow.open(map, marker);\n });\n })(infowindow, marker);\n\n /*\n START INFOWINDOW CUSTOMIZE.\n The google.maps.event.addListener() event expects\n the creation of the infowindow HTML structure 'domready'\n and before the opening of the infowindow, defined styles are applied.\n */\n google.maps.event.addListener(infowindow, 'domready', function() {\n /* Reference to the DIV that wraps the bottom of infowindow */\n\n var iwOuter = document.getElementsByClassName(\"gm-style-iw\");\n for (var i = 0; i < iwOuter.length; i++) {\n iwOuter[i].previousSibling.style.display = \"none\";\n }\n });\n }\n }", "function placeMarkers(map, points) {\n points.forEach(function(point) {\n placeMarker(map, {\n lat: Number(point.latitude),\n lng: Number(point.longitude)\n });\n });\n }", "function draw_markers()\n\t{\n\t\t// This calculates which markers are the red \"multi\" markers.\n\t\tvar overlap_map = MapOverlappingMarkers ( g_main_map.response_object );\n\t\t\n\t\t// Draw the meeting markers.\n\t\tfor ( var c = 0; c < overlap_map.length; c++ )\n\t\t\t{\n\t\t\tCreateMapMarker ( overlap_map[c] );\n\t\t\t};\n\t\t\n\t\t// Finish with the main (You are here) marker.\n\t\tCreateMarker ( g_location_coords, g_center_icon_shadow, g_center_icon_image, g_center_icon_shape );\n\t}", "function makeMarkers(markers) {\n // markers = [{\n // \"url\": \"./images/nicole_llama.png\",\n // \"coordinate\": [-115.462810, 36.193245],\n // \"msg\": \"I like sunshine!\"\n // }]\n for(let marker of markers) {\n let el = document.createElement('div');\n el.className = 'marker';\n el.style.backgroundImage = \"url(\" + marker.url + \")\";\n el.style.width = '50px';\n el.style.height = '50px';\n // add marker to map\n let m = new mapboxgl.Marker(el)\n .setLngLat(marker.coordinate)\n .addTo(map);\n if(\"msg\" in marker) {\n // add popups\n m.setPopup(new mapboxgl.Popup({\n offset: 25,\n closeOnClick: false\n })\n .setHTML('<p>' + marker.msg + '</p>'));\n m.togglePopup();\n }\n }\n }", "function passToMap() {\n let startBar = [STORE.brewList[0].longitude, STORE.brewList[0].latitude];\n let otherBars = [];\n STORE.brewList.forEach(bar => {\n otherBars.push([bar.longitude, bar.latitude, bar.name]);\n });\n STORE.recenter(startBar);\n STORE.addMarker(otherBars);\n}", "function markMap() {\n for (let key in Memory.warControl) {\n if (Memory.warControl[key]) {\n new RoomVisual(key).text(\n Memory.warControl[key].type,\n 25,\n 25,\n {align: 'left', opacity: 0.8}\n );\n }\n if (Memory.warControl[key].siegePoint) {\n new RoomVisual(Memory.warControl[key].siegePoint).text(\n 'Siegepoint',\n 25,\n 25,\n {align: 'left', opacity: 0.8}\n );\n }\n }\n}", "function createMarker(brewery, coords) {\n marker = new google.maps.Marker({\n position: coords,\n map: map,\n title: brewery.brewery.name\n });\n\n }", "function marks(point, coords) {\n return L.circleMarker(coords);\n}", "function initMap() {\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 6,\n center: {lat: 34.972232, lng: 38.504639}\n });\n\n setMarkers(map);\n}", "function createMarker() {\n for (var i = 0; i < locationsList().length; i++ ){\n var initialLocation = locationsList()[i];\n var placeLoc = initialLocation.location;\n var marker = new google.maps.Marker({\n map: map,\n position: placeLoc,\n title: initialLocation.name,\n visible: true\n });\n initialLocation.marker = marker;\n markers.push(marker);\n //add event listeners to the markers to open the relevant infowindow\n google.maps.event.addListener(marker, 'click', (function(initialLocation) {\n return function() {\n closeAllInfoWindows();\n deselectAll();\n toggleBounce(initialLocation);\n initialLocation.selected(true);\n infowindow.setContent(contentString(initialLocation));\n infowindow.open(map, this);\n infowindows.push(infowindow);\n };\n })(initialLocation));\n }\n }", "AddMark(index, setCenter) {\n\t\tvar locationCenter = null;\n\t\tvar locationStore = null;\n\t\tvar arrMarks = [];\n\t\tvar arrLocat = [];\n\t\tvar arrStores = [];\n\t\tvar arrFavorite = [];\n\t\tvar found = false; \n\n\t\tif (this.state.CDMXStores.locations != null) {\n\t\t\t// Check if the location has been previously obtained\n\t\t\t//\n\t\t\tthis.state.CDMXStores.locations.forEach((element) => {\n\t\t\t\tif (element.store == Stores[index].Name) {\n\t\t\t\t\tlocationCenter = element.center;\n\t\t\t\t\tfound = true;\n\t\t\t\n\t\t\t\t\t// Add the mark. First it is neccesary to check is the mark is already in the list.\n\t\t\t\t\t// It is also neccesary to copy all the marks the list already has.\n\t\t\t\t\t// \n\t\t\t\t\tif (this.state.mapProperties.marks != null) {\n\t\t\t\t\t\tthis.state.mapProperties.marks.forEach((key, idx) => {\n\t\t\t\t\t\t\tif (this.state.mapProperties.marks[idx].key == \"Mrk: \" + index) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tarrMarks.push(this.state.mapProperties.marks[idx]);\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tarrMarks.push(<Marker \n\t\t\t\t\t\tkey = {\"Mrk: \" + index} \n\t\t\t\t\t\ttitle = {Stores[index].Name} \n\t\t\t\t\t\tname = {Stores[index].Address} \n\t\t\t\t\t\tvalue = {index}\n\t\t\t\t\t\tposition = {{lat: locationCenter.lat(), lng: locationCenter.lng()}}\n\t\t\t\t\t\tonClick = {this.OnMarkClicked}/>);\n\t\t\t\t\tif (setCenter == false) { locationCenter = this.state.mapProperties.center }\n\t\t\t\t\tthis.setState({mapProperties: {center: locationCenter, marks: arrMarks}});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\t\n\t\t// There is no location => it has to be obtained\n\t\t// It is the first time for this mark\n\t\t//\t\t\n\t\tif (!found) {\t\t\n\t\t\tthis.GetPosition(Stores[index].Address)\n\t\t\t\t.then((center) => {\n\t\t\t\t\tlocationCenter = center;\n\t\t\t\t\tlocationStore = {\n\t\t\t\t\t\tcenter : center,\n\t\t\t\t\t\tstore : Stores[index].Name\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Upgrade the new array of locations. First it is neccesary to copy the locations previously obtained\n\t\t\t\t\t//\n\t\t\t\t\tarrStores = this.state.CDMXStores.stores;\n\t\t\t\t\tarrFavorite = this.state.CDMXStores.favorite;\n\t\t\t\t\tif (this.state.CDMXStores.locations != null) {\n\t\t\t\t\t\tObject.keys(this.state.CDMXStores.locations).forEach((key) => {\n\t\t\t\t\t\t\tarrLocat.push(this.state.CDMXStores.locations[key]);\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tarrLocat.push(locationStore);\n\t\t\t\t\tthis.setState({CDMXStores : {locations: arrLocat, stores: arrStores, favorite: arrFavorite}});\n\t\t\t\t\t\n\t\t\t\t\t// Add the mark. First it is neccesary to copy the marks already the map has.\n\t\t\t\t\t// \n\t\t\t\t\tif (this.state.mapProperties.marks != null) {\n\t\t\t\t\t\tthis.state.mapProperties.marks.forEach((key, idx) => {\n\t\t\t\t\t\t\tarrMarks.push(this.state.mapProperties.marks[idx]);\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tarrMarks.push(<Marker \n\t\t\t\t\t\tkey = {\"Mrk: \" + index} \n\t\t\t\t\t\ttitle = {Stores[index].Name} \n\t\t\t\t\t\tname = {Stores[index].Address} \n\t\t\t\t\t\tvalue = {index}\n\t\t\t\t\t\tposition = {{lat: locationCenter.lat(), lng: locationCenter.lng()}} \n\t\t\t\t\t\tonClick = {this.OnMarkClicked}/>);\n\n\t\t\t\t\t// Center the map to the new location and upgrade the new array of marks\n\t\t\t\t\t//\n\t\t\t\t\tthis.setState({mapProperties: {center: locationCenter, marks: arrMarks}});\n\t\t\t\t})\n\t\t\t\t.catch((error) => {console.log(error)})\n\t\t}\n\t}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {\n lat: locations[0].lon,\n lng: locations[0].lat\n },\n zoom: 8\n });\n infowindow = new google.maps.InfoWindow({\n content: '<div class=\"info\">loading...</div>'\n });\n\n // I'm making this function for marker click because JShint.com don't recommend making a function\n // inside a for loop\n markerClick = function() {\n AppViewModel.showInfo(this);\n };\n //let's loop through the array to add location and marks and info and event listener\n for (var i = 0; i < AppViewModel.allLocations().length; i++) {\n marker[i] = new google.maps.Marker({\n map: map,\n animation: google.maps.Animation.DROP,\n position: {\n lat: locations[i].lon,\n lng: locations[i].lat\n }\n });\n google.maps.event.addListener(marker[i], 'click', markerClick);\n }\n}", "function createMarkerIcons() {\n\t\t\tvar markerIconDot = {\n\t\t\t\turl: '/assets/images/1x1-pixel.png',\n\t\t\t\tsize: new google.maps.Size(1, 1),\n\t\t\t\torigin: new google.maps.Point(0, 0),\n\t\t\t\tanchor: new google.maps.Point(4, 4),\n\t\t\t\tscaledSize: null\n\t\t\t};\n\n\t\t\tvar markerIconSmallRed = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(16, 16),\n\t\t\t\torigin: new google.maps.Point(8, 85),\n\t\t\t\tanchor: new google.maps.Point(8, 12),\n\t\t\t\tscaledSize: null\n\t\t\t};\n\n\t\t\tvar markerIconLargeRed = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(20, 28),\n\t\t\t\torigin: new google.maps.Point(0, 0),\n\t\t\t\tanchor: new google.maps.Point(10, 24),\n\t\t\t\tscaledSize: new google.maps.Size(100, 66)\n\t\t\t};\n\n\t\t\tvar markerIconInvisRed = {\n\t\t\t\turl: '/assets/images/picture1.png',\n\t\t\t\tsize: new google.maps.Size(220, 230),\n\t\t\t\torigin: new google.maps.Point(0, 0),\n\t\t\t\tanchor: new google.maps.Point(3, 158)\n\t\t\t};\n\n\t\t\tvar markerIconLargeRedMain = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(20, 28),\n\t\t\t\torigin: new google.maps.Point(0, 0),\n\t\t\t\tanchor: new google.maps.Point(10, 24),\n\t\t\t\tscaledSize: new google.maps.Size(100, 66)\n\t\t\t};\n\n\t\t\tvar markerIconSmallBlue = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(16, 16),\n\t\t\t\torigin: new google.maps.Point(47, 85),\n\t\t\t\tanchor: new google.maps.Point(8, 12),\n\t\t\t\tscaledSize: null\n\t\t\t};\n\n\t\t\tvar markerIconLargeBlue = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(20, 28),\n\t\t\t\torigin: new google.maps.Point(27, 0),\n\t\t\t\tanchor: new google.maps.Point(9, 24),\n\t\t\t\tscaledSize: new google.maps.Size(100, 66)\n\t\t\t};\n\n\t\t\tvar markerIconSmallGreen = {};\n\n\t\t\tvar markerIconLargeGreen = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(20, 28),\n\t\t\t\torigin: new google.maps.Point(54, 0),\n\t\t\t\tanchor: new google.maps.Point(8, 24),\n\t\t\t\tscaledSize: new google.maps.Size(100, 66)\n\t\t\t};\n\n\t\t\tvar markerIconSmallOrange = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(16, 16),\n\t\t\t\torigin: new google.maps.Point(126, 85),\n\t\t\t\tanchor: new google.maps.Point(8, 12),\n\t\t\t\tscaledSize: null\n\t\t\t};\n\n\t\t\tvar markerIconLargeOrange = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(20, 28),\n\t\t\t\torigin: new google.maps.Point(81, 0),\n\t\t\t\tanchor: new google.maps.Point(8, 24),\n\t\t\t\tscaledSize: new google.maps.Size(100, 66)\n\t\t\t};\n\n\t\t\treturn {\n\t\t\t\tdot: markerIconDot,\n\t\t\t\tsmallRed: markerIconSmallRed,\n\t\t\t\tinvisRed: markerIconInvisRed,\n\t\t\t\tsmallBlue: markerIconSmallBlue,\n\t\t\t\tsmallGreen: markerIconSmallGreen,\n\t\t\t\tsmallOrange: markerIconSmallOrange,\n\t\t\t\tlargeRed: markerIconLargeRed,\n\t\t\t\tlargeRedMain: markerIconLargeRedMain,\n\t\t\t\tlargeBlue: markerIconLargeBlue,\n\t\t\t\tlargeGreen: markerIconLargeGreen,\n\t\t\t\tlargeOrange: markerIconLargeOrange\n\t\t\t};\n\t\t}", "function showMarkers() {\n\tsetAllMap(map);\n}", "function initMap() {\n let sanFrancisco = { lat: 37.790909, lng: -122.417861 };\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 11,\n center: sanFrancisco,\n mapTypeId: google.maps.MapTypeId.TERRAIN\n });\n\n //Event Listener to place marks when user clicks on the map\n map.addListener('click', e => {\n if (nodes.length > 9) {\n alert(\"You can only have 10 marks!\");\n }\n else {\n placeMarker(e.latLng, map);\n nodes.push(e.latLng);\n }\n });\n }", "function initMapInd() {\n //setting coordinates to center the map around (--> center about individual object in this case)\n var center = {\n lat: 43.8620,\n lng: -78.9428\n };\n //initializing map inside div with ID '#map-ind', setting zoom level and centering location\n var map = new google.maps.Map(document.getElementById('map-ind'), {\n zoom: 16, //the higher the number, the more zoomed in you are (--> in this case we zoom in a bit because we have narrowed our search)\n center: center\n });\n //placing marker on individual result map\n var marker = new google.maps.Marker({\n position: center,\n map: map\n });\n}", "function addmarkerforpeaks() {\n for (var i = 0; i < snowCaps.peaks.length; i++) {\n // Get the position from the location array.\n var position = snowCaps.peaks[i].position;\n var title = snowCaps.peaks[i].name;\n //console.log(title,position);\n // Create a marker per location, and put into markers array.\n var marker = new google.maps.Marker({\n position: position,\n title: title,\n map: map,\n icon: 'https://www.distancebetween.us/assets/img/apple-icon-60x60.png',\n animation: google.maps.Animation.DROP,\n });\n // Push the marker to our array of markers.\n markers.push(marker);\n }\n}", "function initMap() {\n\n const schinkelstr = {\n lat: 51.2325243,\n lng: 6.7929929\n };\n const canvas = document.getElementById(\"map\");\n\n const map = new google.maps.Map(canvas, {\n center: schinkelstr,\n zoom: 15,\n scrollwheel: false\n });\n const marker = new google.maps.Marker({\n position: schinkelstr,\n map: map\n });\n}", "function initMap() {\n let uluru;\n uluru = { lat: Number(-24.90387784417046), lng: Number(133.9211859007968) };\n var map = new google.maps.Map(document.getElementById(\"map\"), {\n center: {lat: parseFloat(-24.90387784417046), lng: parseFloat(133.9211859007968) },\n zoom: 4,\n });\n var i = 0;\n while(Object.values(cord).length>=i){ \n if( cord[i] != undefined)\n uluru = { lat: Number(cord[i]['latitude']), lng: Number(cord[i]['longitude']) };\n addMarker(uluru);\n i++; \n } //loop\n //add marker function\n function addMarker(coords){\n var marker = new google.maps.Marker({\n position:coords,\n map:map,\n });\n };\n\n } //map", "function mainMarker(x,y,name,i) {\n \n \n var marker = new google.maps.Marker({\n position: {lat: x, lng: y},\n map: map,\n label:(++i).toString(), \n \n title: name\n });\n markerArray.push(marker);\n }", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 8,\n center: centerCords\n \n \n });\n addMarkerInfo();\n}", "function initMap() {\n \t'use strict';\n\t\tvar myCenter = new google.maps.LatLng(48.2089816, 16.3732133),\n\t\t mapCanvas = document.getElementById(\"officeMap\"),\n\t\t mapOptions = {center: myCenter, zoom: 13, scrollwheel: false},\n\t\t map = new google.maps.Map(mapCanvas, mapOptions);\n\n\t \tvar locations = markers;\n\t \tvar marker, i;\n\t \tvar infowindow = new google.maps.InfoWindow();\n\t \tvar image = {\n\t \t\turl: \"img/officemarker.png\",\n\t \t\tscaledSize: new google.maps.Size(30, 30), // scaled size\n\t \t};\n\t for (i = 0; i < locations.length; i++) { \n\t \tmarker = new google.maps.Marker({\n\t\t position: new google.maps.LatLng(locations[i][0], locations[i][1]),\n\t\t map: map,\n\t\t icon: image\n\t });\n\n\t google.maps.event.addListener(marker, 'click', (function(marker, i) {\n\t return function() {\n\t infowindow.setContent(locations[i][2]);\n\t infowindow.open(map, marker);\n\t map.setZoom(16);\n\t \t map.setCenter(marker.getPosition());\n\t }\n\t })(marker, i));\n\t }\n\t}", "function initMap(){\n \t\tvar mapDiv = document.getElementById('map');\n \t\t map = new google.maps.Map(mapDiv, {\n \t\t\tcenter: {lat: 41.870800, lng: -87.650500},\n \t\t\tzoom: 12});\n \t\tvar mainmarker = new google.maps.Marker({ //Line 1\n \t\t\tposition: {lat: 41.870800, lng: -87.650500}, //Line2: Location to be highlighted\n \t\t\tmap: map,//Line 3: Reference to map object\n \t\t\ttitle: 'Chicago, Il', //Line 4: Title to be given\n icon : iconMainMarker\n \t\t})\n return map;\n \t}", "createRepresentativeMarker(markers, latLngBounds) {\n /*\n\n I think I really need to extend the L.marker class so that my markers can have their own data. Data should conform to an interface that allows\n for a quick description, images, full text description, etc. If I do this, then I need to decide details though: is my data fundamentall a marker? Or do \n i want to separate markers from the actual data? What are pros, cons? If I keep data as a separate class than markers, this means I can use it elsewhere \n when there is no need for any of the functionality a marker provides. However, if my data is primarily meant to be associated with a set of coordinates, then doesnt it \n already make sense to extend it from a marker? \n\n */\n if (markers.length != 0) {\n if (markers.length == 1){\n var soloMarker = markers[0];\n var marker = new L.marker(soloMarker.getLatLng(), {icon: this.getIcon(entry) }); //.addTo(m.getMap());\n marker.bindPopup(() => { return this.getPopupController().getPopupContent(entry) });\n marker.on(\"popupopen\", (event) => { marker.setIcon(this.getActiveIcon(entry)) });\n marker.on(\"popupclose\", (event) => { marker.setIcon(this.getIcon(entry)) });\n } else {\n\n }\n \n }\n\n\n\n }", "function _newMarkerPostion(map) {\n let bbox = map.getBounds();\n const xr = Math.random(), yr = Math.random();\n const xext = bbox.getEast() - bbox.getWest();\n const yext = bbox.getNorth() - bbox.getSouth();\n const x = (xext / 2.0) * xr + bbox.getWest() + (xext / 4.0);\n const y = (yext / 2.0) * yr + bbox.getSouth() + (yext / 4.0);\n return [y, x];\n }", "renderMapandMarkers(props) {\n\n\t\t// if there is an array of islands in props...\n\t\tif (props.islands) {\n\n\t\t\t// put the map center somewhere central\n\t\t\tvar mapCenter = {\n\t\t\t\tlat: 43.9366700,\n\t\t\t\tlng: 12.4463900,\n\t\t\t};\n\n\t\t\t// set the zoom level and the mapcenter we defined earlier\n\t\t var map = new google.maps.Map(this.map, {\n\t\t zoom: 2,\n\t\t center: mapCenter,\n\t\t });\n\n\t\t // loop over all the islands and make a marker for each\n\t\t var marker, i;\n\n \t\tfor (i = 0; i < props.islands.length; i++) { \n\n\t\t\t\tvar coordinates = {\n\t\t\t\t\tlat: props.islands[i].latitude,\n\t\t\t\t\tlng: props.islands[i].longitude,\n\t\t\t\t}\n\n \t\t\tmarker = new google.maps.Marker({\n \t\t\tposition: coordinates,\n \t\t\tmap: map,\n \t\t\t});\n \t\t}\n\n \t// otherwise, if the props are just latitude and longitude...\n\t\t} else if (props.latitude && props.longitude) {\n\n\t\t\t// set a coordinates object...\n\t\t\tvar coordinates = {\n\t\t\t\tlat: props.latitude, \n\t\t\t\tlng: props.longitude,\n\t\t\t};\n\n\t\t\t// which we will use as the centre of our map\n\t\t\tvar map = new google.maps.Map(this.map, {\n\t\t\t zoom: 8,\n\t\t\t center: coordinates,\n\t\t\t});\n\n\t\t\t// and set a marker at the same spot\n\t\t var marker = new google.maps.Marker({\n\t\t position: coordinates,\n\t\t map: map,\n\t\t });\n\t\t}\n\t}", "function addMarkers() {\n for (var x = locations.length - 1; x >= 0; x--) {\n var title = locations[x].title;\n\n // Create the marker\n marker[title] = new google.maps.Marker({\n map: map,\n position: locations[x].position,\n title: title,\n icon: {\n url: locations[x].icon_url,\n scaledSize: new google.maps.Size(50,50)\n }\n });\n\n // Add the click event\n // marker[title].addListener('click', function() {\n // updateIcons(this.getTitle());\n // });\n }\n}", "function showMarkers() {\r\n setMapOnAll(map);\r\n }", "addMarker(coordinates) {\n L.marker(coordinates).addTo(this.map);\n }", "function createMarkers(positions) {\r\n\r\n // $('#map > img').css('opacity','0.5');\r\n\r\n // $.each(markers, function(key, marker) {\r\n // var isUnque = true;\r\n // $.each(positions, function(pos, new_marker) {\r\n // if ('(' + new_marker.latitude + ', ' + new_marker.longitude + ')' == marker.getPosition() && isUnque == true) {\r\n // isUnque = false;\r\n // }\r\n // });\r\n // if (isUnque == true) {\r\n // marker.setOptions({\r\n // 'opacity': 0.1\r\n // });\r\n // } else {\r\n // isUnque = true;\r\n // marker.setMap(null);\r\n // }\r\n // });\r\n\r\n setMapOnAll(null);\r\n\r\n $.each(positions, function(key, position) {\r\n\r\n if(position.latitude == cardLatitude && position.longitude == cardLongitude)\r\n {\r\n icon = '/../../img/MAP/active/' + position.icon + '.svg';\r\n }\r\n else\r\n {\r\n icon = '/../../img/MAP/' + position.icon + '.svg';\r\n }\r\n\r\n marker = new google.maps.Marker({\r\n position: {\r\n lat: parseFloat(position.latitude),\r\n lng: parseFloat(position.longitude)\r\n },\r\n icon: icon,\r\n map: map\r\n });\r\n bounds.extend(new google.maps.LatLng(parseFloat(position.latitude), (position.longitude)));\r\n markers[key] = marker;\r\n google.maps.event.addListener(marker, 'mouseover', function() {\r\n $(\".gm-style img\").addClass(\"icon-click\")\r\n });\r\n google.maps.event.addListener(marker, 'click', function() {\r\n $('#map-sidebar').removeClass('d-md-block');\r\n // $.each(markers, function(pos, new_marker)\r\n // {\r\n // if('('+new_marker.latitude+', '+new_marker.longitude+')' != marker.getPosition())\r\n // {\r\n // markers[pos].setOptions({'opacity': 0.1});\r\n // }\r\n // });\r\n $('body').remove('.si-float-wrapper');\r\n $('.si-float-wrapper').html('');\r\n if ('undefined' !== typeof snWindow) {\r\n snWindow.destroy();\r\n }\r\n\r\n $.post('/load-card/' + position.id, function(result) {\r\n // var activeIcon = markers[key].icon.split('/');\r\n // if('active' != activeIcon[5])\r\n // {\r\n // markers[key].setIcon('/../../img/MAP/active/' + activeIcon[5]);\r\n // }\r\n var snWindow = new SnazzyInfoWindow({\r\n marker: markers[key],\r\n // content: 'Hi',\r\n // wrapperClass: 'card-info-window',\r\n content: result,\r\n closeWhenOthersOpen: true,\r\n showCloseButton: false,\r\n placement: 'top',\r\n pointer: false,\r\n offset: {\r\n top: '10px',\r\n left: '22px'\r\n },\r\n callbacks: {\r\n beforeOpen: function() {\r\n\r\n },\r\n afterOpen: function() {\r\n try {\r\n $('.popup-slider').slick('unslick');\r\n\r\n } catch (e) {\r\n // DO NOTHING\r\n }\r\n $('.popup-slider').slick({\r\n arrows: false,\r\n dots: true,\r\n centerMode: false,\r\n centerPadding: '40px',\r\n slidesToShow: 1,\r\n variableWidth: true,\r\n adaptiveHeight: false\r\n });\r\n $('.card').tooltip({\r\n selector: '[data-toggle=\"tooltip\"]'\r\n });\r\n\r\n $(\".si-content-wrapper .card .cta-like-card\").click(function() {\r\n if ($('body').hasClass('logged-out')) {\r\n $(\"input[name='addLikeCard']\").val($(this).attr(\"data-id\"));\r\n $(\"#cardLikeLogoutModal\").modal(\"show\");\r\n } else {\r\n $.ajax({\r\n url: \"/api/users/like/card\",\r\n method: \"POST\",\r\n data: {\r\n card: $(this).attr(\"data-id\")\r\n },\r\n success: function(e) {\r\n console.log('card liked');\r\n }\r\n }).done(function(res) {\r\n console.log('Like complete');\r\n });\r\n }\r\n });\r\n\r\n $(\".si-content-wrapper .card .cta-favorite-card\").click(function() {\r\n if ($('body').hasClass('logged-out')) {\r\n $(\"input[name='addFavoriteCard']\").val($(this).attr(\"data-id\"));\r\n $(\"#cardFavoriteLogoutModal\").modal(\"show\");\r\n } else {\r\n $.ajax({\r\n url: \"/api/users/favorite/card\",\r\n method: \"POST\",\r\n data: {\r\n card: $(this).attr(\"data-id\")\r\n },\r\n success: function(e) {\r\n msg = JSON.parse(e);\r\n console.log(msg.msg);\r\n // $(this).html(e.msg);\r\n $(this).html(msg.msg);\r\n snWindow.close();\r\n }\r\n }).done(function(res) {\r\n console.log('favorite complete ');\r\n });\r\n }\r\n });\r\n $(\".si-content-wrapper .popup-slider-image\").css(\"cursor\", \"pointer\");\r\n $(\".si-content-wrapper .popup-slider-image\").click(function() {\r\n\r\n loadCardDetails(position.id);\r\n });\r\n\r\n }\r\n }\r\n });\r\n snWindow.open();\r\n\r\n // console.log('test');\r\n });\r\n // console.log('This marker has been clicked '+key);\r\n });\r\n\r\n google.maps.event.addListener(marker, 'onmouseout', function() {\r\n $('body').remove('.si-float-wrapper');\r\n $('.si-float-wrapper').html('');\r\n if ('undefined' !== typeof snWindow) {\r\n snWindow.close();\r\n }\r\n });\r\n });\r\n\r\n if (positions.length > 0) {\r\n if(\"false\" != $('#api-box').attr('data-auto-zoom'))\r\n {\r\n map.fitBounds(bounds);\r\n }\r\n if(positions.length == 1)\r\n {\r\n map.setZoom(15);\r\n }\r\n }\r\n setTimeout(function() {\r\n if ($('#pac-input').hasClass('d-none')) {\r\n $('#pac-input').removeClass('d-none');\r\n }\r\n\r\n }, 1000);\r\n\r\n }", "function createMarker(store, index, array) {\n var latlng = new google.maps.LatLng(store.latitude, store.longitude);\n var key = buildKey(store);\n addMarker(key, latlng);\n }", "function initMap() {\n\n var icon = [{\n url: path+\"public/web/images/marker-menorca.svg\", // url\n scaledSize: new google.maps.Size(70, 70), // scaled size\n origin: new google.maps.Point(0,0), // origin\n anchor: new google.maps.Point(0, 50) // anchor\n }];\n // console.log(locations[0][1]+locations[0][2]);\n\n // The location of Uluru , ,,\n var uluru = {lat: parseFloat(locations[0][1]), lng: parseFloat(locations[0][2])};\n // The map, centered at Uluru\n var map = new google.maps.Map(\n document.getElementById('map'), {\n zoom: 7,\n center: uluru,\n //disableDefaultUI: true,\n styles: [\n {\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#f5f5f5\"\n }\n ]\n },\n {\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#616161\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#f5f5f5\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#bdbdbd\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#eeeeee\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#e5e5e5\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#dadada\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#616161\"\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#e5e5e5\"\n }\n ]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#eeeeee\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#f8f8f9\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#e8e9ec\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#d9d9d9\"\n }\n ]\n }\n ]\n });\n // The marker, positioned at Uluru\n var infowindow = new google.maps.InfoWindow();\n\n var marker, i;\n\n for (i = 0; i < locations.length; i++) {\n marker = new google.maps.Marker({\n position: new google.maps.LatLng(locations[i][1], locations[i][2]),\n icon: icon[0],\n map: map\n\n });\n\n google.maps.event.addListener(marker, 'click', (function(marker, i) {\n return function() {\n var content = '<div class=\"infowin\">'+\n '<p>'+locations[i][0]+'</p>'+\n\n\n '</div>';\n infowindow.setContent(content);\n infowindow.open(map, marker);\n }\n })(marker, i));\n }\n\n}", "function drawMarker(map, markers) {\n // Clear all existing markers first\n for (var i = 0; i < markerArray.length; i++) {\n markerArray[i].setMap(null);\n }\n\n markerArray.length = 0;\n\n for (var i = 0; i < markers.length; ++i)\n {\n if (stateFilter != null && markers[i]['state'] != stateFilter) {\n continue;\n }\n\n lat = markers[i]['lat'];\n lng = markers[i]['lng'];\n\n if (lat != null && lng != null) {\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng(lat, lng),\n map: map\n });\n\n markerArray.push(marker);\n }\n }\n}" ]
[ "0.7381819", "0.7243617", "0.6929383", "0.6908849", "0.6898605", "0.68026686", "0.6795299", "0.6765364", "0.67398953", "0.67398953", "0.67217696", "0.6693958", "0.6691036", "0.6678731", "0.6665427", "0.66634905", "0.6658071", "0.6655073", "0.6654939", "0.66483444", "0.66089475", "0.65811634", "0.65557504", "0.6544736", "0.6539684", "0.65386605", "0.6537624", "0.6537624", "0.6537624", "0.6537463", "0.6535962", "0.6531973", "0.6519584", "0.6510741", "0.6506424", "0.650639", "0.650639", "0.65014786", "0.65011966", "0.6496661", "0.6480174", "0.64761025", "0.6473748", "0.6473136", "0.6472175", "0.6470796", "0.6464452", "0.6463668", "0.6462634", "0.6462322", "0.6461832", "0.6461821", "0.64498484", "0.64466226", "0.6439378", "0.6439378", "0.6422514", "0.64122814", "0.64103067", "0.64095825", "0.6407329", "0.6403471", "0.6403005", "0.63972276", "0.63969684", "0.6395851", "0.63905376", "0.6389892", "0.6387252", "0.6385133", "0.63838005", "0.638173", "0.6380188", "0.63756114", "0.6375576", "0.6373967", "0.6366987", "0.63649505", "0.63643605", "0.6364349", "0.6360019", "0.6357546", "0.63565814", "0.63517404", "0.63473004", "0.6345288", "0.6344237", "0.63431937", "0.6340668", "0.63386226", "0.63373834", "0.63351965", "0.6331519", "0.6330305", "0.6315562", "0.63149846", "0.63121337", "0.63115436", "0.63074183", "0.6307016", "0.63044256" ]
0.0
-1
show modal on click
function showModal (evt) { let feature = map.forEachFeatureAtPixel(evt.pixel, function (feature) { return feature }) if (feature) { $('#peer-list, #peer-list-cdn').empty(); let info = feature.N.geo.city + ', ' + feature.N.geo.country_name $('#service_url').val(feature.N.service_url) $('#modal-network').find('.ntw-country').text(info) $('#modal-network').find('.ntw-ip').text(feature.N.ip4).attr('data-ip',) let peerList = feature.N.service_url + '/api/v1/dht/peers' console.log(peerList) let peerData $.get(peerList, function (data) { // check if not empty if (data) { peerData = JSON.parse(data) } }).done(function () { for ( var i = 0; i < peerData.length; i++ ) { var img_src var block console.log(peerData[i]['profile'].is_cdn); if (!peerData[i]['profile'].is_cdn) { img_src = 'http://' + feature.N.ip4 + ':5678/api/cdn/v1/resource?hkey=' + peerData[i]['profile'].profilePicture + '&thumb=1' var firstName = 'DD';//peerData[i]['profile'].name.first; var lastName = 'SS';//peerData[i]['profile'].name.last; block = `<div class="icon-box"><img src="${img_src}"/>${firstName} ${lastName}</div>` $('#peer-list').append(block) } else { block = `<div class="icon-box"><img src="../dist/img/cdn.svg" />CDN</div>` $('#peer-list-cdn').append(block) } } }) $("[data-target='#modal-network']").trigger('click'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openModal(e) {\n\tmodal.style.display = 'block'\n}", "function __BRE__show_modal(modal_id){$('#'+modal_id).modal('show');}", "function show_modal() {\n \t$('#promoModal').modal();\n }", "function orderCancleButtonClick() {\n $('#orderCancleModal').modal('show');\n}", "function openModal() {\n modal.style.display = 'block';\n }", "function openModal() {\n modal.style.display = 'block';\n }", "function showModal() {\n $(\"#exampleModal\").modal();\n }", "function openModal() { \n modal.style.display = 'block';\n }", "show(){\n\t\tthis.modalShadow.show();\n\t\tthis.modalBody.show();\n\t}", "function openModal () {\n modal.style.display = 'block';\n }", "function openModal(){\r\n modal.style.display = 'block';\r\n }", "showModal() {\n $('.modal').modal('show');\n }", "function openModal(myModal) {\n myModal.style.display = \"block\";\n }", "function showModal(){\n\t\t$('.js_newPortal').on('click', function(){\n\t\t\t$('.modal.modal__addNewPortal').addClass('modalOpen');\n\t\t});\n\t}", "function openModal() {\r\n\t\t\tdocument.getElementById('myModal').style.display = \"block\";\r\n\t\t}", "function runModal() {\r\n $(\"#myModal\").modal(\"show\");\r\n }", "function openModal(){\n modal.style.display = 'block';\n }", "function show_modal() \n{\n $('#myModal').modal();\n}", "function modalCheque()\n{\n $('#agregar_cheque').modal('show');\n}", "function AbrirModalnuevo(){\n $(\"#nuevo\").modal('show');\n}", "function openModal() {\nelModal.style.display = 'block';\n}", "function btnOnclick(){\r\n\tmodal.style.display = \"block\";\r\n}", "function attShowModal() {\n setShowModal(!showModal);\n }", "function show () {\n modal.style.display = \"block\";\n}", "function showPopupFormular() {\r\n $(\"#\" + global.Element.PopupFormular).modal(\"show\");\r\n }", "showModal() {\n this.isModalOpen = true;\n }", "function openModal(modal) {\n \n modal[0].style.display = \"block\";\n}", "function openModal(){\n\t\n\tmodal.style.display = 'block';\n\t\n}", "function openModal(){\r\n modal.style.display = 'block';\r\n}", "function showPopupElementFormular() {\r\n $(\"#\" + global.Element.PopupElementFormular).modal(\"show\");\r\n }", "function start() {\n $('#myModal').modal('show');\n }", "openModal() { \n this.bShowModal = true;\n }", "function show() {\n $$invalidate('modalIsVisible', modalIsVisible = true);\n }", "function openModal() {\n document.getElementById('myModal').style.display = \"block\";\n }", "function openModal() {\n modal.style.display = 'block';\n}", "function openModal() {\n modal.style.display = 'block';\n}", "function openModal() {\n modal.style.display = 'block';\n}", "function openModal() {\n modal.style.display = 'block';\n}", "function openModal() {\n modal.style.display = 'block';\n}", "function openModal() {\r\n\tmodal.style.display = 'block';\r\n}", "function openModal () {\n modal.style.display = 'block'\n}", "function openModal() {\r\n modal.style.display = 'block';\r\n}", "function openMoadal(e){\n console.log(e);\n modal.style.display = 'block';\n \n}", "openModal(){\n\n }", "function openModal(){\r\n modal.style.display = 'block';\r\n}", "click() {\n this.get('modal').showModal(this.get('photoFullUrl'));\n }", "function openModal() {\n modal.style.display = \"block\";\n}", "function openModal() {\n document.getElementById(\"myModal\").style.display = \"block\";\n }", "openAddModal(){\n document.getElementById(\"add_modal\").style.display = \"block\";\n }", "function showModal() {\n\tvar btnShowModal = $('.button-show-modal');\n\tif (btnShowModal.length > 0) {\n\t\tbtnShowModal.bind('click', function(e) {\n\t\t\te.preventDefault();\n\t\t\tvar modalTarget = $(this).data('target-modal');\n\t\t\tvar package = $(this).data('option');\n\n\t\t\tif (modalTarget.length > 0) {\n\t\t\t\t$(modalTarget).addClass('show');\n\n\t\t\t\tif ($(modalTarget).hasClass('show')) {\n\t\t\t\t\tchangeValueOptionInForm(package);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "function openModal() {\n modal.style.display = 'block';\n}", "function openModal() {\n modal.style.display = 'block';\n}", "function showModal()\n{\n\tdocument.getElementById('modal-backdrop').classList.toggle('hidden');\n\tif(document.getElementById('leave-comment-modal')) {\n\t\tdocument.getElementById('leave-comment-modal').classList.toggle('hidden');\n\t}\n\tif(document.getElementById('create-location-modal')) {\n\t\tdocument.getElementById('create-location-modal').classList.toggle('hidden');\n\t}\n}", "function openModal(){\n modal.style.display = 'block';\n}", "function showModal(){\r\n let modal=document.getElementsByClassName(\"modal\")[0];\r\n modal.style.display = \"block\";\r\n }", "function openModal() {\n modal.fadeIn();\n}", "function modalOpen() {\n modal.style.display = 'block';\n}", "function openChooseModal() {\n var chooseModal = document.getElementById(\"chooseModal\");\n\n chooseModal.style.display = \"block\";\n}", "function openModal3() {\n modal3.style.display = 'block';\n }", "function openModal3() {\n modal3.style.display = 'block';\n }", "function openModal() {\r\n modal.style.display = \"block\";\r\n}", "function openModal(){\n modal.style.display = 'block';\n}", "displayModal() {\n $(\"#modal-sliding\").openModal();\n }", "modalProjectDeleteClick() {\n $('#project-delete-modal').modal('show');\n }", "function openModal() {\n modal.style.display = \"block\";\n}", "function openModal() {\n const modal = document.querySelector('.modal');\n\n modal.style.display = 'block';\n}", "function openModal(){\n modal.style.display = 'block'; \n}", "function displayModal() {\n var modal = $(\".modal\");\n modal.addClass(\"modal-open\");\n // closes if X icon or button clicked:\n $(\".close-modal\").on(\"click\", function() {\n modal.removeClass(\"modal-open\");\n });\n // closes if clicked outside content area:\n $(\".modal-inner\").on(\"click\", function() {\n modal.removeClass(\"modal-open\");\n });\n // prevents modal inner from closing parent when clicked:\n $(\".modal-content\").on(\"click\", function(event) {\n event.stopPropagation();\n });\n }", "function buttonClicked(e) {\n e.preventDefault();\n modal.style.display = \"block\";\n}", "function openModal(){\n $(\"#inputModal\").modal('show');\n}", "function shown_bs_modal( /*event*/ ) {\n //Focus on focus-element\n var $focusElement = $(this).find('.init_focus').last();\n if ($focusElement.length){\n document.activeElement.blur();\n $focusElement.focus();\n }\n }", "function openModal3(){\n modal3.style.display = 'block';\n}", "function showModal() {\n\t\t \tvar action = $(\"#myModal\").attr(\"action\");\n\t\t \n\t\t \tif (action == 'update' || action == 'create') {\n\t\t \t\t$(\"#myModal\").modal(\"show\");\n\t\t \t}\n\t\t \t\n\t\t \tshowContractEndDateSelect();\n\t\t \tshowHidePassword();\n\t\t \tshowHideConfirmPassword();\n\t\t }", "function showModal(id) {\n if (id in modals) {\n modals[id].show();\n }\n }", "function openModal() {\n modal3.style.display = 'block'; \n}", "showModal(){\n if(document.getElementById('modal')){\n // console.log('found modal');\n document.getElementById('modal').style.display = 'block';\n document.getElementById('caption').style.display = 'block';\n document.getElementById('modal').style.zIndex = 10;\n }\n \n }", "showModal() {\n this.open = true;\n }", "function openModal() {\n getRecipeDetails();\n handleShow();\n }", "function showModal() {\n $('#modal-container').show(\"fold\", 1000);\n}", "function mostraPanelFoto()\n{\n\t$('#panelFoto').modal('show');\n}", "function openModal() {\n document.getElementById('myModal').style.display = \"block\";\n}", "function showModal() {\n setVisible(true);\n setSignUp(false);\n }", "function showModal(button, modal){\n\t\t$(button).click(function(ev){\n\t\t\tev.preventDefault();\n\t\t\t$('body').css('overflowY', 'hidden');\n\t\t\t$(modal).fadeIn();\n\t\t\tsetTimeout(function(){\n\t\t\t\t$(modal + ' .modal').css({\n\t\t\t\t\tanimation: 'show-modal 0.3s ease',\n\t\t\t\t\topacity: 1,\n\t\t\t\t\ttransform: 'translateY(0)'\n\t\t\t\t});\n\t\t\t\tsizeModal('#modal-contacto');\n\t\t\t\tsizeModal('#modal-simulador');\n\t\t\t\t$(window).resize(function(){\n\t\t\t\t\tsizeModal('#modal-contacto');\n\t\t\t\t\tsizeModal('#modal-simulador');\n\t\t\t\t});\n\t\t\t}, 200);\n\t\t});\n\n\t\t$(modal).click(function(ev){\n\t\t\tev.preventDefault();\n\t\t\t$(modal).fadeIn();\n\t\t\tsetTimeout(function(){\n\t\t\t\t$(modal + ' .modal').css({\n\t\t\t\t\tanimation: 'show-modal 0.3s ease',\n\t\t\t\t\topacity: 1,\n\t\t\t\t\ttransform: 'translateY(0)'\n\t\t\t\t});\n\t\t\t}, 200);\n\t\t});\n\t}", "function onCreateNewStaffClick() {\n $('#modal-register-staff').modal('show');\n }", "function showModal(e) {\n var modalHolder = getById(this.id + '-holder');\n\n // Save the open modal window id\n openModalId = this.id;\n\n // Save the element currently with focus\n focusedElementBeforeModal = document.activeElement;\n\n // Mark the main content as hidden\n document.getElementsByTagName(\"main\")[0].setAttribute('aria-hidden', 'true');\n \n // Display the overlay\n getById('modal-overlay').style.display = 'block';\n\n // Display the modal window\n modalHolder.setAttribute('aria-hidden', 'false');\n \n // Add a listener to deal with pressing the escape key to close the window\n document.addEventListener('keydown', escapeKeyToClose);\n\n // Add a keydown listener to modal to manage the tab key within the modal\n modalHolder.addEventListener('keydown', containTabKey);\n \n // Set focus to the modal window\n modalHolder.focus();\n e.preventDefault();\n}", "function showModal(){\n let modalWinner = document.getElementById('modal-winner')\n $('#modal-winner').modal('show')\n}", "function openModal() {\n document.getElementById(\"myModal\").style.display = \"block\";\n}", "function openModal() {\n document.getElementById(\"myModal\").style.display = \"block\";\n}", "function openModal() {\n document.getElementById(\"myModal\").style.display = \"block\";\n}", "function show_addprogram() {\n $('#addprogram').modal('show')\n}", "function showItemAdditionScreen(){\n $('#itemAdditionScreen').modal('show');\n}", "function launchModal(){\n modal.style.display = \"block\";\n}", "function addTransaction(e) {\n document.getElementById(\"myModal\").style.display = \"block\";\n}", "function showModal () {\n $modal = $('<div class=\"modal-test\"><h1>Your result:</h1></div>');\n $overlay = $('<div class=\"modal-overlay\" title=\"Close results!\"></div>');\n $body.append($overlay);\n $body.append($modal);\n $modal.animate({ top: \"50%\" }, 800);\n }", "function addCourseModalShow() {\n $(\"#addCourseModal\").modal(\"show\");\n}", "'click #openSigninModal' (event) {\n event.preventDefault()\n console.log(\"MODAL OPENED\");\n modal.show();\n }", "function show() {\n document.getElementById('myModal').style.display = \"block\";\n}", "function openModal() {\n document.getElementById(\"myModal\").style.display = \"block\";\n\n}", "function showModal() {\n if (this.getAttribute(\"id\") === \"settings-btn\") {\n document.getElementById('settings-modal').style.display = 'block';\n }\n if (this.getAttribute(\"id\") === \"how-btn\") {\n document.getElementById('how-modal').style.display = 'block';\n }\n}", "function btnEmployeeSign() {\n $(\"#modalMatch\").modal(\"toggle\");\n }", "function openModal() {\n setOpen(true);\n }" ]
[ "0.76985043", "0.76886654", "0.7666412", "0.76051325", "0.7592899", "0.7592899", "0.758097", "0.75543857", "0.7552299", "0.7536714", "0.7496239", "0.7483721", "0.7452537", "0.74288845", "0.7427205", "0.7420433", "0.74037445", "0.7397931", "0.7393442", "0.7377108", "0.73584586", "0.7356099", "0.7329845", "0.73298216", "0.73109543", "0.7289743", "0.7285872", "0.72763216", "0.7257277", "0.72556335", "0.72544134", "0.72443706", "0.7237375", "0.7232794", "0.723011", "0.723011", "0.723011", "0.723011", "0.723011", "0.7213396", "0.7205412", "0.7195548", "0.7191472", "0.71830416", "0.7181503", "0.71802646", "0.7179956", "0.71798885", "0.71683836", "0.7163593", "0.71630234", "0.71630234", "0.71586496", "0.71556914", "0.71506625", "0.7147868", "0.7126149", "0.71260124", "0.7125734", "0.7125734", "0.7121957", "0.7113886", "0.7109911", "0.71021086", "0.70958155", "0.7088134", "0.7081142", "0.70804083", "0.7067353", "0.70668876", "0.7054127", "0.7045809", "0.70423675", "0.7035293", "0.70262605", "0.7024943", "0.70181", "0.7010485", "0.70092756", "0.70063114", "0.69888425", "0.6981522", "0.6977262", "0.697249", "0.69696915", "0.6966647", "0.6963436", "0.6963436", "0.6963436", "0.696003", "0.6953033", "0.6951922", "0.6950614", "0.6948923", "0.6937551", "0.6933379", "0.6932849", "0.69289863", "0.6924139", "0.69210285", "0.69210154" ]
0.0
-1
show tooltip on hover
function displayTooltip (evt) { let feature = map.forEachFeatureAtPixel(evt.pixel, function (feature) { return feature }) tooltip.style.display = feature ? '' : 'none' if (feature) { let info = feature.N.geo.city + ', ' + feature.N.geo.country_name overlay.setPosition(evt.coordinate) $(tooltip).text(info) jTarget.css("cursor", 'pointer') } else { jTarget.css("cursor", '') } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mouseOver() {\n\t\ttooltip.style(\"display\", \"block\")\n\t\t\t .style(\"visibility\", \"visible\");\n\t}", "function mouseOver() {\n tooltip\n .style(\"opacity\", 1)\n .style(\"display\",\"inherit\");\n}", "function tooltip_show(rootNode)\n \t\t\t\t{\n \t\t\t\t\tglobal_hover={id:rootNode.data.id,label:rootNode.data.label,category:rootNode.data.type};\n \t\t\t\t\t$(\"#hover_tooltip\").css({'left':rootNode.x+60,'top':rootNode.y+141});\n \t\t\t\t\t$(\"#hover_tooltip\").css({'display':'block'});\n\t\t\t\t\t}", "showToolTip_(event) {\n this.updateToolTip_(event);\n }", "showDescription() {\n this.hover = true;\n }", "displayToolTip(item) {\n console.log(\"Hovering Over Item: \", item.name);\n }", "function showTooltip() {\n if (angular.isDefined(_tooltip) || angular.isUndefined(lx.text) || !lx.text) {\n return;\n }\n\n _tooltip = angular.element('<div/>', {\n class: `${CSS_PREFIX}-tooltip`,\n });\n\n _tooltipArrow = angular.element('<div/>', {\n class: `${CSS_PREFIX}-tooltip__arrow`,\n });\n\n _tooltipInner = angular.element('<span/>', {\n class: `${CSS_PREFIX}-tooltip__inner`,\n text: lx.text,\n });\n\n _tooltip.append(_tooltipArrow).append(_tooltipInner);\n\n _hoverTimeout = $timeout(_setTooltipPosition, _HOVER_DELAY);\n }", "function showTooltip(content, event) {\n tt.style('opacity', 1.0)\n .html(content);\n \n updatePosition(event);\n }", "function showTooltip(content, refIndic,event) {\n tt.style('opacity', 1.0)\n .html(content);\n\n updatelineChart(refIndic)\n updatePosition(event);\n }", "function showTooltip(content, event) {\n tt.style('opacity', 1)\n .html(content);\n\n updatePosition(event);\n }", "function showTooltip() {\n const item = this.options.foodTruck;\n\n tooltip.style.opacity = 1;\n tooltip.style.left = (event.clientX + 10) + 'px';\n tooltip.style.top = (event.clientY - 28) + 'px';\n\n tooltip.innerHTML =\n `<p><strong>${item.name}</strong>, ${item.queue} ${ checkPlural(item.queue, 'person') } waiting</p>`;\n}", "function showTooltip(content, event) {\n tt.style('opacity', 1.0)\n .html(content);\n\n updatePosition(event);\n }", "function show() {\n tID = null;\n let isBrowsable = false;\n if ($.tooltip.current !== null) {\n isBrowsable = settings($.tooltip.current).isBrowsable;\n }\n\n if ((!IE || !$.fn.bgiframe) && settings($.tooltip.current).fade) {\n if (helper.parent.is(':animated'))\n helper.parent\n .stop()\n .show()\n .fadeTo(settings($.tooltip.current).fade, 100);\n else\n helper.parent.is(':visible')\n ? helper.parent.fadeTo(\n settings($.tooltip.current).fade,\n 100\n )\n : helper.parent.fadeIn(settings($.tooltip.current).fade);\n } else {\n helper.parent.show();\n }\n\n $(helper.parent[0])\n .unbind('mouseenter')\n .unbind('mouseleave')\n .mouseenter(function () {\n if (isBrowsable) {\n $.tooltip.currentHover = true;\n }\n })\n .mouseleave(function () {\n if (isBrowsable) {\n // if tooltip has scrollable content or selectionnable text - should be closed on mouseleave:\n $.tooltip.currentHover = false;\n helper.parent.hide();\n }\n });\n\n update();\n }", "function rolloverToolTip(){\n jQuery('.livia_notestask').hover(\n function() {\n jQuery(this).children(\"span\").css({\n 'display':'block'\n });\n },\n function() {\n jQuery(this).children(\"span\").css({\n 'display':'none'\n });\n return false;\n });\n}", "function mouseoverHandler (d) {\n tooltip.transition().style('opacity', .9)\n tooltip.html('<p>' + d[\"attribute\"] + '</p>' );\n }", "set tooltip(value) {}", "function showTooltip(content, event) {\n\t\t\t\n\t\t\ttt.style(\"opacity\", 1.0)\n .html(content);\n\n\t\t\tupdatePosition(event);\n\t\t}", "get tooltip() {}", "function showTooltip(content, event) {\n tt.style('opacity', 1.0)\n .html(content);\n\n updatePosition(event);\n }", "function enableTooltip() {\n $('[v-tooltip]').tooltip({trigger: \"hover\", 'delay': {show: 1000, hide: 100}});\n}", "addHighlighTooltip () {\n }", "function ShowHelp() {\n $('img').tooltip('show');\n}", "function overName() {\r\n\tget(\"tooltip-display\").style.display = \"block\";\r\n\tget(\"tooltip-text\").innerHTML = \"My name is \" + playerDetails.name + \", that much I remember...\";\r\n}", "function showHelpTooltip() {\n $('#tooltip_help').show();\n}", "function mouseover() {\n tooltip\n .style('opacity', 1)\n d3.select(this)\n .style('stroke', 'black')\n .style('opacity', 1)\n }", "function overSkill0() {\r\n\tget(\"tooltip-display\").style.display = \"block\";\r\n\tget(\"tooltip-text\").innerHTML = skillsDescArray[0]\r\n}", "function toolTips(el,help) {\n\t\t$(el).on('mouseenter', function() {\n\t\t\t$(help).show();\n\t\t\t$(el).on('click', function() {\n\t\t\t\t$(help).hide();\n\t\t\t});\n\t\t\t$(el).on('mouseleave', function() {\n\t\t\t\t$(help).hide();\n\t\t\t});\n\t\t});\n\t}", "function tooltip(e,t,title) {\r\n\t\t$('<div id=\"tooltip\" />')\r\n .appendTo('body')\r\n .text(title)\r\n .hide()\r\n .css({\r\n backgroundImage : 'url(./assets/images/skins/'+settings.skin+'/'+settings.skin+'_controlpanel.png)',\r\n\t\t\tbackgroundPosition : 'top left',\r\n\t\t\tbackgroundRepeat : 'repeat-x',\r\n\t\t\tcolor : settings.label,\r\n\t\t\tborder: '1px solid ' + settings.label,\r\n\t\t\ttop: e.pageY - 20,\r\n left: e.pageX + 20\r\n })\r\n .fadeIn(350);\r\n\t\t\r\n\t\tt.mousemove(function(e) {\r\n\t\t $('#tooltip').css({\r\n\t\t\ttop: e.pageY - 20,\r\n\t\t\tleft: e.pageX + 20\r\n\t\t });\r\n\t\t});\r\n\t }", "function showTooltip_onMouseOver(){\n//----------------------------------------------------------------------------------------------------------------------------\t\n\n\n this.dispalyTooltips = function(toolz){ //args(tooplips array)\n // request mousemove events\n $(\"#graph\").mousemove(function (e) {\n\t\t var onMouseOver_file = new onMouseOver();//uses other module in this very file\n onMouseOver_file.handleMouseMoveAction(e, toolz); //args(mouse event, tooplips array)\n });\n\n } \n}", "function titleTooltip(elem){\n $(elem).hover(function(){\n /// Hover over code\n var title = $(this).attr('title');\n $(this).data('tipText', title).removeAttr('title');\n $('<p class=\"jtt\"></p>')\n .text(title)\n .appendTo('body')\n .fadeIn('slow');\n }, function() {\n /// Hover out code\n $(this).attr('title', $(this).data('tipText'));\n $('.jtt').remove();\n }).mousemove(function(e) {\n var mousex = e.pageX + 20; /// Get X coordinates\n var mousey = e.pageY + 10; /// Get Y coordinates\n $('.jtt').css({ top: mousey, left: mousex })\n });\n}", "function ActivateTooltip() {\n // creates the tooltip to display the y point\n $(\"<div id='tooltip'></div>\").css({\n position: \"absolute\",\n display: \"none\",\n border: \"1px solid #fdd\",\n padding: \"2px\",\n \"background-color\": \"#fee\",\n opacity: 0.80\n }).appendTo(\"body\");\n // displays the tooltip on hover\n $(\"#placeholder\").bind(\"plothover\", function (event, pos, item) {\n if (item) {\n var x = item.datapoint[0].toFixed(2), y = item.datapoint[1].toFixed(2);\n $(\"#tooltip\").html(y)\n .css({ top: item.pageY + 5, left: item.pageX + 5 })\n .fadeIn(200);\n }\n else {\n $(\"#tooltip\").hide();\n }\n });\n }", "function showTooltip(content, event) {\n tooltip.style('opacity', 1.0)\n .html(content);\n\n updatePosition(event);\n }", "toggleTooltips() {\n self.enableTooltips = !self.enableTooltips;\n }", "function mouseoverTooltip(d) {\n var mouseCoords = d3.mouse(this);\n var shiftX = infoBarX + infoBarPieY + 192;\n var shiftY = infoBarY + infoBarPieX + 28;\n\n d3.select(\"#tooltip\")\n .style(\"left\", (mouseCoords[0] + shiftX + \"px\"))\n .style(\"top\", (mouseCoords[1] + shiftY + \"px\"))\n .html(function() {\n return (\"<b>\" + d.data.type + \"</b><br>\" + Math.round(d.value / 1000) + \" PetaJoules\")\n })\n .classed(\"hidden\", false);\n}", "function timelineEventHover(e){\n\n\t\t\t\tvar $tooltip = $(\".battle .tooltip\");\n\n\t\t\t\t$tooltip.show();\n\n\t\t\t\t$tooltip.attr(\"class\",\"tooltip\");\n\n\t\t\t\tif(sandbox){\n\t\t\t\t\t$tooltip.attr(\"class\",\"tooltip sandbox\");\n\t\t\t\t}\n\n\t\t\t\t$tooltip.find(\".name\").html($(this).attr(\"name\"));\n\t\t\t\t$tooltip.addClass($(this).attr(\"class\"));\n\t\t\t\t$tooltip.find(\".details\").html('');\n\n\t\t\t\tif((($(this).hasClass(\"fast\")) || ($(this).hasClass(\"charged\")))&&(! $(this).hasClass(\"tap\"))){\n\n\t\t\t\t\tvar values = $(this).attr(\"values\").split(',');\n\n\t\t\t\t\t$tooltip.find(\".details\").html(values[0] + \" damage\");\n\n\t\t\t\t\t// Append damage percentage\n\t\t\t\t\tif(values.length > 2){\n\t\t\t\t\t\t$tooltip.find(\".details\").append(\" (\"+values[2]+\"%)\");\n\t\t\t\t\t}\n\n\t\t\t\t\t$tooltip.find(\".details\").append(\"<br>\" + values[1] + \" energy\");\n\n\t\t\t\t\t// Append stat boost string, if any\n\t\t\t\t\tif(values.length == 4){\n\t\t\t\t\t\t$tooltip.find(\".details\").append(\"<br>\"+values[3]);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar width = $tooltip.width();\n\t\t\t\tvar left = (e.pageX - $(\".section\").first().offset().left) + 25;\n\t\t\t\tvar top = e.pageY - 20;\n\n\t\t\t\tif( left > ($(\".timeline-container\").width() - width - 10) ){\n\t\t\t\t\tleft -= width + 35;\n\t\t\t\t}\n\n\t\t\t\t$tooltip.css(\"left\",left+\"px\");\n\t\t\t\t$tooltip.css(\"top\",top+\"px\");\n\t\t\t}", "function showTooltip(d) {\n $(this).popover({\n placement: 'auto top', //place the tooltip above the item\n container: '#chart', //the name (class or id) of the container\n trigger: 'manual',\n html : true,\n content: function() { //the html content to show inside the tooltip\n return \"<span style='font-size: 11px; text-align: center;'>\" + \"sds\" + \"</span>\"; }\n });\n $(this).popover('show'); \n}//function showTooltip", "function doTooltip(e, msg) {\nif ( typeof Tooltip == \"undefined\" || !Tooltip.ready ) return;\nTooltip.show(e, msg);\n}", "function showTooltips(evt) {\n\t\tif (tooltips_element) {\n\t\t\ttooltips_element.style.display = '';\n\t\t}\n\t}", "function hoverTooltip(id, type) {\n $('#' + id + ' .tools-' + type + ', #' + id + ' .bubble-' + type).hover(function() {\n $('#' + id + ' .bubble-' + type).show();\n }, function() {\n $('#' + id + ' .bubble-' + type).hide();\n });\n}", "_addTooltips() {\n $(this.el.querySelectorAll('[title]')).tooltip({\n delay: { show: 500, hide: 0 }\n });\n }", "function mouseOver(d){\n\t\t\t// d3.select(this).attr(\"stroke\",\"black\");\n\t\t\ttooltip.html(\"<strong>Frequency</strong>\" + \"<br/>\" + d.data.label);\n\t\t\treturn tooltip.transition()\n\t\t\t\t.duration(10)\n\t\t\t\t.style(\"position\", \"absolute\")\n\t\t\t\t.style({\"left\": (d3.event.pageX + 30) + \"px\", \"top\": (d3.event.pageY ) +\"px\" })\n\t\t\t\t.style(\"opacity\", \"1\")\n\t\t\t\t.style(\"display\", \"block\");\n\t\t}", "showTip(context) {\n const me = this;\n\n if (me.showTooltip) {\n me.clockTemplate = new ClockTemplate({\n timeAxisViewModel: me.client.timeAxisViewModel\n });\n\n me.tip = new Tooltip({\n cls: 'b-interaction-tooltip',\n align: 'b-t',\n autoShow: true,\n forElement: context.element,\n getHtml: () => me.getTipHtml(context.record, context.element)\n });\n }\n }", "function showTooltip(d) {\n tooltip\n .style(\"top\", `${d3.mouse(this)[1]}px`)\n .style(\"left\", `${d3.mouse(this)[0]}px`)\n .style(\"opacity\", 0.5)\n .html(`Country : ${d.Country}<br>Balance : ${d.Balance.toFixed(2)}mil<br>Export : ${d.Export.toFixed(2)}mil<br>Import : ${d.Import.toFixed(2)}mil<br>Total : ${d.Total.toFixed(2)}mil`)\n .on('click', hideTooltip)\n\n}", "function tp(poTag, psSelector)\n{\n\n if(psSelector)\n {\n var sHTML = \"\"+$(psSelector).html();\n sHTML = sHTML.split('\"').join(\"'\");\n\n $(poTag).attr('title', sHTML);\n }\n\n\n $(poTag).tooltip(\n {content: function()\n {\n if(!$(this).attr('title'))\n $(this).attr('title', $(this).text());\n\n return $(this).attr('title');\n }\n }).blur().mouseenter();\n\n return true;\n}", "showTooltip() {\n Animated.timing(this.animation, {\n toValue: 1,\n duration: 140,\n }).start();\n }", "tooltipClicked() {}", "function mouseLeave() {\n tooltip\n .style(\"opacity\", 0)\n .style(\"display\",\"none\")\n}", "function pollHover(d) {\n tooltip.transition()\n .duration(100)\n .style(\"opacity\", 1);\n tooltip.html(\n \"<p><strong>\" + d.key + \"</strong></p>\" +\n \"<table><tbody>\" +\n \"<tr><td>Risk:</td><td>\" + d.value.val + \"</td></tr></tbody></table>\"\n )\n .style(\"left\", (d3.event.pageX + 15) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n}", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "showTip(context) {\n const me = this;\n\n if (me.showTooltip) {\n me.clockTemplate = new ClockTemplate({\n scheduler: me.client\n });\n me.tip = new Tooltip({\n id: `${me.client.id}-time-range-tip`,\n cls: 'b-interaction-tooltip',\n align: 'b-t',\n autoShow: true,\n updateContentOnMouseMove: true,\n forElement: context.element,\n getHtml: () => me.getTipHtml(context.record, context.element)\n });\n }\n }", "function showTooltip(d,pos) {\n // moveTooltip(d,pos);\n // console.log(d.properties.provincia);\n // tooltip.style(\"display\",\"block\")\n // .text(d.properties.provincia);\n //\n // tooltip.style(\"top\",(pos.top+tooltipOffset.y)+\"px\")\n // .style(\"left\",(pos.left+tooltipOffset.x)+\"px\");\n\n}", "function mouseOnS(StateName, info){\n $(tooltip).html(StateName + ' ' +info);\n $(tooltip).css('background', 'white');\n}", "function showTooltips(frame) {\n\n var tools = frame.tools;\n\n for (var i = 0; i < tools.length; i++) {\n var tool = tools[i];\n drawTip(tool, \"tool \" + i);\n saveTip(tool, i);\n }\n\n}", "function mouseOverHelp(i) {\n return function() {\n target.innerHTML = helperTags[i].tooltip\n };\n }", "function showDetailsTooltip(node, index){\n clearTimeout(tooltip_timeout);\n\n $(\"#tooltip\").fadeIn(200);\n $(\"#tooltip\").css(\"position\", \"absolute\");\n $(\"#tooltip\").css(\"top\", node.y + 100);\n $(\"#tooltip\").css(\"left\", node.x);\n $('#author').text(node.name);\n $('#papers').text(\"Anzahl Paper: \" + node.paperCount);\n $('#author_img').attr('src','./img/'+node.name+'.jpg');\n}", "function showDetail(d) {\n\n\t\t//Indicate hover state\n\t\td3.select(this)\n\t\t.attr(\"stroke\", \"black\");\n\n\t var content = '<span class=\"value\" style=\"font-weight: bold; font-size: 0.9em;\">' +\n d.name + \" - \" + d.value + \"x\"\n '</span>'\n\n \ttooltip.showTooltip(content, d3.event);\n\t}", "function mouseover() {\n\ttiptool_div.style(\"display\", \"inline\");\n\t}", "function enableToolTipForHeader(){\r\n\t$('#merchantUpload').tooltip({title: \"Upload new set of images for an application.\", animation: true,placement: \"auto\"});\r\n\t$('[href=\"/search\"]').tooltip({title: \"Search existing or previously uploaded application from the system.\", animation: true,placement: \"auto\"});\r\n\t$('[href=\"/followup\"]').tooltip({title: \"Search applications for document followup from Head office.\", animation: true,placement: \"auto\"});\r\n\t$('[href=\"/signup\"]').tooltip({title: \"Register new merchant promoter or staff in Online Submission Application.\", animation: true,placement: \"auto\"});\r\n\t$('[href=\"#logout\"]').tooltip({title: \"Logout to OSA-PH.\", animation: true,placement: \"auto\"});\r\n}", "function ShowToolTip (d) {\n tooltip\n .style(\"opacity\", 1)\n .style(\"left\", d3.event.x -\n (tooltip.node().offsetWidth / 2) - 10 + \"px\")\n .style(\"top\", d3.event.y - (tooltip.node().offsetHeight / 2) - 145 + \"px\")\n .html(function() { \n if (currGlobal === \"Global Areas\"){ \n return `\n <p class=\"text-center\">${getContinentMap(d.areaname)} ${d.areaname}</p>\n <p class=\"text-center\">Immigration: ${d.value.toLocaleString()}</p>\n `;\n } else { \n return ` \n <p class=\"text-center\"><img src=${d.flag} alt=\"flag\"> ${d.country}</p>\n <p class=\"text-center\">Immigration: ${d.value.toLocaleString()}</p>\n `;\n }\n });\n}", "show() {\n if (this.options.showOn !== 'all' && !Foundation.MediaQuery.is(this.options.showOn)) {\n // console.error('The screen is too small to display this tooltip');\n return false;\n }\n\n var _this = this;\n this.template.css('visibility', 'hidden').show();\n this._setPosition();\n\n /**\n * Fires to close all other open tooltips on the page\n * @event Closeme#tooltip\n */\n this.$element.trigger('closeme.zf.tooltip', this.template.attr('id'));\n\n\n this.template.attr({\n 'data-is-active': true,\n 'aria-hidden': false\n });\n _this.isActive = true;\n // console.log(this.template);\n this.template.stop().hide().css('visibility', '').fadeIn(this.options.fadeInDuration, function() {\n //maybe do stuff?\n });\n /**\n * Fires when the tooltip is shown\n * @event Tooltip#show\n */\n this.$element.trigger('show.zf.tooltip');\n }", "function onMouseoverHdlr() {\t// on 'mouseover' handler\n\tsetTimeout(function(){ $(document).tooltip('disable');}, 10000);\n}", "function tooltips() {\r\n\t$('.tooltip-link').tooltip();\r\n}", "showTooltip() {\n this.setState({ visible: true });\n }", "function tooltip(){\n $(\".waypoints-header\").tooltip({\n position: {\n my: \"center\", \n at: \"bottom\", \n of: \"#waypoints\"\n },\n show: {\n effect: \"slideDown\",\n delay: 1\n }, \n });\n}", "async showTooltip() {\n this.actionEventHandler();\n }", "function show() {\n popupTimeout = null;\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if (transitionTimeout) {\n $timeout.cancel(transitionTimeout);\n transitionTimeout = null;\n }\n\n // Don't show empty tooltips.\n if (!(options.useContentExp ? ttScope.contentExp() : ttScope.content)) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.isOpen = true;\n if (isOpenExp) {\n isOpenExp.assign(ttScope.origScope, ttScope.isOpen);\n }\n\n if (!$rootScope.$$phase) {\n ttScope.$apply(); // digest required as $apply is not called\n }\n\n tooltip.css({ display: 'block' });\n\n positionTooltip();\n }", "function show() {\n popupTimeout = null;\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if (transitionTimeout) {\n $timeout.cancel(transitionTimeout);\n transitionTimeout = null;\n }\n\n // Don't show empty tooltips.\n if (!(options.useContentExp ? ttScope.contentExp() : ttScope.content)) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.isOpen = true;\n if (isOpenExp) {\n isOpenExp.assign(ttScope.origScope, ttScope.isOpen);\n }\n\n if (!$rootScope.$$phase) {\n ttScope.$apply(); // digest required as $apply is not called\n }\n\n tooltip.css({ display: 'block' });\n\n positionTooltip();\n }", "function show() {\n\t cancelShow();\n\t cancelHide();\n\n\t // Don't show empty tooltips.\n\t if (!ttScope.content) {\n\t return angular.noop;\n\t }\n\n\t createTooltip();\n\n\t // And show the tooltip.\n\t ttScope.$evalAsync(function() {\n\t ttScope.isOpen = true;\n\t assignIsOpen(true);\n\t positionTooltip();\n\t });\n\t }", "function ttMouseOver() {\nif (tooltipsOn && wgCanonicalNamespace != \"Special\" && (itemTooltips || npcTooltips || questTooltips || quickTooltips || abilityTooltips || otherTooltips)) {\n$(\"body\").mouseover(hideTip);\n$(\"#bodyContent\").append('<div id=\"tfb\" class=\"htt\"></div><div id=\"templatetfb\" class=\"htt\"><div>');\nif (itemTooltips) $(\"span.itemlink,span.setlink\").each(bindTT);\nif (npcTooltips) $(\"span.npclink\").each(bindTT);\nif (questTooltips) $(\"span.questlink\").each(bindTT);\nif (achievementTooltips) $(\"span.achievementlink\").each(bindTT);\nif (abilityTooltips) $(\"span.abilitylink\").each(bindTT);\nif (otherTooltips) $(\"span.ajaxttlink\").each(bindTT);\nif (quickTooltips) $(\"span.tttemplatelink\").each(function () {\n$(this).mouseover(showTemplateTip);\n$(this).mouseout(hideTemplateTip);\n$(this).mousemove(moveTip);\n});\n}\n}", "function show() {\n\n\n // Don't show empty tooltips.\n if ( ! scope.tt_content ) {\n return angular.noop;\n }\n\n createTooltip();\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if ( transitionTimeout ) {\n $timeout.cancel( transitionTimeout );\n }\n\n // Set the initial positioning.\n tooltip.css({ top: 0, left: 0, display: 'block' });\n\n // Now we add it to the DOM because need some info about it. But it's not \n // visible yet anyway.\n if ( appendToBody ) {\n $document.find( 'body' ).append( tooltip );\n } else {\n element.after( tooltip );\n }\n\n positionTooltip();\n\n // And show the tooltip.\n scope.tt_isOpen = true;\n scope.$digest(); // digest required as $apply is not called\n\n // Return positioning function as promise callback for correct\n // positioning after draw.\n return positionTooltip;\n }", "function show() {\n\n\n // Don't show empty tooltips.\n if ( ! scope.tt_content ) {\n return angular.noop;\n }\n\n createTooltip();\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if ( transitionTimeout ) {\n $timeout.cancel( transitionTimeout );\n }\n\n // Set the initial positioning.\n tooltip.css({ top: 0, left: 0, display: 'block' });\n\n // Now we add it to the DOM because need some info about it. But it's not \n // visible yet anyway.\n if ( appendToBody ) {\n $document.find( 'body' ).append( tooltip );\n } else {\n element.after( tooltip );\n }\n\n positionTooltip();\n\n // And show the tooltip.\n scope.tt_isOpen = true;\n scope.$digest(); // digest required as $apply is not called\n\n // Return positioning function as promise callback for correct\n // positioning after draw.\n return positionTooltip;\n }", "function handlePlotHover(event, pos, item) {\n if (item) {\n var text = getTimestamp(item.datapoint[0] / 1000) + '\\\n <br />\\\n ' + formatNumber(item.datapoint[1]) + ' Players';\n\n if (item.series && item.series.label) {\n text = item.series.label + '<br />' + text;\n }\n\n renderTooltip(item.pageX + 5, item.pageY + 5, text);\n } else {\n hideTooltip();\n }\n}", "function showTooltip(d, ox, oy, tooltip, opts){\n var xy = d3.mouse(this),\n x = xy[0];\n\n tooltip.show(opts.tooltipText(d), xy[1] + oy + 5 + 'px', x + ox + (x < 0 ? 5 : -tooltip.offsetWidth() - 5) + 'px');\n }", "function openTaxesAndFeesToolTip(){\n\t$(\"span[id^='taxesAndFees-']\").hover(function(event) {\n\t\tvar packageId = $(this).attr(\"id\").split(\"-\")[1];\n\t\tmouseEnterAnchor($(this), packageId,event);\n\t}, function() {\n\t\tvar packageId = $(this).attr(\"id\").split(\"-\")[1];\n\t\tmouseLeaveAnchor($(this), packageId);\n\t});\n}", "function showTip($tip) {\n\t\t\t$tip.animate({\n\t\t\t\topacity: 1,\n\t\t\t}, 500);\n\t\t}", "function switchToolTip() {\n //show information box when the mouse is placed on top of the question mark image\n document.getElementById('questionmark').onmouseover = function() {\n var toolTip = document.getElementById('tooltip');\n toolTip.style.display = 'block';\n };\n //hide information box when mouse is moved away from question mark image\n document.getElementById('questionmark').onmouseout = function() {\n var toolTip = document.getElementById('tooltip');\n toolTip.style.display = 'none';\n };\n}", "getTooltip(){return this.__tooltip}", "function showHoverInfo(e, text) {\n\tctx.font = hoverInfoFont();\n\tctx.textAlign = 'center';\n\tctx.textBaseline = 'middle';\n\n\tvar textWidth = ctx.measureText(text).width,\n\t\tx0 = e.offsetX + 10,\n\t\ty1 = e.offsetY - 10,\n\t\tx1 = x0 + 16 + textWidth,\n\t\ty0 = y1 - hoverInfoFontSize - 6;\n\n\t//draw hover box\n\tctx.beginPath();\n\tctx.textAlign = 'center';\n\tctx.textBaseline = 'middle';\n\tctx.fillStyle = colors.hoverPort;\n\n\tctx.moveTo(x0, y0);\n\tctx.lineTo(x0, y1);\n\tctx.lineTo(x1, y1);\n\tctx.lineTo(x1, y0);\n\tctx.fill();\n\n\t//draw module label\n\tctx.beginPath();\n\tctx.fillStyle = '#000000';\n\tctx.font = hoverInfoFont();\n\tctx.fillText(text, lerp(x0, x1, 0.5), lerp(y0, y1, 0.5));\n}", "function showToolTipHelp() {\n\t\tvar link = tip.triggerElement;\n\t\tif (!link) {\n\t\t\treturn false;\n\t\t}\n\t\tvar table = link.getAttribute('data-table');\n\t\tvar field = link.getAttribute('data-field');\n\t\tvar key = table + '.' + field;\n\t\tvar response = cshHelp.key(key);\n\t\ttip.target = tip.triggerElement;\n\t\tif (response) {\n\t\t\tupdateTip(response);\n\t\t} else {\n\t\t\t\t// If a table is defined, use ExtDirect call to get the tooltip's content\n\t\t\tif (table) {\n\t\t\t\tvar description = '';\n\t\t\t\tif (typeof(top.TYPO3.LLL) !== 'undefined') {\n\t\t\t\t\tdescription = top.TYPO3.LLL.core.csh_tooltip_loading;\n\t\t\t\t} else if (opener && typeof(opener.top.TYPO3.LLL) !== 'undefined') {\n\t\t\t\t\tdescription = opener.top.TYPO3.LLL.core.csh_tooltip_loading;\n\t\t\t\t}\n\n\t\t\t\t\t// Clear old tooltip contents\n\t\t\t\tupdateTip({\n\t\t\t\t\tdescription: description,\n\t\t\t\t\tcshLink: '',\n\t\t\t\t\tmoreInfo: '',\n\t\t\t\t\ttitle: ''\n\t\t\t\t});\n\t\t\t\t\t// Load content\n\t\t\t\tTYPO3.CSH.ExtDirect.getTableContextHelp(table, function(response, options) {\n\t\t\t\t\tExt.iterate(response, function(key, value){\n\t\t\t\t\t\tcshHelp.add(value);\n\t\t\t\t\t\tif (key === field) {\n\t\t\t\t\t\t\tupdateTip(value);\n\t\t\t\t\t\t\t\t// Need to re-position because the height may have increased\n\t\t\t\t\t\t\ttip.show();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}, this);\n\n\t\t\t\t// No table was given, use directly title and description\n\t\t\t} else {\n\t\t\t\tupdateTip({\n\t\t\t\t\tdescription: link.getAttribute('data-description'),\n\t\t\t\t\tcshLink: '',\n\t\t\t\t\tmoreInfo: '',\n\t\t\t\t\ttitle: link.getAttribute('data-title')\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}", "function setupHoverTooltip(layerview) {\n var hitTestPromise;\n var highlight;\n\n var tooltip = createTooltip();\n\n view.on(\"pointer-move\", function (event) {\n var promise = (hitTestPromise = view\n .hitTest(event)\n .then(function (hit) {\n if (promise !== hitTestPromise) {\n // another hit test was performed, ignore this result\n return;\n }\n\n // remove current highlighted feature\n if (highlight) {\n highlight.remove();\n highlight = null;\n }\n\n var results = hit.results.filter(function (result) {\n return result.graphic.layer === layer;\n });\n\n // highlight the hovered feature\n // or hide the tooltip\n if (results.length) {\n var graphic = results[0].graphic;\n var screenPoint = hit.screenPoint;\n\n highlight = layerview.highlight(graphic);\n tooltip.show(\n screenPoint,\n \"Built in \" + graphic.getAttribute(\"begin_date\")\n );\n } else {\n tooltip.hide();\n }\n }));\n });\n }", "function show() {\n\n popupTimeout = null;\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if ( transitionTimeout ) {\n $timeout.cancel( transitionTimeout );\n transitionTimeout = null;\n }\n\n // Don't show empty tooltips.\n if ( ! ttScope.content ) {\n return angular.noop;\n }\n\n createTooltip();\n\n // Set the initial positioning.\n tooltip.css({ top: 0, left: 0, display: 'block' });\n\n // Now we add it to the DOM because need some info about it. But it's not\n // visible yet anyway.\n if ( appendToBody ) {\n $document.find( 'body' ).append( tooltip );\n } else {\n element.after( tooltip );\n }\n\n positionTooltip();\n\n // And show the tooltip.\n ttScope.isOpen = true;\n ttScope.$digest(); // digest required as $apply is not called\n\n // Return positioning function as promise callback for correct\n // positioning after draw.\n return positionTooltip;\n }", "function show() {\n\n popupTimeout = null;\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if ( transitionTimeout ) {\n $timeout.cancel( transitionTimeout );\n transitionTimeout = null;\n }\n\n // Don't show empty tooltips.\n if ( ! ttScope.content ) {\n return angular.noop;\n }\n\n createTooltip();\n\n // Set the initial positioning.\n tooltip.css({ top: 0, left: 0, display: 'block' });\n\n // Now we add it to the DOM because need some info about it. But it's not\n // visible yet anyway.\n if ( appendToBody ) {\n $document.find( 'body' ).append( tooltip );\n } else {\n element.after( tooltip );\n }\n\n positionTooltip();\n\n // And show the tooltip.\n ttScope.isOpen = true;\n ttScope.$digest(); // digest required as $apply is not called\n\n // Return positioning function as promise callback for correct\n // positioning after draw.\n return positionTooltip;\n }", "function enableTooltip() {\n\tvar hoverMsg = ( _sessLang == SESS_LANG_CHN ) ? \"如果選擇列表中沒有,選擇任何稱謂然後用“更改”的方式去更正!\" : \"If not found in the dropdown selection list, select any and then use Edit to correct it!\";\n\t$(document).tooltip({content: hoverMsg});\n\t$(document).tooltip(\"enable\");\n} // enableTooltip()", "function showTooltip(x, y, contents) {\n $('<div name=\"tooltip\">' + contents + '</div>').css( {\n position: 'absolute',\n display: 'none',\n top: y + 5, \n left: x + 5,\n border: '1px solid #fdd',\n padding: '2px',\n 'background-color': '#fee',\n opacity: 0.80\n }).appendTo(\"body\").fadeIn(200);\n }", "get tooltipTemplate() {\n return html`<simple-tooltip\n id=\"tooltip\"\n for=\"button\"\n ?hidden=\"${!this.currentTooltip && !this.currentLabel}\"\n position=\"${this.tooltipDirection || \"bottom\"}\"\n >${this.currentTooltip || this.currentLabel}</simple-tooltip\n >`;\n }" ]
[ "0.8077092", "0.76973206", "0.7595864", "0.7559085", "0.75526476", "0.7548938", "0.75137186", "0.7444444", "0.74397117", "0.7409592", "0.7401991", "0.73924196", "0.73853153", "0.7355257", "0.7335925", "0.73334634", "0.7298164", "0.7296399", "0.7286857", "0.72673696", "0.7244063", "0.71927893", "0.71585274", "0.7142442", "0.71244633", "0.7092879", "0.7066614", "0.70465577", "0.7044628", "0.70302904", "0.70232445", "0.7011202", "0.69902503", "0.6984653", "0.695038", "0.6942834", "0.69359136", "0.6923218", "0.6913914", "0.690881", "0.69076645", "0.6891188", "0.688955", "0.6876694", "0.6869628", "0.68670905", "0.68631154", "0.68631065", "0.68621355", "0.68621355", "0.68621355", "0.68621355", "0.68621355", "0.68621355", "0.68621355", "0.68621355", "0.68621355", "0.68621355", "0.68621355", "0.68621355", "0.68621355", "0.68621355", "0.68621355", "0.68621355", "0.68621355", "0.68399286", "0.6839603", "0.6837877", "0.6820965", "0.6811545", "0.68036646", "0.6800693", "0.6793932", "0.67816293", "0.67764044", "0.6775447", "0.6754607", "0.67530113", "0.67512274", "0.67509377", "0.67453754", "0.6744444", "0.6744444", "0.6736478", "0.67210287", "0.6709166", "0.6709166", "0.670564", "0.67016006", "0.67002916", "0.6692221", "0.668517", "0.66821605", "0.6674084", "0.6669151", "0.66608", "0.66566485", "0.66566485", "0.6653524", "0.66442347", "0.6635352" ]
0.0
-1
_Bonus_: It seems some of the directors had directed multiple movies so they will pop up multiple times in the array of directors. How could you "clean" a bit this array and make it unified (without duplicates)?
function getAllDirectors (array) { return array.map (allDirectors => allDirectors.director) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUniqueDirectors(array) {\n\n const uniqueDirectors = array.map(movie => movie.director);\n let uniqueDirectorsArray = uniqueDirectors.filter((director, index) => uniqueDirectors.indexOf(director) === index)\n return uniqueDirectors;\n\n}", "function removeDuplicates(moviesArray) {\n let allDirectors = getAllDirectors(moviesArray);\n\n let cleanArray = allDirectors.filter((film, index) => {\n return allDirectors.indexOf(film) === index;\n });\n\n return cleanArray;\n}", "function getAllDirectors(movies) {\n const directors = movies.map(function(movie){\n return movie.director\n })\n const copy = [...directors]\n for (let i = copy.length - 1; i >= 0; i--) {\n if (copy.indexOf(copy[i]) !== i) {\n copy.splice(i, 1)\n }\n }\n return copy\n}", "function uniqueDirectors(arr) {\n let uniqueDirectorsArr = [...new Set(getAllDirectors(arr))];\n uniqueDirectorsArr.sort();\n}", "function cleanArray (newArray) {\n uniqueDirectors = [];\n for (let el in newArray) {\n if (uniqueDirectors.indexOf(el) < 0) uniqueDirectors.push(el);\n }\n return uniqueDirectors;\n}", "function getAllDirectors(movieArray) {\n const mappedArray = movieArray.map(movie => movie.director)\n\t\treturn mappedArray.filter((a,b) => mappedArray.indexOf(a) === b)\n}", "function getAllDirectors(movies) {\n const directors = movies\n .filter((movie) => movie.director)\n .map((movie) => movie.director);\n const uniqueDirectors = directors.filter((elem, i, arr) => arr.indexOf(elem) === i);\n return uniqueDirectors;\n}", "function getAllDirectors(movieArr){\n const listDirectors = movieArr.map(item => `${item.director}`)\n const listDirectorsfilter = listDirectors.filter((item, index) => {\n return listDirectors.indexOf(item) === index\n })\n return listDirectorsfilter\n }", "function scrubDuplicates(movieList) {\n\t\tlet scrubbedList = movieList = movieList.filter(function(elem, pos) {\n\t\t return movieList.indexOf(elem) == pos;\n\t\t});\n\n return scrubbedList;\n\t}", "function getAllDirectors(moviesArray) {\n\n allDirectors = moviesArray.map(dir => dir.director)\n\n return allDirectors\n\n\n}", "function dedupeArr(arr){\n\n}", "function getAllDirectors(arr) {\n return arr.map(movie => {\n return movie.director;\n });\n}", "function dedupe(arr) {\n return arr.reduce(function(newArray, item) {\n if(newArray.indexOf(item) < 0) {\n newArray.push(item);\n }\n return newArray;\n }, []);\n }", "function removeDuplicates(array) {\n const deDupedArray = [];\n array.forEach(el => {\n const normalizedEl = (el + '').toLowerCase();\n if (deDupedArray.indexOf(normalizedEl) !== -1) {\n deDupedArray.push(normalizedEl)\n }\n })\n return deDupedArray;\n }", "function cleanRoom(arr){\n\tlet copy = [].concat(arr) // copy array so we don't change original\n\n\tcopy.sort( (a, b) => a - b) // sory it low to high\n\n\tcopy.forEach(function(elem, index){\n\t\tif(elem === copy[index + 1]){ // if the next elem is the same as current\n\t\t\t let subArr = [elem] // make a new array with the only the current elem\n\t\t\t while(elem === copy[index + 1]){ // while next elem === current\n\t\t\t \tsubArr.push(...copy.splice(index + 1, 1)) // splice out next elem and add it to subArr\n\t\t\t }\n\t\t\t copy.splice(index, 1, subArr); // replace the current elem with subArr\n\t\t\t}\n\t\t})\n\n\treturn copy\n}", "function filtra(array) {\n return array.filter(function (director, index) {\n return index === array.indexOf(director);\n });\n }", "function getAllDirectors(moviesArray) {\n let directors = moviesArray.map(function (movie){\n return movie.director;\n }); return directors;\n}", "function dedup(array) {\nvar special = [...new Set(array)]; //uses set and the spread operator to delete all duplicates of the array\n\n\nreturn special; //returns the special array of values\n}", "function dedupe(array) {\n // initialize an array that holds all the non duplicate\n // iterate thru the arr\n const output = array.filter((el, idx) => idx === array.indexOf(el));\n // check if the idx of the el is equal to the output of using the indexof method with that el\n // push the el into the output array\n // return the arr\n return output;\n}", "function removeDuplicates(array) {\n var seen = {};\n return array.filter(function(item) {\n return seen.hasOwnProperty(item) ? false : (seen[item] = true);\n });\n }", "function dedup(array) {\n var arr = [];\n for (var i = 0; i < array.length; i++) {\n if (arr.indexOf(array[i]) > -1) continue;\n arr.push(array[i]);\n }\n \n \n return arr;\n}", "function filterDuplicates(arrayToBeFiltered, filteredArray)\n{\n //for each element in allSubs\n for(var i = 0; i < arrayToBeFiltered.length; i++)\n {\n //for each substrate name - substrate at i; name is stored in the first position\n nameOfReactant = arrayToBeFiltered[i][0];\n abbrOfReactant = arrayToBeFiltered[i][1];\n\n isUnique = true;\n for(var j = 0; j < filteredArray.length; j++)\n { \n uniqueName = filteredArray[j][0]\n //if the name is not unique\n if(nameOfReactant == uniqueName)\n isUnique = false;\n }\n if(isUnique)\n { //the array is pass by reference so this is good\n filteredArray.push([nameOfReactant, abbrOfReactant]);\n }\n }\n filteredArray.sort();\n}", "function removeDup(arrGender){\n for (let g = 0; g<arrGender.length; g++){\n for (let f=g+1; f<arrGender.length; f++){\n if (arrGender[g]==arrGender[f]){\n arrGender.splice(f,1);\n }\n }\n }\n return arrGender;\n\n}", "function dedup(array) {\nvar unique = [];\n\n for(var i = 0; i < array.length; i++){\n if(unique.indexOf(array[i]) === -1) {\n unique.push(array[i]);\n }\n }\nreturn unique;\n}", "function dedup(array){\n var seen = {};\n var output = [];\n var length = array.length;\n var count = 0;\n \n for (var i = 0; i < length; i++){ //checking through the array\n var current = array[i];\n if(seen[current] !== 1){\n seen[current] = 1;\n output[count++] = current;\n }\n }\n return output;\n}", "function deDupe(arr) {\n\tvar r = [];\n\to:for(var i = 0, n = arr.length; i < n; i++) {\n\t\tfor(var x = 0, y = r.length; x < y; x++) {\n\t\t\tif (r[x] == arr[i]) {\n\t\t\t\tcontinue o;\n\t\t\t}\n\t\t}\n\t\tr[r.length] = Number(arr[i]);\n\t}\n\treturn r;\n}", "function RemoveDupes(arr){\n var newarr = []\n for(var i = 0; i < arr.length; i ++){\n if(arr[i] !== arr[i - 1]){\n newarr.push(arr[i]);\n }\n }\n return newarr;\n } //ONLY WORKS IF ARRAY VALUES ARE IN ORDER", "function removeDuplicates(array) {\n return array.filter((arr, index) => array.indexOf(arr) === index);\n }", "function toUnique(a) { //array,placeholder,placeholder\n var b = a.length;\n var c\n while (c = --b) {\n while (c--) {\n a[b] !== a[c] || a.splice(c, 1);\n }\n }\n }", "function uniteUnique(arr) {\nlet args = Array.protoype.slice.call(arguments);\nreturn args.reduce(function(a,b) {\n\nreturn a.concat(b.filter(function(subArray) {\n\nreturn a.indexOf(subArray) <0;\n\n}));\n});\n}", "function removeDuplicates(arr){\n return arr.filter(function(elem, pos, self){\n return self.indexOf(elem) == pos;\n });\n }", "function dedup(array) {\n //return the array with all duplicates removed\n var new_array = [...new Set(array)];\n return new_array;\n}", "function removeDuplicates(arr) {\n\tarr = arr.filter((obj, index, self) =>\n\t\tindex === self.findIndex((t) => (\n\t\t\t(t.a === obj.a && t.b === obj.b) || (t.b === obj.a && t.a === obj.b)\n\t\t))\n\t)\n\treturn arr\n}", "function getMoviesFromDirector(array, director) {\n let result = array.filter(movie => movie.director === director);\n \n return result;\n}", "function removeDuplicateFilms(films) {\n var filmId = [];\n var filmsArray = [];\n films.forEach(function (film, index, arr) {\n filmId.push(film.film._id);\n delete film._id;\n });\n var uniqueFilms = filmId.filter(function (elem, pos) {\n return filmId.indexOf(elem) === pos;\n });\n\n films.forEach(function (film, index, arr) {\n uniqueFilms.forEach(function (film1, index1, arr1) {\n if (film1 === film.film._id) {\n filmsArray.push(film);\n delete uniqueFilms[index1];\n }\n });\n });\n return filmsArray;\n}", "function dedup(array) {\nreturn Array.from(new Set (array));\n}", "function noDupVines(arr) {\n var output = {};\n var len = arr.length;\n for (var i = 0; i < len; i++) {\n //if not null then enter\n if (arr[i] !== null) {\n //set store key in output object, if same key then replace existing one\n output[arr[i].author_url] = arr[i];\n }\n }\n return output;\n}", "function getAllDirectors (arr) {\n let directors = arr.map((elem) => {\n return elem.director\n })\n return directors\n}", "function camRemoveDuplicates(array)\n{\n\tvar prims = {\"boolean\":{}, \"number\":{}, \"string\":{}};\n\tvar objs = [];\n\n\treturn array.filter(function(item) {\n\t\tvar type = typeof item;\n\t\tif (type in prims)\n\t\t{\n\t\t\treturn prims[type].hasOwnProperty(item) ? false : (prims[type][item] = true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn objs.indexOf(item) >= 0 ? false : objs.push(item);\n\t\t}\n\t});\n}", "function distinct(arr){\n let newArr=[];\n for(let i=0; i<arr.length; i++){\n if(newArr.includes(arr[i])===false){\n newArr.push(arr[i]);\n }\n }\n return newArr;\n}", "function removeDupes(arr){\n var unique = arr[0];\n var count = 0;\n for(var i = 1; i < arr.length; i++){\n if(arr[i] == unique){\n count++;\n } else {\n unique = arr[i];\n arr[i - count] = arr[i];\n }\n }\n arr.length -= count;\n return arr;\n}", "function dedup(array){\n //store array elements inside variable newArray, use spread operator to copy origina array values\n //new keyword creates an object of those elements, Set function turns element into an array removing duplicates\n var newArray = [...new Set(array)];\n //return new array with no duplicates\n return newArray;\n}", "function removeDups(arr) {\n var names = ['Chelsea', 'Adra', 'Alex', 'Kim', 'Megan', 'Alex', 'Monique', 'Caysen', 'Brycen', 'Kim'];\n let unique = {};\n names.forEach(function(i) {\n if(!unique[i]) {\n unique[i] = true;\n }\n });\n return Object.keys(unique);\n}", "function removeAnagram(arr) {\n\t// sort every item in arr with map function\n\tconst sortedWords = arr.map((word) => word.split('').sort().join(''))\n\n\tfor (let i = 0; i < sortedWords.length; i++) {\n\t\tfor(let j = i + 1; j < sortedWords.length; j++){\n\t\t\tif (sortedWords[i] === sortedWords[j]){\n\t\t\t\tconst arrBeforeFirstAnagram = arr.slice(0, i);\n\t\t\t\tconst arrAfterFirstAnagram = arr.slice(i + 1);\n\t\t\t\tconst combined = [...arrBeforeFirstAnagram, ...arrAfterFirstAnagram];\n\t\t\t\treturn combined;\n\t\t\t}\n\t\t}\n\t}\n}", "function howManyMovies(arr){\n // directedMovies = 0;\n // for(i = 0; i < arr.directed){\n // if(directedMovies = direct )\n // }\n\n let newArray = arr.filter(function(d){\n \n if(d.director === 'Steven Spielberg' && d.genre.includes('Drama')){\n return d\n } \n });\n\n // newArray.forEach(oneMovie => {\n // if(oneMovie.genre.includes('Drama')){\n // directedMovies += 1;\n // }\n // })\n if(arr.length === 0) {\n return undefined;\n }\n\n return `Steven Spielberg directed ${newArray.length} drama movies!`\n}", "function removeDuplicates(arr) {\n return [...new Set(arr.map(s => JSON.stringify(s)))]\n .map(s => JSON.parse(s));\n}", "function eliminateDuplicates(arr) {\n \t var i,\n len=arr.length,\n out=[],\n obj={};\n\n \tfor (i=0;i<len;i++) {\n \tobj[arr[i]]=0;\n \t}\n \tfor (i in obj) {\n \tout.push(i);\n \t}\n \treturn out;\n}", "function eliminateDuplicates(arr) {\n \t var i,\n len=arr.length,\n out=[],\n obj={};\n\n \tfor (i=0;i<len;i++) {\n \tobj[arr[i]]=0;\n \t}\n \tfor (i in obj) {\n \tout.push(i);\n \t}\n \treturn out;\n}", "function eliminateDuplicates(arr) {\n \t var i,\n len=arr.length,\n out=[],\n obj={};\n\n \tfor (i=0;i<len;i++) {\n \tobj[arr[i]]=0;\n \t}\n \tfor (i in obj) {\n \tout.push(i);\n \t}\n \treturn out;\n}", "function eliminateDuplicates(arr) {\n \t var i,\n len=arr.length,\n out=[],\n obj={};\n\n \tfor (i=0;i<len;i++) {\n \tobj[arr[i]]=0;\n \t}\n \tfor (i in obj) {\n \tout.push(i);\n \t}\n \treturn out;\n}", "function removeDuplicates(Array){\n return Array.filter((a,b) => Array.indexOf(a) === b) //no duplicates for the drop menu in front end\n}", "function uniteUnique(...arr) {\n //join all elements in arrays provided in function argument as top-level elements, regardless of uniqueness\n var unitedArr = [...arr].reduce(function(unite, element){\n return unite.concat(element);\n }, []);\n //keep only the first occurence of certain element in the array\n return unitedArr.filter((element, index, self) => index === self.indexOf(element));\n}", "function noDuplicates(arr){\n const removeDups = [...new Set(arr)];\n return removeDups;\n }", "function dedup(array) {\n return array.filter((a, b) => array.indexOf(a) === b);\n}", "function getAllDirectors(movies) {\n return movies.map(i=> i.director)\n}", "function eliminateDuplicates(arr) {\n var i,\n len=arr.length,\n out=[],\n obj={};\n\n for (i=0;i<len;i++) {\n obj[arr[i]]=0;\n }\n for (i in obj) {\n out.push(i);\n }\n return out;\n }", "function dedup(array) {\n \n // Should take an array and return an array with all the duplicates removed\n \n let newArr = [];\n \n for (let i = 0; i < array.length; ++i) {\n \n if (!newArr.includes(array[i])) {\n newArr.push(array[i]);\n }\n \n }\n \n return newArr;\n\n}", "function removeDuplicateNames(arr) {\n let duplicate = false;\n let compare;\n let spliceIndexArr = [];\n let cleanStats;\n let lastTeam;\n let duplicatePlayerTeams = [];\n\n arr.map(function(item, index) {\n if(item.Tm === \"TOT\"){\n if(duplicate) {\n duplicatePlayerTeams.push({Player: compare, Tm: lastTeam});\n compare = item.Player;\n }\n else {\n duplicate = true;\n compare = item.Player;\n }\n }\n else if(duplicate) {\n if(item.Player === compare){\n spliceIndexArr.push(index); \n lastTeam = item.Tm;\n }\n else { //use last team and compare to create an array to fill in TOT players\n duplicatePlayerTeams.push({Player: compare, Tm: lastTeam});\n duplicate = false;\n compare = \"\"; \n lastTeam = \"\";\n }\n }\n });\n\n cleanStats = arr.filter(function(item, index) {\n if(spliceIndexArr.indexOf(index) == -1){\n return true; \n }\n else {\n return false\n }\n });\n return populateDuplicatePlayerTeams(cleanStats, duplicatePlayerTeams); \n}", "function dedup(array){\nvar newArray = [];\nvar oneLongString = array.join(\" \");\n for(var i = 0 ; i < array.length; i++){\n var re = new RegExp(array[i], \"g\");\n //If length = 1 then there's only 1 occurence of the string in the string\n if(oneLongString.match(re).length === 1){\n newArray.push(array[i]);\n //If more than one occurence and the i === the 1st indexOf that string then PUSH \n } else if(oneLongString.match(re).length > 1 && i === array.indexOf(array[i]) ){\n newArray.push(array[i]); \n }\n } return newArray;\n}", "_dedupe(ary) {\n return ary.sort().filter((item, ndx, _ary)=>{\n if (ndx!=0 && item == ary[ndx-1]) return false;\n return true;\n });\n }", "function removeDuples(arr) {\r\n var clearedArray = [];\r\n var i = 0;\r\n while (i < arr.length) {\r\n if (arr[i] == arr[i + 1]) {\r\n i += 2;\r\n } else {\r\n clearedArray.push(arr[i]);\r\n i++;\r\n }\r\n }\r\n // clearedArray = clearedArray.length ? clearedArray : arr;\r\n return arr.length === clearedArray.length ? clearedArray : removeDuples(clearedArray);\r\n }", "function iterate_actor_array(actor,castArr){\n\tfor(var name in castArr){\n\t\tif(!actor_to_actor.has(actor)){ //Checks if the actor exist\n\t\t\tactor_to_actor.set(actor,new Set());\n\t\t}\n\t\tif(actor != castArr[name] && !actor_to_actor.get(actor).has(castArr[name])){\n\t\t\tactor_to_actor.get(actor).add(castArr[name]);\n\t\t}\n\t}\n}", "function removeDuplicates(arr) {\n if (typeof arr != 'object' || arr.length == 0) {\n return arr;\n }\n\n arr = arr.filter(function(item, pos, self) {\n return self.indexOf(item) == pos;\n });\n\n return arr;\n}", "function dublicate(arr) {\n return arr.concat(arr);\n}", "function removeDuplicates(arr){\n let unique_array = []\n for(let i = 0;i < arr.length; i++){\n if(unique_array.indexOf(arr[i]) == -1){\n unique_array.push(arr[i])\n }\n }\n return unique_array\n }", "function eliminateDuplicates(arr) {\n\t\tvar i,\n\t\tlen = arr.length,\n\t\tout = [],\n\t\tobj = {};\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tobj[arr[i]] = 0;\n\t\t}\n\t\tfor (i in obj) {\n\t\t\tout.push(i.split(','));\n\t\t}\n\t\tout = out.map(function (e) {\n\t\t\t\treturn [parseInt(e[0], 10), parseInt(e[1], 10)];\n\t\t\t});\n\t\treturn out;\n\t}", "function dedup (array) {\n const deduplicated = []\n\n array.forEach((item) => {\n if (deduplicated.indexOf(item) === -1) {\n deduplicated.push(item)\n }\n })\n\n return deduplicated\n}", "function removeDuplicatesFromCatArr(array) {\n let removeDuplicates = new Set(array);\n catArray = Array.from(removeDuplicates);\n return catArray\n}", "function removeDuplicates(array) {\n var newArray = [];\n var j = 0;\n for (var i = 0; i < array.length; i++) {\n if (newArray.includes(array[i])) {\n continue;\n } else {\n newArray[j] = array[i];\n j++;\n }\n }\n return newArray;\n}", "function eliminateDuplicates(arr) {\r\n var i,\r\n len=arr.length,\r\n out=[],\r\n obj={};\r\n for (i=0;i<len;i++) {\r\n obj[arr[i]]=0;\r\n }\r\n for (i in obj) {\r\n out.push(i);\r\n }\r\n return out;\r\n}", "function removeDuplicates(arrOfStrings){\n //return all duplicate elements filtered out\n return [...new Set(arrOfStrings)]// SPECIAL OPERATION HERE\n} //(OPTION 1)", "function uniteUnique(arr) {\n var newArray = [].concat.apply([], arguments);\n var result = newArray.reduce((accumulator, current) => {\n \n if (accumulator.indexOf(current) === -1) {\n accumulator.push(current);\n }\n return accumulator;\n }, []);\n\n return result;\n \n}", "function removeDuplicate(arr){\nvar exists = {};\nvar outArr = [];\nvar elm;\n\nfor (var i = 0; i < arr.length; i++){\n elm = arr[i];\n if (!exists[elm]){\n outArr.push(elm);\n exists[elm] = true;\n }\n}\nreturn outArr;\n}", "function removeDuplicates(dups) {\n const used = new Set();\n const clean = [];\n dups.forEach(i => {\n if (!used.has(i.title)) {\n used.add(i.title);\n clean.push(i);\n }\n });\n return clean;\n}", "function createUniqueArr(movArr) {\n\n const uniqueArr = [];\n\n movArr.map(element => {\n\n if (!checkYear(element, uniqueArr)) {\n\n uniqueArr.push({\n year: element.year\n });\n\n }\n })\n\n return uniqueArr;\n\n}", "function removeDuplicateItems (arr) {\n var input = arr\n var inputLower = []\n output = []\n for (var i = 0; i < input.length; i++) {\n if ( typeof input[i] === 'string') {\n inputLower.push(input[i].toLowerCase())\n }\n else {\n inputLower.push(input[i])\n }\n }\n\n for (var i = 0; i < inputLower.length ; i++)\n { if (inputLower [i] !== inputLower[i+1])\n output.push(inputLower[i])\n }\n\n\nreturn(output)\n}", "function removeDupes(arrWithDupes){\n let uniq = [...new Set(arrWithDupes)];\n // console.log(\"uniq\", uniq);\n return uniq;\n}", "function removeDupes(arrWithDupes){\n let uniq = [...new Set(arrWithDupes)];\n // console.log(\"uniq\", uniq);\n return uniq;\n}", "function removeDuplicatesFrom(inputArray) {\n let outputArray = [];\n let len = inputArray.length;\n for (let i = 0; i < len; i++) {\n if (!matchesOneIn(inputArray[i], outputArray)) {\n outputArray.push(inputArray[i]);\n }\n }\n return outputArray;\n}", "function removeArrayDuplicates(arr) {\n return Array.from(new Set(arr));\n}", "function removeDuplicateTwo(arr) {\n const uniqueArray = [];\n arr.forEach((e) => {\n if(contain(e, uniqueArray) === false) {\n uniqueArray.push(e)\n }\n })\n return uniqueArray;\n}", "function removeDupes(arr) {\n \"use strict\";\n var newArr = []; //we have to declare a new array to store the result\n for (var i = 0; i < arr.length; i++) { //loop through array\n var lookingFor = arr[i]; // the current index through this i loop\n var foundIt = false; //flag variable set to false\n for (var j = 0; j < newArr.length; j++) { //loop through new array\n if (newArr[j] == lookingFor) { //if the index of the new array has the same value as //the original array we passed in\n foundIt = true; //then the flag is set to true, keep looping through new array\n }\n }\n if (!foundIt) { // if we haven't found any similarities, then\n newArr[newArr.length] = lookingFor; //at the end of the new array, push the value of // the the original array to the new one \n }\n } \n return newArr; //finally, return new array\n}", "function removeDuplicates(array) {\n const arr2 = [];\n for (let i = 0; i < array.length; i++) {\n let exists = false;\n for (j = 0; j < arr2.length; j++) {\n if (array[i] === arr2[j]) {\n exists = true;\n break;\n }\n }\n if (!exists) {\n arr2.push(array[i]);\n }\n }\n return arr2;\n }", "function deleteDups(arr) {\n const newArr = arr.filter((el, idx) => {\n if (arr.indexOf(el) === idx) return el;\n });\n return newArr;\n}", "function uniteUnique (...arrs) {\n let newArr = [];\n arrs.forEach(nestedArray => {\n nestedArray.forEach(el => {\n if (!newArr.includes(el)) {\n newArr.push(el);\n }\n });\n });\n\n return newArr;\n}", "function uniteUnique(arr) {\n\tconst args = [...arguments];\n\n\tconst unifiedArr = [].concat(...args);\n\n\t//for loop could work too\n\t//Sets can only contain one of each element\n\treturn [...new Set(unifiedArr)];\n}", "function removeDups(arr) {\n let removed = [];\n for (let i = 0; i < arr.length; i++) {\n if (!removed.includes(arr[i])) {\n removed.push(arr[i]);\n }\n }\n return removed;\n}", "function removeDuplicate(arr){\n \n var exists ={},\n outArr = [],\n elm,\n arrLength = arr.length;\n\n for (var i = 0; i < arrLength; i++) {\n elm = arr[i];\n\n if (!exists[elm]) {\n outArr.push(elm);\n exists[elm] = true;\n }\n }\n\n return outArr;\n}", "function removeDuplicatesFromArray (a) {\n var i;\n var obj = {};\n var ret = [];\n for (i = 0; i < a.length; i++) {\n if (!obj[a[i]]) {\n ret.push(a[i])\n }\n obj[a[i]] = true;\n }\n return ret;\n}", "function removeDuplicates(arr) {\n let removed = [];\n for(elem of arr) {\n if(!removed.includes(elem)) {\n removed.push(elem);\n }\n }\n return removed;\n}", "function removeDuplicate(arr) {\n var exists = {},\n outArr = [];\n\n for (var i = 0; i < arr.length; i++) {\n if (!exists[arr[i]]) {\n outArr.push(arr[i]);\n exists[arr[i]] = true;\n }\n }\n return outArr;\n}", "function capTheArray() {\n for (var i = 0; i < movies.length; i++) {\n var titleWords = movies[i][0].split(' ');\n for (var j = 0; j < titleWords.length; j++) {\n var noCap = ['of', 'the', 'and', 'for', 'in', 'to'];\n if (j !== 0 && noCap.indexOf(titleWords[j]) > -1) {\n continue;\n }\n\n titleWords[j] = capitalize(titleWords[j]);\n }\n\n titleWords = titleWords.join(' ');\n movies[i][0] = titleWords;\n }\n}", "function uniqueArray4(a) {\n return [...new Set(a)];\n}", "function removeDuplicate(array){\n\tif(!array || !array.length) return;\n\t\n\tfor(var i = 0; i < array.length; i++)\n\t\tif(array[i] == null){\n\t\t\tarray.splice(i--, 1);\n\t\t}\n\n\tfor(var i = 0; i < array.length - 2; i++){\n\t\tfor(var j = i + 1; j < array.length; j++){\n\t\t\tconsole.log(\"array[j]: \" + i + \", \" + array[j]);\n\t\t\tif(array[i] === array[j]){\n\t\t\t\tarray.splice(j--, 1);\n\t\t\t\tconsole.log(\"array is: \" + array);\n\t\t\t}\n\t\t}\n\t}\n\t\n}", "function removeDuplicates(numArr) {\n var wrk = numArr.slice(0);\n var output = [];\n for (var i = 0; i < wrk.length; i++) {\n if (output.indexOf(wrk[i]) === -1) {\n output.push(wrk[i]);\n }\n }\n return output;\n }", "function removeDuplicateFromSortedArray2(array) {\n let counter = 0;\n for (let i = 0; i < array.length - 1; i++) {\n if(array[i] != array[i+1]) {\n array[counter] = array[i];\n counter++;\n }\n }\n array[counter] = array[array.length - 1];\n\n console.log(array.slice(0, counter+1));\n}", "function unique(array) {\n\t var seen = {};\n\t return array.filter(function(item) {\n\t return seen.hasOwnProperty(item) ? false : (seen[item] = true);\n\t });\n\t}", "function removeDuplicates(arr){\n var current= null;\n for( var i = 0; i < arr.length; i++ ){\n \n\n if ( arr[ i ] == current){\n removeAt(arr, i);\n i-=1;\n }\n current = arr[i];\n }\n return arr;\n}", "function orderAlphabetically(arr) {\n let alphArr = [...arr].sort((s1, s2) => {\n if (s1.title > s2.title) return 1;\n else return -1\n })\n alphArr.splice(20)\n return alphArr.map(movies => movies.title)\n\n}", "function orderAlphabetically(array) {\n const arrayTitle = array.map(movie => movie.title);\n const arrayTitleSorted = arrayTitle.sort((a, b) => {\n if (a > b) {\n return 1;\n } else return -1;\n });\n if (arrayTitleSorted.length > 20) {\n let removedItems = arrayTitleSorted.splice(20, arrayTitleSorted.length);\n return arrayTitleSorted;\n } else return arrayTitleSorted;\n}" ]
[ "0.7698366", "0.7620447", "0.71124375", "0.707752", "0.6968643", "0.68777215", "0.6743857", "0.65551466", "0.6396464", "0.6231454", "0.6191006", "0.6040082", "0.6014061", "0.60026777", "0.59700394", "0.5928939", "0.59099823", "0.5888402", "0.58680964", "0.58316684", "0.58278716", "0.58132684", "0.58012927", "0.578074", "0.5777412", "0.57767636", "0.57624155", "0.5753643", "0.575342", "0.57517713", "0.57493633", "0.5749197", "0.5747353", "0.5746545", "0.5743306", "0.5740146", "0.5735584", "0.573531", "0.57306916", "0.5728002", "0.5726114", "0.5712295", "0.57063454", "0.57012093", "0.5699616", "0.5697952", "0.5690848", "0.5690848", "0.5690848", "0.5690848", "0.56865495", "0.5679922", "0.5661511", "0.5657891", "0.565227", "0.5640761", "0.5640268", "0.56308055", "0.56278914", "0.5626845", "0.5623137", "0.5602244", "0.55977917", "0.5590128", "0.5588994", "0.55764747", "0.5572415", "0.5572395", "0.55719495", "0.55642414", "0.55481756", "0.55475163", "0.5545687", "0.5539541", "0.5539058", "0.5535684", "0.5525741", "0.5525741", "0.5522868", "0.552022", "0.55178523", "0.551002", "0.54977024", "0.54965323", "0.54958045", "0.54895765", "0.5489147", "0.54872143", "0.54832435", "0.5480672", "0.54797536", "0.5478848", "0.54786426", "0.5474712", "0.5473376", "0.54713655", "0.5468879", "0.5468671", "0.5466744", "0.54655164" ]
0.5867437
19
Iteration 2: Steven Spielberg. The best? How many drama movies did STEVEN SPIELBERG direct?
function howManyMovies (array) { return array.filter (dramaMovies => dramaMovies.director === "Steven Spielberg" && dramaMovies.genre.includes ("Drama")).length }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function howManyMovies(movies){\n if (movies == 0){}\n else {\n var dramaFilms = [];\n for (var i = 0; i < movies.length; i++){\n for (var j = 0; j < movies[i].genre.length; j++){\n if (movies[i].genre[j] === 'Drama'){\n dramaFilms.push(movies[i])\n }\n }\n}\n var stevenFilms = dramaFilms.filter(function(elm){\n return elm.director == 'Steven Spielberg';\n });\n return 'Steven Spielberg directed ' + stevenFilms.length + ' drama movies!'\n}\n}", "function howManyMovies(movies) {\n if (movies.length === 0) {\n return;\n }\n\n var spielbergFilms = movies.filter(function(oneMovie) {\n return oneMovie.director === \"Steven Spielberg\";\n });\n\n var dramas = dramaOnly(spielbergFilms);\n\n return \"Steven Spielberg directed \" + dramas.length + \" drama movies!\";\n}", "function main(total, numReqs, movies) {\r\n\r\n var output = \"9 19 29 31 13 72 58 73 10 7 64 69 83 73 33 79 28 0 66 65 77 18 12 39 0 66 55 15 26 55 73 67 38 65 29 47 80 69 27 82 53 55 47 31 31 62 51 29 15 83 43 44 0 28 80 0 76 11 3 79 59 33 83 29 11 20 8 83 52 49 61 69 66 32 17 41 2 57 21 45 10 3 18 77 79 27 76 43 7 5 81 57 11 28 74 60 64 38 72 55 22 1 82 42 28 41 27 14 83 39 70 43 6 67 69 76 7 12 76 11 37 10 2 70 1 77 51 59 21 80 46 21 52 22 74 15 12 32 57 16 40 81 2 5 61 44 14 66 1 56 40 6 49 82 31 56 27 38 6 42 35 51 36 40 82 36 67 69 16 73 20 42 53 0 2 66 26 29 8 17 33 12 54 0 67 8 56 67 6 24 77 81 21 37 28 16 21 45 68 16 74 13 51 73 16 21 78 72 56 12 71 50 46 82 37 32 61 50 13 76 48 79 21 6 10 34 68 63 72 43 65 28 51 36 17 12 56 11 11 78 17 35 58 47 65 81 24 68 68 47 0 73 23 48 82 77 40 79 66 30 49 15 10 44 37 65 67 62 25 45 29 22 26 60 18 3 72 31 45 30 57 67 45 76 55 70 73 24 59 53 66 21 49 59 12 61 25 71 78 26 2 32 59 80 56 77 78 41 74 9 74 44 56 31 43 43 41 37 10 13 74 65 36 25 56 19 12 24 4 81 18 75 81 10 14 68 25 55 26 42 69 56 24 73 56 62 43 10 51 38 26 55 31 23 71 2 64 14 2 0 40 42 24 33 78 8 22 32 6 39 54 51 74 22 39 17 42 46 76 31 29 42 19 7 71 71 5 50 76 22 77 71 39 28 44 13 75 66 69 12 26 39 23 52 34 7 81 41 17 71 60 15 45 0 64 11 54 72 49 25 16 72 38 73 42 22 82 35 47 25 10 42 22 38 82 38 50 49 44 57 53 22 35 7 24 82 82 2 56 41 58 17 24 7 60 47 55 70 10 30 55 25 8 8 3 8 52 39 65 72 20 32 45 70 34 2 72 19 67 62 65 4 8 72 16 78 24 71 0 1 36 8 50 78 12 76 37 50 18 80 21 15 79 83 35 3 32 41 47 37 6 4 62 69 42 82 72 72 10 39 47 25 7 59 79 0 35 23 14 57 5 58 35 70 59 26 47 7 75 42 26 7 36 79 48 55 47 49 24 65 40 56 18 83 56 60 21 26 16 35 0 50 6 33 19 74 23 11 4 67 66 46 54 47 75 77 5 62 49 61 33 41 56 21 23 2 72 5 27 5 10 4 21 2 13 29 8 10 40 63 23 12 55 79 5 82 42 5 83 83 56 39 54 45 29 29 33 2 12 83 72 12 77 69 61 66 79 51 33 12 20 74 75 81 67 24 57 63 24 6 45 70 14 39 51 74 70 21 66 78 62 31 83 54 55 15 29 20 5 58 29 79 69 32 17 17 25 26 51 33 34 54 83 43 52 62 10 7 31 17 75 47 75 36 67 63 60 81 38 31 48 40 47 67 71 25 7 23 32 38 76 42 45 50 3 70 16 33 1 78 1 35 30 59 31 10 53 78 19 0 25 80 42 76 15 71 31 0 9 13 5 50 20 63 82 49 41 37 27 24 70 77 24 28 69 35 82 17 7 13 8 34 38 79 34 31 35 47 13 42 35 38 4 35 39 77 10 5 27 37 82 29 7 16 20 43 70 4 58 82 54 13 62 66 70 35 46 75 49 18 71 4 10 62 56 24 78 35 13 6 18 16 44 79 78 11 13 15 5 60 75 13 83 9 48 66 53 63 79 27 80 74 47 30 8 5 29 61 6 38 61 66 56 51 47 33 20 27 53 83 36 31 67 48 21 27 47 29 55 35 62 2 56 61 31 16 65 50 23 78 30 51 28 58 5 22 71 5 44 3 4 73 37 33 78 10 33 13 75 11 47 4 49 64 6 27 36\";\r\n var fs = require('fs');\r\n var _ = require('lodash');\r\n var moviesArr = getMovies(total);\r\n var requests = movies.split(' ');\r\n var result = [];\r\n\r\n for (var i = 0; i < requests.length; i++) {\r\n var cnt = 0;\r\n //fs.writeFileSync(\"log\" + requests[i] + \".json\", JSON.stringify(moviesArr));\r\n for (var j = 0; j < moviesArr.length; j++) {\r\n\r\n if (moviesArr[j].value === parseInt(requests[i])) {\r\n // console.log(moviesArr[j].index);\r\n for (var k = 0; k < moviesArr.length; k++) {\r\n\r\n if (moviesArr[k].index < moviesArr[j].index) {\r\n moviesArr[k].index++;\r\n } else if (moviesArr[k].index === moviesArr[j].index) {\r\n // console.log(moviesArr[k]);\r\n cnt = moviesArr[k].index - 1;\r\n moviesArr[k].index = 1;\r\n moviesArr = _.orderBy(moviesArr, 'index');\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n else {\r\n // cnt++;\r\n }\r\n\r\n }\r\n\r\n\r\n result.push(cnt);\r\n }\r\n\r\n console.log(result.join(' ') === output);\r\n return result.join(' ');\r\n}", "function howManyMovies(movies)\n{\n if (movies.length==0) return;\n var moviesSpielberg = movies.filter(function(movie){\n return (movie.genre.indexOf('Drama')!=-1 && movie.director === 'Steven Spielberg');\n });\n return \"Steven Spielberg directed \" + moviesSpielberg.length + \" drama movies!\";\n}", "function howManyMovies(array){\n var spielbergDrama =\n array.filter(function(oneMovie){\n return oneMovie.director == \"Steven Spielberg\" && oneMovie.genre.includes(\"Drama\");\n });\n // if(spielbergDrama.length < 1){\n // return \"Steven Spielberg directed 0 drama movies!\";\n // // return undefined;\n // }\n return \"Steven Spielberg directed \" + spielbergDrama.length + \" drama movies!\";\n}", "function countSpielbergDramaMovies(steve) {\n let moviesBySteven = steve.filter((movie) => {\n for (let i = 0; i < movie.genre.length; i++)\n if (movie.genre[i].toLowerCase() === 'drama'){\n return true\n }});\n\n const steveActual = moviesBySteven.filter((movie => movie.director === 'Steven Spielberg'));\n\n return steveActual.length;\n }", "function howManyMovies(movies) {\n let movieString = \"\";\n let spielbergMovies = movies.filter(movie => movie.director === 'Steven Spielberg' && movie.genre.includes('Drama'))\n let total = movieString += spielbergMovies.length\n if (total === 0) return undefined\n return `Steven Spielberg directed ${total} drama movies!`\n }", "function dramaMoviesRate(movies){\n const dramaMovie = movies.filter (function(movie)}\n return movie.genre.indexOf(\"Drama\")\n})", "function howManyMovies(movies) {\n var sortedSteven = movies.filter(function(oneMovie) {\n return (\n oneMovie.director === \"Steven Spielberg\" &&\n oneMovie.genre.indexOf(\"Drama\") !== -1\n );\n });\n if (sortedSteven.length === 0) {\n return undefined;\n } else {\n return (\n \"Steven Spielberg directed \" + sortedSteven.length + \" drama movies!\"\n );\n }\n}", "function howManyMovies(movies){\n\n if (moviesSpielberg.length == 0){\n return undefined\n }\n\n let moviesSpielberg = movies.filter(elm => {\n \n\n return elm.director == 'Steven Spielberg' && elm.genre.includes('Drama')\n })\n\n return `Steven Spielberg directed ${moviesSpielberg.length} drama movies`\n\n console.log(moviesSpielberg)\n}", "function howManyMovies(movies) {\n if(movies.length === 0){\n return undefined;\n }\n var spielbergMovies = movies.filter(function(movie) {\n var filterGenres = movie.genre.filter(function(genre) {\n return genre === \"Drama\"; \n })\n if(filterGenres.length > 0 && movie.director === \"Steven Spielberg\"){\n return true;\n }else {\n return false;\n }\n });\n return `Steven Spielberg directed ${spielbergMovies.length} drama movies!`;\n}", "function howManyMovies(movies) {\n if(movies.length === 0) {\n return undefined;\n }\n\n var dramasBySpielberg = movies.filter(function(movie) {\n if(movie.director === 'Steven Spielberg' && movie.genre.indexOf('Drama') !== -1) {\n return movie;\n }\n });\n\n return 'Steven Spielberg directed ' + dramasBySpielberg.length + ' drama movies!';;\n}", "function dramaMoviesScore(movies) {\n dramaMovies = movies.filter(i => i.genre.includes('Drama'))\n return (dramaMovies.reduce((acc, item)=> acc + (item.score || 0), 0) / dramaMovies.length).toFixed(2) * 1 || 0\n}", "function howManyMovies(moviesArray) {\n let dramaMoviesBySpielberg = moviesArray.filter(movie => (movie.genre.includes('Drama')) && (movie.director.includes('Steven Spielberg')))\n if (moviesArray.length == 0) { return undefined }\n return `Steven Spielberg directed ${dramaMoviesBySpielberg.length} drama movies!`\n\n}", "function howManyMovies(array){\n if (array.length === 0){\n return undefined;\n }\n counter = 0;\n for (var i = 0; i < array.length; i++){\n if ((array[i].director === 'Steven Spielberg') \n /* && (movie.genre.indexOf(\"Drama\") !== -1 *//* || movie.genre === \"Drama\") */){\n counter += 1;\n };\n }\n return (\"Steven Spielberg directed \" + counter + \" drama movies!\")\n\n /* var newMovies = \n array.filter(function(movie){\n return (movie.director === 'Steven Spielberg') && (movie.genre.indexOf(\"Drama\") !== -1 || movie.genre === \"Drama\")\n });\n return newMovies; */\n}", "function howManyMovies(movies){\n if (movies.length === 0){\n return undefined\n }\n let movisDrama = movies.filter(movie => movie.genre.includes(`Drama`))\n let moviesSpilber = movisDrama.filter(movie =>movie.director.includes('Steven Spielberg'))\n \n return (`Steven Spielberg directed ${moviesSpilber.length} drama movies!`)\n }", "function bestYearForCinema(movies) {}", "function howManyMovies(someArray) {\n let stevenMovies = 0;\n \n someArray.forEach(eachMovie => {\n if ((eachMovie.director === \"Steven Spielberg\") && (eachMovie.genre.includes('Drama'))) {\n stevenMovies ++\n }\n });\n \n return stevenMovies; \n}", "function howManyMovies(movies) {\n const stevenDrama = movies.filter(elm => elm.director === \"Steven Spielberg\" && elm.genre.includes(\"Drama\"))\n return stevenDrama.length\n}", "function howManyMovies (movies) {\n const moviesSpielberg = movies.filter(aMovie => aMovie.director === \"Steven Spielberg\")\n const moviesSpielbergDrama = moviesSpielberg.filter(aMovie => aMovie.genre.includes(\"Drama\"))\n \n if (moviesSpielbergDrama.length == 0) {\n return 0;\n } \n else {\n return moviesSpielbergDrama.length;\n }\n }", "function howManyMovies(movies) {\n if (movies.length == 0) return;\n\n var dramaMovies = filterDrama(movies);\n\n var result = dramaMovies.filter(function(movie) {\n return movie.director == \"Steven Spielberg\";\n }).length;\n\n return `Steven Spielberg directed ${result} drama movies!`;\n}", "function howManyMovies(moviesArray) {\n if(moviesArray.length === 0){return undefined;}\n let stevenDramaMovies = moviesArray.filter((eachMovie)=>{\n return (eachMovie.genre.includes(\"Drama\")) && (eachMovie.director === 'Steven Spielberg');\n });\n\n return `Steven Spielberg directed ${stevenDramaMovies.length} drama movies!`;\n}", "function howManyMovies(movies) {\n const spielbergDrama = movies.filter(movie => movie.director === \"Steven Spielberg\" && movie.genre.includes(\"Drama\"))\n return spielbergDrama.length\n }", "function howManyMovies(aArray){\n var dramaMovies = aArray.filter(function(item){\n return (item.genre.indexOf('Drama')>-1);\n });\n var dramaMoviesOfstevenSpielberg = dramaMovies.filter(function(item){\n return item.director==='Steven Spielberg';\n });\n if (dramaMovies!=0)\n return 'Steven Spielberg directed '+dramaMoviesOfstevenSpielberg.length+' drama movies!';\n}", "function howManyMovies(arrayOfMovieObjects){\n if(arrayOfMovieObjects.length ===0){return}//this is the same as return undefined\n let dramasBySteven = arrayOfMovieObjects.filter((eachMovie)=>{\n return eachMovie.director === \"Steven Spielberg\" && eachMovie.genre.includes('Drama');\n })\n return `Steven Spielberg directed ${dramasBySteven.length} drama movies!`; \n}", "function howManyMovies(array) {\n if (array.length === 0) {\n return undefined\n }\n else {\n const dramaBySpielberg = array.filter(element => element.genre.includes('Drama') && element.director === 'Steven Spielberg')\n return `Steven Spielberg directed ${dramaBySpielberg.length} drama movies!`\n }\n}", "function howManyMovies(movies) {\n\tif (movies.length == 0) {\n\t\treturn undefined;\n\t}\n\tvar dramaMovies = movies.filter(function(movie) {\n\t\treturn movie.director.includes('Steven Spielberg') && movie.genre.includes('Drama');\n\t});\n\tif (dramaMovies.length >= 0) {\n\t\treturn `Steven Spielberg directed ${dramaMovies.length} drama movies!`;\n\t}\n}", "function howManyMovies(movies) {\n const stevenDrama = movies.filter(function (e, i) {\n return (e.director === 'Steven Spielberg' && e.genre.includes('Drama'));\n });\n return stevenDrama.length;\n}", "function dramaMoviesRate(movies){\n // filter out the drama movies\n const dramas = movies.filter(function (movie))\n\n}", "function howManyMovies(movies) {\n const dramaSpielberg = movies.filter(elm => elm.director === \"Steven Spielberg\" && elm.genre.includes(\"Drama\"))\n return dramaSpielberg.length\n}", "function dramaMoviesScore(movielist) {\n let drama = movielist.filter(function(movie){\n return (movie.genre.includes('Drama'));\n })\n\n let total = 0\n let result = drama.map(x => total += x.score);\n return total/drama.length\n}", "function howManyMovies(movies) {\n let madeBySpielberg = movies.filter(\n element =>\n element.director === \"Steven Spielberg\" && element.genre.includes(\"Drama\")\n );\n return madeBySpielberg.length;\n}", "function howManyMovies(arr) {\n const dramaSpielbergMovies = arr.reduce((acc, movie) => {\n if (\n movie.director === 'Steven Spielberg' &&\n movie.genre.includes('Drama')\n ) {\n return acc + 1;\n } else {\n return acc;\n }\n }, 0);\n return dramaSpielbergMovies;\n}", "function howManyMovies(moviesArray) {\n if (moviesArray == \"\") {\n return;\n }\n\n var dramaSpielberg = moviesArray.filter(function (movie) {\n return (\n movie.genre.includes(\"Drama\") && movie.director == \"Steven Spielberg\"\n );\n });\n\n if (dramaSpielberg.length == 0) {\n return \"Steven Spielberg directed 0 drama movies!\";\n }\n\n return (\n \"Steven Spielberg directed \" + dramaSpielberg.length + \" drama movies!\"\n );\n}", "function dramaMoviesScore(movies) {\n let dramaMovies = movies.filter(movie => movie.genre.includes('Drama'))\n let scores = dramaMovies.map(movie => movie.score)\n let totalScore = scores.reduce(function (result, score){\n return result + score\n })\n return Number((totalScore / scores.length).toFixed(2))\n }", "function dramaMoviesRate() {\n\n}", "function howManyMovies (movies) {\n \n}", "function dramaMoviesRate(movies){\n var dramaFilms = []\nfor (var i = 0; i < movies.length; i++){\n for (var j = 0; j < movies[i].genre.length; j++){\n if (movies[i].genre[j] === 'Drama'){\n dramaFilms.push(movies[i])\n }\n }\n}\nif (dramaFilms == 0){} else {return ratesAverage(dramaFilms);}\n}", "function dramaMoviesRate(movies) {\n const dramaMov = movies.filter(elm => elm.genre.includes(\"Drama\"))\n if (dramaMov < 1) return 0\n let dramaRate = dramaMov.filter(elm => elm.rate).reduce((acc, elm) => acc + elm.rate, 0)\n let finalRate = dramaRate / dramaMov.length\n return +finalRate.toFixed(2)\n}", "function dramaMoviesRate(movies){\n var moviesDrama = movies.filter(function(a){\nif (a.genre.includes(\"Drama\"))\n{\n return true;\n}\n});\n if (!moviesDrama.length)\n {\n return 0;\n }\n\n // llamo al metodo de la iteracion 4 para no generar mas codigo pero ahora le paso el includes de la variable moviesDrama retornando true. \n var avarage = ratesAverage(moviesDrama);\n return avarage;\n}", "function dramaMoviesRate(movies){\n var onlyDrama = movies.filter(function(movie){\n return movie.genre.includes(\"Drama\");\n });\n var totalDrama = onlyDrama.reduce(function(sum,rating){\n return sum + rating.rate;\n }, 0);\nreturn totalDrama / onlyDrama.length;\n}", "function howManyMovies(moviesArray) {\n if (moviesArray.length === 0) {\n return undefined;\n }\n var directorSpiel = moviesArray.filter(function (elemento) {\n return elemento.director === 'Steven Spielberg' && elemento.genre.indexOf('Drama') !=-1;\n });\n return 'Steven Spielberg directed ' + directorSpiel.length + ' drama movies!';\n }", "function howManyMovies(sumMovies) {\n if (sumMovies.length == 0) {\n return undefined;\n }\n\n var onlySteven = sumMovies.filter(function (movie) {\n return movie.director.includes(\"Steven Spielberg\");\n });\n const onlyDramaSteven = onlySteven.filter(function (movie) {\n return movie.genre.includes(\"Drama\");\n });\n\n return (\n \"Steven Spielberg directed \" + onlyDramaSteven.length + \" drama movies!\"\n );\n}", "function howManyMovies(oldarr) {\r\n if (oldarr.length > 0) {\r\n let mitjaDrama = oldarr.filter((e) => {\r\n if ((e.genre.indexOf('Drama') !== -1) && (e.director.indexOf('Steven Spielberg') !== -1))\r\n return e\r\n });\r\n if (mitjaDrama.length >= 0) { return `Steven Spielberg directed ${mitjaDrama.length} drama movies!`; }\r\n } else return undefined;\r\n}", "function howManyMovies(arrayDramaMovies) {\nvar ssDramaMovies = arrayDramaMovies.fliter (function(directorname){\n return directorname.director.includes(\"Steven Spielberg\");\n});\n}", "function howManyMovies (listMovies) {\n\n if (listMovies.length === 0){\n return undefined;\n }\n else{\n var dramaSp= \n listMovies.filter (function (array){\n return array.genre.includes('Drama') && array.director.includes ('Steven Spielberg')\n });\n\n } \n return \"Steven Spielberg directed \"+ dramaSp.length + \" drama movies!\";\n\n}", "function howManyMovies(movies) {\n const spielberg = movies.filter (function(movie) { \n if(movie.director === 'Steven Spielberg' && movie.genre.includes('Drama')) \n return movie\n })\n return spielberg.length\n}", "function howManyMovies(e){\n var arr = e.filter(e => e.director.includes('Steven')); \n arr = arr.filter(e => e.genre.includes('Drama'));\n return \"Steven Spielberg directed \" +arr.length +\" drama movies!\" \n}", "function bestYearAvg(movies){\n movies.sort((a,b) => {\n if (a.year < b.year) {return -1}\n if (a.year > b.year) {return 1}\n return 0;\n });\n let bestAvg = 0;\n let year = 0, \n sum = 0,\n count = 0;\n\n for(let i =0; i.movies.length; i++) { \n if (movies[i].year = year){\n if(bestAvg < sum / count){\n bestAvg = (sum / count)\n beatYear = movies[i].year;\n }\n }\n sum +=Number(movies[i].rate)\n count += 1;\n console.log(Number)\n } \n\n return\n}", "function howManyMovies(arr) {\n let spielbergMovies = [...arr].filter(movie => movie.director === \"Steven Spielberg\");\n let spilbergDramaMovies = spielbergMovies.filter(movie => movie.genre.includes(\"Drama\"));\n return spilbergDramaMovies.length;\n }", "function howManyMovies(sS) {\n if (!sS) return undefined;\n\n const drama = sS.filter(function(movie) {\n if (movie.genre === \"Drama\");\n {\n return movie.genre.includes(\"Drama\");\n }\n });\n\n const filteredDrama = drama.filter(function(film) {\n if (!drama) {\n return \"Steven Spielbierg directed 0 drama movies!\";\n }\n return film.director.includes(\"Steven Spielberg\");\n });\n if (filteredDrama) {\n return `Steven Spielberg directed ${filteredDrama.length} drama movies!`;\n }\n}", "function howManyMovies(arr) {\n if (!arr || arr.length === 0) {\n return undefined;\n }\n var spielbergMovies = arr.filter(function(movie) {\n return (\n movie.director === \"Steven Spielberg\" &&\n movie.genre.indexOf(\"Drama\") !== -1\n );\n });\n\n return (\n \"Steven Spielberg directed \" + spielbergMovies.length + \" drama movies!\"\n );\n}", "function bonus1() { \n count = {}\n highestCounter = 0\n for(i=0; i < morseCode.length; i++){\n currentCounter = 0\n for (j=0; j < morseCode.length; j++){\n if(morseCode[i] === morseCode[j]){\n currentCounter++\n }\n }\n if(currentCounter > highestCounter){\n highestCounter = currentCounter\n console.log(highestCounter)\n }\n }\n\n highest = 0\n repeated = ''\n\n for(prop in count) {\n if(count[prop] > highest) {\n highest = count[prop];\n repeated = prop.toString()\n console.log(\"Repeated:\" + repeated + \"Highest Count: \" + highest)\n }\n }\n repeatArray = []\n\n for(i=0; i < morseCode.length; i++){\n if(repeated === morseCode[i]){\n repeatArray.push(wordList[i])\n }\n }\n console.log(repeated + ' is repeated ' + highest + ' times.')\n console.log('Words: ' + repeatArray.join(', '))\n}", "function howManyMovies(arr) {\n const stevensDramaMovies = arr.filter(movie => {\n return (\n movie.director === \"Steven Spielberg\" && movie.genre.includes(\"Drama\")\n );\n });\n return stevensDramaMovies.length;\n }", "function howManyMovies(arr){\n var dramaSteveFilms = arr.filter(function(obj){\n return (obj.genre.includes('Drama') && obj.director==='Steven Spielberg');\n })\n//'Steven Spielberg directed 0 drama movies!'\n if(dramaSteveFilms.length === 0) {\n return undefined;\n }\n\n return 'Steven Spielberg directed ' + dramaSteveFilms.length + ' drama movies!';\n}", "function howManyMovies(movies){\n if (movies.length==0) return undefined;\n var moviesCount=movies.filter(function(movie){\n return movie.genre.indexOf(\"Drama\")!=-1 && movie.director==\"Steven Spielberg\";\n }).length;\n return `Steven Spielberg directed ${moviesCount} drama movies!`;\n}", "function findBestMatch() {\n bestMatch = songMatches[0];\n for (let i = 1; i < songMatches.length; ++i) {\n if ( songMatches[i].popularity > bestMatch.popularity ) {\n bestMatch = songMatches[i];\n }\n }\n}", "function howManyMovies(movies) {\n return movies.reduce(function(acc, val) {\n if (val.director === \"Steven Spielberg\" && val.genre.includes(\"Drama\")) {\n acc += 1;\n }\n return acc;\n }, 0);\n}", "function bestYearAvg(arrayOfMovies){\n if(arrayOfMovies.length ===0){return}\n let trackerThing = {};\n arrayOfMovies.forEach((eachMovie)=>{\n if(trackerThing[eachMovie.year]){\n trackerThing[eachMovie.year].number +=1;\n trackerThing[eachMovie.year].totalRate += Number(eachMovie.rate);\n } else{\n trackerThing[eachMovie.year] = {number: 1, totalRate: Number(eachMovie.rate)};\n }\n\n })\n\n let biggest = 0;\n let year = \"\";\n\n for(let yearKey in trackerThing){\n if(trackerThing[yearKey].totalRate / trackerThing[yearKey].number > biggest){\n biggest = trackerThing[yearKey].totalRate / trackerThing[yearKey].number\n year = yearKey;\n }\n }\n console.log(trackerThing);\n return `The best year was ${year} with an average rate of ${biggest}`\n}", "function dramaMoviesRate(movies) {\n const dramaMovies = movies.filter(function(item){\n const isDrama = item.genre.indexOf('Drama') >= 0;\n return isDrama;\n })\n return ratesAverage (dramaMovies);\n \n}", "function highestRating(movieList){\r\n //first find out which video has the higest rating, then check to see if there are any other videos with that rating.\r\n //push all videos with highest rating into var topVideos array.\r\n //access movieLists[0].videos[0].rating\r\n //access movieLists[0].videos[0].title\r\n //use a forEach loop to check every rating.\r\n var highestRating = 0;\r\n var topMovies = [];\r\n movieList.forEach(genre => {\r\n genre.videos.forEach(video => {\r\n if(video.rating > highestRating){\r\n highestRating = video.rating;\r\n }\r\n });\r\n });\r\n \r\n movieList.forEach(genre => {\r\n genre.videos.forEach(video => {\r\n if(video.rating === highestRating){\r\n topMovies.push(video.title);\r\n }\r\n });\r\n });\r\n return topMovies;\r\n}", "function dramaMoviesRate(movies) {\n let drama = movies.filter(function(elem){\n return elem.genre.includes('drama')\n })\n\n let avg = drama.reduce(function(sum, elem){\n return sum + elem.rate;\n }, 0) \n \n / drama.length;\n}", "function howManyMovies (movieArray) {\n if (movieArray.length===0) return undefined;\n var dramaMovies=movieArray.filter(function(elem){\n //if (elem.genre.indexOf(\"Drama\")>=0) console.log(elem.genre);\n return elem.genre.includes(\"Drama\") && elem.director.includes(\"Steven Spielberg\") ;\n });\n //console.log(dramaMovies.length);\n return \"Steven Spielberg directed \"+ dramaMovies.length+\" drama movies!\";\n}", "function dramaMoviesRate(array) {\n\n}", "function howManyMovies(movies) {\n let dramaMoviesSteven = movies.filter(function(movie) {\n return (\n movie.director === \"Steven Spielberg\" && movie.genre.includes(\"Drama\")\n );\n });\n return dramaMoviesSteven.length;\n}", "function howManyMovies(arr){\n let filter = arr.filter(function(value){\n return value.director === 'Steven Spielberg';\n });\n return `Steven Spielberg directed ${filter.length} drama movies!`\n }", "function dramaMoviesRate(array) {\n const drama = array.filter(elm => elm.genre.includes(\"Drama\"))\n sumRating = drama.reduce((acc, elm) => {\n return acc + elm.rate\n }, 0)\n\n div = 0\n drama.forEach((elm, index) => {\n div++\n if (elm.rate == undefined) div--\n })\n let result = sumRating / div\n if (drama.length == 0) return 0\n return +result.toFixed(2)\n\n}", "function getDramas(){\n const dramaMovies = movies.filter(function(movies){\n return movies.genre == \"Drama\"\n })\n dramaRatings = []\n\n for (let i = 0; i<dramaMovies.length; i+=1){\n dramaRatings.push(dramaMovies[i].rate)\n }\n avgDramaRating(dramaRatings)\n }", "function howManyMovies(arr) {\n if (arr.length === 0){\n return undefined;\n }\n let filteredArray = arr.filter(movie => {\n return movie.genre.indexOf(\"Drama\") !== -1;\n });\n let spielbergMovies = filteredArray.filter(movie => {\n return movie.director.indexOf(\"Steven Spielberg\") !== -1;\n }).length;\n return `Steven Spielberg directed ${spielbergMovies} drama movies!`\n}", "evaluate() {\n let highest = 0.0;\n let index = 0;\n for (let i = 0; i < this.population.length; i++) {\n if (this.population[i].fitness > highest) {\n index = i;\n highest = this.population[i].fitness;\n }\n }\n\n this.best = this.population[index].getPhrase();\n if (highest === this.perfectScore) {\n this.finished = true;\n }\n }", "function howManyMovies(arrayMovies) {\n var movies = [];\n if (arrayMovies.length > 0) {\n movies = arrayMovies.filter(function (element) {\n return element.genre.indexOf('Drama') > -1 && element.director === 'Steven Spielberg';\n });\n return ('Steven Spielberg directed ' + movies.length + ' drama movies!');\n } else return undefined;\n}", "function dramaMoviesRate(arr){\n\nlet dramaMovie = 0;\nlet dramaRate = 0;\n\narr.forEach(function(a){\nif(a.genre.includes('Drama')){\n dramaMovie++;\n dramaRate += a.rate\n};\n}); if (dramaMovie === 0){\n return undefined;\n} \n return parseFloat((dramaRate / dramaMovie).toFixed(2));\n}", "function howManyMovies(array){\n \n const stevenDrama = array.filter(function(movie){\n return movie.director === \"Steven Spielberg\" && movie.genre.includes(\"Drama\")\n \n })\n return stevenDrama.length\n }", "function directorMovies(){\nconst director = movies.filter(function(movies){\n return movies.director == \"Steven Spielberg\"\n})\n\nspielBergMovies = []\n\nfor (let i = 0; i<director.length; i+=1){\n spielBergMovies.push(director[i].title)\n}\nconsole.log(\"Steven Spielberg movies has \"+ spielBergMovies.length+ \" movies: \"+ spielBergMovies )\n}", "function dramaMoviesRate(movies) {\n var drama = movies.filter((movie) => movie.genre.includes(\"Drama\"));\n return ratesAverage(drama)\n\n}", "function dramaMoviesScore(movies) {\n const dramaMovies = movies.filter(function(movie){\n if (movie.genre.includes('Drama')) return movie\n })\n\n if (movies.length >= 1) {\n return scoresAverage(dramaMovies)\n }\n}", "function howManyMovies(movies) {\n let drama = movies.filter(function(movie) {\n return movie.genre.includes(\"Drama\") && movie.director === \"Steven Spielberg\"\n })\n return drama.length\n}", "function howManyMovies (movies) {\n let stevenMovies = movies.filter (function (movie) {\n return movie.director === 'Steven Spielberg' && movie.genre.includes('Drama') \n\n });\n\n return stevenMovies.length\n}", "function howManyMovies (movies){\n var drama = movies.filter(function(movie){\n return movie.genre.includes(\"Drama\") && (movie.director === \"Steven Spielberg\")\n });\n \n return drama.length\n }", "function howManyMovies(moviesArray, SearchDirector) {\n if (moviesArray != \"undefined\") {\n var dramaMovies = moviesArray.filter(function (movie) {\n return movie.genre.indexOf(\"Drama\") != -1\n });\n var directorMoviesArray = dramaMovies.filter(function (movie) {\n return movie.director == \"Steven Spielberg\";\n })\n console.log(directorMoviesArray);\n if (directorMoviesArray.length >= 0) {\n return \"Steven Spielberg directed \" + directorMoviesArray.length + \" drama movies!\";\n }\n }\n}", "function dramaMoviesRate(movies){\n let titles = movies.filter((movie) => movie.genre.includes(\"Drama\"));\n titles = titles.map(movie => movie.rate);\n return titles.reduce((ac, cu) => {\n return ac + cu\n });\n console.log(titles);\n}", "function howManyMovies(arr){\n // directedMovies = 0;\n // for(i = 0; i < arr.directed){\n // if(directedMovies = direct )\n // }\n\n let newArray = arr.filter(function(d){\n \n if(d.director === 'Steven Spielberg' && d.genre.includes('Drama')){\n return d\n } \n });\n\n // newArray.forEach(oneMovie => {\n // if(oneMovie.genre.includes('Drama')){\n // directedMovies += 1;\n // }\n // })\n if(arr.length === 0) {\n return undefined;\n }\n\n return `Steven Spielberg directed ${newArray.length} drama movies!`\n}", "function howManyMovies(movies) {\n const dramaMovies = []\n movies.map(function(movie){\n if (movie.director === 'Steven Spielberg') {\n movie.genre.filter(function(genre){\n if (genre === 'Drama') {\n dramaMovies.push(movie)\n }\n })\n }\n })\n \n return dramaMovies.length\n}", "function dramaMoviesRate (movies) {\n var dramaMovie = movies.filter(function(film){\n return film.genre.indexOf('Drama') !== -1;\n });\n if (dramaMovie .length<1){\n return undefined;\n }\n return ratesAverage(dramaMovie);\n}", "function dramaMoviesRate(movies) {\n\n var arrayDramaMovies = movies.filter (function(genredrama){\n return genredrama.genre.includes(\"drama\")\n }); \n\n var totalDramaRates = arrayDramaMovies.reduce (function(accumulator,dramaMovies) {\n return accumulator + Number(dramaMovies.rate);\n },0);\n console.log (\"The average of dramam movies is \" + dramaMoviesRate(movies));\n return (totalDramaRates/arrayDraMaMovies.length)\n}", "function howManyMovies(array) {\n const splilbergDrama = array.filter(elm => elm.director == \"Steven Spielberg\" && elm.genre.includes(\"Drama\"))\n return splilbergDrama.length\n\n}", "function howManyMovies (array) {\n let stevenSpiel = array.filter(movie => movie.genre.includes('Drama') && movie.director === 'Steven Spielberg')\n return stevenSpiel.length\n}", "function howManyMovies(movies){\n\n}", "function dramaMoviesScore(moviesArray) {\n const dramaMovies = moviesArray.filter(function(movie){\n if (movie.genre.indexOf('Drama') !== -1) {\n return movie;\n } \n }); \n if (dramaMovies.length === 0) {\n return 0;\n };\n const averageDramaMovies = dramaMovies.reduce(function (sum, movie){\n return sum + movie.score; \n }, 0); return Math.round((averageDramaMovies / dramaMovies.length) * 100) /100\n}", "function howManyMovies(movieList) {\n let howMany = 0;\n movieList.filter(function(drama) {\n if (\n drama.director === \"Steven Spielberg\" &&\n drama.genre.includes(\"Drama\")\n ) {\n return howMany++;\n } else if (drama.director !== \"Steven Spielberg\") {\n return 0;\n } else {\n return 0;\n }\n });\n return howMany;\n}", "function dramaMoviesRate (movies) {\n if (movies.length === 0) return 0 \n const result = movies.filter (movie => movie.genre.includes('Drama'))\n return ratesAverage(result)\n}", "function howManyMovies(movies) {\n if (movies.length === 0) {\n return 0\n } \n let moviesStevenDra = movies.filter(function(item, index) {\n if (item.genre.includes(\"Drama\") && item.director === \"Steven Spielberg\") {\n return true\n } else {\n return false\n }\n }) \n return moviesStevenDra.length\n}", "function howManyMovies(array) {\n return array.reduce(function(prevVal, elem) {\n if (elem.director === \"Steven Spielberg\" && elem.genre.indexOf(\"Drama\") >= 0) return prevVal + 1;\n return prevVal;\n }, 0);\n}", "recursiveGetMovie(movies, i, numVotes, SciFiInstance, web3) {\n return SciFiInstance.votes(i).then((result)=>{\n\n const amount = result[1].c[0],\n hexname = result[2],\n retracted = result[3];\n\n if(!retracted) {\n // check if movie exists\n if(movies.find((movie)=>{ return movie.name === web3.toAscii(hexname) })){\n // adjust movie\n const objIndex = movies.findIndex((movie)=>{ return movie.name === web3.toAscii(hexname)})\n movies[objIndex].amount += amount/10000\n\n } else {\n // new movie\n movies = [...movies, {\n name : web3.toAscii(hexname),\n amount : parseFloat(amount/10000)}\n ]\n }\n }\n\n // get the next movie if we're not finished, otherwise: return the movies\n if (i === numVotes) {\n return movies;\n } else {\n return this.recursiveGetMovie(movies, i+1, numVotes, SciFiInstance, web3);\n }\n })\n }", "function dramaMoviesRate(movies) {\n var drama = movies.filter(movie => movie.genre.includes(\"Drama\"));\n if (drama.length === 0) {\n return 0;\n }\n return ratesAverage(drama);\n }", "function howManyMovies(moviesArray) {\n let spielbergArray = moviesArray.filter(\n (movie) =>\n movie.director === \"Steven Spielberg\" && movie.genre.includes(\"Drama\")\n );\n return spielbergArray.length;\n}", "function dramaMoviesRate(movies) {\n const drama = movies.filter(elm => elm.genre.includes(\"Drama\"))\n if(drama.length === 0) {\n return 0\n } else {\n const avgDramaRates = drama.reduce((acc, elm) => {\n if(elm.rate) {\n return acc + elm.rate\n } else {\n return acc\n }\n }, 0) / drama.length\n let avgDramaFixed = Math.round(avgDramaRates * 100) / 100\n return avgDramaFixed\n }\n}", "function howManyMovies(collection){\n var filterMovies;\n if(collection === undefined || collection.length === 0){\n return undefined;\n }\n else{\n filterMovies = collection.filter(function(movie){\n return (movie.genre.includes(\"Drama\") && movie.director.includes(\"Steven Spielberg\"));\n });\n var numberOfMovies;\n if (filterMovies.length === 0){\n numberOfMovies = 0;\n }\n else{\n numberOfMovies = filterMovies.length;\n }\n var msg = \"Steven Spielberg directed \"+ numberOfMovies +\" drama movies!\"\n return msg;\n }\n}", "function howManyMovies(movies) {\n\n const dramaGenre = movies.map(\n movie => { if(movie.genre.includes('Drama')) return movie })\n .filter(movie => movie !== undefined)\n .filter(movie => movie.director === 'Steven Spielberg');\n \n return dramaGenre.length;\n}", "function dramaMoviesScore(movies) {\n let dramaMoviesArr = movies.filter(function(eachMovie){\n return eachMovie.genre.includes('Drama')\n })\n return scoresAverage(dramaMoviesArr)\n}" ]
[ "0.6615484", "0.64351207", "0.63925946", "0.63720953", "0.6357477", "0.6347654", "0.63275844", "0.63090986", "0.630258", "0.62725097", "0.6258774", "0.6219019", "0.6214817", "0.6191437", "0.6177101", "0.61580884", "0.6133858", "0.6133687", "0.61111766", "0.6110609", "0.6105069", "0.60955185", "0.6092185", "0.6087999", "0.6085074", "0.60688126", "0.60372424", "0.60317296", "0.602311", "0.60215443", "0.6010203", "0.59846216", "0.5981132", "0.59805566", "0.5976319", "0.5973595", "0.59735346", "0.5965754", "0.5957868", "0.59576446", "0.59570336", "0.5954246", "0.5939244", "0.593621", "0.59355897", "0.5927746", "0.59238183", "0.5914492", "0.5888384", "0.5887847", "0.58851075", "0.5879245", "0.587865", "0.5876623", "0.58724743", "0.5856872", "0.5837897", "0.58331555", "0.58299285", "0.58238417", "0.5821666", "0.581593", "0.58080065", "0.5806182", "0.58050036", "0.57973254", "0.57935363", "0.57815766", "0.5778924", "0.57750636", "0.57711494", "0.57709855", "0.57675415", "0.5767274", "0.57659036", "0.57632995", "0.5763181", "0.5757806", "0.5754909", "0.575464", "0.57400966", "0.57371837", "0.57344735", "0.5728593", "0.5723255", "0.57210654", "0.5718469", "0.57051855", "0.5692956", "0.56885386", "0.5683459", "0.5683336", "0.56813294", "0.5678942", "0.567411", "0.5672538", "0.5666", "0.56637913", "0.56622255", "0.5653637" ]
0.5766323
74
Iteration 3: All rates average Get the average of all rates with 2 decimals
function ratesAverage (array) { if (array.length === 0) { return 0 } else { const averageRate = array.reduce ((accumulator, current) => { if (!current.rate) { return accumulator + 0 } return accumulator + current.rate }, 0) return Number ((averageRate / array.length).toFixed(2)) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ratesAverage(arr) {\n var allRates = arr.reduce(function(acc, elem) {\n return (acc += Number(elem.rate));\n }, 0);\n return parseFloat((allRates / arr.length).toFixed(2));\n}", "function ratesAverage(arr) {\n let temp = arr.reduce(function(cont, obj) {\n return cont + Number(obj.rate);\n }, 0);\n let result = temp / arr.length;\n let roundedResult = Number(result.toFixed(2));\n return roundedResult;\n }", "function ratesAverage(allRates) {\n\n if (allRates.length === 0) {\n return 0;\n }\n\n meanRates = allRates.reduce( (acc, elem) => elem.rate ? acc + elem.rate : acc + 0, 0)/allRates.length;\n \n return Math.round(meanRates * 100) / 100;\n }", "function ratesAverage(arr) { \n var rates = arr.map(function(obj){\n return obj.rate;\n });\n var total = rates.reduce(function(acc,number){\n return acc+number; \n }, 0); \n return parseFloat((total/rates.length).toFixed(2));\n}", "function ratesAverage(array) {\n return parseFloat((array.reduce((acc, current) => acc + parseFloat(current.rate), 0) / array.length).toFixed(2))\n}", "function ratesAverage(array){\n return parseFloat((array.reduce((acc, current) => acc + parseFloat(current.rate), 0) / array.length).toFixed(2))\n}", "function ratesAverage(array){\n //arrayRates => array que tiene en cada posición el rate de cada película\n var arrayRates = array.map(function(element){\n if(isNaN(parseFloat(element.rate))){\n //caso por si la propiedad rate es rate: \"\"; \n return 0.0;\n }\n \n return parseFloat(element.rate);\n });\n \n //total => variable que tiene el total de rates de todas las películas\n var total = arrayRates.reduce(function(accumulator, current){\n \n return accumulator + current;\n }, 0);\n \n //se redondea a 2 decimales\n return Math.round(((total/(array.length))) * 100) / 100;\n }", "function ratesAverage(arr){\n if (arr.length === 0){\n return 0\n }else{\n\n const totalRates = arr.reduce((accumulator,value) => {\n if(!value.rate) { \n return value.rate = 0; }\n \n return accumulator + value.rate;\n \n},0);\n\nreturn parseFloat((totalRates / arr.length).toFixed(2));\n }\n}", "function ratesAverage(array){\n if (array.length > 0 ){\n const avgRates = array.reduce(function (acc,val){\n if (!val.rate){\n return acc\n }\n return acc + val.rate\n \n },0)\n \n let average = (avgRates/array.length)\n return Number(average.toFixed(2))\n }\n return 0\n }", "function ratesAverage(array){\n var total = array.reduce(function (accumulator, item) {\n return accumulator + Number(item.rate); \n },0).toFixed(2);\n return total/array.length;\n}", "function ratesAverage(avgRate) {\n\n if (avgRate.length === 0) {\n return 0;\n }\n let ratesArray = avgRate.reduce((acc, elm) => {\n return acc + elm.rate\n }, 0);\n return number(ratesArray / avgRate.length.toFixed(2))\n}", "function ratesAverage(arr) {\n let sum = 0;\n sum = arr.reduce((total, item) => total += item.rate, 0);\n return parseFloat((sum / arr.length).toFixed(2))\n}", "function ratesAverage(array) {\n let result = array.reduce((accumulator, currentValue) => accumulator + currentValue.rate, 0);\n return parseFloat((result / array.length).toFixed(2));\n}", "function ratesAverage(array) {\n let average = array.reduce((a, b) => {\n return a + Number(b.rate)\n }, 0) / array.length;\n return parseFloat(average.toFixed(2))\n}", "function ratesAverage (arr) {\n if (arr.length === 0){\n return 0\n } \n \n else {\n const rateArr = arr.map(item => item.rate)\n console.log(rateArr)\n\n const onlyActualRatesArr = rateArr.filter(element => typeof element === 'number')\n \n const sumOfRates = onlyActualRatesArr.reduce((acc, c) => acc + c);\n const averageRates = sumOfRates/rateArr.length;\n return Number(averageRates.toFixed(2));\n }\n}", "function ratesAverage(arr){\n if(arr.length === 0) return 0;\n let sumRate = arr.reduce((sum, elem) => {\n if(elem.rate === undefined) return sum;\n return sum += elem.rate;\n },0);\n return parseFloat((sumRate/arr.length).toFixed(2));\n}", "function ratesAverage(array){\n\n const total = array.reduce(function (sum, item) {\n if (typeof item.rate === 'number')\n {\n return sum + item.rate;\n }else {\n return sum + 0;\n }\n \n },0);\n \n let avgTotal = 0;\n \n if (array.length === 0){\n return 0\n }\n\n avgTotal = total / array.length;\n \n return parseFloat(avgTotal.toFixed(2));\n}", "function ratesAverage(array) {\n\n if (array.length == 0) {\n return 0\n }\n let totalRates = array.reduce((a, c) => {\n\n return a + (c.rate ? c.rate : 0);\n }, 0);\n let avgRate = (totalRates / array.length).toFixed(2);\n\n return Number(avgRate);\n\n}", "function ratesAverage(array) {\n let ratesSum = array.reduce(function(prevVal, elem) {\n if (typeof(elem.rate) === \"undefined\") return prevVal;\n return prevVal + elem.rate;\n }, 0);\n if (array.length > 0) \n return Math.round(100*(ratesSum / array.length)) / 100;\n //alternatively: return Number((ratesSum / array.length).toFixed(2));\n return 0;\n}", "function ratesAverage(array) {\n const sum = array.reduce((sum, element) => sum + parseFloat(element.rate), 0)\n return sum / array.length\n}", "function ratesAverage(array){\n if(array.length===0)\n {return 0};\n let totRate=array.reduce((acc,elem)=>{\n return acc+elem.rate\n },0)\n\n let avgRate=totRate/array.length\n return Number(avgRate.toFixed(2))\n}", "function ratesAverage(array) {\n div = 0\n sumRating = array.reduce((acc, elm) => {\n if (elm.rate == undefined) {\n elm.rate = 0\n }\n return acc + elm.rate\n }, 0)\n\n\n array.forEach((elm, index) => {\n div++\n if (elm.rate == undefined) {\n\n div--\n }\n })\n // console.log(sumRating)\n // console.log(div)\n let result = sumRating / div\n if (array.length == 0) return 0\n //console.log(+result)\n return +result.toFixed(2)\n}", "function ratesAverage(array) {\n let result = array.reduce(function (acc, movie) { \n return acc + Number(movie.rate)\n }, 0) / array.length;\n \n let averageResult = Number(result.toFixed(2)) \n return averageResult\n }", "function ratesAverage(arr) {\n\n var total = arr.reduce(function (sum, item) {\n return sum + Number(item.rate);\n\n }, 0);\n\n return total / arr.length;\n}", "function ratesAverage(array) {\n const mappedArr = array.map(rates => parseFloat(rates.rate));\n const sum = (sumarizer, currentElement) => sumarizer + currentElement;\n let avg = parseFloat(((mappedArr.reduce(sum)) / mappedArr.length).toFixed(2));\n return avg;\n}", "function ratesAverage(arr) {\n if (arr.length === 0) return 0;\n const avrRate =\n arr.reduce((acc, val) => {\n if (!val.rate) val.rate = 0;\n return acc + val.rate;\n }, 0) / arr.length;\n return parseFloat(avrRate.toFixed(2));\n}", "function ratesAverage (arr){\n let sumRate = arr.reduce((acc, item)=> {\n return acc += parseInt(item.rate);\n }, 0)\n return sumRate / arr.length;\n}", "function ratesAverage(array){\n var num = \n array.reduce(function(sum, current){\n return sum += parseFloat(current.rate);\n }, 0);\n var average = parseFloat((num / array.length).toFixed(2));\n return average;\n}", "function ratesAverage(arr) {\n if (arr.length === 0) {\n return 0;\n }\n let totalRates = arr.map(function(movie) {\n return movie.rate;\n });\n const sumRates = totalRates.reduce(function(acc, val) {\n return (acc += val);\n }, 0);\n let totalAverange = sumRates / totalRates.length;\n let totalAverangeRounded = Math.round(totalAverange * 100) / 100;\n return totalAverangeRounded;\n}", "function ratesAverage(arr){\n if(arr.length === 0) return 0;\n const averageRate = arr.reduce((accum, currentValue) => {\n if(!currentValue.rate){\n return accum + 0;\n } else {\n return accum + currentValue.rate; \n }\n },0) / arr.length;\n return Number(averageRate.toFixed(2));\n}", "function ratesAverage(arr) {\n if (arr.length === 0) return 0;\n const total = arr.reduce(function (counter, currentValue, i) {\n if (typeof currentValue.rate === \"number\") {\n return (counter += currentValue.rate);\n }\n return counter;\n }, 0);\n var average = Math.round((total / arr.length) * 100) / 100;\n return average;\n}", "function ratesAverage (array) {\n\n var totalRates = array.reduce (function (sum, oneFilm) {\n \n return sum + Number(oneFilm.rate);\n }, 0);\n\n return Number( (totalRates / array.length).toFixed(2));\n}", "function ratesAverage(arr) {\n if (arr.length > 0) {\n let noZero = arr.filter((movies) => movies.rate);\n let ratesArr = noZero.reduce((ac, cu) => ac += cu.rate, 0) / arr.length;\n return +ratesArr.toFixed(2)\n }\n return 0\n}", "function ratesAverage(arr) {\n return arr.reduce((total, movie) => {\n if (!movie.rate) {return total + 0;} // Essa linha precisei da ajuda do vídeo de solução\n return parseFloat((total + movie.rate / arr.length).toFixed(2));\n }, 0);\n}", "function ratesAverage(arr) {\n\n return Number((arr.reduce((total, movie) => {\n return total + Number(movie.rate);\n }, 0)/arr.length).toFixed(2))\n\n}", "function ratesAverage(array) {\n var sumOfRatings=array.reduce(function(acc, item){\n var rateNumber=item.rate*1; \n return acc+rateNumber;\n },0)\n \n return parseFloat((sumOfRatings/array.length).toFixed(2))*1;\n }", "function ratesAverage (arr){\n if(arr.length===0) {\n return 0;\n }\n let reducedArr = arr.reduce(function(acc, current){\n let updatedAcc = acc + current.rate;\n return updatedAcc;\n }, 0);\n\n let avgArr = reducedArr / arr.length;\n return (Math.round(avgArr * 100)) / 100;\n}", "function ratesAverage (movies){\n let ratesArray = movies.map(movie => /*or Number*/parseFloat(movie.rate))\n let sum= ratesArray.reduce((x, y) => x+y, 0)\n let average= sum/ratesArray.length\n return Math.round(average*100)/100;\n // return Number(average.toFixed(2)); (DONT KNOW WHY ITS NOT WORKING)\n //different solution than Maxence\n}", "function ratesAverage(oldarr) {\r\n let mitja = oldarr.reduce((t, e, i, a) => { return t + e.rate / a.length }, 0);\r\n return (Math.round(mitja * 100) / 100);\r\n}", "function ratesAverage(array) {\n var sum = array.reduce(function(acc, currentValue){\n return acc + currentValue.rate;\n },0);\n return sum/array.length;\n\n}", "function ratesAverage(array){\n var rateSum = array.reduce(function(sum, item){\n return sum+= item.rate;\n },0);\n return rateSum/array.length;\n}", "function ratesAverage(movies){\n if (movies.length === 0) {return 0}\n\n const ratesArray = movies.map (function (movies) {\n return movies.rate;\n });\n\n const totalRate = ratesArray.reduce(function (acc, value) {\n if (typeof(value) !== 'number') { \n return acc\n } \n else {\n return acc + value / (ratesArray.length)};\n }, 0);\n\n return Math.round(totalRate*10**2)/10**2;\n}", "function ratesAverage(tab){\n var rate = tab.reduce(function(sum,el){\n return sum + el.rate;\n }, 0);\n return rate/tab.length;\n}", "function ratesAverage(myArray) {\n if ( myArray.length === 0) {\n return 0\n }\n const totalRates = myArray.reduce((acc,curr) => {\n return acc + (curr.rate || 0)\n },0)\n return Math.round((totalRates / myArray.length) * 100) / 100\n}", "function ratesAverage (movies) {\n if(movies.length == 0) return 0\n const reducer = (acc, currentValue) => currentValue.rate !== undefined ? acc + currentValue.rate : acc;\n\n sum = (movies.reduce(reducer, 0));\n avg = sum / movies.length;\n avgdecimals2 = avg.toFixed(2) \n\n console.log(Number(avgdecimals2));\n return Number(avgdecimals2)\n}", "function ratesAverage(movies) {\n let ratesArray = movies.map(function(movies) {\n return movies.rate;\n });\n let rates =\n ratesArray.reduce(function(sum, value) {\n return sum + value;\n }, 0) / ratesArray.length;\n console.log(rates);\n return Number(rates.toFixed(2));\n}", "function ratesAverage (mov) {\n const sumRates = mov.reduce((acc, obj) => {\n if (! obj.rate) obj.rate = 0\n return acc + parseFloat(obj.rate) \n }, 0) \n return Number((sumRates/mov.length).toFixed(2))\n}", "function ratesAverage(array) {\n let averageRate = array.reduce(function(accumulator, value) {\n return accumulator + value.rate;\n });\n return averageRate / array.lenght;\n}", "function ratesAverage(movies){\n const sumRate = movies.reduce((accumulator, movie) => {\n const rate = parseFloat(movie.rate)\n //console.log(`Accumulator: ${accumulator}, Current rate: ${rate}`)\n return (accumulator + rate)\n }, 0)\n return parseFloat((sumRate / movies.length).toFixed(2))\n}", "function ratesAverage (data) {\n if(data.length === 0){\n return 0\n }\n\n function isEmpty(obj) {\n return Object.keys(obj).length === 0;\n }\n\n const totalRates = data.reduce(function(accu, cur){\n if(isEmpty(cur)){\n return accu + 0\n }else if (cur.rate == ''){\n return accu + 0\n }else{\n return accu + cur.rate\n }\n }, 0)\n\n return Number((totalRates / data.length).toFixed(2))\n}", "function ratesAverage(movies)\n{var sumRates = movies.reduce(function(sum, movie){\n var temp = parseFloat(movie.rate);\n return sum + temp;\n}, 0);\nreturn Math.floor((sumRates/movies.length)*100)/100;\n}", "function ratesAverage(movies) {\n\n //return (movies.reduce((sum, movie) => sum + parseFloat(movie.rate), 0).toFixed(2) / movies.lenght)\n\n let x = movies.reduce((suma, movie) => {\n return suma + parseFloat(movie.rate)\n }, 0)\n return parseFloat((x / movies.length).toFixed(2));\n\n /*let y = 0;\n let x = movies.reduce((suma, movie) => {\n if(!movie.rate) {\n y++\n } else {\n return suma + parseFloat(movie.rate)\n }\n }, 0)\n return (x.toFixed(2) / movies.length - y);*/\n}", "function ratesAverage(movies) {\n var totalRates = movies.reduce (function(accumulator,movie) {\n return accumulator + Number(movie.rate);\n },0);\n var avg = (totalRates/movies.length).toFixed(2);\n // console.log(avg);\n return avg;\n}", "function ratesAverage(arr){\n\nlet rating = 0; \n\narr.forEach(function(n){\nrating += n.rate; \n});\n\nreturn (rating / arr.length);\n}", "function ratesAverage (movie){\n var rate=0.0;\n for (var i=0; i<movie.length;i++){\n rate+=parseFloat(movie[i].rate.toString());\n }\n return ((rate/movie.length).toFixed(2));\n }", "function ratesAverage(array) {\n if (array.length === 0) {\n return 0;\n }\n\n let rateArray = array.map(function(movie) {\n if (!movie.rate) {\n return 0;\n } else {\n return movie.rate;\n }\n });\n\n let sum = rateArray.reduce(function(accumulator, value) {\n return accumulator + value;\n }, 0);\n\n let finalRate = sum / array.length;\n\n return parseFloat(finalRate.toFixed(2));\n}", "function ratesAverage(movies){\n const totalItems = movies.length;\n console.log(totalItems);\n const totalRate = movies.map(mRate => mRate.rate).filter(item => typeof item === 'number').reduce((totalRate, movie) => { return totalRate + movie; }, 0);\n //const totalRate = movies.reduce((totalRate, movie) => (totalRate + movie.rate) + 0);\n\n if (totalItems == 0 ){\n return 0;\n }\n return parseFloat((totalRate / totalItems).toFixed(2));\n }", "function ratesAverage(arr) {\n var ratesArray = [];\n arr.forEach(function(movie) {\n ratesArray.push(Number(movie.rate));\n });\n\n var accumulatedMovies = ratesArray.reduce(function(accumulator, number) {\n return accumulator + number;\n });\n\n return accumulatedMovies / (ratesArray.length);\n}", "function ratesAverage(inputArray)\n{ \n var summary ={\n count:0,\n sum:0\n };\n \n var sumCount = (accumulator,item) =>{\n accumulator.count ++;\n accumulator.sum += Number(item.rate);\n return accumulator;\n };\n\n var object= inputArray.reduce(sumCount,summary); \n var average= object.sum/object.count;\n return Number(average.toFixed(2));\n}", "function ratesAverage (movies){\n var rateArray= movies.map(function(film){\n return Number(film.rate); \n })\n .reduce(function(acc,value){\n return acc+value;\n },0)\n ;\n return Math.round((rateArray/movies.length) * 100) / 100;\n}", "function ratesAverage(movies){\n\n let avg = movies.reduce((prev, current) => {\n return prev + current.rate\n\n }, 0) / movies.length\n\n return parseFloat(avg.toFixed(2))\n}", "function ratesAverage(someArray) {\n let sum = someArray.reduce((a, b) => {\n return a + Number(b.rate)\n }, 0);\n return sum / someArray.length;\n}", "function ratesAverage(movies) {\n let totalRates = movies.reduce(function(acumulador, item){\n let mov =0;\n if(item.rate != \"\"){\n mov = parseFloat(item.rate)\n } \n \n return acumulador + mov\n }, 0)\n return parseFloat((totalRates / movies.length).toFixed(2))\n}", "function ratesAverage(array) {\n if (!array.length) {\n return 0;\n }\n let avg = array.reduce(function (acc, movie) {\n if (\"rate\" in movie) {\n return acc + movie.rate;\n } else {\n return acc;\n }\n }, 0);\n avg /= array.length;\n return Number(avg.toFixed(2));\n}", "function ratesAverage(movies){\n if(movies.length == 0){\n return 0;\n } \n var avg = movies.reduce(function(a , b){\n \n if(typeof a && typeof b.rate === 'number'){\n return a += b.rate;\n }else{\n return a+= 0;\n }\n\n },0)\n var average = avg/movies.length; \n return Number(average.toFixed(2)) ;\n\n \n \n \n}", "function ratesAverage(array){\nconst rating = array.reduce(accumulator, currentValue){\n return currentValue.rate / array.length \n}\n}", "function ratesAverage(movies) {\n const totalRates = movies.reduce((acc, movie, i) => {\n acc += parseFloat(movie.rate);\n return acc;\n }, 0);\n return totalRates / movies.length;\n}", "function ratesAverage(arr){\n let sum = 0;\n if(arr.length === 0){\n return 0\n }\n \n for(i=0; i<arr.length; i++){\n if(arr[i].rate){ // check if the rate of the movie exists\n sum += arr[i].rate;\n }\n }\n\n let avg = sum/arr.length;\n return Number(avg.toFixed(2));\n}", "function ratesAverage(movies) {\n\n const arrOfrates = movies.map(function (e) {\n return e.rate\n });\n const allRate = arrOfrates.reduce(function (accumulator, currentValue) {\n return accumulator + currentValue;\n }, 0);\n var avgRate = allRate / arrOfrates.length;\n return avgRate.toFixed(2)\n}", "function ratesAverage(collection){\n var allRatings = collection.map(function(movie){\n var ratingsArr = parseFloat(movie.rate);\n return ratingsArr\n });\n var moviesSum = allRatings.reduce(function(rate,movie){\n return (rate + movie); \n },0);\n var moviesAvg = parseFloat(moviesSum) / allRatings.length;\n return parseFloat(moviesAvg.toFixed(2));\n}", "function ratesAverage(movies) {\n if (movies.length === 0) return 0\n const rateMovie = movies.filter(elm => elm.rate).reduce((acc, elm) => acc + elm.rate, 0)\n let result = rateMovie / movies.length\n return +result.toFixed(2);\n}", "function ratesAverage(movies){\n let rates = movies.reduce( (acc, current) => {\n if (typeof current.rate == 'number'){\n return acc + current.rate;\n } else {\n return acc;\n }\n }, 0 );\n\n if (rates > 0){\n return parseFloat( (rates / movies.length).toFixed(2) );\n } else {\n return 0;\n }\n}", "function ratesAverage(movies){\n if(movies.length === 0){\n return 0\n }\n let filteredMovies = movies.filter(function(movie){\n return movie.rate\n })\n \n let sum = filteredMovies.reduce(function(acc, movie){\n return acc + movie.rate\n }, 0)\n \n return Number((sum / movies.length).toFixed(2))\n }", "function ratesAverage(movies){\n var ratesAverage = movies.reduce(function(sum,oneMovies){\n \n return sum + Number(oneMovies.rate);\n \n },0);\n return ratesAverage/movies.length\n \n }", "function ratesAverage(movieArray) {\n return Math.round(movieArray.reduce(function(sum,elem){\n return sum+Number(elem.rate);\n },0)/movieArray.length*100)/100;\n}", "function ratesAverage(peliculas) {\n if (!peliculas.length) return 0\n let sum = 0;\n peliculas.forEach(function(pelicula) {\n if (pelicula.rate)\n sum += pelicula.rate\n })\n return parseFloat((sum / peliculas.length).toFixed(2))\n}", "function ratesAverage(bestMoviesArr) {\n // console.log(movies);\n const totalRate = bestMoviesArr.reduce(\n (acc, cur) => acc + Number(cur.rate),\n 0\n );\n var result = totalRate / bestMoviesArr.length;\n return Number(result.toFixed(2));\n}", "function ratesAverage(moviesArray){\n var sumTotal = moviesArray.reduce(function (acc,elem) {\n return acc + parseFloat(elem.rate);\n },0)\n return sumTotal / moviesArray.length;\n\n}", "function ratesAverage (movies) {\n var total = movies.reduce(function (acc, item) {\n return acc + Number(item.rate);\n }, 0);\n var average = total / movies.length ;\n return Number(average.toFixed(2));\n}", "function ratesAverage(arrayOfMovies) {\n if (!arrayOfMovies.length) return 0;\n let sumOfRates = arrayOfMovies.reduce((accumValue, currValue) => {\n if (currValue.rate > 0) \n return accumValue + currValue.rate; \n return accumValue;\n }, 0)\n return parseFloat((sumOfRates / arrayOfMovies.length).toFixed(2));\n }", "function ratesAverage (e){\n \n var mov = movies.map(e => {\n e.rate= Number(e.rate);\n return e\n}) ;\n\nvar avg = mov.reduce((sum, ele) => {\n return sum + ele.rate/ mov.length;\n},0)\n\navg = Math.round(avg * 100) /100\n \nreturn avg;\n \n}", "function ratesAverage(moviesArray) {\n var sumaRates = moviesArray.reduce(function (accumulator, movie) {\n return accumulator + Number(movie.rate);\n }, 0);\n return Number((sumaRates/ moviesArray.length).toFixed(2));\n }", "function ratesAverage(movies) {\n var average = movies.reduce(function(total, movie) {\n return total + parseFloat(movie.rate||0 ) / movies.length;\n }, 0);\n return parseFloat(average.toFixed(2));\n}", "function ratesAverage(movies){\n if (movies.length==0){\n return undefined;\n }\n return Math.round((movies.reduce(function(acc,movie){\n return acc + parseFloat(movie.rate==''?0:movie.rate);\n },0)/movies.length)*100)/100;\n \n }", "function ratesAverage(movies) {\n if (movies.length === 0) {\n return 0;\n }\n let sum = movies.reduce((ac, movie) => {\n if (typeof(movie.rate) != \"number\") {\n movie.rate = 0\n } return movie.rate + ac\n }, 0)\n return parseFloat((sum/movies.length).toFixed(2));\n}", "function ratesAverage(array) {\n // RETURN AVERAGE EVEN RATE IS EMPTY\n const average = array.reduce((sum, array) => {\n return sum += array.rate;\n }, 0);\n if (!average) {\n return 0;\n } else {\n return Math.round((average / array.length) * 100) / 100;\n }\n}", "function ratesAverage(movies) {\n if(movies.length === 0){\n return undefined;\n }\n var total = movies.reduce(function(acc,current){\n acc += current.rate;\n return acc;\n },0);\n\n total = total / movies.length;\n return parseFloat(total.toFixed(2));\n}", "function ratesAverage(arr){\n if(arr.length===0){\n return 0;\n }else{\n let filmsWithRate=arr.filter(function(movie){\n return movie.rate>=0;\n })\n let totalRate=filmsWithRate.reduce(function(rate, curr){\n return rate+curr.rate\n },0);\n let avgRate=Math.round(totalRate/arr.length*100)/100;\n return avgRate}\n }", "function ratesAverage(moviesArray) {\n if (moviesArray.length === 0) {\n return 0;\n }\n\n const rates = moviesArray.map(function (film) {\n return film.rate;\n });\n\n console.log(rates);\n\n let totalRate = rates.reduce(function (acc, el) {\n if (el) {\n return acc + el;\n } else {\n return acc;\n }\n }, 0);\n\n return Math.round((totalRate / moviesArray.length) * 100) / 100;\n}", "function ratesAverage(array) {\n\n const movieAvg = array.reduce((total, movie) => {\n return movie.rate ? total + movie.rate : total;\n }, 0)\n\n let avgCalc = !array.length ? 0 : movieAvg / array.length\n\n return Math.round((avgCalc * 100)) / 100;\n}", "function ratesAverage(arrayMovies) {\n if (arrayMovies.length > 0) {\n return Number((arrayMovies.reduce(function (accumulated, element) {\n if (!element.rate>0) {element.rate=0.00;}\n return accumulated += parseFloat(element.rate);\n }, 0) / arrayMovies.length).toFixed(2));\n } else return undefined;\n}", "function ratesAverage (array) {\n const sumRatingCalc = array.reduce((total, movie) => {\n return (total + (movie.rate || 0)) // Does this make sense??? [6, , ] should average out to 6 not 2\n }, 0)\n const averageCalc = sumRatingCalc / array.length || 0\n return Math.round(averageCalc * 100) / 100\n}", "function ratesAverage(movies) {\n\nlet sumOfRates = movies.map(movie => movie.rate).reduce((acc, cv) => acc + cv)\nreturn sumOfRates / movie.length\n}", "function ratesAverage(movies){\n var total = movies.reduce(function(acc, film){\n parseFloat(movies.rate) //pasamos de string a number, para poder sumarlos con reduce\n return acc + film.rate / movies.length\n },0);\n var totalDecimal = total.toFixed(2) //redondeamos a 2 decimales\n var totalNumber = parseFloat(totalDecimal)\n return totalNumber;\n}", "function ratesAverage(movies) {\n const moviesAverageRate = [...movies.filter(eachMovie => eachMovie.rate > 0)]\n\n if (moviesAverageRate.length) {\n\n return (parseFloat((moviesAverageRate.reduce((acc, eachMovie) => acc + eachMovie.rate, 0) / movies.length).toFixed(2)));\n\n } else {\n\n return 0\n }\n}", "function ratesAverage (moviesArray) {\n if(moviesArray.length === 0) {\n return 0;\n }\n const averageRate = moviesArray.reduce(function(acc, element) {\n if (!element.rate) {\n return acc + 0;\n }\n return acc + element.rate;\n }, 0) / moviesArray.length;\n \n \n return +averageRate.toFixed(2);\n\n}", "function ratesAverage(moviesArray) {\n\n let averageRate = moviesArray.reduce((accumulator, eachMovie)=>{\n return accumulator + eachMovie.rate; \n },0) / moviesArray.length;\n\n return Number(averageRate.toFixed(2))\n}", "function ratesAverage(movies) {\n if (movies.length === 0) {return 0};\n let totalRates = movies.reduce(function(sum, movie) {\n return sum + movie.rate;\n }, 0)\n let averageRate = totalRates / movies.length\n return Number(averageRate.toFixed(2))\n}", "function ratesAverage(moviesArray){\n if (moviesArray.length === 0){\n return 0;\n }\n let emptyRates = movies.filter((x) => !x.rate).map((x) => (x.rate = 0));\n\n let mAgv = Math.round((movies.reduce(acc, x) => acc + x.rate, 0) * 100) / moviesArray.length) / 100;\n return mAgv;\n\n}", "function ratesAverage(movies) {\n\n var promedio = movies.reduce(function(valor, movie) {\n return valor + parseFloat(movie.rate);\n }, 0);\n\n let sumaPromedio = (promedio / movies.length);\n return sumaPromedio\n}" ]
[ "0.80671453", "0.79506344", "0.7947648", "0.79257774", "0.7885511", "0.788022", "0.7833778", "0.7827568", "0.7827149", "0.77844524", "0.7758602", "0.77556115", "0.7735074", "0.77064794", "0.77026415", "0.76865137", "0.7682448", "0.7655551", "0.7654449", "0.76507545", "0.7649986", "0.76408136", "0.7620757", "0.7598192", "0.7592091", "0.75868165", "0.75813854", "0.75789833", "0.75723976", "0.7534698", "0.7530648", "0.75301665", "0.7526171", "0.7498652", "0.74962866", "0.74899983", "0.74899644", "0.7484913", "0.74537396", "0.74503535", "0.7441119", "0.7426908", "0.7420853", "0.7410776", "0.740693", "0.7400179", "0.73921895", "0.73874605", "0.7357526", "0.73502094", "0.73425925", "0.7341127", "0.7327795", "0.73202235", "0.7286449", "0.72728443", "0.7240823", "0.72204274", "0.7217599", "0.72143036", "0.7212871", "0.7207958", "0.7184519", "0.71757215", "0.71736395", "0.71612924", "0.71577895", "0.7140225", "0.71243095", "0.70856255", "0.70846444", "0.7084504", "0.7065579", "0.70649594", "0.7060552", "0.70499164", "0.70412636", "0.704031", "0.70259815", "0.7021271", "0.70110625", "0.7003313", "0.7003146", "0.6995534", "0.6976164", "0.6968247", "0.69670796", "0.6963631", "0.6954469", "0.6952565", "0.6938951", "0.692149", "0.69204545", "0.6914993", "0.6914495", "0.6904827", "0.6904812", "0.68951964", "0.6892461", "0.68722594" ]
0.7599768
23
Iteration 4: Drama movies Get the average of Drama Movies
function dramaMoviesRate (array) { const dramaMoviesArray = array.filter (dramaMovies => dramaMovies.genre.includes ("Drama")) const totalDramaRate = dramaMoviesArray.reduce ((accumulator, current) => { if (!current.rate) { return accumulator + 0 } return accumulator + current.rate }, 0) if (dramaMoviesArray.length === 0) { return 0 } return Number ((totalDramaRate / dramaMoviesArray.length).toFixed(2)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateMovieAverage() {\n\tfor (let i = 0; i < movies.length; i++) {\n\t\tlet sumOfRatings = movies[i].ratings.reduce((a, b) => a + b, 0);\n\t\tmovies[i].average = sumOfRatings / movies[i].ratings.length;\n\t}\n}", "function dramaMoviesRate(movies) {\n let drama = movies.filter(function(elem){\n return elem.genre.includes('drama')\n })\n\n let avg = drama.reduce(function(sum, elem){\n return sum + elem.rate;\n }, 0) \n \n / drama.length;\n}", "function moviesAverageOfDirector(array, director) {\n \n let movies = getMoviesFromDirector(array, director);\n\n console.log(movies);\n \n let total = 0;\n\n movies.map(({score}) => total+=score)\n \n const resultado = total / movies.length;\n\n return resultado;\n \n}", "function dramaMoviesScore(movies) {\n let dramaMoviesArr = movies.filter(function(eachMovie){\n return eachMovie.genre.includes('Drama')\n })\n return scoresAverage(dramaMoviesArr)\n}", "function dramaMoviesRate(movies) {\n\n var arrayDramaMovies = movies.filter (function(genredrama){\n return genredrama.genre.includes(\"drama\")\n }); \n\n var totalDramaRates = arrayDramaMovies.reduce (function(accumulator,dramaMovies) {\n return accumulator + Number(dramaMovies.rate);\n },0);\n console.log (\"The average of dramam movies is \" + dramaMoviesRate(movies));\n return (totalDramaRates/arrayDraMaMovies.length)\n}", "function dramaMoviesScore(movies) {\n const dramaMovies = movies.filter(function(movie){\n if (movie.genre.includes('Drama')) return movie\n })\n\n if (movies.length >= 1) {\n return scoresAverage(dramaMovies)\n }\n}", "function dramaMoviesRate (movies){\n var dramaM = movies.filter(function(h){\n return h.genre.includes(\"Drama\")\n })\n \n \n var ratAVG = dramaM.map(function(m){\n var ratNum = parseFloat(m.rate);\n m.rate = ratNum;\n return m\n });\n \n var avg = dramaM.reduce(function(acc,l){\n return acc + l.rate/dramaM.length;\n },0);\n console.log(avg);\n }", "function dramaMoviesScore(moviesArray) {\n const dramaMovies = moviesArray.filter(function(movie){\n if (movie.genre.indexOf('Drama') !== -1) {\n return movie;\n } \n }); \n if (dramaMovies.length === 0) {\n return 0;\n };\n const averageDramaMovies = dramaMovies.reduce(function (sum, movie){\n return sum + movie.score; \n }, 0); return Math.round((averageDramaMovies / dramaMovies.length) * 100) /100\n}", "function dramaMoviesScore(movielist) {\n let drama = movielist.filter(function(movie){\n return (movie.genre.includes('Drama'));\n })\n\n let total = 0\n let result = drama.map(x => total += x.score);\n return total/drama.length\n}", "function calculateAverageDramaRate(movies) {\n const drama = movies.filter((value) => {\n return value.genre.includes(\"Drama\")\n }); if (drama.length === 0) {\n return 0\n } else {\n return calculateAverageMovieRate(drama)\n }\n\n\n}", "function dramaMoviesScore(someMovies) {\n const dramaMovies = someMovies.filter((someMovies) =>\n someMovies.genre.includes(\"Drama\"));\n const avgRate = scoresAverage(dramaMovies);\n return avgRate;\n}", "function dramaMoviesRate (e){\n \n var mov = movies.filter(e => {\n return e.genre.includes('Drama')\n })\n \n var avg = mov.reduce((sum, ele) => {\n return sum + ele.rate/ mov.length;\n },0)\n \n avg = Math.round(avg * 100) /100\n if(avg === 0){\n return undefined\n}\n return avg;\n \n }", "function dramaMoviesRate (movies) {\n if (movies.length === 0) return 0 \n const result = movies.filter (movie => movie.genre.includes('Drama'))\n return ratesAverage(result)\n}", "function dramaMoviesRate(movies){\n var dramaFilms = []\nfor (var i = 0; i < movies.length; i++){\n for (var j = 0; j < movies[i].genre.length; j++){\n if (movies[i].genre[j] === 'Drama'){\n dramaFilms.push(movies[i])\n }\n }\n}\nif (dramaFilms == 0){} else {return ratesAverage(dramaFilms);}\n}", "function dramaMoviesRate(movies) {\n var drama = movies.filter((movie) => movie.genre.includes(\"Drama\"));\n return ratesAverage(drama)\n\n}", "function dramaMoviesRate (movies) {\n var dramaMovie = movies.filter(function(film){\n return film.genre.indexOf('Drama') !== -1;\n });\n if (dramaMovie .length<1){\n return undefined;\n }\n return ratesAverage(dramaMovie);\n}", "function dramaMoviesRate(movies){\n if(movies.length == 0){\n return 0;\n } \n var avgDrama = movies.filter(function(movie){\n return movie.genre.includes(\"Drama\");\n\n })\n return ratesAverage(avgDrama) ;\n\n}", "function dramaMoviesRate(movies){\n var moviesDrama = movies.filter(function(a){\nif (a.genre.includes(\"Drama\"))\n{\n return true;\n}\n});\n if (!moviesDrama.length)\n {\n return 0;\n }\n\n // llamo al metodo de la iteracion 4 para no generar mas codigo pero ahora le paso el includes de la variable moviesDrama retornando true. \n var avarage = ratesAverage(moviesDrama);\n return avarage;\n}", "function dramaMoviesRate(movies) {\n const dramaMovies = movies.filter(function(item){\n const isDrama = item.genre.indexOf('Drama') >= 0;\n return isDrama;\n })\n return ratesAverage (dramaMovies);\n \n}", "function getDramas(){\n const dramaMovies = movies.filter(function(movies){\n return movies.genre == \"Drama\"\n })\n dramaRatings = []\n\n for (let i = 0; i<dramaMovies.length; i+=1){\n dramaRatings.push(dramaMovies[i].rate)\n }\n avgDramaRating(dramaRatings)\n }", "function dramaMoviesRate(movies) {\n\n const moviesAverageRateDrama = [...movies.filter(eachMovie => eachMovie.genre.includes('Drama'))]\n\n return ratesAverage(moviesAverageRateDrama)\n\n}", "function dramaMoviesRate(movies){\n var onlyDrama = movies.filter(function(movie){\n return movie.genre.includes(\"Drama\");\n });\n var totalDrama = onlyDrama.reduce(function(sum,rating){\n return sum + rating.rate;\n }, 0);\nreturn totalDrama / onlyDrama.length;\n}", "function dramaMoviesScore(array) {\n\n \n let dramaArray = array.reduce( (sum, elem) => {\n if (elem.genre.includes('Drama')) {\n return sum + Number( (elem.genre.includes('Drama')))\n }\n }, 0 )\n\n \nlet average = Number( (elem.genre.includes('Drama')))\nreturn average;\n}", "function dramaMoviesScore(movies) {\n dramaMovies = movies.filter(i => i.genre.includes('Drama'))\n return (dramaMovies.reduce((acc, item)=> acc + (item.score || 0), 0) / dramaMovies.length).toFixed(2) * 1 || 0\n}", "function dramaMoviesRate(movies){\n\n return ratesAverage(movies.filter(function(movie){\n return movie.genre.indexOf(\"Drama\")!=-1;\n }));\n}", "function dramaMoviesRate(movies) {\n let dramaMovies = movies.filter(function (movie) {\n return movie.genre.includes(\"Drama\");})\n return ratesAverage(dramaMovies);\n}", "function dramaMoviesRate(movies){\n let dramaMovies = movies.filter(movie => movie.genre.some(genre => genre === 'Drama'));\n return ratesAverage(dramaMovies);\n}", "function dramaMoviesRate(movies) {\n var drama = movies.filter(movie => movie.genre.includes(\"Drama\"));\n if (drama.length === 0) {\n return 0;\n }\n return ratesAverage(drama);\n }", "function calculateAverageDramaRate (drama){\n let dramaMovies = drama.filter((movie) => {\n if (movie.genre.indexOf('Drama') > -1){\n return true\n } \n });\n\n if (dramaMovies.length === 0) {\n return 0\n } else {\n return calculateAverageMovieRate(dramaMovies);\n }\n}", "function dramaMoviesRate (movArr) {\n const dramaMovies = movArr.filter(function findDrama(movie) {\n return movie.genre.find(function (genre) {\n return genre === 'Drama'})\n}) \n return ratesAverage (dramaMovies)\n}", "function dramaMoviesRate(movies) {\n let dramaMovies = movies\n .filter(movie => movie.genre.includes('Drama'))\n return ratesAverage(dramaMovies)\n}", "function dramaMoviesRate(movies) {\n let newArr = [...movies];\n let dramaArray = newArr.filter(element => element.genre.includes(\"Drama\"));\n return ratesAverage(dramaArray);\n}", "function dramaMoviesScore(movies) {\n let dramaMovies = movies.filter(movie => movie.genre.includes('Drama'))\n let scores = dramaMovies.map(movie => movie.score)\n let totalScore = scores.reduce(function (result, score){\n return result + score\n })\n return Number((totalScore / scores.length).toFixed(2))\n }", "function dramaMoviesRate(array)\n{\n const stevenDrama = array.filter(function(movie){\n return movie.genre.includes(\"Drama\")\n \n })\n const totalRates = stevenDrama.reduce(function (acc,val){\n if (!val.rate){\n return acc\n }\n return acc + val.rate\n \n },0) \n \n let average = (totalRates/array.length)\n return Number(average.toFixed(2))\n}", "function dramaMoviesRate(array) { \n\n let dramaMovies = array.filter(function (movie) { \n return movie.genre.indexOf('Drama') >= 0;\n })\n \n let result = dramaMovies.map(function (movie) { \n return movie.rate;\n }).reduce(function (acc, rate) { \n return acc + Number(rate);\n }, 0)\n \n let average = result / dramaMovies.length \n if (dramaMovies.length === 0) {\n return 0;\n } else {\n return Number(average.toFixed(2));\n }\n }", "function dramaMoviesRate(movies){\n \n const totalItems = movies.length;\n const totalDramaRate = movies.reduce((totalDramaRate, movieDrama) => { return totalDramaRate + movieDrama.rate; } ,0);\n\n return avgDramaRate = (parseFloat((totalDramaRate / totalItems).toFixed(2)));\n}", "function dramaMoviesRate(movies){\n \n let dramaMovies = movies.filter(function(movie){\n return movie.genre == \"Drama\";});\n\n let dramaMoviesLength = dramaMovies.length;\n\n if(dramaMoviesLength == 0)\nreturn 0;\n \n else {\n let ratesDramaSum = dramaMovies.reduce(function (acc, value){\n return acc + value.rate;\n },0);\n\n let avgDramaRate = (ratesDramaSum/dramaMovies.length).toFixed(2);\n let avgDramaRateNumber = Number (avgDramaRate);\n return avgDramaRateNumber;\n }\n}", "function dramaMoviesRate(array) {\n let dramaWord = 0;\n let sum = array.reduce((accumulator, value) => {\n if (value.genre.includes(\"Drama\")) {\n dramaWord += 1;\n return accumulator + value.rate;\n } else {\n return accumulator;\n }\n }, 0);\n if (!dramaWord) {\n return 0;\n }\n\n let average = parseFloat((sum / dramaWord).toFixed(2));\n return average;\n}", "function dramaMoviesRate(array) {\n let dramamov = array.filter(function (movies) {\n return movies.genre.includes('Drama');\n });\n \n let dramaSum = dramamov.reduce((acc, curr) => {\n return acc + curr.rate;\n }, 0);\n\n let avgDrama = Math.round(dramaSum / dramamov.length);\n return avgDrama;\n}", "function dramaMoviesRate(moviePar){\n let dramaMovies = moviePar.filter(movie=> movie.genre.includes ('Drama'))\n return ratesAverage (dramaMovies)\n}", "function dramaMoviesRate(arr) {\n let dramaMovies = [];\n for (let movie of arr) {\n if (movie.genre.includes('Drama')) {\n dramaMovies.push(movie);\n }\n }\n return ratesAverage(dramaMovies);\n}", "function dramaMoviesRate (moviesArray){\n var dramas = moviesArray.filter(function(elem){\n return elem.genre.indexOf(\"Drama\") != -1;\n });\n return ratesAverage(dramas);\n}", "function dramaMoviesRate(movies){\n \n var dramas = movies.filter(function(item) {\n if (item.genre.indexOf('Drama') !== -1){\n return true;\n };\n });\n if (dramas.length === 0) {\n return;\n }\n return ratesAverage(dramas);\n}", "function dramaMoviesRate(movies) {\n const dramaMovies = movies.filter(function (e, i) {\n if (e.genre.includes('Drama')) {\n return e;\n }\n });\n const arrOfrates = dramaMovies.map(function (e) {\n return e.rate\n });\n const allRate = arrOfrates.reduce(function (accumulator, currentValue) {\n return accumulator + currentValue;\n }, 0);\n var avgRate = allRate / arrOfrates.length;\n return avgRate.toFixed(2)\n}", "function dramaMoviesRate(array){\n\n const somaTotal = array.reduce(function (sum, item) {\n if (item.genre.indexOf('Drama')>=0){\n\n if (typeof item.rate === 'number')\n {\n return sum + item.rate;\n }else {\n return sum + 0;\n }\n\n }else{\n return sum + 0;\n }\n },0);\n\n const contDrama = array.reduce(function (cont, item) {\n if (item.genre.indexOf('Drama')>=0){\n return cont + 1;\n }else{\n return cont + 0;\n }\n },0); \n \n let avgTotal = 0;\n \n if (contDrama === 0){\n return 0\n }\n\n avgTotal = somaTotal / contDrama;\n \n return parseFloat(avgTotal.toFixed(2));\n}", "function dramaMoviesRate(mov) {\n let dramaMovies = mov.filter(function(item, index) {\n if (item.genre.includes(\"Drama\")) {\n return true\n } else {\n return false\n }\n }) \n if (dramaMovies.length === 0) {\n return 0\n }\n return ratesAverage(dramaMovies)\n}", "function dramaMoviesRate(array) {\n const dramaMovies = array.filter(element => element.genre.includes(\"Drama\"));\n if (dramaMovies.length === 0) {\n return 0;\n }\n const mapDramaMovies = dramaMovies.map(rates => rates.rate);\n mapDramaMovies.forEach(function (element, index) {\n if (element === \"\") {\n mapDramaMovies[index] = \"0\";\n }\n })\n const sum = (sumarizer, currentElement) => parseFloat(sumarizer) + parseFloat(currentElement);\n let avg = parseFloat(((mapDramaMovies.reduce(sum)) / mapDramaMovies.length).toFixed(2));\n return avg;\n}", "function dramaMoviesRate(movies){\n let moviDrama = movies.filter(movie => movie.genre.includes(`Drama`))\n\n if (moviDrama.length == 0){\n return undefined\n }\n return ratesAverage(moviDrama)\n\n}", "function ratesAverage(movies) {\n\nlet sumOfRates = movies.map(movie => movie.rate).reduce((acc, cv) => acc + cv)\nreturn sumOfRates / movie.length\n}", "function dramaMoviesRate(movies) {\n const drama = movies.filter(elm => elm.genre.includes(\"Drama\"))\n if(drama.length === 0) {\n return 0\n } else {\n const avgDramaRates = drama.reduce((acc, elm) => {\n if(elm.rate) {\n return acc + elm.rate\n } else {\n return acc\n }\n }, 0) / drama.length\n let avgDramaFixed = Math.round(avgDramaRates * 100) / 100\n return avgDramaFixed\n }\n}", "function dramaMoviesRate(arr) {\n let drama = arr.filter(function(movie) {\n return movie.genre.includes(\"Drama\")\n });\n let maped = drama.map(function(e) {\n return e.rate\n })\n let averageDrama = maped.reduce(function(acc, val) {\n return acc + (val|| 0) / maped.length\n }, 0)\nreturn Math.round(averageDrama * 100) / 100\n}", "function dramaMoviesScore(someArray) {\n\n \n let dramaMovies = someArray.filter(eachMovie => {\n return eachMovie.genre.includes('Drama');\n });\n\n let sumDramaScores = dramaMovies.reduce((acc, eachScore) => {\n return acc + eachScore.score;\n },0) ;\n\n let avgDramaScore = sumDramaScores / dramaMovies.length;\n\n let roundedDramaScore = Math.round((avgDramaScore + Number.EPSILON) * 100) / 100;\n\n return roundedDramaScore;\n\n}", "function dramaMoviesRate(arr){\n\n let dramaMovies=arr.filter(function(movie){\n return movie.genre.includes(\"Drama\");\n });\n if(dramaMovies.length===0){return 0;}\n else{\n let totalRateDM=dramaMovies.reduce(function(rate, curr){\n return rate+curr.rate\n },0);\n \n let avgRateDM=Math.round(totalRateDM/dramaMovies.length*100)/100;\n \n return avgRateDM; }\n \n }", "function dramaMoviesRate(arr){\n let dramaMovies = [];\n arr.map(movie => {\n if(movie.genre.includes(\"Drama\")){\n dramaMovies.push(movie);\n }\n return dramaMovies;\n });\n if(dramaMovies.length === 0) return 0;\n let averageRateDrama = dramaMovies.reduce((accum, currentValue) => {\n return accum + currentValue.rate;\n },0) / dramaMovies.length;\n return Number(averageRateDrama.toFixed(2));\n}", "function dramaMoviesRate (movies) {\n const dramaMovies = movies.filter (function(movie) { \n return movie.genre.indexOf('Drama') != -1;\n });\n if (dramaMovies.length != 0) {\n return ratesAverage (dramaMovies) // en vez de hacer de nuevo una funcion para calcular la media, usamos la anterior funcion pero ahora que ataque a dramaMovies\n }\n else {\n return undefined;\n }\n\n}", "function dramaMoviesRate(movies) {\n /*console.log(ratesAverage(movies.filter(movie => movie.genre.indexOf('Drama') !== -1)))*/\n //return ratesAverage(movies.filter(movie => movie.genre.indexOf('Drama') !== -1))\n\n const drama = movies.filter(movie => movie.genre.indexOf('Drama') !== -1)\n if(drama.length === 0) return undefined\n return parseFloat(ratesAverage(drama));\n\n}", "function dramaMoviesRate(movies) {\n console.log(movies);\n let dramaMovies = movies.filter(function(movie) {\n // console.log(movie.genre);\n // console.log(movie.genre.includes(\"Drama\"))\n return movie.genre.includes(\"Drama\");\n });\n return ratesAverage(dramaMovies);\n}", "function dramaMoviesScore(arr) {\n const dramaMovies = arr.filter((movie) => {\n return movie.genre.includes('Drama');\n });\n if (!dramaMovies.length) {\n return 0;\n }\n const averageDramaScore = dramaMovies.reduce((acc, movie) => {\n return acc + movie.score;\n }, 0);\n return Number.parseFloat((averageDramaScore / dramaMovies.length).toFixed(2));\n}", "function dramaMoviesScore(arr){\n let dramas = arr.filter((elem) => {\n if(elem.genre.includes(\"Drama\")){\n return elem\n }\n })\n \n let total = dramas.reduce((sum,elem) => {\n return sum + elem.score\n },0)\n return +((total / dramas.length).toFixed(2))\n}", "function dramaMoviesRate(movies){\n let totalDramaMovies = 0\n let rate = 0;\n const sumRate = movies.reduce((accumulator, movie) => { \n (movie.rate !== '') ? rate = parseFloat(movie.rate) : rate = 0\n \n if((movie.genre.length === 1) && (movie.genre.indexOf('Drama') !== -1)){\n totalDramaMovies ++\n //console.log(`Title: ${movie.title}, Accumulator: ${accumulator}, Current rate: ${rate}`)\n return (accumulator + rate)\n } else {\n return accumulator\n }\n }, 0)\n return (totalDramaMovies !== 0) ? parseFloat((sumRate / totalDramaMovies).toFixed(2)) : undefined\n}", "function calculateAverageMovieRate(movies) {\n const moviesRates = movies.reduce((accumulator, value) => {\n return accumulator + value.rate\n\n }, 0);\n\n return (moviesRates / movies.length)\n}", "function dramaMoviesRate(movies)\n{\n var dramaMovies = movies.filter(function(movie){\n var genreMovie = movie.genre.filter(function(genre){\n return genre==='Drama';\n });\n return genreMovie.length!=0;\n });\n var result = dramaMovies.length===0 ? undefined : parseFloat(ratesAverage(dramaMovies).toFixed(2));\n console.log(result);\n return result;\n}", "function dramaMoviesRate(array) {\n \n const moviesDrama = array.map(\n movie => {\n if(movie.genre.includes('Drama')) return movie\n }).filter(movie => movie !== undefined)\n \n return ratesAverage(moviesDrama)\n}", "function dramaMoviesRate(arrayMovies) {\n var moviesDrama = [];\n\n moviesDrama = arrayMovies.filter(function (element) {\n return element.genre[0]==='Drama' ;//&& element.rate>0;\n });\n return ratesAverage(moviesDrama);\n}", "function ratesAverage(movies){\n var totalRating = movies.reduce(function(sum, rating){\n return sum + rating.rate ;\n }, 0);\n return totalRating / movies.length ;\n}", "function dramaMoviesRate(moviesArray){\n let dramaMovies = moviesArray.filter((eachMovie)=>{\n return eachMovie.genre.includes(\"Drama\");\n });\n if(dramaMovies.length === 0){return undefined;}\n return ratesAverage(dramaMovies);\n}", "function dramaMoviesRate(array){\n if(array.length===0 && array.genre.length >1 && array.movie.genre !=\"Drama\")\n {return 0};\n \n let totRate=array.reduce((acc,elem)=>{\n return acc+elem.rate\n },0)\n\n let avgRate=totRate/array.length\n return Number(avgRate.toFixed(2))\n}", "function dramaMoviesRate(movie) {\n const dramaMovies = movie.filter((x) => {\n return x.genre.includes('Drama');\n })\n // console.log(ratesAverage(dramaMovies));\n let average = ratesAverage(dramaMovies);\n return isNaN(average) ? 0 : average;\n\n // or \n // let average = Number(ratesAverage(dramaMovies).toFixed(2));\n // return average;\n}", "function dramaMoviesRate (array) {\n const dramaMovies = array.filter(movie => movie.genre.includes('Drama'))\n return ratesAverage(dramaMovies)\n}", "function dramaMoviesRate(movies) {\n var dramaMovies = movies.filter(function(movie) {\n if(movie.genre.indexOf('Drama') !== -1) {\n return movie;\n }\n });\n\n var averageDramaRating = ratesAverage(dramaMovies);\n if(isNaN(averageDramaRating)) {\n return undefined;\n }\n return averageDramaRating;\n}", "function dramaMoviesRate(movies) {\n var dramaMovies = filterDrama(movies);\n\n if (dramaMovies.length == 0) return;\n\n return ratesAverage(dramaMovies);\n}", "function dramaMoviesRate(arr) {\n let movieDramas = arr.filter(function(movie) {\n return movie.genre.includes(\"Drama\");\n });\n return ratesAverage(movieDramas);\n}", "function dramaMoviesRate(moviesArray) {\n\n const dramaMovies = []\n let totalRate = 0;\n\n moviesArray.filter(function (drama) {\n drama.genre.map(function (d) {\n d === 'Drama' ? dramaMovies.push(drama.rate) : null\n })\n })\n\n dramaMovies.forEach(e => totalRate += e)\n\n return (totalRate / dramaMovies.length) ? Math.round((totalRate / dramaMovies.length) * 100) / 100 : 0\n\n}", "function dramaMoviesRate(movies) {\n var dramaMoviesRate = [];\n var avgDramaRate = 0;\n\n var dramaMovies = movies.filter(function(movie) {\n return movie.genre.includes(\"Drama\");\n });\n dramaMovies.map(function(element) {\n dramaMoviesRate.push(Number.parseFloat(element.rate).toFixed(2) * 1);\n });\n if (dramaMovies.length === 0) {\n return undefined;\n } else if (dramaMovies.length === 1) {\n var result = Number.parseFloat(dramaMovies[0].rate).toFixed(2); //al fer el fixed to torna a string\n return Number.parseFloat(result);\n } else if (dramaMovies.length > 1) {\n avgDramaRate = dramaMoviesRate.reduce(function(acc, val) {\n return acc + val;\n });\n }\n var finalRate = (avgDramaRate / dramaMovies.length).toFixed(2);\n return Number.parseFloat(finalRate);\n}", "function dramaMoviesRate (movieArray) {\n var dramaMovies=movieArray.filter(function(elem){\n //if (elem.genre.indexOf(\"Drama\")>=0) console.log(elem.genre);\n return elem.genre.indexOf(\"Drama\")>=0;\n });\n console.log(dramaMovies.length);\n if (dramaMovies.length===0) return undefined;\n return ratesAverage(dramaMovies);\n}", "function dramaMoviesRate(moviesArray) {\n let result = ratesAverage(moviesArray.filter(movie => movie.genre.includes('Drama')))\n\n console.log(result)\n return (result)\n}", "function dramaMoviesRate(movies) {\n var drama = movies.filter(function(oneDrama) {\n return oneDrama.genre.indexOf(\"Drama\") !== -1;\n });\n if (isNaN(ratesAverage(drama))) {\n return undefined;\n } else {\n return ratesAverage(drama);\n }\n}", "function dramaMoviesRate(array) {\n const dramaMovies = array.filter(y =>\n y.genre.includes(\"Drama\")\n )\n if (dramaMovies.length === 0) return 0\n const averageDrama = dramaMovies.reduce(function (sum, movie) {\n return sum + movie.rate\n }, 0)\n return roundToTwo(averageDrama / dramaMovies.length)\n}", "function ratesAverage(movies) {\n\n var promedio = movies.reduce(function(valor, movie) {\n return valor + parseFloat(movie.rate);\n }, 0);\n\n let sumaPromedio = (promedio / movies.length);\n return sumaPromedio\n}", "function dramaMoviesRate(movies) {\n\tvar dramaMovies = movies.filter((movie) => {\n\t\treturn movie.genre.includes('Drama');\n\t});\n\tif (dramaMovies.length > 0) {\n\t\treturn ratesAverage(dramaMovies);\n\t} else {\n\t\treturn undefined;\n\t}\n}", "function dramaMoviesRate(array) {\n let dramaRates = array.filter(array => array.genre.includes(\"Drama\"));\n\n let dramaAverage = ratesAverage(dramaRates);\n\n return dramaAverage;\n}", "function scoresAverage(movies) {\n let scores = movies.map(movie => movie.score)\n let totalScore = scores.reduce(function (result, score){\n return result + score\n })\n return Number((totalScore / scores.length).toFixed(2))\n }", "function dramaMoviesRate(moviesArray) {\n var dramaMovie = moviesArray.filter(function (pelicula) {\n return pelicula.genre.indexOf('Drama') !== -1;\n });\n if (dramaMovie.length===0) {\n return ;\n }\n return (ratesAverage(dramaMovie));\n }", "function dramaMoviesRate(array) {\n const drama = array.filter(elm => elm.genre.includes(\"Drama\"))\n sumRating = drama.reduce((acc, elm) => {\n return acc + elm.rate\n }, 0)\n\n div = 0\n drama.forEach((elm, index) => {\n div++\n if (elm.rate == undefined) div--\n })\n let result = sumRating / div\n if (drama.length == 0) return 0\n return +result.toFixed(2)\n\n}", "function dramaMoviesRate (arrayOfMovies) {\n let dramaMovies = arrayOfMovies.filter(movie => (movie.genre.includes(\"Drama\")));\n if (!dramaMovies.length) return 0;\n return ratesAverage(dramaMovies);\n }", "function dramaMoviesRate(array) {\n let dramaMovies = array.filter(function(movie) {\n if (movie.genre.indexOf('Drama') !== -1) {\n return true;\n }\n return false\n });\n \n if (dramaMovies.length == 0 ){\n return 0;\n }\n \n return (ratesAverage(dramaMovies));\n \n }", "function dramaMoviesRate(array){\n var dramaArray = array.filter(function(movie){\n return (movie.genre.indexOf(\"Drama\") !== -1 || movie.genre === \"Drama\");\n });\n counter = 0;\n for (var i = 0; i < length.dramaArray; i++){\n if(dramaArray.rate === ''){\n dramaArray.rate = 0;\n counter += 1;\n };\n }\n\n if (dramaArray === []){\n return undefined;\n };\n return ratesAverage(dramaArray);\n\n var num = \n dramaArray.reduce(function(sum, current){\n return sum += parseFloat(current.rate);\n }, 0);\n var average = parseFloat((num / (dramaArray.length - counter).toFixed(2)));\n return average;\n}", "function dramaMoviesRate(arrayOfMovies){\n let filteredMovies = arrayOfMovies.filter(function(movie) {\n if (movie.genre.includes('Drama')) {\n return movie\n }\n }); \n return ratesAverage(filteredMovies);\n}", "function dramaMoviesRate(movies) {\n const dramaMov = movies.filter(elm => elm.genre.includes(\"Drama\"))\n if (dramaMov < 1) return 0\n let dramaRate = dramaMov.filter(elm => elm.rate).reduce((acc, elm) => acc + elm.rate, 0)\n let finalRate = dramaRate / dramaMov.length\n return +finalRate.toFixed(2)\n}", "function scoresAverage(movies) {\n return (movies.reduce((acc, item)=> acc + (item.score || 0), 0) / movies.length).toFixed(2) * 1 || 0\n}", "function dramaMoviesRate(movies) {\n var filterMovies = movies.filter(function(movie) {\n var filterGenres = movie.genre.filter(function(genre) {\n return genre === \"Drama\"; \n })\n //console.log(filterGenres);\n return filterGenres.length > 0;\n })\n console.log(filterMovies);\n return ratesAverage(filterMovies);\n}", "function dramaMoviesRate(dramaMovies) {\n if (dramaMovies.length === 0) return 0;\n const filteredMovies = dramaMovies.filter(function(movie) {\n if (movie.rate === \"\") movie.rate = 0;\n return movie.genre.includes(\"Drama\");\n });\n if (!filteredMovies.length) return undefined;\n const avg = ratesAverage(filteredMovies);\n return avg;\n // return avg;\n}", "function dramaMoviesRate(array) {\n const arrayDrama = array.filter((movieDrama) => {\n return drama = movieDrama.genre.includes('Drama');\n });\n return ratesAverage(arrayDrama);\n}", "function ratesAverage(movies){\n var ratesAverage = movies.reduce(function(sum,oneMovies){\n \n return sum + Number(oneMovies.rate);\n \n },0);\n return ratesAverage/movies.length\n \n }", "function dramaMoviesRate(array){\n var dramaMovies =\n array.filter(function(oneMovie){\n var movieGenre = oneMovie.genre;\n // console.log(movieGenre);\n // console.log(movieGenre.includes('Drama'));\n if(oneMovie.rate == \"\" ){\n oneMovie.rate=0;\n }\n if (movieGenre.includes('Drama')===false){\n return undefined;\n }\n return movieGenre.includes('Drama');\n });\n if(dramaMovies.length < 1){\n return undefined;\n }\n var ratesCount = 0;\n dramaMovies.forEach(function(oneDrama){\n ratesCount += parseFloat(oneDrama.rate);\n });\n var avgRate = ratesCount/dramaMovies.length;\n avgRate = precisionRound(avgRate);\n // console.log(avgRate);\n return avgRate;\n \n // return dramaMovies;\n \n }", "function ratesAverage(movies) {\n let totalSum = movies.reduce(function(accumulator, value) {\n return accumulator + parseInt(value.rate, 10);\n }, 0);\n return totalSum / movies.length;\n}", "function rateAverage(movies){\n var ratAVG = movies.map(function(m){\n var ratNum = parseFloat(m.rate);\n m.rate = ratNum;\n return m\n });\n \n var avg = movies.reduce(function(acc,l){\n return acc + l.rate/movies.length;\n },0);\n}", "function dramaMoviesRate(tab){\n var tab2 = tab.filter(function(el){\n return el.genre.indexOf('Drama') != -1;\n }) ;\n if (tab2.length ==0){\n return 0;\n }\n return Math.round(ratesAverage(tab2)*100)/100;\n}", "function dramaMoviesRate(myArray) {\n const totalDramaArray = myArray.filter(dramaMovies => dramaMovies.genre.includes(\"Drama\"))\n return ratesAverage(totalDramaArray)\n \n}", "function dramaMoviesRate (movies) {\n const dramas = movies.filter(aMovie => aMovie.genre.includes(\"Drama\"))\n const total = dramas.reduce((sum, movie) => {\n if (movie.rate != \"\" && movie.rate != undefined) {\n return sum + movie.rate ;\n }\n else {\n return sum;\n } \n }, 0);\n\n if (dramas.length === 0) {\n return 0;\n }\n else {\n let aveNum = total / dramas.length;\n return Number.parseFloat(aveNum.toFixed(2));\n }\n}", "function dramaMoviesRate(movies){\n const dramaMovie = movies.filter (function(movie)}\n return movie.genre.indexOf(\"Drama\")\n})" ]
[ "0.81957364", "0.8133081", "0.8052378", "0.80023414", "0.7962245", "0.79441017", "0.7880204", "0.7867686", "0.786345", "0.7804334", "0.7782986", "0.77755874", "0.77485806", "0.77287227", "0.7704139", "0.7699077", "0.76935977", "0.7687617", "0.76865757", "0.7664305", "0.76448625", "0.7627095", "0.7623114", "0.7615416", "0.7610569", "0.76078266", "0.7600898", "0.75979483", "0.7595262", "0.75924295", "0.7588189", "0.7581938", "0.75662476", "0.75491315", "0.7534094", "0.7528685", "0.7525757", "0.7516642", "0.75155836", "0.7513565", "0.7513544", "0.7510584", "0.75022477", "0.7497707", "0.74938357", "0.747782", "0.74759257", "0.747402", "0.7473951", "0.74691683", "0.7453547", "0.7444443", "0.7433696", "0.7425253", "0.74101645", "0.73961884", "0.7395675", "0.7379999", "0.7368791", "0.7367618", "0.7354777", "0.73292404", "0.7323181", "0.73231375", "0.7315822", "0.7314614", "0.73030806", "0.72996736", "0.7299229", "0.72988635", "0.7274947", "0.72683805", "0.7253321", "0.72497296", "0.72339326", "0.72327197", "0.723044", "0.7225301", "0.7221629", "0.72080207", "0.7206025", "0.7203193", "0.7202599", "0.72011626", "0.7195385", "0.7194772", "0.7189307", "0.71879405", "0.7179882", "0.71704143", "0.7162007", "0.71618843", "0.71501917", "0.71456057", "0.7141901", "0.7137764", "0.7126515", "0.71227694", "0.71206474", "0.71192586", "0.7117888" ]
0.0
-1
Iteration 5: Ordering by year Order by year, ascending (in growing order)
function orderByYear (array) { const yearsOrdered = array.slice().sort (function (a, b) { if (a.year > b.year) { return 1 } if (a.year < b.year) { return -1 } if (a.year === b.year) { if (a.title > b.title) { return 1 } if (a.title < b.title) { return -1 } } }) return yearsOrdered }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function orderByYear(someArr){\n const order = someArr.sort((a, b) => a.year > b.year ? 1 : -1)\n return order;\n}", "function orderByYear(arr) {\n let byYear = [...arr].sort((s1, s2) => {\n if (s1.year > s2.year) return 1;\n else return -1\n })\n return byYear\n}", "sortAlbumsYear() {\n this.albumsList.sort((album1, album2)=>{\n if(album1.year < album2.year){\n return -1\n } else if (album1.year > album2.year) {\n return 1\n } else {\n return 0\n }\n })\n }", "function orderByYear (arr){\n let byYear = []\n const sortedYears = arr.sort((a, b) => {\n let alpha = a.year - b.year \n if (alpha === 0){\n return a.title.localeCompare(b.title)\n }\n return alpha\n }) \n byYear = sortedYears\n return byYear\n}", "function orderByYear(array) {\n // array.forEach(elm => console.log(elm.duration))\n const yearArray = [...array]\n yearArray.sort((a, b) => {\n a.year - b.year\n\n if (a.year - b.year == 0) {\n\n if (a.title < b.title) {\n return -1\n }\n\n return 1\n\n }\n return a.year - b.year\n\n })\n\n return yearArray\n}", "function orderByYear(moviesArray) {\n\n\n const orderByYear = moviesArray.map(function (e) {\n return { title: e.title, year: e.year }\n })\n\n orderByYear.sort((a, b) => (a.year > b.year) ? 1 : -1)\n\n const objectOrderByYear = {}\n const arrayOrderByYear = []\n\n orderByYear.forEach(function (e, idx) {\n objectOrderByYear.year = e.year\n arrayOrderByYear.push({ year: objectOrderByYear.year })\n })\n\n // console.log(arrayOrderByYear);\n\n return arrayOrderByYear\n}", "function sorterenyear(a, b) {\r\n return d3.ascending(year(a), year(b));\r\n}", "function orderByYear(array) {\n const order = [...array].sort(function(a, b) {\n if(a.year === b.year){\n return a.title.localeCompare(b.title)\n }\n return a.year - b.year;\n });\n return order;\n }", "function orderByYear() {\n \n}", "function orderByYear(movies) {\n if (movies.length > 0) {\n return [];\n } \n else {\n return movies.sort((num1, num2) => {\n if(num1.year !== num2.year){\n return num1.year - num2.year\n }\n else {\n if(word1.year < word2.year) {\n return 1\n }\n else {\n if(word1.year > word2.year) {\n return -1\n }\n else {\n return 0\n }\n }\n }\n })\n } \n}", "filterAndSortDataByYear () {\n }", "function orderByYear(array){\n \n array.sort(function(a, b) {\n // Sort by year\n var dCount = a.year - b.year;\n if(dCount) return dCount;\n \n // If there is a tie, sort by title\n var dYear = ('' + a.title).localeCompare(b.title);\n return dYear;\n });\n let newArr = [...array]\n return newArr\n }", "function orderByYear(array){\n\n \n array.sort(function (a, b) {\n if (a.year > b.year) return 1; // 1 here (instead of -1 for ASC)\n if (a.year < b.year) return -1; // -1 here (instead of 1 for ASC)\n //if (a.year === b.year) return 0;\n if (a.year === b.year) {\n if (a.title > b.title) return 1;\n if (a.title < b.title) return -1;\n if (a.title === b.title) return 0;\n }\n });\n\n const newArray = Array.from(array)\n\n return newArray;\n\n}", "function sortByYear\n(\n array\n) \n{\n return array.sort(function(a,b)\n {\n var x = parseInt(a.number.split('-')[1]);\n var y = parseInt(b.number.split('-')[1]);\n return ((x < y) ? -1 : ((x > y) ? 0 : 1));\n }).reverse();\n}", "function orderByYear (anArr) {\n return anArr.sort((a, b) => {\n if (a.year > b.year) {\n return 1;\n } else if (a.year < b.year) {\n return -1;\n } else {\n if (a.title > b.title) {\n return 1;\n } else if (a.title < b.title) {\n return -1;\n }\n }\n})\n}", "function orderByYear(arr) {\n let sortedByYear = [];\n for (let movie of arr) {sortedByYear.push(movie);}\n sortedByYear.sort((a, b) => {\n if (a.year < b.year) {return -1;}\n if (a.year > b.year) {return 1;}\n return a.title.localeCompare(b.title); // com ajuda da solução\n });\n return sortedByYear;\n}", "function orderByYear(array) {\n const sortedArray = array.slice().sort((a, b) => {\n if (a.year !== b.year) {\n return a.year - b.year;\n } else {\n return a.title.localeCompare(b.title);\n }\n });\n return sortedArray;\n}", "function orderByYear(movies) {\n const newYearOrder = [...movies]\n\n newYearOrder.sort((a, b) => {\n\n if (a.year === b.year) {\n return a.title.localeCompare(b.title)\n } else {\n return a.year - b.year\n }\n })\n return newYearOrder\n}", "function orderByYear(array) {\n const sortedArray = array.slice().sort(function (a, b) {\n if (a.year !== b.year) {\n return a.year - b.year;\n } else {\n return a.title.localeCompare(b.title);\n }\n });\n return sortedArray;\n}", "function orderByYear(arr) {\n let clone = JSON.parse(JSON.stringify(arr))\n \n clone.sort((first, second) => {\n if(first.year > second.year){\n return 1\n }\n else if(first.year < second.year){\n return -1\n }\n else{\n if(first.title > second.title){\n return 1\n }\n else if(first.title < second.title){\n return -1\n }\n else{\n return 0\n }\n }\n })\n return clone\n}", "function orderByYear(arr) {\n return arr.map(function (movie) {\n return movie.year;\n });\n orderByYear\n}", "function orderByYear(arr) {\n \n const moviesOrdered = [...arr].sort((a, b) => {\n if (a.year > b.year) {\n return 1;\n } else if (a.year < b.year) {\n \n return -1;\n }\n else if (a.year == b.year && a.title > b.title) {\n return 1;\n } \n else if (a.year == b.year && a.title < b.title) {\n return -1;\n } \n });\nreturn moviesOrdered;\n}", "function orderByYear(array) {\n let newArray = array.map(elm => {\n return elm\n })\n newArray.sort((a, b) => {\n if (a.year > b.year) return 1\n\n if (a.year < b.year) return -1\n\n if ((a.year == b.year) && (a.title > b.title)) return 1\n if ((a.year == b.year) && (a.title < b.title)) return -1\n })\n return newArray\n}", "function orderByYear(movies) {\n var sortedArray = movies.sort(function (movie1, movie2) {\n var movie1Year = movie1.year;\n var movie2Year = movie2.year;\n if (movie1Year < movie2Year) {\n // console.log(\"first movie is older \" + movie1Year + \" \" + movie2Year);\n return -1;\n } else if (movie1Year > movie2Year) {\n // console.log(\"first movie is younger \" + movie1Year + \" \" + movie2Year);\n return +1;\n } else {\n // console.log(\"movies came out the same year \" + movie1Year + \" \" + movie2Year);\n var movie1Name = movie1.title;\n var movie2Name = movie2.title;\n if (movie1Name > movie2Name) {\n // console.log(\"the first movie should go after \" + movie1Name + \" \" + movie2Name)\n return +1;\n } else if (movie1Name < movie2Name) {\n // console.log(\"the first movie should go first \" + movie1Name + \" \" + movie2Name);\n return -1;\n }\n }\n })\n // console.log(sortedArray);\n return sortedArray;\n}", "function orderByYear(array) {\n\n let newSortedArray = [...array];\n newSortedArray.sort(function (a, b) {\n let year = a.year - b.year;\n if (year === 0) {\n return a.title.localeCompare(b.title);\n }\n return year;\n });\n return newSortedArray;\n}", "function orderByYear (array) {\n array.sort((a, b) => {\n if (parseInt(a.year) > parseInt(b.year)) {\n return 1\n } else if (parseInt(a.year) < parseInt(b.year)) {\n return -1\n } else {\n if (a.title > b.title) {\n return 1\n } else if (a.title < b.title) {\n return -1\n } else {\n return 0\n }\n }\n })\n return array\n}", "function orderByYear(yearOfMovie) {\n\n let copiaMovies = [...yearOfMovie];\n function ordenar(a,b) {\n if (a.year !== b.year){\n return a.year - b.year;\n } else {\n return a.title.localeCompare(b.title);\n }\n }\n\n return copiaMovies.sort(ordenar);\n}", "function orderByYear(array) {\n const arrayYear = array.filter((movieYear) => {\n return year = movieYear.year;\n });\n return arrayYearSorted = arrayYear.sort((a, b) => {\n if (a.year > b.year) { //YEAR SORTING\n return 1;\n } else if (a.year === b.year) { //IF YEAR IS EQUAL THEN TITLE SORT\n if (a.title > b.title) {\n return 1;\n } else return -1;\n return 1;\n } else return -1;\n });\n}", "function orderByYear(arr) {\n const newOrderByYear = arr;\n if (newOrderByYear.length === 0) return null;\n newOrderByYear.sort(function tata(a, b) {\n if (a.year === b.year) {\n\n if (a.title.toLowerCase() < b.title.toLowerCase()) return -1;\n if (a.title.toLowerCase() > b.title.toLowerCase()) return 1;\n return 0;\n\n }\n return a.year - b.year;\n });\n\n return newOrderByYear;\n}", "function orderByYear(someArray) {\n\n let moviesCopy = JSON.parse(JSON.stringify(someArray));\n \n let orderedMovies = moviesCopy.sort((a,b) => a.year - b.year);\n\n \n return orderedMovies;\n}", "function orderByYear (array) { \n let orderedArray = array.sort((a, b) => { \n if(a.year === b.year && a.title.toLowerCase() > b.title.toLowerCase()){ \n return 1;\n } else if(a.year === b.year && a.title.toLowerCase() < b.title.toLowerCase()) { \n return -1;\n } else if (a.year > b.year) { \n return 1;\n } else if (a. year < b.year){ \n return -1;\n } else { \n return 0; \n } \n });\n return orderedArray;\n }", "function orderByYear(movies) {\n let newArray =[...movies];\n return newArray.sort((movie1,movie2) => {\n if(movie1.year > movie2.year) {return 1}\n else {return -1}})\n}", "function orderByYear(array) {\n\n let newSortedArray = JSON.parse( JSON.stringify(people) )\n\n newSortedArray.sort( (first, second) => {\n if (first.year > second.year) {\n return 1\n }\n else if (first.year < second.year) {\n return -1\n }\n else {\n return 0\n }\n\n })\n\n return newSortedArray\n}", "function orderByYear (array) {\n const clone = Array.from(array)\n return clone.sort((movieA, movieB) => {\n if (movieA.year < movieB.year) {\n return -1\n } else if (movieA.year > movieB.year) {\n return 1\n } else {\n if (movieA.title < movieB.title) {\n return -1\n } else if (movieA.title > movieB.title) {\n return 1\n }\n return 0\n }\n })\n}", "function orderByYear(data){\n return data.slice(0).sort(function(a,b){\n if(a.year - b.year == 0 ){\n if (a.title.toLowerCase() > b.title.toLowerCase()){\n return 1\n }else if (a.title.toLowerCase() < b.title.toLowerCase()){\n return -1\n }else{\n return 0\n }\n }else{\n return a.year - b.year\n }\n })\n}", "function orderByYear(movies) {\n let newArr = movies.sort((x, y) => {\n if (x.year > y.year) {\n return 1;\n } else if (x.year < y.year) {\n return -1;\n }\n });\n let sortedArr = [...newArr];\n return sortedArr;\n}", "function orderByYear(arr) {\n let objFromArray = arr.slice();\n let ordered = objFromArray.sort(function(a, b) {\n if(a.year === b.year) {\n return a.title.localeCompare(b.title);\n }else {\n return a.year - b.year\n }\n });\n return ordered;\n}", "function orderByYear(arr){\n return arr.sort((mov1, mov2)=> {\n if (mov1.year - mov2.year ===0){\n if (mov1.title > mov2.title)return 1;\n if (mov1.title< mov2.title) return -1\n return 0\n }\n return mov1.year - mov2.year;\n })\n}", "function orderByYear(myArray) {\n const newArray = Array.from(myArray.sort((a, b) => {\n if (a.year === b.year) {\n const stringOrderArray = [a.title,b.title]\n stringOrderArray.sort()\n if (stringOrderArray[0] === a.title) {\n return -1\n }\n return 1\n }\n return a.year - b.year\t\t\n }))\n return newArray\n}", "function orderByYear(arr){\n let sortedArr = arr.concat().sort((a,b) => {\n if(a.year === b.year){\n if(a.title < b.title) return -1;\n if(a.title > b.title) return 1;\n else return 0;\n }\n else return a.year - b.year\n });\n return sortedArr;\n}", "function orderByYear(arr) {\n let mappedArr=arr.map(obj=>obj).sort(function(a,b){\n if (a.year === b.year) {\n return a.title.localeCompare(b.title);\n }\n return a.year - b.year;\n });\n return mappedArr;\n}", "function orderByYear(array) {\n\n let copy = [...array];\n\n copy.sort((a, b) => {\n if (a.year > b.year) return 1;\n if (a.year < b.year) return -1;\n if (a.year == b.year) {\n if (a.title > b.title) return 1;\n if (a.title < b.title) return -1;\n }\n\n });\n return copy;\n}", "function orderByYear(arr) {\n const ordenado = [...arr].sort((movie1, movie2) => {\n if (Number(movie1.year) === Number(movie2.year)) {\n return movie1.title.localeCompare(movie2.title);\n } else {\n return movie1.year - movie2.year;\n }\n });\n return ordenado;\n}", "function orderByYear(arr) {\n const sorted = [...arr].sort(function(a, b) {\n if (a.year === b.year) {\n return a.title.localeCompare(b.title);\n }\n return a.year - b.year;\n });\n return sorted;\n}", "function orderByYear(movies){\n const total = [...movies]\n \n total.sort((a,b) => {\n if(a.year > b.year){\n return 1;\n } else if (a.year < b.year){\n return -1;\n }else {\n if (a.title > b.title){\n return 1;\n } else if (a.title < b.title){\n return -1; \n } else{\n return 0\n }\n}\n } );\n return total\n}", "function orderByYear(someArray) {\n let newArr = someArray.sort((a, b) => {\n if (a.year < b.year) {return -1;} \n if (a.year > b.year) {return 1;} \n return a.title.localeCompare(b.title);\n });\n return newArr;\n}", "function orderByYear(array) {\n let myArray = JSON.parse(JSON.stringify(array));\n return myArray.sort(function(a,b) {\n // Check the order of year\n if (a.year > b.year) return 1;\n if (a.year < b.year) return -1;\n // Years are equal. Check oder of title\n if (a.title > b.title) return 1; \n if (a.title < b.title) return -1;\n return 0; \n });\n}", "function orderByYear(movies) {\n const moviesOrderedByYear = [...movies]\n\n moviesOrderedByYear.sort(function (a, b) {\n if (a.year !== b.year) {\n return a.year - b.year\n }\n if (a.title === b.title) {\n return 0;\n }\n return a.year > b.year ? 1 : -1;\n });\n\n return moviesOrderedByYear\n\n}", "function yearComparator(auto1, auto2){\n return auto2.year - auto1.year;\n}", "function orderByYear(arr){\n const newArr = JSON.parse(JSON.stringify(arr));\n newArr.sort((a,b) => {\n if(a.year < b.year) return -1;\n if(a.year === b.year){\n if(a.title.localeCompare(b.title)<0){\n return -1;\n }\n }\n });\n return newArr;\n}", "function orderByYear(itemsToSort) {\n let sortedItems = [...itemsToSort];\n\n sortedItems.sort(function(a, b) {\n if (a.year === b.year) {\n return a.title.localeCompare(b.title);\n }\n return a.year - b.year;\n });\n return sortedItems;\n}", "function orderByYear(array) {\n\n const newArray = [...array];\n\n const newArray2 = newArray.sort((a, b) => {\n return a.year === b.year ? a.title.localeCompare(b.title) : a.year - b.year;\n })\n\n return newArray2;\n\n}", "function orderByYear(array) {\n let arrayTitle = array.map(movie => {\n \n let container = {};\n\n container.title = movie.title;\n container.year = movie.year;\n\n return container\n });\n\n console.log(arrayTitle);\n\n let ordenPorTitulo = arrayTitle.sort(function(a,b){\n if (a.title > b.title) {\n return 1;\n }\n if (a.title < b.title) {\n return -1;\n }// a must be equal to b\n return 0;\n });\n\n console.log(ordenPorTitulo);\n\n let ordenPorYear = ordenPorTitulo.sort(function(a,b){\n if (a.year > b.year) {\n return 1;\n }\n if (a.year < b.year) {\n return -1;\n }// a must be equal to b\n return 0;\n });\n\n return ordenPorYear;\n\n}", "function orderByYear(movies) {\n const sortedYear = [...movies]\n return sortedYear.sort((a, b) => {\n if (a.year > b.year) {\n return 1;\n } else if (a.year < b.year) {\n return -1;\n } else {\n if (a.title > b.title) {\n return 1;\n } else if (a.title < b.title) {\n return -1;\n }\n\n }\n })\n}", "function orderByYear(yearMovies) {\n return yearMovies.concat().sort((a, b) => {\n if (a.year > b.year) return 1;\n else return -1;\n });\n}", "function orderByYear(movies) {\n const sorted = movies.slice().sort(function (a, b) {\n if (a.year !== b.year) {\n return a.year - b.year; \n } else {\n return a.title.localeCompare(b.title);\n }\n });\n return sorted;\n}", "function orderByYear(array) {\n const newArray = [...array].sort((a, b) => (a.year > b.year) ? 1 : (a.year === b.year) ? ((a.title > b.title) ? 1 : -1) : -1)\n return newArray\n}", "function orderByYear(arr){\n let myArr = JSON.parse(JSON.stringify(arr))\n let pelisOrdenadas=myArr.sort(function(a,b){\n if(a.year===b.year){\n return a.title.localeCompare(b.title);\n }\n return a.year - b.year});\n return pelisOrdenadas\n }", "function orderByYear(movies) {\n const copySort = [...movies].sort((a, b) => {\n if(a.year === b.year) {\n //localeCompare() devuelve -1 o 1 en función de la precedencia entre los títulos a comparar, muy útil para combinar con el sort. Devuelve 0 en caso de ser iguales.\n return a.title.localeCompare(b.title)\n } else {\n return a.year - b.year\n }\n })\n return copySort\n}", "function orderByYear(moviesArray) {\n let sortedMovies = moviesArray.slice().sort(function (movie1, movie2) {\n if (movie1.year === movie2.year) {\n return -1;\n }\n return movie1.year - movie2.year;\n }); return sortedMovies;\n}", "function orderByYear(someArray){\n someArray.sort((a, b) => (a.year > b.year) ? 1 : (a.year === b.year) ? ((a.title.toLowerCase() > b.title.toLowerCase()) ? 1 : -1) : -1 )\n return someArray;\n}", "function orderByYear(peliculas) {\n const sortedPeliculas = [...peliculas];\n sortedPeliculas.sort((a, b) => {\n if (a.year - b.year)\n return a.year - b.year\n else {\n if (a.title < b.title) return -1\n else if (a.title > b.title) return 1\n else return 0\n }\n })\n return sortedPeliculas\n}", "function orderByYear(movies) {\n return movies.slice().sort(function(a, b) {\n if (a === b){\n return a.title.localeCompare(b.title);\n } else {\n return a.year - b.year\n }\n })\n }", "function orderByYear(array) {\n let sortedArray = array.slice().sort(function(a, b) {\n if (a[\"year\"] === b[\"year\"]) {\n return a[\"title\"].localeCompare(b[\"title\"]);\n }\n\n return a[\"year\"] - b[\"year\"];\n });\n\n return sortedArray;\n}", "function orderByYear(array){\n let newArray=JSON.parse(JSON.stringify(array))\n\n\nlet sortNewArray=newArray.sort((a,b)=>{\n if (a.year>b.year){\n return 1\n }\n\n else if (a.year<b.year){\n return -1\n }\n\n else {\n if (a.title>b.title){\n return 1\n }\n else if ( a.title<b.title){\n return -1\n }\n else return 0\n }\n \n }) \n return sortNewArray \n}", "function sortBubblesYear(b1, b2) {\n return b1.year - b2.year;\n}", "function orderByYear(movies) {\n const newArray = movies.map(i => i)\n return newArray.sort((a,b)=> a.year - b.year === 0 ? a.title > b.title? 1 : -1 : a.year - b.year)\n}", "function orderByYear(array) {\n let moviesByYear = [];\n if(array.length===0){\n return moviesByYear\n }\n moviesByYear = array.sort((a, b) => \n (a.year > b.year) ? 1 : (a.year === b.year) \n ?\n ((a.title > b.title) ? 1 : -1)\n : -1\n )\n\n return moviesByYear;\n}", "function orderByYear (arrayOfMovies) {\n let sortedArr = arrayOfMovies.slice().sort((a,b) => {\n if (a.year > b.year) return 1;\n if (a.year < b.year) return -1;\n if (a.title > b.title) return 1;\n if (a.title < b.title) return -1;\n }); \n return sortedArr;\n }", "function orderByYear(movies){\n let moviesClone = JSON.parse(JSON.stringify(movies)); // deep clone\n \n let orderByYear = moviesClone.sort(function(movie1, movie2){\n \n if(movie1.year === movie2.year){\n \n // sorting same year movies alphabetically:\n if(movie1.title < movie2.title){\n return -1\n } else if(movie1.title > movie2.title){\n return 1\n } else {\n return 0\n }\n \n } else {\n \n return movie1.year - movie2.year\n }\n \n })\n return orderByYear\n }", "function orderByYear(arr) {\n\tlet sortedMovies = [ ...arr ].sort((a, b) => {\n\t\tif (a.year < b.year) {\n\t\t\treturn -1;\n\t\t}\n\t\tif (a.year > b.year) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\tif (a.title < b.title) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (a.title > b.title) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t});\n\treturn sortedMovies;\n}", "function orderByYear (movies) {\n if (movies.length === 0) return 0;\n const copy=[...movies];\n copy.sort(function(a, b) {\n return a.year - b.year || a.title.localeCompare(b.title);\n });\n return copy\n }", "function orderByYear (movies) {\n const result = movies\n .map(movie => movie)\n .sort(function(aMovie, anotherMovie){\n if (aMovie.year === anotherMovie.year) {\n const nameA = aMovie.title.toUpperCase(); // ignore upper and lowercase\n const nameB = anotherMovie.title.toUpperCase(); // ignore upper and lowercase\n\n if (nameA < nameB) {\n return -99;\n }\n if (nameA > nameB) {\n return 111222;\n }\n // names must be equal\n return 0;\n } else {\n // 2003-2015 ==> negative\n // 2003-2003 ==> zero\n // 2003-1999 ==> positive\n return aMovie.year - anotherMovie.year;\n }\n });\n return result;\n}", "function orderByYear(moviesArray) {\n let sortMovies = moviesArray.map((x) => x).sort((a, b) => {\n if (a.title < b.title){\n return -1;\n }\n if (a.title > b.title){\n return 1;\n }\n return 0;\n })\n .sort ((a, b) => {\n return a.year - b.year;\n });\n return sortMovies;\n}", "function orderByYear([...movies]){\n return movies.sort( (a, b) => {\n if (a.year > b.year){\n return 1;\n } else if (a.year < b.year){\n return -1;\n } else if (a.title > b.title){\n return 1;\n } else {\n return -1;\n }\n })\n}", "function sortCollectionByDate(collection){\n\treturn collection.sort(function(a, b){\n\t\tif(a[year] < b[year]) return -1;\n\t\tif(a[year] > b[year]) return 1;\n\t\treturn 0;\n\t});\n}", "function buildYearly() {\n yearlyData = [];\n originalData.forEach(buildYearlyForEach);\n}", "function orderByYear(movies) {\n const newMovies = [...movies];\n\n newMovies.sort((a, b) => {\n if (a.year - b.year) {\n return a.year - b.year;\n } else if (a.title > b.title) {\n return 1;\n } else if (a.title < b.title) {\n return -1;\n } else return 0;\n });\n\n return newMovies;\n}", "function sortByYear() {\n if (!window.confirm(\"Sort releases by year?\"))\n return false;\n \n var items = document.getElementsByTagName(\"tr\");\n var years = new Array();\n for (var i=1; i<items.length; i++) { //Starts at one to skip the heading\n var info = items[i].getElementsByTagName(\"td\");\n var year = info[1].innerHTML;\n year = year.split(\"[\")[1].split(\"]\")[0];\n years.push(year);\n }\n years = years.sort();\n GM_log(years);\n \n //Go through each year in the array\n var foundsList = new Array(); //Array of what ones have been ordered\n foundsList.push(null);\n for (i in years)\n foundsList.push(false);\n GM_log(foundsList);\n \n for (i in years) {\n //Find the first torrent in the list that has that year\n var notFound = true;\n var index = 0;\n while (notFound) {\n index++; //Again, start search at one, not zero\n var info = items[index].getElementsByTagName(\"td\");\n var year = info[1].innerHTML;\n year = year.split(\"[\")[1].split(\"]\")[0];\n //Check if this is the year we're looking for\n if ( (years[i] == year) && (foundsList[index] == false) ) {\n notFound = false; //We found it\n foundsList[index] = true;\n //info[0].getElementsByTagName(\"input\")[3].value = i + \"0\";\n //Submit the data to update it\n pending++; //One more is pending\n var postdata = \"action=manage_handle\";\n var data = info[0].getElementsByTagName(\"input\");\n postdata += \"&collageid=\" + data[1].value;\n postdata += \"&groupid=\" + data[2].value;\n postdata += \"&sort=\" + (i*1+1) + '0';\n postdata += \"&submit=Edit\";\n GM_xmlhttpRequest({ 'method' : \"POST\",\n 'url' : data[0].form.action,\n 'headers' : {'Content-Type' : 'application/x-www-form-urlencoded'},\n 'data' : postdata,\n 'onload' : function() {\n pending--;\n if (pending == 0)\n alert(\"Done!\");\n window.location.reload();\n }\n });\n }\n }\n }\n \n //alert(\"Done!\");\n}", "function orderByYear(moviesArray) {\n let orderedArray = moviesArray.slice().sort(function compare(a, b) {\n if (a.year < b.year) {\n return -1;\n }\n if (a.year > b.year) {\n return 1;\n }\n if (a.year === b.year) {\n if (a.title < b.title) {\n return -1;\n }\n if (a.title > b.title) {\n return 1;\n }\n }\n });\n\n return orderedArray;\n}", "function orderByYear(movies) {\n const orderedMovies = movies.map((item) => {\n return item;\n });\n orderedMovies.sort((a, b) => {\n if (a.year > b.year) {\n return 1;\n } else if (b.year > a.year) {\n return -1;\n } else if (a.title > b.title) {\n return 1;\n } else if (b.title > a.title) {\n return -1;\n }\n });\n return orderedMovies;\n}", "function yearComparator( auto1, auto2) {\n //put auto2 as arg1 and auto1 as arg2 to sort the cars in \"reverse\"\n //this produces the desired \"newest cars on top\" sorting effect\n return exComparator(auto2.year, auto1.year);\n}", "function orderByYear(movies) {\n const newArray = movies.map(function(item){\n return item;\n })\n const oldestFirst = newArray.sort(function(a, b){\n if (a.year === b.year) {\n if (a.title > b.title) {\n return 1;\n } \n if (a.title < b.title) {\n return -1;\n }\n return 0;\n }\n return a.year - b.year; \n }); \n return oldestFirst;\n}", "function orderByYear(arr) {\n var newArray = arr.map(function(movie) {\n return movie;\n });\n newArray.sort(function(a, b) {\n if (a.year === b.year) {\n if (a.title > b.title) {\n return 1;\n } else if (a.title < b.title) {\n return -1;\n }\n return 0;\n }\n return a.year - b.year;\n });\n return newArray;\n}", "function orderByYear(movies) {\n let moviesArr = JSON.parse(JSON.stringify(movies))\n\n moviesArr.sort((a,b)=>{\n if(a.year > b.year){\n return 1\n }else if (b.year > a.year) {\n return -1\n } else{\n if(a.title > b.title){\n return 1;\n }else if (b.title > a.title){\n return -1\n }\n return 0\n }\n })\n return moviesArr\n}", "function yearComparator( auto1, auto2){\n /* your code here*/\n if (auto1.year < auto2.year) {\n \treturn true;\n }\n else {\n \treturn false;\n }\n}", "function orderByYear(movies) {\n var order = movies.slice().sort(function(a, b) {\n if (a.year !== b.year) {\n return a.year - b.year;\n } else {\n return a.title.localeCompare(b.title);\n // NOTA : El método localeCompare() devuelve un\n //número que indica si la cadena de caracteres actual es anterior, posterior o igual a la\n //cadena pasada como parámetro, en orden lexicográfico.\n }\n });\n return order;\n}", "function alphabetique(){\n entrepreneurs.sort.year\n }", "function yearComparator( auto1, auto2){\r\n if(auto1.year >= auto2.year){\r\n\t\treturn true;\r\n\t}\r\n\telse{\r\n\t\treturn false;\r\n\t}\r\n}", "function orderByYear(moviesArray) {\n let copiedArray = JSON.parse(JSON.stringify(moviesArray));\n copiedArray.sort((a, b) => {\n if (a.year === b.year && a.title < b.title) {\n return -1;\n } else if (a.year === b.year && a.title > b.title) {\n return 1;\n }\n return a.year - b.year;\n });\n return copiedArray;\n}", "function compareYear(a, b) {\r\n if (a.YEAR < b.YEAR)\r\n return -1;\r\n else if (a.YEAR > b.YEAR)\r\n return 1;\r\n else\r\n return 0;\r\n}", "function yearComparator( auto1, auto2){\r\n\r\n if (auto1.year > auto2.year){\r\n return false;\r\n }else if(auto1.year < auto2.year){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n}", "function orderByYear(moviesArray) {\n let moviesByYear = [...moviesArray].sort(function(movie1, movie2) {\n if (movie1.year > movie2.year) {\n return 1;\n } else if (movie1.year < movie2.year) {\n return -1;\n } else {\n //compare them by title\n if (movie1.title > movie2.title) {\n return 1;\n } else if (movie2.title < movie2.title) {\n return -1;\n }\n }\n });\n return moviesByYear;\n}", "function bestYearAvg(movies){\n movies.sort((a,b) => {\n if (a.year < b.year) {return -1}\n if (a.year > b.year) {return 1}\n return 0;\n });\n let bestAvg = 0;\n let year = 0, \n sum = 0,\n count = 0;\n\n for(let i =0; i.movies.length; i++) { \n if (movies[i].year = year){\n if(bestAvg < sum / count){\n bestAvg = (sum / count)\n beatYear = movies[i].year;\n }\n }\n sum +=Number(movies[i].rate)\n count += 1;\n console.log(Number)\n } \n\n return\n}", "listYears () {\n const dates = []\n let currentDate = Moment(this.minMoment)\n while (currentDate <= this.maxMoment) {\n dates.push({\n text: currentDate.year(),\n value: currentDate.year()\n })\n currentDate = Moment(currentDate).add(1, 'year')\n }\n return dates\n }", "function cmp(a, b) {\n let yearA = a[0].years[0]\n let yearB = b[0].years[0]\n return (yearB > yearA) ? 1 : ((yearB < yearA) ? -1 : 0)\n }", "next() {\n return this.d.clone().add(1, 'year')\n }", "function logSortedByYear(movies) {\r\n var sorted = Object.keys(movies).map(function(key) {\r\n return movies[key];\r\n }).sort(function(a, b) {\r\n return a.Year - b.Year;\r\n })\r\n sorted.forEach(function(movie) {\r\n console.log(movie.Title + \" - \" + movie.Year);\r\n });\r\n}", "function orderByYear(movies) {\n movies.sort(function(a, b) {\n if (a.year === b.year) {\n return a.title.localeCompare(b.title);\n } else {\n return a.year - b.year;\n }\n });\n return movies;\n}", "function yearComparator( auto1, auto2){\n /* your code here*/\n if (auto1.year > auto2.year) {\n return true;\n } else {\n return false;\n }\n}" ]
[ "0.73930913", "0.72207165", "0.7199483", "0.7184372", "0.71712124", "0.7131323", "0.71258926", "0.7112834", "0.70953214", "0.7086341", "0.70824206", "0.70626515", "0.70470494", "0.7039376", "0.6998345", "0.6992632", "0.69889164", "0.6951553", "0.6943999", "0.6936583", "0.6920672", "0.6911526", "0.6907237", "0.69033843", "0.68976367", "0.68695986", "0.685014", "0.68481547", "0.6835043", "0.68311346", "0.68280447", "0.682502", "0.682502", "0.6820659", "0.68204844", "0.6804679", "0.6803787", "0.6792252", "0.678703", "0.678325", "0.6772004", "0.6763467", "0.6748319", "0.67422587", "0.6736305", "0.672566", "0.6725022", "0.6719175", "0.67124325", "0.67007214", "0.66911054", "0.6689239", "0.66680664", "0.6651237", "0.6650829", "0.6609318", "0.66043204", "0.6600592", "0.65961826", "0.6589194", "0.65704614", "0.65701574", "0.6549259", "0.65427834", "0.65281636", "0.65279937", "0.6524296", "0.65237945", "0.6521221", "0.65085596", "0.6471703", "0.64696205", "0.64538884", "0.6435524", "0.6432444", "0.64228916", "0.6404615", "0.64010894", "0.638087", "0.6343785", "0.6343779", "0.6341088", "0.6333884", "0.6327487", "0.6315054", "0.63061523", "0.62964267", "0.62901103", "0.62893736", "0.62861884", "0.6280365", "0.62761676", "0.6269253", "0.6259389", "0.62488896", "0.6240324", "0.6234719", "0.62248", "0.62239224", "0.61917865" ]
0.7076336
11
Iteration 6: Alphabetic Order Order by title and print the first 20 titles
function orderAlphabetically (array) { const sortedTitlesArray = array.map(movie => { return movie.title }).sort() if (sortedTitlesArray.length > 20) { let firstTwenty = [] for (let i=0; i < 20; i++) { firstTwenty.push(sortedTitlesArray[i]) } return firstTwenty } else { return sortedTitlesArray } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function orderAlphabetically(array){\n let titles = array.map(i=>i.title)\n if (array.length <= 20) {\n for (i = 0; i<array.length; i++) {\n console.log(titles.sort()[i]);\n }\n } else {\n for (i = 0; i<20; i++) {\n console.log(titles.sort()[i]);\n }\n }\n}", "function orderAlphabetically(movies) {\nvar arrayTitleMovies = movies.sort(function(movie){\n return movie.title.sort();\n});\nvar i = 0; \nwhile (i<arrayTitleMovies.length) {\n if (i == 20) {\n break;\n }\n i += 1;\n}\n}", "function orderAlphabetically(movies)\n{\n //ordenar per title\n //print els primers 20\n\n var moviesOrdered = movies.sort(function(movieA, movieB){\n if (movieA.title > movieB.title) return 1;\n else return -1;\n });\n var movies20 = moviesOrdered.slice(0,20);\n\n var titles = [];\n movies20.forEach(function(movie){\n titles.push(movie.title);\n });\n console.log(titles);\n return titles;\n}", "function orderAlphabetically(arr) {\n let sorted20s = [...arr]\n let finalList = []\n sorted20s = sorted20s.sort((a,b) =>{\n if (a.title > b.title) {\n return 1;\n } else if (a.title < b.title) {\n return -1;\n }\n })\n sorted20s = sorted20s.slice(0,20)\n for (let key in sorted20s) {\n // console.log(sorted20s[key].title)\n finalList.push(sorted20s[key].title)\n }\n return finalList\n}", "function orderAlphabetically (array) { \n array.sort((a, b) => {\n if(a.title > b.title) { \n return 1;\n } else if (a.title < b.title) { \n return -1;\n } else {\n return 0;\n } \n }); \n const titles = array.map((value) => { \n return value.title\n }); \n const topTwenty = titles.slice(0, 20); \n return topTwenty; \n }", "function orderAlphabetically(movie) {\n const alphabet = movie.sort(function(a,b) {\n if (a.title < b.title) {\n return -1;\n } else if (a.title > b.title) {\n return 1;\n } else {\n return 0 \n }\n});\n const orderedTitles = alphabet.map(list => list.title)\n if (orderedTitles.length > 20) {\n return orderedTitles.slice(0, 20);\n }\n return orderedTitles;\n }", "function orderAlphabetically (movies){\n var orden = movies.sort(function(a,b){\n if (a.title>b.title) return 1;\n if (a.title<b.title) return -1;\n if (a.title === b.title) return 0;\n });\n \n for (i=0; i<20; i++){\n console.log(orden[i].title);\n }\n }", "function orderAlphabetically(arr) {\n const newOrderByTitle = arr.map(function toto(element) {\n return element.title;\n });\n\n newOrderByTitle.sort(function tata(a, b) {\n if (a.toLowerCase() < b.toLowerCase()) return -1;\n if (a.toLowerCase() > b.toLowerCase()) return 1;\n return 0;\n });\n const printTitle = newOrderByTitle.reduce(function tata(\n counter,\n currentValue,\n i\n ) {\n if (i < 20) {\n counter.push(currentValue);\n return counter;\n }\n return counter;\n },\n []);\n return printTitle;\n}", "function orderAlphabetically (data){\n const alphaSortedArry = data.slice(0).sort(function(a,b){\n if (a.title.toLowerCase() > b.title.toLowerCase()){\n return 1\n }else if (a.title.toLowerCase() < b.title.toLowerCase()){\n return -1\n }else{\n return 0\n }\n })\n \n const topTwenty = alphaSortedArry.slice(0,20);\n let topTitles = [];\n let arrLengthReturn = 0;\n \n if(topTwenty.length<20){\n arrLengthReturn = topTwenty.length\n }else{\n arrLengthReturn = 20\n }\n\n for (i=0; i<arrLengthReturn; i++){\n topTitles.push(topTwenty[i].title)\n }\n \n return topTitles\n \n\n\n}", "function orderAlphabetically(tab){\n var tab2= tab.map(function(elt){\n return elt.title;\n })\n\n console.log(tab2);\n var res= tab2.sort();\n return res.slice(0,20);\n}", "function orderAlphabetically(arr) {\n let resultArray = arr.sort((a, b) => {\n if (a.title > b.title) {\n return 1;\n }\n if (a.title < b.title) {\n return -1\n } \n return 0;\n\n})\n let titleArray = resultArray.map(x => {\n return x.title;\n });\n return titleArray.slice(0, 20);\n}", "function orderAlphabetically(arr){\n let contador = [];\n for(let i =0; i<arr.length; i++){\n contador.push(arr[i].title)\n }\n contador.sort();\n return contador.slice(0,20);\n }", "function orderAlphabetically(array) {\n const alphabetArray = [...array]\n alphabetArray.sort((a, b) => {\n if (a.title < b.title) return -1\n if (a.title > b.title) return 1\n return 0\n\n })\n let titles = []\n alphabetArray.forEach(elm => titles.push(elm.title))\n\n let first20 = titles.filter((elm, index) => index < 20)\n return first20\n}", "function orderAlphabetically(someArray){\n someArray.sort((a, b) => (a.title > b.title) ? 1 : -1);\n const onlyTitles = someArray.map((value) => {\n return value.title\n});\n const top20 = onlyTitles.slice(0,20);\n return top20\n console.log(top20)\n}", "function orderAlphabetically(array){\n var sortedArray =\n array.sort(function(a,b){\n if(a.title.toLowerCase() < b.title.toLowerCase()){\n return -1;\n } else if(a.title.toLowerCase() > b.title.toLowerCase()){\n return 1;\n }\n });\n var byTitle20 = [];\n // for(var i = 0; i < 20; i++){\n // byTitle20.push(sortedArray[i].title);\n // }\n var count = 0;\n sortedArray.forEach(function(oneMovie){\n if(count < 20){\n byTitle20.push(oneMovie.title);\n count++;\n } \n });\n \n return byTitle20;\n \n}", "function orderAlphabetically (movies) {\n const first20Titles = movies.map(aMovie => aMovie.title).sort();\n // if (first20Titles.length < 20) {\n // return firstTwentyTitles;\n // }\n // else {\n return first20Titles.slice(0, 20);\n }", "function orderAlphabetically(arr){\n let sorted = arr.concat().sort((a,b) => {\n if(a.title > b.title){\n return 1;\n } \n else if(a.title < b.title){\n return -1;\n }\n });\n let first20 = sorted.slice(0,20);\n let titles = first20.map(movie => {\n return movie.title;\n });\n return titles;\n}", "function orderAlphabetically(movies) {\n const sorted = movies.map((item) => {\n return item.title;\n});\nsorted.sort ((a,b) => {\n return a.localeCompare(b);\n});\nreturn sorted.slice(0,20);\n}", "function orderAlphabetically(movieArray) {\n\n const titleAlpha = []\n const top20titleAlpha = []\n\n const first20Titles = movieArray.filter(e => e.title.toString())\n\n first20Titles.forEach(e => titleAlpha.push(e.title))\n titleAlpha.sort()\n\n titleAlpha.forEach(function (e, idx) {\n idx < 20 ? top20titleAlpha.push(e) : null\n })\n\n return top20titleAlpha\n}", "function orderAlphabetically(movies) {\n const movieTitle = movies.map(movie => movie.title);\n return movieTitle.sort(function(a,b) {\n return a.localeCompare(b);\n }).slice(0,20)\n \n}", "function orderAlphabetically(arr){\n return arr.map(movie => {\n return movie.title\n }).sort((a,b) => {\n if(a > b) return 1;\n if( a < b) return -1;\n return 0;\n }).slice(0,20)\n }", "function orderAlphabetically(movies) {\n\n return movies.map(a => a.title).sort().slice(0, 20)\n\n}", "function orderAlphabetically(movies) {\n let alphaOrder = movies.map(elm => elm.title).sort((a, b) => a.localeCompare(b))\n const top20Alpha = alphaOrder.splice(0, 20)\n return top20Alpha;\n}", "function orderAlphabetically([...movies]){\n let orderArr = movies.sort( (a, b) => {\n if (a.title > b.title){\n return 1;\n } else {\n return -1;\n }\n })\n \n return orderArr.slice(0, 20).map(movie => movie.title);\n}", "function orderAlphabetically(movies) {\n const copySortTitle = [...movies].sort((a, b) => a.title.localeCompare(b.title))\n const twentyTitles = copySortTitle.map(elm => elm.title).slice(0, 20)\n return twentyTitles\n}", "function orderAlphabetically(moviesAlph) {\n let alphArray = moviesAlph.map(elm => {\n return elm.title\n })\n\n alphArray.sort((a, b) => {\n if (a > b) return 1\n if (a < b) return -1\n if (a == b) return 0\n })\n return alphArray.slice(0, 20)\n}", "function orderAlphabetically(movies){\n movies.sort(function(a,b){\n return a.title < b.title ? -1 : 1;\n });\n var first20=[];\n var limit = 20;\n if (movies.length<20){\n limit= movies.length;\n }\n for (var i = 0; i<limit; i++){\n first20.push(movies[i].title);\n }\n return first20;\n}", "function orderAlphabetically(array) {\n let orderAlphArray = array.sort(function (movie1, movie2) { \n let title1 = movie1.title.toLowerCase();\n let title2 = movie2.title.toLowerCase();\n if (title1 > title2) { \n return 1;\n } else if (title1 < title2) {\n return -1;\n }\n return 0;\n })\n return orderAlphArray.map(function (movie) { \n return movie.title\n }).slice(0, 20) \n \n }", "function orderAlphabetically(array) {\nlet title = array.map( (elem) => {\n return array.titles < 20\n})\n\nlet orderedTitle = title.sort(first, second) => {\n if (first.title > second.title) {\n return 1\n }\n else if (first.title < second.title) {\n return 0\n }\n else {\n return 0\n }\n}\n\n return orderedTitle\n}", "function orderAlphabetically(array){\nlet newArray = array.map(function(order){\n return order.title\n});\nlet title = newArray.sort();\nreturn title.slice(0,20);\n}", "function orderAlphabetically(array){\n const arrayOfTitles = array.map(element => element.title)\n const sortedArrayOfTitles = arrayOfTitles.sort()\n if(arrayOfTitles.length < 20){\n return sortedArrayOfTitles\n }\n else{\n return sortedArrayOfTitles.slice(0,20)\n }\n}", "function orderAlphabetically(arr) {\n\n let orderArr = [];\n let total = 0;\n arr.sort((a, b) => {\n if (a.title < b.title) {\n return -1;\n }\n if (a.title > b.title) {\n return 1;\n }\n return 0;\n });\n if (arr.length < 20) {\n total = arr.length;\n } else {\n total = 20;\n }\n for (let i = 0; i < total; i += 1) {\n orderArr.push(arr[i].title);\n }\n //console.log(orderArr)\n return orderArr;\n}", "function orderAlphabetically(movies) {\n let firstTwenty = movies.map(movie => movie.title);\n firstTwenty.sort();\n if (movies.length >=20){\n firstTwenty = firstTwenty.slice(0,20);\n }\n\n return firstTwenty;\n \n}", "function orderAlphabetically(movies) {\n const ordered = movies.sort(function (a, b) {\n if (a.title < b.title) {\n return -1\n } else if (a.title > b.title) {\n return 1\n } else {\n return 0\n };\n });\n return ordered.slice(1, 20);\n\n}", "function orderAlphabetically(arr) {\n let clone = JSON.parse(JSON.stringify(arr))\n \n clone.sort((first, second) =>{\n if(first.title > second.title){\n return 1\n }\n else if(first.title < second.title){\n return -1\n }\n else{\n return 0\n }\n })\n \n return clone.map((elem) => {\n return elem.title\n }).slice(0,20)\n}", "function orderAlphabetically(movies){\n if (movies.length === 0) return 0;\n let titleList = movies.map(function(movie) {\n return movie.title;\n })\n titleList.sort(function(a,b){\n let title1 = a.toLowerCase();\n let title2 = b.toLowerCase();\n if (title1 < title2) return -1;\n if (title1 > title2) return 1;\n if (title1 === title2) return 0;\n })\n if (titleList.length < 20){\n return titleList.slice(0,titleList.length)\n }\n return titleList.slice(0,20)\n }", "function orderAlphabetically(myArray) {\n\tconst titleArray = []\n\tfor (const movie of myArray) {\n\t\ttitleArray.push(movie.title.toLowerCase());\n\t}\n\ttitleArray.sort()\n\treturn titleArray.slice(0,20)\n}", "function orderAlphabetically(movies) {\n let movAlphab = movies.sort(function(a, b) {\n if (a.title > b.title) {\n return 1\n } else if (a.title < b.title) {\n return -1\n } else {\n return 0\n }\n })\n return movAlphab.map(function(item){\n return item.title\n }).slice(0, 20);\n}", "function orderAlphabetically(arr){\n let myArr = JSON.parse(JSON.stringify(arr));\n let alphabetical=myArr.sort(function(a,b){\n return a.title.localeCompare(b.title);\n }); \n let first20=alphabetical.filter(function(a,b){\n return a, b<20;\n })\n let first20Title=first20.map(function(movie){\n return movie.title\n })\n return first20Title;\n }", "function orderAlphabetically (movies){\n\n const array = [...movies].map(function(movie){\n\n return movie.title;\n}) \n var finalArray = array.sort();\n var top = finalArray.slice(0,20) \n\n return top;\n}", "function orderAlphabetically(movies) {\n\n var movieTitles = [...movies];\n \n movieTitles = movies.map(movie => {\n return movie.title;\n });\n\n movieTitles.sort((a, b) => {\n if (a.toLowerCase() > b.toLowerCase())\n return 1;\n if (a.toLowerCase() < b.toLowerCase())\n return -1;\n return 0;\n });\n\n\n const top20= movieTitles.slice(0,20);\n return top20;\n}", "function orderAlphabetically(arr) {\n return arr\n // let orderTop20 = [...arr].sort((a, b) => {\n // if (a.title > b.title) {\n // return 1;\n // } else if (a.title < b.title) {\n // return -1;\n // }\n // })\n .map(movies => movies.title)\n .sort()\n .slice(0, 20);\n return orderTop20;\n }", "function orderAlphabetically(movies) {\n const sortedArr = movies.sort((movieA, movieB) => movieA.title.localeCompare(movieB.title));\n const orderedTitles = sortedArr.map(list => list.title)\n if (orderedTitles.length > 20) {\n return orderedTitles.slice(0, 20);\n }\n return orderedTitles;\n}", "function orderAlphabetically (movies) {\n var filmTitle = movies\n .map(function(film){\n return film.title\n })\n .sort(function(a,b){\n return a>b? 1 : -1 \n })\n \n if (filmTitle.length >20)\nreturn filmTitle.filter(function(film){\n return filmTitle.indexOf(film)<20;\n })\n else return filmTitle;\n }", "function orderAlphabetically(arr) {\n arr.sort(function(a, b) {\n if (a.title > b.title) {\n return 1;\n }\n if (a.title < b.title) {\n return -1;\n }\n return 0;\n });\n if(arr.length<20){\n return arr;\n \n }else{\n return arr.splice(0,20);\n }\n }", "function orderAlphabetically(moviesArray){\n return moviesArray.map((x) => x.title)\n sort()\n .slice(0, 20);\n}", "function orderAlphabetically(movies) {\r\n let moviesSorted = movies.sort((a, b) => {\r\n if (a.title < b.title) return -1\r\n else return 1\r\n });\r\n let result = [];\r\n if (moviesSorted.length < 20) {\r\n moviesSorted.forEach(e => result.push(e.title));\r\n }\r\n else {\r\n for (let index = 0; index < 20; index++) {\r\n result.push(moviesSorted[index].title);\r\n }\r\n }\r\n return result;\r\n}", "function orderAlphabetically(movies) {\n var moviesSorted = movies.sort(function(itemA, itemB) {\n if (itemA.title < itemB.title) {\n return -5;\n } else {\n return 10;\n }\n });\n var moviesFirst20 = [];\n for (var i = 0; i < 20; i += 1) {\n moviesFirst20.push(moviesSorted[i].title);\n }\n return moviesFirst20;\n}", "function orderAlphabetically(movies) {\n let moviesArr = [...movies];\n let newArr = moviesArr.sort((x, y) => {\n if (x.title > y.title) {\n return 1;\n } else if (x.title < y.title) {\n return -1;\n }\n });\n return newArr\n .map(function(movies) {\n return movies.title;\n })\n .slice(0, 20);\n}", "function orderAlphabetically(movies){\n let moviesOrder = movies.sort(function(a,b) {\n if (a.title > b.title) return 1\n if (a.title < b.title) return -1\n }) \n \n let movisTittle = moviesOrder.map(movie => {\n return movie.title \n })\n \n return movisTittle.splice(0,20)\n\n}", "function orderAlphabetically(movies) {\n var onlyMoviesTitle = []\n var alphabeticallOrder = movies.sort(function (movie1, movie2) {\n var title1 = movie1.title;\n var title2 = movie2.title;\n if (title1 > title2) {\n // console.log(title1 + \" should be under \" + title2);\n return +1;\n } else if (title1 < title2) {\n // console.log(title1 + \" should be above \" + title2);\n return -1;\n }\n })\n\n alphabeticallOrder.reduce(function (allmovietitle, movie) {\n onlyMoviesTitle.push(movie.title);\n }, []);\n // console.log(onlyMoviesTitle);\n if (onlyMoviesTitle.length <= 20) {\n return onlyMoviesTitle;\n } else {\n // console.log(onlyMoviesTitle.slice(0, 20))\n return onlyMoviesTitle.slice(0, 20)\n }\n}", "function orderAlphabetically(movies) {\n movieTitles = [];\n for (let i = 0; i < movies.length; i++) {\n movieTitles.push(movies[i].title);\n }\n var sortedTitles = movieTitles.sort(function(a, b) {\n if (a > b) return 1;\n if (a < b) return -1;\n return 0;\n });\n var longSortedTitles = [];\n if (sortedTitles.length <= 20) {\n return sortedTitles;\n } else if (sortedTitles.length > 20) {\n for (let i = 0; i < 20; i++) {\n longSortedTitles.push(sortedTitles[i]);\n }\n return longSortedTitles;\n }\n}", "function orderAlphabetically(arr) {\n let movieTitles = arr.map(movie => movie.title);\n const alpha = movieTitles.sort((a, b) => a > b ? 1 : -1).slice(0, 20);\n return alpha;\n}", "function orderAlphabetically(arr) {\n let newArray = arr.sort((a, b) => {\n if (a.title > b.title) {\n return 1;\n }\n if (a.title < b.title) {\n return -1;\n }\n return 0;\n });\n newArray = newArray.map(function (movie) {\n return movie.title;\n });\n return newArray.slice(0, 20);\n}", "function orderAlphabetically(collection){\n var arrayTitleSort = collection.sort(function(movieA,movieB){\n var movieAupper = movieA.title.toUpperCase();\n var movieBupper = movieB.title.toUpperCase();\n if (movieAupper < movieBupper){\n return -1;\n }\n if (movieAupper > movieBupper){\n return 1;\n }\n });\n var titlesArray = [];\n arrayTitleSort.forEach(function(movie,index) {\n if (index < 20)\n {\n titlesArray[index] = movie.title;\n }\n });\n return titlesArray;\n}", "function orderAlphabetically(array) {\n let alphaOrdered = array.slice().sort(function(a, b) {\n return a[\"title\"].localeCompare(b[\"title\"]);\n });\n\n let top20 = alphaOrdered.slice(0, 20).map(function(movie) {\n return movie[\"title\"];\n });\n\n return top20;\n}", "function orderAlphabetically(arr) {\n let titles = arr.map(function(movie) {\n return movie.title\n });\n let alphabeticOrder = titles.sort(function(a , b) {\n return a.localeCompare(b)\n });\n return alphabeticOrder.slice(0, 20)\n}", "function orderAlphabetically(lotsOfMovies) {\n return [...lotsOfMovies]\n .sort((a, b) => {\n if (a.title > b.title) return 1;\n else if (a.title < b.title) return -1;\n else return 0;\n })\n .map((eachMovie) => eachMovie.title)\n .slice(0, 20);\n}", "function orderAlphabetically (array) {\n array.sort((a,b) => {\n if (a.title > b.title) {\n return 1\n } else if (a.title < b.title) {\n return -1\n } else {\n return 0\n }\n })\n let titleArray = [];\n if (array.length > 0){\n if (array.length < 20) {\n for (let i = 0; i < array.length; i++){\n titleArray.push(array[i].title);\n }\n } else {\n for (let i = 0; i < 20; i++) {\n titleArray.push(array[i].title);\n }\n }\n }\n\n return titleArray\n}", "function orderAlphabetically(array) {\n const titleArray = array.map(movie => movie.title).sort((a, b) => a.localeCompare(b));\n return titleArray.slice(0, 20);\n}", "function orderAlphabetically(movies){\n var orderMovies = movies.sort(function(a,b){\n if (a.title > b.title) {return 1;}\n else if (a.title < b.title) {return -1;} \n else {return 0;}\n });\n var newArray = [];\n orderMovies.forEach(function(orderMovies) {\n newArray.push(orderMovies.title);\n });\n return newArray.slice(0,20);\n}", "function orderAlphabetically(movies) {\n let sortedMovies = [...movies]\n sortedMovies.sort((a, b) => {\n if (a.title.toLowerCase() > b.title.toLowerCase()) {\n return 1\n } else if (a.title.toLowerCase() < b.title.toLowerCase()) {\n return -1\n } else {\n return 0\n }\n });\n let titlesList = sortedMovies.map((value) => value.title)\n return titlesList.slice(0, 20);\n}", "function orderAlphabetically(array) {\n let arrayTitle = array.map(movie => movie.title);\n\n return arrayTitle.sort().slice(0,20);\n\n\n}", "function orderAlphabetically(movies) {\n const onlyTitles = movies.map(i => i.title)\n const allpha = onlyTitles.sort((a,b) => a > b? 1 : b> a? -1 : 0)\n return allpha.filter((item, index)=> index <= 19)\n}", "function orderAlphabetically(array) {\n const orderedByTitle = [...array].sort((a, b) => a.title < b.title ? -1 : 1);\n let onlyTitle = orderedByTitle.slice(0, 20).map(function (a) {\n return a.title\n })\n return onlyTitle\n\n}", "function orderAlphabetically() {}", "function orderAlphabetically (array){\n\n var titulosPeliculas = array.map(function(element){\n \n return element.title;\n });\n\n return titulosPeliculas.sort().slice(0,20);\n}", "function orderAlphabetically(arr) {\n let moviesCopy = [];\n let sortedTitles = [];\n for (let movie of arr) {moviesCopy.push(movie.title);}\n moviesCopy.sort();\n if (moviesCopy.length < 20) {\n for (let j = 0; j < moviesCopy.length; j++) {sortedTitles.push(moviesCopy[j]);}\n } else for (let i = 0; i < 20; i++) {sortedTitles.push(moviesCopy[i]);}\n return sortedTitles;\n}", "function orderAlphabetically(movies) {\n return movies\n .map(movie => movie.title)\n .sort((a, b) => a.localeCompare(b))\n .slice(0, 20);\n}", "function orderAlphabetically(arr) {\n const moviesTitles = arr.map((movie) => {\n return movie.title;\n });\n moviesTitles.sort();\n if (moviesTitles.length > 20) {\n return moviesTitles.slice(0, 20);\n };\n return moviesTitles;\n}", "function orderAlphabetically(movies){\n let titles = movies.map(movie => movie.title);\n return titles.sort().splice(0,20);\n}", "function orderAlphabetically(moviesArray) {\n let firstTwentyAlpha = [...moviesArray]\n .sort(function(movie1, movie2) {\n if (movie1.title > movie2.title) {\n return 1;\n } else if (movie1.title < movie2.title) {\n return -1;\n } else {\n return 0;\n }\n })\n .map(function(movieTitle) {\n return movieTitle.title;\n })\n .slice(0, 20);\n return firstTwentyAlpha;\n}", "function orderAlphabetically(bunchaMovies){\n let arrayToUse = [...bunchaMovies];\n arrayToUse.sort((a,b)=>{\n if(a.title < b.title){\n return -1;\n } else if (b.title < a.title){\n return 1\n }\n return 0;\n })\n let blah = arrayToUse.slice(0,20);\n let titlesOnly = blah.map((eachMovieObject)=>{\n return eachMovieObject.title;\n })\n return titlesOnly;\n}", "function orderAlphabetically(movies) {\n var onlyTitles = movies.map(a => {\n return a.title;\n });\n\n var orderedOnlyTitles = onlyTitles.sort();\n return orderedOnlyTitles.slice(0, 20);\n}", "function orderAlphabetically(arr) {\n var newArray = arr.map(function(movie) {\n return movie.title;\n });\n return newArray.sort().slice(0, 20);\n}", "function orderAlphabetically(array) {\n // step1: create an array of strings (title of each movie)\n // step2: order them alphabetically\n // step3: return the first 20 movies (max)\n\n let myArray = array.map(function(elem) {\n return elem.title}); \n myArray.sort();\n return myArray.filter(function(elem, index) {\n return index < 20;\n });\n}", "function orderAlphabetically(movies) {\n const copy = [...movies];\n const sortCopy = copy.sort(function (a, b) {\n return a.title.localeCompare(b.title)\n });\n const firstTwenty = sortCopy.slice(0, 20);\n let array = [];\n firstTwenty.forEach((movie) => array.push(movie.title));\n return array;\n }", "function orderAlphabetically(movies) {\n const moviesArr = JSON.parse(JSON.stringify(movies))\nconst sortedMoviesArr = moviesArr\n .sort((a, b) => {\n if (a.title > b.title) {\n return 1;\n } else if (a.title < b.title) {\n return -1;\n } else {\n return 0;\n }\n })\n .map(eachMovie => eachMovie.title)\n .slice(0, 20);\n\n return sortedMoviesArr\n}", "function orderAlphabetically(movies) {\n const copy = [...movies]\n const ordered = copy.sort(function(a, b){\n return a.title.localeCompare(b.title)\n }).map(function(movie){\n return movie.title\n })\n return ordered.slice(0, 20)\n}", "function orderAlphabetically(movies) {\n\tconst sortedMovies = movies.sort(titleComparison);\n\tselectedMovies = sortedMovies.slice(0, 20); // pour cibler les 20 premiers\n\treturn selectedMovies.map((movie) => movie.title); // pour avoir juste le titre\n}", "function orderAlphabetically(arrayOfMovies){\n const moviesByTitle = [...arrayOfMovies];\n moviesByTitle.sort((movieA, movieB) => {\n if (movieA.title.toLowerCase() > movieB.title.toLowerCase()) {\n return 1;\n } else if (movieA.title.toLowerCase() < movieB.title.toLowerCase()) {\n return -1;\n } else {\n return 0;\n }\n });\n //maximize the minimum\n let numberOfMoviesToReturn = Math.max(Math.min(moviesByTitle.length, 20), 0);\n const top20movieTitles = [];\n for (let i=0; i<numberOfMoviesToReturn; i++){\n top20movieTitles.push(moviesByTitle[i].title);\n }\n return top20movieTitles;\n}", "function orderAlphabetically(alphabetOrderedArr) {\n let copiaMovies = Array.from(alphabetOrderedArr);\n\n function ordenarAZ(a,b) {\n return a.title.localeCompare(b.title);\n }\n\n copiaMovies.sort(ordenarAZ);\n\n copiaMovies = copiaMovies.map(movies => {\n\n return movies.title\n }).slice(0,20);\n\n return copiaMovies;\n}", "function orderAlphabetically(array) {\n array = array.sort((a, b) => { return (a.title > b.title) ? 1 : -1 });\n let newArray = []\n array.forEach(function (movie) { newArray.push(movie.title) })\n if (newArray.length >= 20) {\n return newArray.slice(0, 20);\n } else {\n return newArray;\n }\n}", "function orderAlphabetically(movies){\n var sortedTitles=[];\n movies.sort(function (a,b){\n return ((a.title>b.title)?1:-1);\n });\n for (i=0;i<20 && i<movies.length;i++){\n sortedTitles.push(movies[i].title);\n }\n return sortedTitles;\n}", "function orderAlphabetically(array) {\n\n let movieByTitle = array.map(movie => movie.title)\n let topTwenty = movieByTitle.sort((a, b) => (a > b) ? 1 : -1)\n topTwenty.length > 20 ? topTwenty.splice(20) : topTwenty;\n\n return topTwenty\n }", "function orderAlphabetically(movies) {\n return movies.sort(function(movie1, movie2) {\n return movie1.title.localeCompare(movie2.title);\n })\n .slice(0, 20)\n .map(function(movie) {\n return movie.title;\n });\n}", "function orderAlphabetically(moviesArray) {\n let movieTitles = moviesArray.map(function(movie) {\n return movie.title\n }); \n\n movieTitles.sort(function(title1, title2){\n if (title1 > title2) {\n return 1;\n } else if (title1 < title2) {\n return -1;\n }\n }); return movieTitles.slice(0, 20);\n}", "function orderAlphabetically(movies) {\n const newArray = movies.map(function(item){\n return item.title;\n });\n const oldestFirst = newArray.sort();\n\nreturn oldestFirst.slice(0, 20);\n}", "function orderAlphabetically(moviesArray) {\n\n const moviesArrayCopy = JSON.parse(JSON.stringify(moviesArray));\n\n const titlesArray = moviesArrayCopy.map(function(element) {\n return element.title;\n });\n\n const firstTwentyMoviesArray = titlesArray.sort(function(element1, element2){\n\n return element1.localeCompare(element2);\n });\n\n return firstTwentyMoviesArray.slice(0,20);\n\n}", "function orderAlphabetically (array) {\n const clone = Array.from(array)\n const sorted = clone.sort((movieA, movieB) => {\n if (movieA.title < movieB.title) {\n return -1\n } else if (movieA.title > movieB.title) {\n return 1\n } else {\n return 0\n }\n })\n return sorted.reduce((total, movie) => {\n if (total.length < 20) {\n total.push(movie.title)\n }\n return total\n }, [])\n}", "function orderAlphabetically (arrayOfMovies) {\n let sortedArr = arrayOfMovies.slice().sort((a,b) => {\n if (a.title > b.title) return 1;\n if (a.title < b.title) return -1;\n }); \n let limitArr = [];\n for (let i=0; (i<sortedArr.length)&&i<20; i++) {\n limitArr.push(sortedArr[i].title);\n } \n return limitArr; \n}", "function orderAlphabetically(movieList) {\n let ordered = movieList.sort(function(a, b) {\n return a.title.localeCompare(b.title);\n });\n ordered = ordered.map(function(movie) {\n return movie.title;\n });\n return ordered.slice(0, 20);\n}", "function orderAlphabetically () {\n movies.sort(function (itemA,itemB){\n if (itemA.title<itemB.title){\n //if itemA comes before itemB return negative\n //(the order is good)\n return -1;\n }\n else{\n //if itemB comes before itemA return positive\n //they need to switch\n return 50;\n }\n })\n \n console.log(movies);\n}", "function orderAlphabetically(arr){\n let newArr = JSON.parse(JSON.stringify(arr));\n newArr.sort((a,b) => {\n if(a.title < b.title) return -1;\n });\n newArr = newArr.slice(0,20).map(e=>{\n return e.title;\n });\n return newArr;\n}", "function orderAlphabetically(movies) {\n var sortedArray = movies.sort(function(a,b) {\n if(a.title < b.title) {\n return -1;\n }\n if(a.title > b.title) {\n return 1;\n }\n return 0;\n })\n var titlesArray = sortedArray.map(function(movie) {\n return movie.title;\n })\n return titlesArray.splice(0, 20);\n}", "function orderAlphabetically(bestMoviesArr) {\n const onlyTitle = bestMoviesArr.map(function(movie) {\n return movie.title;\n });\n if (onlyTitle.length < 20) {\n return onlyTitle.sort();\n }\n return onlyTitle.sort().slice(0, 20);\n}", "function orderAlphabetically(array) {\n if(array.length > 19) {\n let moviesArray= [...array];\n\n let alphabeticalMovies = moviesArray.sort(\n (a,b) => (a.title > b.title) ? 1 : -1\n )\n let alphaMovSliced = alphabeticalMovies.slice(0, 20);\n\n let movieByTitle = alphaMovSliced.map(movie => movie.title)\n \n return movieByTitle\n }\n let moviesArray= [...array];\n\n let alphabeticalMovies = moviesArray.sort(\n (a,b) => (a.title > b.title) ? 1 : -1\n )\n\n let movieByTitle = alphabeticalMovies.map(movie => movie.title)\n \n return movieByTitle\n\n}", "function orderAlphabetically(arr){\n var moviesTitle = arr.map(function(obj){\n return obj.title;\n });\n var moviesSorted = moviesTitle.sort();\n if (moviesSorted.length > 20){\n moviesSorted.splice(20);\n }\n return moviesSorted\n}", "function orderAlphabetically(arr) {\n let alphArr = [...arr].sort((s1, s2) => {\n if (s1.title > s2.title) return 1;\n else return -1\n })\n alphArr.splice(20)\n return alphArr.map(movies => movies.title)\n\n}", "function orderAlphabetically(movies) {\n var sortedTitles = movies\n .map(function(oneMovie) {\n return oneMovie.title;\n })\n .sort()\n .slice(0, 20);\n\n return sortedTitles;\n}" ]
[ "0.7854673", "0.781835", "0.76172966", "0.7562915", "0.75456494", "0.75414544", "0.75134784", "0.7492668", "0.7456303", "0.7399086", "0.7363743", "0.7331747", "0.7330319", "0.73057425", "0.7285872", "0.7259712", "0.72448254", "0.72349596", "0.72197604", "0.7199472", "0.71971166", "0.7192966", "0.7192174", "0.71662325", "0.7165595", "0.7165374", "0.71618533", "0.71612924", "0.7156598", "0.7141193", "0.71283525", "0.7127791", "0.7108257", "0.7105391", "0.7104386", "0.7100395", "0.70996064", "0.70990247", "0.70905983", "0.70818675", "0.7055051", "0.70390594", "0.7035069", "0.70331484", "0.70257133", "0.7017491", "0.7009749", "0.70096165", "0.700926", "0.70015556", "0.69997764", "0.6997249", "0.6986894", "0.6984496", "0.69708735", "0.6967523", "0.6964019", "0.69553626", "0.6946815", "0.69416124", "0.6935734", "0.69326043", "0.69276506", "0.6900756", "0.69001037", "0.68961114", "0.6895212", "0.68934894", "0.6891822", "0.6884394", "0.6883104", "0.6852087", "0.6846452", "0.6831177", "0.6822178", "0.6819244", "0.68161076", "0.68149805", "0.68036395", "0.6796995", "0.67519236", "0.67463905", "0.6744531", "0.6743867", "0.6742938", "0.67368895", "0.67254436", "0.6708582", "0.670777", "0.67009455", "0.66887224", "0.6679341", "0.6673386", "0.66702735", "0.6657706", "0.662186", "0.6619467", "0.66180784", "0.66130304", "0.66088194" ]
0.69541353
58
Reset elements to their initial state.
reset() { arrayEach(this.elements, ui => ui.reset()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _reset () {\n _elements = [];\n }", "reset(){\n this.ended = false;\n this.elements = [];\n }", "function reset()\n\t\t{\n\t\t\t\n\t\t\tfor(var i=0;i<a;i++)\n\t\t\t{\n\t\t\t\tvar a1=$(element).find(\"#g\"+i).get(0);\n\t\t\t\t\n\t\t\t\tvar a2=$(element).find(\"#s\"+i).get(0);\n\t\t\t\t\n\t\t\t\ta2.innerHTML = \"\";\n\t\t\t\ta1.removeAttribute(\"style\");\n\t\t\t\ta1.removeAttribute(\"value\");\n\t\t\t\ta1.removeAttribute(\"readonly\");\n\t\t\t\ta1.value = \"\";\n\t\t\t}\n\t\t\t\t\n\t\t}", "reset() {\n this.domSquares.forEach(square => {\n this.setSquare(square, '');\n });\n }", "reset() {\n\t\tthis.items.length = 0;\n\t}", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "reset() {\n this._index = 0;\n }", "reset() {\n this._index = 0;\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(`${initClass} ${activeClass} ${animation}`);\n }", "reset() {\n this.#container.dom = null;\n this.#prevContainerDom = null;\n this.#prevRender = null;\n this.#prevProps = null;\n this.#needUpdate = null;\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function resetState() {\n focusLaterElements = [];\n}", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function resetState() {\n var _arr = [before, after];\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var item = _arr[_i];\n if (!item) continue;\n item.parentNode && item.parentNode.removeChild(item);\n }\n before = after = null;\n instances = [];\n}", "function resetState() {\n var _arr = [before, after];\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var item = _arr[_i];\n if (!item) continue;\n item.parentNode && item.parentNode.removeChild(item);\n }\n before = after = null;\n instances = [];\n}", "reset() {\n super.reset();\n this.element?.clear();\n }", "reset() {\n this._updateSelectedItemIndex(0);\n this.steps.forEach(step => step.reset());\n this._stateChanged();\n }", "function reset () {\n\t\tfillZero(xs,9);\n\t\tfillZero(os,9);\n\t\tremoveSelected(circles);\n\t\tcurrent = null;\n\t\tcounter = null;\n\t\twin = false;\n\t\tdisplay.textContent = \"tic tac toe\";\n\t}", "reset() {\r\n this.state=this.initial;\r\n this.statesStack.clear();\r\n\r\n }", "reset() {\n for (let i = 0; i < this.allNodes.length; i++) { this.allNodes[i].reset(); }\n for (let i = 0; i < this.Splitter.length; i++) {\n this.Splitter[i].reset();\n }\n for (let i = 0; i < this.SubCircuit.length; i++) {\n this.SubCircuit[i].reset();\n }\n }", "reset() {\r\n this.statesDone.clear();\r\n this.statesDone.push(this.initialState);\r\n }", "function reset() {\n\t element[0].style.transitionDuration = 0;\n\t element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n\t }", "reset(){\n this.enable();\n this.init();\n this.buildAll();\n }", "Reset()\n {\n this._position = 0;\n }", "reset() {\n document.getElementById(\"block-container\").innerHTML = null;\n this.index = 0;\n this.lookUp = {};\n this.initCellMaps();\n }", "reset() {\r\n this.state = this.initial;\r\n }", "function reset () {\n setCurrentlyClicking(false);\n setCounter(1);\n clearInterval(currentInterval);\n setCurrentInterval(\"\");\n setClickingFast(false);\n setColors(initialColors);\n }", "function reset(){\n\t\tsetSorting(false);\n\t\t// setDataBottom(new Array(rectNum).fill(new Rect(0,Math.round(maxWidth/rectNum),0)));\n\t\tsetLightUp([]);\n\t\t// setLightUpBottom([]);\n\n\t}", "function reset() { }", "function resetState$4() {\n focusLaterElements = [];\n}", "function resetElements()\n{\n\tvalidMemes = new Array;\n\tgameLogic = gameLogicI;\n\tmemesCoords = new Array;\t\n\n\tmixMemes();\n}", "onreset() {\n this.dom = [];\n this.root = new Document(this.dom);\n this.done = false;\n this.tagStack = [this.root];\n this.lastNode = null;\n this.parser = null;\n }", "function reset() {\n clear();\n initialize(gameData);\n }", "function reset() {\n\t setState(null);\n\t} // in case of reload", "function reset() {\n var $li, $ul, item;\n // Clear\n $ul = this.$ul;\n $ul.html('');\n // Reattach\n item = this.head;\n while(item) {\n if (item.group) item.reset();\n $ul.append(item.$el);\n item = item.next;\n }\n }", "reset() {\n\n this._flushTime = 0;\n this._flushCounter = 0;\n this._idleDelay = 500;\n\n this._timer = null;\n this._minDelay = this.ELEMTickerInterval;\n this._flushing = false;\n this._needFlush = false;\n this._slowness = 1;\n\n this._elements = {};\n this._nextElemId = 0;\n this._freeElemIds = [];\n\n this._styleCache = {};\n this._styleTodo = {};\n this._elemTodo = [];\n this._elemTodoH = {};\n }", "reset() {\n\n this._flushTime = 0;\n this._flushCounter = 0;\n this._idleDelay = 500;\n\n this._timer = null;\n this._minDelay = this.ELEMTickerInterval;\n this._flushing = false;\n this._needFlush = false;\n this._slowness = 1;\n\n this._elements = {};\n this._nextElemId = 0;\n this._freeElemIds = [];\n\n this._styleCache = {};\n this._styleTodo = {};\n this._elemTodo = [];\n this._elemTodoH = {};\n }", "function reset()\n\t{\n\t\tsetValue('')\n\t}", "function reset() {\n\tcardsContainer.innerHTML = \"\";\n\n\t//Call startGame to create new cards\n\tstartGame();\n\t\n\t//Reset any related variables like matchedCards\n\tmatchedCards = [];\n\topenedCards = [];\n\n\tmoves = 0;\n\tmovesContainer.innerHTML = 0;\n\n\tstarsContainer.innerHTML = star + star + star;\n\n\tresetTimer();\n\tstopTimer();\n\n\tshuffle(icons);\n}", "function reset() {\n // noop\n }", "function reset() {\n\tstate.questionCounter = 0;\n\tstate.score = 0;\n\tstate.questions = [\n\t\t{\n\t\t\tid: 0,\n\t\t\tpregunta: 'Ets un/a Vilafranquí/ina de Tota la Vida? Prova el test!',\n\t\t\trespostes: [],\n\t\t\tcorrecte: null,\n\t\t},\n\t];\n\tstate.collectedAnswers = [];\n\tstate.comodinsLeft = state.comodinsInitial;\n\tstate.comodiUsedInQuestion = false;\n\tstate.comodiButtonExpanded = false;\n\t// display initial question\n\tdisplayInitialQuestion();\n}", "reset() {\r\n this.currentState = this.initial;\r\n }", "reset() {\n this.init();\n }", "reset() {\n this.index = 0;\n }", "function reset() \n{\n for (var i = 0; i < $cell.length; i++) \n {\n \t$cell[i].className = 'cell';\n \t$cell[i].innerHTML = '';\n }\n bombs.posX = [];\n bombs.posY = [];\n}", "function reset(){\n magicElement.style.display = \"block\";\n magicElement.style.visibility = \"visible\";\n}", "function reset() {\r\n // noop\r\n }", "reset() {\n this._items = [];\n }", "reset() {\n this.resetFields();\n this.resetStatus();\n }", "function reset()\n {\n Parameters.container = $.extend(true, {}, defaultContainer);\n Parameters.counter = 0;\n Parameters.timeId = null;\n }", "reset () {\n this.state.clear()\n this.redraw()\n }", "reset() {\n\t\tfor (let i = 0; i < this.tiles.length; i++) {\n\t\t\tthis.tiles[i].unsetPiece();\n\t\t}\n\t\tfor (let i = 0; i < this.whitePieces.length; i++) {\n\t\t\tthis.whitePieces[i].unsetTile();\n\t\t\tthis.whitePieces[i].animation = null;\n\t\t\tthis.blackPieces[i].unsetTile();\n\t\t\tthis.blackPieces[i].animation = null;\n\t\t}\n\t}", "function resetAll(arr){\n arr.forEach(function(el) {\n document.getElementById(el).value = \"\";\n })\n}", "reset() {\r\n this.initial=this.begin;\r\n this.rsteps=[];\r\n this.usteps=[];\r\n\r\n }", "reset() {\n this._setTreeStatus('');\n this._checkedAutorollers = new Set();\n this._selectedTreeStatus = '';\n this.setAttribute('collapsed', '');\n this._render();\n }", "function resetState() {\n while (answerButtonsElement.firstChild) {\n answerButtonsElement.removeChild(answerButtonsElement.firstChild);\n }\n }", "function reset()\n {\n _pos = {};\n _first = false;\n _fingers = 0;\n _distance = 0;\n _angle = 0;\n _gesture = null;\n }", "reset() {\n this.setObjectRenderer(this.emptyRenderer);\n }", "reset() {\n for (let i = 0, l = this.matrix.length; i !== l; i++) {\n this.matrix[i] = 0\n }\n }", "resetToInitialState() {\n this._itemsManager.reset();\n this._directionsManager.reset();\n if(this._currentGuide) {\n this._currentGuide.finish();\n this._currentGuide = null;\n }\n }", "function resetDefault(){\n fillDefault();\n}", "reset() {\n\t\tthis.stop();\n\n\t\tthis.ticks = 0;\n\t\tthis.interval = 0;\n\t\tthis.node.innerText = \"00:00:00\";\n\t}", "reset() {\n for (let node of this.nodes) {\n node.phase = NetworkNode.PHASE.NORMAL;\n }\n for (let l of this.links) {\n l.state = NodeLink.STATES.NORMAL;\n }\n }", "function reset(){\n $('#selection-area').empty();\n $('#species-info').empty().css('background-color', panelColor);\n $('#last-dropdown-area').empty();\n $('.counties').css('fill', mapColor);\n $('.labels').css('fill', panelColor);\n }", "function reset(){\n let clearDivs = document.querySelectorAll('div');\n for(let div of clearDivs){\n div.remove();\n };\n shuffledColors = shuffle(COLORS);\n createDivsForColors(shuffledColors);\n clicks.innerText = 0;\n}", "function reset()\n\t\t{\n\t\t\t// Clear any random swimming that is set to occur.\n\t\t\tif(currentRandomTimer !== null)\n\t\t\t{\n\t\t\t\twindow.clearTimeout(currentRandomTimer);\n\t\t\t\tcurrentRandomTimer = null;\n\t\t\t}\n\n\t\t\t// If the fish is in motion, stop it and remove the sequence.\n\t\t\tif(movementSequence instanceof Concert.Sequence)\n\t\t\t{\n\t\t\t\tmovementSequence.stop();\n\t\t\t\tmovementSequence = null;\n\t\t\t}\n\n\t\t\t// Clear out any swim destinations.\n\t\t\tfutureDestinations = [];\n\t\t\tcurrentDestination = null;\n\n\t\t\t// Set the fish back to normal size.\n\t\t\tfishSizeMultiplier = StartingFishSizeMultiplier;\n\n\t\t\t// Remove all food from the pond.\n\t\t\twhile(uneatenFood.length > 0)\n\t\t\t{\n\t\t\t\tlet eatenFood = uneatenFood.shift();\n\t\t\t\teatenFood.parentNode.removeChild(eatenFood);\n\t\t\t}\n\n\t\t\t// Set the actual style and SVG attributes back to their original values.\n\t\t\tlet scaleParmString = StartingFishSizeMultiplier + \",\" + StartingFishSizeMultiplier\n\t\t\tfishGroupElement.setAttribute(\"transform\", \"scale(\" + scaleParmString + \") rotate(0,0,0)\");\n\t\t\tfishOuterElement.style.left = \"0px\";\n\t\t\tfishOuterElement.style.top = \"0px\";\n\t\t} // end reset()", "function reset() {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n restore_array = [];\n index = -1;\n }", "function reset() {\n setPieces(round);\n }", "function resetState(){\n Oclasses = {}; // known classes\n arrayOfClassVals = null; // cached array of class values\n arrayOfClassKeys = null; // cached array of class keys\n objectProperties = {}; // known object properties\n arrayOfObjectPropVals = null; // array of object property values\n arrayOfObjectPropKeys = null; // array of object property keys\n dataTypeProperties = {}; // known data properties\n arrayOfDataPropsVals = null; // array of data properties values\n\n classColorGetter = kiv.colorHelper();\n svg = null;\n zoomer = null;\n renderParams = null;\n mainRoot = null;\n panel = null;\n }", "function reset_all()\n {\n $states = [];\n $links = [];\n $graph_table = [];\n $end_states = [];\n graph.clear();\n $start_right = [];\n $left = [];\n $current_tape_index = \"\";\n $current_state = \"\";\n $previous_state = \"\";\n $old_current_state = \"\";\n $old_previous_state = \"\";\n $old_tape_index = \"\";\n $error = false;\n $old_tape_head_value = \"\";\n }", "function resetAll() {\n\n //reset scale\n\n $(\".zoomUnit\").text(\"1\");\n scaling.domain([0, sequence.length - 1]);\n scalingPosition.range([0, sequence.length - 1]);\n var seq = displaySequence(sequence.length);\n\n if (seq === false && !svgContainer.selectAll(\".AA\").empty()) svgContainer.selectAll(\".seqGroup\").remove();\n\n transition_data(features, 0);\n reset_axis();\n }", "reset() {\n this.grid = this.getEmptyBoard();\n }", "function reset( )\n\t{\n\n\t\tvar circles = canvas_handler.circles;\n\t\tvar lines = canvas_handler.lines;\n\t\t\n\t\tvar i = circles.length;\n\t\t\n\t\twhile( i-- )\n\t\t{\n\t\t\n\t\t\tcircles[ i ].color = NODE_DEFAULT_COLOR;\n\t\t\t\n\t\t}\n\t\t\n\t\ti = lines.length;\n\t\t\n\t\twhile( i-- )\n\t\t{\n\t\t\t\n\t\t\tlines[ i ].color = EDGE_DEFAULT_COLOR;\n\t\t\t\n\t\t}\n\t\t\n\t\tstarting_node = null;\n\t\tending_node = null;\n\t\t\n\t\tnodes_selected = 0;\n\t\t\n\t\tvar begin_reset_button = document.getElementById( \"begin_reset_button\" );\n\t\tbegin_reset_button.innerHTML = \"Begin\";\n\t\tbegin_reset_button.className = \"button green_background hidden\";\t\n\t\tbegin_reset_button.onclick = null;\n\t\t\n\t\tvar overlay = document.getElementById( \"overlay\" );\n\t\tdocument.body.removeChild( overlay );\n\t\t\n\t\tcanvas_handler.canvas_invalid = true;\n\t\t\n\t}", "function reset() {\n\tclearCounter('#LR');\n\tclearCounter('#RR');\n\tclearTheDifference();\n\tresetSetSizeIndicators();\n\t$('.element').remove();\n\t// repopulate the numbers\n\tfor(var i=0; i<numbers.length; i++) {\n\t\tvar paragraph = '<span class=\"element\">';\n\t\t\tparagraph += numbers[i];\n\t\t\tparagraph += '</span>';\n\t\t$('#num').append(paragraph);\n\t}\n\t// restores draggable settings\n\t$(\".element\").draggable({\n\t\thelper:\"clone\",\n\t\tcontainment:\"document\",\n\t\topacity: 0.5\n\t});\n}", "reset() {\n this._setIsResetting(true);\n this._setFinish(false);\n this.activeStep = undefined;\n this.nextStep = undefined;\n for (let i = 0; i < this._steps.length; i++) {\n const step = this.getStepById(i);\n step.reset(this.openFirstStepOnStartup);\n }\n this._setIsResetting(false);\n }", "function reset() {\n var _options5 = options,\n infinite = _options5.infinite,\n ease = _options5.ease,\n rewindSpeed = _options5.rewindSpeed,\n rewindOnResize = _options5.rewindOnResize,\n classNameActiveSlide = _options5.classNameActiveSlide,\n initialIndex = _options5.initialIndex;\n\n\n slidesWidth = elementWidth(slideContainer);\n frameWidth = elementWidth(frame);\n\n if (frameWidth === slidesWidth) {\n slidesWidth = slides.reduce(function (previousValue, slide) {\n return previousValue + elementWidth(slide);\n }, 0);\n }\n\n if (rewindOnResize) {\n index = initialIndex;\n } else {\n ease = null;\n rewindSpeed = 0;\n }\n\n if (infinite) {\n translate(slides[index + infinite].offsetLeft * -1, 0, null);\n\n index = index + infinite;\n position.x = slides[index].offsetLeft * -1;\n } else {\n translate(slides[index].offsetLeft * -1, rewindSpeed, ease);\n position.x = slides[index].offsetLeft * -1;\n }\n\n if (classNameActiveSlide) {\n setActiveElement(slice.call(slides), index);\n }\n }", "reset(){\n this.buffer = []\n this.svg.selectAll('*').remove()\n this.setup()\n }", "function resetClicked(){\n filters.rating = undefined\n filters.genres = undefined\n filters.language = undefined\n filters.runtime = undefined\n filters.year = undefined\n\n // reset the sliders and option boxes\n const runtimeRange = getRuntimeRange()\n const yearRange = getYearRange()\n\n // move the slider back to start\n runtimeSliderPointer.set([runtimeRange.low, runtimeRange.high])\n ratingSliderPointer.set([0, 10])\n yearSliderPointer.set([yearRange.low, yearRange.high])\n\n // re-call the create functions, which will delete the old one and replace it as a new selector\n createGenreSelector()\n createLanguageSelector()\n\n applyFilters()\n\n}", "reset() {\n\n\t\t// Reset slides\n\t\tqueryAll( this.Reveal.getRevealElement(), '[data-auto-animate]:not([data-auto-animate=\"\"])' ).forEach( element => {\n\t\t\telement.dataset.autoAnimate = '';\n\t\t} );\n\n\t\t// Reset elements\n\t\tqueryAll( this.Reveal.getRevealElement(), '[data-auto-animate-target]' ).forEach( element => {\n\t\t\tdelete element.dataset.autoAnimateTarget;\n\t\t} );\n\n\t\t// Remove the animation sheet\n\t\tif( this.autoAnimateStyleSheet && this.autoAnimateStyleSheet.parentNode ) {\n\t\t\tthis.autoAnimateStyleSheet.parentNode.removeChild( this.autoAnimateStyleSheet );\n\t\t\tthis.autoAnimateStyleSheet = null;\n\t\t}\n\n\t}", "function resetDOM() {\n userDataArray = defaultDataArray.map(element => element);\n totalWorthHasBeenRequested = false;\n totalWealthIsAlreadyDisplayed = false;\n updateDOM();\n}", "reset() {\n\t\tthis.formElement.reset();\n\t}", "reset() {\n\t\tthis.tilesForTextureUpdate = Array.from( this.tiles );\n\t\tthis.updateNextTile();\n\t}", "function resetState () {\n while (answerElement.firstChild) {\n answerElement.removeChild(answerElement.firstChild);\n }\n}", "function reset() {\n $(\"body\").empty();\n state = 0;\n pages();\n}", "reset(){\n this.number = 0;\n this.isMine = false;\n this.isFlagged = false;\n this.isOpen = false;\n this.div.style.backgroundImage = cellImages[9];\n }", "reset() {\n this.playerContainer.players.forEach(x => x.clearHand())\n this.winner = undefined;\n this.incrementState();\n this.clearSpread();\n this.deck = new Deck();\n this.clearPot();\n this.clearFolded();\n }", "function reset() {\n self.taskActionList([]);\n self.selectedTasklist([]);\n self.isTaskSelected(false);\n self.actionName('');\n self.actionComments('');\n self.showConfirmation('none');\n }", "function reset() {\n resetGrid();\n resetLives();\n resetScore();\n generateRandomPath(width);\n}", "function resetState () {\n while (answerButtonsEl.firstChild) {\n answerButtonsEl.removeChild(answerButtonsEl.firstChild);\n }\n}", "reset() {\n this[0] = 0;\n this[1] = 0;\n this[2] = 0;\n this[3] = 1;\n this[4] = 0;\n this[5] = 0;\n this[6] = 0;\n this[7] = 0;\n return this;\n }", "function setInitialStates(){\n removeAll([\"h3\", \"h4\"]);\n}", "reset() {\n this.init();\n }", "updated() {\n this.el.reset();\n }", "function _reset() {\r\n it = 0;\r\n redraw();\r\n looping == false ? noLoop() : 0;\r\n}", "function reset() {\n attachSource(null);\n attachView(null);\n protectionData = null;\n protectionController = null;\n }", "reset() {\n this._counter++;\n this._size = 0;\n this._colObjects = [];\n this._updateSides();\n }", "reset() {\n this.setIrqMask(0);\n this.setNmiMask(0);\n this.resetCassette();\n this.keyboard.clearKeyboard();\n this.setTimerInterrupt(false);\n this.z80.reset();\n }" ]
[ "0.82190245", "0.73723614", "0.73670727", "0.7325234", "0.7169908", "0.71429116", "0.71264213", "0.71264213", "0.71236986", "0.71177864", "0.71028036", "0.71028036", "0.71028036", "0.71028036", "0.71022475", "0.70965993", "0.70843774", "0.70843774", "0.70525646", "0.7031606", "0.70172685", "0.7014351", "0.6996129", "0.697011", "0.6968892", "0.69600075", "0.6957927", "0.69514734", "0.6897263", "0.6889121", "0.6882315", "0.6881891", "0.68685627", "0.6855928", "0.68492895", "0.684166", "0.6820749", "0.68123937", "0.68120706", "0.68120706", "0.6796679", "0.67943245", "0.67905074", "0.6781675", "0.6758907", "0.6754029", "0.6740244", "0.6730264", "0.6728543", "0.672797", "0.6718029", "0.6717709", "0.67156297", "0.6694652", "0.6692411", "0.6691766", "0.66826737", "0.6682341", "0.6678961", "0.6662489", "0.66518843", "0.665076", "0.6641943", "0.6637015", "0.6631033", "0.66300535", "0.6629232", "0.6629144", "0.66179955", "0.6610971", "0.6609614", "0.6609381", "0.6605939", "0.66028786", "0.65993965", "0.65966934", "0.6592009", "0.6590907", "0.6589431", "0.6586368", "0.6583723", "0.65833724", "0.6581674", "0.6579587", "0.6579337", "0.6575919", "0.6575374", "0.65740424", "0.65655756", "0.6559674", "0.6555148", "0.65549636", "0.65544015", "0.65454733", "0.65395355", "0.65371853", "0.65348834", "0.65299225", "0.6528007", "0.6524857" ]
0.7656365
1
newEmployee = new Employee("Mauricio", "Cabrera", "4851356","06/28/1992", "45 St. Lanza, Sopocachi, LP", "61530245", "Programmer", "Systems Engineering"); new Employee("Luciana", "Diaz", "6524553","01/21/1988", "655 St. Carlos Medinacelli, San Miguel, LP", "79615302", "Programmer", "Systems Engineering"),
function EmploymentComponent(graphqlCrudService) { this.graphqlCrudService = graphqlCrudService; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Employee(id,firstName,lastName,title){\n this.id=id;\n this.firstName=firstName;\n this.lastName=lastName;\n this.title=title\n}", "function Employee(firstName, lastName, id, title, salary) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.id = id;\n this.title = title;\n this.salary = salary;\n}", "function Employee (name,age,salary){\n this.name = name;\n this.age = age;\n this.salary = salary;\n\n}", "function employee(id, firstName, lastName, title){\n this.id = id;\n this.firstName = firstName;\n this.lastName = lastName;\n this.title = title;\n}", "function Employee(id, firstName, lastName, title) {\n this.id = id;\n this.firstName = firstName;\n this.lastName = lastName;\n this.title = title;\n\n}", "function employee(id, firstName, lastName, title) {\n this.id = id;\n this.firstName = firstName;\n this.lastName = lastName;\n this.title = title;\n}", "function employee(id, firstName, lastName, title) {\n this.id = id;\n this.firstName = firstName;\n this.lastName = lastName;\n this.title = title;\n}", "function addEmployee(firstName, lastName, employeeId, title, annualSalary) {\n console.log('in addEmployee');\n let employee = { firstName, lastName, employeeId, title, annualSalary }\n console.log('new employee', employee);\n employeeList.push(employee);\n}", "function Employee(name, salary, experience){\n this.name = name;\n this.salary = salary;\n this.experience = experience;\n}", "function Employee(id, firstName, fastName, title)\n\n{\n this.id =id;\nthis.firstName = firstName;\nthis.lastName =lastName;\nthis.title = title;\n}", "function createEmployeeObject(firstName, lastName, desig, gender) {\n // No need to do first & last line if new keyword is used.\n // JS creates an object by variable this. So assume it adds lines like\n // first n second as below.\n // var this = {};\n this.firstName = firstName;\n this.lastName = lastName;\n this.gender = gender;\n this.designation = desig;\n // return this;\n}", "function Employee(name, salary, experience){\r\n this.name = name;\r\n this.salary = salary;\r\n this.experience = experience;\r\n}", "function Employee(name,age){\r\n this.name = name;\r\n this.age = age;\r\n}", "function Employee(name, email, hireDate) {\n this.name = name;\n this.email = email;\n this.hireDate = hireDate;\n}", "function Employee(id, firstName, lastName, title) {\n this.id = id;\n this.firstName = firstName;\n this.lastName = lastName;\n this.title = title;\n}", "addNewEmployee() {\n const newId = nanoid(10);\n this.employees = [\n ...this.employees,\n {\n id: newId,\n name: 'New Employee',\n plannedWorkingTime: 180,\n overtime: 0,\n consecutiveWorkingDays: {\n min: 3,\n max: 5,\n preferred: 4,\n },\n minConsecutiveDaysOff: 2,\n shift: setDefaultShiftDist(this.shifts),\n avatar: randomAvataaarURL(newId),\n shiftWishes: new Array(this.dateArray.length).fill(0),\n shiftVacation: new Array(this.dateArray.length).fill(0),\n recentAssignment: { shift: 0, numberOfDays: 4 },\n },\n ];\n this.openEditEmployee({ detail: { id: newId } });\n }", "function Employee(id, firstName, lastName, title) //object function Employee with 4 parameters\n{\n this.id = id;\n this.firstName = firstName;\n this.lastName = lastName;\n this.title = title;\n}", "function Employee() {\n this.name = '';\n this.dept = 'general';\n}", "function addEmployees() {\n console.log(' in addEmployees');\n const newEmp = new Employees(\n $('#firstNameIn').val(),\n $('#lastNameIn').val(),\n $('#idIn').val(),\n $('#titleIn').val(),\n $('#annualSalaryIn').val()\n )\n console.log('added', newEmp);\n employees.push(newEmp);\n \n displayEmp();\n} // end of addEmployees function ", "function Employee(name) {\r\n this.name = name;\r\n}", "function Employee(fName, lName, birthYear) {\r\n this.fName = fName;\r\n this.lName = lName;\r\n this.fullName = function () {\r\n return this.fName + \" \" + this.lName;\r\n }\r\n this.birthYear = birthYear;\r\n \r\n \r\n}", "function employee(id, firstName, lastName, dept, position, email, phone, photo) {\n this.id = id;\n this.firstName = firstName;\n this.lastName = lastName;\n this.dept = dept;\n this.position = position;\n this.email = email;\n this.phone = phone;\n this.photo = photo;\n}", "function Employee(name) {\n this.employeeName = name;\n }", "function createEmployeeRecord([firstName, familyName, title, payPerHour]) {\r\n let obj = {\r\n firstName: firstName,\r\n familyName: familyName,\r\n title: title,\r\n payPerHour: payPerHour,\r\n timeInEvents: [],\r\n timeOutEvents: []\r\n }\r\n return obj\r\n}", "function Employee(firstName, lastName, middleName, age, designation, salary) {\n\n this._id = encodeURIComponent((this.fistName + '_' + this.middleName + '_' + this.lastName + '_' + this.designation).replace(' ', '_'));\n this.firstName = firstName;\n this.lastName = lastName;\n this.middlename = middlename;\n this.age = age;\n this.designation = designation;\n this.salary = salary;\n }", "function Empolyee(name) {\n this.employeeName = name;\n }", "function Employee(name,age,salary){\n Person.call(this,name,age);\n this.salary=salary;\n}", "function Employee(id,name,salary){\n if (this.constructor !== Employee)\n return new Employee(id,name,salary);\n var _id = 0,\n \t\t_name = \"\",\n \t\t_salary = 0;\n\n \tthis.id = function(){\n \t\tif (arguments.length === 0 ) return _id;\n \t\tif (arguments[0] > 0) _id = id;\n \t};\n\n \tthis.name = function(){\n \t\tif (arguments.length === 0 ) return _name;\n \t\tif (arguments[0] !== \"\") _name = name;\n \t};\n \tthis.salary = function(){\n \t\tif (arguments.length === 0 ) return _salary;\n \t\tif (arguments[0] > 0) _salary = salary;\n \t}\n \tthis.id(id);\n \tthis.name(name);\n \tthis.salary(salary);\n}", "function Employee(firstName, lastName, id) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.id = id;\n this.getFullName = function() {\n return `${this.firstName} ${this.lastName}`; \n }\n this.getId = function() {\n return id;\n }\n}", "function Employee(ss, name, workDays, hours) {\n this.ss = ss;\n this.name = name;\n this.workDays = workDays;\n this.hours = hours;\n}", "constructor(name, establishedDate, country, businessType, employees){\n this.name = name;\n this.establishedDate = establishedDate;\n this.country = country;\n this.businessType = businessType;\n this.employees = employees;\n }", "function Employee(name,age,salary){\n // this.name = name;\n // this.age = age;\n Person.call(this,name,age);\n this.salary = salary;\n\n}", "function Employee(code, name, gender, annualSalary, dateOfBirth) {\n this.code = code;\n this.name = name;\n this.gender = gender;\n this.annualSalary = annualSalary;\n this.dateOfBirth = dateOfBirth;\n }", "constructor (AllEmployeeName,AllEmployeeDepartment,AllEmployeeByManager,AddEmployee,\n RemoveEmployee,UpdateEmployeeRole,UpdateEmployeeManager)\n {\n this.AllEmployeeName = AllEmployeeName\n this.AllEmployeeDepartment = AllEmployeeDepartment\n this.AllEmployeeByManager = AllEmployeeByManager\n this.AddEmployee = AddEmployee\n this.RemoveEmployee = RemoveEmployee\n this.UpdateEmployeeRole = UpdateEmployeeRole\n this.UpdateEmployeeManager = UpdateEmployeeManager\n }", "function createEmp() {\n new Employee($('#firstName').val(), $('#lastName').val(), $('#idNum').val(), $('#job').val(), $('#annSal').val());\n // clear input fields\n $('#firstName').val('');\n $('#lastName').val('');\n $('#idNum').val('');\n $('#job').val('');\n $('#annSal').val('');\n} //END createEmp function", "function Employee(){\n \tthis.basicSalary = 25000;\n \tthis.salary = 0;\n this.health = 0;\n this.feeding = 0;\n this.transport = 0;\n this.vat = 0;\n\n }", "function Employee ( name, position, salary, office ) {\n this.name = name;\n this.position = position;\n this.salary = salary;\n this._office = office;\n\n this.office = function () {\n return this._office;\n }\n }", "constructor(name,id) {\n super(name,id); //Call & using contrusctor of parent Employee object\n }", "function createEmployeeRecord([firstName, familyName, title, payPerHour]) {\n // populates a firstName field from the 0th element, familyName field from the 1th element..etc\n return {\n firstName: firstName,\n familyName: familyName,\n title: title,\n payPerHour: payPerHour,\n // initializes a field, timeInEvents, to hold an empty Array\n timeInEvents: [],\n // initializes a field, timeOutEvents, to hold an empty Array\n timeOutEvents: []\n };\n}", "function Employee(firstName, lastName, idNumber, jobTitle, annualSalary) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.idNumber = idNumber;\n this.jobTitle = jobTitle;\n this.annualSalary = Number(annualSalary);\n this.monthlyCost = Number( (this.annualSalary / 12).toFixed(2) );\n} // END: Employee(firstName, lastName, idNumber, jobTitle, annualSalary)", "function createEmployeeRecord([firstName, familyName, title, payPerHour]) {\n return {\n firstName,\n familyName,\n title,\n payPerHour,\n timeInEvents: [],\n timeOutEvents: []\n }\n}", "function addEmployee(){ \n let firstName = $('#firstIn').val();\n let lastName = $('#lastIn').val();\n let id = $('#idIn').val();\n let title = $('#titleIn').val();\n let salary = $('#salaryIn').val();\n let employee = new Employee(firstName, lastName, id, title, salary);\n employeeList.push(employee)\n console.log(employeeList);\n displayEmployee(employeeList);\n clearInputs();\n totalMonthly+=Number(employee.salary);\n console.log('total: ', totalMonthly);\n displayMonthly(totalMonthly)\n}", "function addEmployee(){\n console.log('in addEmployee');\n \n fnameInput = $('#fname').val();\n lnameInput = $('#lname').val();\n idInput = $('#id').val();\n titleInput = $('#title').val();\n salaryInput = $('#salary').val();\n salaryInput = Math.floor( Number(salaryInput) );\n console.log('input', fnameInput, lnameInput, idInput, titleInput, salaryInput);\n \n $('#employeesList').append(`\n <tr class=\"employeeRow\">\n <td>${fnameInput}</td>\n <td>${lnameInput}</td>\n <td>${idInput}</td>\n <td>${titleInput}</td>\n <td>${salaryInput}</td>\n <td><button class=\"deleteButton\">Delete</button></td>\n </tr>\n `);\n\n $('#fname').val('');\n $('#lname').val('');\n $('#id').val('');\n $('#title').val('');\n $('#salary').val('');\n\n let newEmployee = new EmployeeInfo(fnameInput, lnameInput, idInput, titleInput, salaryInput);\n console.log('temp:', newEmployee);\n\n employeesList.push(newEmployee);\n console.log('employeesList:', employeesList);\n \n\n} // end addEmployee", "function employ (lname,marks,rollnumber){\nthis.lname=lname;\nthis.marks=marks;\nthis.rollnumber=rollnumber;\n}", "static createEmployee(name) {\n return { name: name };\n }", "function Employee1( name, age, role, dept ) {\n // Step 1.1: call Person constructor, passing the newly created object as its context, and name & age\n\n this.role = role;\n this.dept = dept;\n}", "function CommissionedEmployee(name, title) {\n let emp = Employee(name, title);\n emp.setBaseSalary = setBaseSalary;\n emp.setCommissionRate = setCommissionRate;\n emp.setSalesVolume = setSalesVolume;\n emp.getPay = getPay;\n let baseSalary = 0;\n let commissionRate = 0;\n let salesVolume = 0;\n return emp;\n\n/* Define new methods to the CommissionedEmployee class */\n\n function setBaseSalary(dollars) {\n baseSalary = dollars;\n }\n\n function setCommissionRate(rate) {\n commissionRate = rate;\n }\n\n function setSalesVolume(dollars) {\n salesVolume = dollars;\n }\n\n function getPay() {\n return baseSalary + commissionRate * salesVolume;\n }\n\n}", "function Employee(){\n\n}", "function addEmployee() {\n var tempEmpObj = {\n firstname: parent.empObj.firstname,\n lastname: parent.empObj.lastname,\n email: parent.empObj.email,\n address: parent.empObj.address,\n phone: parent.empObj.phone\n };\n return parent.postEmpList(tempEmpObj);\n }", "constructor(name, id, email, officeNumber) {\n\n //takes in information from Employee \n super(name, id, email);\n\n //takes info from Manager object\n this.officeNumber = officeNumber;\n\n\n }", "function createEmployeeObject() {\n var employee = {\n name: $('#name').val(),\n position: $('#position').val(),\n salary: $('#salary').val()\n };\n return employee;\n}", "function Employee(name, title) {\n Person.call(this, name); // super(name)\n this.title = title;\n}", "function createEmployeeRecord(employeeArray) {\n const employeeObj = {firstName: employeeArray[0],\n familyName: employeeArray[1],\n title: employeeArray[2],\n payPerHour: employeeArray[3],\n timeInEvents: [],\n timeOutEvents: []}\n return employeeObj;\n}", "constructor(first_name, last_name, company_name, salary) {\n this.first_name = first_name\n this.last_name = last_name\n this.company_name = company_name\n this.salary = salary\n }", "function finish() {\n const employee = {\n fullName: fullName.value,\n identifyCard: identifyCard.value,\n birthday: birthday.value,\n email: email.value,\n phone: phone.value,\n level: level.value,\n position: position.value,\n department: department.value,\n //salary: salary.innerHTML,\n };\n employees.push(employee);\n console.log(employees);\n displayEmployee();\n editData();\n}", "function constructEmployee(reason, name, start, end, birthdate, role){\n return {\n \"Reason\": reason,\n \"Full name\": name,\n \"Shift start\": start,\n \"Shift end\": end,\n \"Birthdate\": birthdate,\n \"Role\": role,\n }\n}", "function EmployeeType2(name) {\n this.name = name;\n}", "constructor(){\r\n\t\tthis.data = [];//initializing the array as blank...\r\n\t\tthis.data.push(new employee(123, \"Phaniraj\", \"Bangalore\"));\r\n\t\tthis.data.push(new employee(124, \"Mahesh\", \"Bangalore\"));\r\n\t\tthis.data.push(new employee(125, \"Gopal\", \"Mysore\"));\r\n\t\tthis.data.push(new employee(126, \"Venkatesh\", \"Chennai\"));\r\n\t}", "function person1(firstName, lastName, salary) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.salary = salary;\n \n}", "function emp(id,name,salary){ \r\n this.id=id; \r\n this.name=name; \r\n this.salary=salary; \r\n \r\n this.changeSalary=changeSalary; \r\n function changeSalary(otherSalary){ \r\n this.salary=otherSalary; \r\n } \r\n }", "function Person (name, employeeNumber, salary, rating) {\n this.name = name,\n this.employeeNumber= employeeNumber,\n this.salary=salary,\n this.rating=rating\n}", "function createEmployeeRecord(employeeInfo) {\n return {\n firstName: employeeInfo[0],\n familyName: employeeInfo[1],\n title: employeeInfo[2],\n payPerHour: employeeInfo[3],\n timeInEvents: [],\n timeOutEvents: []\n }\n}", "constructor(employeeName, employeeID , employeeEmail ,rank) {\n this.employeeName = employeeName;\n this.employeeID = employeeID;\n this.employeeEmail = employeeEmail;\n this.rank = rank\n }", "constructor(n, a, e, z) {\n this.name = n;\n this.age = a;\n this.email = e;\n this.salary = z;\n }", "function Staff(name, position, nip, salary) {\n\n this.name = name;\n this.position = position;\n this.nip = nip;\n this.salary = salary;\n\n}", "function makeEmployee(name) {\n return {\n getName() {\n return name;\n },\n }; \n}", "function person (name,salary) {\n this.name = name;\n this.salary = salary;\n}", "function addEmployee(employee) {\n var divNode = document.createElement(\"div\");\n\n // create a p element for each field in the employee\n var node = document.createElement(\"h3\");\n var nameNode = document.createTextNode(employee.name );\n node.appendChild(nameNode);\n divNode.appendChild(node);\n\n var innerDivNode = document.createElement(\"div\");\n\n var node = document.createElement(\"p\");\n var officeNode = document.createTextNode('Office: ' + employee.officeNum);\n node.appendChild(officeNode);\n innerDivNode.appendChild(node);\n\n var node = document.createElement(\"p\");\n var phoneNode = document.createTextNode('Phone: ' + employee.phoneNum);\n node.appendChild(phoneNode);\n innerDivNode.appendChild(node);\n\n divNode.appendChild(innerDivNode);\n divNode.classList.add('employeeItem');\n\n return divNode;\n}", "function Programmer(name, salary, experience, language){\n Employee.call(this, name, salary, experience);\n this.language = language;\n}", "function employee_info() {\n var emp=\n [\n {\n name:\"Amarjeet malik\",\n age:22,\n salary:8000,\n DOB:\"04/08/1996\"\n },\n {\n name:\"Dolly\",\n age:21,\n salary:10000,\n DOB:\"14/11/1997\"\n },\n {\n name:\"Surya\",\n age:19,\n salary:4000,\n DOB:\"03/07/1999\"\n },\n {\n name:\"Sampriti\",\n age:19,\n salary:900,\n DOB:\"12/08/1999\"\n }\n ];\n console.log(\"Employees info:\");\n console.log(emp);\n}", "function createEmployeeRecord(array) {\r\n let object = {\r\n firstName: array[0],\r\n familyName: array[1],\r\n title: array[2],\r\n payPerHour: array[3],\r\n timeInEvents: [],\r\n timeOutEvents: [],\r\n }\r\n\r\n return object\r\n\r\n }", "function Programmer(name, salary, experience, language){\r\n Employee.call(this, name, salary, experience);\r\n this.language = language;\r\n}", "function addEmployee() {\n console.log('button clicked');\n let firstNameIn = $('#firstNameIn').val();\n let lastNameIn = $('#lastNameIn').val();\n let idNumberIn = $('#idNumberIn').val();\n let jobTitleIn = $('#jobTitleIn').val();\n let annualSalaryIn = $('#annualSalaryIn').val();\n let newEmployee = new Employee(firstNameIn, lastNameIn, idNumberIn, jobTitleIn, annualSalaryIn);\n employeeArray.push(newEmployee);\n\n //call monthly total function\n calculateMonthly();\n //call empty input function\n emptyInput();\n //call function to append\n appendEmployees();\n}", "function createEmployeeRecord(eData){\n let record = {};\n record.firstName = eData[0];\n record.familyName = eData[1];\n record.title = eData[2];\n record.payPerHour = eData[3];\n record.timeInEvents = [];\n record.timeOutEvents = [];\n return record;\n}", "function updateEmployeeList() {\n\n $('#EmployeeList').empty(); //clear out data\n\n //create variables from input fields\n let firstNameIn = $('#firstNameIn').val();\n let lastNameIn = $('#lastNameIn').val();\n let idNumberIn = $('#idNumberIn').val();\n let jobTitleIn = $('#jobTitleIn').val();\n let annualSalaryIn = ($('#annualSalaryIn').val());\n //monthlySalary = annualSalaryIn.toFixed(2); //take 2 decimals from input field\n\n\n //test to make sure variables and functions work\n console.log('employee annualSalaryIn:', annualSalaryIn);\n\n\n //create new employee object from class constructor \n let addEmployee = new Employee(firstNameIn, lastNameIn, idNumberIn, jobTitleIn, annualSalaryIn);\n employeeData.push(addEmployee); // push new Employee into employee data array\n\n //create variable for output/appending to HTML\n let newEmployee = (firstNameIn + ' ' + lastNameIn + ' ' + idNumberIn\n + ' ' + jobTitleIn + ' ' + '$' + annualSalaryIn);\n\n //test: console.log( 'showing', newEmployee);\n\n //append new employee info to html \n $('#employeeList').append('<p>' + newEmployee + '</p>');\n\n $('#firstNameIn').empty('First Name');\n $('#lastNameIn').empty();\n $('#idNumberIn').val();\n $('#jobTitleIn').val();\n $('#annualSalaryIn').val();\n\n} //end updateEmployeeList", "function EmployeeObject()\n{\n\tthis.Company = null;\n\tthis.EmployeeNbr = null;\n\tthis.PayPlan = null;\n\tthis.EmployeeName = null;\n\tthis.SupervisorName = null;\n\tthis.DepartmentName = null;\n\tthis.SalaryClass = null;\n\tthis.Email = null;\n\tthis.SupervisorEmail = null;\n\tthis.GroupName = null;\n\tthis.PayCodeGroupName = null;\n}", "function EmployeeObject()\n{\n\tthis.Company = null;\n\tthis.EmployeeNbr = null;\n\tthis.PayPlan = null;\n\tthis.EmployeeName = null;\n\tthis.SupervisorName = null;\n\tthis.DepartmentName = null;\n\tthis.SalaryClass = null;\n\tthis.Email = null;\n\tthis.SupervisorEmail = null;\n\tthis.GroupName = null;\n\tthis.PayCodeGroupName = null;\n}", "function mapEmployees(id,nome,cognome,livello,salario){\n var impiegato ={\n id : id,\n name : nome,\n surname : cognome,\n level : livello,\n salary: salario\n }\n employee.push(impiegato);\n}", "constructor(firstName, lastName, email, age){\n // When we create a new manager, we still want to define their first name, last name, email, and age when we create a new instance\n super(firstName, lastName, email, age)\n // The cool thing is that we can invoke a special function called \"super\" which will call the \"parent's\" constructor method, in this case the Employee class constructor method is being called.\n // By calling super, we don't need to define this.first_name = firstName etc. because the parent class takes care of that already.\n\n // We can also identify new properties that we want to add on top of the properties inherited from the parent class\n this.reports = [];\n }", "constructor(id, name, salary, gender, startDate) {\n this.id = id;\n this.name = name;\n this.salary = salary;\n this.gender = gender;\n this.startDate = startDate;\n }", "function createEmployeeRecord(array){\n return{\n firstName: array[0],\n familyName: array[1],\n title: array[2],\n payPerHour: array[3],\n timeInEvents: [],\n timeOutEvents: []\n }\n}", "constructor(id, name, email, github){\n //to access the superclass (Employee) constructor and methods, use super().\n //Must call super constructor in derived class before accessing \n //'this' or returning from derived constructor at new Manager to avoid\n //the error: ReferecenError.\n super(id, name, email);\n this.github = github;\n }", "function Employee(eid, ename, deptNo) {\n if (eid === void 0) { eid = 0; }\n if (ename === void 0) { ename = \"null\"; }\n if (deptNo === void 0) { deptNo = 0; }\n this.eid = eid;\n this.ename = ename;\n this.deptNo = deptNo;\n }", "constructor(newName,newLastName,newBirthDate){\n this.name = newName;\n this.lastName = newLastName;\n this.birthDate = newBirthDate;\n }", "function createEmployeeRecord(array) {\n const firstName = array[0]\n const lastName = array[1]\n const title = array[2]\n const pay = array[3]\n return {\n firstName: firstName,\n familyName: lastName,\n title: title,\n payPerHour: pay,\n timeInEvents: [],\n timeOutEvents: []\n }\n}", "constructor(firstName, lastName, age, likes, position) {\n // IMPORTANT LINE to inherit the already existing Human properties\n super(firstName, lastName, age, likes)\n // and now down below defines what makes \"Employee\" unique\n this.position = position\n }", "function Person1(firstName, lastName, salary){\n this.firstName = firstName;\n this.lastName = lastName;\n this.salary = salary;\n}", "function Person(firstName, lastName, loginID, startDate) {\n this.firstName=firstName;\n this.lastName=lastName;\n this.loginID=loginID;\n this.startDate=startDate;\n}", "constructor(name, id, email, github){\n // same as super class employee + github\n super(name, id, email);\n this.github = github;\n }", "function addingEmployeesIntoArray(firstName, lastName, iD, title, annualSalary) {\n console.log('In addingEmployeesIntoArray function!', firstName, lastName, iD, title, annualSalary);\n const employeeNew = {\n first: firstName,\n last: lastName,\n id: iD,\n title: title,\n salary: annualSalary\n };\n addedEmployeeArray.push(employeeNew);\n return true;\n}", "function create() {\n emp = new Object();\n emp.Title = $(\"#TextBoxTitle\").val();\n emp.Firstname = $(\"#TextBoxFirstname\").val();\n emp.Lastname = $(\"#TextBoxLastname\").val();\n emp.Phoneno = $(\"#TextBoxPhone\").val();\n emp.Email = $(\"#TextBoxEmail\").val();\n emp.DepartmentId = $(\"#ddlDepts\").val();\n}", "function newPerson (firstName,lastName,age){\n // adding a new object directly into the array postion `family` is the name of our array \n // we refferance `family` and then in the brackets [family.length] \n // family.length is a way to refferance the length of family. \n family[family.length] = {\n firstName: firstName,\n lastName: lastName,\n age: age,\n };\n}", "constructor(name, id, email, school) {\n // grabbing the name, id, and email from employee\n super(name, id, email);\n this.role = \"Intern\";\n this.school = school;\n }", "function createEmployeeRecord (arraySt){\r\n\r\n return {\r\n firstName : arraySt[0],\r\n familyName: arraySt[1],\r\n title: arraySt[2],\r\n payPerHour: arraySt[3],\r\n timeInEvents : [],\r\n timeOutEvents:[]\r\n }\r\n}", "function bob(){\n new Employ(\"Bob Cool\", \"cool\", 200, 40, 30);\n setstats();\n act_money();\n}", "function createEmployee() {\n // add an Engineer or Intern?\n inquirer.prompt(questions.employee).then((employeeRole) => {\n switch (employeeRole.empRole) {\n case \"Engineer\":\n inquirer.prompt(questions.engineer).then((engResponses) => {\n let newEngineer = new Engineer(\n engResponses.engName,\n engResponses.engId,\n engResponses.engEmail,\n engResponses.engGithub\n );\n employees.push(newEngineer);\n console.log(\"New engineer has been added to the team: \", newEngineer);\n confirmEmployee();\n });\n break;\n case \"Intern\":\n inquirer.prompt(questions.intern).then((internResponses) => {\n let newIntern = new Intern(\n internResponses.internName,\n internResponses.internId,\n internResponses.internEmail,\n internResponses.internSchool\n );\n employees.push(newIntern);\n console.log(\"New intern has been added to the team: \", newIntern);\n confirmEmployee();\n });\n break;\n }\n });\n}", "function handleClick(){ \n console.log( 'click!');\n //get value of handle called and declaire const firstName\n // val always returns a string\n const firstName = $('#firstName').val();\n const lastName = $('#lastName').val();\n const idNumber = $('#idNumber').val();\n const title = $('#title').val();\n const salary = $('#salary').val();\n //at this point make a global variable (see above)\n \n \n // V1 using objects\n // const employee = {\n // //items on left are the keyname \n // firstName : firstName, \n // lastName : lastName, \n // idNumber : idNumber, \n // title : title, \n // salary : salary, \n // }\n //V2 using classes!\n const employee = new Employee(firstName, lastName, idNumber, title, salary);\n console.log( 'in employee declaring new Employee class', employee);\n\n\n employeeArray.push(employee);\n console.log('Employee Array', employeeArray);\n\n appendEmployees(); \n }", "function newEmployee() {\n\tvar emp = {\n\t\thead : \"new\",\n\t\t// dirId: '${sessionScope.empId}',\n\t\tid : $('[name=id1]').val(),\n\t\tfname : $('[name=fname1]').val(),\n\t\tlname : $('[name=lname1]').val(),\n\t\taddress : $('[name=address1]').val(),\n\t\tpossition : $('[name=possition1]').val(),\n\t\teMail : $('[name=email1]').val(),\n\t\tpassword : $('[name=psw1]').val(),\n\t};\n\tdoSend(JSON.stringify(emp));\n\tclear2();\n}", "constructor(firstName, lastName, email, age) {\n // We still need to define a custom first name, last name, email, and age for each employee\n super(firstName, lastName, email, age)\n // We call super to invoke the parent's constructor method in this case Manager. Manager wil then call super on the employee which will set this employees first name, last name, email, and age\n\n // We can also give this class additional properties: title and bonus\n this.title = 'Not a manager'\n this.bonus = 0\n }", "function EmployeeCreate (EmployeeEntry) {\n var employee = {\n id: params.id,\n name: params.name,\n }\n var EmployeeHash = commit(\"Employee\", employee);\n return EmployeeHash;\n}", "function addEmployee(employeeInfoObject) {\n employeeInfo.push(employeeInfoObject);\n render();\n\n}" ]
[ "0.7673696", "0.7647592", "0.76313215", "0.7536549", "0.75345767", "0.7522685", "0.7522685", "0.7522511", "0.7521508", "0.75141406", "0.74753517", "0.74700046", "0.7468802", "0.7468523", "0.7442836", "0.7288481", "0.7284053", "0.72475547", "0.7201586", "0.71832836", "0.7106051", "0.70849067", "0.7083316", "0.69487345", "0.6948716", "0.69466734", "0.6942213", "0.6929536", "0.6923029", "0.6920261", "0.69102764", "0.6885404", "0.68733144", "0.68460286", "0.6842901", "0.6817415", "0.68056405", "0.6785712", "0.67801666", "0.6777604", "0.6773238", "0.67714906", "0.6754084", "0.6743627", "0.6738173", "0.6713694", "0.6688229", "0.66558546", "0.66529745", "0.6609006", "0.65941536", "0.6547585", "0.6542302", "0.6540877", "0.6520895", "0.65098625", "0.65077734", "0.6424568", "0.64188606", "0.6412722", "0.64056844", "0.6399886", "0.63944125", "0.63838065", "0.63757235", "0.63625896", "0.6356607", "0.6334658", "0.6324163", "0.632119", "0.63137424", "0.63106835", "0.62923026", "0.62824935", "0.62720466", "0.6271928", "0.6271928", "0.6241809", "0.6229956", "0.6218144", "0.62073714", "0.6189096", "0.6187641", "0.6187618", "0.6185615", "0.618352", "0.61742985", "0.6171813", "0.61588246", "0.61549526", "0.61503917", "0.614129", "0.6134377", "0.61314297", "0.61202556", "0.61172515", "0.6116177", "0.6086361", "0.6080586", "0.60764164", "0.6070225" ]
0.0
-1
Checking if confirm password box is the same as password box ///////
check() { if (this.state.signupmessage != "") { this.setState({"signupmessagevisible":"contents"}); } else { this.setState({"signupmessagevisible":"none"}); } if (this.state.loginmessage != "") { this.setState({"loginmessagevisible":"contents"}); } else { this.setState({"loginmessagevisible":"none"}); } if (this.state.confirmpasswordstatus != "") { this.setState({"confirmpasswordstatusvisible":"contents"}); } else { this.setState({"confirmpasswordstatusvisible":"none"}); } try { if (this.state.password === this.state.confirmpassword) { // Both blank if (this.state.password === "") { this.setState({confirmpasswordstatus: ""}); this.setState({signupmessage: ""}); } // Both the same else { this.setState({confirmpasswordstatus: ""}); } } else { this.setState({confirmpasswordstatus: "passwords do not match"}); } } catch (e) { console.log("Error") } if (!(this.state.password === "")) { this.setState({signupmessage:""}); var password = this.state.password; if (password.length < 8) { this.setState({signupmessage: "- Password must be at least 8 characters long\n"}); } var symbols = 0; var lowercase = 0; var uppercase = 0; var numbers = 0; for (var i=0; i<password.length; i++){ if ("abcdefghijklmnopqrstuvwxyz".includes(password[i])) { lowercase += 1; } else if ("ABCDEFGHIJKLMNOPQRSTUVWXYZ".includes(password[i])) { uppercase += 1; } else if ("1234567890".includes(password[i])) { numbers += 1; } else if ("!-_<>.&$£".includes(password[i])) { symbols += 1; } else { this.setState({signupmessage: this.state.signupmessage + "- Passwords may only contain letters, numbers and the following symbols: '!-_<>.&$£'\n"}); } } if (!((symbols > 0) && (lowercase > 0) && (uppercase > 0) && (numbers > 0))){ if (symbols == 0) { this.setState({signupmessage: this.state.signupmessage + "- Passwords must contain at least 1 allowed symbol: '!-_<>.&$£'\n"}); } if (lowercase == 0) { this.setState({signupmessage: this.state.signupmessage + "- Passwords must contain at least one lowercase letter\n"}); } if (uppercase == 0) { this.setState({signupmessage: this.state.signupmessage + "- Passwords must contain at least one uppercase letter\n"}); } if (numbers == 0) { this.setState({signupmessage: this.state.signupmessage + "- Passwords must contain at least one number\n"}); } } else if ((!(this.state.signupmessage === "Account creation error")) || (!(this.state.signupmessage === "") || (!(this.state.signupmessage === "Account already exists, try logging in")))){ this.setState({signupmessage: ""}); } } else if ((!(this.state.signupmessage === "Account creation error")) || (!(this.state.signupmessage === "") || (!(this.state.signupmessage === "Account already exists, try logging in")))){ //this.setState({signupmessage: ""}); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirmPassword(p1, p2 ){ if (p1.value && p1.value !== p2.value) {\n password2Ok = 0;\n showError(p2, \"Both passwords must match.\")\n} else if (p1.value && p1.value === p2.value) {\n password2Ok = 1;\n showSuccess(p2)\n}\n}", "function comparePassword() {\n\t\tvar newPassword = $(\"#txtNewPassword\").val();\n\t\tvar newPasswordConfirm = $(\"#txtNewPasswordConfirm\").val();\n\t\t// compare\n\t\tif (newPassword == newPasswordConfirm) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function checkPasswordMatch() {\n var password = $(\"#password-input\").val();\n var confirmPassword = $(\"#password-check\").val();\n \n if (password !== confirmPassword){\n $(\"#divCheckPasswordMatch\").html(\"Passwords do not match!\");\n }\n else{\n $(\"#divCheckPasswordMatch\").html(\"Passwords match.\");\n }\n }", "function judgeConfirm()\n{\n var password = document.getElementById(\"Password_Password\").value;\n var confirm = document.getElementById(\"Password_Confirm\").value;\n clearDivText(\"Div_Confirm\");\n if(confirm.length > 0 && password == confirm)\n {\n setDivText(\"Div_Confirm\", TYPE_CORRECT, \"\");\n return true;\n }\n else\n {\n if(confirm.length > 0)\n {\n setDivText(\"Div_Confirm\", TYPE_ERROR, \"两次输入密码不同\");\n }\n else\n {\n setDivText(\"Div_Confirm\", TYPE_ERROR, \"未输入密码\");\n }\n return false;\n }\n}", "function checkPasswordMatch() {\n var password = $(\"#password\").val();\n var confirmPassword = $(\"#confirmPassword\").val();\n \n if (password != confirmPassword)\n $(\"#divCheckPasswordMatch\").html(\"Passwords do not match!\");\n else\n $(\"#divCheckPasswordMatch\").html(\"Passwords match.\");\n }", "function confirmPass() {\n var pass = document.getElementById(\"pass1\").value\n var confPass = document.getElementById(\"pass2\").value\n if (pass != confPass) {\n alert('Wrong confirm password !');\n return false\n } else {\n return true;\n }\n}", "function checkConfirmPassword() {\n var password = $modalPass.val();\n var confirmPassword = $modalConfirmPass.val();\n if (password !== confirmPassword) {\n $confirmPasswordError.html(\"Passwords Did Not Match\");\n $confirmPasswordError.show();\n $modalConfirmPass.css(\"border-bottom\",\"2px solid #F90A0A\");\n confirmPasswordError = true;\n } else {\n $confirmPasswordError.hide();\n $modalConfirmPass.css(\"border-bottom\",\"2px solid #34F458\");\n }\n }", "function checkPasswordsMatch() {\n\tif (password.value !== confirmPassword.value) {\n\t\tshowError(confirmPassword, 'Passwords do not match')\n\t}\n}", "function checkPasswords() {\n\n var field_new_pass = document.getElementById('new_password').value;\n var field_conf_new_pass = document.getElementById('conf_new_password').value;\n\n if(field_new_pass != field_conf_new_pass) {\n window.alert('Confirmation of password was failed');\n return false;\n }\n else if(field_new_pass != ''){\n window.alert('Success');\n }\n}", "function checkPasswordMatch(password,confirmPassword)\n{\n\tif (password != confirmPassword) {\n \treturn 'false';\n } else {\n return 'true';\n } \n}", "function checkPasswordMatch() {\n\t\tvar password = $(\"#txtNewPassword\").val();\n\t\tvar confirmPassword = $(\"#txtConfirmPassword\").val();\n\n\t\tif (password != confirmPassword) {\n\t\t\t$(\"#txtConfirmPassword\").removeClass(\"border-success\");\n\t\t\t$(\"#txtConfirmPassword\").addClass(\"border-danger\");\n\t\t\t$(\"#divCheckPasswordMatch\").html(\"<i><small class='text-danger'>Password Harus Sama</small></i>\");\n\t\t\t$('#tbhUser').prop('disabled', true);\n\t\t} else {\n\t\t\t$(\"#txtConfirmPassword\").removeClass(\"border-danger\");\n\t\t\t$(\"#txtConfirmPassword\").addClass(\"border-success\");\n\t\t\t$(\"#divCheckPasswordMatch\").html(\"<i><small class='text-success'>Password Cocok</small></i>\");\n\t\t\t$('#tbhUser').prop('disabled', false);\n\t\t}\n\t}", "function checkPasswordMatch() {\n const password = $(\"#password\").val();\n const confirmPassword = $(\"#password2\").val();\n const feedback = $(\"#divCheckPasswordMatch\");\n\n if (password !== confirmPassword) {\n feedback.html(\"Wachtwoorden zijn niet gelijk!\").removeClass('text-success').addClass('text-danger');\n return;\n }\n\n feedback.html(\"Wachtwoorden zijn gelijk.\").removeClass('text-danger').addClass('text-success');\n }", "function check_field_password(password, confirm_password) {\n if (password != confirm_password) {\n set_message('error', 'Passwords don\\'t match. Please try again.');\n clear_message();\n return true;\n }\n return false;\n}", "function checkpw(inputpw,inputpwc){\n if(inputpw.value != inputpwc.value){\n document.getElementById(\"Password\").innerHTML = \"Please check passward you type in. The password is not equal to password confirm.\"+\"<br>\";\n inputpw.value = \"\";\n inputpwc.value = \"\";\n return false;\n }\n else\n return true;\n}", "function checkConfirmPassword()\r\n\t{\r\n\t\tvar newPassword=$(\"#Npass\").val();\r\n\t\tvar confirmPassword=$(\"#Cpass\").val();\r\n\t\t \r\n\t\t if(!isEmpty(confirmPassword))\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t$(\"#Cpass\").css(\"border-color\",\"red\");\r\n\t\t\t\t$(\"#CpassP\").text(\"confirm password is Required\").css(\"color\",\"red\").show();\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\tif(!passwordRegEx.test(confirmPassword))\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$(\"#Cpass\").css(\"border-color\",\"red\");\r\n\t\t\t\t$(\"#CpassP\").text(\"Invalid confirm password Entered\").css(\"color\",\"red\").show();\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\tif(newPassword!=confirmPassword)\r\n\t\t\t{\r\n\t\t\t\r\n\t\t\t\t$(\"#Cpass,#Npass\").css(\"border-color\",\"red\");\r\n\t\t\t\t$(\"#CpassP,#NpassP\").text(\"New and confirm Password must be same\").css(\"color\",\"red\").show();\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t \r\n\t\telse\r\n\t\t\t{\r\n\t\t\t\t$(\"#Cpass\").css(\"border-color\",\"\");\r\n\t\t\t\t$(\"#CpassP\").hide();\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}\t\r\n\t}", "checkPwd() {\n const pwd = document.getElementById('newPwd').value,\n rpt = document.getElementById('repeatPwd').value;\n\n if (pwd !== rpt) {\n alert(getLang('SAME_PWD'));\n return false;\n }\n }", "function confirm_psw() {\n var p1 = document.user_reg_form.reg_psw.value;\n var p2 = document.user_reg_form.con_psw.value;\n\n if (p1 == p2) {\n document.getElementById('con_msg').innerHTML = 'Password Match';\n document.getElementById('con_msg').style.color = 'green';\n } else {\n document.getElementById('con_msg').innerHTML = 'Password Not Match';\n document.getElementById('con_msg').style.color = 'red';\n\n }\n}", "function validatePasswords(){\r\n var password = document.getElementById(\"password\").value;\r\n var confirmPassword = document.getElementById(\"confirmpassword\").value;\r\n if (confirmPassword != password){\r\n document.getElementById(\"passwordsmatch\").innerHTML = \"The passwords do not match.\";\r\n }\r\n else{\r\n document.getElementById(\"passwordsmatch\").innerHTML = \"\";\r\n }\r\n}", "function CheckConfirmPWD() {\r\n if (!($scope.VendorDetails.Password == $scope.VendorDetails.ConfirmPassword)) {\r\n $scope.fpwdclass = true;\r\n $scope.innerhtml = \"Password and Confirm Password must be same\";\r\n if (!($scope.VendorDetails.ConfirmPassword.length == 0)) {\r\n document.getElementById('pwd2').focus();\r\n }\r\n\r\n $scope.VendorDetails.ConfirmPassword = \"\";\r\n return false;\r\n }\r\n else {\r\n $scope.innerhtml = \" \";\r\n $scope.fpwdclass = false;\r\n return true;\r\n }\r\n }", "function confirmPassword() {\n var pass1 = document.getElementById('pwd1').value;\n var pass2 = document.getElementById('pwd2').value;\n\n if (pass1 == pass2 && pass2.length > 6) {\n document.getElementById('pwd2Tick').style.display = 'block';\n document.getElementById('pwd2Cross').style.display = 'none';\n return true;\n } else {\n document.getElementById('pwd2Cross').style.display = 'block';\n document.getElementById('pwd2Tick').style.display = 'none';\n return false;\n }\n}", "function comparePwd(password, confPwd)\r\n{\r\n\t if(password != confPwd)\r\n\t {\r\n\t\t alert(\"Re-type the New Password in Confirm Password field\");\r\n\t\t $('#txtConfPwd').focus();\r\n\t\t return false;\r\n\t }\r\n\t else\r\n\t {\r\n\t\t return true; \r\n\t }\r\n}", "function checkConfirm () {\n var confirmBox = document.getElementById(\"confirm\");\n var confirm = confirmBox.value;\n \n var password = document.getElementById(\"password\");\n var confirm = document.getElementById(\"confirm\");\n // alert (password.value+\" \"+confirm.value)\n if (password.value != confirm.value) {\n //Password is different\n confirmBox.style.borderColor = \"red\";\n \n } else {\n //Password is same\n confirmBox.style.borderColor = \"green\";\n }\n}", "function validconfpass()\n{\nvar p1=document.getElementById(\"pword\").value;\nvar p2=document.getElementById(\"confpword\").value;\n\n\nif(p1.length==0 )\n{\nalert(\"Password is required\");\n}\n\nif(p1!=p2)\n{\nalert(\"Password does not match\");\n}\nelse if()\n{\ndocument.getElementById(\"mess3\").innerHTML=\"Password confirmed\";\n}\n}", "function checknewpass(x,y,z)\n{\n\tlet pone=x;\n\tlet ptwo=y;\n\tlet locz=z;\n\tlet pwd1=$('#'+pone).val();\n\tlet pwd2=$('#'+ptwo).val();\n\n\tif (pwd1==\"\" || pwd2==\"\")\n\t{\n\t\treturn;\n\t}\n\n\tif (pwd1!=pwd2) \n\t{\n\t\t$('#'+locz).html(\"<b><center>Passwords do not match!</center></b>\");\n\n\t}\n\telse\n\t{\n\t\t$('#'+locz).html(\"\");\n\n\t}\n\n}", "function passwordMatch(password, confirm_password) {\n\n if (password != confirm_password) {\n resetFields();\n\t document.getElementById(\"passError\").innerHTML = \"Password does not match!\";\n\t document.getElementById(\"passError\").style.color = \"red\";\n\t\tdocument.getElementById(\"pword\").style.border = \"3px solid red\";\n\t document.getElementById(\"cpword\").style.border = \"3px solid red\";\n\t \n return false;\n } else {\n\n\t\tresetFields();\n return true;\n }\n\n\n}", "function checkPass() {\n var pass = \"\";\n $(opts['classname']).each(function(i){\n if (i == 0) {\n pass = $(this).val();\n } else {\n if ($(this).val() != pass) {\n if (opts['messages']['confirmation']) {\n errors.push (opts['messages']['confirmation']);\n } else {\n errors.push (opts['title'] + ' confirmation mismatch');\n }\n }\n }\n });\n }", "function checkPasswords() {\n var password = document.getElementById('InputPassword');\n var retypePassword = document.getElementById('InputPassword2');\n\n if (password.value != retypePassword.value) {\n showFeedBack(retypePassword.name,\"NoMatch\");\n if(retypePassword.value != \"\"){\n retypePassword.value = \"\";\n retypePassword.focus();\n }\n passwordError = true;\n } else {\n if(retypePassword.value != \"\"){\n showFeedBack(retypePassword.name,\"valid\");\n passwordError = false;\n }\n \n }\n \n }", "function confirmPassword(inputPassword) {\n let confirm;\n\n if (inputPassword.match(password) === null) {\n confirm = false;\n }\n else {\n const test = inputPassword.match(password).join(\"\");\n \n // if (test === inputPassword) {\n // confirm = true;\n // }\n // else {\n // confirm = false;\n // }\n test === inputPassword ? confirm = true: confirm = false;\n }\n\n\n if (confirm) {\n sendLogin();\n }\n else {\n console.error(\"error\");\n incorrectPassword();\n }\n}", "function testConfirmPassword(event){\n // != 0 is to prevent default from changing when there's no password input\n if (passRecieved.value == confirmRecieved.value && passRecieved.value.length != 0) {\n confirmPassTagRecieved.innerHTML = 'Your password matches.';\n confirmPassTagRecieved.classList.add('confirmPassCorrect');\n confirmPassTagRecieved.classList.remove('confirmPassIncorrect');\n checkConfirmPassword = true;\n } else {\n confirmPassTagRecieved.innerHTML = 'Your password doesn\\'t match.';\n confirmPassTagRecieved.classList.add('confirmPassIncorrect');\n confirmPassTagRecieved.classList.remove('confirmPassCorrect');\n checkConfirmPassword = false;\n }\n}", "function confirmPasswordMatch() {\n const passwordField = document.querySelector(\"#password\");\n const confirmPassword = document.querySelector(\"#confirm-password\");\n const passwordWarningText = document.querySelector(\".confirm-warning\");\n\n if (confirmPassword.value !== passwordField.value) {\n confirmPassword.classList.remove(\"valid\");\n confirmPassword.classList.add(\"invalid\");\n passwordWarningText.classList.remove(\"hidden\");\n }\n else {\n passwordWarningText.classList.add(\"hidden\");\n }\n\n}", "function check()\n{\n\tvar pass1 = document.getElementById('pass');\n\tvar pass2 = document.getElementById('confirmpass');\n\tif(pass1.value != pass2.value)\n\t{\n\t\talert(\"Password Not Match\");\n\t\treturn false;\n\t}\n}", "function passwordMatchCheck(form) {\n password = form.password.value;\n passwordConfirm = form.passwordConfirm.value;\n\n if (password != passwordConfirm) {\n alert(\"\\nPassword did not match: Please try again...\");\n return false;\n } else {\n return true;\n }\n}", "function validatePasswordMatch(password, confirmPassword) {\n if (password === confirmPassword) {\n return true;\n } else {\n return \"Password do not match!\"\n }\n}", "function validatechangePasswordForm()\n{\n\tvar currentPassword = validatePassword(\"changePasswordForm\",\"currentPassword\",\"currentPasswordSpan\");\n\tvar equal = passwordEqual(\"changePasswordForm\",\"newPassword\",\"confirmPassword\",\"newPasswordSpan\",\"confirmPasswordSpan\");\n\tif (currentPassword & equal)\n\t {\n\t \treturn true;\n\t }\n\t return false;\n}", "function passwordEqual(form,newpass,confirmpass,newpasspan,confrmpasapan)\n{\n\tvar password = document.forms[form][newpass].value;\n\tvar confirmPassword = document.forms[form][confirmpass].value;\n\tvar passwordMismach = document.getElementById(\"passwordMismarch\");\n\n\t//checks if the two passwords march\n\tvar fPass = validatePassword(form,newpass,newpasspan);\n\tvar sPass = validatePassword(form,confirmpass,confrmpasapan);\n\n\tif (fPass&sPass)\n\t {\n\t \t//checks if the two passwords match\n\t \tif (confirmPassword==password) \n\t \t{\n\t \t\tpasswordMismach.innerHTML=\"\";\n\t \t\treturn true;\n\t \t}\n\t \telse\n\t \t{\n\t \t\tpasswordMismach.innerHTML=\"password did not match\";\n\t \t\tdocument.forms[form][newpass].value=\"\";\n\t \t\tdocument.forms[form][confirmpass].value=\"\";\n\t \t}\n\t }\n\t else\n\t {\n\t \tpasswordMismach.innerHTML=\"\";\n\t }\n\t return false;\n}", "function checkPassword(form)\r\n{\r\n if (form.Password.value != form.PasswordConfirm.value)\r\n {\r\n alert(\"Passwords do not match!\");\r\n return false;\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n}", "function validateConfPass() {\n if (user_conf.value === user_pass.value) {\n document.getElementById(\"alert_conf_pass\").innerHTML = \"\";\n return true;\n }\n document.getElementById(\"alert_conf_pass\").innerHTML =\n \"Password did'nt matched \";\n return false;\n}", "function validatePassword(){\n var pass = document.getElementById(\"password1\");\n var confirm = document.getElementById(\"confirm_password\");\n\n if(pass.value == confirm.value){\n confirm.setCustomValidity('');\n }else{\n confirm.setCustomValidity(\"Passwords do not match!\");\n }\n}", "function confirm_password_validation(targetObjects){\r\n //console.log(targetObjects);\r\n if( $(targetObjects[0]).val()==$(targetObjects[1]).val() ){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "function repwd()\r\n {\r\n var pwd=\"password\";\r\n var repwd=\"repassword\";\r\n var label=\"labelrepwd\";\r\n var x=document.getElementById(pwd).value;\r\n var y=document.getElementById(repwd).value;\r\n if(x!=y){\r\n procces(\"\",\"not matched\",\"red\",label);\r\n return true;\r\n }\r\n procces(\"\",\"matched\",\"green\",label);\r\n return true;\r\n }", "function verify()\r\n {\r\n var p=document.getElementById(\"password\").value;\r\n var vp=document.getElementById(\"vpassword\").value;\r\n if(p!=vp)\r\n {\r\n alert(\"Make sure passwords match\")\r\n return false;\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n }", "function updatefrom(event) {\n let updatePassword = document.getElementById(\"updatePassword\").value;\n let updateConfirmPassword = document.getElementById(\"updateConfirmPassword\").value;\n\n if(updatePassword != updateConfirmPassword) {\n event.preventDefault();\n alert(\"confirm Password and password must be same\");\n return false;\n}\n}", "function uConfPassword() {\n\t\tvar u_conf_pass = $('#user_conf').val();\n\t\tvar u_pass = $('#user_pass').val();\n\t\tif (!(u_conf_pass == u_pass)) {\n\t\t\t$('#alert_conf_pass').text(\"Password did'nt matched \");\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_conf_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t} else if (u_conf_pass === '') {\n\t\t\t$('#alert_conf_pass').text('This field cannot be empty ');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_conf_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function validateseniorForm(){\n\tif (document.getElementById(\"psw\").value!=document.getElementById(\"psw2\").value){\n\t\t\tbootbox.alert(\"Password and new password is different, They must be same.\");\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "function checkpassword()\r\n{\r\n\tif(document.newpassword.newpass.value==\"\")\r\n\t{\r\n\t\talert(lng_plsenternewpass);\r\n\t\tdocument.newpassword.newpass.focus();\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif(document.newpassword.newpass.value.length<6)\r\n\t{\r\n\t\talert(lng_passtooshort);\r\n\t\tdocument.newpassword.newpass.focus();\r\n\t\tdocument.newpassword.newpass.select();\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif(document.newpassword.cnfnewpass.value==\"\")\r\n\t{\r\n\t\talert(lng_plsenterconfpass);\r\n\t\tdocument.newpassword.cnfnewpass.focus();\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif(document.newpassword.newpass.value!=document.newpassword.cnfnewpass.value)\r\n\t{\r\n\t\talert(lng_passmismatch);\r\n\t\tdocument.newpassword.cnfnewpass.focus();\r\n\t\tdocument.newpassword.cnfnewpass.select();\r\n\t\treturn false;\r\n\t}\r\n}", "function validateInfo(email, password, confirmPassword) {\n if (password == confirmPassword) {\n return true;\n }\n else {\n return false;\n }\n}", "function CheckNewPass() {\n var psw=$('#NewPass').val();\n var repsw=$('#ReNewPass').val();\n\n if(repsw==psw) {\n return true;\n }\n else {\n console.log('salam');\n $('#errorpsw').show();\n return false;\n }\n}", "function onCheckPW() {\r\n if ($(this).val() === $('#id_password2').val()) {\r\n this.setCustomValidity('');\r\n } else {\r\n this.setCustomValidity('Passwords must match.');\r\n }\r\n }", "function isValidPassword(password, confirmPassword) {\r\n return password.length >= 6 && password === confirmPassword;\r\n}", "function checkPasswords() {\n var pw = elements.password.value;\n var pw2 = elements.password2.value;\n if (pw == pw2 && pw != '') {\n\t$(elements.passwordCheckIcon).addClass('ok');\n\t$(elements.substep23).stop(true, true).animate({opacity: 1}, 500);\n\t$(elements.substep24).stop(true, true).animate({opacity: 1}, 500);\n\telements.retreiveSecretKeyButton.disabled = false;\n\telements.role.disabled = false;\n\telements.identity_function.disabled = false;\n } else {\n\t$(elements.passwordCheckIcon).removeClass('ok');\n\t$(elements.substep23).stop(true, true).animate({opacity: 0.2}, 500);\n\t$(elements.substep24).stop(true, true).animate({opacity: 0.2}, 500);\n\telements.retreiveSecretKeyButton.disabled = true;\n\telements.role.disabled = true;\n\telements.identity_function.disabled = true;\n }\n}", "function passwordCheckOld() {\n if (\n document.querySelector(\".modifyPassword_form-password input\").value ==\n userObject.password\n ) {\n passwordCheckMatch();\n } else {\n document.querySelector(\".modifyPassword_paragraph-alert\").style.display =\n \"block\";\n document.querySelector(\".modifyPassword_paragraph-alert\").textContent =\n \"Wrong old password\";\n }\n}", "passwordsMatch(password, confirm_password) {\n if(password !== confirm_password) {\n this.msg = '<div class=\"alert alert-danger\">Passwords do not match!</div>';\n this.checkError(this.msg);\n }\n }", "function pw(passwort, passwortConfirm) {\n // -1 is defaul\n if (!passwort.value || !passwortConfirm.value) {\n return -1;\n } else {\n if (passwort.value == passwortConfirm.value) {\n removeErrorAndOK(passwort);\n removeErrorAndOK(passwortConfirm);\n showErrorOrOK(passwort, \" \", true);\n showErrorOrOK(passwortConfirm, \" \", true);\n return true;\n } else {\n showErrorOrOK(passwort, \" passwort not Confirm\", false);\n showErrorOrOK(passwortConfirm, \" passwort not Confirm\", false);\n return false;\n }\n }\n }", "function check_password() {\n if ($('#password').val() == $('#repassword').val()) {\n var message = document.getElementById('checkPassword');\n message.style.color = \"#66cc66\";\n message.innerHTML = \"Passwords match\";\n return true;\n } else {\n var message = document.getElementById('checkPassword');\n message.style.color = \"#ff6666\";;\n message.innerHTML = \"Passwords do not match\";\n return false;\n\n }\n}", "function passwordsMatch(input1, input2) {\n if (input1.value !== input2.value) {\n showError(input2, \"Paswords do not match\");\n }\n}", "function comparePasswords() {\n var validPassword = false;\n if ($scope.newUser.password === $scope.newUser.password) {\n validPassword = true;\n } else {\n validPassword = false;\n }\n return validPassword;\n }", "function validate() {\n const password = document.getElementById(\"password-register\").value;\n const confirmPassword = document.getElementById(\"confirm-password-register\").value;\n if(password != confirmPassword){\n document.getElementById(\"passwordChangeMsg\").innerHTML = \"Password must be same !\";\n return false;\n }else{\n document.forms[\"form-password-recovery\"].submit();\n }\n}", "function validatePassword() {\n let oldPass = new Password(dom('#oldPassword').value)\n let newPass = new Password(dom('#newPassword').value)\n let newPassConfirm = new Password(dom('#newPassword2').value)\n let errorPrompt = dom('#passwordError')\n\n if (!newPass.match(newPassConfirm)) {\n errorPrompt.innerText = \"Passwords do not match\"\n return false\n }\n if (newPass.lessEq(7) || newPassConfirm.lessEq(7)) {\n errorPrompt.innerText = \"New password must be at least 8 characters\"\n return false\n }\n if (!oldPass.matchStr(\"test\")) {\n errorPrompt.innerText = \"Incorrect password\"\n return false\n }\n errorPrompt.innerText = \"\"\n return true\n}", "function checkPasswordMatch(input1, input2) {\n\tif (input1.value !== input2.value) {\n\t\tshowError(input2, 'Passwords do not match');\n\t}\n}", "function checkRepeatedPassword() {\n\t\tvar rptpsw=document.sform.rptpsw.value;\n\t\tvar intpsw=document.sform.psw.value;\n\t\tif (rptpsw!=intpsw){\n\t\t\talert(\"Passwords must match!\");\n\t\t\tdocument.sform.rptpsw.value=\"\";\n\t\t\tdocument.sform.rptpsw.focus();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function checkPass1() {\n\n var flag = 0;\n var neutralColor = '#fff'; // 'white';\n var badColor = '#f66'; // 'red';\n var goodColor = '#6f6'; // 'green';\n\n var password1 = getElm('new_password1').value;\n var password2 = getElm('confirm_password1').value;\n\n //if password length is less than 6\n if (password1.length < 6) {\n feedback1('Mật khẩu tối thiểu 6 kí tự');\n //we do not care about pass2 when pass1 is too short\n setBGColor('confirm_password', neutralColor);\n //if pass1 is blank, set neutral background\n if (password1.length === 0) {\n setBGColor('new_password1', neutralColor);\n } else {\n setBGColor('new_password1', badColor);\n }\n flag = 1;\n //else if passwords do not match\n } else if (password1.indexOf(' ') >= 0) {\n feedback1('Mật khẩu không được có kí tự trắng');\n setBGColor('new_password1', badColor);\n flag = 1;\n } else if (password2 !== password1) {\n //we now know that pass1 is long enough\n feedback1('Mật khẩu không trùng khớp');\n setBGColor('new_password1', goodColor);\n //if pass2 is blank, set neutral background\n if (password2.length === 0) {\n setBGColor('confirm_password1', neutralColor);\n } else {\n setBGColor('confirm_password1', badColor);\n }\n flag = 1;\n\n } else {\n feedback1('Mật khẩu trùng khớp');\n setBGColor('new_password1', goodColor);\n setBGColor('confirm_password1', goodColor);\n flag = 0;\n }\n return flag;\n}", "function checkPasswordsMatch(input1, input2) {\n if (input1.value !== input2.value) {\n showError(input2, 'Passwords do not match');\n }\n}", "function verifPassImg() { //appel dans view_utilisateur \n //on teste que le pass et sa confirmation ne soient pas nul\n //et soient identique\n if ($('#pass').val() != ''\n && $('#confirmPass').val() != ''\n && $('#pass').val() == $('#confirmPass').val())\n {\n $('#passValid').show();\n }\n else\n $('#passValid').hide();\n}", "function checkPasswordMatch(input1 , input2){\n if(input1.value !== input2.value){\n showError(input2,'Password do not match');\n }\n}", "function passPatternValid() {\n var errors = document.querySelector(\"#errors\");\n var pass = document.querySelector(\"#pass\").value;\n var password = document.querySelector(\"#secondPass\").value;\n if(pass !== password) {\n errorMessage(\"<p>Please enter a valid Password with 8 to 16 characters one upper case letter and one number!</p>\");\n return false;\n }\n return true;\n }", "function check_cpswd() {\n\n if ($('#pswd').val() == $('#cpswd').val()) {\n $('#cpswd_error').hide();\n $('#cpswd_corr').html('Matching');\n $('#cpswd_corr').show();\n er_cupass = true;\n }\n else {\n $('#cpswd_error').html('Passwords not matching');\n $('#cpswd_error').show();\n $('#cpswd_corr').hide();\n\n }\n }", "function EntryCheck( pwd, vfy_pwd )\n\t{\n\t if ( pwd != vfy_pwd )\n\t {\n\t alert ( \"ERROR - Your Input Values for ' Password ' and ' Verify Password ' do not match...\" );\n\t return false;\n\t }\n\t else\n\t return true;\n\t}", "function checkPasswordsMatch(input1,input2){\n if(input1.value != input2.value)\n {\n showError(input2,\"Password don't match\");\n }\n\n}", "function validatePasswordInput() {\n let typedPassword = document.querySelector(\n \".confirmModifications_form-password input\"\n ).value;\n if (userObject.password == typedPassword) {\n // If there is a match the user is updated in the website\n\n populateUserInfo(userObject);\n\n // The user is updated in the database\n\n put(userObject);\n document.querySelector(\".modal-confirm\").style.display = \"block\";\n closeConfirmModifications();\n } else {\n document.querySelector(\n \".confirmModifications_paragraph-alertWrongPass\"\n ).style.display = \"block\";\n }\n}", "compareNewPasswords() {\n if (this.state.newPassword !== this.state.confirmPassword) {\n return false;\n }\n return true;\n }", "function validatePasswordMatch(password, confirmPassword, errors) {\n if (password !== confirmPassword) {\n errors.confirmPassword = \"Passwords must match.\";\n }\n}", "function AdminConfirmPassword() {\r\n var password = $(\"#admin_password\").val()\r\n var confirm_pas = $(\"#confirm_password_reset\").val()\r\n if (confirm_pas.length == null || confirm_pas.length == \"\") {\r\n $(\"#conf_password_reset_label\").show();\r\n\r\n $(\"#confirm_password_reset\").addClass(\"has-error\");\r\n $(\"#conf_password_reset_label\").text(\"This Field is required\");\r\n return false;\r\n } \r\n else {\r\n if(confirm_pas != password) {\r\n $(\"#confirm_password_reset\").addClass(\"has-error\");\r\n $(\"#conf_password_reset_label\").show();\r\n $(\"#conf_password_reset_label\").text(\"Password is not match\");\r\n return false;\r\n } \r\n else {\r\n $(\"#confirm_password_reset\").removeClass(\"has-error\");\r\n $(\"#conf_password_reset_label\").hide();\r\n $(\"#conf_password_reset_label\").text(\"\");\r\n return true;\r\n }\r\n }\r\n\r\n}", "function match_password(Element)\n\t\t{\n\t\t\n\t\t\tif($(Element).is(\"input:password\"))\n\t\t\t{\n\t\t\t\tif($(Element).attr(\"match\")!=null)\n\t\t\t\t{\n\t\t\t\t\tvar Match=\"#\"+$(Element).attr(\"match\");\n\t\t\t\t\tif($(Match).val()!=$(Element).val())\n\t\t\t\t\t{\n\t\t\t\t\t\tvar Message=\"Please enter the same password as above\";\n\t\t\t\t\t\tdisplay_msg(Element,Message,\"match\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplay_msg(Element,'',\"match\");\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}", "function check_Modify_password_form() {\n var emailcode = document.getElementById(\"emailcodeText\").value;\n var password = document.getElementById(\"passwordText\").value;\n var confirm_password = document.getElementById(\"Confirm_passwordText\").value;\n\n if(emailcode.length ==0){\n alert(\"Please enter the code\");\n return false;\n }\n if (password.length <6) {\n alert(\"Please enter the 6 digital password\");\n return false;\n }\n if (password != confirm_password) {\n alert(\"The passwords are not match, Please enter again\");\n return false;\n }\n\n return true;\n\n}", "function checkPasswordMatch(input1, input2) {\n if (input1.value !== input2.value) {\n showError(input2, \"Password does not matches\")\n }\n\n}", "function checkPasswordMatch() {\n\tvar password1 = document.getElementById(\"passw\").value;\n\tvar password2 = document.getElementById(\"enterPassword\").value;\n\n\tif (password2 == \"\"){\n\n\t} else {\n\t\tif (password1 == password2) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\talert(\"Password does not match!\");\n\t\t\treturn false;\n\t\t}\n\t}\n}", "function validatePassword(){var r=document.getElementById(\"passwordfield\").value,e=document.getElementById(\"confirmPasswordfield\").value;e!=r?document.getElementById(\"confirmPasswordfield\").setCustomValidity(\"Passwords Don't Match\"):document.getElementById(\"confirmPasswordfield\").setCustomValidity(\"\")}", "checkPassword(password) {\n return password === this.password;\n }", "function changePw () {\n var userid = $('#pwUserid').val();\n var currpw = $('#pwPassword').val();\n var newpw = $('#pwNew').val();\n var pw2 = $('#pwNew2').val();\n\n if ( newpw != pw2 ) {\n alert(\"The proposed password is not equal to the retyped password, returning.\");\n return;\n }\n\n alert('Calling changeMyPW.php');\n}", "function verifyPassword(pwId, verifiedPwId, errorMsg) {\n var pwElement = document.getElementById(pwId);\n var verifiedPwElement = document.getElementById(verifiedPwId);\n var errorElement = document.getElementById(verifiedPwId + \"Error\");\n var isTheSame = (pwElement.value === verifiedPwElement.value);\n showMessage(isTheSame, verifiedPwElement, errorMsg, errorElement);\n return isTheSame;\n}", "function passwordMatch(password) {\n return password === admin.password;\n}", "function ChequearClave() {\n password= $(\"#password\").val()\n repassword=$(\"#repassword\").val()\n if ( password != repassword){\n $('#mjsRegistro').text(\"Las claves no coinciden!\");\n // alert('no clave')\n $(\"#repassword\").focus()\n \n }else if ( password == repassword){\n $('#mjsRegistro').text(\"\");\n } \n}", "function cekpass(){\n\tvar p2 = $('#passBTB2').val();\n\tvar p1 = $('#passBTB1').val();\n\tif(p2==p1){ // notif ketika sama\n\t\t$('#passinfo').html('<span class=\"label label-success\">password sesuai</span>'); \n\t}else{ //notif ketika beda/salah\n\t\t$('#passinfo').html('<span class=\"label label-important\">password harus sama</span>');\n\t}\n}", "function passwordsMatch() {\n if (register_password.value.length !== 0 && register_password_again.value.length !== 0) {\n if (register_password.value === register_password_again.value) {\n document.querySelector('.btn-register').disabled = false;\n document.querySelector('#passwords_match').classList.add('passwords-match')\n document.querySelector('#passwords_match').classList.remove('passwords-dont-match')\n document.querySelector('#passwords_match').innerHTML = 'Password match!'\n } else {\n document.querySelector('.btn-register').disabled = true;\n document.querySelector('#passwords_match').classList.add('passwords-dont-match')\n document.querySelector('#passwords_match').classList.remove('passwords-match')\n document.querySelector('#passwords_match').innerHTML = 'Passwords do not match.'\n };\n } else {\n document.querySelector('#passwords_match').innerHTML = ''\n };\n }", "function checkPass(elem) {\n // collect needed elements\n var pass1 = document.getElementById('pass');\n var pass2 = document.getElementById('pass_confirmed');\n var errmsg = document.getElementById('errP');\n\n // return flag\n var okPass = true;\n\n // check the user defined Passwords\n if (pass1.value != pass2.value && pass2.value.length != 0) {\n if (elem && elem === pass2)\n errmsg.innerHTML = \"Passwords Do Not Match\";\n okPass = false;\n } else if (pass1.value.length < 8 && pass1.value.length != 0) {\n if (elem && elem === pass1)\n errmsg.innerHTML = \"Passwords must be at least 8 characters\";\n okPass = false;\n } else {\n errmsg.innerHTML = \"\";\n }\n\n return okPass;\n}", "function checkMatch() {\n var pw1 = $(\"#inputPassword2\").val();\n var pw2 = $(\"#inputPassword3\").val();\n //Update HTML to show user information.\n if (pw1 === pw2) {\n $(\"#match\").html(\"Passwords: Match\");\n } else {\n $(\"#match\").html(\"Passwords: Don't Match\");\n }\n }", "function validate() {\n var password = $(\"#password\").val();\n var confirm = $(\"#confirm_password\").val();\n \n if(password == confirm) {\n $(\"#validate-status\").text(\"passwords match\").css(\"color\", \"#33cc59\"); // green if passwords match \n }\n else {\n $(\"#validate-status\").text(\"passwords do not match\").css(\"color\", \"red\"); // red if passwords don't match \n } \n}", "function matchingPasswords(){\n if(createRetypePassword == createPassword){\n return true;\n }else{\n return false;\n }\n}", "function validatePassword(){\n var password = document.getElementById(\"password\");\n var confirm_password = document.getElementById(\"confirm_password\");\n if(password.value != confirm_password.value) {\n confirm_password.setCustomValidity(\"Passwords Don't Match\");\n } else {\n confirm_password.setCustomValidity('');\n }\n}", "function check_password(){\n //password same check\n var pwd = $('#user_pwd').val();\n var repwd = $('#user_repwd').val();\n\n if(pwd == \"\" && repwd == \"\")\n return false;\n\n if (pwd != repwd) {\n $('#errmsg').show();\n setTimeout(function() { $(\"#errmsg\").hide(); }, 5000);\n return true;\n } else\n return false;\n}", "function validate_password()\n {\n const icon = DOM.new_password_validation_icon;\n const password = DOM.new_password_input.value;\n\n icon.style.visibility = \"visible\";\n\n if (security.is_valid_password(password))\n {\n icon.src = \"/icons/main/correct_white.svg\";\n return true;\n }\n else\n {\n icon.src = \"/icons/main/incorrect_white.svg\";\n return false;\n }\n }", "function passwordEqual(password, verify_password) {\n return password === verify_password;\n}", "function validPassA(pw1,currpw) {\n if(pw1 === currpw) {\n return \"Password matches old password.\";\n }\n return \"\";\n}", "function checkPassword() {\n\tvar item1 = document.getElementById(\"pwd1\").value;\n\tvar item2 = document.getElementById(\"pwd2\").value;\n var isSame = true;\n var isBig = true;\n\tvar numCount = 0;\n\tvar charCount = 0;\n\tif (item1.length != item2.length) {\n isSame = false;\n }\n if (item1.length < 7) {\n isBig = false;\n }\n \n\tfor (var i = 0; i < item1.length; i++) {\n\t\tif (item1.charAt(i) != item2.charAt(i)) {\n\t\t\tisSame = false;\n }\n \n\t\tif (isNaN(item1.charAt(i))) { \n\t\t\tcharCount++; \n\t\t} else { \n\t\t\tnumCount++; \n\t\t}\n }\n\n if (numCount == 0 || charCount == 0 || !isBig) {\n isBig = false;\n } else {\n isBig = true;\n }\n \n\tif (!isSame) {\n document.getElementById('error').innerHTML = \"*Passwords not identical.<br/>\";\n\t}\t\n\telse {\n\t\tdocument.getElementById('error').innerHTML = \"\";\n }\n \n\tif (!isBig) {\n document.getElementById('error2').innerHTML = \"*Password needs to start with a letter and be 7-20 characters long with at least one number.<br/>\";\n\t}\n\telse {\n\t\tdocument.getElementById('error2').innerHTML = \"\";\n }\n // running into a problem where the innerHTML is not updating before the check and alerts.\n if (isBig && isSame) {\n return true;\n } else {\n return false;\n }\n}", "function verifyPassword(pwId, verifiedPwId, errorMsg) {\n var pwElement = document.getElementById(pwId);\n var verifiedPwElement = document.getElementById(verifiedPwId);\n var errorElement = document.getElementById(verifiedPwId + \"Error\");\n var isTheSame = (pwElement.value === verifiedPwElement.value);\n showMessage(isTheSame, verifiedPwElement, errorMsg, errorElement);\n return isTheSame;\n}", "async function confirm()\n {\n // Double check everything is as expected.\n if (!validate_password() ||\n !validate_repeated_password())\n {\n return;\n }\n try\n {\n const new_password = DOM.new_password_input.value;\n const new_hashed_password = await security.hash(new_password);\n\n let setting_up;\n if (old_hashed_password)\n {\n setting_up = bookmarks.change_authentication(\n old_hashed_password,\n new_hashed_password\n );\n }\n else { setting_up = bookmarks.setup(new_hashed_password); }\n\n transition_to(\"on_hold\");\n await new Promise(resolve => { setTimeout(resolve, 1000); });\n await setting_up;\n\n on_success(old_hashed_password, new_hashed_password);\n }\n catch (error)\n {\n transition_to(\"error\",\n {\n title: `Error during password ${old_hashed_password ? \"change\" : \"setup\"}`,\n message: error.message\n });\n }\n finally { clear_sensitive_data(); }\n }", "function checkPassword(form) {\n password1 = form.password1.value;\n password2 = form.password2.value;\n\n // If password not entered\n if (password1 != password2) {\n document.getElementById(\"pwderror\").innerHTML = '<span style=\"color:red;\">Password did not match: Please try again...</span>';\n return false;\n }\n\n // If same return True.\n else {\n document.getElementById(\"pwderror\").innerHTML = \"\";\n return true;\n }\n}", "function validateConfirmPasswordIn() {\n var password = $(\"input#inputPassword\").val();\n var passwordcf = $(\"input#inputPasswordConfirm\").val();\n document.getElementById('inputPasswordConfirm').setCustomValidity('');\n if (passwordcf == password) {\n document.getElementById('form-group-password-confirm').className =\n \"form-group has-success has-feedback\";\n document.getElementById('form-span-password-confirm').className =\n \"glyphicon glyphicon-ok form-control-feedback\";\n } else {\n document.getElementById('form-group-password-confirm').className =\n \"form-group has-error has-feedback\";\n document.getElementById('form-span-password-confirm').className =\n \"glyphicon glyphicon-remove form-control-feedback\";\n document.getElementById('inputPasswordConfirm').setCustomValidity(\"The password you typed in are not same!\");\n }\n}", "function validate_repeated_password()\n {\n const icon = DOM.repeated_new_password_validation_icon;\n const password = DOM.new_password_input.value;\n const repeated_password = DOM.repeated_new_password_input.value;\n\n icon.style.visibility = \"visible\";\n\n if (validate_password() &&\n repeated_password === password)\n {\n icon.src = \"/icons/main/correct_white.svg\";\n return true;\n }\n else\n {\n icon.src = \"/icons/main/incorrect_white.svg\";\n return false;\n }\n }", "function verificarSenhas() {\n if (documento.form.password.value ===\n document.forms.passwordConfirm.value) {\n alert(\"As duas senhas conferem\");\n } else {\n alert(\"As duas senhas não conferem\")\n }\n}", "function checkPasswordMatch(password, password2) {\r\n\r\n if (password.value !== password2.value) {\r\n showError(password2, `Passwords do not match`)\r\n };\r\n}" ]
[ "0.825452", "0.82242584", "0.81092644", "0.8101749", "0.80924803", "0.8092059", "0.80533576", "0.79814583", "0.79556125", "0.78751856", "0.7852896", "0.7852385", "0.7844596", "0.7840821", "0.7810496", "0.7810102", "0.7773194", "0.7763123", "0.77459764", "0.7736487", "0.77200174", "0.7696013", "0.7688857", "0.76823497", "0.7678735", "0.76274115", "0.7613267", "0.7608929", "0.7600076", "0.75725365", "0.7571233", "0.75331634", "0.7531697", "0.7508571", "0.7503306", "0.7499776", "0.74938273", "0.7476843", "0.7467776", "0.74552864", "0.744643", "0.74309886", "0.74030006", "0.7399457", "0.73984593", "0.7397836", "0.7395306", "0.73877597", "0.73704964", "0.7356715", "0.73555845", "0.7354331", "0.733527", "0.73058724", "0.7297522", "0.7296195", "0.7290093", "0.72870857", "0.7278148", "0.7265628", "0.72566646", "0.7247339", "0.7238562", "0.72302973", "0.72265005", "0.72243416", "0.72140557", "0.7213959", "0.7209754", "0.7205894", "0.7197846", "0.7197591", "0.71970266", "0.7191244", "0.7186476", "0.7181257", "0.7169543", "0.71660215", "0.7164675", "0.71616536", "0.7155332", "0.7149178", "0.7148572", "0.7147153", "0.7146007", "0.71443826", "0.71293694", "0.71290344", "0.71256", "0.71178645", "0.7109274", "0.7105236", "0.71035033", "0.71018887", "0.7096056", "0.70940065", "0.70928717", "0.7074825", "0.70649797", "0.70634407", "0.70614064" ]
0.0
-1
when the document is ready, then run main.js code
function initialize(){ // $ means jQuery // $('css or jquery selector') $('h1').css('color', 'red'); $('h1').css('font-size', '35px'); var currentH1Text = $('h1').text(); console.log(currentH1Text); $('h1').text('Welcome to JavaScript'); $('div').css('color', 'purple'); $('#d2').css('font-size', '24px'); $('#d3').css('background', 'yellow'); $('.c1').css('font-family', 'monospace'); $('.c1').text('Adam Thede'); $('.c1').css({'color': 'green', 'background-color': 'red'}).text('Germania'); var bgcolor = prompt('What background color do you want?'); $('#d3').css('background-color', bgcolor); var textd3 = prompt('What do you want the text in div 3 to be?'); $('#d3').text(textd3); var numPs = $('.cp').length; console.log(numPs); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callMain() {\n console.log(documentReady);\n if(documentReady>=1) {\n\n window.main && window.main();\n } else {\n documentReady+=1;\n }\n\n }", "function init() {\n //called when document is fully loaded; your \"main method\"\n}", "function mainComplete() {\n\t\tconsole.log('it is all loaded up');\n\t\t//Demo.main.initialize();\n\t}", "function onready() {\n\tif (document.readyState == 'complete' ||\n\t\tdocument.readystate == 'interactive') {\n\t\tmain();\n\t} else {\n\t\tdocument.addEventListener(\"DOMContentLoaded\", function(event) {\n\t\t\tmain();\n\t\t});\n\t}\n}", "function ready() {\n run();\n}", "function main() {\n //your widget code goes here\n jQueryBeacon(document).ready(function () {\n console.log('Realgraph Beacon Loaded');\n var currentURL = window.location.href; // Returns full URL\n pingListener(currentURL);\n getAndRenderEntitiesData(currentURL);\n\n //example load css\n //loadCss(\"http://example.com/widget.css\");\n\n //example script load\n //loadScript(\"http://example.com/anotherscript.js\", function() { /* loaded */ });\n });\n }", "function init()\n {\n $(document).on(\"loaded:everything\", runAll);\n }", "function main() {\n initQuestions();\n\n window.addEventListener('load', setup);\n}", "function init() {\n documentReady(documentLoaded);\n}", "function main() {\n $(function() {\n // When document has loaded we attach FastClick to\n // eliminate the 300 ms delay on click events.\n FastClick.attach(document.body)\n\n // Event listener for Back button.\n $('.app-back').on('click', function() {\n history.back()\n })\n })\n\n // Event handler called when Cordova plugins have loaded.\n document.addEventListener(\n 'deviceready',\n onDeviceReady,\n false)\n window.onbeforeunload = function(e) {\n rfduinoble.close();\n };\n google.charts.load('current', {\n 'packages': ['corechart', 'controls', 'charteditor']\n });\n //google.setOnLoadCallback(drawChart);\n // google.setOnLoadCallback(function() {\n // genSampleData(generateSamples)\n // });\n }", "function startup() {\n\tdocument.addEventListener('DOMContentLoaded', function() {\n loadmap();\n loadquestions();\n\t\t}, false);\n }", "function initOnDomReady() {}", "function main() {\n initBurgerMenu();\n setScrollAnimationTargets(); // init homepage nav\n\n if ($('#home').length === 1) {\n initHomepageNav();\n } else {\n console.log('not home');\n } // init lightboxes\n\n\n initVideoLightbox();\n initTCsLightbox();\n}", "function main() {\n _readyInterval = window.setInterval(widgetReady, 500);\n }", "function scriptLoadHandler() {\n // Restore jQuery and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n PlannTo.jQuery = jQuery;\n\n // Call our main function\n\n main();\n }", "function main() {\r\n\t// Init the myGM functions.\r\n\tmyGM.init();\r\n\r\n\t// If the script was already executed, do nothing.\r\n\tif(myGM.$('#' + myGM.prefix + 'alreadyExecutedScript'))\treturn;\r\n\r\n\t// Add the hint, that the script was already executed.\r\n\tvar alreadyExecuted\t\t= myGM.addElement('input', myGM.$('#container'), 'alreadyExecutedScript');\r\n\talreadyExecuted.type\t= 'hidden';\r\n\r\n\t// Init the language.\r\n\tLanguage.init();\r\n\r\n\t// Init the script.\r\n\tGeneral.init();\r\n\r\n\t// Call the function to check for updates.\r\n\tUpdater.init();\r\n\r\n\t// Call the function to enhance the view.\r\n\tEnhancedView.init();\r\n}", "function init() {\n // THIS IS THE CODE THAT WILL BE EXECUTED ONCE THE WEBPAGE LOADS\n }", "function pageReady() {\n svg4everybody();\n initScrollMonitor();\n initModals();\n }", "function mainComplete() {\n console.log('it is all loaded up');\n MyGame.game.initialize();\n\n }", "function initialize_app() {\n // We are downloading solutions.min.js in parallel, so we show the\n // activity icon here, to inform the user that a \"background download\"\n // is happening (the users at least sees that 'somethnig is going on')\n // TODO is this really necessary? Downloading a 400k file should take\n // far less time than the time it takes the user to start the first\n // calcuation process. Besides, I should already do check for the\n // existence of solutions_db (i.e. \"solutions_db !== null\") before I\n // try to use it anyway...\n show_activity_icon();\n mainEl = document.querySelector('main');\n custom_stamps = new UserStamps();\n small_screen = document.documentElement.clientWidth < 450;\n\n if (small_screen) {\n document.getElementById('forward_btn').textContent = 'Neste';\n document.querySelector('.dropdown-activator').addEventListener('click',\n show_menu);\n }\n document.getElementById('back_btn').addEventListener('click', go_back);\n document.getElementById('forward_btn').addEventListener('click', go_forward);\n document.querySelector('nav > h1').addEventListener('click', reset_site);\n}", "function initScripts() {\n breakpoint();\n lazyload();\n heroSlider();\n categoriesMobile();\n asideLeftMobile();\n scrollRevealInit();\n seoSpoiler();\n mobileMenuOverflowScroll();\n}", "function init() {\n console.debug(\"Document Load and Ready\");\n\n listener();\n initGallery();\n cargarAlumnos();\n\n // mejor al mostrar la modal\n // cargarCursos();\n}", "function mkdOnDocumentReady() {\n\t mkdIconWithHover().init();\n\t mkdIEversion();\n\t mkdInitAnchor().init();\n\t mkdInitBackToTop();\n\t mkdBackButtonShowHide();\n\t mkdInitSelfHostedVideoPlayer();\n\t mkdSelfHostedVideoSize();\n\t mkdFluidVideo();\n\t mkdOwlSlider();\n\t mkdPreloadBackgrounds();\n\t mkdPrettyPhoto();\n mkdInitCustomMenuDropdown();\n }", "function callScripts() {\n\t\"use strict\";\n\tjsReady = true;\n\tsetTotalSlides();\n\tsetPreviousSlideNumber();\n\tsetCurrentSceneNumber();\n\tsetCurrentSceneSlideNumber();\n\tsetCurrentSlideNumber();\n}", "function main() {\n window.addEventListener('load', onBodyLoad)\n\n NodeList.prototype.forEach = HTMLCollection.prototype.forEach = Array.prototype.forEach\n\n useCompanion = (location.href.indexOf('?companion') != -1) ||\n (location.href.indexOf('&companion') != -1)\n useLocalServer = (location.href.indexOf('?local') != -1) ||\n (location.href.indexOf('&local') != -1)\n\n slideEls = document.querySelectorAll('.presentation > div')\n}", "function main() {\n if (debug) console.log(`Main ran in ${window.name}`)\n // Whenever this is ran, an unload event (i.e. when the user loads a whatIf report)\n // triggers the collection of data needed to do a query for course information.\n // This isn't a listener because getting listeners to work inside iframes is hard.\n function setupWhatIfDataListener() {\n $(getWindow('frSelection')).on(\"unload\", fetchWhatIfData)\n }\n\n // It's ran 10 times per second because again, listeners on iframes are hard.\n // This means the app would break if the user managed to get through the\n // DegreeWorks WhatIf form in a 10th of a second.\n setInterval(setupWhatIfDataListener, 100);\n console.log(window.name)\n if (window.name === \"frBody\") {\n addModal();\n }\n if (window.name === \"frLeft\") {\n let button = addButton(`DegweeWorks Planner`, getDegreeInfo, null, \"genPossible\")\n // addNumberField('Min courses/semester', 'minCourses', 4)\n // addNumberField('Max courses/semester', 'maxCourses', 4);\n }\n }", "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n // Call our main function\n main();\n }", "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n // Call our main function\n main();\n }", "function init(){\n console.log(\"Page loaded and DOM is ready\");\n}", "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n // Call our main function\n main();\n }", "function init(){\n console.debug('Document Load and Ready');\n console.trace('init');\n initGallery();\n \n pintarLista( );\n pintarNoticias();\n limpiarSelectores();\n resetBotones();\n \n}", "function onDOMReady() {\n // Make sure that the DOM is not already loaded\n if (isReady) return;\n // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\n if (!document.body) return setTimeout(onDOMReady, 0);\n // Remember that the DOM is ready\n isReady = true;\n // Make sure this is always async and then finishin init\n setTimeout(function() {\n app._finishInit();\n }, 0);\n }", "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n // Call our main function\n main();\n }", "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n // Call our main function\n main();\n }", "function pageReady(){\n handleUTM();\n legacySupport();\n initModals();\n initScrollMonitor();\n initVideos();\n _window.on('resize', debounce(initVideos, 200))\n initSmartBanner();\n initTeleport();\n initMasks();\n }", "function scriptLoadHandler() {\n\t\t// Restore jQuery and window.jQuery to their previous values and store the\n\t\t// new jQuery in our local jQuery variable\n\t\tjQuery = window.jQuery.noConflict(true);\n\t\t$ = window.jQuery;\n\t\t// Call our main function\n\t\tmain(); \n\t}", "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n $ = jQuery;\n // Call our main function\n main();\n }", "function ready() {\n\n\tif(!Modernizr.csstransforms3d) $('body').prepend('<div class=\"alert\"><div class=\"box\"><h2>Fatti un regalo.</h2><p>Questo sito usa tecnologie moderne non compatibili con il tuo vecchissimo browser.</p><p>Fatti un regalo, impiega due minuti a installare gratuitamente un browser recente, tipo <a href=\"http://www.google.it/intl/it/chrome/browser/\">Google Chrome</a>. Scoprirai che il web è molto più bello!</p></div></div>');\n\tloader.init();\n\t$('nav').addClass('hidden');\n\t//particles.init();\n\twork.init();\n\tnewhash.change(true);\n\textra();\n\tskillMng.init();\n\tcomponentForm.init();\n\tresponsiveNav();\n\tmaterial_click();\n\tcuul.init();\n\tdisableHover();\n\tscroll_down.init();\n}", "function documentReadyFunction() {\n onPageLoadOrResize();\n onPageLoad();\n }", "function init()\n\t{\n\t\tvar scripts = document.getElementsByTagName('script');\n\t\tfor(var i = 0; i < scripts.length; ++i)\n\t\t{\n\t\t\tif(scripts[i].hasAttribute('main'))\n\t\t\t{\n\t\t\t\tif(scripts[i].hasAttribute('root'))\n\t\t\t\t{\n\t\t\t\t\tPoof.importRoot = scripts[i].getAttribute('root');\n\t\t\t\t}\n\n\t\t\t\tif(scripts[i].hasAttribute('suffix'))\n\t\t\t\t{\n\t\t\t\t\tPoof.importSuffix = scripts[i].getAttribute('suffix');\n\t\t\t\t}\n\n\t\t\t\tif(scripts[i].hasAttribute('concatenated'))\n\t\t\t\t{\n\t\t\t\t\tPoof.concatenated = scripts[i].getAttribute('concatenated');\n\t\t\t\t}\n\n\t\t\t\tif(scripts[i].hasAttribute('debug'))\n\t\t\t\t{\n\t\t\t\t\tPoof.debug = scripts[i].getAttribute('debug') === 'true';\n\t\t\t\t}\n\n\t\t\t\tcompatibilityFixes.applyAll();\n\t\t\t\tImport(scripts[i].getAttribute('main')).execute(onMainClassRady);\n\t\t\t}\n\t\t}\n\t}", "function main() {\n\t window.onload = renderTest;\n\t}", "function main() {\r\n initFlags();\r\n fixMarkup();\r\n changeLayout();\r\n initConfiguration();\r\n}", "function initializeMain(){\n\tinit();\n\tanimate();\n}", "function _Initialise(){\r\n\t\t\r\n\t\tfunction __ready(){\r\n\t\t\t_PrecompileTemplates();\r\n\t\t\t_DefineJqueryPlugins();\r\n\t\t\t_CallReadyList();\r\n\t\t};\r\n\r\n\t\t_jQueryDetected = typeof window.jQuery === \"function\";\r\n\r\n\t\tif(_jQueryDetected){\r\n\t\t\tjQuery(document).ready(__ready);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tdocument.addEventListener(\"DOMContentLoaded\", __ready, false);\r\n\t\t}\r\n\t\t\r\n\t}", "function main() {\n NodeList.prototype.forEach = HTMLCollection.prototype.forEach = Array.prototype.forEach\n\n slideEls = document.querySelectorAll('.presentation > div')\n\n // Specific slide tech\n $('pre, code').each(function(i, block) {\n hljs.highlightBlock(block)\n });\n\n // Set up\n getSlideNumberFromUrlFragment()\n document.querySelector('.presentation').classList.add('visible')\n showSlide(true, true)\n onSlideEnter(slideEls[currentSlideNumber], true)\n\n document.body.addEventListener('keydown', onKeyDown)\n document.body.focus()\n}", "function DOMReady() {\n }", "function init() {\n\tconst params = getUrlParameters() // valuable information is encoded in the URL\n\tconst dataPromise = loadData(params) // start loading the data\n\tconst callback = () => app(params, dataPromise)\n\n\t// set error handlers\n\twindow.addEventListener(\"error\", errorHandler)\n\twindow.addEventListener(\"unhandledrejection\", errorHandler)\n\n\tif (document.readyState !== \"loading\")\n\t\tdocument.addEventListener(\"DOMContentLoaded\", callback)\n\telse\n\t\tcallback()\n}", "function initMain(){\n\tbuildGameButton();\n\tbuildGameStyle();\n\tbuildScoreboard();\n\t\n\tgoPage('main');\n\tloadXML('questions.xml');\n}", "function init () {\r\n\t\tconsole.log('all is loaded.');\r\n\t}", "function onloadHandler(){\n console.info(\"Nick Cage is ready!\");\n // where the magic happens\n replaceAllElements();\n }", "function init() {\n\twindow.addEventListener(\"error\", errorHandler)\n\twindow.addEventListener(\"unhandledrejection\", errorHandler)\n\tif (document.readyState !== \"loading\")\n\t\tdocument.addEventListener(\"DOMContentLoaded\", app)\n\telse\n\t\tapp()\n}", "function main() {\n buildNavbar();\n $(\"body\").append($(\"<div>\").addClass(\"container\").attr(\"id\", \"mainContainer2\"));\n createJumboTron();\n $(\"body\").append($(\"<div>\").addClass(\"container h-100 scrollspy\").attr(\"id\", \"mainContainer\"));\n buildMoviePage();\n\n }", "function run_when_document_ready(fn) {\n if (document.readyState !== \"loading\"){\n fn();\n } else {\n document.addEventListener(\"DOMContentLoaded\", fn);\n }\n}", "function main() {\n // Initialize some event listeners on the word info display choice.\n setup_word_info();\n\n // Initialize the first page of cues.\n previous_page();\n\n // Initialize the top scores leaderboard.\n load_leaderboard();\n\n // Initialize the Sammy.js app.\n app.run();\n}", "function init() {\n console.log(\"Document Ready\");\n\n createPets();\n totalNumPets();\n totalPrice();\n petsByType();\n displayPets();\n displayOfficeInfo();\n}", "function alwaysRunOnload () {\n\t\n\t}", "function init() {\n\n // ALSO REMEMBER TO LOAD MP3s RIGHT AWAY (you could also load MEIs as well)\n // TODO\n \n // Register event - call main() when page loaded\n \n document.addEventListener('DOMContentLoaded', initWhenPageLoaded);\n \n window.AudioLoader = AudioLoader; // TEMP FOR DEBUGGING\n }", "onReady() {}", "function init() {\n this.$ = require(\"jquery/dist/jquery\");\n this.jQuery = this.$;\n\n require(\"svg4everybody/dist/svg4everybody\")();\n require(\"retinajs/dist/retina\");\n\n require(\"bootstrap/dist/js/bootstrap.bundle\");\n\n\n\n $(document).ready(function () {\n require(\"./components/interractionObserver\")();\n });\n}", "function runWhenReady() {\n if (typeof tagpro.map !== 'undefined' && typeof tagpro.teamNames !== undefined && typeof tagpro.score !== undefined) {\n main();\n } else {\n setTimeout(function() {\n runWhenReady();\n }, 100);\n }\n}", "function boot()\n {\n\t// scriptweeder ui's iframe, don't run in there !\n\tif (in_iframe() && window.name == 'scriptweeder_iframe')\t// TODO better way of id ?\n\t return;\n\tif (location.hostname == \"\")\t// bad url, opera's error page. \n\t return;\n\tassert(typeof GM_getValue == 'undefined', // userjs_only\n\t \"needs to run as native opera UserJS, won't work as GreaseMonkey script.\");\n\tif (window.opera.scriptweeder && window.opera.scriptweeder.version_type == 'extension')\t\t// userjs_only\n\t{\n\t my_alert(\"ScriptWeeder extension detected. Currently it has precedence, so UserJS version is not needed.\");\n\t return;\n\t}\n\t\n\tsetup_event_handlers();\n\twindow.opera.scriptweeder = new Object();\t// external api\n\twindow.opera.scriptweeder.version = version_number;\n\twindow.opera.scriptweeder.version_type = version_type;\t\n\tdebug_log(\"start\");\t\n }", "function onReady() {\n console.log('JQ');\n //jquery to handle button clicks\n $('#equalsButton').on('click', computeMath);\n $('#clearButton').on('click', clearNums);\n //NOTE FROM LIVE SOLVE: could have used 'this' to simplify\n $('#addButton').on('click', addNums);\n $('#subtractButton').on('click', subtractNums);\n $('#multiplyButton').on('click', multiplyNums);\n $('#divideButton').on('click', divideNums);\n\n keepHistory();\n}", "function ready() {\n if (!isReady) {\n triggerEvent(document, \"ready\");\n isReady = true;\n }\n }", "function init() {\n if (!ready) {\n ready = true;\n initElements();\n }\n }", "function main() {\n console.log('Ready!\\n');\n _hcsr04.fn.startMonitoring();\n}", "function waitDone() {\n (function (initApplication) {\n initApplication($, Highcharts, window, document);\n })(function ($, Highcharts, window, document) {\n // load libraries\n ApmJqWidgets();\n APMRPM.Services = new APMRPM._Services();\n APMRPM.Components = new APMRPM._Components();\n APMRPM.Highcharts = new APMRPM._Highcharts();\n APMRPM.MainPanel = new APMRPM._MainPanel();\n\n // load jquery\n $(function () {\n APMRPM.MainPanel.adjustCSS();\n APMRPM.MainPanel.render();\n });\n });\n}", "function main() {\n addEventListeners();\n}", "function mainFn () {\n logFn( prefixStr + 'Start' );\n xhiObj.npmObj.load( xhiObj.fqPkgFilename, onLoadFn );\n }", "function init() {\n homeBtns.forEach(btn => btn.addEventListener('click', loadHome))\n gsBtns.forEach(btn => btn.addEventListener('click', loadGs))\n docsBtns.forEach(btn => btn.addEventListener('click', loadDocs))\n\n downloadBtn.addEventListener('click', () => {\n window.location = `https://github.com/KucingKode/quick.js/releases/download/${VERSION}/quick.js`\n })\n githubBtn.addEventListener('click', () => {\n window.location = 'https://github.com/KucingKode/quick.js'\n })\n \n sideToggle.addEventListener('click', () => {\n sideToggle.classList.toggle('active')\n sidebar.classList.toggle('active')\n })\n loadSidebar('home')\n}", "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n\n // Call our main function\n main();\n}", "function Main() {\n window.$ = jQuery.noConflict();\n this.languagesLoaded = false;\n this.frameCallback = null;\n }", "function main() {\n addEventListeners();\n addAdvancedEventListeners();\n}", "function main_entry(){\n\tinit_map();\n\tinit_fsmap();\n\t\n\tregister_ui_events_dom(); // old style\n\t//register_ui_events_jquery(); // new style\n}", "function init() { \n SP.SOD.notifyScriptLoadedAndExecuteWaitingJobs('domTools.js');\n }", "ready() { }", "ready() { }", "ready() { }", "ready() { }", "ready() { }", "ready() { }", "ready() { }", "ready() { }", "function setup() {\n console.log(\"I have linked Javascript!\");\n $(\"#intake\").click(handleRespones);\n $('#signup').click(signUp);\n}", "function qodefOnDocumentReady() {\n qodefThemeRegistration.init();\n\t qodefInitDemosMasonry.init();\n\t qodefInitDemoImportPopup.init();\n }", "function main() {\n init();\n render();\n handleVisibilityChange();\n}", "function main() {\n startSlideShowAnimation();\n renderProject();\n}", "onDOMReady() {\n\n\t\t\t// resize the canvas to fill browser window dynamically\n\t\t\twindow.addEventListener('resize', _onWindowResize, false);\n\t\t\t_onWindowResize();\n\t\t\t\n\t\t\t// Stop generic mouse events from propagating up to the document\n\t\t\tlet windows = document.querySelectorAll('.ui-window');\n\t\t\tfor(let i = 0, len = windows.length; i < len; i++) {\n\t\t\t\tlet element = windows[i];\n\t\t\t\telement.addEventListener('mousedown', event => {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t});\n\t\t\t\telement.addEventListener('wheel', event => {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Initialize the starting windows\n\t\t\t_windows = {\n\t\t\t\t'newsfeed': new NewsfeedWindow('#window-Newsfeed')\n\t\t\t};\n\t\t\t_windows.newsfeed.clearNews(LogicM.getUniverseClock());\n\n\t\t\t// this.addNews(\"Welcome back, Emperor.\", null, LogicM.getUniverseClock(), 'self', false);\n\t\t}", "function example() {\n\n//begin window.onload\nwindow.onload = function () {\n\t// ... entire app goes here ...\n};\n//end\n\n}", "static ready() { }", "function init() {\n setDomEvents();\n }", "function when_ready(callback)\n {\n if (document.readyState !== \"loading\") { callback(); }\n else { document.addEventListener(\"DOMContentLoaded\", callback); }\n }", "function initMain(){\n\tif(!isMobile || !isTablet){\n\t\t$('#canvasHolder').show();\t\n\t}else{\n\t\tcheckMobileOrientation();\t\n\t}\n\t\n\tinitAppCanvas(stageW,stageH);\n\tbuildAppCanvas();\n\tbuildPageButton();\n\tbuildCamera();\n\t\n\tgoPage('main');\n\tresizeCanvas();\n\t\n\tloadXML('stickers.xml');\n}", "function pageReady() {\n legacySupport();\n initSliders();\n }", "function scriptMain() {\n pageSetup();\n\n}", "function run() {\r\n\t// Initialize the loader before anything happens\r\n\tloader.init();\r\n}", "function initializePage() {\n\t/*$(\"#testjs\").click(function(e) {\n\t\t$('.jumbotron h1').text(\"Javascript is connected\");\n\t\t$(\"#testjs\").text(\"Thanks for clicking me!\");\n\t\t$(\".jumbotron p\").toggleClass(\"active\");\n\t});*/\n\n\t// Add any additional listeners here\n\t// example: $(\"#div-id\").click(functionToCall);\n\t$(\"#submitBtn\").click(addEvent);
\n\t$('#scheduleBtn').click(goBackToSchedule);\n}", "function init() {\n\t\t//console.log(\"app.init()\");\n\t\tif(initDone) {\n\t\t\t//console.log(\"init already done.\");\n\t\t\treturn;\n\t\t} else {\n\t\t\tinitDone = true;\n\t\t}\n\n\t\t// Init HTML layout and from there the GUI/UI with interaction.\n\t\tlayout.init();\n\t\tscene.init();\n\t\t//ui.init();\n\t\t// Proceed directly to startup of the loop.\n\t\t//start();\n\t}", "function onReady() {\n\t// TODO\n}", "function run (){\n \t\tconsole.log(\"in screen-splash run in screen-splash.js\");\n \t\tif(firstTime){\n \t\t\tinit();\n \t\t}\n \t\t//do our stuff\n \t}", "function scriptLoadHandler() {\n\t\t // Restore $ and window.jQuery to their previous values and store the\n\t\t // new jQuery in our local jQuery variable\n\t\t jQuery = window.jQuery.noConflict(true);\n\t\t // Call our main function\n\t\t main(); \n\t\t}", "function _main() {\n try {\n // the modules own main routine\n //_logCalls();\n\n // enable a global accessability from window\n window.tools = {} || window.tools;\n window.tools._log = _log;\n window.tools._addNavigation = _addNavigation;\n } catch (error) {\n console.log(error);\n }\n\n }" ]
[ "0.7603928", "0.75638664", "0.7359414", "0.730716", "0.7170651", "0.71284896", "0.70197076", "0.69391704", "0.692763", "0.6903614", "0.6875203", "0.68749505", "0.6855237", "0.6827818", "0.68195826", "0.67367786", "0.6597146", "0.65857714", "0.65451413", "0.653772", "0.6534618", "0.65314823", "0.65188617", "0.6517812", "0.65124494", "0.64906234", "0.64835805", "0.64835805", "0.6470628", "0.6450235", "0.64042234", "0.6400592", "0.6387882", "0.6387882", "0.6386654", "0.63826627", "0.6379701", "0.6374448", "0.6354706", "0.6343033", "0.6343026", "0.63390094", "0.6338031", "0.6329047", "0.63241816", "0.6315097", "0.62922055", "0.62897897", "0.62690693", "0.6265846", "0.6263136", "0.625771", "0.6257601", "0.6252646", "0.6244597", "0.6239451", "0.6237214", "0.62326276", "0.6231082", "0.62270874", "0.62221277", "0.62205434", "0.6215212", "0.62056285", "0.6203836", "0.6202219", "0.6193545", "0.61915994", "0.6187144", "0.6182462", "0.6173338", "0.61676335", "0.6166632", "0.6165353", "0.6162839", "0.6162839", "0.6162839", "0.6162839", "0.6162839", "0.6162839", "0.6162839", "0.6162839", "0.61590093", "0.6156821", "0.615438", "0.61461484", "0.6145935", "0.61243856", "0.6118966", "0.61082643", "0.6102078", "0.60965043", "0.6092836", "0.60906047", "0.60905725", "0.60836047", "0.60793656", "0.6069443", "0.60691816", "0.6068554", "0.60660696" ]
0.0
-1
when user clicks on logout => delete token from local storage
function handleLogoutClick(e) { e.preventDefault(); console.log("The link was clicked."); localStorage.clear(); window.location = "http://localhost:3000/"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function logout() {\n localStorage.removeItem(\"token\");\n}", "onLogout() {\n\t\tlocalStorage.removeItem('userToken');\n\t}", "logout() {\n localStorage.removeItem(\"token\");\n localStorage.removeItem(\"userName\");\n }", "logout() {\n localStorage.removeItem(\"id_token\");\n }", "logout() {\n localStorage.removeItem('id_token');\n }", "static logout() {\n localStorage.removeItem('token');\n }", "function logout() {\n token = null;\n if (!window.localStorage) return;\n window.localStorage.setItem('token', token);\n}", "logOutUser(){\n localStorage.removeItem('token')\n }", "function logout() {\n svc.token = null;\n svc.identity = null;\n delete $window.localStorage['authToken']; \n }", "function logout() {\n localStorage.removeItem('token')\n observer.trigger(observer.events.logoutUser);\n}", "logout() {\n localStorage.removeItem(\"token\");\n localStorage.removeItem(\"user\");\n window.location.reload();\n }", "logout() {\n this.Storage.unstore('isLoggedIn');\n this.Storage.unstore('token');\n }", "function logout() {\n authState.jwt_token = ''\n localStorage.setItem('token', '');\n window.location.reload()\n }", "function deleteToken () {\n localStorage.removeItem('token')\n}", "logout() {\r\n this.authenticated = false;\r\n localStorage.removeItem(\"islogedin\");\r\n localStorage.removeItem(\"token\");\r\n localStorage.removeItem(\"user\");\r\n }", "static logout() {\n localStorage.removeItem('auth_token');\n localStorage.removeItem('email');\n localStorage.removeItem('userid');\n localStorage.removeItem('username');\n }", "logout() {\n localStorage.removeItem(\"auth\");\n }", "function logout(){\n localStorage.removeItem('user_email');\n localStorage.removeItem('user_token');\n localStorage.clear();\n }", "logout() {\n localStorage.removeItem('user');\n }", "logout() {\n localStorage.removeItem(\"user\");\n }", "function logout() {\n tokenStore['igtoken'] = undefined;\n }", "destroyToken() {\n localStorage.removeItem('Authorization');\n }", "function logout()\n {\n setUserData({\n token: undefined,\n user: undefined\n })\n localStorage.setItem(\"auth-token\", \"\")\n }", "function logout() {\n localStorage.removeItem('user');\n}", "function logout() {\n //$cookies.remove('token');\n }", "function logout() {\n //$cookies.remove('token');\n }", "static logout() {\n AsyncStorage.removeItem('token');\n AsyncStorage.removeItem('currentVehicle');\n AsyncStorage.removeItem('userId');\n }", "static deauthenticateUser() {\n localStorage.removeItem('token');\n }", "static deauthenticateUser() {\n localStorage.removeItem('token');\n }", "static deauthenticateUser() {\n localStorage.removeItem('token');\n }", "static deauthenticateUser() {\n localStorage.removeItem('token');\n }", "static deauthenticateUser() {\n localStorage.removeItem('token');\n }", "function removeToken() {\n localStorage.removeItem('authorization');\n }", "logout() {\n localStorage.removeItem('email');\n localStorage.removeItem(\"id_token\");\n localStorage.removeItem(\"expires_at\");\n localStorage.removeItem('name');\n localStorage.removeItem('productId');\n localStorage.removeItem('productName');\n }", "static deauthenticateUser() {\n localStorage.removeItem('token');\n }", "logout() {\n localStorage.removeItem('token');\n request.unset('Authorization');\n }", "function logout() {\n localStorage.clear();\n}", "static removeToken() {\n window.localStorage.removeItem(this.TOKEN_KEY);\n }", "function logOut() {\n localStorage.removeItem('id_token')\n showWelcome()\n}", "function logout() {\n sessionStorage.removeItem('id');\n sessionStorage.removeItem('token');\n sessionStorage.removeItem('registerUser');\n setIsLoggedIn(false);\n }", "clearToken() {\n this._localStorageService.remove(tokenKey);\n }", "function logout(){\n localStorage.removeItem('users');\n}", "function logout() {\n localStorage.removeItem('token');\n localStorage.removeItem('email');\n window.location.href = \"index.html\";\n}", "function logout() {\n setToken(\"\");\n ShareBnBApi.token = \"\";\n localStorage.removeItem(\"token\");\n setCurrentUser({});\n }", "function logout() {\n JoblyApi.token = null;\n setCurrentUser(null);\n localStorage.removeItem(\"token\");\n localStorage.removeItem(\"currentUser\");\n }", "logout() {\n $cookies.remove('token');\n currentUser = {};\n }", "function logout() {\n localStorage.removeItem('id_token');\n localStorage.removeItem('AWS.config.credentials');\n authManager.unauthenticate();\n $state.reload();\n }", "function listenLogout() {\n $(\".logout-button\").on(\"click\", event => {\n localStorage.removeItem(\"TOKEN\");\n location.reload();\n });\n}", "logout() {\n // destroy the session\n localStorage.removeItem('session');\n }", "function logOut(){\n localStorage.removeItem(\"user\");\n localStorage.removeItem(\"token\");\n templateController();\n}", "static deauthenticateUser() {\n console.log(\"de-authenticate\")\n localStorage.removeItem('token');\n }", "static logout() {\n localStorage.removeItem('token');\n\n store.dispatch(sessionLogout());\n\n history.push('/user/login');\n }", "function remove() {\n // sessionStorage.removeItem(TOKEN_KEY);\n}", "function logout() {\n\t\t\ttokenStore['fbtoken'] = undefined;\n }", "function handleLogout() {\n window.localStorage.clear();\n setToken(localStorage.getItem(\"token\"));\n setCurrentUser({});\n console.log(\"localStorage is:\", localStorage);\n history.push('/login');\n }", "logout () {\n axios.post(LOGOUT_URL + '?access_token=' + window.localStorage.getItem('id_token'))\n .then((response) => {\n router.push('/')\n })\n window.localStorage.clear()\n user.authenticated = false\n }", "function logout() {\n delete $localStorage.currentUser;\n $window.location.reload();\n }", "function logout() {\n sessionStorage.removeItem('user')\n sessionStorage.removeItem('isLogged')\n}", "logOut(){\n localStorage.removeItem('username');\n localStorage.removeItem('password');\n localStorage.removeItem('firstName');\n }", "function Logout() {\n localStorage.removeItem('user_id')\n}", "static delete() {\n localStorage.removeItem('logged');\n }", "logout() {\n console.log(\"killing token; logging out.\")\n localStorage.removeItem('authToken');\n this.setState({\n authToken: localStorage.getItem('authToken'),\n isTokenValid: null\n });\n }", "deleteSessionToken() {\n store.delete(this.SESSION_TOKEN_STORAGE_KEY);\n }", "destroyToken () {\n localStorage.removeItem('token')\n localStorage.removeItem('expiration')\n\n admin = false\n professor = false\n student = false\n }", "logout() {\n this.authenticated = false;\n\n localStorage.removeItem('user');\n }", "logout() {\n if(localStorage.token) {\n var token = JSON.parse(localStorage.getItem('token'));\n axios.put('http://10.90.90.71:3000/api/v1/authentication/'+token.data.id).then(res =>{\n console.log(\"Success\")\n localStorage.clear();\n this.props.history.push('/');\n })\n } \n }", "function logout() {\n if (typeof window !== \"undefined\")\n localStorage.removeItem(localStorageSessionName);\n\n httpService.clearAuthToken();\n}", "function resetLocalStorageAfterLogout() {\n localStorage.removeItem(\"auth\");\n localStorage.removeItem(\"navbar_title\");\n}", "function logout() {\n\t\tif (Modernizr.localstorage) {\n\t\t\tlocalStorage.removeItem('X-Authorization-Token');\n\t\t}\n\t\t\n\t\twindow.location.href = '/';\n\t}", "function logout() {\n setToken(null);\n setCurrentUser(null);\n }", "function logout() {\n TokenService.removeToken();\n self.all = [];\n self.user = {};\n CurrentUser.clearUser();\n $window.location.reload();\n }", "function handleLogout() {\n window.localStorage.clear();\n setToken(\"\");\n setCurrentUser({});\n history.push('/');\n }", "async logout() {\n this.token = null;\n }", "function logout() {\n token = false;\n showLogin();\n}", "function logout() {\n localStorage.removeItem(authConfig.ACCESS_TOKEN_CACHE_KEY)\n localStorage.removeItem(authConfig.REFRESH_TOKEN_CACHE_KEY)\n store.dispatch(push('/landingPage'))\n}", "logout() {\n // Remove the HTTP header that include the JWT token\n delete axios.defaults.headers.common['Authorization'];\n // Delete the token from our session\n sessionStorage.removeItem('token');\n this.token = null;\n }", "logout(state) {\n localStorage.removeItem(\"JWT\"); // remove the localStorage to have JWT token\n localStorage.removeItem(\"expiryTime\"); // remove the localStorage to have expiry time\n state.token = undefined; // remove the state 'token'\n state.user = undefined; // remove the state 'user'\n state.expiryTime = \"\"; // remove the state 'expiryTime'\n state.loggedIn = false; // set the state 'loggedIn' to be false for vue framework\n }", "signOut() {\n this._authData = {};\n window.localStorage.removeItem(this._authDataKey);\n }", "removeToken(state) {\n localStorage.removeItem('accessToken');\n localStorage.removeItem('refreshToken');\n state.jwt_access = null;\n state.jwt_refresh = null;\n }", "function logOut() {\n localStorage.removeItem('idToken');\n localStorage.removeItem('username');\n localStorage.removeItem('profilePicture');\n localStorage.removeItem('userId');\n window.location.href='http://clrksanford.github.io/date-night/';\n}", "function logout() {\n sessionStorage.clear(); \n}", "function logout() {\n var name = settings.name;\n name = (name ? '_' + name : '');\n $.Storage.remove('token' + name, null);\n $.Storage.remove('login' + name, null);\n if (settings.history) {\n command_line.history().disable();\n }\n login();\n }", "function logout(event) {\n localStorage.removeItem(\"username\");\n checkLocalStorage();\n}", "function logout() {\n $window.sessionStorage['userInfo'] = null;\n $http.defaults.headers.common['X-TOKEN'] = null; // jshint ignore:line\n userInfo = null;\n }", "function logout(){\n localStorage.clear();\n window.location.href = \"/login\";\n}", "function logout() {\n setToken(); // set token to undefined\n // Clear user\n $localStorage.user = undefined;\n\n // Clear activity filter data\n $localStorage.activityFilterData = undefined;\n\n // Clear form data\n $localStorage.selectedUser = undefined;\n $localStorage.selectedCompany = undefined;\n $localStorage.selectedDomain = undefined;\n $localStorage.userMainAccount = undefined;\n \n clearAuthHeaderForAPI();\n clearAll();\n }", "function logout() {\n setCurrentUser(null);\n setToken(null);\n }", "function deleteUserToken() {\n setCookie('token', '', 0);\n}", "function logout() {\n if (Token.has()) {\n $http.get('auth/logout')\n .then(function () {\n AuthEvent.deauthenticated();\n currentUser = {};\n $state.go('login');\n });\n }\n }", "logout() {\n this._userId = null\n this._userToken = null\n this._userUsername = null\n\n sessionStorage.clear()\n }", "function attachHandlerLogout() {\n $(\"#logout\").on(\"click\", function() {\n localStorage.removeItem('token');\n localStorage.removeItem('userId');\n localStorage.removeItem('name');\n $(\".user_login\").show();\n $(\".loggedIn\").html(\"\");\n })\n\n }", "logout () {\n API.User.Logout(AppStorage.getAuthToken())\n .then(() => {\n AppDispatcher.handleAction({\n actionType: 'CLEAR_SESSION'\n })\n AppStorage.clearAll()\n browserHistory.push('/')\n })\n .catch(error => {\n AppSignal.sendError(error)\n AppDispatcher.handleAction({\n actionType: 'CLEAR_SESSION'\n })\n AppStorage.clearAll()\n browserHistory.push('/')\n })\n }", "function signOut() {\n localStorage.removeItem('curUser');\n}", "function logout(){\n localStorage.clear();\n window.location = \"/login\";\n}", "logout () {\n // Clear access token and ID token from local storage\n localStorage.removeItem('access_token')\n localStorage.removeItem('id_token')\n localStorage.removeItem('expires_at')\n this.userProfile = null\n this.authNotifier.emit('authChange', false)\n // navigate to the home route\n router.replace('/')\n }", "function logout() {\n localStorage.removeItem('user');\n $location.path('/');\n }", "logout() {\n return new Promise(resolve => {\n localStorage.removeItem('token');\n resolve(true);\n });\n }", "function btnLogoutClick()\n{\n\twindow.localStorage.clear();\n}", "handleLogOut() {\n localStorage.removeItem(\"jwtToken\");\n setAuthToken(false);\n this.setState({\n loggedIn : false,\n })\n }", "logOut() {\n localStorage.removeItem('user');\n this.router.navigateByUrl('');\n }", "clearAuthToken() {\r\n this.realClearAuthToken(sessionStorage);\r\n this.realClearAuthToken(localStorage);\r\n }" ]
[ "0.8866661", "0.87263083", "0.8692079", "0.86786264", "0.8630982", "0.8626936", "0.85571724", "0.8489406", "0.8469176", "0.84631497", "0.84571075", "0.8455713", "0.8357431", "0.8326805", "0.831313", "0.8222032", "0.8219754", "0.8192851", "0.8188027", "0.8186844", "0.8179761", "0.81570846", "0.815151", "0.8139745", "0.812995", "0.812995", "0.8107929", "0.80469483", "0.80469483", "0.80469483", "0.80469483", "0.80469483", "0.80377156", "0.80187", "0.8017861", "0.80144894", "0.8011361", "0.7981719", "0.79502153", "0.7925737", "0.79173154", "0.7902618", "0.78998107", "0.7895733", "0.78957295", "0.78761816", "0.7866658", "0.7866319", "0.7861793", "0.7852158", "0.7848509", "0.78375566", "0.7812247", "0.78105193", "0.7797136", "0.77685314", "0.7753182", "0.77509314", "0.7748433", "0.77431107", "0.7742968", "0.77410614", "0.7737525", "0.77369666", "0.7716643", "0.77158475", "0.7712686", "0.7712364", "0.77052385", "0.7695011", "0.7686272", "0.7684287", "0.76713437", "0.7658103", "0.76577896", "0.76498294", "0.76474094", "0.7647125", "0.76440734", "0.76302373", "0.7629913", "0.7628855", "0.76212776", "0.761532", "0.76142466", "0.7612417", "0.7609427", "0.76071787", "0.75802624", "0.7577827", "0.75739825", "0.7560543", "0.7559612", "0.75469965", "0.7529494", "0.7523699", "0.7522744", "0.7521724", "0.7513113", "0.7499926", "0.7488678" ]
0.0
-1
returns an array consisting of 'type' and any 'class' properties
function getClassList(type) { var classList = davinci.ve.metadata.queryDescriptor(type, 'class'); if (classList) { classList = classList.split(/\s+/); classList.push(type); return classList; } return [type]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getProperties (type) {\n\n}", "function classes() {\n var classes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n classes[_i] = arguments[_i];\n }\n return classes\n .map(function (c) { return c && typeof c === 'object' ? Object.keys(c).map(function (key) { return !!c[key] && key; }) : [c]; })\n .reduce(function (flattened, c) { return flattened.concat(c); }, [])\n .filter(function (c) { return !!c; })\n .join(' ');\n}", "function getClassInfo(classDescriptor)\n{\n var classInfo = new Array();\n var theObject = new Object();\n if (classDescriptor && classDescriptor.superclass)\n {\n if (classDescriptor.superclass == \"java.lang.Object\")\n {\n theObject.type = \"Class\";\n theObject.image = WEBSERVICE_OBJECT_FILENAME;\n classInfo.push(theObject); \n }\n }\n return classInfo;\n}", "classes() {\n return this.dataset.reduce(function(acc, val) {\n if (!acc.includes(val.c)) {\n acc.push(val.c);\n }\n return acc;\n }, []);\n }", "function fromClass(cls) {\n var classes = (cls || '').split(/\\s+/),\n i = classes.length,\n match;\n while (i--)\n if (match = classes[i].match(/awld-type-(.+)/))\n return map(match[1]);\n }", "function classToArray(getclass ){\n var objects = document.getElementsByClassName(getclass);\n var hold_objects = [];\n for(var i=0; i<objects.length;i++){\n if(objects[i].tagName === 'SELECT' || objects[i].tagName === 'INPUT'|| objects[i].tagName === 'TEXTAREA' )\n hold_objects[i] = objects[i].value;\n }\n return filter_array(hold_objects);\n }", "function getPropertiesOfObjectType(type) {\n if (type.flags & 2588672 /* ObjectType */) {\n return resolveStructuredTypeMembers(type).properties;\n }\n return emptyArray;\n }", "getClassNames(){return this.__classNames}", "function getCtors(cls) {\n if (CCClass._isCCClass(cls)) {\n return cls.__ctors__ || [];\n } else {\n return [cls];\n }\n }", "function getAllClasses() {\n return readObject('classes');\n\n }", "get classes()\n {\n var instanciable = this.instanciable;\n if(!instanciable) return [_object];\n return instanciable.supClasses;\n }", "function GetClassArray(tempClass)\n {\n var className = tempClass.val();\n \n return eval(\"stats_\" + className.toLowerCase());\n }", "static get observedAttributes(){// note: piggy backing on this to ensure we're finalized.\nthis.finalize();const attributes=[];// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nthis._classProperties.forEach((v,p)=>{const attr=this._attributeNameForProperty(p,v);if(attr!==void 0){this._attributeToPropertyMap.set(attr,p);attributes.push(attr)}});return attributes}", "function getClass(obj) {\n return obj.className.split(/\\s+/);\n}", "function get_classes_array(classes) {\n\n var classesArray = [];\n\n // Clean\n classes = $.trim(classes);\n\n // Clean multispaces\n classes = classes.replace(/\\s\\s+/g, ' ');\n\n // Check if still there have another class\n if (classes.indexOf(\" \") != -1) {\n\n // Split with space\n $.each(classes.split(\" \"), function (i, v) {\n\n // Clean\n v = $.trim(v);\n\n // Push\n classesArray.push(v);\n\n });\n\n } else {\n\n // Push if single.\n classesArray.push(classes);\n\n }\n\n return classesArray;\n\n }", "static get observedAttributes(){// note: piggy backing on this to ensure we're finalized.\nthis.finalize();const attributes=[];// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nthis._classProperties.forEach((v,p)=>{const attr=this._attributeNameForProperty(p,v);if(attr!==undefined){this._attributeToPropertyMap.set(attr,p);attributes.push(attr);}});return attributes;}", "static get observedAttributes(){this.finalize();const e=[];// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nreturn this._classProperties.forEach((t,n)=>{const r=this._attributeNameForProperty(n,t);void 0!==r&&(this._attributeToPropertyMap.set(r,n),e.push(r))}),e}", "function getType(array) {\r\n \r\n const types = [];\r\n\r\n array.forEach((item) => {\r\n if (!types.includes(item.type)) {\r\n types.push(item.type);\r\n }\r\n });\r\n return types;\r\n}", "get classes() {\n const result = {};\n const element = this.nativeElement;\n // SVG elements return an `SVGAnimatedString` instead of a plain string for the `className`.\n const className = element.className;\n const classes = typeof className !== 'string' ? className.baseVal.split(' ') : className.split(' ');\n classes.forEach((value) => result[value] = true);\n return result;\n }", "function classes(root) {\n const classes = [];\n\n for (const node of root) {\n if (node.key) {\n classes.push({\n packageName: node.key,\n className: node.key,\n value: node.value\n });\n }\n }\n return {children: classes};\n}", "function determinePropertiesToGet (type) {\n const defaultProperties = ['description', 'summary']\n let result = defaultProperties\n switch (type) {\n case 'API':\n result.push('tags', 'info')\n break;\n case 'METHOD':\n result.push('tags')\n break;\n case 'PATH_PARAMETER':\n case 'QUERY_PARAMETER':\n case 'REQUEST_HEADER':\n case 'REQUEST_BODY':\n result.push('required')\n break;\n }\n return result\n}", "function getAllPropertyTypes() {\r\n return get('/propertytype/getall').then(function (res) {\r\n return res.data;\r\n }).catch(function (err) {\r\n return err.response.data;\r\n });\r\n}", "function getStyleClasses( style ) {\n\t\tvar attrs = style.getDefinition().attributes,\n\t\t\tclasses = attrs && attrs[ 'class' ];\n\n\t\treturn classes ? classes.split( /\\s+/ ) : null;\n\t}", "get classList() {\n if (!this.hasAttribute(\"class\")) {\n return new DOMTokenList(null, null);\n }\n const classes = this.getAttribute(\"class\", true)\n .filter((attr) => attr.isStatic)\n .map((attr) => attr.value)\n .join(\" \");\n return new DOMTokenList(classes, null);\n }", "function parseSavedClasses(classes) {\n var class_data = []\n if (classes != null) {\n var picked_classes = classes.split(\"+\");\n for (c in picked_classes) {\n if (c != 0) {\n var data = picked_classes[c].split(\",\");\n var saved = new Object();\n for (i in data) {\n var attr = data[i].split(\":\")[0];\n var value = data[i].split(\":\")[1];\n if (attr == \"sectionID\") \n saved.sectionID = value;\n else if (attr == \"color\")\n saved.color = value;\n else if (attr == \"type\") \n saved.type = value;\n else if (attr == \"classID\") \n saved.classID = value;\n else if (attr == \"classLabel\")\n saved.classLabel = value;\n else if (attr == \"timeandplace\") \n saved.timeandplace = value;\n else if (attr == \"sectionData\") \n saved.sectionData = value\n\t\t else {\n\t\t\tsaved.timeandplace += \",\" + attr;\n\t\t }\n }\n class_data.push(saved);\n }\n }\n }\n return class_data;\n}", "function classes(root){\n\tvar classes = []; //存储结果的数组 \n /* \n * 自定义递归函数\n * 第二个参数指传入的json对象 \n */ \n function recurse(name, node) { \n if (node.children) //如果有孩子结点 (这里的children不是自带的,是json里面有的) \n { \n node.children.forEach(function(child) { //将孩子结点中的每条数据 \n recurse(node.name, child); \n })\n } \n else {\n \t//如果自身是孩子结点的,将内容压入数组\n \tclasses.push({ name: node.name, value: node.size,props:node.props})\n }; \n } \n recurse(null, root); \n return {children: classes};\n}", "getProperties(){\n\t\tlet className = this.getModelClass();\n\t\tlet $properties = className.$properties();\n\t\tvar rtn = {};\n\t\tvar propNames = Object.getOwnPropertyNames($properties);\n\t\tfor(let prop of propNames){\n\t\t\trtn[prop] = this[prop];\n\t\t}\n\t\treturn rtn;\n\n\t}", "function classes(root) {\n var classes = [];\n\n function recurse(name, node) {\n if (node.children) node.children.forEach(function (child) {\n recurse(node.name, child);\n });\n else classes.push({\n packageName: name,\n className: node.name,\n value: node.size\n });\n }\n\n recurse(null, root);\n return {\n children: classes\n };\n}", "function getClassObjects(getFields) {\n var b = (typeof(getFields) === 'undefined' || getFields == null || !getFields) ? false : getFields;\n var arr = [];\n var i = 0;\n var t = \"\";\n\n var _name, _typ, _def, _ref, _rowid;\n var $tbody;\n\n $(\".object\").each(function() {\n i = getInt($(this).attr(\"data-num\"));\n t = $.trim($(this).find(\".object-name\").val()); \n if (t.length > 0 && i > 7) {\n var fields = [];\n if (b) {\n $tbody = $(this).find(\".object-table tbody\");\n $tbody.find(\"tr\").each(function() {\n var $o = $(this).find(\".sel-record-type option:selected\");\n var $ref = $(this).find(\".btn-object-ref\");\n \n _rowid = getInt($(this).attr(\"data-row\"));\n _name = $.trim($(this).find(\".td-name\").text()); \n _typ = {id: $o.val(), title: $.trim($o.text())};\n _def = $.trim($(this).find(\".td-default\").text());\n _ref = {classID: $ref.attr(\"data-class\"), fieldID: $ref.attr(\"data-field\")};\n fields.push({id: _rowid, name: _name, type: _typ, default: _def, ref:_ref});\n });\n }\n arr.push({id: i, txt: t, fields:fields}); \n }\n });\n \n return arr;\n }", "getTypeNodes() {\r\n return this.compilerNode.types.map(t => this._getNodeFromCompilerNode(t));\r\n }", "function _getClasses($el){\n var cls = $el.attr('class')\n if (cls)\n return cls.split(/\\s+/)\n return []\n }", "function getPoceTypes(poceObject){\n var poceTypes = \"\";\n for (var count=0;count<poceObject.types.length; count++){\n poceTypes+=poceObject.types[count].name+\" \";\n } \n return poceTypes;\n}", "function classes(root) {\n var classes = [];\n\n//pushing hashes into an array here, renamed our keyvalue set, can add year here too\n function recurse(name, node) {\n if (node.children) node.children.forEach(function(child) { recurse(node.name, child); });\n else classes.push({packageName: name, className: node.name, value: node.size, url: node.url});\n }\n\n recurse(null, root);\n return {children: classes};\n}", "function classes(root) {\n var classes = [];\n\n function recurse(name, node) {\n if (node.children) node.children.forEach(function(child) { recurse(node.name, child); });\n else classes.push({packageName: name, className: node.name, value: node.size});\n }\n\n recurse(null, root);\n return {children: classes};\n }", "getAttrs(){\n let properties = new Set()\n let currentObj = this\n do {\n Object.getOwnPropertyNames(currentObj).map(item => properties.add(item))\n } while ((currentObj = Object.getPrototypeOf(currentObj)))\n return {attributes: [...properties.keys()].sort().filter(item => typeof this[item] !== 'function')};\n }", "function getAugmentedPropertiesOfType(type) {\n type = getApparentType(type);\n var propsByName = createSymbolTable(getPropertiesOfType(type));\n if (getSignaturesOfType(type, 0 /* Call */).length || getSignaturesOfType(type, 1 /* Construct */).length) {\n ts.forEach(getPropertiesOfType(globalFunctionType), function (p) {\n if (!propsByName[p.name]) {\n propsByName[p.name] = p;\n }\n });\n }\n return getNamedMembers(propsByName);\n }", "static get observedAttributes() {\n // note: piggy backing on this to ensure we're finalized.\n this.finalize();\n const attributes = [];\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this._classProperties.forEach((v, p) => {\n const attr = this._attributeNameForProperty(p, v);\n if (attr !== undefined) {\n this._attributeToPropertyMap.set(attr, p);\n attributes.push(attr);\n }\n });\n return attributes;\n }", "static get observedAttributes() {\n // note: piggy backing on this to ensure we're finalized.\n this.finalize();\n const attributes = [];\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this._classProperties.forEach((v, p) => {\n const attr = this._attributeNameForProperty(p, v);\n if (attr !== undefined) {\n this._attributeToPropertyMap.set(attr, p);\n attributes.push(attr);\n }\n });\n return attributes;\n }", "static get observedAttributes() {\n // note: piggy backing on this to ensure we're finalized.\n this.finalize();\n const attributes = [];\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this._classProperties.forEach((v, p) => {\n const attr = this._attributeNameForProperty(p, v);\n if (attr !== undefined) {\n this._attributeToPropertyMap.set(attr, p);\n attributes.push(attr);\n }\n });\n return attributes;\n }", "function classes(root) {\n var classes = [];\n\n function recurse(name, node) {\n if (node.children) node.children.forEach(function(child) { recurse(node.name, child); });\n else classes.push({packageName: name, className: node.name, value: node.size});\n }\n\n recurse(null, root);\n return {children: classes};\n }", "function getClassesOfElement(element){\n var tab = [];\n for(var i =0; i< element.length;i++){\n tab.push(element[i]);\n }\n return tab;\n}", "function processInfo(info) {\n let array = Object.keys(info.props).map(function(key) {\n let obj = {};\n\n /* Skip empty objects. */\n if (typeof info.props[key].type === \"undefined\") {\n return obj;\n }\n\n let name = info.props[key].type.name;\n\n /* Check if the type is a union. */\n if (name === \"union\") {\n obj.type = '\"' + key + '\":' + \" PropTypes.oneOfType([\";\n\n for (let i = 0; i < info.props[key].type.value.length; i++) {\n let type = info.props[key].type.value[i];\n switch (type.name) {\n case \"number\":\n obj.type += \"PropTypes.number,\";\n break;\n case \"string\":\n obj.type += \"PropTypes.string,\";\n break;\n case \"element\":\n obj.type += \"PropTypes.element,\";\n break;\n case \"array\":\n obj.type += \"PropTypes.array,\";\n break;\n case \"object\":\n obj.type += \"PropTypes.object,\";\n break;\n case \"shape\":\n obj.type += \"PropTypes.shape(\" + JSON.stringify(type.value) + \")\";\n break;\n /* If we get here it means were missing this proptype and it should\n have a case added to this switch statment. */\n default:\n console.log(\"Missing proptype: \" + type.name);\n throw \"Missing proptype: \" + type.name;\n }\n }\n\n if (obj.type !== \"shape\") {\n obj.type += \"])\";\n }\n } else {\n obj.type = '\"' + key + '\":' + \" \" + \"PropTypes.\" + name;\n }\n\n obj.required = info.props[key].required;\n obj.description = info.props[key].description;\n return obj;\n });\n\n return array;\n}", "function getClassList(element) {\n\tif (element.className && element.className != \"\") {\n\t\treturn element.className.split(' ');\n\t}\n\treturn [];\n}", "getSerialisedArray(_classesArray) {\n\t\tconst array = [];\n\n\t\tfor (var [key, classObject] of Object.entries(_classesArray)) {\n\t\t\tconst serialisedObject = classObject.serialisedObject;\n\t\t\tarray.push(serialisedObject);\n\t\t}\n\n\t\treturn array;\n\t}", "function classes(root) {\r\n\t\t var classes = [];\r\n\r\n\t\t function recurse(name, node) {\r\n\t\t if (node.children) node.children.forEach(function(child) { recurse(node.name, child); });\r\n\t\t else classes.push({packageName: name, className: node.name, value: node.size});\r\n\t\t }\r\n\r\n\t\t recurse(null, root);\r\n\t\t return {children: classes};\r\n\t\t}", "function classes(root) {\n\t var classes = [];\n\n\t function recurse(name, node) {\n\t if (node.children) node.children.forEach(function(child) { recurse(node.name, child); });\n\t else classes.push({packageName: name, className: node.name, value: node.size});\n\t }\n\n\t recurse(null, root);\n\t return {children: classes};\n\t}", "function classes(root) {\n var classes = [];\n\n function recurse(name, node) {\n if (node.children) node.children.forEach(function(child) { recurse(node.name, child); });\n else classes.push({packageName: name, className: node.name, value: node.size});\n }\n\n recurse(null, root);\n return {children: classes};\n }", "function detect_class_members_from_array(cls, ast) {\n cls[\"members\"] = [];\n return _.each(ast[\"elements\"], function(el) {\n detect_method_or_property(cls, key_value(el), el, el);\n });\n}", "function classes() {\n var classes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n classes[_i] = arguments[_i];\n }\n return classes.filter(function (c) { return !!c; }).join(' ');\n}", "function classes() {\n var classes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n classes[_i] = arguments[_i];\n }\n return classes.filter(function (c) { return !!c; }).join(' ');\n}", "function classes() {\n var classes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n classes[_i] = arguments[_i];\n }\n return classes.filter(function (c) { return !!c; }).join(' ');\n}", "function classes(root) {\n var classes = [];\n\n function recurse(name, node) {\n if (node.children) node.children.forEach(function(child) { recurse(node.name, child); });\n else classes.push({packageName: name, className: node.name, value: node.size});\n }\n\n recurse(null, root);\n return {children: classes};\n}", "function getTypes(data) {\n\t\tvar types = Object.keys(data.overall);\n\n\t\treturn types;\n\t}", "function classes(root) {\n\t\t\t\t\t\t var classes = [];\n\n\t\t\t\t\t\t function recurse(name, node) {\n\t\t\t\t\t\t if (node.children) node.children.forEach(function(child) { recurse(node.name, child); });\n\t\t\t\t\t\t else classes.push({packageName: name, className: node.name, value: node.size});\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t recurse(null, root);\n\t\t\t\t\t\t return {children: classes};\n\t\t\t\t\t\t}", "function classes(root) {\n var classes = [];\n function recurse(name, node) {\n if (node.children) node.children.forEach(function(child) { recurse(node.name, child); });\n else classes.push({packageName: name, className: node.name, value: node.size});\n }\n recurse(null, root);\n return {children: classes};\n}", "function classes(root) {\n\t\t\t\t var classes = [];\n\n\t\t\t\t function recurse(name, node) {\n\t\t\t\t\tif (node.children) node.children.forEach(function(child) { recurse(node.name, child); });\n\t\t\t\t\telse classes.push({packageName: name, className: node.name, value: node.size});\n\t\t\t\t }\n\n\t\t\t\t recurse(null, root);\n\t\t\t\t return {children: classes};\n\t\t\t\t}", "function ctGetBasicTypes()\n{\n\tvar ret = {};\n\tvar key;\n\tfor (key in deftypes)\n\t\tret[key] = deftypes[key];\n\n\treturn (ret);\n}", "function t(n) {\n var o = {};\n\n for (var _e301 in n) {\n if (\"declaredClass\" === _e301) continue;\n var _r148 = n[_e301];\n if (null != _r148 && \"function\" != typeof _r148) if (Array.isArray(_r148)) {\n o[_e301] = [];\n\n for (var _n152 = 0; _n152 < _r148.length; _n152++) {\n o[_e301][_n152] = t(_r148[_n152]);\n }\n } else \"object\" == typeof _r148 ? _r148.toJSON && (o[_e301] = JSON.stringify(_r148)) : o[_e301] = _r148;\n }\n\n return o;\n }", "function classes(root) {\n var classes = [];\n\n function recurse(name, node) {\n if (node.children) node.children.forEach(function(child) { recurse(node.name, child); });\n else classes.push({packageName: node.name, className: node.name, value: node.size});\n }\n\n recurse(null, root);\n //console.log({children:classes});\n return {children: classes};\n\n }", "function get_classes(elem) {\n \"use strict\";\n return $(elem).attr('class').split(/\\s+/);\n}", "static get observedAttributes() {\n // note: piggy backing on this to ensure we're _finalized.\n this._finalize();\n const attributes = [];\n for (const [p, v] of this._classProperties) {\n const attr = this._attributeNameForProperty(p, v);\n if (attr !== undefined) {\n this._attributeToPropertyMap.set(attr, p);\n attributes.push(attr);\n }\n }\n return attributes;\n }", "_groupCustomClasses() {\n const result = [];\n if (this.options.customClasses && Array.isArray(this.options.customClasses)) {\n this.options.customClasses.forEach((customClass) => {\n if (typeof (customClass.targetXPathIndex) === 'number') {\n if (typeof (result[customClass.targetXPathIndex]) === 'undefined') {\n result[customClass.targetXPathIndex] = [customClass];\n } else {\n result[customClass.targetXPathIndex].push(customClass);\n }\n delete customClass.targetXPathIndex;\n }\n });\n }\n return result;\n }", "function getTypes() {\n\t\tif (focusCategory === \"All Types\") {\n\t\t\treturn [\"All Types\"];\n\t\t} else {\n\t\t\treturn d3.map(this.data.pointsData, function(d) {\n\t\t\t\treturn d[categories[focusCategory]];\n\t\t\t}).keys().sort();\n\t\t}\n\t}", "get clazz() {\n return this._json\n }", "function effect_get_classes(element) {\n var str = $(element).attr('class');\n var stringArray = str.split(/(\\s+)/).filter( function(e) { return e.trim().length > 0; } );\n return stringArray;\n}", "_getTypesList(){\n return [\n {\"optText\": \"Select type\", \"optValue\":\"\"},\n {\"optText\": \"Media Type\", \"optValue\":\"MediaType\"},\n {\"optText\": \"Localization Type\", \"optValue\":\"LocalizationType\"},\n {\"optText\": \"State Type\", \"optValue\":\"StateType\"},\n {\"optText\": \"Leaf Type\", \"optValue\":\"LeafType\"},\n ];\n }", "function getAddressibleClasses() {\n // ignoredClasses serves two purposes:\n // 1) ignore a few classes that are used for display like\n // 2) filter out duplicates \n var ignoredClasses = {\n 'active': true,\n 'minute': true,\n 'hour': true,\n 'extra': true\n };\n var classes = [].map\n .call($('#world-clock td'),function(obj) { return $(obj).attr('class').split(' '); }) /* get array of arrays of classes for each td */\n .reduce(function(left, right) { return left.concat(right); }) /* flatten into one array containing all classes for all tds */\n .filter(function(obj) { return ignoredClasses.hasOwnProperty(obj) ? false : (ignoredClasses[obj] = true); }); /* filter out duplicates */\n return classes;\n }", "_saveInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nthis.constructor._classProperties.forEach((_v,p)=>{if(this.hasOwnProperty(p)){const value=this[p];delete this[p];if(!this._instanceProperties){this._instanceProperties=new Map();}this._instanceProperties.set(p,value);}});}", "function getClasses() {\n\n\n return fetch(\"api/Classes\", { headers: { Accept: 'application/json' } })\n .then(function (resposta) {\n if (resposta.status === 200) {\n return resposta.json();\n } else {\n return Promise.reject(new Error(\"Erro ao obter as Classes\"));\n }\n });\n}", "function getPropertyDefs(type) {\n var propDefs = propDefsList[0].propDefs;\n\n if (propDefsList.length > 1) {\n for (var i = 0; i < propDefsList.length; i++) {\n if (propDefsList[i].chartTypes.indexOf(type) >= 0) {\n propDefs = propDefsList[i].propDefs;\n break;\n }\n }\n } \n return propDefs;\n }", "function enumAllClasses()\n{\n\tvar allClasses = [];\n\n\tfor (var aClass in ObjC.classes) {\n\t\tif (ObjC.classes.hasOwnProperty(aClass)) {\n\t\t\tallClasses.push(aClass);\n\t\t}\n\t}\n\n\treturn allClasses;\n}", "function availableTypes() {\n return (availableTypeNames()).map(function(T) { return module.exports[T]; });\n}", "function getElementByClassName(obj,clazz){\n\n var\n arr = [],\n clazzArr = obj.getElementsByTagName('*');\n for(var i= 0,len=clazzArr.length;i<len;i++){\n\n var clazz_arr = clazzArr[i].className ? clazzArr[i].className.splice(' ') : [];\n\n for(var j= 0,iLen = clazz_arr.length;j<iLen; j++){\n\n if(clazz_arr[j] === clazz){\n\n arr.push(clazzArr[i]);\n break;\n }\n }\n }\n return arr;\n}", "getEventsByType(type) {\n var output = [];\n this.events.forEach(function(ev) {\n if(ev.getEvent() instanceof type) {\n output.push(ev);\n }\n });\n return output;\n }", "function loadClasses(input) {\n const ret = {};\n for (const myClass in input) {\n if ({}.hasOwnProperty.call(input, myClass)) {\n ret[myClass] = new InspectorClass(input[myClass]);\n }\n }\n return ret;\n}", "_saveInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nthis.constructor._classProperties.forEach((_v,p)=>{if(this.hasOwnProperty(p)){const value=this[p];delete this[p];if(!this._instanceProperties){this._instanceProperties=new Map}this._instanceProperties.set(p,value)}})}", "_saveInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nthis.constructor._classProperties.forEach((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}})}", "function classList(props) {\n\t var _classes;\n\n\t var spin = props.spin,\n\t pulse = props.pulse,\n\t fixedWidth = props.fixedWidth,\n\t inverse = props.inverse,\n\t border = props.border,\n\t listItem = props.listItem,\n\t flip = props.flip,\n\t size = props.size,\n\t rotation = props.rotation,\n\t pull = props.pull; // map of CSS class names to properties\n\n\t var classes = (_classes = {\n\t 'fa-spin': spin,\n\t 'fa-pulse': pulse,\n\t 'fa-fw': fixedWidth,\n\t 'fa-inverse': inverse,\n\t 'fa-border': border,\n\t 'fa-li': listItem,\n\t 'fa-flip-horizontal': flip === 'horizontal' || flip === 'both',\n\t 'fa-flip-vertical': flip === 'vertical' || flip === 'both'\n\t }, _defineProperty(_classes, \"fa-\".concat(size), typeof size !== 'undefined' && size !== null), _defineProperty(_classes, \"fa-rotate-\".concat(rotation), typeof rotation !== 'undefined' && rotation !== null), _defineProperty(_classes, \"fa-pull-\".concat(pull), typeof pull !== 'undefined' && pull !== null), _defineProperty(_classes, 'fa-swap-opacity', props.swapOpacity), _classes); // map over all the keys in the classes object\n\t // return an array of the keys where the value for the key is not null\n\n\t return Object.keys(classes).map(function (key) {\n\t return classes[key] ? key : null;\n\t }).filter(function (key) {\n\t return key;\n\t });\n\t}", "function getPackhouses_getClasses(){\n for (var i = 0; i < currentData.Items.length; i++) {\n var currentItem = currentData.Items[i];\n\n var packhouse = currentItem.payload.Data.PackRun.Packhouse;\n if (packhouses.indexOf(packhouse) == -1){\n if (packhouse != null) {\n packhouses.push(packhouse);\n }\n }\n\n var fruitVariety = currentItem.payload.Data.PackRun.FruitVariety;\n if (commodities.indexOf(fruitVariety) == -1){\n commodities.push(fruitVariety);\n }\n }\n }", "function byClass(className, obj) {\n\n if (obj.getElementsByClassName) {\n return obj.getElementsByClassName(className);\n } else {\n var retnode = [];\n var elem = obj.getElementsByTagName('*');\n for (var i = 0; i < elem.length; i++) {\n if ((' ' + elem[i].className + ' ').indexOf(' ' + className + ' ') > -1) retnode.push(elem[i]);\n }\n return retnode;\n }\n }", "getTypes() {\n return super.get(['types'], function (data) {\n // return dictionary when typeId not specified\n return Products.toProductDictionary(data);\n });\n }", "get propertyType() {}", "function classes(root) {\n\t\t\t\t\tvar classes = [];\n\n\t\t\t\t\tfunction recurse(name, node) {\n\t\t\t\t\t\tif (node.children) node.children.forEach(function(child) {\n\t\t\t\t\t\t\trecurse(node.name, child);\n\t\t\t\t\t\t});\n\t\t\t\t\t\telse classes.push({\n\t\t\t\t\t\t\tpackageName: name,\n\t\t\t\t\t\t\tclassName: node.name,\n\t\t\t\t\t\t\tvalue: node.size,\n\t\t\t\t\t\t\tid: node.id,\n\t\t\t\t\t\t\tgenre: node.genre,\n\t\t\t\t\t\t\tviews: node.views,\n\t\t\t\t\t\t\tproportion: node.size/totalLikes\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\trecurse(null, root);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tchildren: classes\n\t\t\t\t\t};\n\t\t\t\t}", "async function getOurTypes(KnowledgeBase) {\n\tconst result = [];\n\tKnowledgeBase.forEach(async (element) => {\n\t\tresult.push(element.type);\n\t});\n\n\treturn result;\n}", "function genProperties(){\n var result = {};\n\n // generates this structure\n //\"properties\": {\n // \"user\": {\n // \"type\": \"string\"\n // },\n // \"tweets\": {\n // \"type\": \"string\"\n // }\n //}\n\n for(var prop in body){\n result[prop] = {\n type: body[prop]\n }\n }\n\n return result;\n }", "getElementsByType(type) {\n if (!this[$elementsByType].has(type)) {\n return [];\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return Array.from(this[$elementsByType].get(type));\n }", "function GetAvailableClasses( nodeName )\n{\n\tvar styles = FCK.Styles.GetStyles() ;\n\tvar aClasses = [{name:'', classname:''}];\n\n\tfor ( var styleName in styles )\n\t{\n\t\tvar style = styles[styleName] ;\n\t\tif (style.IsCore)\n\t\t\tcontinue;\n\n\t\tif (style.Element == nodeName)\n\t\t{\n\t\t\tif (style._StyleDesc.Attributes && style._StyleDesc.Attributes['class'] )\n\t\t\t\taClasses.push( {name:styleName, classname:style._StyleDesc.Attributes['class']} ) ;\n\t\t}\n\t}\n\n\treturn aClasses ;\n}", "static applyReflectionClasses(reflection) {\n const classes = [];\n let kind;\n if (reflection.kind === index_1.ReflectionKind.Accessor) {\n if (!reflection.getSignature) {\n classes.push(\"tsd-kind-set-signature\");\n }\n else if (!reflection.setSignature) {\n classes.push(\"tsd-kind-get-signature\");\n }\n else {\n classes.push(\"tsd-kind-accessor\");\n }\n }\n else {\n kind = index_1.ReflectionKind[reflection.kind];\n classes.push(DefaultTheme.toStyleClass(\"tsd-kind-\" + kind));\n }\n if (reflection.parent &&\n reflection.parent instanceof index_1.DeclarationReflection) {\n kind = index_1.ReflectionKind[reflection.parent.kind];\n classes.push(DefaultTheme.toStyleClass(`tsd-parent-kind-${kind}`));\n }\n let hasTypeParameters = !!reflection.typeParameters;\n reflection.getAllSignatures().forEach((signature) => {\n hasTypeParameters = hasTypeParameters || !!signature.typeParameters;\n });\n if (hasTypeParameters) {\n classes.push(\"tsd-has-type-parameter\");\n }\n if (reflection.overwrites) {\n classes.push(\"tsd-is-overwrite\");\n }\n if (reflection.inheritedFrom) {\n classes.push(\"tsd-is-inherited\");\n }\n if (reflection.flags.isPrivate) {\n classes.push(\"tsd-is-private\");\n }\n if (reflection.flags.isProtected) {\n classes.push(\"tsd-is-protected\");\n }\n if (reflection.flags.isStatic) {\n classes.push(\"tsd-is-static\");\n }\n if (reflection.flags.isExternal) {\n classes.push(\"tsd-is-external\");\n }\n reflection.cssClasses = classes.join(\" \");\n }", "function classes(root) {\n var classes = [];\n\n function recurse(name, node) {\n if (node.children) node.children.forEach(function(child) { recurse(node.name, child); });\n else classes.push({packageName: node.name, className: node.name, value: pScale(node.size) });\n }\n\n recurse(null, root);\n //console.log({children:classes});\n return {children: classes};\n\n }", "getClassMap() {\n return this.cache.getOrAdd('classMap', () => {\n const map = new Map();\n this.enumerateBrsFiles((file) => {\n var _a;\n if ((0, reflection_1.isBrsFile)(file)) {\n for (let cls of file.parser.references.classStatements) {\n const lowerClassName = (_a = cls.getName(Parser_1.ParseMode.BrighterScript)) === null || _a === void 0 ? void 0 : _a.toLowerCase();\n //only track classes with a defined name (i.e. exclude nameless malformed classes)\n if (lowerClassName) {\n map.set(lowerClassName, { item: cls, file: file });\n }\n }\n }\n });\n return map;\n });\n }", "get type() {}", "getClasses() {\n let classes = ['indicator-pip'];\n\n if (this.props.final) {\n classes.push('final');\n }\n\n if (this.props.taken) {\n classes.push('taken');\n }\n\n return classes.join(' ');\n }", "get instanciableValueFields() // only for instanciable\n {\n if(this._cache_instanciableValueFields) return this._cache_instanciableValueFields;\n var fields = [];\n for(var class_ of this.supClasses)\n for(var field of class_.$from(_typeFrom))\n if(field.$(_functional) != _true)\n if(field.$(_claimDisabled) != _true)\n {\n fields.push(field);\n var resolvableField = field.resolvableField;\n if(resolvableField) fields.push(resolvableField);\n }\n return this._cache_instanciableValueFields = fields;\n }", "toString() {\n return Array.from(this.classes.keys()).join(' ');\n }", "function getEdmTypeOfAll(entityTypeObject) {\n return getAllColumnProperties(\"type\", entityTypeObject);\n }", "elementsOfType(types) {\n return _.chain(this.getTableEntries())\n .filter(e => {\n var elemType = getElemFieldVal(e, FIELD_TYPE);\n return _.includes(types, elemType);\n })\n .map(e => {\n return getElemFieldVal(e, FIELD_NAME);\n })\n .value();\n }", "function classes(root) {\n var classes = [];\n\n function recurse(name, node) {\n if (node.children) node.children.forEach(function(child) { recurse(node.name, child); });\n else {\n \t\tvar d = new Date(node.date)\n \t\tnode.date_fmt = d.strftime\n \t\t\t\t\t\t\t? d.strftime(input.style.date_format)\n \t\t\t\t\t\t\t: node.date.substr(8,2)+\".\"+node.date.substr(5,2)+\".\"+node.date.substr(0,4);\n\n classes.push({packageName: name, className: node.name, value: node.size, for_print:node.for_print, date:node.date_fmt});\n }\n }\n\n recurse(null, root);\n return {children: classes};\n }", "function normalizeToArray( classes ) {\n\t\treturn Array.isArray( classes ) ? classes : [ classes ];\n\t}", "function AnnotationTypeList () {\n\t}", "getComponents(): Array<ComponentClass> {\n let foundComponents: Array<ComponentClass> = [];\n for (const type: Class<ComponentClass> of this.constructor.componentTypes) {\n for (const comp: ComponentClass of this.manager.componentInstances) {\n if (comp instanceof type) {\n foundComponents.push(comp);\n }\n }\n }\n return foundComponents;\n }\n init() {}\n draw(timeSinceLastUpdate: number) {} // eslint-disable-line\n update() {}\n}" ]
[ "0.64413375", "0.63544554", "0.61874616", "0.6066649", "0.6019503", "0.5999366", "0.5942111", "0.594038", "0.5935475", "0.593419", "0.59158164", "0.5765498", "0.5745204", "0.5737128", "0.5726987", "0.5725635", "0.57159704", "0.56694007", "0.5654689", "0.5634892", "0.56270546", "0.561929", "0.55554414", "0.55432075", "0.5502937", "0.5498533", "0.5490736", "0.5486542", "0.54863614", "0.54846644", "0.5468581", "0.54458606", "0.5434484", "0.54258984", "0.54200375", "0.5405976", "0.5402993", "0.5402993", "0.5402993", "0.5398413", "0.5391954", "0.5389809", "0.53820497", "0.5363445", "0.53554004", "0.5354429", "0.53500277", "0.534868", "0.5344546", "0.5344546", "0.5344546", "0.53443474", "0.53370506", "0.5321802", "0.5316923", "0.53160363", "0.52993494", "0.52973163", "0.5287087", "0.5284418", "0.52822614", "0.5268818", "0.5268784", "0.52668196", "0.5230165", "0.5207664", "0.52022517", "0.5199893", "0.5194316", "0.51735246", "0.51687086", "0.5166315", "0.5163422", "0.51604205", "0.515891", "0.515817", "0.51530355", "0.51481897", "0.5145612", "0.51405925", "0.51398146", "0.5137616", "0.5137271", "0.51218843", "0.5121398", "0.51097995", "0.51061916", "0.5101786", "0.51017785", "0.5081989", "0.50485444", "0.5045768", "0.5044463", "0.5042065", "0.50418144", "0.5034534", "0.50343287", "0.5030333", "0.50050765", "0.5001352" ]
0.7040512
0
returns 'true' if any of the elements in 'classes' are in 'arr'
function containsClass(arr, classes) { return classes.some(function(elem) { return arr.indexOf(elem) !== -1; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hasClass (cls) {\r\n if (!cls) return false\r\n emptyArray.some.call({ 'a': 'asas' }, function (el) {\r\n console.log(el)\r\n })\r\n }", "anyHighlighted(arr) {\n\t\tfor (let i = 0; i < arr.length; i++) {\n\t\t\tif (arr[i])\n\t\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function validateInputsClass (array) {\n var flag = true\n if (true) {\n for (var i = 0; i < array.length; i++) {\n var className = document.querySelector('#' + array[i]).getAttribute('class')\n if (className.indexOf('success') < 0) {\n flag = false\n }\n }\n }\n\n return flag\n}", "function includes(arr, target) {\n let contains = false;\n arr.forEach( el => {\n if (el === target){\n contains = true;;\n }\n })\n return contains;\n}", "function includes(arr, target) {\n let found = false;\n arr.forEach((el) => {\n if (el === target) {\n return found = true;\n }\n })\n return found;\n}", "function isValid() {\r\n return inputsToArray.every(element => {\r\n return element.className == \"valid\";\r\n });\r\n}", "function isInArray(elem,arr) {\n return (arr.slice(0,arr.length).indexOf(elem) > -1);\n }", "function containsAll(arr){\n for (let k = 1; k < arguments.length; k++){\n let num = arguments[k];\n if (arr.indexOf(num) === -1){\n return false;\n }\n }\n return true;\n}", "function checkIfActive(classes) {\n return classes.includes('Plx--active');\n}", "function has (arr, items) {\n\tvar result = false;\n\n\titems.forEach(function (item) {\n\t\tif (arr.indexOf(item) >= 0) {\n\t\t\tresult = true;\n\t\t}\n\t});\n\n\treturn result;\n}", "function hasClass(className) {\n var callback = function(element) {\n return element.classList.contains(className);\n }\n\n return $.some(this.elements, callback);\n }", "hasClass(clazz) {\n let hasIt = false;\n this.eachElem(node => {\n hasIt = node.classList.contains(clazz);\n if (hasIt) {\n return false;\n }\n });\n return hasIt;\n }", "hasClass(clazz) {\n let hasIt = false;\n this.eachElem(node => {\n hasIt = node.classList.contains(clazz);\n if (hasIt) {\n return false;\n }\n });\n return hasIt;\n }", "function inArray(el, arr) {\n return arr.indexOf(el) > -1;\n}", "function checkMatching(array) {\n\tif (array[0].firstElementChild.className === array[1].firstElementChild.className) {\n\t\tcardMatch = true;\n\t}\n\telse {\n\t\tcardMatch = false;\n\t}\n}", "hasClass(ele, str) {\n return ele.className.trim().split(/ +/).indexOf(str) >= 0;\n }", "function arrayContains(arr, val) {\n return arr.some(function (arrVal) {\n return val[0] == arrVal[0] && val[1] == arrVal[1];\n })\n }", "function inArray(user, arr){\n var count=arr.length;\n for(var i=0;i<count;i++){\n if(arr[i]===user){return true;}\n }\n return false;\n }", "function arrayContains(inputArr, val) { return inputArr.indexOf(val) !== -1; }", "function arrayContains(inputArr, val) { return inputArr.indexOf(val) !== -1; }", "function hasClass (elem, cls) {\n\tvar str = \" \" + elem.className + \" \";\n\tvar testCls = \" \" + cls + \" \";\n\treturn (str.indexOf(testCls) != -1);\n}", "function containsAll(arr){\r\n\tfor(let k=1; k<arguments.length;k++){\t\t//arguments object to pass arguments\r\n\t\tlet num=arguments[k];\r\n\t\tif(arr.indexOf(num)===-1){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "function contains(arr, el) {\n return arr.includes(el)\n}", "function include(arr,obj) {\r\n return (arr.indexOf(obj) != -1);\r\n}", "hasClass(classname, reqtForAll = !1) {\n let newInstance = new MicroDOM;\n if (reqtForAll) // The presence of a class for each element of the set\n return this.forEach((el => {\n el.classList.contains(classname) && newInstance.push(el);\n })), newInstance;\n // the presence of a class for at least one element of the set\n for (const el of this) el.classList.contains(classname) && newInstance.push(el);\n return newInstance;\n }", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n }", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n }", "function containsSubStr(classList, substr) {\n\t\tfor (var i=0, l=classList.length; i<l; ++i) {\n\t\t\tif (classList[i].includes(substr)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function contains(array, obj) {\n for (var i = 0; i < array.length; i++) {\n if (array[i] === obj) {\n return true;\n }\n }\n return false;\n }", "function hasClass( elem, klass ) {\n\t\t\t return (\" \" + elem.className + \" \" ).indexOf( \" \"+klass+\" \" ) > -1;\n\t\t\t}", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n }", "function include(arr, obj) {\n return arr.indexOf(obj) != -1;\n}", "function detect(arr, val) {\n\t return arr.some(function (v) {\n\t return val.match(v);\n\t });\n\t}", "function contains(array, elem) {\n\t return array.indexOf(elem) !== -1;\n\t}", "function includesArray (arr, item) {\n for (let i = 0; i < arr.length; i++) {\n if (equalArrays(arr[i], item)) {\n return true;\n }\n }\n return false;\n}", "function inArr(arr, e){\n\tif(arr.length == 0)\n\t\treturn false;\n\treturn arr.indexOf(e) !== -1\n}", "function inArr(arr, e){\n\tif(arr.length == 0)\n\t\treturn false;\n\treturn arr.indexOf(e) !== -1\n}", "function contains(arr, obj) {\n\tif (typeof(arr) == typeof([])) {\n\t\tvar i = arr.length;\n\t\twhile (i--) {\n\t\t\tif (arr[i] == obj) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}", "function contains(element, arr){\n\tfor(var i = 0; i < arr.length; i++){\n\t\tif(arr[i].name === element.name)\n\t\t\treturn true;\n\t}\n\n\treturn false;\n}", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n}", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n}", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n}", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n}", "function includesArray (arr, element) {\r\n var i = 0;\r\n while (i < arr.length) {\r\n if (arr[i] == element) {\r\n return true;\r\n }\r\n i++\r\n }\r\n return false;\r\n}", "contains(array, obj) {\n var i = array.length;\n while (i--) {\n if (array[i] == obj) {\n return true;\n }\n }\n return false;\n }", "function contains(arr, obj) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] == obj) {\n return true;\n }\n }\n return false;\n}", "contains(num, arr) {\n\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] === num) {\n return true;\n }\n }\n return false;\n }", "function contains(array, obj) {\n for (var i = 0; i < array.length; i++) {\n if (array[i] == obj) {\n return true;\n }\n }\n return false;\n}", "function checkWin(currentClass){\n // check in WINNING_COMBINATION array if any combination has all positions filled with current class\n return WINNING_COMBINATIONS.some( combination => {\n //for current combination, check if each index/position is filled with current class\n return combination.every( index=> {\n return cellElements[index].classList.contains(currentClass)\n })\n })\n}", "function hasClass(className) {\n var i, val;\n for(i = 0;i < this.length;i++) {\n val = this.get(i).getAttribute(attr);\n val = val ? val.split(/\\s+/) : [];\n if(~val.indexOf(className)) {\n return true;\n }\n }\n return false;\n}", "function containsAll2(arr, ...nums){\n for (let num of nums){\n if (arr.indexOf(num) === -1){\n return false;\n }\n }\n return true;\n}", "function hasClass(elem, className) {\n return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');\n }", "function classCheck(element, classesToCheck) {\n\t\tvar newClasses = classesToCheck.replace(/\\s+/g,'').split(\",\");\n\t\tvar currentClasses = element.className.trim().replace(/\\s+/g,' ') + ' ';\n\t\tvar ind = newClasses.length;\n\t\tvar hasClass = true;\n\n while(ind--) {\n\t\t\tvar testTerm = new RegExp(newClasses[ind] +' ');\n if (!testTerm.test(currentClasses)) {\n hasClass = false;\n break;\n } \n \t\t}\n \t\treturn hasClass;\n \t}", "function any(func, array){\n for (var i=0; i<array.length; i++){\n\t if (func(array[i])) return true;\n }\n return false;\n }", "function hasClass(elem, className) {\r\n\treturn new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');\r\n}", "function inside(str,arr) {\n if (arr.includes(str)) {\n return true\n } else {\n return false\n }\n}", "function hasClass(element, cls) {\n\treturn (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n}", "function hasClass(element, cls) {\n\t\treturn (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n\t}", "function matchingClass(cls) {\n return (el) => el.classList.contains(cls);\n }", "function hasClass(element, clas)\n{\n return (' ' + element.className + ' ').indexOf(' ' + clas + ' ') > -1;\n}", "function inArray(val, arr) {\n\tfor (var i=0; i < arr.length; i++) {\n\t\tif (arr[i] == val) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "arraysItemInArray(a, b) {\r\n for(let item of a) {\r\n if(b.includes(item)) return true;\r\n }\r\n return false;\r\n }", "function checkWin(currentClass) {\n\treturn winningCombinations.some(combination => { \n\t\treturn combination.every(index => {\n\t\t\treturn cellElements[index].classList.contains(currentClass)\n\t\t})\n\t})\n}", "function checkIfElExistsInArr(element, arr) {\n for (const arrEl of arr) {\n if(element.toLowerCase() === arrEl.toLowerCase()) {\n return true;\n }\n }\n return false;\n}", "function hasClass(elem, className) {\n\treturn new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');\n}", "function hasClass(elem, className) {\n\treturn new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');\n}", "function hasClass(elem, className) {\n\treturn new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');\n}", "function testParamClass(param, types){\n for (var i = 0; i < types.length; i++) {\n if (types[i] === 'Array') {\n if(param instanceof Array) {\n return true;\n }\n } else {\n if (param.name === types[i]) {\n return true; // class name match, pass\n } else if (types[i] === 'Constant') {\n return true; // accepts any constant, pass\n }\n }\n }\n return false;\n}", "function hasClass(elm, cls) {\n\t var classes = elm.className.split(' ');\n\t for (var i = 0; i < classes.length; i++) {\n\t if (classes[i].toLowerCase() === cls.toLowerCase()) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t}", "function hasClass(elem, className) {\n return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');\n }", "function hasClass(elm, cls) {\n var classes = elm.className.split(' ');\n for (var i = 0; i < classes.length; i++) {\n if (classes[i].toLowerCase() === cls.toLowerCase()) {\n return true;\n }\n }\n return false;\n}", "function hasClass(elem, className) {\n return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ')\n}", "function hasClass(elements, value) {\n // if there are no elements, we're done\n if (!elements) {\n return;\n }\n // if we have a selector, get the chosen elements\n if (typeof(elements) === 'string') {\n elements = document.querySelectorAll(elements);\n }\n // if we have a single DOM element, make it an array to simplify behavior\n else if (elements.tagName) {\n elements = [elements];\n }\n //loop the elements\n for (var i = 0; i < elements.length; i++) {\n //check if it is the one\n //debug\n //console.log(elements[i].className)\n //console.log(value);\n if (elements[i].className.indexOf(value) != -1) {\n return (1);\n }\n }\n return (0);\n }", "function contains(arr, val) {\n return arr.indexOf(val) !== -1;\n }", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(arr, val) {\n for (var i = 0; i < arr.length; i ++) {\n if (arr[i]===val) {\n return true;\n }\n }\n return false;\n}", "function contains(array, obj) {\n var i = a.length;\n while (i--) {\n if (a[i] === obj) {\n return true;\n }\n }\n return false;\n}", "function hasClass(element, cls) {\n return element.classList.contains(cls);\n}", "function includes(target) {\n for (let element of this) if (target === element) return true;\n return false;\n }", "function hasClass(element, cls) {\n return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n}", "function hasClass(element, cls) {\n return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n}", "function hasClass(element, cls) {\n return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n}", "function hasClass(element, cls) {\n return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n }", "function hasClass(element, cls) {\n return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n }", "function intersection(arr) {\n\t var arrs = slice(arguments, 1),\n\t result = filter(unique(arr), function(needle){\n\t return every(arrs, function(haystack){\n\t return contains(haystack, needle);\n\t });\n\t });\n\t return result;\n\t }", "function class_exists(ele,className){return new RegExp(' '+className+' ').test(' '+ele.className+' ');}", "function includeWithLoop(arr, ele) {\n for (let i=0; i<arr.length; i++) {\n if (arr[i] === ele) {\n return true;\n }\n }\n // gotten through whole array and didn't find ele, so return false\n return false;\n}", "function tenEx(arr) {\n if (arr.includes(1) || arr.includes(3)) {\n console.log(\"false\");\n } else {\n console.log(\"true\");\n }\n}", "function getClassesContain(str, sel) {\n\n var i, k,\n allClasses,\n classes = new Array();\n\n for (i = 0; i < sel.length; i++) {\n allClasses = sel.eq(i).attr('class').split(' ');\n for (k = 0; k < allClasses.length; k++) {\n if (allClasses[k].substring(0, str.length) == str) {\n if ($.inArray(allClasses[k], classes) == -1) {\n classes.push(allClasses[k]);\n }\n }\n }\n }\n return classes;\n}", "function includes (array, element) {\n\t\n\tfor (var i = 0; i < array.length; i++) if (array[i].id == element.id) return true;\n\treturn false;\n\t\n}", "function isInArray(item, arr){\n\t\treturn item.indexOf(arr) > -1;\n\t}", "function searchForArr(obj, arr) {\n\tfor (i = 0; i < obj.length; i++) {\n\t\tif ( (arr[0] === obj[i]) && (arr[1] === obj.i) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}", "function arrayContainsElements(arr){\n for(var i=0;i<arr.length;i++){\n if(arr[i] !== \"\")\n return true;\n }\n return false;\n }" ]
[ "0.6747393", "0.648532", "0.6372377", "0.6261987", "0.6231514", "0.6092992", "0.6058115", "0.6042399", "0.60270303", "0.6022681", "0.6020663", "0.59999645", "0.59999645", "0.5996123", "0.59672314", "0.5953228", "0.59128493", "0.59070724", "0.59056646", "0.59056646", "0.5891308", "0.5878689", "0.5878544", "0.5877903", "0.58738726", "0.58690715", "0.58690715", "0.5848037", "0.5847183", "0.5837321", "0.58006024", "0.57905066", "0.57841116", "0.578007", "0.577689", "0.5773505", "0.5773505", "0.576826", "0.57620853", "0.5739082", "0.5739082", "0.5739082", "0.5739082", "0.57280236", "0.5721482", "0.5718673", "0.5712798", "0.5712072", "0.57105446", "0.56999916", "0.569318", "0.5686906", "0.5686264", "0.56796944", "0.56700176", "0.5669264", "0.56652486", "0.5653176", "0.5646616", "0.56399757", "0.5627657", "0.56259686", "0.5619946", "0.5619924", "0.5619239", "0.5619239", "0.5619239", "0.56190157", "0.56127846", "0.560721", "0.5605876", "0.560503", "0.5602942", "0.5595312", "0.5591498", "0.5591498", "0.5591498", "0.5591498", "0.5591498", "0.5591498", "0.5591498", "0.5591498", "0.55858713", "0.5581472", "0.55695194", "0.556475", "0.55625015", "0.55625015", "0.55625015", "0.55618113", "0.55618113", "0.55598885", "0.55579245", "0.5557765", "0.5538426", "0.5525373", "0.55239695", "0.5521526", "0.55212176", "0.5516765" ]
0.83967656
0
Returns 'true' if the dropped widget is allowed as a child of the given parent.
function isAllowed(children, parent) { var parentType = parent instanceof davinci.ve._Widget ? parent.type : parent._dvWidget.type; var parentClassList, allowedChild = davinci.ve.metadata.getAllowedChild(parentType); // special case for HTML <body> if (parentType === "html.body") { allowedChild = ["ANY"]; } parentClassList = getClassList(parentType); // Cycle through children, making sure that all of them work for // the given parent. return children.every(function(child){ var isAllowedChild = allowedChild[0] !== "NONE" && (allowedChild[0] === "ANY" || containsClass(allowedChild, child.classList)); var isAllowedParent = child.allowedParent[0] === "ANY" || containsClass(child.allowedParent, parentClassList); return isAllowedChild && isAllowedParent; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function canDropOnWidget(element) {\n var targetWidget = viewmodel.getWidgetFromElementId(element.id);\n return draggedWidget && draggedWidget !== targetWidget && targetWidget.canHaveChildren;\n }", "isElementAllowed(parent, event) {\n if (this._overlayToIgnore?.size > 0) {\n for (const element of event.path) {\n if (element.id && this._overlayToIgnore.has(element.id)) {\n return true;\n }\n }\n }\n \n return this.isElementContained(parent, event);\n }", "containInParent() {\n if (this.parentContainer && this.isActive) {\n let targetRect = this.target.getBoundingClientRect();\n\n //Make sure bottom of parent is visible, then ensure the target and the parent's bottom are at the same level, then confirm the window's offset is not over the target\n if (this.shouldDock(targetRect)) {\n this.setDocked();\n } else if(this.isDocked && targetRect.top >= this.offset) {\n this.setUndocked();\n }\n }\n }", "isElementContained(parent, event) {\n var node = event.target?.parentNode;\n while (node != null) {\n if (node === parent) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n }", "function isChildOf(node, parent) {\n\t\twhile (node) {\n\t\t\tif (parent === node) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tnode = node.parentNode;\n\t\t}\n\n\t\treturn false;\n\t}", "function isChildOf(node, parent) {\n\t\twhile (node) {\n\t\t\tif (parent === node) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tnode = node.parentNode;\n\t\t}\n\n\t\treturn false;\n\t}", "function isChildOf(node, parent) {\n\t\twhile (node) {\n\t\t\tif (parent === node) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tnode = node.parentNode;\n\t\t}\n\n\t\treturn false;\n\t}", "canHide() {\n return this.parent ? true : false;\n }", "function isChild(parent, child) {\n\t\tvar node = child.parentNode;\n\t\t\n\t\twhile (node != null) {\n\t\t\tif(node == parent){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tnode = node.parentNode;\n\t\t}\n\t\treturn false;\n\t}", "function hasDisabledParent(element){\n return !!element.parent()[0].attributes.getNamedItem('disabled');\n }", "function getIsDroppingOnBuilder(controlType, parentControlType, quadrant) {\n\n var isBuilder = controlType === containers.screen || controlType === containers.form;\n\n var isParentBuilder = (parentControlType === containers.screen || parentControlType === containers.form) && (quadrant !== quadrants.center);\n\n return isBuilder || isParentBuilder;\n }", "function allowDrop( ui ) {\n\t\tif ( ! ui.placeholder.parent().hasClass( 'start_divider' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// new field\n\t\tif ( ui.item.hasClass( 'frmbutton' ) ) {\n\t\t\tif ( ui.item.hasClass( 'frm_tbreak' ) || ui.item.hasClass( 'frm_tform' ) || ui.item.hasClass( 'frm_tdivider' ) || ui.item.hasClass( 'frm_tdivider-repeat' ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\t// moving an existing field\n\t\treturn ! ( ui.item.hasClass( 'edit_field_type_break' ) || ui.item.hasClass( 'edit_field_type_form' ) ||\n\t\t\tui.item.hasClass( 'edit_field_type_divider' ) );\n\t}", "function isParent(possibleParent, elem) {\n if(!elem || elem.nodeName === 'HTML') {\n return false;\n }\n\n if(elem.parentNode === possibleParent) {\n return true;\n }\n\n return isParent(possibleParent, elem.parentNode);\n }", "_isChildEnabled(child) {\n return !(child.disabled || child.templateApplied || child.hidden || child instanceof HTMLDivElement || child.offsetHeight === 0);\n }", "function isChildNode(parent, child) {\n if (!isNode(parent) || !isNode(child)) {\n return false;\n }\n return child.parentNode === parent;\n }", "function isChildNode(parent, child) {\n if (!isNode(parent) || !isNode(child)) {\n return false;\n }\n return child.parentNode === parent;\n }", "function isParentTab() {\n return scope.parentTab === true;\n }", "function IUIControlValidateFromParent() {}", "function isInsideHammer(parent, child) {\n // get related target for IE\n if(!child && window.event && window.event.toElement){\n child = window.event.toElement;\n }\n\n if(parent === child){\n return true;\n }\n\n // loop over parentNodes of child until we find hammer element\n if(child){\n var node = child.parentNode;\n while(node !== null){\n if(node === parent){\n return true;\n };\n node = node.parentNode;\n }\n }\n return false;\n }", "function hasParent(element, parent) {\n var elem = element;\n\n while (elem) {\n if (elem === parent) {\n return true;\n } else if (elem.parentNode) {\n elem = elem.parentNode;\n } else {\n return false;\n }\n }\n\n return false;\n}", "function hasParent(element, parent) {\n var elem = element;\n\n while (elem) {\n if (elem === parent) {\n return true;\n } else if (elem.parentNode) {\n elem = elem.parentNode;\n } else {\n return false;\n }\n }\n\n return false;\n}", "function isParentHorizontal() {\n return scope.parentControl && spFormBuilderService.isHorizontalContainer(scope.parentControl.getType().getAlias());\n }", "function isChildOf(parent, child) { \r\n\r\n let node = child.parentNode; \r\n \r\n // keep iterating unless null \r\n while (node != null) { \r\n \tif (node == parent) { \r\n\r\n return true; \r\n } \r\n node = node.parentNode; \r\n } \r\n return false; \r\n}", "function isParentOf(parent,child){\n\tif(!parent || !child) return false;\n\tif(parent == child) return true;\n\tif(child.parentNode){\n\t\twhile(child = child.parentNode){\n\t\t\tif(parent == child) return true;\t\t\t\n\t\t}\n\t}\n\treturn false;\n}", "function isDescendant(parent, child) {\n while(child.parentNode) {\n if(child.parentNode === parent) return true;\n child = child.parentNode;\n }\n return false;\n }", "function isControlInExplicitContainer(parent) {\n if (!parent) {\n return false;\n }\n\n var controlInExplicitContainer = false;\n var parentAlias;\n\n while (parent) {\n parentAlias = parent.type.getAlias();\n if ((parent.name && parentAlias !== spFormBuilderService.containers.form && parentAlias !== spFormBuilderService.containers.screen) || (parentAlias === spFormBuilderService.containers.header)) {\n controlInExplicitContainer = true;\n break;\n }\n\n parent = structure.map[parent.id()].parentControl;\n }\n\n return controlInExplicitContainer;\n }", "function hasSelectParent($node){\n if($node.closest('.cf-select').length > 0){\n return true;\n }\n return false;\n }", "function shouldNotSearchParent(flags, parentLocation) {\n return flags & 2 /* Self */ ||\n (flags & 1 /* Host */ && (parentLocation >> 15 /* ViewOffsetShift */) > 0);\n}", "hasParent() {\n return this._ancestors.size() !== 0;\n }", "function getIsParentExplicit() {\n\n var isExplicit = false;\n\n if (scope.parentControl) {\n\n var container = spFormBuilderService.isExplicitContainer(scope.parentControl);\n if (container && container !== false) {\n\n isExplicit = true;\n }\n }\n\n return isExplicit;\n }", "isDragged(e) {\r\n let isOk = false;\r\n if (e.target.classList.contains(this.options.dragBtnClassName)) {\r\n isOk = true;\r\n } else {\r\n let dragBtn = e.target.closest('.' + this.options.dragBtnClassName);\r\n if (dragBtn) {\r\n isOk = true;\r\n }\r\n }\r\n return isOk;\r\n }", "function Browser_IsValidParent(html)\n{\n\t//only if it has a parent and the parent is a valid node\n\treturn html.parentNode != null && (html.parentNode.nodeType == 1 || html.parentNode.nodeType == 11);\n}", "function isDescendant( childElem, parentElem ) {\n \n let node = childElem.parentNode;\n \n while ( node !== null && node.parentNode !== undefined ) {\n \n if ( node === parentElem ) {\n\n return true;\n }\n \n node = node.parentNode;\n }\n \n return false;\n }", "function isDropAllowed(binding) {\n //console.log(event)\n //console.log(binding)\n // Disallow drop from external source unless it's allowed explicitly.\n if (!dndDragTypeWorkaround.isDragging && !externalSources) return false;\n\n // Check mimetype. Usually we would use a custom drag type instead of Text, but IE doesn't\n // support that.\n if (!hasTextMimetype(this.dataTransfer.types)) return false;\n\n // Now check the dnd-allowed-types against the type of the incoming element. For drops from\n // external sources we don't know the type, so it will need to be checked via dnd-drop.\n if (binding.value.dndAllowedTypes && dndDragTypeWorkaround.isDragging) {\n let allowed = binding.value.dndAllowedTypes;\n if (Array.isArray(allowed) && allowed.indexOf(dndDragTypeWorkaround.dragType) === -1) {\n return false;\n }\n }\n\n // Check whether droping is disabled completely\n if (binding.value.dndDisableIf) return false;\n\n return true;\n }", "function isOverflowed(thisElement, useParent) {\n\t\t\t\t\tthisElement = useParent ? thisElement.parent() : thisElement;\n\t\t\t\t\treturn thisElement[0].scrollHeight > thisElement[0].clientHeight;\n\t\t\t\t}", "function viewAttachedToContainer(view) {\n return isLContainer(view[PARENT]);\n}", "function viewAttachedToContainer(view) {\n return isLContainer(view[PARENT]);\n}", "function viewAttachedToContainer(view) {\n return isLContainer(view[PARENT]);\n}", "function viewAttachedToContainer(view) {\n return isLContainer(view[PARENT]);\n}", "function viewAttachedToContainer(view) {\n return isLContainer(view[PARENT]);\n}", "function viewAttachedToContainer(view) {\n return isLContainer(view[PARENT]);\n}", "function viewAttachedToContainer(view) {\n return isLContainer(view[PARENT]);\n}", "function _visibleChild(name, p, c, cache) {\n\t\tfor (var w = c; w; w = w.parent)\n\t\t\tif (p == w) //yes, c is a child of p\n\t\t\t\treturn !cache || c.isWatchable_(name, p, cache);\n\t\treturn false;\n\t}", "_hasLeftChild(parentIndex) {\n const leftChildIndex = (parentIndex * 2) + 1;\n return leftChildIndex < this.size();\n }", "isElementDraggable(el, event) {\n throw new Error('Implement in subclass');\n }", "isElementDraggable(el, event) {\n throw new Error('Implement in subclass');\n }", "function getCanDrop(dragData, isField, control, quadrant, callback) {\n\n var drop = true;\n var because = 'unknown';\n\n if (dragData && dragData instanceof FieldContainer) {\n // do not allow dropping a field which is already on the form\n if (dragData.isField && dragData.isField()) {\n drop = !spFormBuilderService.isFieldOnFormNoCache(dragData, callback);\n }\n\n // do not allow dropping a lookup or choice field which is already on the form\n if ((dragData.isLookup && dragData.isLookup()) || (dragData.isChoiceField && dragData.isChoiceField())) {\n drop = !spFormBuilderService.isRelationshipOnFormNoCache(dragData, callback);\n }\n\n if (!drop) {\n because = 'cannot drop field, choice or lookup that is already on the form';\n }\n }\n\n control = control || spFormBuilderService.currentDropTarget;\n isField = isField || spFormBuilderService.currentDropTargetIsField;\n quadrant = quadrant || spFormBuilderService.currentDropTargetQuadrant;\n\n var dragType = dragData && dragData.getType ? dragData.getType().getAlias() : '';\n var controlType = control ? control.getType().getAlias() : '';\n var parentControlType = scope.parentControl ? scope.parentControl.getType().getAlias() : '';\n var isExplicit = scope.explicitContainer && scope.explicitContainer !== false;\n var isParentExplicit = getIsParentExplicit();\n var isDraggingTabOrContainer =\n (dragData && (dragData.name === 'Container' || dragData.name === 'Tabbed Container') || dragData._fieldGroupEntity) ||\n (dragType === containers.vertical || dragType === containers.horizontal || dragType === containers.tab || dragType === containers.header);\n\n //if ((controlType === containers.screen || controlType === containers.form) && control.containedControlsOnForm.length > 0) {\n // /////\n // // Do not show the root builder drop zones if a control has already been placed\n // /////\n // drop = false;\n //}\n\n if (quadrant === quadrants.center) {\n /////\n // If this is a direct drop\n /////\n\n if (isField) {\n /////\n // Do not allow direct drop on to a field container\n /////\n drop = false;\n\n because = 'cannot drop on a field container';\n }\n\n if (isDraggingTabOrContainer && isExplicit && controlType === containers.vertical) {\n /////\n // Do not allow a tabbed container or container to be placed within another explicit container\n /////\n drop = false;\n\n because = 'no tabs or containers can go in an explicit container';\n }\n\n } else {\n /////\n // If this is an indirect drop on to the current control's parent\n /////\n\n if (scope.tab) {\n /////\n // Do not allow any interaction with the hidden stack created for each tab\n /////\n drop = false;\n\n because = 'this is a hidden stack container';\n }\n\n if (isDraggingTabOrContainer && isParentExplicit &&\n parentControlType === containers.vertical && !isParentTab()) {\n /////\n // Do not allow a tabbed container or container to be placed within a parent that is another explicit container\n /////\n drop = false;\n\n because = 'cannot indirectly add a container to this explicit parent container';\n }\n\n switch (quadrant) {\n\n case quadrants.left:\n case quadrants.right:\n if (isParentExplicit && parentControlType === containers.vertical && !isParentTab()) {\n ////\n // Do not allow placement at the left or right of an element in an explicit vertical stack (unless tab/screen/form)\n ////\n drop = false;\n\n because = 'we can only stack vertically here';\n }\n break;\n\n case quadrants.top:\n case quadrants.bottom:\n if (control !== scope.parentControl && isParentHorizontal() && !isParentTab()) {\n ////\n // Do not allow placement at the top or bottom of an element in a horizontal stack\n ////\n drop = false;\n\n because = 'we can only stack horizontally here';\n }\n break;\n }\n }\n\n var msg = 'form builder can ' + (drop ? '' : 'NOT ') + 'drop a ' +\n (dragType.length > 0 ? dragType : dragData.name) + ' on to the ' +\n quadrant + ' quadrant of ' + controlType;\n\n if (!drop) {\n msg += (' because ' + because);\n }\n\n console.log(msg);\n\n return drop;\n }", "canDrop(props) {\n return !props.piece\n }", "function viewAttachedToContainer(view) {\n return isLContainer(view[PARENT]);\n}", "_hasRightChild(parentIndex) {\n const rightChildIndex = (parentIndex * 2) + 2;\n return rightChildIndex < this.size();\n }", "function checkATCParent() {\n if (window.parent.location.href.indexOf('u_atc_parent') > -1) {\n return true;\n } else {\n return false;\n }\n}", "function canDropItem(dragData, dropData) {\n var dropParentNode,\n selectedTabNode = scope.getSelectedTabNode();\n\n if (!dragData || !dropData ||\n dragData === dropData || !spNavService.isSelfServeEditMode) {\n return false;\n }\n\n if (!selectedTabNode) {\n return false;\n }\n\n // Ensure cannot drop parent into child\n dropParentNode = dropData.parent;\n while (dropParentNode) {\n if (dropParentNode.item &&\n dragData.item &&\n dropParentNode.item.id === dragData.item.id) {\n return false;\n }\n\n dropParentNode = dropParentNode.parent;\n }\n\n if (spAppSettings.selfServeNonAdmin) { \n return canDropItemSelfServeModeOnly(dragData, dropData);\n }\n\n if (isTopMenu(dragData) || isTopMenu(dropData)) {\n // If the source or target is top menu\n // can only drop if both are top menu\n return isTopMenu(dragData) && isTopMenu(dropData);\n } \n\n var isNew = dragData.source === 'new';\n\n if (dropData === 'navTreeRoot') {\n return true;\n } \n\n if (isNew &&\n isTab(dropData)) {\n // Cannot drop new items onto tabs\n return false;\n }\n\n // Nav sections can only be added at depth 2 and 3\n if (isNavSection(dragData) || isTab(dragData)) {\n return (dropData.item.depth === 2 || dropData.item.depth === 3);\n }\n else {\n // Source is not a nav section\n // Can only be dropped onto non-tab items\n return !isTab(dropData);\n }\n }", "function hasParent(node) {\n if (_.isEmpty(node.parentLink))\n return false;\n\n var link = node.parentLink;\n if (link.endsWith('workspace/vdbs'))\n return false;\n\n return true;\n }", "function viewAttachedToContainer(view) {\n return isLContainer(view[PARENT]);\n }", "function hasNoRelevantChild(parent){\r\n var children = $(parent).children();\r\n if (children.size()==0) return true;\r\n for (i=0;i<children.size();i++){\r\n if (re.test($(children[i]).text())) return false;\r\n }\r\n return true;\r\n }", "canUp() {\n if (!this.parent) {\n return false;\n }\n const props = this.parent.order ? this.parent.order : Object.keys(this.parent.properties);\n const index = props.indexOf(this.name);\n if (index >= 0) {\n return index > 0;\n }\n else {\n for (const p of props) {\n if (Array.isArray(p)) {\n if (p.indexOf(this.name) >= 0) {\n return p.indexOf(this.name) > 0;\n }\n }\n }\n }\n }", "function isPosterityNode(parent, child) {\n if (!isNode(parent) || !isNode(child)) {\n return false;\n }\n while (child.parentNode) {\n child = child.parentNode;\n if (child === parent) {\n return true;\n }\n }\n return false;\n }", "function isInFrame() {\n try {\n return self !== top && parent !== self;\n } catch (e) {\n return true;\n }\n}", "function isPosterityNode(parent, child) {\n if (!isNode(parent) || !isNode(child)) {\n return false;\n }\n while (child.parentNode) {\n child = child.parentNode;\n if (child === parent) {\n return true;\n }\n }\n return false;\n }", "function isDescendant(parent, child) {\n var node = child.parentNode;\n while (node != null) {\n if (node == parent) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n}", "function canInsertNativeChildOfView(viewTNode,view){// Because we are inserting into a `View` the `View` may be disconnected.\nvar container=getLContainer(viewTNode,view);if(container==null||container[RENDER_PARENT]==null){// The `View` is not inserted into a `Container` or the parent `Container`\n// itself is disconnected. So we have to delay.\nreturn false;}// The parent `Container` is in inserted state, so we can eagerly insert into\n// this location.\nreturn true;}", "function checkGroupZoneDrag( event ){\n if( event && event.dataTransfer && event.dataTransfer.items\n && event.dataTransfer.items.length ){\n return event.dataTransfer.items[0].type === 'atd';\n }\n return false;\n }", "_isDropAllowed() {\n if (this._dragAndDropService.isDragged || this.dropEnabled) {\n //If we send a function to allowDrop we call this\n if (this.allowDrop) {\n return this.allowDrop(this._dragAndDropService.dragData);\n }\n //else we look for dropZones if we have not dropzone drop is allowed else we compare dropZone\n if (this.dropZones.length === 0 && this._dragAndDropService.allowedDropZones.length === 0) {\n return true;\n }\n for (let i = 0; i < this._dragAndDropService.allowedDropZones.length; i++) {\n let dragZone = this._dragAndDropService.allowedDropZones[i];\n if (this.dropZones.indexOf(dragZone) !== -1) {\n return true;\n }\n }\n }\n return false;\n }", "_parentMarkedDirty(onlySelf) {\n const parentDirty = this._parent && this._parent.dirty;\n return !onlySelf && parentDirty && !this._parent._anyControlsDirty();\n }", "_parentMarkedDirty(onlySelf) {\n const parentDirty = this._parent && this._parent.dirty;\n return !onlySelf && parentDirty && !this._parent._anyControlsDirty();\n }", "canDown() {\n if (!this.parent) {\n return false;\n }\n const props = this.parent.order ? this.parent.order : Object.keys(this.parent.properties);\n const index = props.indexOf(this.name);\n if (index >= 0) {\n return index < props.length - 1;\n }\n else {\n for (const p of props) {\n if (Array.isArray(p)) {\n if (p.indexOf(this.name) >= 0) {\n return p.indexOf(this.name) < p.length - 1;\n }\n }\n }\n }\n }", "static is_a(idn_child, idn_parent) {\n if (idn_child === idn_parent) {\n return true;\n }\n // FALSE WARNING: 'if' statement can be simplified\n // noinspection RedundantIfStatementJS\n if (is_a(idn_child, Array) && idn_child.length >= 1 && idn_child[0] === idn_parent) {\n return true;\n // TODO: Get an ancestry of idn_child and see if parent is anywhere in it.\n // Right now this will NOT work: if (lex.is_a(w.sbj, lex.idn_of.user)\n }\n // TODO: Less alarming name collision between Lex.is_a() and window.is_a().\n return false;\n }", "_parentMarkedDirty(onlySelf) {\n const parentDirty = this._parent && this._parent.dirty;\n return !onlySelf && !!parentDirty && !this._parent._anyControlsDirty();\n }", "_parentMarkedDirty(onlySelf) {\n const parentDirty = this._parent && this._parent.dirty;\n return !onlySelf && !!parentDirty && !this._parent._anyControlsDirty();\n }", "_parentMarkedDirty(onlySelf) {\n const parentDirty = this._parent && this._parent.dirty;\n return !onlySelf && !!parentDirty && !this._parent._anyControlsDirty();\n }", "_parentMarkedDirty(onlySelf) {\n const parentDirty = this._parent && this._parent.dirty;\n return !onlySelf && !!parentDirty && !this._parent._anyControlsDirty();\n }", "_parentMarkedDirty(onlySelf) {\n const parentDirty = this._parent && this._parent.dirty;\n return !onlySelf && !!parentDirty && !this._parent._anyControlsDirty();\n }", "function isDropAllowed(event) {\n // Disallow drop from external source unless it's allowed explicitly.\n if (!dndDragTypeWorkaround.isDragging && !externalSources) return false;\n\n // Check mimetype. Usually we would use a custom drag type instead of Text, but IE doesn't\n // support that.\n if (!hasTextMimetype(event.dataTransfer.types)) return false;\n\n // Now check the dnd-allowed-types against the type of the incoming element. For drops from\n // external sources we don't know the type, so it will need to be checked via dnd-drop.\n if (attr.dndAllowedTypes && dndDragTypeWorkaround.isDragging) {\n var allowed = scope.$eval(attr.dndAllowedTypes);\n if (angular.isArray(allowed) && allowed.indexOf(dndDragTypeWorkaround.dragType) === -1) {\n return false;\n }\n }\n\n // Check whether droping is disabled completely\n if (attr.dndDisableIf && scope.$eval(attr.dndDisableIf)) return false;\n\n return true;\n }", "function isDropAllowed(event) {\n // Disallow drop from external source unless it's allowed explicitly.\n if (!dndDragTypeWorkaround.isDragging && !externalSources) return false;\n\n // Check mimetype. Usually we would use a custom drag type instead of Text, but IE doesn't\n // support that.\n if (!hasTextMimetype(event.dataTransfer.types)) return false;\n\n // Now check the dnd-allowed-types against the type of the incoming element. For drops from\n // external sources we don't know the type, so it will need to be checked via dnd-drop.\n if (attr.dndAllowedTypes && dndDragTypeWorkaround.isDragging) {\n var allowed = scope.$eval(attr.dndAllowedTypes);\n if (angular.isArray(allowed) && allowed.indexOf(dndDragTypeWorkaround.dragType) === -1) {\n return false;\n }\n }\n\n // Check whether droping is disabled completely\n if (attr.dndDisableIf && scope.$eval(attr.dndDisableIf)) return false;\n\n return true;\n }", "isInEditorElement(element){\n if ( element ) {\n if ( element.hasPointer && element.hasPointer.indexOf('translatable') > -1 ) {\n return true;\n }\n\n if ( element.nodeName != '#text' && element.getAttribute('data-crudadmin-editor') === '' ) {\n return true;\n }\n\n if ( element.parentElement ) {\n return this.isInEditorElement(element.parentElement);\n }\n }\n\n return false;\n }", "_canItemBeHovered(item) {\n const level = item.level;\n\n return item.disabled === false &&\n item.templateApplied !== true &&\n item.hidden !== true &&\n (level === 1 ||\n level > 1 &&\n this._isContainerOpened(level, item.parentElement.container) &&\n item.getBoundingClientRect().height > 0);\n }", "function hasParent(el, test) {\n\twhile (test) {\n\t\tif (test === el.parentElement) {\n\t\t\treturn true;\n\t\t}\n\t\ttest = test.parentElement;\n\t}\n\treturn false;\n}", "_parentMarkedDirty(onlySelf) {\n const parentDirty = this._parent && this._parent.dirty;\n return !onlySelf && !!parentDirty && !this._parent._anyControlsDirty();\n }", "function checkForDroppability(disk, tower) {\n var towerDisks = $(tower).children();\n// elegibility for drop: if the data-block value is less than that of the value of the disk in the top of the stack, allow the draggable object to be dropped\n\tif (towerDisks.length === 0 || parseInt($(disk).attr('data-block')) <= parseInt(towerDisks.last().attr('data-block'))) { // dropping disk is smaller than top disk\n\t\treturn true;\n\t} else\n\treturn false;\n}", "function isParent(thing, relative) {\n var i;\n var temp;\n if (thing === relative) {\n return true;\n }\n if (!thing.children) {\n return false;\n }\n for (i = 0; i < thing.children.length; i++) {\n if (isParent(thing.children[i], relative)) {\n return true;\n }\n }\n return false;\n }", "function elementContains(parent, child, allowVirtualParents) {\n if (allowVirtualParents === void 0) { allowVirtualParents = true; }\n var isContained = false;\n if (parent && child) {\n if (allowVirtualParents) {\n isContained = false;\n while (child) {\n var nextParent = Object(_getParent__WEBPACK_IMPORTED_MODULE_0__[\"getParent\"])(child);\n if (nextParent === parent) {\n isContained = true;\n break;\n }\n child = nextParent;\n }\n }\n else if (parent.contains) {\n isContained = parent.contains(child);\n }\n }\n return isContained;\n}", "function inheritanceNodeContainsParent(source, destination) {\n return (source.type !== NODE_TYPE.INHERITANCE && destination.type !== NODE_TYPE.INHERITANCE) || source.parent || destination.parent\n}", "function isDescendant(parent, child) {\n var node = child.parentNode;\n while (node != null) {\n if (node == parent) {\n return true;\n }\n node = node.parentNode;\n }\n}", "function canInsertNativeChildOfView(viewTNode, view) {\n // Because we are inserting into a `View` the `View` may be disconnected.\n var container = getLContainer(viewTNode, view);\n if (container == null || container[RENDER_PARENT] == null) {\n // The `View` is not inserted into a `Container` or the parent `Container`\n // itself is disconnected. So we have to delay.\n return false;\n }\n // The parent `Container` is in inserted state, so we can eagerly insert into\n // this location.\n return true;\n}", "function canInsertNativeChildOfView(viewTNode, view) {\n // Because we are inserting into a `View` the `View` may be disconnected.\n var container = getLContainer(viewTNode, view);\n if (container == null || container[RENDER_PARENT] == null) {\n // The `View` is not inserted into a `Container` or the parent `Container`\n // itself is disconnected. So we have to delay.\n return false;\n }\n // The parent `Container` is in inserted state, so we can eagerly insert into\n // this location.\n return true;\n}", "function canInsertNativeChildOfView(viewTNode, view) {\n // Because we are inserting into a `View` the `View` may be disconnected.\n var container = getLContainer(viewTNode, view);\n if (container == null || container[RENDER_PARENT] == null) {\n // The `View` is not inserted into a `Container` or the parent `Container`\n // itself is disconnected. So we have to delay.\n return false;\n }\n // The parent `Container` is in inserted state, so we can eagerly insert into\n // this location.\n return true;\n}", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;\n }\n }", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;\n }\n }", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;\n }\n }", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;\n }\n }", "function isOwnChild(e, object) {\n var currentObjectKey = object.part.data.key;\n var node = findNode(currentObjectKey, globalLogicData);\n node.isAdopted = false;\n node.gotAdopted = false;\n reRender(currentObjectKey);\n return;\n}", "parentFrame() {\n return this.sameTargetParentFrame() || this.crossTargetParentFrame();\n }", "tryToPlaceInContainer(\n\t\tv: Vec, \n\t\tblockToPlace: CasusBlock, \n\t\tctx: ?CanvasRenderingContext2D,\n\t\tisOuterContainer: boolean = false\n\t): boolean {\n\t\tif (!this.boundingBox.contains(v)) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (const child of this.getChildBlocks()) {\n\t\t\tif (child.tryToPlaceInContainer(v, blockToPlace, ctx)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function eventInWidget(display, e) {\r\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\r\n if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;\r\n }\r\n }", "isTabFromContainer(node) {\n\t\t// Return immediately if the clicked element is not a Tab. This prevents tab panel content from selecting a tab.\n\t\tif (!isTabNode(node)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if the first occurrence of a Tabs container is `this` one.\n\t\tlet nodeAncestor = node.parentElement;\n\t\tdo {\n\t\t\tif (nodeAncestor === this.tabsNode) return true;\n\t\t\telse if (nodeAncestor.getAttribute('data-tabs')) break;\n\t\t\tnodeAncestor = nodeAncestor.parentElement;\n\t\t} while (nodeAncestor);\n\n\t\treturn false;\n\t}", "function checkParent(t) {\nwhile (t.parentNode) {\nif (t == document.getElementById('abc')) {\nreturn false\n} else if (t == document.getElementById('close')) {\nreturn true\n}\nt = t.parentNode\n}\nreturn true\n}", "function isInside(curs, dropTarget){\n\t // check for x, then y.\n\tvar dt_x = dropTarget.getX(), dt_y = dropTarget.getY();\n\t\n\treturn (curs.x >= dt_x && curs.x < dt_x + dropTarget.getWidth())\n\t\t&& // now check for y.\n\t\t(curs.y >= dt_y && curs.y < dt_y + dropTarget.getHeight());\n}", "canDrag(props) {\n return props.visible;\n }", "shouldAddInst(parentInst, parentEl) {\n PxMapBehavior.ElementImpl.shouldAddInst.call(this, parentInst);\n\n if (this.elementInst && parentInst) {\n this.__parentEl = parentEl;\n this.addInst(parentInst);\n };\n }", "function elementContains(parent, child, allowVirtualParents) {\n if (allowVirtualParents === void 0) { allowVirtualParents = true; }\n var isContained = false;\n if (parent && child) {\n if (allowVirtualParents) {\n if (parent === child) {\n isContained = true;\n }\n else {\n isContained = false;\n while (child) {\n var nextParent = (0,_getParent__WEBPACK_IMPORTED_MODULE_0__.getParent)(child);\n if (nextParent === parent) {\n isContained = true;\n break;\n }\n child = nextParent;\n }\n }\n }\n else if (parent.contains) {\n isContained = parent.contains(child);\n }\n }\n return isContained;\n}" ]
[ "0.712374", "0.66280293", "0.64605296", "0.6460221", "0.62799704", "0.62799704", "0.62799704", "0.6207811", "0.62066627", "0.6175943", "0.6142097", "0.61072016", "0.6022566", "0.59747666", "0.5956069", "0.59204423", "0.58989155", "0.58889574", "0.58308643", "0.5830085", "0.5830085", "0.58240217", "0.58100355", "0.5792036", "0.5761111", "0.5755148", "0.57509226", "0.5749793", "0.57346207", "0.5729533", "0.5723049", "0.570696", "0.5645853", "0.56356525", "0.56016845", "0.5591789", "0.5591789", "0.5591789", "0.5591789", "0.5591789", "0.5591789", "0.5591789", "0.55892617", "0.55885303", "0.5580185", "0.5580185", "0.55773526", "0.5564625", "0.55586237", "0.55502266", "0.5546057", "0.5538984", "0.55353606", "0.55353457", "0.5519759", "0.5515711", "0.5488197", "0.5485118", "0.54835093", "0.54807705", "0.54740965", "0.54740125", "0.5468629", "0.5468604", "0.5468604", "0.54663056", "0.5460275", "0.545944", "0.545944", "0.545944", "0.545944", "0.545944", "0.5453002", "0.5453002", "0.54493827", "0.543886", "0.54372466", "0.541893", "0.5415582", "0.54152244", "0.53998244", "0.5392016", "0.53843147", "0.5380533", "0.5380533", "0.5380533", "0.53619176", "0.53619176", "0.53619176", "0.53619176", "0.5352814", "0.5352142", "0.5348576", "0.5347168", "0.53450817", "0.53434277", "0.5342705", "0.53057945", "0.53046507", "0.5299978" ]
0.67826295
1
Get a random hex color
function hexRandom() { var letters = '0123456789ABCDEF'; var color = '#'; for (var i = 0; i < 6; i++ ) { color += letters[Math.floor(Math.random() * 16)]; } return color; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRandomColorHex() {\n var hex = \"0123456789ABCDEF\",\n color = \"#\";\n for (var i = 1; i <= 6; i++) {\n color += hex[Math.floor(Math.random() * 16)];\n }\n return color;\n }", "function randomColor() {\n const hexa = '0123456789ABCDEF';\n let cor = '#';\n\n for (let index = 0; index < 6; index += 1) {\n cor += hexa[Math.floor(Math.random() * 16)];\n }\n return cor;\n}", "randomHexValue() {\n var color = '#';\n var c = '0123456789ABCDEF'.split('');\n\n for (var i = 0; i < 6; i++) {\n color += c[Math.floor(Math.random() * c.length)];\n }\n\n return color;\n }", "function randNumForHexColor(){\n return Math.floor(Math.random() * hexColor.length);\n}", "function randomColor(){ \n return rgbToHex(random255(),random255(),random255())\n}", "function randomHexColour() {\n return '#' + Math.floor( Math.random() * 16777215 ).toString( 16 );\n}", "function getRandomColor() {\n var chars = '0123456789ABCDEF'.split('');\n var hex = '#';\n for (var i = 0; i < 6; i++) {\n hex += chars[Math.floor(Math.random() * 16)];\n }\n return hex;\n }", "function randomHexColor() {\n\n var randomHexColor;\n randomHexColor = '#' + Math.floor(Math.random() * 16777215).toString(16);\n return randomHexColor;\n\n}", "function colorValue() {\n return randomHex() + randomHex();\n}", "function randomColor() {\t\t\t\t\t\t\t\t// randomizes hex values\n\tlet color = \"#\";\n\tfor(i = 0; i < 6; i++) {\n\t\tcolor += Math.floor((Math.random() * 16)).toString(16);\n\t}\n\treturn color;\n}", "function generateHex(){\n \n //Chroma library used here to use its random function of the chroma class \n const ranColor = chroma.random();\n\n return ranColor;\n}", "function getRandomColor() {\n var length = 6;\n var chars = '0123456789ABCDEF';\n var hex = '#';\n while (length--) hex += chars[(Math.random() * 16) | 0];\n return hex;\n }", "function getRandomColor(){\n\t\t\t\tvar letters = '0123456789ABCDEF'.split('');\n\t\t\t\tvar color = '#';\n\t\t\t\tfor (i=0;i<6;i++){\n\t\t\t\t\tcolor += letters[Math.floor(Math.random()*16)];\n\t\t\t\t}\n\t\t\t\treturn color;\n\t\t\t}", "function randomHexColor() {\n const red = randomHexNumber();\n const green = randomHexNumber();\n const blue = randomHexNumber();\n\n return (\"#\" + red + green + blue).toUpperCase();\n}", "function randomColor(){\n\tvar chars = '0123456789abcdef'\n\tvar value = '#';\n\tfor(var i=0; i < 6; i++){\n\t\tvalue += chars[Math.floor(Math.random() * 16)];\n\t}\n\treturn value;\n}", "function randColor()\n {\n return '#'+ Math.floor(Math.random()*16777215).toString(16);\n }", "function randomColor() {\n\tvar hexChars = '0123456789ABCDEF'.split('');\n\tvar color = '#';\n\n\tfor (var i = 0; i < 6; i++) {\n\t\tcolor += hexChars[Math.floor(Math.random()*16)];\n\t}\n\n\treturn color;\n}", "function getRandomColor() {\n var length = 6;\n var chars = '0123456789ABCDEF';\n var hex = '#';\n while (length--) hex += chars[(Math.random() * 16) | 0];\n return hex;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n }", "function getRandomColor() {\n var letters = '0123456789ABCDEF'.split('');\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n }", "function getRandomColor() {\r\n var letters = '0123456789ABCDEF';\r\n var color = '#';\r\n for (var i = 0; i < 6; i++) {\r\n color += letters[Math.floor(Math.random() * 16)];\r\n }\r\n return color;\r\n }", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n }", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n }", "function generateHexColor() {\n /* From comments here:\n * https://www.paulirish.com/2009/random-hex-color-code-snippets/ */\n return \"#\" + Math.random().toString(16).slice(2, 8).toUpperCase();\n }", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n }", "function getRandomColor() {\n var hex = Math.floor(Math.random() * 0xFFFFFF);\n return \"#\" + (\"000000\" + hex.toString(16)).substr(-6);\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n }", "function getRandomColor() {\n var letters = \"0123456789ABCDEF\".split(\"\");\n var color = \"#\";\n for (var i = 0; i < 6; i++ ) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n }", "function getRandomColor() {\n var hex = Math.floor(Math.random() * 0xFFFFFF);\n return \"#\" + (\"000000\" + hex.toString(16)).substr(-6);\n}", "function getRandomColor () {\n var hex = Math.floor(Math.random() * 0xFFFFFF);\n return \"#\" + (\"000000\" + hex.toString(16)).substr(-6);\n}", "static get randomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n }", "function randomColor() {\n\t\treturn \"#\"+(0x1000000+(Math.random())*0xffffff).toString(16).substr(1,6);\n\t}", "function get_random_color() {\n var letters = '0123456789ABCDEF'.split('');\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.round(Math.random() * 15)];\n }\n return color;\n }", "function getRandomColor() {\n\t\tvar letters = '0123456789ABCDEF';\n\t\tvar color = '#';\n\t\t//Math.floor(Math.random()) Get an integer in the range\n\t\tfor(var i = 0; i < 6; i++) {\n\t\t\tcolor += letters[Math.floor(Math.random() * 16)];\n\t\t}\n\t\treturn color;\n\t}", "function getRandomColor() {\n\tvar letters = '0123456789ABCDEF';\n\tvar color = '#';\n\tfor (var i = 0; i < 6; i++) {\n\t color += letters[Math.floor(Math.random() * 16)];\n\t}\n\treturn color;\n}", "function getRandomColor() {\n var codes = '0123456789ABCDEF'.split('');\n var color = '#';\n for (var i = 0; i < 6; i++ ) {\n color += codes[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n const letters = '0123456789ABCDEF';\n let color = '#';\n for (let i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color; // random color 1-16\n}", "function getRandomColor() {\n\tvar letters = '0123456789ABCDEF';\n\tvar color = '#';\n\tfor (var i = 0; i < 6; i++ ) {\n\t\tcolor += letters[Math.floor(Math.random() * 16)];\n\t}\n\treturn color;\n}", "function getRandomColor() {\n\tvar letters = '0123456789ABCDEF';\n\tvar color = '#';\n\tfor (var i = 0; i < 6; i++ ) {\n\t\tcolor += letters[Math.floor(Math.random() * 16)];\n\t}\n\treturn color;\n}", "function getRandColor() {\n // let color = '#'+(0x1000000+(Math.random())*0xffffff).toString(16).substr(1,6);\n let color = '#9CDCFE';\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function randomColor() {\n return \"#\" + Math.floor(Math.random() * 0xffffff).toString(16);\n}", "function getRandomColour() {\n var hex = \"0123456789ABCDEF\";\n var colourCode = \"#\";\n\n for (var i = 0; i < 6; i++) {\n colourCode += hex.charAt(Math.floor(getRandomNumber(0, 16))); \n }\n\n return colourCode;\n}", "static getRandomColor() {\n let alphabet = '0123456789ABCDEF';\n let color = '#';\n for(let i = 0; i < 6; ++i) {\n color += alphabet[Math.floor(Math.random()*10)];\n }\n return color;\n }", "function getRandomColor() {\r\n var letters = '0123456789ABCDEF';\r\n var color = '#';\r\n for (var i = 0; i < 6; i++) {\r\n color += letters[Math.floor(Math.random() * 16)];\r\n }\r\n return color;\r\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF'.split('');\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return (color);\n}", "function getRandomColor() {\r\n\tvar letters = '0123456789ABCDEF'.split('');\r\n\tvar color = '#';\r\n\tfor (var i = 0; i < 6; i++) {\r\n\t\tcolor += letters[Math.floor(Math.random() * 16)];\r\n\t}\r\n\treturn color;\r\n}", "function randomColor(){\n\treturn '#'+Math.random().toString(16).substr(-6);\n}", "function getRandomColor() {\n\tvar letters = '0123456789abcdef';\n\tvar color = '#';\n\tfor (var i = 0; i < 6; i++) {\n\t\tcolor += letters[Math.floor(Math.random() * 16)];\n\t}\n\treturn color;\n}", "function randomColor() {\n var color = '#';\n for (k = 0; k < 3; k++) {\n color += ('0' + ((Math.random() * 256) | 0).toString(16)).substr(-2);\n }\n return color;\n }", "function getRandomColor() {\n const letters = '0123456789ABCDEF';\n let color = '#';\n for (let i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n\tlet color = '#';\n\twhile (color.length < 7)\n\t\tcolor += '0123456789abcdef'[Math.floor(Math.random() * 16)];\n\treturn color;\n}", "function getRandomColor() {\n var letters = \"0123456789ABCDEF\";\n var color = \"#\";\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = \"0123456789ABCDEF\";\n var color = \"#\";\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n let color = '#';\n let letters = '0123456789ABCDEF';\n for (let i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF'.split('');\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.round(Math.random() * 15)];\n }\n return color;\n }", "function getRandomColor() {\n let letters = \"0123456789ABCDEF\";\n let color = \"#\";\n let colorCounter = 0;\n for ( colorCounter; colorCounter<6; colorCounter ++) {\n let randomLetter = letters[Math.floor(Math.random()*16)];\n color += randomLetter;\n }\n return color;\n }", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF'.split('');\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.round(Math.random() * 15)];\n }\n return color;\n }", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++ ) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF'.split('');\n var color = '#';\n for (var i = 0; i < 6; i++ ) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF'.split('');\n var color = '#';\n for (var i = 0; i < 6; i++ ) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\r\n const letters = '0123456789ABCDEF'.split('');\r\n let color = '#';\r\n for (var i = 0; i < 6; i++ ) {\r\n color += letters[Math.floor(Math.random() * 16)];\r\n }\r\n return color;\r\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF'.split('');\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n let color = '#';\n let i;\n for (i = 0; i < 6; i += 1) {\n color += Math.floor(Math.random() * 16).toString(16);\n }\n return color;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF'.split('');\n var color = '#';\n for (var i = 0; i < 6; i++ ) {\n color += letters[Math.round(Math.random() * 15)];\n }\n return color;\n }", "function getRandomColor() {\r\n var letters = '0123456789ABCDEF';\r\n var color = '#';\r\n for (var i = 0; i < 6; i++) {\r\n color += letters[Math.floor(Math.random() * 16)];\r\n }\r\n return color;\r\n}", "function getRandomColor() {\r\n var letters = '0123456789ABCDEF'.split('');\r\n var color = '#';\r\n for (var i = 0; i < 6; i++ ) {\r\n color += letters[Math.floor(Math.random() * 16)];\r\n }\r\n return color;\r\n}", "function getRandomColor() {\r\n var letters = '0123456789ABCDEF'.split('');\r\n var color = '#';\r\n for (var i = 0; i < 6; i++ ) {\r\n color += letters[Math.floor(Math.random() * 16)];\r\n }\r\n return color;\r\n}", "function getRandomColor() {\r\n var letters = '0123456789ABCDEF'.split('');\r\n var color = '#';\r\n for (var i = 0; i < 6; i++ ) {\r\n color += letters[Math.floor(Math.random() * 16)];\r\n }\r\n return color;\r\n}", "function getRandomColor() {\r\n var letters = '0123456789ABCDEF';\r\n var color = '#';\r\n for (var i = 0; i < 6; i++ ) {\r\n color += letters[Math.floor(Math.random() * 16)];\r\n }\r\n return color;\r\n}", "function getRandomColor() {\n let letters = '0123456789ABCDEF';\n let color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function getRandomColor() {\n\t\tvar letters = '0123456789ABCDEF'.split('');\n\t\tvar color = '#';\n\t\tfor (var i = 0; i < 6; i++ ) {\n\t\t\tcolor += letters[Math.round(Math.random() * 15)];\n\t\t}\n \treturn color;\n\t}", "function getRandomColor() {\n const rgb = []\n for (let i = 0; i < 3; ++i) {\n let color = Math.floor(Math.random() * 256).toString(16)\n color = color.length == 1 ? '0' + color : color\n rgb.push(color)\n }\n return '#' + rgb.join('')\n}", "function randomColor() {\n const caracter = '0123456789ABCDEF';\n\n let color = '#';\n\n for (let i = 0; i < 6; i += 1) {\n color += caracter[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function colour() {\n //let c = Math.random();\n //console.log(c);\n //c = c.toString(16)\n //console.log(c)\n return '#' + Math.random().toString(16).substring(2,8); //substring (2,8) \n}", "function getRandomColor() {\n\tvar letters = '0123456789ABCDEF';\n\tvar color = '#';\n //stops after six creating the hex code\n for (var i = 0; i < 6; i++ ) {\n \t//adding random letters and numbers to color variable creating the random hex code\n \tcolor += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "getRandomColor () {\n let letters = '0123456789ABCDEF'\n let color = '#'\n for (let i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)]\n }\n return color\n }", "function generateHex() {\n return chroma.random();\n}", "function randColor() {\n return Math.floor(Math.random() * 256);\n}", "function getRandomColor() {\n var letters = \"0123456789ABCDEF\";\n var color = \"#\";\n\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n\n return color;\n}", "function getRandomColor() {\r\n const letter = \"0123456789ABCDEF\";\r\n let color = \"#\";\r\n for (let i = 0; i < 6; i++) {\r\n color += letter[Math.floor(Math.random() * 16)];\r\n }\r\n return color;\r\n}", "function randomColor () {\nreturn Math.floor (Math.random() * 256) ;\n}", "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#0';\n for (var i = 0; i < 4; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color + \"3\";\n}", "function getRandomColor () {\n let randomColor = \"#\" + Math.floor(Math.random()*16777215).toString(16);\n return randomColor;\n}" ]
[ "0.85668033", "0.84949356", "0.8477566", "0.84574234", "0.84543955", "0.8441952", "0.8439629", "0.84316456", "0.83898795", "0.83860964", "0.83828336", "0.8363854", "0.8319679", "0.8310057", "0.83043873", "0.8287921", "0.82837385", "0.8279657", "0.826899", "0.8268499", "0.8266648", "0.8261236", "0.8261236", "0.8259592", "0.82535917", "0.8251261", "0.8247114", "0.82385683", "0.8235147", "0.8233227", "0.8216376", "0.82084286", "0.82068557", "0.81936014", "0.8192289", "0.8184113", "0.81794214", "0.81775635", "0.81775635", "0.8171998", "0.81707656", "0.81707656", "0.81707656", "0.81707656", "0.81707656", "0.81707656", "0.81707656", "0.81707656", "0.81707656", "0.81707656", "0.81707656", "0.81707656", "0.81707656", "0.81707656", "0.8170572", "0.8168315", "0.8166153", "0.8161977", "0.8151385", "0.8142635", "0.8142006", "0.81411093", "0.8140973", "0.8140187", "0.8136151", "0.8129989", "0.8129989", "0.81297576", "0.8129522", "0.8127358", "0.8125935", "0.8125935", "0.8125935", "0.81238085", "0.81220603", "0.812103", "0.812103", "0.81203747", "0.81192213", "0.81186295", "0.81164974", "0.81147355", "0.81129503", "0.81129503", "0.81129503", "0.81101644", "0.81101424", "0.8109491", "0.8107114", "0.81034786", "0.81005996", "0.8095396", "0.80953854", "0.8093053", "0.80895066", "0.80805993", "0.80746216", "0.8070145", "0.8070103", "0.80654263" ]
0.8333955
12
Get random transparent color
function rgbaRandom(){ var r = Math.floor(Math.random() * 255); var g = Math.floor(Math.random() * 255); var b = Math.floor(Math.random() * 255); var a = roundDecimal(Math.random(), 2); // Get a num between 0-1 and use 2 decimals return "rgba("+ r +","+ g +","+ b +","+ a +")"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomColor () {\nreturn Math.floor (Math.random() * 256) ;\n}", "function randColor() {\n return Math.floor(Math.random() * 256);\n}", "function randomColor(){\n return color3(Math.floor(Math.random()*256),\n Math.floor(Math.random()*256),\n Math.floor(Math.random()*256));\n}", "function randomColor() {\n return Math.floor(Math.random() * 255);\n}", "function randomColor(){ \n return rgbToHex(random255(),random255(),random255())\n}", "function randomColor(){\n\treturn \"rgba(\"+randomInt(0,255)+\",\"+randomInt(0,255)+\",\"+randomInt(0,255)+\",1)\";\n}", "function getRandomColorRGBA() {\n return 'rgba(' + calcRndGen(255, true).toString() + \",\" + calcRndGen(255, true).toString() + \",\" + calcRndGen(255, true).toString() + \",\" + Math.random().toString() + ')';\n }", "static random() {\n return new Color(random(255), random(255), random(255))\n }", "function color_rand() {\n return color(random(127,255),random(127,255),random(127,255));\n}", "getRandomColor() {\n const getByte = _ => 55 + Math.round(Math.random() * 200);\n return `rgba(${getByte()},${getByte()},${getByte()},.9)`;\n }", "function random_rgba() {\n var random = Math.floor(Math.random() * 10);\n\n if (random === 0) {\n return 'rgba(254,91,53, 1)';\n }\n else {\n return 'rgba(0, 0, 0, 1)';\n }\n}", "function random_rgba() {\n var o = Math.round, r = Math.random, s = 255;\n return 'rgb(' + o(r() * s) + ',' + o(r() * s) + ',' + o(r() * s) + ')';\n}", "function randomColor(){ \n num = Math.floor(Math.random() * 255);\n return num\n}", "function randomColor(){\n return \"#\" + Math.round(Math.random() * 0xFFFFFF).toString(16);\n}", "function randomColor() {\n return \"#\" + Math.floor(Math.random() * 0xffffff).toString(16);\n}", "function randColor()\n {\n return '#'+ Math.floor(Math.random()*16777215).toString(16);\n }", "function randomColor() { return Array.from({ length: 3 }, () => Math.floor(Math.random() * 256)); }", "function GetRandomColor() {\r\n var r = 0,\r\n g = 0,\r\n b = 0;\r\n while (r < 100 && g < 100 && b < 100) {\r\n r = Math.floor(Math.random() * 256);\r\n g = Math.floor(Math.random() * 256);\r\n b = Math.floor(Math.random() * 256);\r\n }\r\n return \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\r\n}", "static random_color () {\n let r = rand_in_range(0, 256)\n let g = rand_in_range(0, 256)\n let b = rand_in_range(0, 256)\n let a = rand_in_range(0, 128)\n\n return [r, g, b, a]\n }", "function randomColor() {\n\t\treturn \"#\"+(0x1000000+(Math.random())*0xffffff).toString(16).substr(1,6);\n\t}", "function randomColorz() {\n var tempColor =[\n random (255),\n random (255),\n random (255)\n ];\n \n return tempColor;\n }", "randomColor()\n {\n function r()\n {\n return Math.floor(Math.random() * 255)\n }\n return 'rgba(' + r() + ',' + r() + ',' + r() + ', 0.2)'\n }", "function randomColor() {\n var x = Math.floor(Math.random() * 256);\n var y = Math.floor(Math.random() * 256);\n var z = Math.floor(Math.random() * 256);\n return Color = \"rgb(\" + x + \",\" + y + \",\" + z + \")\";\n}", "function randomColor(){\n\tval = Math.floor(Math.random()*255);\n\treturn val;\n}", "function random_rgba() {\n var o = Math.round, r = Math.random, s = 255;\n return 'rgba(' + o(r()*s) + ',' + o(r()*s) + ',' + o(r()*s) + ',' + r().toFixed(1) + ')';\n}", "function randomColor(){\n\treturn '#'+Math.random().toString(16).substr(-6);\n}", "function genColorVal(){\r\n return Math.floor(Math.random() * 256);\r\n }", "function random_rgba() {\n var o = Math.round, r = Math.random, s = 255;\n return 'rgba(' + o(r()*s) + ',' + o(r()*s) + ',' + o(r()*s) + ',' + r().toFixed(1) + ')';\n}", "function randomColor(){\r\n return(\"rgba(\" + Math.round(Math.random()*250)+\",\"\r\n + Math.round(Math.random()*250) + \",\"\r\n + Math.round(Math.random()*250) + \",\"\r\n + Math.ceil(Math.random() *10)/10 + \")\" // Math.ceil: round number UP to the nearset Intenger\r\n );\r\n}", "function getRandomColor() {\n let r = 0;\n let g = 0;\n let b = 0;\n while (r < 100 && g < 100 && b < 100) {\n r = Math.floor(Math.random() * 256);\n g = Math.floor(Math.random() * 256);\n b = Math.floor(Math.random() * 256);\n }\n return `rgba(${r},${g},${b},0.6)`;\n}", "function randomColor() {\n return color = `rgba(${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)})`;\n}", "function randomColor() {\n function color() {\n return Math.floor(Math.random()*256).toString(16)\n }\n return \"#\"+color()+color()+color();\n}", "function randColor() {\r\n var r = Math.floor(Math.random() * (256)),\r\n g = Math.floor(Math.random() * (256)),\r\n b = Math.floor(Math.random() * (256));\r\n return '#' + r.toString(16) + g.toString(16) + b.toString(16);\r\n}", "function getRandomColor() {\n var hex = Math.floor(Math.random() * 0xFFFFFF);\n return \"#\" + (\"000000\" + hex.toString(16)).substr(-6);\n}", "function getRandomColor () {\n var hex = Math.floor(Math.random() * 0xFFFFFF);\n return \"#\" + (\"000000\" + hex.toString(16)).substr(-6);\n}", "function randomColor() {\n var color = '#';\n for (k = 0; k < 3; k++) {\n color += ('0' + ((Math.random() * 256) | 0).toString(16)).substr(-2);\n }\n return color;\n }", "function randomColor() {\n return (\n \"rgba(\" +\n Math.round(Math.random() * 250) +\n \",\" +\n Math.round(Math.random() * 250) +\n \",\" +\n Math.round(Math.random() * 250) +\n \",\" +\n Math.ceil(Math.random() * 10) /10 +\n \")\"\n )\n}", "function backgroundColor() {\n return Math.floor(Math.random() * 256);\n}", "function get_random_color() {\n\n let c = [];\n c[0] = 255;\n c[1] = Math.floor(Math.random() * 256);\n c[2] = Math.floor(Math.random() * (256 - c[1] / 2));\n c.sort(function() {\n return (0.5 - Math.random());\n });\n return (\"rgb(\" + c[0] + \", \" + c[1] + \", \" + c[2] + \")\");\n }", "function randomColor() {\n var x = Math.floor(Math.random() * 256);\n var y = Math.floor(Math.random() * 256);\n var z = Math.floor(Math.random() * 256);\n var color = \"rgb(\" + x + \",\" + y + \",\" + z + \")\";\n return color;\n}", "function randomColor() {\n // Generate random integer between 0 and 255\n function generateNumber() {\n return Math.floor(Math.random() * 256);\n }\n return \"rgb(\" + generateNumber() + \", \" + generateNumber() + \", \" + generateNumber() + \")\";\n}", "function getRandomColor() {\n var hex = Math.floor(Math.random() * 0xFFFFFF);\n return \"#\" + (\"000000\" + hex.toString(16)).substr(-6);\n}", "function generateRandomColor() {\n let r = Math.floor(Math.random() * 255);\n let g = Math.floor(Math.random() * 255);\n let b = Math.floor(Math.random() * 255);\n let opacity = Math.random() * 0.4 + 0.2;\n let color = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + opacity + \")\";\n return color;\n }", "function randColour()\n{\n\tvar c = Math.round(0xffffff * Math.random());\t\n\treturn ('#0' + c.toString(16)).replace(/^#0([0-9a-f]{6})$/i, '#$1');\n}", "function gencolor() {\n len = _COLOR.length;\n rand = Math.floor(Math.random()*len); \n return _COLOR[rand];\n }", "function colorValue() {\n return randomHex() + randomHex();\n}", "function getRandColor() {\n // let color = '#'+(0x1000000+(Math.random())*0xffffff).toString(16).substr(1,6);\n let color = '#9CDCFE';\n return color;\n}", "function getRandomColor() {\r\n var rand = function() {\r\n return Math.floor(Math.random() * 256);\r\n };\r\n return `rgb(${rand()}, ${rand()}, ${rand()})`;\r\n }", "randomColor() {\n /*\n Uncomment for random shades of blue\n\n h = 215;\n s = Math.floor(Math.random() * 100);\n l = 60 // Math.floor(Math.random() * 100);\n return 'hsl(' + h + ', ' + s + '%, ' + l + '%)';\n */\n return ('#' + (Math.random() * 0xFFFFFF << 0).toString(16) + '000000').slice(0, 7);\n }", "function randomColor(){\n\tvar r=Math.floor(Math.random()*256);\n\tvar g=Math.floor(Math.random()*256);\n\tvar b=Math.floor(Math.random()*256);\n\treturn \"rgb(\"+r+\", \"+g+\", \"+b+\")\";\n\n}", "function randomColor(){\r\n var r= Math.floor(Math.random() * 256);\r\n var g= Math.floor(Math.random() * 256);\r\n var b= Math.floor(Math.random() * 256);\r\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\r\n}", "function randomColor (){\n\tvar color = \"rgb(\";\n\tfor(var i=0; i<2; i++){\n\t\tcolor+=\"\"+Math.floor(255-parseInt(Math.random()*10)*25.5);\n\t\tcolor+=\",\";\n\t}\n\tcolor+=\"0)\";\n\treturn color;\n}", "function getRandomColor() {\n let r = 0;\n let b = 255;\n let g = 0; //Math.round(Math.random()*255);\n return \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n}", "function randomColor(){\n return `rgb(${randomInt(0,256)},${randomInt(0,256)},${randomInt(0,256)})`;\n}", "function randomColour() {\n return new rgb(\n Math.floor(Math.random() * 255),\n Math.floor(Math.random() * 255),\n Math.floor(Math.random() * 255)\n );\n}", "function randomColorGen(){\n // return `#${Math.floor(Math.random()*16777215).toString(16)}`;\n return \"#\" + Math.random().toString(16).slice(2, 8)\n}", "function generateRandomColor()\n{\n let randomColor = '#'+Math.floor(Math.random()*16777215).toString(16); //167777215 amount of colors that exisit black to white\n return randomColor;\n}", "function randomColor () {\n let color = []\n for (let i=0; i<3; i++)\n color.push(Math.floor(Math.random(i) * 256));\n return color;\n}", "function randomColor() {\n var r = random(256) | 0,\n g = random(256) | 0,\n b = random(256) | 0;\n return 'rgb(' + r + ',' + g + ',' + b + ')';\n }", "function randomRgb(){\n\treturn Math.floor(Math.random() * 256) + 1;\n}", "function randomColor(){\nconst r = Math.floor(Math.random() * 100) + 1;\nconst g = Math.floor(Math.random() * 100) + 1;\nconst b = Math.floor(Math.random() * 100) + 1;\nconst a = Math.floor(Math.random() * 100) + 1;\nconst color = `rgba(${r},${g},${b},0.${a})`\nreturn color;\n}", "function randomColor(){\n var r = Math.floor(Math.random() * 256);\n var g = Math.floor(Math.random() * 256);\n var b = Math.floor(Math.random() * 256);\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function getRandomColor() {\n return 'rgb(' + Math.floor(Math.random() * 256) + ',' + Math.floor(Math.random() * 256) + ',' + Math.floor(Math.random() * 256) + ')';\n}", "function generateRandomColor() {\n let r = Math.floor(Math.random() * 255);\n let g = Math.floor(Math.random() * 255);\n let b = Math.floor(Math.random() * 255);\n let color = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + 1 + \")\";\n return color;\n }", "function randomColour() {\n\n\tfunction value() {\n\t\treturn Math.floor(Math.random() * Math.floor(255)) \n\t}\n\treturn 'rgb(' + value() + ',' + value() + ',' + value() + ')';\n}", "function randomColorGenerator() {\n\t\t\t\t\t\t\treturn '#'\n\t\t\t\t\t\t\t\t\t+ (Math.random().toString(16) + '0000000')\n\t\t\t\t\t\t\t\t\t\t\t.slice(2, 8);\n\t\t\t\t\t\t}", "function randomColor() {\n return \"rgb(\" + random(0, 235) +\n \", \" + random(0, 235) +\n \", \" + random(0, 235) + \")\";\n}", "function randomColor() {\n\n let r = Math.floor(Math.random(256) * 256);\n let g = Math.floor(Math.random(256) * 256);\n let b = Math.floor(Math.random(256) * 256);\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function randomColor() {\n\tconst r = Math.round(255 * Math.random());\n\tconst g = Math.round(255 * Math.random());\n\tconst b = Math.round(255 * Math.random());\n\treturn {r, g, b};\n}", "function randomColor()\n{\n\treturn \"rgb(\" + Math.floor(Math.random()*255)+\",\"+\n\t\t\t\t Math.floor(Math.random()*255)+\",\"+\n\t\t\t\t Math.floor(Math.random()*255)+\")\";\n}", "function randomRGB(){\n return Math.floor(Math.random()*256);\n}", "function getRandomColor () {\n let randomColor = \"#\" + Math.floor(Math.random()*16777215).toString(16);\n return randomColor;\n}", "function changueColor(){\n let randomNumber = Math.floor(Math.random() * (256 - 1 + 1)) + 1;\n return randomNumber;\n}", "function randomColor(){\n\tlet r = Math.floor(Math.random() * 256);\n\tlet g = Math.floor(Math.random() * 256);\n\tlet b = Math.floor(Math.random() * 256);\n\n\treturn \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n\n}", "function randomColor() {\n return (\n \"rgb(\" +\n Math.round(Math.random() * 250) + \",\" +\n Math.round(Math.random() * 250) + \",\" +\n Math.round(Math.random() * 250)\n + \")\"\n );\n}", "function randomRgbaColor() {\n var o = Math.round,\n r = Math.random,\n s = 255;\n return (\n 'rgba(' +\n o(r() * s) +\n ', ' +\n o(r() * s) +\n ', ' +\n o(r() * s) +\n ', ' +\n r().toFixed(1) +\n ')'\n );\n}", "function randomColor() {\n var r = random(0, 255);\n var b = random(0, 255);\n var g = random(0, 255);\n\n\n return color(r, b, g);\n}", "function randomColor() {\n const rand255 = () => {\n return Math.floor(Math.random() * 255);\n };\n return `rgb(${rand255()},${rand255()},${rand255()})`;\n}", "function randomColor() {\n r = random(255);\n g = random(255);\n b = random(255);\n}", "function generateRandomColor() {\n // return '#'+Math.floor(Math.random()*16777215).toString(16);\n return myColors[Math.floor(Math.random()*myColors.length)];\n}", "function RandomColor() {\n\n\tlet rFactor = Math.random()\n\tlet gFactor = Math.random()\n\tlet bFactor = Math.random()\n\n\tlet color = new THREE.Color(rFactor, gFactor, bFactor);\n\n\treturn color ;\n}", "function randomRGB(){\n return Math.floor(Math.random() * 256 );\n}", "function getRandomColor() {\n // Return a random color. Note that we don't check to make sure the color does not match the background\n return '#' + (Math.random()*0xFFFFFF<<0).toString(16);\n}", "function getRandomColor() {\n // Return a random color. Note that we don't check to make sure the color does not match the background\n return '#' + (Math.random()*0xFFFFFF<<0).toString(16);\n}", "function getRandomColor() {\n if (numberOfRgbaColorsTaken > (rgbColors.length - 1))\n return random_rgba();\n return rgbColors[numberOfRgbaColorsTaken++];\n}", "function randomRGB() {\n return Math.floor(Math.random() * 256);\n}", "function randomRGB() {\n return Math.floor(Math.random() * 256);\n}", "function randomRGB() {\n return Math.floor(Math.random() * 256);\n}", "function getRandomColor() {\n const rgb = []\n for (let i = 0; i < 3; ++i) {\n let color = Math.floor(Math.random() * 256).toString(16)\n color = color.length == 1 ? '0' + color : color\n rgb.push(color)\n }\n return '#' + rgb.join('')\n}", "function getRandomColorRGB() {\n return 'rgb(' + calcRndGen(255, true).toString() + \",\" + calcRndGen(255, true).toString() + \",\" + calcRndGen(255, true).toString() + ')';\n }", "function colour() {\n //let c = Math.random();\n //console.log(c);\n //c = c.toString(16)\n //console.log(c)\n return '#' + Math.random().toString(16).substring(2,8); //substring (2,8) \n}", "function getRandomColor() {\r\n color = \"hsl(\" + Math.random() * 360 + \", 100%, 75%)\";\r\n return color;\r\n}", "static get randomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n }", "function randomColor(){\r\n var hue = Math.floor(Math.random() * 360);\r\n var l = Math.random() * 15 + 70;\r\n var pastel = 'hsl(' + hue + ', 100%, ' + l + '%)';\r\n return pastel;\r\n}", "function randomRGB() {\n\treturn Math.floor(Math.random() * 256);\n}", "function randomColor() {\n const hexa = '0123456789ABCDEF';\n let cor = '#';\n\n for (let index = 0; index < 6; index += 1) {\n cor += hexa[Math.floor(Math.random() * 16)];\n }\n return cor;\n}", "function randomRGB() {\n // Use math.floor to generate random value btween 1-255\n return Math.floor(Math.random() * 255)\n}", "function randomHexColour() {\n return '#' + Math.floor( Math.random() * 16777215 ).toString( 16 );\n}", "function colorRandom(){\n var color=\"#\";\n for(let i=0; i<3; i++){\n let num = Math.floor((Math.random()*255)+1).toString(16);\n if(num.length<2){\n num = \"0\"+num;\n }\n color = color+num;\n }\n return color;\n}", "function randomColor() {\n return `#${Math.floor(Math.random() * 16777215)\n .toString(16)\n .padStart(6, 0)}`;\n}" ]
[ "0.8150127", "0.80947584", "0.7981961", "0.79687035", "0.7937515", "0.79124874", "0.7902498", "0.7884345", "0.788225", "0.7863379", "0.7803254", "0.7801668", "0.77953285", "0.7795316", "0.7788447", "0.7785807", "0.77852964", "0.77700734", "0.7752409", "0.77505213", "0.7747883", "0.7736205", "0.77335286", "0.77327454", "0.7732456", "0.77301186", "0.77293587", "0.7728401", "0.7704519", "0.7699803", "0.7682352", "0.76726544", "0.76692307", "0.7656002", "0.7649716", "0.7645005", "0.7639745", "0.7632746", "0.763038", "0.76300555", "0.7629869", "0.7626265", "0.7617352", "0.7610286", "0.7608508", "0.7604952", "0.7590934", "0.75862014", "0.7557385", "0.7555943", "0.75530773", "0.75402486", "0.7539714", "0.7536076", "0.7528622", "0.7523648", "0.75224406", "0.75158167", "0.75138247", "0.7513189", "0.75125974", "0.7505722", "0.74961674", "0.74912906", "0.7488197", "0.74763966", "0.7474924", "0.74746084", "0.7474551", "0.7469975", "0.74688613", "0.7466608", "0.7466402", "0.74659306", "0.74646044", "0.74594337", "0.7456859", "0.74534696", "0.7450023", "0.7448263", "0.74454045", "0.7440042", "0.74335575", "0.74335575", "0.7429772", "0.7429074", "0.7429074", "0.7429074", "0.7427712", "0.7421077", "0.7418131", "0.74112415", "0.74111307", "0.7406095", "0.74060535", "0.7403179", "0.7402096", "0.73965806", "0.7390192", "0.7380417" ]
0.7807199
10
Sets the global variables $rects and $origRectSpecs
function setConstants() { const wrapItems = ".image-analysis-wrapper .face-wrap, .image-analysis-wrapper .score-wrap, .image-analysis-wrapper .attribute-wrap, .image-analysis-wrapper .region-block, .image-analysis-wrapper .region-block .word-block .word-wrap"; $rects = jQuery(".image-analysis-wrapper .rectangle"); // Iterate over each rectangle and save the width, height, top position, // left position, closest stats block element, and position of the closest // stats block element to an object. Each object is then added to the // $origRectSpecs array for global use. $origRectSpecs = $rects.map(function () { closestWrapItems = jQuery(this).siblings(wrapItems); const stats = closestWrapItems.map(function () { return { origStatTop: jQuery(this).position().top || parseInt(jQuery(this).css("top")), origStatLeft: jQuery(this).position().left || parseInt(jQuery(this).css("left")) } }) return { origRectWidth: jQuery(this).width(), origRectHeight: jQuery(this).height(), origRectTop: jQuery(this).position().top || parseInt(jQuery(this).css("top")), // if the rect is on a tab that is currently not displayed it has a position of 0, so this check gets the css instead so we don't lose the value origRectLeft: jQuery(this).position().left || parseInt(jQuery(this).css("left")), statBlock: closestWrapItems[0], statPosition: stats[0] } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setup_rectangles(rects){\n let xScale = this.xScale;\n let yScale = this.yScale;\n let h = this.h;\n let y_pad = this.y_pad\n rects.attr(\"x\", function(d, i) {return xScale(i);})\n .attr(\"y\", function(d) {return yScale(d.mort_rate);})\n .attr(\"width\", xScale.bandwidth())\n .attr(\"height\", function(d) {return (h - y_pad) - yScale(d.mort_rate);});\n return rects\n }", "function rectSet(){\n\tthis.covers = [];\n\tthis.paths = [];\n\tthis.primed = null;\n}", "function redrawRects(selectedImageId) {\n var rectData = $scope.imageArr[selectedImageId];\n if (rectData != undefined || rectData != null) {\n for (var i = 0; i < rectData.length; i++) {\n var obj = rectData[i];\n var x1 = obj.currentObj.x1;\n var y1 = obj.currentObj.y1;\n var x2 = obj.currentObj.x2;\n var y2 = obj.currentObj.y2;\n\n\n var width = x2 - x1;\n var height = y2 - y1;\n var context = getCanvasContext();\n context.beginPath();\n context.rect(x1, y1, width, height);\n context.lineWidth = 1;\n context.strokeStyle = obj.currentObj.color;\n context.stroke();\n }\n }\n //temp squares\n\n var rectData = $scope.tempPoints[selectedImageId];\n if (rectData != undefined || rectData != null) {\n for (var i = 0; i < rectData.length; i++) {\n var obj = rectData[i];\n var x1 = obj.currentObj.x1;\n var y1 = obj.currentObj.y1;\n var x2 = obj.currentObj.x2;\n var y2 = obj.currentObj.y2;\n\n\n var width = x2 - x1;\n var height = y2 - y1;\n var context = getCanvasContext();\n context.beginPath();\n context.rect(x1, y1, width, height);\n context.lineWidth = 1;\n context.strokeStyle = obj.currentObj.color;\n context.stroke();\n }\n }\n\n }", "animateRectangles() {\n requestAnimationFrame(this.animateRectangles.bind(this));\n this.clearCanvas();\n this.rectangles.forEach(rect => rect.update(this.mouse.x, this.mouse.range));\n }", "function updateDrawingRectangleOfAPeer(oldRectangleObject, newRectangleObject) {\n oldRectangleObject.set({\n left: newRectangleObject.left,\n top: newRectangleObject.top,\n width: newRectangleObject.width,\n height: newRectangleObject.height\n });\n}", "reset() {\n\n // Set the initial crop to match any given fixed aspect ratio (or\n // default to a square crop 1:1).\n let aspectRatio = this._initialAspectRatio\n\n // Calculate the initial crop size such that it fits within the bounds\n let width = getWidth(this.bounds)\n let height = getWidth(this.bounds) / aspectRatio\n\n if (aspectRatio < width / getHeight(this.bounds)) {\n width = getHeight(this.bounds) * aspectRatio\n height = getHeight(this.bounds)\n }\n\n // Calculate the initial crop position to be central to the bounds\n const x = (getWidth(this.bounds) - width) / 2\n const y = (getHeight(this.bounds) - height) / 2\n\n // Set the region\n this.region = [\n [x, y],\n [x + width, y + height]\n ]\n }", "function RefreshRectangles()\n{\n clearCanvas();\n var i;\n for(i=0; i<LayerCollection.length; i++)\n {\n LayerCollection[i].RefreshLayer(_drawContext);\n }\n \n if(_selectedRectOverlay != undefined && SelectedRectangle != undefined)\n {\n _selectedRectOverlay.RenderOverlay(_drawContext);\n }\n}", "function dummyRectAlphaSettings() {\n\tcurrent_output_unit_rect_dummy.alpha = detector_rect_dummy.alpha = material_holder_rect_dummy.alpha = polariser_rect_dummy.alpha = emitter_rect_dummy.alpha = 0.01;\n}", "setRect(_rect) {\n if (this.rect) {\n this.rect.releaseView(this);\n }\n if (this.isString(_rect) && this.isFunction(this[_rect])) {\n _rect = this[_rect]();\n }\n if (this.isArray(_rect)) {\n this._setArrayRect(_rect);\n }\n else if (this.isObject(_rect) && _rect.hasAncestor(HRect)) {\n this.rect = _rect;\n }\n if (this.rect) {\n this.rect.bindView(this);\n }\n // this.refresh();\n return this;\n }", "function assertRectsEqual(expected, actual) {\n if (!goog.math.Rect.equals(expected, actual)) {\n assertEquals(expected, actual);\n }\n}", "function adjustByMinSize(viewport,rects,minSize) {\n var smallerCount = 0, // no. of rect which is less then the minSize\n min; // The min rectangle\n \n if (minSize === undefined)\n minSize = {width : 0 , height : 0};\n \n for (var i = 0 ; i < rects.length ;i++) {\n if (rects[i].width < minSize.width ||\n rects[i].height < minSize.height) {\n smallerCount++;\n min = rects[i];\n }\n }\n \n if (smallerCount == 1) { \n\n // Ignore 0 or 2.\n // If the count is 2, it has no way to adjust.\n var dw = minSize.width - min.width,\n dh = minSize.height - min.height;\n if (dw < 0)\n dw = 0;\n if (dh < 0)\n dh = 0;\n \n for (var i = 0 ; i < rects.length ;i++) {\n if (rects[i].width < minSize.width ||\n rects[i].height < minSize.height) {\n \n rects[i].width += dw;\n rects[i].height += dh;\n \n if (i === 1) { // It is on the right / bottom\n rects[i].left -= dw;\n rects[i].top -= dh;\n }\n \n } else {\n rects[i].width -= dw;\n rects[i].height -= dh; \n \n if (i === 1) { // It is on the right / bottom\n rects[i].left += dw;\n rects[i].top += dh;\n }\n }\n }\n }\n\n }", "function OldRectangles(width, height) {\n this.width = width;\n this.height = height;\n}", "function rectSetPath(ctx, rectSet) {\n rectSet.forEach(function(r) {\n ctx.rect(r[0], r[1], r[2], r[3]);\n });\n }", "setRectangle() {\n this.gene = makeRectangle(this.size, this.size - 10);\n }", "function Rect( xmin , ymin , xmax , ymax ) {\n\tvar src = xmin ;\n\n\tthis.xmin = 0 ;\n\tthis.xmax = 0 ;\n\tthis.ymin = 0 ;\n\tthis.ymax = 0 ;\n\tthis.width = 0 ;\n\tthis.height = 0 ;\n\tthis.isNull = true ;\n\n\tif ( src && ( typeof src === 'object' || typeof src === 'function' ) ) {\n\t\tif ( src instanceof termkit.Terminal ) {\n\t\t\tthis.set( {\n\t\t\t\txmin: 1 ,\n\t\t\t\tymin: 1 ,\n\t\t\t\txmax: src.width ,\n\t\t\t\tymax: src.height\n\t\t\t} ) ;\n\t\t}\n\t\telse if ( src instanceof termkit.ScreenBuffer ) {\n\t\t\tthis.set( {\n\t\t\t\txmin: 0 ,\n\t\t\t\tymin: 0 ,\n\t\t\t\txmax: src.width - 1 ,\n\t\t\t\tymax: src.height - 1\n\t\t\t} ) ;\n\t\t}\n\t\telse if ( src instanceof termkit.TextBuffer ) {\n\t\t\tthis.set( {\n\t\t\t\txmin: 0 ,\n\t\t\t\tymin: 0 ,\n\t\t\t\txmax: src.width - 1 ,\n\t\t\t\tymax: src.height - 1\n\t\t\t} ) ;\n\t\t}\n\t\telse if ( src instanceof Rect ) {\n\t\t\tthis.set( src ) ;\n\t\t}\n\t\telse if ( src.xmin !== undefined || src.ymin !== undefined || src.xmax !== undefined || src.ymax !== undefined ) {\n\t\t\tthis.set( {\n\t\t\t\txmin: src.xmin !== undefined ? src.xmin : 0 ,\n\t\t\t\tymin: src.ymin !== undefined ? src.ymin : 0 ,\n\t\t\t\txmax: src.xmax !== undefined ? src.xmax : 1 ,\n\t\t\t\tymax: src.ymax !== undefined ? src.ymax : 1\n\t\t\t} ) ;\n\t\t}\n\t\telse if ( src.x !== undefined || src.y !== undefined || src.width !== undefined || src.height !== undefined ) {\n\t\t\tthis.set( {\n\t\t\t\txmin: src.x !== undefined ? src.x : 0 ,\n\t\t\t\tymin: src.y !== undefined ? src.y : 0 ,\n\t\t\t\txmax: src.width !== undefined ? src.x + src.width - 1 : 1 ,\n\t\t\t\tymax: src.height !== undefined ? src.y + src.height - 1 : 1\n\t\t\t} ) ;\n\t\t}\n\t}\n\telse {\n\t\tthis.set( {\n\t\t\txmin: xmin !== undefined ? xmin : 0 ,\n\t\t\tymin: ymin !== undefined ? ymin : 0 ,\n\t\t\txmax: xmax !== undefined ? xmax : 1 ,\n\t\t\tymax: ymax !== undefined ? ymax : 1\n\t\t} ) ;\n\t}\n}", "set pixelRect(value) {}", "function mergeRectOffsets(rects) {\n return rects.reduce((previousRect, rect) => {\n if (previousRect == null) {\n return rect;\n }\n\n return {\n top: previousRect.top + rect.top,\n left: previousRect.left + rect.left,\n width: previousRect.width,\n height: previousRect.height,\n bottom: previousRect.bottom + rect.bottom,\n right: previousRect.right + rect.right,\n };\n });\n} // Calculate a boundingClientRect for a node relative to boundaryWindow,", "function setupGraphics($scope){\r\n var bbox = $scope.bbox;\r\n $scope.south = bbox[$scope.sub][0][0];\r\n $scope.west = bbox[$scope.sub][0][1];\r\n $scope.north = bbox[$scope.sub][1][0];\r\n $scope.east = bbox[$scope.sub][1][1];\r\n}", "function generateRectangles() {\n \n for (var i = 20; i < 900; i = i + rectangleWidth) {\n\n rectangleHeight = Math.random() * 100;\n rectangleHeight = Math.floor(rectangleHeight);\n \n ctx.rect(i, positionTop, rectangleWidth, rectangleHeight);\n ctx.stroke();\n ctx.fillStyle = 'rgba(255,0,0,0.5)'; \n ctx.fill();\n newArray.push(rectangleHeight);\n arrayLength = newArray.length;\n positionLeft.push(i);\n}\n\n/*function position(newArray[rectangleHeight]) {\n ctx.rect(i, 20, rectangleWidth, rectangleHeight);\n}*/\n\nconsole.log(\"this is the original random array of rectangle heights \" + \"[\" + newArray + \"]\");\nconsole.log(\"this is the original restangles position for rectangles \" + \"[\" + positionLeft + \"]\");\nreturn ;\n}", "function addRect(x, y, w, h, fill,sector,place, line,cell,pricenum) {\n var rect = new Box;\n rect.x = x;\n rect.y = y;\n rect.w = w\n rect.h = h;\n rect.fill = fill;\n rect.sector = sector;\n rect.pricenum = pricenum;\n rect.state = '1';\n rect.line= line;\n rect.cell= cell;\n rect.place=place;\n\n primer[line][cell]=rect; \n invalidate();\n}", "function unionRectangles(rect1, rect2) {\r\n\t\tvar rect = {\r\n\t\t\ttop : (Math.min(rect1.top, rect2.top)),\r\n\t\t\tbottom : (Math.max(rect1.bottom, rect2.bottom)),\r\n\t\t\tleft : (Math.min(rect1.left, rect2.left)),\r\n\t\t\tright : (Math.max(rect1.right, rect2.right))\r\n\t\t}\r\n\t\trect.width = rect.right - rect.left;\r\n\t\trect.height = rect.bottom - rect.top;\r\n\r\n\t\treturn rect;\r\n\t}", "function RectTestSuite() {\n\n this.name = \"Rect\";\n this.tag = \"core\";\n\n var rectEmpty = { x: 0, y: 0, width: 0, height: 0 };\n\n // using a graphics coordinate system (TL is negative, BR is positive):\n\n var pointO = new Seadragon2.Point(0, 0);\n var pointTL = new Seadragon2.Point(-10, -10);\n var pointTR = new Seadragon2.Point(10, -10);\n var pointBL = new Seadragon2.Point(-10, 10);\n var pointBR = new Seadragon2.Point(10, 10);\n var pointQuadTL = new Seadragon2.Point(-5, -5);\n var pointQuadTR = new Seadragon2.Point(5, -5);\n var pointQuadBL = new Seadragon2.Point(-5, 5);\n var pointQuadBR = new Seadragon2.Point(5, 5);\n\n var rectAll = new Seadragon2.Rect(-10, -10, 20, 20);\n var rectMid = new Seadragon2.Rect(-5, -5, 10, 10);\n var rectQuadTL = new Seadragon2.Rect(-10, -10, 10, 10);\n var rectQuadTR = new Seadragon2.Rect(0, -10, 10, 10);\n var rectQuadBL = new Seadragon2.Rect(-10, 0, 10, 10);\n var rectQuadBR = new Seadragon2.Rect(0, 0, 10, 10);\n\n this.constructor0 = function () {\n var r = new Seadragon2.Rect();\n expectObjectsEqual(r, rectEmpty);\n }\n\n this.constructor2 = function () {\n\n function verify (point, size, exp) {\n var r = new Seadragon2.Rect(point, size);\n expectObjectsEqual(r, exp);\n };\n\n verify({ x: 0, y: 0 }, { width: 0, height: 0 }, rectEmpty);\n verify(new Seadragon2.Point(), { width: 0, height: 0 }, rectEmpty);\n verify({ x: 0, y: 0 }, new Seadragon2.Size(), rectEmpty);\n verify(new Seadragon2.Point(), new Seadragon2.Size(), rectEmpty);\n verify({ x: -11, y: -12 }, { width: 22, height: 24 }, { x: -11, y: -12, width: 22, height: 24 });\n verify(new Seadragon2.Point(-11, -12), new Seadragon2.Size(22, 24), { x: -11, y: -12, width: 22, height: 24 });\n }\n\n this.constructor4 = function () {\n\n function verify (x, y, width, height, exp) {\n var r = new Seadragon2.Rect(x, y, width, height);\n expectObjectsEqual(r, exp);\n };\n\n verify(0, 0, 0, 0, rectEmpty);\n verify(-11, -12, 0, 0, { x: -11, y: -12, width: 0, height: 0 });\n verify(-11, -12, 22, 24, { x: -11, y: -12, width: 22, height: 24 });\n }\n\n this.bridge = function () {\n\n function verify (obj) {\n var r = Seadragon2.Rect.$(obj);\n expectTrue(r instanceof Seadragon2.Rect);\n expectObjectsEqual(r, obj);\n };\n\n verify(rectEmpty, rectEmpty);\n verify({ x: 0, y: 0 }, rectEmpty);\n verify({ width: 0, height: 0 }, rectEmpty);\n verify(new Seadragon2.Point(), rectEmpty);\n verify(new Seadragon2.Size(), rectEmpty);\n verify({ x: 1, y: 2 }, { x: 1, y: 2, width: 0, height: 0 });\n verify({ width: 3, height: 4 }, { x: 0, y: 0, width: 3, height: 4 });\n verify({ x: 1, y: 2, width: 3, height: 4 }, { x: 1, y: 2, width: 3, height: 4 });\n verify(new Seadragon2.Rect(1, 2, 3, 4), { x: 1, y: 2, width: 3, height: 4 });\n }\n\n this.contains = function () {\n\n function verify (rect, other) {\n expectTrue(rect.contains(other), rect + \" should contain \" + other);\n };\n\n // Testing rectAll contains all points...\n verify(rectAll, pointO);\n verify(rectAll, pointTL);\n verify(rectAll, pointTR);\n verify(rectAll, pointBL);\n verify(rectAll, pointBR);\n verify(rectAll, pointQuadTL);\n verify(rectAll, pointQuadTR);\n verify(rectAll, pointQuadBL);\n verify(rectAll, pointQuadBR);\n\n // Testing rectAll contains all rects, including itself...\n verify(rectAll, rectAll);\n verify(rectAll, rectMid);\n verify(rectAll, rectQuadTL);\n verify(rectAll, rectQuadTR);\n verify(rectAll, rectQuadBL);\n verify(rectAll, rectQuadBR);\n\n // Testing rects contain their edge and mid points...\n verify(rectMid, pointO);\n verify(rectMid, pointQuadBL);\n verify(rectQuadTL, pointO);\n verify(rectQuadTL, pointQuadTL);\n verify(rectQuadTR, pointTR);\n verify(rectQuadTR, pointQuadTR);\n verify(rectQuadBL, pointBL);\n verify(rectQuadBR, pointQuadBR);\n }\n\n this.containsNot = function () {\n\n function verify (rect, other) {\n expectFalse(rect.contains(other), rect + \" should not contain \" + other);\n };\n\n // Testing rects don't contain outside points...\n verify(rectMid, pointTR);\n verify(rectMid, pointBL);\n verify(rectQuadTL, pointBR);\n verify(rectQuadTR, pointQuadTL);\n verify(rectQuadBL, pointTR);\n verify(rectQuadBR, pointQuadBL);\n\n // Testing quad and mid rects don't contain each other...\n verify(rectMid, rectQuadBL);\n verify(rectQuadTL, rectQuadBR);\n verify(rectQuadTR, rectQuadTL);\n }\n\n this.union = function () {\n\n function verify (rect, other, newRect) {\n expectObjectsEqual(rect.union(other), newRect);\n };\n\n // Testing rectAll union anything is rectAll...\n verify(rectAll, pointO, rectAll);\n verify(rectAll, pointTL, rectAll);\n verify(rectAll, pointQuadBL, rectAll);\n verify(rectAll, rectAll, rectAll);\n verify(rectAll, rectMid, rectAll);\n verify(rectQuadBR, rectAll, rectAll);\n\n // Testing rect union miscellaneous cases...\n verify(rectQuadTL, rectQuadBR, rectAll);\n verify(rectQuadBL, rectQuadTR, rectAll);\n verify(rectQuadTL, rectQuadTR, { x: -10, y: -10, width: 20, height: 10 });\n verify(rectQuadTL, rectQuadBL, { x: -10, y: -10, width: 10, height: 20 });\n verify(rectQuadBR, rectQuadBL, { x: -10, y: 0, width: 20, height: 10 });\n verify(rectQuadBR, rectQuadTR, { x: 0, y: -10, width: 10, height: 20 });\n verify(rectMid, rectQuadTR, { x: -5, y: -10, width: 15, height: 15 });\n verify(rectQuadBL, rectMid, { x: -10, y: -5, width: 15, height: 15 });\n }\n\n this.intersect = function () {\n\n function verify (rect, other, newRect) {\n expectObjectsEqual(rect.intersect(other), newRect);\n };\n\n // Testing rectAll intersect anything is the anything...\n verify(rectAll, pointO, pointO);\n verify(rectAll, pointTL, pointTL);\n verify(rectAll, pointQuadBL, pointQuadBL);\n verify(rectAll, rectAll, rectAll);\n verify(rectMid, rectAll, rectMid);\n verify(rectAll, rectQuadBR, rectQuadBR);\n\n // Testing rect intersection empty and miscellaneous cases...\n verify(rectQuadTL, pointBR, null);\n verify(rectQuadBL, pointQuadTR, null);\n verify(rectQuadTL, rectQuadBR, pointO);\n verify(rectQuadBL, rectQuadTR, pointO);\n verify(rectQuadBR, rectQuadTR, { x: 0, y: 0, width: 10, height: 0 });\n verify(rectQuadTR, rectQuadTL, { x: 0, y: -10, width: 0, height: 10 });\n verify(rectMid, rectQuadTR, { x: 0, y: -5, width: 5, height: 5 });\n verify(rectQuadBL, rectMid, { x: -5, y: 0, width: 5, height: 5 });\n verify(rectMid, rectQuadBR, { x: 0, y: 0, width: 5, height: 5 });\n verify(rectQuadTL, rectMid, { x: -5, y: -5, width: 5, height: 5 });\n }\n\n this.scale1 = function () {\n\n function verify (rect, factor, newRect) {\n expectObjectsEqual(rect.scale(factor), newRect);\n };\n\n verify(rectMid, 1, rectMid);\n verify(rectQuadBL, 1, rectQuadBL);\n verify(rectQuadTL, 2, rectAll);\n verify(rectAll, 0.5, rectQuadTL);\n verify(rectMid, 1.5, rectMid.union(rectQuadBR));\n verify(rectMid.union(rectQuadBR), 2 / 3, rectMid);\n }\n\n this.scale2 = function () {\n\n function verify (rect, factor, point, newRect) {\n expectObjectsEqual(rect.scale(factor, point), newRect);\n };\n\n verify(rectMid, 2, pointO, rectAll);\n verify(rectAll, 0.5, pointO, rectMid);\n verify(rectQuadBR, 2, pointBR, rectAll);\n verify(rectAll, 0.5, pointBR, rectQuadBR);\n verify(rectMid, 1.5, pointQuadBL, rectQuadTR.union(rectMid));\n verify(rectQuadTR.union(rectMid), 2 / 3, pointQuadBL, rectMid);\n }\n\n this.translate = function () {\n\n function verify (rect, point, newRect) {\n expectObjectsEqual(rect.translate(point), newRect);\n };\n\n verify(rectAll, {}, rectAll);\n verify(rectMid, { x: 0, y: 0 }, rectMid);\n verify(rectQuadTL, { x: 10 }, rectQuadTR);\n verify(rectQuadTR, { x: -10 }, rectQuadTL);\n verify(rectQuadTL, { y: 10 }, rectQuadBL);\n verify(rectQuadBL, { y: -10 }, rectQuadTL);\n verify(rectQuadBL, { x: 10, y: -10 }, rectQuadTR);\n verify(rectQuadTR, { x: -10, y: 10 }, rectQuadBL);\n verify(rectMid, { x: 5, y: 5 }, rectQuadBR);\n verify(rectQuadBR, { x: -5, y: -5 }, rectMid);\n }\n}", "updateBounds() {\n this.bounds = getBounds(this);\n }", "reset() {\n this.current = this.unknownFramebuffer;\n this.viewport = new Rectangle_1.Rectangle();\n }", "function resizeRectangle(canvas, event, pos) {\n rightCorner = getCanvasMousePosition(canvas, event)\n panels[whichPanel][pos].width = rightCorner.x - panels[whichPanel][pos].x\n panels[whichPanel][pos].height = rightCorner.y - panels[whichPanel][pos].y\n\n //Call to panel function that resizes browser view\n changePanelDims(panels[whichPanel][pos].x, panels[whichPanel][pos].y, panels[whichPanel][pos].width, panels[whichPanel][pos].height, panels[whichPanel][pos].viewNum)\n\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n for(i = 0; i < panels[whichPanel].length; i++)\n {\n ctx.beginPath()\n ctx.rect(panels[whichPanel][i].x, panels[whichPanel][i].y, panels[whichPanel][i].width, panels[whichPanel][i].height)\n ctx.stroke()\n ctx.closePath()\n }\n bottomBar(barNum)\n}", "function updateRect(rect) {\n rect.attr('x', function (d) {\n // if at the edge, adjust for stroke width\n var val = x(d[0]);\n if (val === xMin) {\n return val - strokeWidthClipAdjustment;\n }\n return val;\n }).attr('width', function (d) {\n // if at the edge, adjust for stroke width to prevent clipping it\n var valMin = x(d[0]);\n var valMax = x(d[d.length - 1]);\n if (valMin === xMin) {\n valMin -= strokeWidthClipAdjustment;\n }\n if (valMax === xMax) {\n valMax += strokeWidthClipAdjustment;\n }\n\n return valMax - valMin;\n }).attr('y', clipRectY).attr('height', clipRectHeight);\n }", "function resetShapes() {\n\tvar scale;\n\n\tselectedItem1 = -1;\n\tselectedItem2 = -1;\n\t\n\tshapeOrder = [];\n\t\n\tfor (var i=0; i<items.length; i++) {\n\t\titems[i].currLocID = items[i].startLocID;\n\t\titems[i].x = locations[items[i].currLocID].x;\n\t\titems[i].y = locations[items[i].currLocID].y;\n\t\titems[i].targetLocID = -1;\n\t}\n\n\t\n\tfor (i=0; i<shapes.length; i++) {\n\t\tshapeOrder[i] = i;\n\t\t\n\t\tshapes[i].active = shapes[i].defaultActive;\n\t}\n\t\n\n\tfor (i=0; i<items.length; i++) {\n\t\tif (shapes[items[i].id].active) {\n\t\t\titems[i].scale = scaleNormal;\n\t\t} else {\n\t\t\titems[i].scale = scaleDisabled;\n\t\t}\n\t}\n\t\n\tfor (i=0; i<maps.length; i++) {\n\t\tmaps[i].visible = maps[i].defaultVisible;\n\t}\n\n\tif (leyLineMode) {\n\t\tupdateLines = true;\n\t\trebuildLines();\n\t} else {\t\t\n\t\tlines = [];\n\t}\n}", "_updateBoundingRect() {\n this._elBoundingRect = this.$el.getBoundingClientRect();\n\n // this has been introduced in 6c8234bb83d2df3e56f1b21a0caea4e4ef657eb4 and\n // breaks a lot of things... respecify the behavior when\n // normalizeCoordinates === false, because is not related to the given\n // element (this.$el) as implemented.\n // (the only app that depends on this option is probably coloop, so check it)\n // this._elBoundingRect = {\n // top: 0,\n // bottom: 0,\n // left: 0,\n // right: 0,\n // width: window.innerWidth,\n // height: window.innerHeight,\n // };\n }", "function updateRectLike(item, x, y, width, height) {\n xy2shape(item, \"x\", x, \"y\", y);\n item.setAttributeNS(null, \"width\", width);\n item.setAttributeNS(null, \"height\", height);\n }", "function unionRectangles(rect1, rect2) {\n var rect = {\n top: (Math.min(rect1.top, rect2.top)),\n bottom: (Math.max(rect1.bottom, rect2.bottom)),\n left: (Math.min(rect1.left, rect2.left)),\n right: (Math.max(rect1.right, rect2.right))\n }\n rect.width = rect.right - rect.left;\n rect.height = rect.bottom - rect.top;\n\n return rect;\n }", "function makeRect() { //makes rectangle test\n\tctx.fillRect( 50, 50, 100, 200);\n}", "function addMoreRects() {\n for (let i = 0; i < AMOUNT; i++) {\n rects[i].float();\n rects[i].display();\n rects[i].collisionDetection();\n }\n}", "function setBounds() {\n let el = angular.element(canvas);\n\n //set initial style\n if ( scope.options.layout.height === \"inherit\" ) {\n let viewHeight = view.getHeight();\n el.css(\"height\", `${viewHeight}px`);\n el.attr(\"height\", `${viewHeight * view.scale}px`);\n } else {\n el.css(\"height\", `${scope.options.layout.height}px`);\n el.attr(\"height\", `${scope.options.layout.height * view.scale}px`);\n }\n //set initial style\n if ( scope.options.layout.width === \"inherit\" ) {\n let viewWidth = view.getWidth();\n el.css(\"width\", `${viewWidth}px`);\n el.attr(\"width\", `${viewWidth * view.scale}px`);\n } else {\n el.css(\"width\", `${scope.options.layout.width}px`);\n el.attr(\"width\", `${scope.options.layout.width * view.scale}px`);\n }\n }", "drawRect(canvas, rect, pan) {\n\n canvas.on(\"mouse:down\", function(o) {\n\n Config.RECTMENUE.classList.add(\"hide\");\n\n pointer = canvas.getPointer(o.e);\n\n if (selectedColor) { color = selectedColor; }\n if (rect.getType() === \"withBorder\") {\n fill = \"transparent\";\n stroke = 3;\n } else if (rect.getType() === \"filled\") {\n fill =\n color;\n stroke = 0;\n }\n\n isDown = true;\n origX = pointer.x;\n origY = pointer.y;\n\n rectangle = new fabric.Rect({\n left: origX,\n top: origY,\n fill: fill,\n stroke: color,\n strokeWidth: stroke,\n });\n canvas.add(rectangle);\n });\n\n canvas.on(\"mouse:move\", function(o) {\n\n if (!isDown) {return;}\n pointer = canvas.getPointer(o.e);\n if (origX > pointer.x) {\n rectangle.set({ left: Math.abs(pointer.x) });\n }\n if (origY > pointer.y) {\n rectangle.set({ top: Math.abs(pointer.y) });\n }\n rectangle.set({ width: Math.abs(origX - pointer.x) });\n rectangle.set({ height: Math.abs(origY - pointer.y) });\n canvas.renderAll();\n });\n\n canvas.on(\"mouse:up\", function(o) {\n isDown = false;\n canvas.off(\"mouse:down\");\n pan.enablePan(canvas);\n canvas.fire(\"object:modified\", { target: rectangle });\n });\n\n }", "function clearBoardRect() {\n wordsAroundNewLetter.length = 0;\n usedRectArray.length = 0;\n m.clear();\n for(j = 0; j < filledBoardRect.length; j++){\n mod = (filledBoardRect[j] % 15);\n qut = Math.floor(filledBoardRect[j] / 15);\n\n if (mod === 0) {\n x = 14 * rectLength + 5;\n y = (qut - 1) * rectBreadth + 210;\n emptyBoardRect(x, y);\n if (filledBoardRect[j] in multiplier) {\n var rectType = multiplier[filledBoardRect[j]];\n if (rectType === '2xLS') {\n ls2(x, y);\n }\n else if (rectType === '3xWS'){\n ws3(x, y)\n }\n }\n }\n else {\n x = (mod - 1) * rectLength + 5;\n y = qut * rectBreadth + 210\n emptyBoardRect(x, y);\n if (filledBoardRect[j] in multiplier) {\n var rectType = multiplier[filledBoardRect[j]];\n if (rectType === '2xLS') {\n ls2(x, y);\n }\n else if (rectType === '3xLS'){\n ls3(x, y)\n }\n else if (rectType === '2xWS'){\n ws2(x, y)\n }\n else if (rectType === '3xWS'){\n ws3(x, y)\n }\n else if (rectType === 'star'){\n getStar(x, y)\n }\n }\n }\n }\n filledBoardRect.length = 0;\n word.length = 0;\n selectLetter = null;\n wordss.length = 0;\n rackPreviousState();\n}", "function addRect(){\n\t\t\tvar newRect = new fabric.Rect({\n top : 70,\n left : 100,\n width : 200,\n height : 200,\n fill : 'rgb(200,200,200)'\n\t\t\t});\n\t\t\tcanvas.add(newRect).setActiveObject(newRect);\n\t\t\tselectObjParam();\n\t\t\tcanvas.renderAll();\n\t\n\t\t}", "updateSecondaryValues(_noSize) {\n\n // this._updateFlexibleDimensions();\n\n /**\n * isValid is true if the Rect's right side is greater than or equal to its left\n * and its bottom is greater than or equal to its top, and false otherwise.\n * An invalid rectangle can't be used to define an interface area (such as\n * the frame of a view or window).\n **/\n this.isValid = this.right >= this.left && this.bottom >= this.top;\n\n /**\n *\n * The Point-returning functions return the coordinates of one of the\n * rectangle's four corners.\n **/\n this.leftTop = new HPoint(this.left, this.top);\n this.leftBottom = new HPoint(this.left, this.bottom);\n this.rightTop = new HPoint(this.right, this.top);\n this.rightBottom = new HPoint(this.right, this.bottom);\n\n /**\n * The width and height of a Rect's rectangle, as returned through these\n * properties.\n **/\n if (!_noSize) {\n this.width = (this.right - this.left);\n this.height = (this.bottom - this.top);\n }\n this.position = [this.left, this.top];\n this.size = [this.width, this.height];\n return this;\n }", "function updateDrawSelectionRectangle(x, y, w, h) {\r\n d3.selectAll(\".selection\")\r\n .attr(\"x\", x)\r\n .attr(\"y\", y)\r\n .attr(\"width\", w)\r\n .attr(\"height\", h);\r\n return;\r\n}", "set rectValue(value) {}", "function Rectangles(sideA, sideB){\n this.sideA = sideA\n this.sideB = sideB\n}", "function resizeBoxDraw(){\n state.boxArr.forEach(function(el){\n ctx.fillStyle = el.resizeStyle;\n ctx.fillRect(el.resize.top.x, el.resize.top.y, el.resize.top.w, el.resize.top.h)\n // ctx.fillRect(el.resize.bottom.x, el.resize.bottom.y, el.resize.bottom.w, el.resize.bottom.h)\n // ctx.fillRect(el.resize.left.x, el.resize.left.y, el.resize.left.w, el.resize.left.h)\n ctx.fillRect(el.resize.right.x, el.resize.right.y, el.resize.right.w, el.resize.right.h) \n })\n \n }", "refreshRect() {\n\t\tvar posX = this.savedPosX + this.offsetX;\n\t\tvar posY = this.savedPosY + this.offsetY;\n\t\tvar sizeX = this.savedSizeX;\n\t\tvar sizeY = this.savedSizeY;\n\t\t\n\t\t// Calculate actual position and scale\n\t\tvar scale = renko.getWindowScale() * (2 / window.devicePixelRatio);\n\t\tposX = posX - sizeX/2 + renko.appWidth/2;\n\t\tposY = posY - sizeY/2 + renko.appHeight/2;\n\t\tposX *= scale;\n\t\tposY *= scale;\n\t\tsizeX *= scale;\n\t\tsizeY *= scale;\n\t\t\n\t\t// Apply transform\n\t\tthis.style.left = String(posX) + \"px\";\n\t\tthis.style.top = String(posY) + \"px\";\n\t\tthis.style.width = String(sizeX) + \"px\";\n\t\tthis.style.height = String(sizeY) + \"px\";\n\t}", "function set_edges() {\n\n dragrect.style(\"stroke\", \"black\");\n\n // Edging goes top, right, bottom, left\n // As a rectangle has 4 sides, there are 2^4 = 16 cases to handle.\n\n\n var numRepeats = Math.floor(rect_geom.width / 4);\n var gap = rect_geom.width - 4 * numRepeats;\n var edge = \"2,2,\".repeat(numRepeats) + gap + \",0\";\n\n var dashArray = \"\";\n\n if (rect_geom.top_fixed){\n dashArray += edge;\n } else {\n dashArray += \"0,\" + rect_geom.width;\n }\n\n if (rect_geom.right_fixed){\n dashArray += \",\" + rect_geom.height + \",0\";\n } else {\n dashArray += \",\" + \"0,\" + rect_geom.height;\n }\n\n if (rect_geom.bottom_fixed){\n dashArray += \",\" + edge;\n } else {\n dashArray += \",\" + \"0,\" + rect_geom.width;\n }\n\n if (rect_geom.left_fixed){\n dashArray += \",\" + rect_geom.height + \",0\";\n } else {\n dashArray += \",\" + \"0,\" + rect_geom.height;\n }\n\n dragrect.style(\"stroke-dasharray\", dashArray);\n common_geom.update_formula();\n }", "function updateRect(rect) {\n myTransition(rect)\n // Each fruit will keep the same color as its score changes.\n .attr('fill', d => colorScale(d.colorIndex))\n .attr('width', barWidth - barPadding * 2)\n .attr('height', d => usableHeight - yScale(d.score))\n .attr('x', barPadding)\n .attr('y', d => TOP_PADDING + yScale(d.score));\n}", "function BoundingBox(rects) {\n this.rects = rects;\n}", "function adjust_everything(update_description){\n // We rely on: rect_geom.width, rect_geom.height, , common_geom.h\n\n var axis_height = subplot_geom.yScale.range()[1];\n if (timing_parent_bar){\n axis_height += (timing_parent_bar.subplot.yOffset - subplot_geom.yOffset );\n }\n rect_geom.rail_height = axis_height + (rect_geom.physicalLevel-1) * common_geom.track_padding;\n\n if (parseInt(subplot_geom.svg.attr(\"height\")) < rect_geom.rail_height + common_geom.vertical_padding){\n subplot_geom.svg.attr(\"height\", rect_geom.rail_height + common_geom.vertical_padding)\n }\n\n // convenience quanities (redundant)\n rect_geom.delay_line_length = rect_geom.start_time_pos - rect_geom.track_circle_pos;\n\n rect_geom.delay_line_height = rect_geom.rect_top+rect_geom.height;\n\n // move things\n dragbarright.attr(\"cx\", rect_geom.start_time_pos + rect_geom.width)\n .attr(\"cy\", rect_geom.rect_top + rect_geom.height/2);\n\n dragbartop.attr(\"cx\", rect_geom.start_time_pos + (rect_geom.width / 2))\n .attr(\"cy\", rect_geom.rect_top);\n\n dragbarbottom.attr(\"cx\", rect_geom.start_time_pos + (rect_geom.width / 2))\n .attr(\"cy\", rect_geom.rect_top + rect_geom.height);\n\n dragrect\n .attr(\"x\", rect_geom.start_time_pos)\n .attr(\"y\", rect_geom.rect_top)\n .attr(\"height\", rect_geom.height)\n .attr(\"width\", Math.max(rect_geom.width,1));\n\n delay_line\n .attr(\"x1\", rect_geom.track_circle_pos)\n .attr(\"x2\", rect_geom.start_time_pos)\n .attr(\"y1\", rect_geom.delay_line_height)\n .attr(\"y2\", rect_geom.delay_line_height);\n\n startline.attr(\"x1\", rect_geom.track_circle_pos)\n .attr(\"x2\", rect_geom.track_circle_pos)\n .attr(\"y1\", rect_geom.delay_line_height)\n .attr(\"y2\", rect_geom.rail_height)\n .style(\"visibility\", (rect_geom.startTimeIsBound && !rect_geom.following) ? 'visible' : 'hidden');\n\n endline.attr(\"x1\", rect_geom.track_circle_pos + rect_geom.width)\n .attr(\"x2\", rect_geom.track_circle_pos + rect_geom.width)\n .attr(\"y1\", rect_geom.delay_line_height)\n .attr(\"y2\", rect_geom.rail_height)\n .style(\"visibility\", rect_geom.endTimeIsBound ? 'visible' : 'hidden');\n\n track_circle.attr(\"cx\", rect_geom.track_circle_pos)\n .attr(\"cy\", rect_geom.rail_height)\n .style(\"visibility\", (rect_geom.startTimeIsBound && !rect_geom.following) ? 'visible' : 'hidden');\n\n end_circle.attr(\"cx\", rect_geom.track_circle_pos + rect_geom.width)\n .attr(\"cy\", rect_geom.rail_height)\n .style(\"visibility\", rect_geom.endTimeIsBound ? 'visible' : 'hidden')\n .style(\"visibility\", rect_geom.endTimeIsBound ? 'visible' : 'hidden');\n\n rect_label\n .attr(\"x\", rect_geom.start_time_pos)\n .attr(\"y\", rect_geom.rect_top - 10)\n .style(\"visibility\", common_geom.allow_logic ? \"visible\" : \"hidden\")\n .text(subplot_geom.base_variable_name + rect_geom.rectangleIndex);\n\n if (timing_parent_bar){\n // may need to shift time bars vertically\n timing_parent_bar.adjust_everything();\n }\n\n if (update_description){\n common_geom.update_formula();\n }\n set_edges();\n }", "function testDrawRect() \n{\n\tvar c=document.getElementById(\"mainCanvas\");\n\tvar ctx=c.getContext(\"2d\");\n\tctx.fillStyle=\"#FF0000\";\n\tctx.fillRect(0,0,150,75);\n}", "function addRects() {\n for (var i = 0; i < rectsPerSpawn; i++) { //generates 10,000 rectangles, one at a time\n if (rectangleList.length < 10000) {\n var rec = new randomRectangle(); //create new rect object\n\n rectangleList.push(rec); //push to the list\n rec.init(); //initialize the rectangle object\n songPlayed.play(); //play the song on spawn\n } else if (rectangleList.length == 10000) { //if the list hits 10,000\n rectangleList.splice();\n rec = new randomRectangle(); //make more rectangles\n //\"never-ending feeling\"\n rectangleList.push(rec);\n rec.init();\n }\n }\n }", "_updateFlexibleRects() {\n this.__views.forEach(_view => {\n if (_view && (_view.flexRight || _view.flexBottom)) {\n _view.rect._updateFlexibleDimensions();\n }\n });\n }", "function setBoundingBox() {\r\n that.x1P = board.widthP - 1;\r\n that.y1P = board.heightP - 1;\r\n that.x2P = that.y2P = 0;\r\n for (var i in that.pieces) {\r\n piece = that.pieces[i];\r\n that.x1P = Math.min(that.x1P, piece.xP);\r\n that.x2P = Math.max(that.x2P, piece.xP + piece.widthP - 1);\r\n that.y1P = Math.min(that.y1P, piece.yP);\r\n that.y2P = Math.max(that.y2P, piece.yP + piece.heightP - 1);\r\n }\r\n that.xP = that.x1P;\r\n that.yP = that.y1P;\r\n that.widthP = that.x2P - that.x1P + 1;\r\n that.heightP = that.y2P - that.y1P + 1;\r\n }", "function setRect(node, // @param Node:\r\n rect) { // @param Hash: { x, y, w, h }\r\n // Number: x, y, w, h\r\n var s = node.style;\r\n\r\n if (_ua.ie || _ua.opera) {\r\n if (\"x\" in rect) { s.pixelLeft = rect.x; }\r\n if (\"y\" in rect) { s.pixelTop = rect.y; }\r\n if (\"w\" in rect) { s.pixelWidth = rect.w > 0 ? rect.w : 0; }\r\n if (\"h\" in rect) { s.pixelHeight = rect.h > 0 ? rect.h : 0; }\r\n } else {\r\n if (\"x\" in rect) { s.left = rect.x + \"px\"; }\r\n if (\"y\" in rect) { s.top = rect.y + \"px\"; }\r\n if (\"w\" in rect) { s.width = (rect.w > 0 ? rect.w : 0) + \"px\"; }\r\n if (\"h\" in rect) { s.height = (rect.h > 0 ? rect.h : 0) + \"px\"; }\r\n }\r\n}", "function updateShapes() {\n\trebuildLines();\t\n}", "function draw_bounding_box(canvas_variables, vs) {\n const ctx = canvas_variables[1];\n ctx.fillStyle = 'red';\n ctx.beginPath();\n ctx.moveTo(vs[0].x, vs[0].y);\n ctx.lineTo(vs[1].x, vs[1].y);\n ctx.lineTo(vs[2].x, vs[2].y);\n ctx.lineTo(vs[3].x, vs[3].y);\n ctx.lineTo(vs[0].x, vs[0].y);\n ctx.fill();\n}", "function copyRect(rect) {\r\n return {\r\n left: rect.left,\r\n right: rect.right,\r\n top: rect.top,\r\n bottom: rect.bottom\r\n };\r\n}", "function build_rect(rect_params, long, short, long_pos, short_pos) {\n return {\n [rect_params['long_dim']]: long,\n [rect_params['short_dim']]: short,\n [pos_dim[rect_params['long_dim']]]: long_pos,\n [pos_dim[rect_params['short_dim']]]: short_pos\n };\n}", "function drawRect(svgContainer, x, y, baseSize, base, type) {\n if (type == 0) {\n base = baseOp[base];\n y = y + baseSize + 5;\n }\n svgContainer.append(\"rect\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .attr(\"width\", baseSize)\n .attr(\"height\", baseSize)\n .attr(\"fill\", colorRange[base])\n .on(\"mouseover\", function () {\n d3.select(this).style('fill', \"yellow\")\n })\n .on(\"mouseout\", function () {\n d3.select(this).transition().duration(200).style('fill', colorRange[base])\n });\n}", "_setCoordinates() {\n this._bounds = [];\n this._coordinates = this._convertCoordinates(this._coordinates);\n\n this._projectedBounds = [];\n this._projectedCoordinates = this._projectCoordinates();\n\n this._center = this._coordinates;\n }", "function Rectangles( aside, heihgt){\n this.aside = aside;\n this.heihgt = heihgt;\n}", "function normalizeRect(rect) {\n\t return BoundingRect.create(rect);\n\t}", "function setMasks(){\n var maskG = d3.select(_canvas).select('g.masks');\n var masks = maskG.selectAll('rect.mask')\n .data(_pixelLayers, function(p){ return p.uuid(); });\n\n // ENTER\n masks.enter()\n .append('svg:rect')\n .attr('id', function(p){ return \"mask-\" + p.uuid(); })\n .classed('mask', true);\n\n // UPDATE + ENTER\n masks\n .attr('x', function(p){ return p.x(); })\n .attr('y', function(p){ return p.y(); })\n .attr('width', function(p){ return p.width(); })\n .attr('height', function(p){ return p.height() + 20; })\n .attr('fill', \"black\");\n \n masks.exit().remove();\n }", "function ResetCanvas()\n{\n if(_horizScrollVisible)\n {\n var currentLeft = _horizThumb.style.left;\n var newLeft = 0;\n newLeft = Number(currentLeft.substr(0,currentLeft.length-2));\n MoveHorizontalThumb((-newLeft));\n }\n \n if(_verticalScrollVisible)\n {\n var currentTop = _verticalThumb.style.top;\n var newTop = 0;\n newTop = Number(currentTop.substr(0,currentTop.length-2));\n MoveVerticalThumb((-newTop));\n }\n\n LayerCollection = [];\n SelectedRectangle = undefined;\n CurrentLayer = undefined;\n _selectedRectOverlay = undefined;\n InitLayers();\n RefreshPropertyControls();\n RefreshRectangles();\n}", "_renderRects(dataset) {\n let perc_so_far = 0;\n\n this._rects = this._groups\n .selectAll(\"rect\")\n .data((d, i) => {\n return [dataset[i]];\n })\n .enter()\n .append(\"rect\")\n .attr(\"y\", 0)\n .attr(\"x\", d => {\n const prev_perc = perc_so_far;\n const this_perc = 100 * (d / 100);\n perc_so_far = perc_so_far + this_perc;\n return prev_perc + \"%\";\n })\n .attr(\"width\", d => `${d}%`)\n .attr(\"height\", 30);\n }", "function moveRectangle(canvas, event, pos) {\n leftCorner = getCanvasMousePosition(canvas, event)\n panels[whichPanel][pos].x = leftCorner.x\n panels[whichPanel][pos].y = leftCorner.y\n\n //Call to panel function that moves the browser view\n changePanelDims(panels[whichPanel][pos].x, panels[whichPanel][pos].y, panels[whichPanel][pos].width, panels[whichPanel][pos].height, panels[whichPanel][pos].viewNum)\n\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n for(i = 0; i < panels[whichPanel].length; i++)\n {\n ctx.beginPath()\n ctx.rect(panels[whichPanel][i].x, panels[whichPanel][i].y, panels[whichPanel][i].width, panels[whichPanel][i].height)\n ctx.stroke()\n ctx.closePath()\n }\n bottomBar(barNum)\n}", "function clear_rectangles(map_id, layer_id){\n for (i = 0; i < window[map_id + 'googleRectangles' + layer_id].length; i++){\n window[map_id + 'googleRectangles' + layer_id][i].setMap(null);\n }\n window[map_id + 'googleRectangles' + layer_id] = null;\n}", "function BoundingBoxRect() { }", "function setViewRect( x,y,w,h )\n {\n this.viewRect = new Rect( x,y,w,h );\n this._width = w;\n this._height = h;\n if( this.canvas != null ){\n\n this.canvas.width = this.viewRect.w;\n this.canvas.height = this.viewRect.h;\n }\n this.setView(this.latitude, this.longitude, this.zoom );\n }", "constructor(centerX,\n centerY,\n length,\n tolerance,\n draw_test,\n color_bg_supplier,\n color_fg_supplier,\n base_height,\n thickness){\n super();\n this.centerX = centerX;\n this.centerY = centerY;\n this.length = length;\n this.color_bg_supplier = color_bg_supplier;\n this.color_fg_supplier = color_fg_supplier;\n this.base_height = base_height;\n // angle from the center to the top corners of the rectangle\n this.delta_top = Math.atan(thickness/(2*length));\n // angle from the center to the bottom corners of the rectangle\n this.delta_base = Math.atan(thickness/(2*base_height));\n // the radius that the bottom corners of the rectangle move through\n this.vertex_radius_base = Math.sqrt( (thickness*thickness/4) + base_height * base_height);\n // the radius that the top corners of the rectangle move through\n this.vertex_radius_top = Math.sqrt( (thickness*thickness/4) + length * length);\n // last records the last plotted values (so we don't have to keep recalculating\n this.last_x1 = centerX;\n this.last_y1 = centerY;\n this.last_x2 = centerX;\n this.last_y2 = centerY;\n this.last_x3 = centerX;\n this.last_y3 = centerY;\n this.last_x4 = centerX;\n this.last_y4 = centerY;\n // The change in angle from the last plotted angle before we actually redraw\n this.tolerance = tolerance;\n // predicate test that is called if the hand is not going to redraw to see\n // if there is an externally defined reason for redrawing (like another hand)\n this.draw_test = draw_test;\n this.angle = -1;\n this.last_draw_time = null;\n }", "function put_rect(rect, max_width){\r\n line.push(rect);\r\n\r\n var parent = undefined;\r\n\r\n for (var i = 0; i < line.length; i++){\r\n if ((line[i].space_left >= rect.height) && (line[i].x + line[i].width + rect.width + applyPacking.PADDING - max_width) <= applyPacking.FLOAT_EPSILON){\r\n parent = line[i];\r\n break;\r\n }\r\n }\r\n\r\n if (parent !== undefined){\r\n rect.x = parent.x + parent.width + applyPacking.PADDING;\r\n rect.y = parent.bottom;\r\n rect.space_left = rect.height;\r\n rect.bottom = rect.y;\r\n parent.space_left -= rect.height + applyPacking.PADDING;\r\n parent.bottom += rect.height + applyPacking.PADDING;\r\n } else {\r\n rect.y = global_bottom;\r\n global_bottom += rect.height + applyPacking.PADDING;\r\n rect.x = init_x;\r\n rect.bottom = rect.y;\r\n rect.space_left = rect.height;\r\n }\r\n\r\n if (rect.y + rect.height - real_height > -applyPacking.FLOAT_EPSILON) real_height = rect.y + rect.height - init_y;\r\n if (rect.x + rect.width - real_width > -applyPacking.FLOAT_EPSILON) real_width = rect.x + rect.width - init_x;\r\n }", "function smallRect (xVal, yVal, red, green, blue) {\n\tfill(red, green, blue);\n\trect(xVal, yVal, 60, 150);\n}", "async _handleRect() {\n\n const sendFbUpdate = this._rects;\n this._processingFrame = true;\n\n while (this._rects) {\n\n await this._socketBuffer.waitBytes(12, 'Rect begin');\n const rect = {};\n rect.x = this._socketBuffer.readUInt16BE();\n rect.y = this._socketBuffer.readUInt16BE();\n rect.width = this._socketBuffer.readUInt16BE();\n rect.height = this._socketBuffer.readUInt16BE();\n rect.encoding = this._socketBuffer.readInt32BE();\n\n if (rect.encoding === encodings.pseudoQemuAudio) {\n this.sendAudio(true);\n this.sendAudioConfig(this._audioChannels, this._audioFrequency);//todo: future: setFrequency(...) to update mid thing\n } else if (rect.encoding === encodings.pseudoQemuPointerMotionChange) {\n this._relativePointer = rect.x == 0;\n } else if (rect.encoding === encodings.pseudoCursor) {\n const dataSize = rect.width * rect.height * (this.pixelFormat.bitsPerPixel / 8);\n const bitmaskSize = Math.floor((rect.width + 7) / 8) * rect.height;\n this._cursor.width = rect.width;\n this._cursor.height = rect.height;\n this._cursor.x = rect.x;\n this._cursor.y = rect.y;\n this._cursor.cursorPixels = this._socketBuffer.readNBytesOffset(dataSize);\n this._cursor.bitmask = this._socketBuffer.readNBytesOffset(bitmaskSize);\n rect.data = Buffer.concat([this._cursor.cursorPixels, this._cursor.bitmask]);\n } else if (rect.encoding === encodings.pseudoDesktopSize) {\n this._log('Frame Buffer size change requested by the server', true);\n this.clientHeight = rect.height;\n this.clientWidth = rect.width;\n this.updateFbSize();\n this.emit('desktopSizeChanged', {width: this.clientWidth, height: this.clientHeight});\n } else if (this._decoders[rect.encoding]) {\n await this._decoders[rect.encoding].decode(rect, this.fb, this.pixelFormat.bitsPerPixel, this._colorMap, this.clientWidth, this.clientHeight, this._socketBuffer, this.pixelFormat.depth, this.pixelFormat.redShift, this.pixelFormat.greenShift, this.pixelFormat.blueShift);\n } else {\n this._log('Non supported update received. Encoding: ' + rect.encoding);\n }\n this._rects--;\n this.emit('rectProcessed', rect);\n //\n // if (!this._rects) {\n // this._socketBuffer.flush(true);\n // }\n\n }\n\n if (sendFbUpdate) {\n if (!this._firstFrameReceived) {\n this._firstFrameReceived = true;\n this.emit('firstFrameUpdate', this.fb);\n }\n this._log('Frame buffer updated.', true, 2);\n this.emit('frameUpdated', this.fb);\n }\n\n this._processingFrame = false;\n\n if (this._fps === 0) {\n // If FPS is not set, request a new update as soon as the last received has been processed\n this.requestFrameUpdate();\n }\n\n }", "function checkRect(entry, expected, description=\"\") {\n assert_equals(entry.intersectionRect.left, expected[0],\n 'left of rect ' + description);\n assert_equals(entry.intersectionRect.right, expected[1],\n 'right of rect ' + description);\n assert_equals(entry.intersectionRect.top, expected[2],\n 'top of rect ' + description);\n assert_equals(entry.intersectionRect.bottom, expected[3],\n 'bottom of rect ' + description);\n}", "function drawBoxes(boxes) {\n progressMessage.setProgressMessage(\"draw bounding boxes\");\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }\n}", "function buildsRect8BasePoints()\n {\n // rectangle points\n if (appstate.showRectPts) {\n\t //constructPts(dr.leftPts, baseMax, \"inscribed tofill\", sconf.FINEPTS_RADIUS);\n\t constructPts(dr.leftPts, baseMax, \"inscribed\", sconf.FINEPTS_RADIUS);\n\t constructPts(dr.righPts, baseMax, \"circumscribed\", sconf.FINEPTS_RADIUS);\n\t constructPts(dr.curvPts, baseMax, \"figure\", sconf.FINEPTS_RADIUS);\n }\n constructBasePts_dom(appstate.showRectPts, dr.basePts);\n }", "function Rect(x, y, w, h, color, lineWidth) {\r\n this.type = \"Rect\";\r\n this.x = x;\r\n this.y = y;\r\n this.w = w;\r\n this.h = h;\r\n this.color = color;\r\n this.lineWidth = lineWidth;\r\n this.isSelected = false;\r\n }", "get rects() {\n return this.layers\n .filter(layer => layer.active)\n .map(layer => this.getLayerRects(layer)).reduce((cur, prev) => {\n return prev.concat(cur);\n }, []);\n }", "function drawRect(gRect, w, h, x, y) { gRect.append(\"rect\").attr(\"fill\", \"red\").attr(\"width\", w).attr(\"height\", h).attr(\"x\", x).attr(\"y\", y); }", "function addRect(canvasObject, x, y, w, h, note, fill) {\n\t var rect = new Box2;\n\t rect.x = x;\n\t rect.y = y;\n\t rect.w = w\n\t rect.h = h;\n\t rect.note = note;\n\t rect.fill = fill;\n\t canvasObject.boxes2.push(rect);\n\t invalidate(canvasObject);\n\t}", "function adjustFaceWrap() {\n const ratioWidth = displayImage.width() / image.width;\n const ratioHeight = displayImage.height() / image.height;\n\n $rects.map(function (i) {\n const { origRectWidth, origRectHeight, origRectTop, origRectLeft, statPosition, statBlock } = $origRectSpecs[i];\n jQuery(this).css({\n \"width\": `${origRectWidth * ratioWidth}px`,\n \"height\": `${origRectHeight * ratioHeight}px`,\n \"top\": `${origRectTop * ratioHeight}px`,\n \"left\": `${origRectLeft * ratioWidth}px`\n });\n\n if (statBlock) {\n jQuery(statBlock).css({\n \"top\": `${statPosition.origStatTop * ratioHeight}px`,\n \"left\": `${statPosition.origStatLeft * ratioWidth}px`\n });\n }\n })\n }", "static unionRect(b1, b2) {\n\t\tvar x = Math.min(b1.x, b2.x);\n\t\tvar y = Math.min(b1.y, b2.y);\n\t\tvar width = Math.max(b1.x + b1.width, b2.x + b2.width) - x;\n\t\tvar height = Math.max(b1.y + b1.height, b2.y + b2.height) - y;\n\t\treturn {\n\t\t\tx: x,\n\t\t\ty: y,\n\t\t\twidth: width,\n\t\t\theight: height\n\t\t};\n\t}", "function rectSetDraw(ctx, rectSet) {\n // First, draw the shadow.\n ctx.save();\n ctx.beginPath();\n ctx.translate(6, 6);\n rectSetPath(ctx, rectSet);\n ctx.globalAlpha = 0.2;\n ctx.fillStyle = 'black';\n ctx.fill();\n ctx.restore();\n\n // Now for the actual rectangle. We draw it in a blue color to make\n // it stand out from the white background.\n ctx.beginPath();\n rectSetPath(ctx, rectSet);\n ctx.fillStyle = '#ddddff';\n ctx.fill();\n ctx.lineWidth = 2;\n ctx.stroke();\n }", "function SetExpectPositions() \n{\n\tif (GetMyTeam() == TEAM_1) {\n\t\tarrExpectPos.push(new Position(5, 1)); //border\n\t\tarrExpectPos.push(new Position(7, 7)); //center\n\t\tarrExpectPos.push(new Position(7, 14)); //center\n\t\tarrExpectPos.push(new Position(5, 20)); //border\n\t}\n\telse if (GetMyTeam() == TEAM_2) {\n\t\tarrExpectPos.push(new Position(16, 1)); //border\n\t\tarrExpectPos.push(new Position(14, 7)); //center\n\t\tarrExpectPos.push(new Position(14, 14)); //center\n\t\tarrExpectPos.push(new Position(16, 20)); //border\n\t}\n}", "function setRectangle(gl, x, y, width, height) {\n var x1 = x;\n var x2 = x + width;\n var y1 = y;\n var y2 = y + height;\n\n // Drawing related to the canvas size\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([x1, y1, x2, y1, x1,\n y2, x1, y2, x2, y1, x2, y2\n ]), gl.STATIC_DRAW);\n\n}", "static async _RectangleSelection(event){\n\t\t\tconst tool = game.activeTool;\n\t\t\tif(tool !== \"select\") return;\n\t\t\tif($(document.getElementById(\"tokenAttacher\")).find(\".control-tool.select.active\").length <= 0 ) return;\n\t\t\t$(document.getElementById(\"tokenAttacher\")).find(\".control-tool.select\")[0].classList.toggle(\"active\");\t\n\t\t\t\n\t\t\tconst {coords, originalEvent} = event.data;\n\t\t\tconst {x, y, width, height, releaseOptions={}, controlOptions={}}=coords;\n\t\t\tlet selected = {};\t\n\t\t\tconst baseId= canvas.scene.getFlag(moduleName, \"attach_base\").element;\t\t\n\t\t\tconst token = canvas.tokens.get(baseId);\n\t\t\tfor (const type of [\"AmbientLight\", \"AmbientSound\", \"Drawing\", \"MeasuredTemplate\", \"Note\", \"Tile\", \"Token\", \"Wall\"]) {\n\t\t\t\tconst layer = canvas.getLayerByEmbeddedName(type);\n\t\t\t\t//if (layer.options.controllableObjects) {\n\t\t\t\t\t// Identify controllable objects\n\t\t\t\t\tconst controllable = layer.placeables.filter(obj => obj.visible && (obj.control instanceof Function));\n\t\t\t\t\tconst newSet = controllable.filter(obj => {\n\t\t\t\t\t\tlet c = obj.center;\n\t\t\t\t\t\t//filter base out\n\t\t\t\t\t\tif(obj.data._id === baseId) return;\n\t\t\t\t\t\t//Filter attached elements except when they are already attached to the base\n\t\t\t\t\t\tconst parent = obj.getFlag(moduleName, 'parent') || \"\";\n\t\t\t\t\t\tif(parent !== \"\" && parent !== baseId) return;\n\t\t\t\t\t\t//filter all inside selection\n\t\t\t\t\t\treturn Number.between(c.x, x, x+width) && Number.between(c.y, y, y+height);\n\t\t\t\t\t});\t\t\n\t\t\t\t\tselected[type] = newSet.map(a => a.data._id);\n\t\t\t\t\tif(selected[type].length <= 0) delete selected[type];\t\t\n\t\t\t\t//}\n\t\t\t}\n\t\t\tif(selected.length === 0) return;\n\t\t\tTokenAttacher._attachElementsToToken(selected, token, false);\n\t\t\tui.notifications.info(game.i18n.format(localizedStrings.info.ObjectsAttached));\n\t\t}", "get rect():Object {\n\t\treturn this._rect = this._rect || new XY.Rect(this.origin.x, this.origin.y, this._width, this._height);\n\t}", "resetCanvas() {\n this.positions = this.calcSizeAndPosition();\n }", "function createSelectionRect() {\r\n selectionRect = that.surface.createRect({\r\n x: that.width, y: that.height, \r\n width: 1, height: 1}).\r\n setFill(\"yellow\");\r\n }", "function drawBoxes() {\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }\n}", "drawRect() {\n if (this.isNullOrUndefined(this.rect)) {\n if (this.drawn === false) {\n this._updateZIndex();\n }\n this.drawn = true;\n return this;\n }\n else {\n if (!this.rect.isValid || !this.parent) {\n !this.rect.isValid && console.error('HView#drawRect; invalid rect:', this.rect);\n !this.parent && console.error('Hview#drawRect; invalid parent:', ELEM.get(this.elemId));\n }\n else {\n Object.entries({\n left: this.flexLeft ? this.rect.left : 'auto',\n top: this.flexTop ? this.rect.top : 'auto',\n right: this.flexRight ? this._rightOffset : 'auto',\n bottom: this.flexBottom ? this._bottomOffset : 'auto',\n width: (this.flexLeft && this.flexRight) ? 'auto' : this.rect.width,\n height: (this.flexTop && this.flexBottom) ? 'auto' : this.rect.height,\n display: this.displayMode,\n }).forEach(([_key, _value], i) => {\n if (i < 6 && _value !== 'auto') {\n _value += 'px';\n }\n ELEM.setStyle(this.elemId, _key, _value, true);\n });\n // Show the rectangle once it gets created, unless visibility was set to\n // hidden in the constructor.\n if (!this.isHidden) {\n ELEM.setStyle(this.elemId, 'visibility', 'inherit', true);\n }\n if (this.drawn === false) {\n this._updateZIndex();\n }\n if (this.isntNullOrUndefined(this.themeStyle)) {\n this.themeStyle.call(this);\n }\n this.drawn = true;\n }\n return this;\n }\n }", "function setArtboardBounds(artboard, bounds) {\r\n var rect = [\r\n bounds.left,\r\n bounds.top,\r\n bounds.left + bounds.width,\r\n bounds.top - bounds.height\r\n ];\r\n artboard.artboardRect = rect;\r\n}", "function setRectangle(gl, x, y, width, height) {\n var x1 = x;\n var x2 = x + width;\n var y1 = y;\n var y2 = y + height;\n\n // NOTE: gl.bufferData(gl.ARRAY_BUFFER, ...) will affect\n // whatever buffer is bound to the `ARRAY_BUFFER` bind point\n // but so far we only have one buffer. If we had more than one\n // buffer we'd want to bind that buffer to `ARRAY_BUFFER` first.\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x2, y1,\n x1, y2,\n x1, y2,\n x2, y1,\n x2, y2]), gl.STATIC_DRAW);\n}", "_estimateBoundingBox()\n\t{\n\t\t// take the alignment into account:\n\t\tthis._boundingBox = new PIXI.Rectangle(\n\t\t\tthis._pos[0] - this._size[0] / 2.0,\n\t\t\tthis._pos[1] - this._size[1] / 2.0,\n\t\t\tthis._size[0],\n\t\t\tthis._size[1],\n\t\t);\n\t}", "union(_rect) {\n return new HRect(\n Math.min(this.left, _rect.left), Math.min(this.top, _rect.top),\n Math.max(this.right, _rect.right), Math.max(this.bottom, _rect.bottom)\n );\n }", "function normalizeRect(rect) {\n return BoundingRect.create(rect);\n }", "function normalizeRect(rect) {\n return BoundingRect.create(rect);\n }", "addObservationRectangle() {\n if(App.pathFinder.data.scope_loaded) {\n return;\n }\n\n let $chart = App.pathFinder.chart;\n\n var xAxis = $chart.xAxis[0],\n yAxis = $chart.yAxis[0];\n\n var x = xAxis.toPixels(-25),\n y = yAxis.toPixels(25),\n size_x = xAxis.toPixels(25) - xAxis.toPixels(-25),\n size_y = yAxis.toPixels(-25) - yAxis.toPixels(25);\n \n // FOV Box\n $chart.renderer.rect(x, y, size_x, size_y).attr({\n 'stroke-width': 1,\n stroke: '#868686',\n fill: 'rgba(68, 192, 0, .02)',\n zIndex: 0\n }).addClass('rect').add();\n\n // Vertical target path line\n $chart.renderer.path(['M', xAxis.toPixels(0), yAxis.toPixels(-25), 'L', xAxis.toPixels(0), yAxis.toPixels(25)]).attr({\n 'stroke-width': 1, stroke: 'silver', dashstyle: 'dash'\n }).add();\n\n // Horizontal target path line\n $chart.renderer.path(['M', xAxis.toPixels(-25), yAxis.toPixels(0), 'L', xAxis.toPixels(25), yAxis.toPixels(0)]).attr({\n 'stroke-width': 1, stroke: 'silver', dashstyle: 'dash'\n }).add();\n\n App.pathFinder.data.scope_loaded = true;\n }", "function orderRects(rectsData) {\n let rects = [];\n for (let [width, height] of rectsData) {\n let rect = createRect(width, height);\n rects.push(rect);\n }\n rects.sort((a, b) => a.compareTo(b));\n return rects;\n\n function createRect(width, height) {\n return rect = {\n width,\n height,\n area: () => rect.width * rect.height,\n compareTo: function (other) {\n let comparisonResult = other.area() - rect.area();\n if (comparisonResult === 0) {\n return other.width - rect.width;\n }\n return comparisonResult;\n }\n };\n }\n}", "function Rectangle(left,top,right,bottom){this.left=left;this.top=top;this.right=right;this.bottom=bottom;}", "rectb(x0, y0, w, h, c) {\n // evaluate runtime errors\n if (w <= 0) {\n throw new RangeError(\"The width of a rectangle must be > 0. \");\n }\n else if (h <= 0) {\n throw new RangeError(\"The height of a rectangle must be > 0. \");\n }\n this.colorRangeError(c);\n for (let x = 0; x < w; x++) {\n for (let y = 0; y < h; y++) {\n if (x === 0 || y === 0 || x === w - 1 || y === h - 1) {\n this.pix(x0 + x, y0 + y, c);\n }\n }\n }\n }", "function changeSettings() {\n originalWidth = width;\n originalHeight = height;\n xCentreCoord = 0;\n yCentreCoord = 0;\n }", "rect(x0, y0, w, h, c) {\n // evaluate runtime errors\n if (w <= 0) {\n throw new RangeError(\"The width of a rectangle must be > 0. \");\n }\n else if (h <= 0) {\n throw new RangeError(\"The height of a rectangle must be > 0. \");\n }\n this.colorRangeError(c);\n this.cr.renderer.fillStyle = this.palette[c];\n this.cr.renderer.fillRect(x0 * this.cr.options.scaleFactor, y0 * this.cr.options.scaleFactor, w * this.cr.options.scaleFactor, h * this.cr.options.scaleFactor);\n }" ]
[ "0.63136405", "0.61685306", "0.61619914", "0.6012233", "0.5906206", "0.5901949", "0.58671635", "0.5807357", "0.57795286", "0.57289696", "0.5660493", "0.5648216", "0.55788183", "0.55577624", "0.5554394", "0.5548755", "0.55219686", "0.5506867", "0.5487357", "0.5412677", "0.5405972", "0.5405751", "0.53922147", "0.538021", "0.53731817", "0.5363406", "0.53545713", "0.53460133", "0.5328838", "0.53155637", "0.5313024", "0.52748245", "0.52651477", "0.5258848", "0.5226269", "0.5226044", "0.5217311", "0.5210803", "0.5208798", "0.52031004", "0.5197463", "0.5195273", "0.5191272", "0.5189805", "0.5181769", "0.5164774", "0.51642734", "0.5159499", "0.514947", "0.51408815", "0.51392937", "0.5125019", "0.5112982", "0.51127297", "0.5112187", "0.5111614", "0.51088834", "0.50983405", "0.50976056", "0.50975543", "0.5096011", "0.50932956", "0.50889", "0.5086799", "0.5070417", "0.50669634", "0.5062991", "0.5061241", "0.5060209", "0.50558585", "0.50508726", "0.5050625", "0.5049941", "0.50463736", "0.5035273", "0.5026839", "0.50175077", "0.5016464", "0.501566", "0.50103945", "0.5010194", "0.5003906", "0.4998893", "0.4998731", "0.49941617", "0.49922636", "0.49904087", "0.4985745", "0.49844697", "0.49804878", "0.49795815", "0.49752903", "0.49722043", "0.49722043", "0.4967857", "0.49667785", "0.49664092", "0.49642438", "0.49562013", "0.49524736" ]
0.5735856
9
Iterate over each rectangle saved in the global variable $rect and set the size and position to scale with the rendered image.
function adjustFaceWrap() { const ratioWidth = displayImage.width() / image.width; const ratioHeight = displayImage.height() / image.height; $rects.map(function (i) { const { origRectWidth, origRectHeight, origRectTop, origRectLeft, statPosition, statBlock } = $origRectSpecs[i]; jQuery(this).css({ "width": `${origRectWidth * ratioWidth}px`, "height": `${origRectHeight * ratioHeight}px`, "top": `${origRectTop * ratioHeight}px`, "left": `${origRectLeft * ratioWidth}px` }); if (statBlock) { jQuery(statBlock).css({ "top": `${statPosition.origStatTop * ratioHeight}px`, "left": `${statPosition.origStatLeft * ratioWidth}px` }); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set scale9Grid(rect) {\n if (this.$disp instanceof ScaleBitmap) {\n this.$disp.scale9Grid = rect;\n }\n }", "animateRectangles() {\n requestAnimationFrame(this.animateRectangles.bind(this));\n this.clearCanvas();\n this.rectangles.forEach(rect => rect.update(this.mouse.x, this.mouse.range));\n }", "function resizeBoxDraw(){\n state.boxArr.forEach(function(el){\n ctx.fillStyle = el.resizeStyle;\n ctx.fillRect(el.resize.top.x, el.resize.top.y, el.resize.top.w, el.resize.top.h)\n // ctx.fillRect(el.resize.bottom.x, el.resize.bottom.y, el.resize.bottom.w, el.resize.bottom.h)\n // ctx.fillRect(el.resize.left.x, el.resize.left.y, el.resize.left.w, el.resize.left.h)\n ctx.fillRect(el.resize.right.x, el.resize.right.y, el.resize.right.w, el.resize.right.h) \n })\n \n }", "function redrawRects(selectedImageId) {\n var rectData = $scope.imageArr[selectedImageId];\n if (rectData != undefined || rectData != null) {\n for (var i = 0; i < rectData.length; i++) {\n var obj = rectData[i];\n var x1 = obj.currentObj.x1;\n var y1 = obj.currentObj.y1;\n var x2 = obj.currentObj.x2;\n var y2 = obj.currentObj.y2;\n\n\n var width = x2 - x1;\n var height = y2 - y1;\n var context = getCanvasContext();\n context.beginPath();\n context.rect(x1, y1, width, height);\n context.lineWidth = 1;\n context.strokeStyle = obj.currentObj.color;\n context.stroke();\n }\n }\n //temp squares\n\n var rectData = $scope.tempPoints[selectedImageId];\n if (rectData != undefined || rectData != null) {\n for (var i = 0; i < rectData.length; i++) {\n var obj = rectData[i];\n var x1 = obj.currentObj.x1;\n var y1 = obj.currentObj.y1;\n var x2 = obj.currentObj.x2;\n var y2 = obj.currentObj.y2;\n\n\n var width = x2 - x1;\n var height = y2 - y1;\n var context = getCanvasContext();\n context.beginPath();\n context.rect(x1, y1, width, height);\n context.lineWidth = 1;\n context.strokeStyle = obj.currentObj.color;\n context.stroke();\n }\n }\n\n }", "function scale(scale)\n{\n // Loop through each value pair\n for (var i = 0, size = positions.length; i < size; i+=2)\n {\n // Get x and y coordinates\n var x = positions[i];\n var y = positions[i+1];\n\n // Multiply x and y valu by scale value\n x += x * scale;\n y += y * scale;\n\n // Set position values\n positions[i] = x;\n positions[i+1] = y;\n }\n\n // Redraw the image\n loadImage();\n}", "refreshRect() {\n\t\tvar posX = this.savedPosX + this.offsetX;\n\t\tvar posY = this.savedPosY + this.offsetY;\n\t\tvar sizeX = this.savedSizeX;\n\t\tvar sizeY = this.savedSizeY;\n\t\t\n\t\t// Calculate actual position and scale\n\t\tvar scale = renko.getWindowScale() * (2 / window.devicePixelRatio);\n\t\tposX = posX - sizeX/2 + renko.appWidth/2;\n\t\tposY = posY - sizeY/2 + renko.appHeight/2;\n\t\tposX *= scale;\n\t\tposY *= scale;\n\t\tsizeX *= scale;\n\t\tsizeY *= scale;\n\t\t\n\t\t// Apply transform\n\t\tthis.style.left = String(posX) + \"px\";\n\t\tthis.style.top = String(posY) + \"px\";\n\t\tthis.style.width = String(sizeX) + \"px\";\n\t\tthis.style.height = String(sizeY) + \"px\";\n\t}", "function put_rect(rect, max_width){\r\n line.push(rect);\r\n\r\n var parent = undefined;\r\n\r\n for (var i = 0; i < line.length; i++){\r\n if ((line[i].space_left >= rect.height) && (line[i].x + line[i].width + rect.width + applyPacking.PADDING - max_width) <= applyPacking.FLOAT_EPSILON){\r\n parent = line[i];\r\n break;\r\n }\r\n }\r\n\r\n if (parent !== undefined){\r\n rect.x = parent.x + parent.width + applyPacking.PADDING;\r\n rect.y = parent.bottom;\r\n rect.space_left = rect.height;\r\n rect.bottom = rect.y;\r\n parent.space_left -= rect.height + applyPacking.PADDING;\r\n parent.bottom += rect.height + applyPacking.PADDING;\r\n } else {\r\n rect.y = global_bottom;\r\n global_bottom += rect.height + applyPacking.PADDING;\r\n rect.x = init_x;\r\n rect.bottom = rect.y;\r\n rect.space_left = rect.height;\r\n }\r\n\r\n if (rect.y + rect.height - real_height > -applyPacking.FLOAT_EPSILON) real_height = rect.y + rect.height - init_y;\r\n if (rect.x + rect.width - real_width > -applyPacking.FLOAT_EPSILON) real_width = rect.x + rect.width - init_x;\r\n }", "setup_rectangles(rects){\n let xScale = this.xScale;\n let yScale = this.yScale;\n let h = this.h;\n let y_pad = this.y_pad\n rects.attr(\"x\", function(d, i) {return xScale(i);})\n .attr(\"y\", function(d) {return yScale(d.mort_rate);})\n .attr(\"width\", xScale.bandwidth())\n .attr(\"height\", function(d) {return (h - y_pad) - yScale(d.mort_rate);});\n return rects\n }", "setRectangle() {\n this.gene = makeRectangle(this.size, this.size - 10);\n }", "function rectangle_zoom(pos) {\n\tif (! ('x' in pos && 'y' in pos && 'width' in pos && 'height' in pos) || typeof pos.x == 'undefined' || typeof pos.y == 'undefined' || typeof pos.width == 'undefined' || typeof pos.height == 'undefined' ||\n\t(pos.width < 10 && pos.height < 10)) {\n\t\t$(\"selection-box\").hide();\n\t\tzoom_vals = {};\n\t\treturn;\n\t}\n\t\n\tvar $container = $('#canvas');\n\tvar loc = {\t\n\t\t'start1': pos.x - margin.left - $container.position().left,\n\t\t'end1': pos.x + pos.width - margin.left - $container.position().left,\n\t\t'start2': pos.y - margin.top - $container.position().top,\n\t\t'end2': pos.y + pos.height - margin.top - $container.position().top\n\t};\n\t\n\tvar nloc = {\n\t\t'start1': parseInt( scales.xback( loc.start1 ) ),\n\t\t'end1': parseInt( scales.xback( loc.end1 ) ),\n\t\t'start2': parseInt( scales.yback( loc.start2 ) ),\n\t\t'end2': parseInt( scales.yback( loc.end2 ) )\n\t};\n\tif (nloc.start1 > nloc.end1) {\n\t\tvar s1 = nloc.start1;\n\t\tnloc.start1 = nloc.end1;\n\t\tnloc.end1 = nloc.start1;\n\t}\n\tif (nloc.start2 > nloc.end2) {\n\t\tvar s2 = nloc.start2;\n\t\tnloc.start2 = nloc.end2;\n\t\tnloc.end2 = s2;\n\t}\n\t\n\t// Check limits\n\tvar max1 = cached_genomes.genomes[ get_par( 'sp1' ) ].max_pnum_display;\n\tvar max2 = cached_genomes.genomes[ get_par( 'sp2' ) ].max_pnum_display;\n\tif ( nloc.start1 < 0 ) { nloc.start1 = 0; }\n\tif ( nloc.start2 < 0 ) { nloc.start2 = 0; }\n\tif ( nloc.end1 > max1) { nloc.end1 = max1; }\n\tif ( nloc.end2 > max2) { nloc.end2 = max2; }\n\t\n\t// Update coordinates\n\tzoom_vals = nloc;\n}", "function updateRectLike(item, x, y, width, height) {\n xy2shape(item, \"x\", x, \"y\", y);\n item.setAttributeNS(null, \"width\", width);\n item.setAttributeNS(null, \"height\", height);\n }", "function updateRect(rect) {\n myTransition(rect)\n // Each fruit will keep the same color as its score changes.\n .attr('fill', d => colorScale(d.colorIndex))\n .attr('width', barWidth - barPadding * 2)\n .attr('height', d => usableHeight - yScale(d.score))\n .attr('x', barPadding)\n .attr('y', d => TOP_PADDING + yScale(d.score));\n}", "function drawRect(){\n for(y = 0; y < shapePosY.length; y++){\n for(i = 0; i < shapePosX.length; i++){\n noStroke();\n fill(colors[i]);\n rect(shapePosX[i], shapePosY[y], 35, 35);\n }\n }\n}", "function scaleAll2(newScale){\r\n if(newScale>MIN_SCALE && newScale<MAX_SCALE){\r\n canvas.forEachObject(function(item, index, arry){\r\n if(!item.isTag){\r\n item.scale(newScale);\r\n if(item != fabImg){\r\n //When scaling move element so that distance of elements for center is always in portion wiht scale\r\n var x = ((item.getLeft() - AnnotationTool.originX)/AnnotationTool.SCALE) * newScale + AnnotationTool.originX;\r\n var y = ((item.getTop() - AnnotationTool.originY)/AnnotationTool.SCALE) * newScale + AnnotationTool.originY;\r\n if(item.elementObj){\r\n item.elementObj.setItemPos(x, y, newScale);\r\n }\r\n }\r\n \r\n }\r\n });\r\n canvas.renderAll();\r\n AnnotationTool.SCALE = newScale;\r\n }\r\n }", "resizeToChildren() {\n let totalBounds = this.recurseThroughChildren(this, []);\n let minX;\n let minY;\n let maxX;\n let maxY;\n for (let bound in totalBounds) {\n if (!minX) {\n minX = this.x;\n maxX = totalBounds[bound].x + totalBounds[bound].width;\n minY = this.y;\n maxY = totalBounds[bound].y + totalBounds[bound].height\n continue;\n }\n if (totalBounds[bound].x + totalBounds[bound].width > maxX) {\n maxX = totalBounds[bound].x + totalBounds[bound].width\n }\n if (totalBounds[bound].y + totalBounds[bound].height > maxY) {\n maxY = totalBounds[bound].y + totalBounds[bound].height\n }\n }\n this.x = minX;\n this.y = minY;\n this.width = maxX - minX;\n this.height = maxY - minY;\n this.sizeUpdated = true;\n }", "function resize(){\n rect = Canvas.getBoundingClientRect()\n ratio = S/rect.height\n Canvas.width = S\n Canvas.height = S\n\n for (let i=0; i<Class('image').length; i++){\n let c = Class('image')[i]\n c.width = S\n c.height = S\n }\n}", "function _spr(x,y,w,h,sx,sy,data) {\n\tfor (var i=0; i<w; i++) {\n\t\tfor (var j=0; j<h; j++) {\n\t\t\tvar c = data[i+j*w]\n\t\t\trect(x+i*sx,y+j*sy,sx,sy,c)\n\t\t}\n\t}\n}", "function renderEditBoxes(svg){\r\n //edit boxes\r\n //movement\r\n var editPos = svg.selectAll(\"rect.move\")\r\n .data(editArr)\r\n .enter()\r\n .append(\"rect\")\r\n .attr(\"class\", \"ebp\")\r\n .attr(\"x\", function(d){\r\n if(editingPic == -1){\r\n return -100;\r\n }else{\r\n return pictureArray[editingPic][0] + pictureArray[editingPic][2]/2;\r\n }\r\n })\r\n .attr(\"y\", function(d){\r\n if(editingPic == -1){\r\n return -100;\r\n }else{\r\n return pictureArray[editingPic][1];\r\n }\r\n })\r\n .attr(\"width\", editBoxWidth)\r\n .attr(\"height\", editBoxWidth)\r\n .attr(\"fill\", \"#505050\")\r\n .on(\"mousedown\", function(d){mouseDownEvent(1, svg)})\r\n .on(\"mousemove\", function(d){if(dragging == 1) {mouseDragEvent(1, svg)}})\r\n .on(\"mouseup\", function(d){mouseUpEvent(1)});\r\n\r\n //width\r\n var editWidth = svg.selectAll(\"rect.width\")\r\n .data(editArr)\r\n .enter()\r\n .append(\"rect\")\r\n .attr(\"class\", \"ebw\")\r\n .attr(\"x\", function(d){\r\n if(editingPic == -1){\r\n return -100;\r\n }else{\r\n return Number(pictureArray[editingPic][0]) + Number(pictureArray[editingPic][2]) - editBoxWidth;\r\n }\r\n })\r\n .attr(\"y\", function(d){\r\n if(editingPic == -1){\r\n return -100;\r\n }else{\r\n return Number(pictureArray[editingPic][1])+50;\r\n }\r\n })\r\n .attr(\"width\", editBoxWidth)\r\n .attr(\"height\", editBoxWidth)\r\n .attr(\"fill\", \"#505050\")\r\n .on(\"mousedown\", function(d){mouseDownEvent(2, svg)})\r\n .on(\"mousemove\", function(d){if(dragging == 2) {mouseDragEvent(2, svg)}})\r\n .on(\"mouseup\", function(d){mouseUpEvent(2)});\r\n}", "set pixelRect(value) {}", "function updateScales(width,height){\n\t\tscales[state].x.range([0, width]);\n\n\t\tscales[state].y.range([height,0]);\n\t}", "scale(scale) {\n this._height *= scale;\n this._width += scale;\n }", "function scale(s){\ndWidth = 90;\ndHeight = 45;\nwallHeight = 135;\n\ndWidth = dWidth * s;\ndHeight = dHeight * s;\nwallHeight = wallHeight * s;\n\n}", "function RefreshRectangles()\n{\n clearCanvas();\n var i;\n for(i=0; i<LayerCollection.length; i++)\n {\n LayerCollection[i].RefreshLayer(_drawContext);\n }\n \n if(_selectedRectOverlay != undefined && SelectedRectangle != undefined)\n {\n _selectedRectOverlay.RenderOverlay(_drawContext);\n }\n}", "function DrawRectangle(){\n /**Render All Four Quadrants*/\n /**Initialize entry points */\n let i_o = start.y < mouse.y ? start.y : mouse.y; \n let j_o = start.x < mouse.x ? start.x : mouse.x;\n let i_f = i_o == start.y ? mouse.y : start.y;\n let j_f = j_o == start.x ? mouse.x : start.x;\n\n for(let i = i_o; i <= i_f; i++){\n for(let j = j_o; j <= j_f; j++){\n if(i==i_o || j==j_o || i ==i_f || j == j_f){\n if($('#'+i+'a'+j).attr('type') == 'tile'){\n prev_pixels.push($('#'+i+'a'+j));\n }\n }\n }\n }\n}", "function resizeRectangle(canvas, event, pos) {\n rightCorner = getCanvasMousePosition(canvas, event)\n panels[whichPanel][pos].width = rightCorner.x - panels[whichPanel][pos].x\n panels[whichPanel][pos].height = rightCorner.y - panels[whichPanel][pos].y\n\n //Call to panel function that resizes browser view\n changePanelDims(panels[whichPanel][pos].x, panels[whichPanel][pos].y, panels[whichPanel][pos].width, panels[whichPanel][pos].height, panels[whichPanel][pos].viewNum)\n\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n for(i = 0; i < panels[whichPanel].length; i++)\n {\n ctx.beginPath()\n ctx.rect(panels[whichPanel][i].x, panels[whichPanel][i].y, panels[whichPanel][i].width, panels[whichPanel][i].height)\n ctx.stroke()\n ctx.closePath()\n }\n bottomBar(barNum)\n}", "function updateThumbnail()\n{\n\tvar thumb_dimension = 100;\n\tvar thumbnail_style = $('#thumbnail');\n\tupdateSelection();\n\t//should be the same\n\tvar X_scale = thumb_dimension/selection.origWidth;\n\tvar Y_scale = thumb_dimension/selection.origHeight;\n\tthumbnail_style.css('width', imgObj.width*X_scale);\n\tthumbnail_style.css('height', imgObj.height*Y_scale);\n\tthumbnail_style.css('left', -selection.origX*X_scale);\n\tthumbnail_style.css('top', -selection.origY*Y_scale);\n}", "function generateRectangles() {\n \n for (var i = 20; i < 900; i = i + rectangleWidth) {\n\n rectangleHeight = Math.random() * 100;\n rectangleHeight = Math.floor(rectangleHeight);\n \n ctx.rect(i, positionTop, rectangleWidth, rectangleHeight);\n ctx.stroke();\n ctx.fillStyle = 'rgba(255,0,0,0.5)'; \n ctx.fill();\n newArray.push(rectangleHeight);\n arrayLength = newArray.length;\n positionLeft.push(i);\n}\n\n/*function position(newArray[rectangleHeight]) {\n ctx.rect(i, 20, rectangleWidth, rectangleHeight);\n}*/\n\nconsole.log(\"this is the original random array of rectangle heights \" + \"[\" + newArray + \"]\");\nconsole.log(\"this is the original restangles position for rectangles \" + \"[\" + positionLeft + \"]\");\nreturn ;\n}", "function updateRect() {\n\tcanvasPosX = parseInt(document.getElementById('x-setter').value);\n\tcanvasPosY = parseInt(document.getElementById('y-setter').value);\n\tcanvasWidth = parseInt(document.getElementById('width').value);\n\tcanvasHeight = parseInt(document.getElementById('height').value);\n\tlet preview = document.getElementById('imagepreview');\n\tlet canvas = document.getElementById('canvas');\n\tlet context = canvas.getContext('2d');\n\tlet ctx = preview.getContext('2d');\n\tcontext.clearRect(0, 0, canvas.width, canvas.height);\n\tctx.clearRect(0, 0, preview.width, preview.height);\n\tpreview.height = canvasHeight;\n\tpreview.width = canvasWidth;\n\tcanvas.height = canvasHeight;\n\tcanvas.width = canvasWidth;\n\tctx.drawImage(output, canvasPosX, canvasPosY);\n\tcontext.drawImage(output, canvasPosX, canvasPosY)\n}", "draw() {\n rect(this.x1, this.y1, this.Width, this.Height);\n }", "draw() {\n rect(this.x1, this.y1, this.Width, this.Height);\n }", "function translateToRect(_rect) {\r\n var that = {};\r\n\r\n // convert konva rect/image to an object that contains x, y, width and height\r\n var rect = _rect.attrs || _rect;\r\n that.left = rect.x,\r\n that.right = rect.x + rect.width,\r\n that.top = rect.y,\r\n that.bottom = rect.y + rect.height;\r\n\r\n return that;\r\n }", "function addMoreRects() {\n for (let i = 0; i < AMOUNT; i++) {\n rects[i].float();\n rects[i].display();\n rects[i].collisionDetection();\n }\n}", "generate(_texture, _rects, _resolutionQuad, _origin) {\n this.frames = [];\n let framing = new ƒ.FramingScaled();\n framing.setScale(1 / _texture.image.width, 1 / _texture.image.height);\n let count = 0;\n for (let rect of _rects) {\n let frame = this.createFrame(this.name + `${count}`, _texture, framing, rect, _resolutionQuad, _origin);\n frame.timeScale = 1;\n this.frames.push(frame);\n // ƒ.Debug.log(frame.rectTexture.toString());\n // ƒ.Debug.log(frame.pivot.toString());\n // ƒ.Debug.log(frame.material);\n count++;\n }\n }", "function updateRect(rect) {\n rect.attr('x', function (d) {\n // if at the edge, adjust for stroke width\n var val = x(d[0]);\n if (val === xMin) {\n return val - strokeWidthClipAdjustment;\n }\n return val;\n }).attr('width', function (d) {\n // if at the edge, adjust for stroke width to prevent clipping it\n var valMin = x(d[0]);\n var valMax = x(d[d.length - 1]);\n if (valMin === xMin) {\n valMin -= strokeWidthClipAdjustment;\n }\n if (valMax === xMax) {\n valMax += strokeWidthClipAdjustment;\n }\n\n return valMax - valMin;\n }).attr('y', clipRectY).attr('height', clipRectHeight);\n }", "function resize() {\n\n\t var width = $(self.scatterEl).width() - self.margin.left - self.margin.right,\n\t \t\theight = $(self.scatterEl).height() - self.margin.top - self.margin.bottom;\n\n\t \tself.height = height;\n\t\tself.width = width;\n\n\t \tself.scatter_svg.select(\"#clip\").selectAll(\"rect\")\n\t \t\t.attr(\"width\", width)\n\t .attr(\"height\", (height-self.margin.bottom));\n\n\t \t// Update zoom and pan handles size\n\t\tself.scatter_svg.select('rect.zoom.xy.box')\n\t\t\t.attr(\"width\", width)\n\t\t\t.attr(\"height\", height-self.margin.bottom);\n\n\t\tself.scatter_svg.select('rect.zoom.x.box')\n\t\t\t.attr(\"width\", width)\n\t\t\t.attr(\"height\", self.margin.bottom)\n\t\t\t.attr(\"transform\", \"translate(\" + 0 + \",\" + (height - self.margin.bottom) + \")\");\n\n\t\tself.scatter_svg.select('rect.zoom.y.box')\n\t\t\t.attr(\"width\", self.margin.left)\n\t\t\t.attr(\"height\", height - self.margin.bottom);\n\n\t\tself.scatter_svg.select('rect.zoom.y2.box')\n\t\t\t.attr(\"width\", self.margin.left)\n\t\t\t.attr(\"height\", height - self.margin.bottom)\n\t\t\t.attr(\"transform\", \"translate(\" + width + \",0)\");\n\n\t\tself.scatter_svg.select('.y2.axis')\n\t\t\t.attr(\"transform\", \"translate(\"+width+\",0)\");\n\n\t\t// Add x scale label to y axis to make sure it is rendered over all ticks\n\t\tself.scatter_svg.select(\".xaxislabel\")\n\t\t\t.attr(\"x\", width - 10)\n\t\t\t.attr(\"transform\", \"translate(0,\" + (height-self.margin.bottom) + \")\");\n\n\n\t // Update the range of the scale with new width/height\n\t self.xScale.range([0, width]);\n\t self.yScale_left.range([0, (height-self.margin.bottom)]);\n\t if(self.right_scale.length > 0){\n\t \tself.yScale_right.range([0, (height-self.margin.bottom)]);\n\t }\n\n\n\t for (var i = self.sel_y.length - 1; i >= 0; i--) {\n\t \t//var par = self.sel_y[i]\n\t\t // Update legend for available unique identifiers\n\t\t\tvar legend = self.scatter_svg.selectAll(\".legend_\"+self.sel_y[i].replace(/[^a-zA-Z ]/g, \"\"))\n\t\t\tlegend.select(\"circle\")\n\t\t\t\t.attr(\"cx\", width - 25)\n\t\t\t\n\t\t\tlegend.select(\"text\")\n\t\t\t\t.attr(\"x\", width - 34)\n\t\t}\n\n\t\tself.updateTicks();\n\n\t\t// Update the axis with the new scale\n\t self.scatter_svg.select('.x.axis')\n\t .attr(\"transform\", \"translate(0,\" + (height-self.margin.bottom) + \")\")\n\t .call(self.xAxis);\n\n\t self.scatter_svg.select('.y.axis')\n\t .call(self.yAxis_left);\n\n\t if(self.yAxis_right){\n\t \tself.scatter_svg.select('.y2.axis')\n\t \t\t.call(self.yAxis_right);\n\t }\n\n\t self.updatedots();\n\n\t for (var i = self.sel_y.length - 1; i >= 0; i--) {\n\t\t\trenderlines(self.sel_y[i]);\n\t\t};\n\t \n\t if (self.renderBlocks){\n\n\t\t\tself.scatter_svg.selectAll(\".datarectangle\")\n\t\t\t\t.attr(\"x\",function(d) { \n\t\t\t\t\tif(self.daily_products){\n\t\t\t\t\t\tvar t = d.starttime;\n\t\t\t\t\t\tt.setUTCHours(0,0,0,0);\n\t\t\t\t\t\treturn self.xScale(t); \n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn self.xScale(d.starttime); \n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.attr(\"y\",function(d) { \n\t\t\t\t\treturn self.yAxis_left(d.max_height); \n\t\t\t\t})\n\t\t\t\t.attr(\"width\", function(d) { \n\t\t\t\t\tif(self.daily_products){\n\t\t\t\t\t\tvar t = d.starttime;\n\t\t\t\t\t\tt.setUTCHours(23,59,59,999);\n\t\t\t\t\t\tvar x_max = self.xScale(t); \n\t\t\t\t\t\tt.setUTCHours(0,0,0,0);\n\t\t\t\t\t\treturn (x_max-self.xScale(t));\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn (self.xScale(d.endtime)-self.xScale(d.starttime));\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.attr(\"height\", function(d){\n\t\t\t\t\treturn (self.yAxis_left(d.min_height)-self.yAxis_left(d.max_height));\n\t\t\t\t});\n\n\t\t\tcolorAxisScale.range([(height-self.margin.bottom), 0]);\n\n\t\t\tself.scatter_svg.selectAll(\".color.axis\")\n\t\t\t\t.attr(\"transform\", \"translate(\" + (width+40) + \" ,0)\")\n\t\t\t\t.call(colorAxis);\n\n\t\t\tself.scatter_svg.selectAll(\".colorscaleimage\")\n\t\t\t\t.attr(\"width\", height-self.margin.bottom)\n\t\t\t\t.attr(\"transform\", \"translate(\" + (width+17) + \" ,\"+(height-self.margin.bottom)+\") rotate(270)\");\n\t\t}\n\n\t}", "function drawRect(svgContainer, x, y, baseSize, base, type) {\n if (type == 0) {\n base = baseOp[base];\n y = y + baseSize + 5;\n }\n svgContainer.append(\"rect\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .attr(\"width\", baseSize)\n .attr(\"height\", baseSize)\n .attr(\"fill\", colorRange[base])\n .on(\"mouseover\", function () {\n d3.select(this).style('fill', \"yellow\")\n })\n .on(\"mouseout\", function () {\n d3.select(this).transition().duration(200).style('fill', colorRange[base])\n });\n}", "function rectSetPath(ctx, rectSet) {\n rectSet.forEach(function(r) {\n ctx.rect(r[0], r[1], r[2], r[3]);\n });\n }", "function rectSet(){\n\tthis.covers = [];\n\tthis.paths = [];\n\tthis.primed = null;\n}", "setRect(_rect) {\n if (this.rect) {\n this.rect.releaseView(this);\n }\n if (this.isString(_rect) && this.isFunction(this[_rect])) {\n _rect = this[_rect]();\n }\n if (this.isArray(_rect)) {\n this._setArrayRect(_rect);\n }\n else if (this.isObject(_rect) && _rect.hasAncestor(HRect)) {\n this.rect = _rect;\n }\n if (this.rect) {\n this.rect.bindView(this);\n }\n // this.refresh();\n return this;\n }", "update() {\n fill(\"#FFF\");\n rect(this.position.x, this.position.y, this.size.x, this.size.y);\n }", "draw() {\n // We use the south-west and north-east\n // coordinates of the overlay to peg it to the correct position and size.\n // To do this, we need to retrieve the projection from the overlay.\n const overlayProjection = this.getProjection();\n // Retrieve the south-west and north-east coordinates of this overlay\n // in LatLngs and convert them to pixel coordinates.\n // We'll use these coordinates to resize the div.\n const sw = overlayProjection.fromLatLngToDivPixel(\n this.bounds_.getSouthWest(),\n );\n const ne = overlayProjection.fromLatLngToDivPixel(\n this.bounds_.getNorthEast(),\n );\n\n // Resize the image's div to fit the indicated dimensions.\n if (this.div_) {\n this.div_.style.left = sw.x + \"px\";\n this.div_.style.top = ne.y + \"px\";\n this.div_.style.width = ne.x - sw.x + \"px\";\n this.div_.style.height = sw.y - ne.y + \"px\";\n }\n }", "setScales() {\n this.room2_E_KeyImg.setScale(0.4);\n this.room2_wall_info_1.setScale(0.75);\n this.room2_activity1A.setScale(0.67);\n this.room2_activity2A.setScale(0.5);\n this.room2_activity2B.setScale(0.67);\n this.room2_activity3A.setScale(0.67);\n this.room2_activity3B.setScale(0.67);\n\t this.room2_activity4A.setScale(0.45);\n\t this.room2_activity4B.setScale(0.67);\n this.room2_activity5A.setScale(0.5);\n\t this.room2_activity5B.setScale(0.67);\n this.room2_activity6A.setScale(0.67);\n\t this.room2_activity6B.setScale(0.67);\n\t this.room2_activity6C.setScale(0.67);\n\t this.room2_activity6D.setScale(0.67);\n\t this.room2_activity6E.setScale(0.67);\n this.room2_wall_info_2.setScale(0.75);\n this.room2_wall_info_3.setScale(0.75);\n this.room2_wall_info_4.setScale(0.75);\n this.room2_wall_info_5.setScale(0.75);\n this.room2_wall_info_6.setScale(0.75);\n this.room2_notebook.setScale(0.75);\n this.room2_map.setScale(0.75);\n this.room2_character_north.setScale(3);\n this.room2_character_south.setScale(3);\n this.room2_character_west.setScale(3);\n this.room2_character_east.setScale(3);\n this.room2_floor.scaleY = 0.71;\n this.room2_floor.scaleX = 0.99;\n this.leftArrow.setScale(.2);\n this.rightArrow.setScale(.2);\n this.room2_hole_activity.setScale(0.5);\n\n\t this.returnDoor.setScale(1.5);\n this.countCoin.setScale(0.25);\n this.coin0.setScale(0.5);\n this.coinHead.setScale(0.5);\n this.profile.setScale(1.5);\n }", "set rectValue(value) {}", "resizeSprite(currWidth, oldWidth, currHeight, oldHeight){\n //proportionate x and y positions based on canvas resizing\n this.x = this.x * currWidth/oldWidth;\n this.y = this.y * currHeight/oldHeight;\n this.h = this.h * currHeight/oldHeight;\n this.w = this.w * currWidth/oldWidth;\n }", "change_properties() {\n\t\t// The currently selected object:\n\n\t\tthis.currently_selected_entity.collision_box.x = parseInt(EZGUI.components.entity_change_x_value.text);\n\t\tthis.currently_selected_entity.collision_box.y = parseInt(EZGUI.components.entity_change_y_value.text);\n\t\tvar given_width = parseInt(EZGUI.components.entity_change_width_value.text);\n\t\tvar given_height = parseInt(EZGUI.components.entity_change_height_value.text); \n\t\tthis.currently_selected_entity.collision_box.width = given_width;\n\t\tthis.currently_selected_entity.collision_box.height = given_height;\n\t\tthis.currently_selected_entity.id = EZGUI.components.entity_change_id_value.text;\n\n\t\t// modify the sprite scaling based on this:\n\n\t\t// have they changed the image?\n\t\tvar selected_path =EZGUI.components.entity_change_sprite_path_value.text;\n\t\tvar sprite = this.currently_selected_entity.sprite;\n\t\tvar platform_sprite;\n\t\tvar scale_x, scale_y;\n\t\tif ( this.currently_selected_entity.image_path === EZGUI.components.entity_change_sprite_path_value.text)\n\t\t{\n\t\t\tscale_x = given_width / sprite.texture.width;\n\t\t\tscale_y = given_height / sprite.texture.height;\n\t\t} \n\t\telse \n\t\t{\n\t\t\t// they changed the image\n\t\t\tsprite = new PIXI.Sprite( PIXI.loader.resources[selected_path].texture);\n\t\t\tthis.currently_selected_entity.sprite = sprite;\t\n\t\t\tthis.currently_selected_entity.image_path = selected_path;\t\n\t\t\tscale_x = given_width / sprite.texture.width;\n\t\t\tscale_y = given_height / sprite.texture.height;\n\t\t}\n\n\t\t// find the proportions necessary to scale the sprite to the given widht/height\n\t\tsprite.scale.set(scale_x, scale_y);\n\n\n\t}", "function hb_rect(self,value) {\n switch (value) {\n case 0: return self.pos[0] - self.width/2;\n case 1: return self.pos[1] - self.height;\n case 2: return self.pos[0] + self.width/2;\n case 3: return self.pos[1];\n }\n }", "_applyScale() {\n // adjust textures size\n for(let i = 0; i < this.textures.length; i++) {\n this.textures[i].resize();\n }\n\n // we should update the plane mvMatrix\n this._updateMVMatrix = true;\n }", "function drawScale() {\n //Define scale dimensions\n var margin = 30, scaleHeight = 20;\n var x = margin;\n var y = mapHeight - margin - scaleHeight;\n\n //Add rectangles to display legend colors\n mapsvg.append(\"g\").attr(\"id\", \"scaleg\")\n for (var i = 0; i < 200; i += 2) {\n mapsvg.select(\"#scaleg\").append(\"rect\")\n .datum(i)\n .attr(\"class\", \"scalerect\")\n .attr(\"x\", x + i)\n .attr(\"y\", y)\n .attr(\"width\", 2)\n .attr(\"height\", scaleHeight)\n }\n\n //Add outline to scale\n mapsvg.append(\"rect\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .attr(\"width\", 200)\n .attr(\"height\", scaleHeight)\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", \"#000\")\n .attr(\"stroke-width\", 1)\n\n //Add label to scale\n mapsvg.append(\"text\")\n .attr(\"id\", \"scalelabel\")\n .attr(\"x\", x)\n .attr(\"y\", y - 25)\n\n //Add label to show the units of the scale\n mapsvg.append(\"text\")\n .attr(\"id\", \"scaleunits\")\n .attr(\"x\", x)\n .attr(\"y\", y - 10)\n .attr(\"font-size\", 12)\n\n //Add group to store axis on bottom of scale.\n mapsvg.append(\"g\")\n .attr(\"id\", \"scaleaxis\")\n .attr(\"transform\", \"translate(\" + x + \", \" + (y + scaleHeight) + \")\")\n\n updateScale()\n}", "function formatRectObjects(rect) {\n return `top=${rect.y}`.padEnd(10) + `left=${rect.x}`.padEnd(10) + `bottom=${rect.y + rect.h}`.padEnd(12) \n + `right=${rect.x + rect.w}`.padEnd(10) + `(${rect.w}x${rect.h})`;\n }", "setScale() {\n document.body.style.width = `${this.w}px`;\n document.body.style.height = `${this.h}px`;\n // style used on html els and not for canvas, since canvas css doesn't determine actual available coords -- actual obj size defaults to 300x150 n if only css is changed it just scales from that n looks rly bad\n canvas.width = this.w;\n canvas.height = this.h;\n\n road.draw();\n }", "reloadpic()\n\t{\n\t\tif (this.pictures.length == 0) return;\n\t\tthis.currentpic = new Texture(\"@/images/\" + this.pictures[0].image);\n\t\tthis.currenthitboxes = [new Polygon(1, 0, 0, this.currentpic.width, this.currentpic.height)];//this.pictures[0].hitbox;\n\t\tthis.creatureTransform.identity();\n\t\tthis.aspect = this.currentpic.height/this.currentpic.width;\n\t\tthis.height = this.width * this.aspect;\n\t\tthis.creatureShape = HUDSystem.render(this.currentpic, 0, 0, this.currentpic.width, this.currentpic.height);\n\t}", "function positionRectangle(rect, x, y) {\n if (x >= 0 && x + rect.width <= canvas.width) {\n rect.left = x;\n rect.right = rect.left + rect.width;\n } else if (x < 0) {\n rect.left = 0;\n rect.right= rect.width;\n } else if (x + rect.width > canvas.width) {\n rect.left = canvas.width - rect.width;\n rect.right = canvas.width;\n }\n if (y >= 0 && y + rect.height <= canvas.height) {\n rect.top = y;\n rect.bottom = rect.top + rect.height;\n } else if (y < 0) {\n rect.top = 0;\n rect.bottom = rect.height;\n } else if (y + rect.height > canvas.height) {\n rect.top = canvas.height - rect.height;\n rect.bottom = canvas.height; \n }\n}", "scale(scaleAmount) {\n\n this.w *= scaleAmount;\n this.h *= scaleAmount;\n this.x = this.center.x - this.w / 2;\n this.y = this.center.y - this.h / 2;\n\n this.calculateVectorsAndSetShape();\n this.resetFixture();\n }", "render(ctx) {\n const rect = this.getWorldObject();\n\n // Save the context so that the parent (world) transform can be restored.\n ctx.save();\n\n // Apply the rectangles transform to size and position it.\n ctx.transform(...rect.transform);\n\n // Render the rectangle as a 1x1 square centered at 0,0.\n ctx.fillStyle = rect.color;\n ctx.fillRect(-0.5, -0.5, 1, 1);\n\n // Restore the context.\n ctx.restore();\n }", "spr(s, x0, y0) {\n this.cr.renderer.mozImageSmoothingEnabled = false;\n this.cr.renderer.webkitImageSmoothingEnabled = false;\n this.cr.renderer.imageSmoothingEnabled = false;\n let amountFieldsHorizontal = this.images.values().next().value.width / this.spriteSize;\n let yPos = Math.floor(s / amountFieldsHorizontal);\n let xPos = s - amountFieldsHorizontal * yPos;\n this.cr.renderer.drawImage(this.images.values().next().value, xPos * this.spriteSize, yPos * this.spriteSize, 8, 8, x0 * this.cr.options.scaleFactor, y0 * this.cr.options.scaleFactor, this.spriteSize * this.cr.options.scaleFactor, this.spriteSize * this.cr.options.scaleFactor);\n }", "function updateDrawingRectangleOfAPeer(oldRectangleObject, newRectangleObject) {\n oldRectangleObject.set({\n left: newRectangleObject.left,\n top: newRectangleObject.top,\n width: newRectangleObject.width,\n height: newRectangleObject.height\n });\n}", "function updateLocation(width) {\n for (var i = 0; i < arr.length; i++) {\n arr[i].x = 100 + i * width * 2;\n if (i >= 50) {\n arr[i].x = 100 + (i - 50) * width * 2;\n arr[i].y = 200;\n }\n else if (i >= 25) {\n arr[i].x = 100 + (i - 25) * width * 2;\n arr[i].y = 150;\n }\n }\n paintAllComponents();\n}", "function addRectImage(imageSrc) {\n var tryOnObj = new Image();\n tryOnObj.src = imageSrc;\n\n tryOnObj.onload = function() {\n var rectImage = new Box2Image;\n rectImage.x = 20;\n rectImage.y = 20;\n rectImage.w = tryOnObj.width;\n rectImage.h = tryOnObj.height;\n rectImage.imageObj = tryOnObj;\n boxes2Images.push(rectImage);\n invalidate();\n };\n\n \n}", "function formatRectObjects(rect) {\n return `top=${rect.y}`.padEnd(10) + `left=${rect.x}`.padEnd(10) + `bottom=${rect.y + rect.h}`.padEnd(12)\n + `right=${rect.x + rect.w}`.padEnd(10) + `(${rect.w}x${rect.h})`;\n }", "draw() {\n this.tiles.forEach(t => {\n var tileCoords = {\n x: this.origin.x + (t.x * 8) + 16,\n y: this.origin.y + (t.y * 8)\n }\n this.context.drawImage(RESOURCE.sprites, t.t * 8, 16, 8, 8, tileCoords.x, tileCoords.y, 8, 8);\n });\n }", "rectb(x0, y0, w, h, c) {\n // evaluate runtime errors\n if (w <= 0) {\n throw new RangeError(\"The width of a rectangle must be > 0. \");\n }\n else if (h <= 0) {\n throw new RangeError(\"The height of a rectangle must be > 0. \");\n }\n this.colorRangeError(c);\n for (let x = 0; x < w; x++) {\n for (let y = 0; y < h; y++) {\n if (x === 0 || y === 0 || x === w - 1 || y === h - 1) {\n this.pix(x0 + x, y0 + y, c);\n }\n }\n }\n }", "_updateRendering() {\n this._domElement.style.width = this._width + 'px'\n this._domElement.style.height = this._height + 'px'\n this._adjustAll()\n }", "function __ceilRect(rect)\r\n{\r\n var x = rect.x;\r\n var y = rect.y;\r\n rect.x = Math.floor(x);\r\n rect.y = Math.floor(y);\r\n rect.width = Math.ceil(rect.width + (x - rect.x));\r\n rect.height = Math.ceil(rect.height + (y - rect.y));\r\n}", "function setBounds() {\n let el = angular.element(canvas);\n\n //set initial style\n if ( scope.options.layout.height === \"inherit\" ) {\n let viewHeight = view.getHeight();\n el.css(\"height\", `${viewHeight}px`);\n el.attr(\"height\", `${viewHeight * view.scale}px`);\n } else {\n el.css(\"height\", `${scope.options.layout.height}px`);\n el.attr(\"height\", `${scope.options.layout.height * view.scale}px`);\n }\n //set initial style\n if ( scope.options.layout.width === \"inherit\" ) {\n let viewWidth = view.getWidth();\n el.css(\"width\", `${viewWidth}px`);\n el.attr(\"width\", `${viewWidth * view.scale}px`);\n } else {\n el.css(\"width\", `${scope.options.layout.width}px`);\n el.attr(\"width\", `${scope.options.layout.width * view.scale}px`);\n }\n }", "function renderRectangles(list,n){\n \n\n ctx.fillStyle = \"white\";\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n drawText(\"step \"+n);\n ctx.fillStyle = 'rgb(200, 0, 0)';\n \n for(i=0; i<30; i++){\n \n var height=list[i]\n \n ctx.fillRect(10+i*26, 500-height, 26, height);\n ctx.strokeRect(10+i*26, 500-height, 26, height);\n }\n }", "function drawBoxes() {\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }\n}", "function addRect(x, y, w, h, fill,sector,place, line,cell,pricenum) {\n var rect = new Box;\n rect.x = x;\n rect.y = y;\n rect.w = w\n rect.h = h;\n rect.fill = fill;\n rect.sector = sector;\n rect.pricenum = pricenum;\n rect.state = '1';\n rect.line= line;\n rect.cell= cell;\n rect.place=place;\n\n primer[line][cell]=rect; \n invalidate();\n}", "_adjustAll() {\n for (const layer of this._layers) {\n layer._changeSizeTo(this._width, this._height)\n }\n }", "updateBounds() {\n this.bounds = getBounds(this);\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }", "function maybeUpdateRectForZooming(measure, rect) {\r\n if (!window.screen || screen.logicalXDPI == null ||\r\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\r\n return rect;\r\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\r\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\r\n return {left: rect.left * scaleX, right: rect.right * scaleX,\r\n top: rect.top * scaleY, bottom: rect.bottom * scaleY};\r\n }", "_onTextureUpdate()\n {\n this._textureID = -1;\n\n // so if _width is 0 then width was not set..\n if (this._width)\n {\n this.scale.x = sign(this.scale.x) * this._width / this.texture.orig.width;\n }\n\n if (this._height)\n {\n this.scale.y = sign(this.scale.y) * this._height / this.texture.orig.height;\n }\n }", "updateImageResizerPosition() {\n if (!isNullOrUndefined(this.currentImageElementBox)) {\n let elementBox = this.currentImageElementBox;\n let lineWidget = elementBox.line;\n let top = this.viewer.selection.getTop(lineWidget) + elementBox.margin.top;\n let left = this.viewer.selection.getLeftInternal(lineWidget, elementBox, 0);\n let topValue = top * this.viewer.zoomFactor;\n let leftValue = left * this.viewer.zoomFactor;\n let height = this.viewer.render.getScaledValue(elementBox.height, 2);\n let width = this.viewer.render.getScaledValue(elementBox.width, 1);\n this.setImageResizerPosition(leftValue, topValue, width, height, this);\n }\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null || screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) {\n return rect;\n }\n\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {\n left: rect.left * scaleX,\n right: rect.right * scaleX,\n top: rect.top * scaleY,\n bottom: rect.bottom * scaleY\n };\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n return rect;\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY};\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n return rect;\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY};\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n return rect;\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY};\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n return rect;\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY};\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n return rect;\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY};\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n return rect;\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY};\n }", "function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n return rect;\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY};\n }", "draw() {\n\n const { scaleX, scaleY, ctx } = this.world;\n const w = Math.floor(this.img.width * this.scale);\n const h = Math.floor(this.img.height * this.scale);\n const px = this.position.x * scaleX.toPx;\n const py = this.position.y * scaleY.toPx;\n this.width = w * scaleX.toUnits;\n this.height = h * scaleY.toUnits;\n\n if (!this.loaded || !this.display) return;\n\n // Draw image.\n if (this.rotation !== 0) {\n ctx.save();\n ctx.translate(px, py);\n ctx.rotate(this.rotation);\n ctx.drawImage(this.img, -w * this.pivot.x, -h * this.pivot.y, w, h);\n ctx.restore();\n } else {\n ctx.drawImage(\n this.img,\n px - w * this.pivot.x,\n py - h * this.pivot.y,\n w,\n h\n );\n }\n \n }", "function maybeUpdateRectForZooming(measure, rect) {\n\t\t if (!window.screen || screen.logicalXDPI == null ||\n\t\t screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n\t\t return rect;\n\t\t var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n\t\t var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n\t\t return {left: rect.left * scaleX, right: rect.right * scaleX,\n\t\t top: rect.top * scaleY, bottom: rect.bottom * scaleY};\n\t\t }", "function maybeUpdateRectForZooming(measure, rect) {\n\t\t if (!window.screen || screen.logicalXDPI == null ||\n\t\t screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n\t\t { return rect }\n\t\t var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n\t\t var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n\t\t return {left: rect.left * scaleX, right: rect.right * scaleX,\n\t\t top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n\t\t }" ]
[ "0.63539463", "0.6207321", "0.6199388", "0.6186508", "0.6179984", "0.60675913", "0.5999527", "0.5939361", "0.5938346", "0.5926946", "0.5893675", "0.58922666", "0.5866202", "0.578647", "0.578199", "0.57817686", "0.5768587", "0.57682097", "0.5749682", "0.57379705", "0.5718131", "0.570926", "0.56905115", "0.5674302", "0.56718427", "0.567073", "0.5664676", "0.5656959", "0.5656359", "0.5656359", "0.5641757", "0.5631087", "0.5628981", "0.55969656", "0.55923945", "0.55917335", "0.55801827", "0.55310625", "0.55294317", "0.55252534", "0.55207264", "0.5514725", "0.5511922", "0.5494942", "0.548362", "0.5467002", "0.5463165", "0.5461581", "0.5437324", "0.5431384", "0.54233634", "0.54229176", "0.5411336", "0.5406872", "0.54060507", "0.54032457", "0.539087", "0.53906304", "0.5387086", "0.5376805", "0.5372802", "0.53708625", "0.5357684", "0.5352244", "0.53522396", "0.5346834", "0.5342614", "0.53364825", "0.5335491", "0.53345335", "0.53345335", "0.53345335", "0.53345335", "0.53345335", "0.53345335", "0.53345335", "0.53345335", "0.53345335", "0.53345335", "0.53345335", "0.53345335", "0.53345335", "0.53345335", "0.53345335", "0.53345335", "0.53345335", "0.53321815", "0.533066", "0.53281176", "0.53268176", "0.53264475", "0.53264475", "0.53264475", "0.53264475", "0.53264475", "0.53264475", "0.53264475", "0.532155", "0.53136665", "0.53114796" ]
0.54756814
45
When the user clicks on the button, toggle between hiding and showing the dropdown content
function myMenu() { document.getElementById("myDropdown").classList.toggle("show"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dropDownShowClick(){\n document.getElementById(\"forDropDown\").style.display=\"block\";\n document.getElementById(\"dropDownShowBtn\").style.display=\"none\";\n document.getElementById(\"dropDownHideBtn\").style.display=\"block\";\n}", "function btn_show() {\n document.getElementById(\"dropdown-content\").classList.toggle(\"show\");\n}", "function mybutton() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n }", "function showDropdown(btn) {\n var str = '',\n id = '';\n // $common.hideFbPageList();\n $('.dropdown, .select-list').hide();\n $('.dropdown')\n .parents('li:not(' + btn + ')').removeClass('on')\n .children('.on:not(' + btn + ')').removeClass('on');\n $(btn).toggleClass('on');\n str = $(btn).attr('id');\n if (str.search('btn') === 0) {\n // slice(4) for btn-xxx\n str = $(btn).attr('id').slice(4);\n }\n id = '#' + str + '-dropdown';\n if ($(btn).hasClass('on')) {\n $(id).show();\n } else {\n $(id).hide();\n }\n}", "function dropdown() {\n document.getElementById(\"all-versions\").classList.toggle(\"show\");\n}", "function dropdownFunc() {\n document.getElementById(\"infoDrop\").classList.toggle(\"show\");\n }", "function dropupToggle() {\n\tdocument.getElementById(\"myDropup\").classList.toggle(\"show\");\n\tdocument.getElementById(\"myDropupOS\").style.display = \"block\";\n}", "function toggleSizeDropdown(){\n let sizeDropdown = document.getElementById(\"sizeDropdown\");\n let colorDropdown = document.getElementById(\"colorDropdown\");\n if(sizeDropdown.style.visibility == \"visible\"){\n sizeDropdown.style.visibility = \"hidden\";\n }\n else{\n colorDropdown.style.visibility = \"hidden\";\n sizeDropdown.style.visibility = \"visible\";\n }\n}", "function myButton() {\r\n document.getElementById(\"mydropdown\").classList.toggle(\"show\");\r\n}", "function toggleOptions() {\n if(options.style.display === \"none\") {\n options.style.display = \"block\";\n toggle.innerHTML = \"Hide Options\";\n } else {\n options.style.display = \"none\";\n toggle.innerHTML = \"Show Options\";\n }\n}", "function desplegable() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function dropdownFunction() {\n $(\"#myDropdown\").toggleClass(\"hidden flexbox\");\n $(\".men-icon\").toggleClass(\"no-display\");\n}", "toggle() {\n this.setState({\n dropdownOpen: !this.state.dropdownOpen\n });\n }", "function dropdownToggle() {\n document.getElementById(\"ProjectDropdown\").classList.toggle(\"show\");\n}", "function drop() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n }", "onToggleDropdown() {\n\t\tif(this.containerDropdownElement.className.indexOf(\"show\") == -1) {\n\t\t\tthis.containerDropdownElement.className += \" show\";\n\t\t} else {\n\t\t\tthis.containerDropdownElement.className = this.containerDropdownElement.className.replace(\" show\", \"\");\n\t\t}\n\t}", "function toggleDropdown() {\n if (document.querySelector(\".dropdown\") !== null) {\n let aDropdownButtonElements =\n document.querySelectorAll(\".dropdown__button\");\n /* let aDropdownListElements = document.querySelectorAll(\n \".dropdown-list-container\"\n ); */\n aDropdownButtonElements.forEach((eButton) => {\n eButton.addEventListener(\"click\", () => {\n //Reset all dialog boxes\n\n // aDropdownListElements.forEach((eList) => {\n // if (eButton.dataset.buttonid === eList.dataset.listid) {\n // eList.classList.toggle(\"dropdown-list-container--hidden\");\n // }\n // });\n\n //----------- REFACTORED VERSION ------------//\n document\n .querySelector(`[data-listid='${eButton.dataset.buttonid}']`)\n .classList.toggle(\"dropdown-list-container--hidden\");\n });\n });\n }\n}", "function toggleQuestionDropdown() {\n // if the dropdown is disabled and the user presses on the dropdown\n if(partyIsOpen == false) {\n\n // show the dropdown and sets partyIsOpen to true\n questionPartyDropdown.style.display = \"block\";\n partyIsOpen = true;\n } else {\n\n // if the dropdown is enabled and the user presses on the dropdown, disable the dropdown and sets partyIsOpen back to false\n questionPartyDropdown.style.display = \"none\";\n partyIsOpen = false;\n }\n}", "function dropDown() {\n\tdocument.getElementById( \"dropdown\" ).classList.toggle( \"show\" );\n}", "function showDropdown() {\n document.getElementById(\"myDrop\").classList.toggle(\"show\");\n}", "function dropdown_menu_clicked() {\n if(document.getElementById('menu_dropdown_content').classList.contains('show'))\n \tdocument.getElementById('menu_dropdown_content').classList.remove('show');\n else\n \tdocument.getElementById('menu_dropdown_content').classList.add('show');\n}", "function showMenu() {\n $('.dropbtn').click(function () {\n console.log('clicked');\n $('#myDropdown').toggle();\n })\n}", "function dropdown() {\r\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\r\n}", "function dropdown() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function dropdownToggle() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function showDropdown() {\n\t$('.dropdown-toggle').click(function(){\n\t\tvar dropdown = $(this).parent().find('.m-dropdown-menu');\n\t\tif( dropdown.css('display') == 'none' )\n\t\t\tdropdown.show();\n\t\telse\n\t\t\tdropdown.hide();\n\n\t\t// clicks out the dropdown\n\t $('body').click(function(event){\n\t \tif(!$(event.target).is('.m-dropdown-menu a')) {\n\t \t\t$(this).find('.m-dropdown-menu').hide();\n\t \t}\n\t });\n\t\tevent.stopPropagation();\n\t});\n}", "function toggleDropdown() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function toggleDropdown(element) {\t\n\t\tif (hasClass(element,\"hidden\")) {\n\t\t\tshowOneDropdown(element);\n\t\t} else {\n\t\t\taddClass(element,\"hidden\");\n\t\t}\n\t}", "function openViewDropdown() {\n document.getElementById(\"viewDropdown\").classList.toggle(\"show\");\n}", "function dropDown() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function dropFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function dropdownMenu() {\n\tdocument.getElementById(\"dropDownMenu\").classList.toggle(\"show\");\n}", "function myFunction() {\n \t\tdocument.getElementById(\"myDropdown\").classList.toggle(\"show\");\n\t\t}", "function myFunction() {\n\t\t\t\tdocument.getElementById(\"myDropdown\").classList.toggle(\"show\");\n\t\t\t\t}", "function dropdown(){\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function dropdownFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function dropdownTeam() {\n document.getElementById('myDropdown-team').classList.toggle('show');\n}", "function dropdown() {\n glumacNameContainer.classList.toggle(\"show\");\n\n if (arrow.classList.contains('fa-arrow-down')) {\n arrow.classList.remove('fa-arrow-down');\n arrow.classList.add('fa-arrow-up');\n } else {\n arrow.classList.add('fa-arrow-down');\n }\n}", "function dropdown_menu() {\n let x = document.getElementById(\"mobile_id\");\n if (x.style.display === \"block\") {\n x.style.display = \"none\";\n } else {\n x.style.display = \"block\";\n }\n}", "function dropFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function DropDown() {\n document.getElementById(\"dropdowmenu\").classList.toggle(\"show\");\n}", "function drop_toggle() {\n\tdocument.getElementById(\"peekaboo_nav_list\").classList.toggle(\"show\");\n}", "function dropit(){\n document.getElementById(\"dropOptions\").classList.toggle(\"show\");\n}", "function navButton() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "onToggleDropdown() {\n if (this.containerDropdownElement.className.indexOf('show') === -1) {\n this.containerDropdownElement.className += ' show';\n } else {\n const className = this.containerDropdownElement.className.replace(' show', '');\n\n this.containerDropdownElement.className = className;\n }\n }", "toggle(event) {\n this.setState({\n dropdownOpen: !this.state.dropdownOpen\n });\n }", "function toggle() {\n console.log(\"toggle\");\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myDropdown(){\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "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}", "showDropdown(){\n this.setState({isDropdownVisible:true});\n }", "function toggleOption(){\n\tif(optionsContainer.visible){\n\t\toptionsContainer.visible = false;\n\t}else{\n\t\toptionsContainer.visible = true;\n\t}\n}", "myFunction() {\n const dropdown = document.querySelector(\"#myDropdown\");\n dropdown.classList.toggle(\"show\");\n }", "function dropDown() {\n\t\t$navButton = $('.navbar-toggler');\n\t\t$navButton.on('click', () => {\n\t\t\t$('#navbarTogglerDemo03').toggle('collapse');\n\t\t});\n\t}", "function desplegar() {\n document.getElementById(\"dropdown\").style.display = \"block\";\n}", "function toggleDropdown(dropdown) {\n document.getElementById(dropdown).classList.toggle(\"show\");\n}", "function dropDown() {\n document.getElementById(\"playerDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n }", "function userDropdown() {\n document.getElementById(\"user_dropdown\").classList.toggle(\"show\");\n}", "function homeDropdown() {\n\t\tdocument.getElementById(\"myDropdown\").classList.toggle(\"show\");\n\t}", "function myFunction() {\n\tdocument.getElementById(\"myDropdown\").classList.toggle(\"show\");\n }", "function myFunction() {\n \tdocument.getElementById(\"myDropdown\").classList.toggle(\"show\");\n\t}", "function dropmenu() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function ddButton() {\n $('#fuel').click(function(e) {\n e.preventDefault();\n if ($('#dropdownContent').hasClass(\"show\")) {\n $('#dropdownContent').removeClass('show');\n $('#dropdownContent').addClass('calc-dropdown-content');\n } else {\n $('#dropdownContent').addClass('show');\n $('#dropdownContent').removeClass('calc-dropdown-content');\n }\n })\n $('.calc-dropdown').mouseleave(function() {\n $('#dropdownContent').removeClass('show');\n $('#dropdownContent').addClass('calc-dropdown-content');\n })\n}", "function toggleDropdown(){\n\n dropdownItems.classList.toggle('dropdownShow');\n dropdownPijltje.classList.toggle('draaiPijl')\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n }", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n }", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n }", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n }", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n }", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n }", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n }", "function dropDown(){\n var _dropDown = $('.drop-down');\n if ( _dropDown.hasClass('hide') ) {\n _dropDown.removeClass('hide').addClass('show');\n } else {\n _dropDown.removeClass('show').addClass('hide');\n }\n}", "function myFunction() {\n var change = document.getElementById(\"toggle\");\n if (change.innerHTML == \"Filter ON\"){ \n change.innerHTML = \"Filter OFF\";\n unfilter()\n }\n else{ \n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n }\n }", "function Info_Function() {\n\t\tdocument.getElementById(\"Info_myDropdown\").classList.toggle(\"show\");\n\t}", "function menuOptions() {\r\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\r\n}", "function setToggle(dropBool) {\n if(dropBool == \"true\") {\n\tdocument.getElementById(\"advSearch\").className=\"collapse in\";\n }\n dropIconToggle();\n}", "function toggleDropdown() { \n document.querySelector(\"#my-dropdown\").classList.add(\"show\"); \n}", "function showMenu() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "onToggleLanguagesDropdown() {\n $('#select-languages').on('click', function () {\n $(this).siblings('#dropdown-languages').toggleClass('show')\n });\n }", "function toggleEditingMenu(state) {\n\t\tif (state) {\n\t\t\telements.controls.dropdown.show();\n\t\t\telements.controls.add.hide();\n\t\t\telements.controls.remove.hide();\t\n\t\t\telements.controls.reset.hide();\n\t\t} else {\n\t\t\telements.controls.dropdown.hide();\n\t\t\telements.controls.add.show();\n\t\t\telements.controls.remove.show();\n\t\t\telements.controls.reset.show();\n\t\t}\n\t}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n \n}", "function menuDrop() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function toggleDropdownButton() {\n if ($(this).is('.active')) {\n $(this).removeClass('active');\n } else {\n $(this).addClass('active');\n }\n}", "function dropIconToggle() {\n if(dropBool) {\n\tdropBool = false;\n\tdocument.getElementById(\"dropDiv\").innerHTML=\n\t 'Advanced Search <i class=\"icon-chevron-down\" data-toggle=\"collapse\"'\n\t\t+ ' data-target=\"#advSearch\"></i>';\n } else {\n\tdropBool = true;\n\tdocument.getElementById(\"dropDiv\").innerHTML=\n\t 'Advanced Search <i class=\"icon-chevron-up\" data-toggle=\"collapse\"'\n\t\t+ ' data-target=\"#advSearch\"></i>';\n }\n}", "function myFunction() {\n    document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function dropDownParticipant() {\n document.getElementById(\"participantDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\n\tdocument.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\r\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\r\n}", "function myFunction() {\r\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\r\n}", "function myFunction() {\r\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\r\n}", "function toggleDropdownMenu() {\n if (dropdownToggleState == false) {\n\n dropdownMenu.style.display = 'block';\n dropdownMenu.style.opacity = '1';\n\n userIcon.classList.toggle('active');\n\n dropdownToggleState = true;\n\n }\n else {\n\n dropdownMenu.style.opacity = '0';\n dropdownMenu.style.display = 'none';\n\n userIcon.classList.toggle('active');\n \n dropdownToggleState = false;\n\n }\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\n document.getElementById('myDropdown').classList.toggle('show');\n}" ]
[ "0.78088385", "0.7671879", "0.74918294", "0.73910683", "0.7350857", "0.73457146", "0.7332308", "0.7264288", "0.72625244", "0.7242689", "0.72131056", "0.72122794", "0.7175608", "0.71719986", "0.71553904", "0.7151304", "0.7146252", "0.71220434", "0.71034634", "0.7098101", "0.70930576", "0.70919764", "0.7085965", "0.7079735", "0.7071532", "0.70642245", "0.7053539", "0.7049491", "0.7024196", "0.7010935", "0.7010369", "0.7008138", "0.70039755", "0.70028937", "0.699487", "0.69946045", "0.6991081", "0.6987607", "0.6984752", "0.69789064", "0.6967716", "0.6964993", "0.69579566", "0.6957922", "0.6943225", "0.69310975", "0.6924612", "0.690933", "0.69019395", "0.68898326", "0.6876458", "0.68691105", "0.686294", "0.6856342", "0.68464416", "0.6845293", "0.683875", "0.6837254", "0.68307006", "0.6815506", "0.6812683", "0.68099743", "0.6806342", "0.6806289", "0.68029517", "0.68029517", "0.68029517", "0.68029517", "0.68029517", "0.68029517", "0.68029517", "0.6786822", "0.6775579", "0.6771023", "0.6767952", "0.6765882", "0.67600477", "0.6752147", "0.6750018", "0.6745669", "0.6743084", "0.6729371", "0.67220503", "0.67091674", "0.6708447", "0.670241", "0.66990983", "0.66846347", "0.66846347", "0.66846347", "0.6681174", "0.66798633", "0.66798633", "0.66798633", "0.66798633", "0.66798633", "0.66798633", "0.66798633", "0.66798633", "0.66798633", "0.66721463" ]
0.0
-1
! vuex v3.5.1 (c) 2020 Evan You
function n(t){var e=Number(t.version.split(".")[0]);if(e>=2)t.mixin({beforeCreate:i});else{var n=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[i].concat(t.init):i,n.call(this,t)}}function i(){var t=this.$options;t.store?this.$store="function"===typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFieldVuex() {\n return store.getters.dataField;\n }", "getProfileVuex() {\n return store.getters.dataProfile;\n }", "function vuexInit(){var options=this.$options;// store injection\n\tif(options.store){this.$store=options.store;}else if(options.parent&&options.parent.$store){this.$store=options.parent.$store;}}", "function U(He){Le&&(He._devtoolHook=Le,Le.emit('vuex:init',He),Le.on('vuex:travel-to-state',function(Ne){He.replaceState(Ne)}),He.subscribe(function(Ne,je){Le.emit('vuex:mutation',Ne,je)}))}", "function vuexInit() {\n\t var options = this.$options;\n\t var store = options.store;\n\t var vuex = options.vuex;\n\t // store injection\n\t\n\t if (store) {\n\t this.$store = store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t // vuex option handling\n\t if (vuex) {\n\t if (!this.$store) {\n\t console.warn('[vuex] store not injected. make sure to ' + 'provide the store option in your root component.');\n\t }\n\t var state = vuex.state;\n\t var getters = vuex.getters;\n\t var actions = vuex.actions;\n\t // handle deprecated state option\n\t\n\t if (state && !getters) {\n\t console.warn('[vuex] vuex.state option will been deprecated in 1.0. ' + 'Use vuex.getters instead.');\n\t getters = state;\n\t }\n\t // getters\n\t if (getters) {\n\t options.computed = options.computed || {};\n\t for (var key in getters) {\n\t defineVuexGetter(this, key, getters[key]);\n\t }\n\t }\n\t // actions\n\t if (actions) {\n\t options.methods = options.methods || {};\n\t for (var _key in actions) {\n\t options.methods[_key] = makeBoundAction(this.$store, actions[_key], _key);\n\t }\n\t }\n\t }\n\t }", "function vuexlocal() {\n return store => {\n // 判断是否有本地缓存如果有就取本地缓存的如果没有就取自身初始值\n let local = JSON.parse(localStorage.getItem('myVuex')) || store.replaceState(state)\n store.replaceState(local); // 替换state的数据\n store.subscribe((mutation,state) => { // 监听\n // 替换之前先取一次防止数据丢失\n let newstate = JSON.parse(JSON.stringify(state))\n localStorage.setItem('myVuex',JSON.stringify(newstate))\n })\n }\n}", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store\n\t }\n\t }", "users() {\n return this.$store.getters.users\n }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = typeof options.store === 'function'\n\t ? options.store()\n\t : options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\r\n var options = this.$options;\r\n // store injection\r\n if (options.store) {\r\n this.$store = typeof options.store === 'function'\r\n ? options.store()\r\n : options.store;\r\n } else if (options.parent && options.parent.$store) {\r\n this.$store = options.parent.$store;\r\n }\r\n }", "getTokenVuex() {\n return store.getters.jwt;\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }" ]
[ "0.67587286", "0.67122144", "0.6688526", "0.6349349", "0.6322197", "0.6264196", "0.6259897", "0.6259897", "0.6259897", "0.62497246", "0.61534715", "0.6144857", "0.6078976", "0.6071553", "0.6071553", "0.6071553", "0.6071553", "0.6071553", "0.60639966", "0.60370344", "0.6036347", "0.59763974", "0.59763974", "0.59763974", "0.59763974", "0.59763974", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304", "0.59524304" ]
0.0
-1
! vuerouter v3.3.4 (c) 2020 Evan You
function i(t,e){0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "private internal function m248() {}", "function TM(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function BO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Es(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function version(){ return \"0.13.0\" }", "vampireWithName(name) {\n \n }", "function Qw(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Uk(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function iP(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function yh(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"graticule.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function fyv(){\n \n }", "function SigV4Utils() { }", "function cO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function vT(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "transient private internal function m185() {}", "function Wx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function ow(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "upgrade() {}", "function Ak(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Rb(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function dp(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function PD(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "transient final protected internal function m174() {}", "function jx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Ek(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function VI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "protected internal function m252() {}", "function Bv(e){let{basename:t,children:n,window:r}=e,l=X.exports.useRef();l.current==null&&(l.current=gv({window:r}));let o=l.current,[i,u]=X.exports.useState({action:o.action,location:o.location});return X.exports.useLayoutEffect(()=>o.listen(u),[o]),X.exports.createElement(Fv,{basename:t,children:n,location:i.location,navigationType:i.action,navigator:o})}", "function hA(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "transient protected internal function m189() {}", "function Bevy() {}", "function $S(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Hr(e,t){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "updated() {}", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "function vI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"style.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function JV(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function VO(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};VO.installed||(VO.installed=!0,t.use(i,e),t.use(r,e),t.use(o,e),t.use(a,e),t.use(s,e),t.use(u,e),t.use(l,e),t.use(c,e),t.use(d,e),t.use(h,e),t.use(f,e),t.use(p,e),t.use(m,e),t.use(v,e),t.use(g,e),t.use(_,e),t.use(y,e),t.use(b,e),t.use(x,e),t.use(w,e),t.use(A,e),t.use(M,e),t.use(S,e),t.use(T,e),t.use(k,e),t.use(O,e),t.use(C,e),t.use(L,e),t.use(E,e),t.use(D,e),t.use(j,e),t.use(I,e),t.use(P,e),t.use(Y,e),t.use(F,e),t.use(R,e),t.use(N,e),t.use(B,e),t.use($,e),t.use(z,e),t.use(H,e),t.use(V,e),t.use(G,e))}", "function uf(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "transient private protected internal function m182() {}", "added(vrobject){}", "function qv() {}", "function Vt(){this.__data__=[]}", "function test_candu_graphs_datastore_vsphere6() {}", "transient final private internal function m170() {}", "function __vue_normalize__(a,b,c,d,e){var f=(\"function\"==typeof c?c.options:c)||{};// For security concerns, we use only base name in production mode.\nreturn f.__file=\"/Users/hadefication/Packages/vue-chartisan/src/components/Pie.vue\",f.render||(f.render=a.render,f.staticRenderFns=a.staticRenderFns,f._compiled=!0,e&&(f.functional=!0)),f._scopeId=d,f}", "function WD(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "transient final private protected internal function m167() {}", "function i(t,e,n){if(o(t,e))return void(t[e]=n);if(t._isVue)return void i(t._data,e,n);var r=t.__ob__;if(!r)return void(t[e]=n);if(r.convert(e,n),r.dep.notify(),r.vms)for(var s=r.vms.length;s--;){var a=r.vms[s];a._proxy(e),a._digest()}return n}", "function r(t,e,n){if(a(t,e))return void(t[e]=n);if(t._isVue)return void r(t._data,e,n);var i=t.__ob__;if(!i)return void(t[e]=n);if(i.convert(e,n),i.dep.notify(),i.vms)for(var s=i.vms.length;s--;){var o=i.vms[s];o._proxy(e),o._digest()}return n}", "function v71(v72) {\n }", "function comportement (){\n\t }", "function vB_PHP_Emulator()\n{\n}", "function ea(){}", "function zC(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function v77(v78,v79,v80,v81,v82) {\n }", "static transient final private internal function m43() {}", "function EN(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function iT(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function vinewx(t=\"untitled\",s=!1){return new class{constructor(t,s){this.name=t,this.debug=s,this.isQX=\"undefined\"!=typeof $task,this.isLoon=\"undefined\"!=typeof $loon,this.isSurge=\"undefined\"!=typeof $httpClient&&!this.isLoon,this.isNode=\"function\"==typeof require,this.isJSBox=this.isNode&&\"undefined\"!=typeof $jsbox,this.node=(()=>this.isNode?{request:\"undefined\"!=typeof $request?void 0:require(\"request\"),fs:require(\"fs\")}:null)(),this.cache=this.initCache(),this.log(`INITIAL CACHE:\\n${JSON.stringify(this.cache)}`),Promise.prototype.delay=function(t){return this.then(function(s){return((t,s)=>new Promise(function(e){setTimeout(e.bind(null,s),t)}))(t,s)})}}get(t){return this.isQX?(\"string\"==typeof t&&(t={url:t,method:\"GET\"}),$task.fetch(t)):new Promise((s,e)=>{this.isLoon||this.isSurge?$httpClient.get(t,(t,i,o)=>{t?e(t):s({status:i.status,headers:i.headers,body:o})}):this.node.request(t,(t,i,o)=>{t?e(t):s({...i,status:i.statusCode,body:o})})})}post(t){return this.isQX?(\"string\"==typeof t&&(t={url:t}),t.method=\"POST\",$task.fetch(t)):new Promise((s,e)=>{this.isLoon||this.isSurge?$httpClient.post(t,(t,i,o)=>{t?e(t):s({status:i.status,headers:i.headers,body:o})}):this.node.request.post(t,(t,i,o)=>{t?e(t):s({...i,status:i.statusCode,body:o})})})}initCache(){if(this.isQX)return JSON.parse($prefs.valueForKey(this.name)||\"{}\");if(this.isLoon||this.isSurge)return JSON.parse($persistentStore.read(this.name)||\"{}\");if(this.isNode){const t=`${this.name}.json`;return this.node.fs.existsSync(t)?JSON.parse(this.node.fs.readFileSync(`${this.name}.json`)):(this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:\"wx\"},t=>console.log(t)),{})}}persistCache(){const t=JSON.stringify(this.cache);this.log(`FLUSHING DATA:\\n${t}`),this.isQX&&$prefs.setValueForKey(t,this.name),(this.isLoon||this.isSurge)&&$persistentStore.write(t,this.name),this.isNode&&this.node.fs.writeFileSync(`${this.name}.json`,t,{flag:\"w\"},t=>console.log(t))}write(t,s){this.log(`SET ${s} = ${JSON.stringify(t)}`),this.cache[s]=t,this.persistCache()}read(t){return this.log(`READ ${t} ==> ${JSON.stringify(this.cache[t])}`),this.cache[t]}delete(t){this.log(`DELETE ${t}`),delete this.cache[t],this.persistCache()}notify(t,s,e,i){const o=\"string\"==typeof i?i:void 0,n=e+(null==o?\"\":`\\n${o}`);this.isQX&&(void 0!==o?$notify(t,s,e,{\"open-url\":o}):$notify(t,s,e,i)),this.isSurge&&$notification.post(t,s,n),this.isLoon&&$notification.post(t,s,e),this.isNode&&(this.isJSBox?require(\"push\").schedule({title:t,body:s?s+\"\\n\"+e:e}):console.log(`${t}\\n${s}\\n${n}\\n\\n`))}log(t){this.debug&&console.log(t)}info(t){console.log(t)}error(t){console.log(\"ERROR: \"+t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){this.isQX||this.isLoon||this.isSurge?$done(t):this.isNode&&!this.isJSBox&&\"undefined\"!=typeof $context&&($context.headers=t.headers,$context.statusCode=t.statusCode,$context.body=t.body)}}(t,s)}", "__previnit(){}", "function Eu(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function Jb(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"style.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}" ]
[ "0.6006168", "0.5910948", "0.58579415", "0.58024395", "0.5760202", "0.572362", "0.56569654", "0.5647048", "0.5646177", "0.56405777", "0.562393", "0.55948853", "0.5549056", "0.5530102", "0.5519", "0.54926825", "0.54880124", "0.5483679", "0.5471095", "0.54508156", "0.5450005", "0.54181725", "0.5404357", "0.540363", "0.5401573", "0.53986394", "0.53769386", "0.53553635", "0.53443545", "0.5338198", "0.5325552", "0.53183126", "0.53123766", "0.5311129", "0.53016424", "0.52846473", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5282586", "0.5268836", "0.5268652", "0.52606165", "0.52562267", "0.5239273", "0.52220875", "0.5201189", "0.5188895", "0.51785594", "0.5163819", "0.5158636", "0.5140287", "0.51386136", "0.5137695", "0.5136932", "0.5133659", "0.51272464", "0.51156473", "0.5112925", "0.5111955", "0.5105522", "0.51038206", "0.5102529", "0.5098086", "0.5094744", "0.5078673", "0.5076196", "0.5074749" ]
0.0
-1